First public release. - docs: document the audit log, user offboarding, CSV export and the "require a reason for destructive actions" setting across README, docs/ and CLAUDE/AGENTS.md; note retention for panel_audit - docs: fill the publishing placeholders (repo URL, security contact, issue-template links) and add a semantic-versioning policy - move agent/contributor context into CLAUDE/ (AGENTS.md + a README); root CLAUDE.md is now a thin @-import pointer - add a favicon (shield-lock, matching the login screen) to the login page and the app layout - CHANGELOG: promote [Unreleased] to [1.0.0]; keep the earlier internal build as [0.1.0] Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UfuvfwexztdS7LDpGuKsuK
39 lines
1.1 KiB
Bash
39 lines
1.1 KiB
Bash
#!/bin/sh
|
|
# First-run bootstrap for the ADconsole container. The project is bind-mounted,
|
|
# so a fresh `git clone` has no vendor/ and no APP_KEY yet - handle both here so
|
|
# `docker compose up` just works. Safe to run on every start (all steps are
|
|
# idempotent).
|
|
set -e
|
|
|
|
cd /var/www/html
|
|
|
|
if [ ! -f .env ]; then
|
|
echo "[adconsole] .env is missing - copy .env.example to .env and fill it in." >&2
|
|
exit 1
|
|
fi
|
|
|
|
# 1. PHP dependencies.
|
|
if [ ! -f vendor/autoload.php ]; then
|
|
echo "[adconsole] installing composer dependencies..."
|
|
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
|
|
fi
|
|
|
|
# 2. Application key.
|
|
if ! grep -qE '^APP_KEY=.+' .env; then
|
|
echo "[adconsole] generating APP_KEY..."
|
|
php artisan key:generate --force
|
|
fi
|
|
|
|
# 3. Writable paths (bind-mounted repo is owned by the host user).
|
|
chown -R www-data:www-data storage bootstrap/cache 2>/dev/null || true
|
|
|
|
# 4. Database schema + storage symlink.
|
|
php artisan migrate --force
|
|
php artisan storage:link 2>/dev/null || true
|
|
|
|
# 5. Framework caches (config/route/view/event). Refreshed on every boot.
|
|
php artisan optimize:clear
|
|
php artisan optimize
|
|
|
|
exec "$@"
|