caddy: refuse the AI crawler that pegged forgejo - #1448
Merged
Conversation
aaylward
force-pushed
the
forgejo-crawler-guards
branch
from
August 24, 2026 21:37
dfddaec to
61b8489
Compare
meta-externalagent held forgejo against its 0.5-CPU cap for hours, crawling the git-backed routes from ~70 addresses in 57.141.0.0/16. robots.txt is not the lever: Forgejo serves one disallowing /*/*/src/ and /user/, and the crawler requests both anyway. git.muchq.com now 403s that User-Agent, that subnet, and any self-identified crawler on the six routes that fork git.
aaylward
force-pushed
the
forgejo-crawler-guards
branch
from
August 24, 2026 21:41
61b8489 to
ebccae3
Compare
aaylward
enabled auto-merge (squash)
August 24, 2026 21:52
aaylward
disabled auto-merge
August 24, 2026 21:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1447, which has the analysis and the logs.
git.muchq.comnow 403s themeta-externalagentUser-Agent,57.141.0.0/16, and any self-identified crawler on the six routes that fork git. The first two overlap on purpose — the agent self-identifies today and may stop, the range is Meta's today and may move.Replaying the 23,788 requests from the incident windows against the rules refuses 23,670 of them and removes 53,117 of 53,120 server-seconds; what survives is browser assets and issue pages, and no browser User-Agent matches. Only HTTP is affected — git over SSH reaches Forgejo on port 222 without passing through Caddy.
Deliberately left open:
/issues/and/raw/, a database read and a file read, worth more indexed than blocked. The Postgres suites skipped locally with the URLs unset, so CI is their first run.