From 52f8118ee5182c63494752292d2be745cd1266f8 Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Mon, 30 Nov 2026 01:38:00 -0800 Subject: [PATCH] ops: give Forgejo its own access log, not watched by threatcrushd (#182) Crawlers browsing repo files (.env.example, package.json, .gitignore under ///src/commit//) tripped the web sensitive-file rule, and threatcrushd auto-banned 63 crawler IPs from git within minutes of watching the shared log. git. now logs to git-access.log (kept for forensics); every other site stays on access.log. Already live on the box. Co-authored-by: Claude Opus 5.5 --- setup.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index bd1f9a5..977257e 100755 --- a/setup.sh +++ b/setup.sh @@ -847,7 +847,7 @@ if [ "$FORGEJO" = "1" ]; then GIT_SITE=" ${GIT_DOMAIN} { encode zstd gzip - import accesslog + import accesslog_git reverse_proxy http://${FORGEJO_HTTP_ADDR} } " @@ -977,6 +977,21 @@ cat > /etc/caddy/Caddyfile </.env.example, package.json), which +# the web rules read as sensitive-file probes: within minutes of watching it, +# 63 crawler IPs were auto-banned from git (2026-11-30). Kept for forensics. +(accesslog_git) { + log { + output file /var/log/caddy/git-access.log { + roll_size 50MiB + roll_keep 5 + roll_keep_for 720h + } + format json + } +} + ${DOMAIN} { encode zstd gzip import accesslog