Implement remaining server infrastructure changes #9
Labels
No labels
Compat/Breaking
Compat/Deprecation
Kind
Bug
Kind
Chore
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Investigation
Kind
Question
Kind
Security
Kind
Testing
Meta/Good First Issue
Meta/Help Wanted
Meta/Stale
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Resolution
Confirmed
Resolution
Duplicate
Resolution
Invalid
Resolution
Won't Fix
Status
Abandoned
Status
Blocked
Status
Needs More Info
Status
Needs Triage
No milestone
No project
No assignees
1 participant
Notifications
Total time spent: 6 hours 13 minutes
Due date
Xeplosion
6 hours 13 minutes
No due date set.
Dependencies
No dependencies set.
Reference
XeplosionGames/.forgejo#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type of chore
Security hardening
What needs doing and why?
Following the infrastructure and CI/CD security design work, a number of changes
need to be implemented on both servers and in Forgejo that are not yet in place.
The current setup uses a single shared
cicduser and org-level SSH credentialswhich does not match the agreed security model.
Forgejo — secrets and runners
SSH_PRIVATE_KEYandSSH_USERfrom org-level secretsSSH_PRIVATE_KEYandSSH_USERas repo-level secrets on each service repohubvpsruns-on:in workflowsVPS (node-i440fx)
svc-nginxuser (/usr/sbin/nologin, no sudo exceptsystemctl reload nginx)svc-bungeecorduser (/usr/sbin/nologin, no sudo exceptsystemctl restart bungeecord)forgejo-runneruser (no SSH, no sudo, owns runner workspace only)node-nginx— register public key insvc-nginxauthorized_keyswithcommand=restrictionnode-bungeecord— register public key insvc-bungeecordauthorized_keyswithcommand=restrictiondeploy.shforsvc-nginx(git pull+systemctl reload nginx)deploy.shforsvc-bungeecord(git pull+systemctl restart bungeecord)sudoers.d/svc-nginxentrysudoers.d/svc-bungeecordentrySSH_PRIVATE_KEYinnode-nginxandnode-bungeecordrepo secretsSSH_USERin each repo to match service usernameHub (hub-x9scl-f)
svc-nginxusersvc-forgejousersvc-mc-survivalusersvc-mc-moddedusersvc-zulipusersvc-uptime-kumausercicduser (no SSH, no sudo)command=restrictionsdeploy.shper service usersudoers.dentry per service userSSH_PRIVATE_KEYin each service repo secretSSH_USERin each repo to match service usernameForgejo migration (VPS → Hub)
/var/lib/forgejo/data to hubgit.xegames.onlinepoints to hub (or VPS with proxy to hub)git.confon VPS nginx to proxy to hub over WireGuard.forgejorepodocsbranchREADME.md,CONVENTION.md,ISSUES.md,LABELS.md,PULL_REQUESTS.md,INFRASTRUCTURE-HUB.md,INFRASTRUCTURE-VPS.mdtodocsbranchdocsas the default branch.forgejo/CODEOWNERS(.* @xeplosion) tomainbranch.forgejo/CODEOWNERSto each template branchdocsbranch (disable direct push, 1 required approval)mainand all template branchesforgejo-runneruser tocicduserRisk or impact
High impact — the Forgejo migration has a downtime window and requires careful
sequencing to avoid losing runner registrations or repo data. The per-service
user changes affect all CI/CD deployments and must be coordinated with secret
rotation in Forgejo.
Do the Forgejo migration during a low-activity window. Have a rollback plan:
keep the VPS Forgejo instance stopped but intact until the hub instance is
confirmed stable for at least 48 hours.
Additional context
INFRASTRUCTURE-HUB.md,INFRASTRUCTURE-VPS.mdondocsbranchcommand=restriction details:INFRASTRUCTURE-VPS.mdruns-on:label routing:INFRASTRUCTURE-HUB.mdChecklist
Deviation from original plan: runner user is
cicdnotforgejo-runner.During implementation, the runner user was created as
cicdrather thanforgejo-runneras originally specified. This better reflects the user's actual role — it runs CI/CD jobs broadly, not just the Forgejo runner daemon specifically. In the future, other CI/CD tooling could run through the same user without the name becoming misleading.The security properties are unchanged —
cicdhas no SSH access, no sudo, and owns only its runner workspace.INFRASTRUCTURE-HUB.mdandINFRASTRUCTURE-VPS.mdwill be updated to reflectcicdin place offorgejo-runner.