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
+12 -8
View File
@@ -148,9 +148,6 @@ echo "# admin gate, signed out: must redirect to the login, with the original UR
for p in \
/sb/ /sb/index.html /jobs/ /jobs/api/graphql /tracker/ /tracker/dashboard \
/dozzle/ /garage/ /radio/admin/stats.xsl /uploads/private/x.png \
/gitea/adamf/web_server/commit/0000000 /gitea/adamf/web_server/src/commit/0000000/README.md \
/gitea/adamf/web_server/archive/main.tar.gz /gitea/adamf/web_server/compare/main...x \
/gitea/adamf/web_server/blame/commit/0000000/README.md \
"/jobs/leads?x=1"; do
must 302 "$LOGIN$p" gate "$p"
done
@@ -161,21 +158,29 @@ must 302 "${LOGIN}/receipt/" permission /receipt/
if [ -n "${EDGE_COOKIE:-}" ]; then
echo "# admin gate, signed in: must be let through"
for p in /sb/ /jobs/ /tracker/ /dozzle/ /garage/ /radio/admin/stats.xsl \
/gitea/adamf/web_server/commit/0000000 /receipt/; do
/receipt/; do
not_login gate "$p" -H "Cookie: $EDGE_COOKIE"
done
fi
echo "# carve-outs and public routes (status depends on the upstream)"
for p in /jobs/api/capture /jobs/job-capture.user.js /tracker/api/v1/events \
/tracker/tracker.user.js /tracker/readyz /usaco/ /notes/ /gitea/ \
/gitea/adamf/web_server/src/branch/main/README.md /radio/status.xsl \
/tracker/tracker.user.js /tracker/readyz /usaco/ /notes/ /radio/status.xsl \
/py/ /py/docs /api/ /api/me /; do
show public "$BASE$p"
done
echo "# Gitea moved to git.<domain>: every /gitea/ URL must 301 there, prefix dropped"
GIT_HOST=${BASE#*://}
GIT="https://git.${GIT_HOST#www.}"
must 301 "$GIT/" gitea /gitea
must 301 "$GIT/" gitea /gitea/
must 301 "$GIT/adamf/web_server/src/branch/main/README.md" gitea /gitea/adamf/web_server/src/branch/main/README.md
must 301 "$GIT/adamf/web_server.git/info/refs?service=git-upload-pack" gitea "/gitea/adamf/web_server.git/info/refs?service=git-upload-pack"
must 301 "$GIT/adamf/web_server/commit/0000000" gitea /gitea/adamf/web_server/commit/0000000
echo "# bare prefixes and moved URLs"
for p in /api /radio /dozzle /garage /gitea /notes /sb /py /jobs /usaco \
for p in /api /radio /dozzle /garage /notes /sb /py /jobs /usaco \
/tracker /receipt /cv/jobs /cv/leads /job-capture.user.js "/gitea?x=1"; do
show redirect "$BASE$p"
done
@@ -187,7 +192,6 @@ done
hdr "$BASE/" Content-Type Strict-Transport-Security X-Frame-Options \
X-Content-Type-Options Referrer-Policy Content-Security-Policy Server
hdr "$BASE/api/" Strict-Transport-Security X-Frame-Options Server
hdr "$BASE/gitea/" Strict-Transport-Security X-Frame-Options Server
hdr "$BASE/assets/does-not-exist.js" Cache-Control
hdr "$BASE/img/stamps/mine.gif" Access-Control-Allow-Origin Cache-Control