From 0e3a3b4b0e8d4d3b1c3012dabdba31214027f2ff Mon Sep 17 00:00:00 2001 From: BergaBruh Date: Tue, 5 May 2026 21:12:54 +0500 Subject: [PATCH] fix(stats-site): chmod 755/644 in TMP before rsync (nginx 403 fix) --- stats-site/build.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stats-site/build.sh b/stats-site/build.sh index 44b2061..7505134 100755 --- a/stats-site/build.sh +++ b/stats-site/build.sh @@ -29,7 +29,12 @@ sed \ -e "s|{{ \.Site\.Params\.description }}|${SITE_DESC}|g" \ "$SRC/layouts/index.html" > "$TMP/index.html" -# 3. Atomic rsync, preserving runtime data (snapshot.json) and ownership. +# 3. Set perms in TMP that nginx (www-data) can read. mktemp creates 700; +# --archive in rsync preserves them, leading to 403s in nginx logs. +find "$TMP" -type d -exec chmod 0755 {} + +find "$TMP" -type f -exec chmod 0644 {} + + +# 4. Atomic rsync, preserving runtime data (snapshot.json) and ownership. # --delete removes files in DEST that aren't in TMP (cleans old assets), # --exclude protects data/ (snapshot generator owns that). rsync -a --delete \