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
+8 -7
View File
@@ -34,7 +34,7 @@ dials out and publishes no port; see "Cloudflare Tunnel" in §3.
--------------------------------------------- (same container
| | | | | | as icecast2)
v v v v v v |
/api/ /radio/ /gitea/ /sb/ /notes/ /py/ |
/api/ /radio/ /v2/ /sb/ /notes/ /py/ |
backend icecast2 gitea sb sb-pub python |
| ^ |
| | |
@@ -60,7 +60,7 @@ everything that reached Gitea on stpvm still does at the same address:
```
stpvm Gitea LXC (LAN IP)
caddy /gitea/, /v2/ --+ +------------------+
caddy /v2/ (apex) ----+ +------------------+
backend feed ----------+--> gitea:3000 (haproxy) ---> | gitea :3000 |
usaco pulls -----------+ :2222 ------------> | :2222 |
runner, Renovate localhost:3000 | gitea-db |
@@ -69,6 +69,9 @@ everything that reached Gitea on stpvm still does at the same address:
over the LAN)
```
Gitea's public address is `https://git.<DOMAIN>/` (its `ROOT_URL`), served by
the LXC's own Cloudflare tunnel, not by this edge; Caddy only 301s the old
`/gitea/*` URLs there and still proxies the registry at the apex's `/v2/`.
The LXC is also on the tailnet, so a laptop can use its own name directly.
Deploys of this stack never restart Gitea; recreating the forwarder only
drops connections in flight.
@@ -87,7 +90,7 @@ drops connections in flight.
| jobs (job tracker, published image) | `jobs` | 8080 | `/jobs/` (admin-gated by Caddy `forward_auth`; capture API and userscript public, bearer-token) | no |
| activity-tracker (published image, adamf/ccp) | `activity-tracker` | 8080 | `/tracker/`, prefix stripped (pages admin-gated by Caddy `forward_auth`; `/api/v1/` bearer/app-checked) | no |
| icecast2 + liquidsoap | `${ICECAST_HOST}` | `${ICECAST_PORT}` | `/radio/` | **harbor port only** |
| gitea (haproxy forwarder to the Gitea LXC) | `${GITEA_HOST}` | 3000, 2222 | `/gitea/`, and the registry at the apex `/v2/` | **3000, 2222** |
| gitea (haproxy forwarder to the Gitea LXC) | `${GITEA_HOST}` | 3000, 2222 | the registry at the apex `/v2/` (`/gitea/*` 301s to `git.<DOMAIN>`) | **3000, 2222** |
| vue | `vue` | 5173 (dev only) | `/` (dev only) | no |
| cloudflared | `cloudflared` | — (fixed IP `172.28.255.250`) | all of Caddy, via Cloudflare | no (outbound only) |
| dozzle (log viewer) | `dozzle` | 8080 | `/dozzle/` (admin-gated by Caddy `forward_auth`; reads the Docker socket) | no |
@@ -123,9 +126,7 @@ The config is `caddy/Caddyfile` (global options and snippets), `caddy/routes.cad
it, so stripping the prefix serves a blank page with nothing in the log).
- **Upstreams resolve when dialled.** Caddy starts with any upstream container
missing and answers 502 until it appears; it never refuses to start over one.
- **Admin gate.** `/sb/`, `/jobs/`, `/tracker/`, `/dozzle/`, `/garage/`, `/radio/admin/`, `/uploads/private/` and
Gitea's history views and archives (`…/commit/`, `…/src/commit/`, `…/blame/commit/`, `…/archive/`, `…/compare/`; the
branch views stay public) are
- **Admin gate.** `/sb/`, `/jobs/`, `/tracker/`, `/dozzle/`, `/garage/`, `/radio/admin/` and `/uploads/private/` are
protected by `forward_auth` to the backend's `/auth/validate-admin` (the
`admin_gate` snippet); a 401/403 redirects to the SPA login. Most of these services have no auth of their own at that path; the
job and activity trackers also check the session themselves. Their carve-outs, which a session
@@ -701,7 +702,7 @@ nothing, so pull and `up -d` there afterwards.
- *Backups.* A Proxmox `vzdump` of the whole LXC covers the git data and the
database together. `data/` alone is not a backup: the issues, PRs,
users and registry index are in `gitea_db`.
- *If it is down,* `/gitea/` and the registry are 502, CI does not run, and
- *If it is down,* `git.<DOMAIN>` is a Cloudflare error, the registry is 502, CI does not run, and
image pulls fail; the site itself keeps serving.
- *Moving it again* (or the first move, from stpvm): stop Gitea, `pg_dump -Fc`
its database and restore it with `pg_restore --no-owner --role=gitea` into