diff --git a/scripts/update.sh b/scripts/update.sh index 8750ca9..b45350b 100644 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -159,13 +159,21 @@ _sudoers_add(){ chmod 440 "$file" } fix_permissions(){ + # Eigentümer + Gruppe korrigieren chown -R "${APP_USER}:${APP_GROUP}" \ "${APP_DIR}/bootstrap/cache" \ "${APP_DIR}/storage" \ "${APP_DIR}/public/build" 2>/dev/null || true + # Gruppe Schreibrecht + setgid (neue Dateien erben Gruppe automatisch) chmod -R ug+rwX \ "${APP_DIR}/bootstrap/cache" \ "${APP_DIR}/storage" 2>/dev/null || true + find "${APP_DIR}/bootstrap/cache" "${APP_DIR}/storage" \ + -type d -exec chmod g+s {} \; 2>/dev/null || true + # Cache als www-data (PHP-FPM-User) neu aufbauen → keine Rechteprobleme + sudo -u "${APP_GROUP}" php "${APP_DIR}/artisan" optimize:clear --quiet 2>/dev/null || true + sudo -u "${APP_GROUP}" php "${APP_DIR}/artisan" config:cache --quiet 2>/dev/null || true + sudo -u "${APP_GROUP}" php "${APP_DIR}/artisan" route:cache --quiet 2>/dev/null || true } ensure_system(){