ops: give Forgejo its own access log, not watched by threatcrushd

Crawlers browsing repo files (.env.example, package.json, .gitignore under /<owner>/<repo>/src/commit/<sha>/) tripped the web sensitive-file rule, and threatcrushd auto-banned 63 crawler IPs from git within minutes of watching the shared log. git.<root> 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 <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-11-30 09:37:05 +00:00
parent 9a7b2d0df6
commit 12dc34993f

View file

@ -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 <<CADDY
}
}
# Forgejo gets its own log that threatcrushd does NOT watch. Crawlers browse
# repo files all day (.../src/commit/<sha>/.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