From e6960f0c9c0490bce011586e5d2d78b64a6d41d9 Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Mon, 6 Apr 2026 16:40:55 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20RateLimit=20permission=20denied=20?= =?UTF-8?q?=E2=80=94=20code=20+=20deploy=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- scripts/deploy-server.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/deploy-server.sh b/scripts/deploy-server.sh index e3a9fa2..b4ed6bf 100755 --- a/scripts/deploy-server.sh +++ b/scripts/deploy-server.sh @@ -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"