Move gitea/ to its own repo, adamf/stpgit
Test and deploy / test (push) Successful in 21s
Test and deploy / deploy (push) Successful in 13s

The Gitea LXC's compose file, entrypoint, app.ini template and env example
now live in adamf/stpgit, which the LXC checks out instead of this repo.
What stays here is stpvm's side: the haproxy forwarder, renamed to
gitea-forwarder/haproxy.cfg, and a copy of the entrypoint in
.deprecated/gitea/ so the stpvm rollback does not depend on the new repo.
Renovate now also covers adamf/stpgit, and the docs point there.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-24 16:52:55 +00:00
co-authored by Claude Opus 5.5
parent fc777ba8b2
commit bb83c6bb03
15 changed files with 41 additions and 374 deletions
+23 -21
View File
@@ -52,9 +52,9 @@ backend icecast2 gitea sb sb-pub python |
### Gitea runs in its own LXC
Gitea (git, Actions, the image registry) is not in this stack. It runs on a
separate Proxmox LXC, from `gitea/docker-compose.yml`, with its own Postgres
(`gitea-db`); the runbook is "Gitea LXC" in §7. The `gitea` service here is
an haproxy TCP forwarder (`gitea/forwarder.cfg`) from this host's 3000 and
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:
@@ -420,8 +420,8 @@ of deleting the directory:
| `./icecast2/fallback_music` | Radio fallback MP3s | Copied to the host by hand, not git |
| `${OBSIDIAN_DIR}` | The Obsidian vault (a git clone of the notes repo) | Read-write to backend and silverbullet, **read-only** to silverbullet-public |
Gitea's state (`gitea/data`, `gitea/config`, the `gitea_db` volume) is on
the Gitea LXC, not here; see "Gitea LXC" in §7. The pre-move copy is in
Gitea's state (`data/`, `config/` and the `gitea_gitea_db` volume, in the
`adamf/stpgit` checkout) is on the Gitea LXC, not here; see "Gitea LXC" in §7. The pre-move copy is in
stpvm's `.deprecated/gitea/` (gitignored), kept as the rollback.
**Ephemeral:** anything else inside a container. Notably the Vue build, the
@@ -442,7 +442,8 @@ Two distinct mechanisms read it, and services use both:
- **`env_file: ./.env`** — injects the whole file into the container. Used by
backend, db and icecast2.
Gitea's own variables are in `gitea/.env` on the Gitea LXC (`gitea/.env.example`);
Gitea's own variables are in the `.env` of its checkout on the Gitea LXC (the
`adamf/stpgit` repo's `.env.example`);
there it receives explicit `GITEA__section__KEY` variables (Gitea's own
convention for overriding `app.ini` keys). Here, `python` receives an explicit
allow-list (as do `jobs`, `caddy` and the rest), so it never sees the database password or any API key other than
@@ -677,39 +678,40 @@ Back up `garage_meta` and `garage_data` together (meta without data, or the
reverse, is useless); Garage also snapshots its metadata every 6h inside
`garage_meta`.
**Gitea LXC.** Gitea runs in its own Proxmox LXC (§1), from
`gitea/docker-compose.yml` in a checkout of this repo, with its secrets in
`gitea/.env`. It is deployed by hand, never by CI:
**Gitea LXC.** Gitea runs in its own Proxmox LXC (§1), from a checkout of its
own repo, `adamf/stpgit` (until 2026-11-24 this repo's `gitea/` directory),
with its secrets in that checkout's `.env`. Its README is the full runbook.
It is deployed by hand, never by CI:
```
cd ~/deploy/web_server/gitea && git pull && docker compose up -d
cd ~/deploy/stpgit && git pull && docker compose up -d
```
That includes a Renovate PR that bumps its image: merging deploys stpvm, not
the LXC, so pull and `up -d` here afterwards.
That includes a Renovate PR to that repo that bumps an image: merging deploys
nothing, so pull and `up -d` there afterwards.
- *The container.* Debian, unprivileged, with `nesting=1,keyctl=1` (Docker
needs both), a static LAN IP on stpvm's bridge, Docker and Tailscale.
`GITEA_UPSTREAM` in stpvm's `.env` is that LAN IP; `GITEA_SSH_DOMAIN` in
`gitea/.env` is its tailnet name, which Gitea prints in SSH clone URLs.
the stpgit `.env` is its tailnet name, which Gitea prints in SSH clone URLs.
- *Webhooks to the site* (usaco's push hook,
`https://www.<DOMAIN>/usaco/api/hooks/gitea`) go straight to stpvm's Caddy
over the LAN: `extra_hosts` pins `www.<DOMAIN>` to `EDGE_IP`, and
`ALLOWED_HOST_LIST` allows that name, since its address is private.
- *Backups.* A Proxmox `vzdump` of the whole LXC covers the git data and the
database together. `gitea/data` alone is not a backup: the issues, PRs,
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
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
a fresh `gitea-db`, copy `gitea/data` and `gitea/config` with
a fresh `gitea-db`, copy `data/` and `config/` with
`tar --numeric-owner` (owned by uid 1000), start it, then point
`GITEA_UPSTREAM` at the new address and `docker compose up -d gitea` on
stpvm. The SSH host key is in `gitea/data`, so clients' `known_hosts` still
stpvm. The SSH host key is in `data/`, so clients' `known_hosts` still
match.
- *Rollback to running it on stpvm:* stop it on the LXC, copy its
`gitea/data` and database back over the pre-move copy in
`data/` and database back over the pre-move copy in
`.deprecated/gitea/` and stpvm's `db`, then
`docker compose -f docker-compose.yml -f .deprecated/gitea/docker-compose.gitea.yml up -d gitea`.
`.deprecated/README.md` has the details.
@@ -782,7 +784,7 @@ Documented, not fixed — each would change deploy behaviour.
and `./logs/nginx/`, plus the `logs/nginx` stanza in
`/etc/logrotate.d/web_server`. The code is in `.deprecated/`. Once the
rollback is no longer wanted, delete the two directories and the stanza.
2. **`gitea/config/entrypoint.sh` is an empty, unused file** that would be
mounted to the same in-container path as the real wrapper. It is currently
shadowed by an explicit file mount — fragile. Deleting it would be safe but
is a file removal.
2. **`config/entrypoint.sh` in the stpgit checkout is an empty, unused,
root-owned file** that would be mounted to the same in-container path as
the real wrapper. It is currently shadowed by an explicit file mount —
fragile. Deleting it (`sudo rm`) would be safe but is a file removal.