A spare-machine Gitea forge, hardened, backed up and with CI, as a template. Personal values are placeholders listed in the README.
2.4 KiB
2.4 KiB
type, purpose, answers, cites
| type | purpose | answers | cites | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Architecture | Map the services, their seams, and how outside traffic reaches each one. |
|
|
Mithlond — architecture
Request path
Internet
│
├─ :443 (HTTPS) ──► Router ──► :443 host ──► Caddy ──► git.example.com → gitea:3000
│ └────► example.com → portfolio:8000 (optional)
├─ :80 (ACME) ──► Router ──► :80 host ──► Caddy
├─ :2222 (SSH) ──► Router ──► :2222 host ──► Gitea container :22
└─ :2234 (admin)──► LAN only (not forwarded) ──► sshd (Arch host)
DNS: git.example.com and example.com A → home IP (Cloudflare, DNS-only)
DDNS: ddclient on the host updates both A records via the Cloudflare API
Services
- gitea (
compose.yml:gitea) —gitea/gitea:1.23, SQLite. State in the bind-mount./gitea-data/→/data. Web on127.0.0.1:3000only, so the web UI is reachable from outside only through Caddy; SSH on0.0.0.0:2222. Hardening and registration lock are env vars, which win overapp.inion every start (compose.yml:GITEA__service__DISABLE_REGISTRATION). - caddy (
compose.yml:caddy) — owns 80/443, TLS from Let's Encrypt, certificates in./caddy-data/. One site block per name (Caddyfile). - runner (
compose.yml:runner) —gitea/act_runner, polls Gitea over HTTPS and starts each job as a sibling container through the host Docker socket. One job at a time, labelalpine(runner/config.yaml:capacity).
Seams
edgenetwork (compose.yml:external: true) — shared with an optional apex-site stack (e.g. a portfolio), which joins it from its own compose file. That site ships no proxy; theexample.comblock inCaddyfileis the only thing in front of it.- Env over
app.ini— Gitea config that must stay put lives incompose.yml;docker compose up -dre-applies it. - Backup boundary —
gitea-data/is the only state that matters. The nightlygitea-backup.timerrunsscripts/gitea-backup, which stops Gitea, snapshots that directory into restic on the backup drive, and starts it again. Caddy keeps serving the apex while Gitea is stopped.