Reach Gitea as git.DOMAIN on the LAN and drop the forwarder
Everything on stpvm now reaches the Gitea LXC by its own name, GITEA_HOST (git.DOMAIN), pinned to its LAN IP: by extra_hosts in caddy, backend, usaco and silverbullet-git, and by /etc/hosts on the host for the runner, CI and Renovate. Public DNS for that name is Cloudflare, which only carries HTTPS, so the pin is what makes :3000 and :2222 work. The haproxy forwarder that kept localhost:3000/2222 working is gone, so stpvm no longer publishes those ports. The deploy and Renovate workflows and the runner script use the new name; the docs and the rollback notes follow. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+20
-15
@@ -13,8 +13,8 @@ network, behind one Caddy (nginx and certbot until 2026-11-17).
|
||||
|
||||
## 1. Service topology
|
||||
|
||||
Only three things are reachable from outside the host: Caddy on 80/443, Gitea on
|
||||
3000/2222 (a forwarder to the Gitea LXC, below), and the liquidsoap harbor port. Everything else is internal. Web
|
||||
Only two things are reachable from outside the host: Caddy on 80/443 and the
|
||||
liquidsoap harbor port. (Gitea, below, is on its own LXC.) Everything else is internal. Web
|
||||
traffic can also come in through the Cloudflare tunnel (`cloudflared`), which
|
||||
dials out and publishes no port; see "Cloudflare Tunnel" in §3.
|
||||
|
||||
@@ -54,27 +54,33 @@ backend icecast2 gitea sb sb-pub python |
|
||||
Gitea (git, Actions, the image registry) is not in this stack. It runs on a
|
||||
separate Proxmox LXC, from its own repo (`adamf/stpgit`), with its own Postgres
|
||||
(`gitea-db`); the runbook is that repo's README, summarised in "Gitea LXC" in §7.
|
||||
The `gitea` service here is an haproxy TCP forwarder (`gitea-forwarder/haproxy.cfg`) from this host's 3000 and
|
||||
2222 to the LXC's LAN IP (`GITEA_UPSTREAM`), under the old container name, so
|
||||
everything that reached Gitea on stpvm still does at the same address:
|
||||
Everything here reaches it by one name, `GITEA_HOST`
|
||||
(`git.<DOMAIN>`), pinned to the LXC's LAN IP (`GITEA_UPSTREAM`): in
|
||||
containers by `extra_hosts`, and on the host by a line in `/etc/hosts`. Public
|
||||
DNS for that name points at Cloudflare, which carries only HTTPS, so without
|
||||
the pin SSH and port 3000 would go nowhere. (Until 2026-11-24 an haproxy
|
||||
forwarder here published 3000/2222 and everything used `localhost`.)
|
||||
|
||||
```
|
||||
stpvm Gitea LXC (LAN IP)
|
||||
stpvm (pin: git.DOMAIN -> LAN IP) Gitea LXC (LAN IP)
|
||||
caddy /v2/ (apex) ----+ +------------------+
|
||||
backend feed ----------+--> gitea:3000 (haproxy) ---> | gitea :3000 |
|
||||
usaco pulls -----------+ :2222 ------------> | :2222 |
|
||||
runner, Renovate localhost:3000 | gitea-db |
|
||||
CI, obsidian localhost:2222 / DOMAIN:2222 +--------+---------+
|
||||
backend feed ----------+--> git.DOMAIN:3000 --------> | gitea :3000 |
|
||||
usaco pulls -----------+ | |
|
||||
runner, Renovate git.DOMAIN:3000 (/etc/hosts) ----> | |
|
||||
CI, silverbullet-git, obsidian git.DOMAIN:2222 ----> | :2222 |
|
||||
| gitea-db |
|
||||
usaco <-- caddy <-- https://www.DOMAIN/usaco/api/hooks/gitea --+ (webhook,
|
||||
over the LAN)
|
||||
```
|
||||
|
||||
A new machine or container that talks to Gitea needs the same pin, or a
|
||||
`~/.ssh/config` entry pointing the name at the tailnet name `stpgit` for SSH.
|
||||
|
||||
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.
|
||||
Deploys of this stack never touch Gitea.
|
||||
|
||||
### Who listens where
|
||||
|
||||
@@ -90,7 +96,6 @@ 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 | 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 |
|
||||
@@ -188,8 +193,8 @@ which has two jobs:
|
||||
leaves the old containers running.
|
||||
- **`deploy`** runs only on `main`, only after `test` passes, and only if the
|
||||
tested commit is still the tip of `main` (so an older run cannot deploy a
|
||||
newer, untested commit). It fetches over `ssh://git@localhost:2222` (the
|
||||
forwarder to the Gitea LXC),
|
||||
newer, untested commit). It fetches over `ssh://git@git.<DOMAIN>:2222` (Gitea
|
||||
on its LXC, pinned in `/etc/hosts`),
|
||||
hard-resets the deploy checkout, and runs
|
||||
`docker compose up -d --build --remove-orphans` under the
|
||||
`.compose.lock` flock, shared with the weekly maintenance workflow.
|
||||
|
||||
Reference in New Issue
Block a user