mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
fix: RateLimit permission denied — code + deploy scripts
RateLimit.php: - Silence mkdir() with @ operator - Guard file_put_contents with is_writable() check (graceful degrade) scripts/deploy-server.sh + setup-server.sh: - mkdir -p storage/cache/rate_limit on every deploy - chown www-data:posterg + chmod 2775 on storage/cache/ so php-fpm can always write rate limit files
This commit is contained in:
@@ -25,7 +25,7 @@ printf "==================================\n\n"
|
||||
|
||||
# ── Step 1: Permissions ───────────────────────────────────────────────────────
|
||||
printf "📋 Step 1: Fixing file permissions...\n"
|
||||
printf "--------------------------------------\n"
|
||||
echo "--------------------------------------"
|
||||
|
||||
chown -R www-data:posterg /var/www/posterg/
|
||||
ok "Ownership: www-data:posterg"
|
||||
@@ -50,7 +50,7 @@ ok "Cache dirs: created and owned by www-data:posterg"
|
||||
|
||||
# ── Step 2: Nginx config ──────────────────────────────────────────────────────
|
||||
printf "\n📋 Step 2: Deploying nginx configuration...\n"
|
||||
printf "--------------------------------------------\n"
|
||||
echo "--------------------------------------------"
|
||||
|
||||
if [ ! -f "/tmp/posterg.conf" ]; then
|
||||
err "/tmp/posterg.conf not found — run: just deploy-nginx"
|
||||
@@ -73,7 +73,7 @@ fi
|
||||
|
||||
# ── Step 3: Validate ──────────────────────────────────────────────────────────
|
||||
printf "\n📋 Step 3: Testing nginx configuration...\n"
|
||||
printf "------------------------------------------\n"
|
||||
echo "------------------------------------------"
|
||||
|
||||
if nginx -t 2>&1; then
|
||||
ok "Nginx configuration is valid"
|
||||
|
||||
Reference in New Issue
Block a user