Fix: artisan cache-Befehle in apply-domains als App-User statt root

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main v1.1.301
boban 2026-04-26 18:37:49 +02:00
parent 81f1c9512a
commit 29566499f9
1 changed files with 5 additions and 2 deletions

View File

@ -338,8 +338,11 @@ if [ -n "${UI_HOST}" ] && [ -f "${ENV_FILE}" ]; then
cd "${APP_DIR}" && npm run build --silent 2>/dev/null || true
fi
# Laravel-Caches leeren
php "${APP_DIR}/artisan" optimize:clear --quiet 2>/dev/null || true
# Laravel-Caches leeren (als App-User, nicht root)
APP_USER=$(stat -c '%U' "${APP_DIR}/artisan" 2>/dev/null || echo "www-data")
su -s /bin/sh "${APP_USER}" -c "php '${APP_DIR}/artisan' optimize:clear --quiet" 2>/dev/null || true
su -s /bin/sh "${APP_USER}" -c "php '${APP_DIR}/artisan' config:cache --quiet" 2>/dev/null || true
su -s /bin/sh "${APP_USER}" -c "php '${APP_DIR}/artisan' route:cache --quiet" 2>/dev/null || true
fi
if nginx -t 2>/dev/null; then