Plan: Forgejo as a platforms/proxmox core service
IMPLEMENTATION RULES: Before implementing this plan, read and follow:
- WORKFLOW.md - The implementation process
- PLANS.md - Plan structure and best practices
Status: Completed — all three phases live-verified against the real Proxmox install, 2026-10-26
Phase 3's own Validation bar (below) is met: urb-agents#2022→#2032 ran a real Forgejo
mirror repository against this exact install (push-mirrored from GitHub, a real git
object transfer) and pushed/pulled real images through its built-in registry (the
actions/docker/helm action-mirror orgs ops created and used for Forgejo Actions'
own action resolution) — both the "real git push" and "real docker push/pull"
proofs this plan asked for, against the live forgejo guest, not a mock.
Goal: Add Forgejo (self-hosted git host + its own built-in OCI registry) as a new
platforms/proxmox core service — the same host-level-guest shape as the registry cache,
Bao and Garage — so the Epinio self-service deploy path
(INVESTIGATE-service-epinio-deploy-path.md)
has somewhere to push built images to and pull them back from.
Investigation: INVESTIGATE-service-epinio-deploy-path.md, INVESTIGATE-system-registry-cache.md (Parts 4-5, the containerd-trust gap this plan does not close — see "What this plan does not do" below)
Related: urb-agents#1909, #1910, #1912, #1913, #1917 — Terje's 2026-10-20 decision
that this should move into UIS proper now, ahead of the "eventual, deliberate handover" timing
#1914 had originally described.
Last Updated: 2026-10-20
Problem Summary
The Epinio PoC proved Forgejo works for this purpose, but built it as one-off IaC in a private
platform repository outside UIS, with a hand-written guest declaration (static IP, a specific
Proxmox host and VMID) rather than through platforms/proxmox's own generic CORE_SERVICES
mechanism that every other core-services guest (registry cache, Bao, Garage, Postgres) already
uses. This plan brings Forgejo into that same generic mechanism, translating the proven
install/config logic rather than copying the one-off version verbatim.
What this plan does
platforms/proxmox/ansible/roles/forgejo/— a new role, structured identically toroles/garage(Docker-based, systemd-wrapped, nftables-gated):defaults/main.yml,handlers/main.yml,tasks/main.yml, and three templates (app.ini.j2,forgejo-nftables.conf.j2,forgejo.service.j2). Pins the image by digest, verified live against Codeberg's own v2 registry API (see the role's own defaults file for the exact query and result) rather than left as a tag the way the original PoC IaC did — the one place this plan improves on what it's translating.platforms/proxmox/ansible/playbooks/service-forgejo.yml— the per-guest install playbook, following theservice-garage.yml/service-bao.ymlshape exactly. Resolves its own domain from the connection address at play time (ansible_host), so no extra-eflag or hardcoded address is ever needed — this repository's standing rule against baking real addresses into anything committed.website/docs/production/forgejo.md— a docs page following the registry-cache page's precedent (host-level-guest services get documented underproduction/, notservices/management/, since they aren'tuis deploy <service>Kubernetes workloads).
What this plan does NOT do — integration is a separate, deliberate step
Update 2026-10-20: items 1-3 below are now done — see Phase 2's checklist. Left as written for the historical record of what was deferred and why; item 4 (admin account) remains genuinely out of scope.
Three things remain for whoever integrates this (not done here, because they touch multi-service shared files this plan's own code review should see as a clean, reviewable diff rather than entangled with new-role additions):
generate-ansible-config.shneeds one newcasearm in itsfor svc in $CORE_SERVICESloop (alongsidepg/bao/garage/registry), e.g.:VMID 410 is the next free slot after the existingforgejo) write_core_service forgejo 410 2 2048 512 "order=3" "nesting=1,keyctl=1" 8 /var/lib/forgejo 50 "" forgejo ;;405-409(verified by reading the existing case statement directly, not guessed) — not the real PoC's VMID 411 on its real host, which was assigned ad hoc outside this generic mechanism and has no bearing on what a fresh install throughCORE_SERVICESshould use.05-core-services-apply.shneeds aFORGEJO_IPcapture (identical shape to the existingREGISTRY_IP/BAO_IPcapture in its per-service loop) so a later step can wire containerd trust for Forgejo's registry — see item 3.- Containerd trust for Forgejo's own registry is explicitly out of scope here — that is INVESTIGATE-system-registry-cache.md Parts 4 and 5, a structurally different mechanism from the one this plan's role provides, tracked and (as of this writing) being implemented as its own parallel change. A cluster cannot actually pull from this Forgejo install until that lands too — this plan alone does not make Forgejo usable end-to-end.
- Admin account / first repository — deliberately not automated (see the role's own comment) — an explicit operator step after install, same as every other core-services guest with a bootstrap credential.
- The CI runner
urb-agents#1910actually asked for — "official Forgejo Runner on a dedicated Proxmox VM (not LXC)" was part of the same decision this plan implements, and was missed entirely here (caught 2026-10-21, not flagged as deferred at the time this plan was written). Was a real gap, not anymore: the dedicated-VM path got built, live-tested, then retired in favor of a shared pod-based runner instead — see INVESTIGATE-system-forgejo-runner.md for the full resolution.
Honest limits of what's been verified
- No live Proxmox cluster exists in this working environment (still true — this
repo's own dev sandbox has none). Every file here was YAML-parsed,
ansible-playbook --syntax-check-ed, and (for the three Jinja templates) rendered with representative dummy variables before anything shipped — that part proves the code parses, not that it runs. The actual live-run proof came from ops, not imac (who tests Rancher Desktop, not Proxmox, per this project's own division of labor) — repeatedly, acrossurb-agents#2022→#2032. See Status above. - The image digest was independently verified live against
codeberg.org/v2/...on 2026-10-20 — that part is a real, reproducible check, not copied from the PoC's own comment (though it happens to match). - The
0777data-directory permission, the SQLite backing store, and the "no admin bootstrap" choice are carried over from the proven PoC reference as-is — not independently re-derived or re-justified here, since they already have a working precedent to translate from. - VMID 410 and the
write_core_servicecall signature in "What this plan does NOT do" above are not yet applied anywhere — they are the exact diff for whoever does that integration step, written out so it doesn't need re-deriving, not a claim that the file has already been changed.
Phase 1: Role and playbook review
Tasks
- 1.1
roles/forgejo/written, translated from the proven PoC reference, digest-pinned - 1.2
service-forgejo.ymlwritten, resolves its own domain at play time - 1.3
website/docs/production/forgejo.mdwritten - 1.4 Code review of this plan and its diff — overtaken by events: merged to
main2026-10-20 and in continuous live use since (see Status above), the same bar a separate formal review step would have been gating
Validation
Met — the role has been running against the real Proxmox install since 2026-10-20, exercised repeatedly and successfully by real work (see Status above).
Phase 2: Integration into CORE_SERVICES
Tasks
- 2.1 Add the
forgejo)case togenerate-ansible-config.sh— done 2026-10-20, VMID 410 as planned,order=6(notorder=3as first sketched — that collided with garage's ownorder=3) - 2.2 Add
FORGEJO_IPcapture to05-core-services-apply.sh's per-service loop — done - 2.3 Coordinate with the registry-direct-insecure-trust change — done: the "wire k3s
registry trust" step is now ONE combined
ansible-playbookinvocation passingregistry_host(ifregistryselected) andregistry_direct_insecure(ifforgejoselected) together, reading Forgejo's registry port fromroles/forgejo/defaults/ main.yml'sforgejo_http_portrather than duplicating it
Validation
Met. A lab owner who adds forgejo to CORE_SERVICES and runs
05-core-services-apply.sh (or uis platform core-service add proxmox forgejo, the
newer form — see the 2026-10-21 update below) gets a running, HA-registered, firewalled
Forgejo guest — run live, repeatedly, across urb-agents#2022→#2032, not a one-time
test.
2026-10-21 update: the recommended way to do this is now uis platform core-service add proxmox forgejo — see provision-host/uis/manage/uis-cli.sh's cmd_platform_core-service
and platforms/proxmox/scripts/07-core-service-add.sh. It does exactly the manual steps this
validation describes (add to CORE_SERVICES, run the apply step), scoped to just this one
service rather than re-touching every other already-built guest. The hand-edit-config.sh path
above still works unchanged; the new command is additive, not a replacement for it.
Phase 3: First real use
Tasks
- 3.1 Operator creates the first admin account and organisation by hand — done (ops), proven by every subsequent live action against this install
- 3.2 Confirm a real
git pushand a realdocker push/pullagainst the built-in registry work end to end — done,urb-agents#2022→#2032(see Status above)
Validation
Met, 2026-10-26. A real repository pushed to this Forgejo install, and real images
pulled from its registry by a k3s node — both proven live against the real forgejo
guest, the same acceptance-test discipline every other core service in this repository
already holds itself to.