gitea: only route GETs to Anubis on expensive paths #1162

Closed
JakeHillion wants to merge 1 commits from jj/rrzllvptvuko into main
pull from: jj/rrzllvptvuko
Owner

Submitting the PR creation form (POST to /:owner/:repo/compare/...) was
being intercepted by Anubis because the @expensive matcher in the gitea
vhost matched on path alone, regardless of method. Anubis would respond
with a challenge HTML page; the form navigation then rendered the
challenge, but solving it issues a GET redirect back to the original
URL, dropping the POST body. The form was unsubmittable.

Restricted the @expensive matcher to GET and HEAD. Scrapers - the
intended target of the Anubis gate - only ever GET these paths, so
nothing they do escapes the gate; POSTs (PR creation, etc.) now fall
through to gitea directly.

Test plan:

  • CI
  • create a PR via the web UI on gitea.hillion.co.uk and confirm the
    form submits without an Anubis interstitial
Submitting the PR creation form (POST to /:owner/:repo/compare/...) was being intercepted by Anubis because the @expensive matcher in the gitea vhost matched on path alone, regardless of method. Anubis would respond with a challenge HTML page; the form navigation then rendered the challenge, but solving it issues a GET redirect back to the original URL, dropping the POST body. The form was unsubmittable. Restricted the @expensive matcher to GET and HEAD. Scrapers - the intended target of the Anubis gate - only ever GET these paths, so nothing they do escapes the gate; POSTs (PR creation, etc.) now fall through to gitea directly. Test plan: - CI - create a PR via the web UI on gitea.hillion.co.uk and confirm the form submits without an Anubis interstitial
JakeHillion added 1 commit 2026-06-08 20:59:49 +01:00
gitea: only route GETs to Anubis on expensive paths
commit-validation / validate-single-commit (pull_request) Successful in 8s
buildbot/nix-eval Build done. (881 warnings)
buildbot/nix-build Build done.
0e4c7a2f1e
Submitting the PR creation form (POST to /:owner/:repo/compare/...) was
being intercepted by Anubis because the @expensive matcher in the gitea
vhost matched on path alone, regardless of method. Anubis would respond
with a challenge HTML page; the form navigation then rendered the
challenge, but solving it issues a GET redirect back to the original
URL, dropping the POST body. The form was unsubmittable.

Restricted the @expensive matcher to GET and HEAD. Scrapers - the
intended target of the Anubis gate - only ever GET these paths, so
nothing they do escapes the gate; POSTs (PR creation, etc.) now fall
through to gitea directly.

Test plan:
- CI
- create a PR via the web UI on gitea.hillion.co.uk and confirm the
  form submits without an Anubis interstitial
Author
Owner

This actually went away, but will keep this in the back pocket in case it shows up again.

This actually went away, but will keep this in the back pocket in case it shows up again.
JakeHillion closed this pull request 2026-06-08 21:00:24 +01:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JakeHillion/nixos#1162