Redirect /gitea/ to git.DOMAIN instead of proxying Gitea
Test and deploy / test (push) Successful in 21s
Test and deploy / deploy (push) Successful in 8s

Gitea's ROOT_URL is now https://git.DOMAIN/, served by the Gitea LXC's own
tunnel, so Caddy stops proxying /gitea/ and 301s every /gitea/* URL there
with the prefix dropped and the query kept (CV links, HTTPS clones,
bookmarks). The admin gate on Gitea's commit-history views goes with the
proxy; on git.DOMAIN they are public by choice. The registry at the apex's
/v2/ is still proxied. edge_test.sh checks the redirects instead of the
gate, and the docs and architecture diagrams follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-24 17:21:13 +00:00
co-authored by Claude Opus 5.5
parent bb83c6bb03
commit 180f6ac8b8
7 changed files with 41 additions and 52 deletions
+11 -23
View File
@@ -111,7 +111,7 @@ redir {$BACKEND_ENDPOINT} {$BACKEND_ENDPOINT}/ 301
redir /radio /radio/ 301
redir /dozzle /dozzle/ 301
redir /garage /garage/ 301
redir /gitea /gitea/ 301
redir /gitea https://git.{$DOMAIN}/ 301
redir /notes /notes/ 301
redir /sb /sb/ 301
redir /py /py/ 301
@@ -215,23 +215,6 @@ handle /radio/admin/* {
}
}
# Gitea's history views and archives. A crawler swarm (129k requests from
# 103k IPs over 2026-10-18/19, so per-IP rate limits are useless) walks every
# file at every commit, and those pages are the expensive ones: diffs, blame,
# tarballs. 89% of its requests were these shapes. People browsing the code
# use the branch views (src/branch/..., commits/branch/...), which stay
# public, so the CV's repo links still work. Gitea's own
# REQUIRE_SIGNIN_VIEW=expensive would also block src/branch, hence doing it
# here. Ahead of /gitea/*.
@gitea_history path_regexp ^/gitea/[^/]+/[^/]+/((src|raw|blame|commits|media)/commit/|commit/|archive/|compare/)
handle @gitea_history {
import admin_gate
uri strip_prefix /gitea
reverse_proxy {$GITEA_HOST}:{$GITEA_PORT} {
import proxy
}
}
# SilverBullet: the admin-only EDITOR for the vault /notes/ publishes. NO
# prefix strip: it is a PWA told its own base path via SB_URL_PREFIX=/sb, and
# builds its service-worker scope and asset URLs from it. Strip the prefix and
@@ -252,11 +235,16 @@ handle /radio/* {
}
}
handle /gitea/* {
uri strip_prefix /gitea
reverse_proxy {$GITEA_HOST}:{$GITEA_PORT} {
import proxy
}
# Gitea moved to its own address on 2026-11-24: git.DOMAIN, served by the
# Gitea LXC's own Cloudflare tunnel (the adamf/stpgit repo), and its ROOT_URL.
# Every old link (the CV's, HTTPS clone URLs, bookmarks) is sent there with the
# prefix dropped and the query kept; git follows the redirect on a clone. This
# edge no longer proxies Gitea's pages, so the admin gate that used to sit on
# its commit-history views and archives (a crawler swarm walked them in
# 2026-10) went with it: on git.DOMAIN they are public by choice. The registry
# at the apex's /v2/ (sites/prod.caddy) is still proxied from here.
handle_path /gitea/* {
redir https://git.{$DOMAIN}{uri} 301
}
# The public notes viewer, behind the denials at the top of this file. No