Move Gitea to its own LXC; keep a forwarder on stpvm
Test and deploy / test (push) Successful in 17s
Test and deploy / deploy (push) Successful in 2s

Gitea (git, Actions, the registry) now runs from gitea/docker-compose.yml
on a separate Proxmox LXC with its own Postgres, deployed by hand. The
stack's gitea service becomes an haproxy TCP forwarder from stpvm's 3000
and 2222 to the LXC (GITEA_UPSTREAM), under the same container name, so
Caddy, the backend feed, usaco, the runner, Renovate and every repo's CI
keep their addresses. Webhooks from the LXC reach Caddy over the LAN.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-24 15:42:44 +00:00
co-authored by Claude Opus 5.5
parent aa4c3b1a67
commit 10606f4c77
13 changed files with 381 additions and 148 deletions
+50
View File
@@ -0,0 +1,50 @@
# =============================================================================
# gitea/forwarder.cfg — haproxy config for the `gitea` service on stpvm.
#
# Gitea itself runs in its own LXC (gitea/docker-compose.yml). This forwards
# stpvm's Gitea ports to it, unchanged, at the TCP level:
# :3000 HTTP — Caddy's /gitea/ and /v2/ routes, the backend's activity
# feed and usaco's pulls reach it as gitea:3000 on
# app-network; the runner and Renovate as localhost:3000.
# :2222 SSH — every repo's CI (ssh://git@localhost:2222), the obsidian
# checkout and silverbullet-git (DOMAIN:2222, pinned to this
# host), and laptops using stpvm's tailnet name.
# So nothing that talked to Gitea on stpvm had to change address.
#
# TCP mode, not HTTP: the bytes are passed through untouched, so Caddy's
# X-Forwarded-For still reaches Gitea (which trusts one hop of it), SSH just
# works, and there is no second body-size limit on registry uploads.
#
# GITEA_UPSTREAM is the LXC's LAN IP, set in the site's .env. An IP and not a
# name: Docker's DNS cannot see tailnet or LAN names.
# =============================================================================
global
log stdout format raw local0 notice
defaults
mode tcp
log global
option tcplog
timeout connect 5s
# Inactivity timeouts, not total ones. A large clone or image layer upload
# keeps bytes moving; an idle `git` waiting on a slow server-side pack
# should not be cut off at a minute, so these are generous.
timeout client 1h
timeout server 1h
# Start even if the upstream does not resolve yet (dev has no Gitea at
# all); connections then fail rather than the container.
default-server init-addr last,libc,none
frontend http
bind :3000
default_backend gitea_http
frontend ssh
bind :2222
default_backend gitea_ssh
backend gitea_http
server gitea "${GITEA_UPSTREAM}:3000"
backend gitea_ssh
server gitea "${GITEA_UPSTREAM}:2222"