Overhaul .forgejo meta-repo — workflows, sync, docs, and security #11
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
Due date
No due date set.
Dependencies
No dependencies set.
Reference
XeplosionGames/.forgejo#11
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
Other
What needs doing and why?
A full audit of the
docs,main, andtemplate-scriptbranches surfacedbroken behavior, two conflicting architectural models, weak/inconsistent
comments, and undocumented security choices. This is the umbrella issue tracking
the cleanup. Canonical rule: the infrastructure docs win over the README
wherever they conflict.
Tags below:
[decision]needs a call ·[bug]broken ·[docs]·[chore]formatting/naming/comments ·
[feature]new.1. Decisions
[decision]Deploy logic lives in git (orchestrate from thehubrunner), not in a root-owned server-side
deploy.sh. Accepts the securitytradeoff below; deployments remain per-implementation via in-repo
service-start.sh/healthcheck.sh/xegames.config.yml.[decision].template-sync.ymlderives its file list fromsync-config.ymlat runtime rather than hand-maintaining a per-repopaths:list. (Examine directory-entry expansion forISSUE_TEMPLATE/.)[decision]create-labels.sh— write it (readlabels.yml, upsert viathe Forgejo labels API) or strip the references in
LABELS.md/labels.yml.[decision]Whether the bespoke/legacy hub services (hub-nginx, hub-zulip,…) migrate to the in-git deploy model too, or keep their forced-command
deploy.shfor now. Document whichever.2. Rewrite all workflows from scratch
Comments and conventions on the existing workflows are poor across the board.
Rather than patch, rewrite each with consistent structure, accurate behavior,
and comments that explain what each step does and why.
[chore]Rewrite with the new names + descriptivename:fields:-
sync-shared.yml→sync-shared-files.yml— "Sync Shared Files → Template Branches (on push to main)"-
sync-shared-manual.yml→sync-shared-files-manual.yml— "Sync Shared Files → Template Branches (manual, one branch or all)"-
sync-templates.yml→publish-template-branch.yml— "Publish Template Branch → Template Repo (on push)"-
sync-templates-manual.yml→publish-template-branch-manual.yml— "Publish Template Branch → Template Repo (manual, one or all)"-
sync-full.yml→sync-everything.yml— "Full Sync — Shared Files + All Template Repos (manual)"-
sync-implementers.yml→template-sync.yml— "Template Sync — Pull Shared Files from .forgejo (scheduled)"-
sync-implementers-manul.yml→template-sync-manual.yml— "Template Sync — Pull Shared Files from .forgejo (manual)"-
deploy-production.yml(keep) — "Deploy to Production (push to main → target server)"-
deploy-test.yml(keep) — "Deploy to Test (push to dev → test server)"-
rollback.yml(keep) — "Rollback Deployment (manual, or auto on failed healthcheck)"-
healthcheck.yml(keep) — "Scheduled Healthcheck (production + test)"-
release.yml(keep) — "Release — Notes + Artifacts (on tag v*)"-
ci-script.yml(keep) — "CI — Script / Infra (runs validate.sh)"-
promote.yml(keep) — "Promote Mirror → Main (mirror-pull repos)"[chore]Every workflow gets a header block (purpose, trigger, where itruns) and inline comments on non-obvious steps.
Behavioral requirements the rewrite must satisfy (these are the old bugs):
[bug]Deploy/ops workflows run onruns-on: hub(noubuntu-latestrunner exists).
[bug]Host values come fromvars.{VPS_HOST,HUB_HOST,SSH_PORT}(orgvariables), SSH creds from per-repo
secrets.{SSH_USER,SSH_PRIVATE_KEY}.[bug]Single deploy-target source: theDEPLOY_TARGETsecret everywhere(drop
.deploy.targetfromxegames.config.yml).[bug]template-syncworkflows callscripts/template-sync.sh, and themanual variant's PR head matches the script (
template-sync/auto).[feature]sync-shared-files-manual.ymltakes abranchinput (onebranch or
all) replacing the deadfull_syncboolean;sync-everything.ymlcalls it with the default
all.[bug]Workflows that useyqinstall it (deploy/rollback/healthcheck/release currently assume it's present).
[chore]Standardize: yq install path,secretsvs env-var token usage,name:spacing, indentation.3. Sync system correctness
[bug]sync-config.yml: fixtemplate-issuesstypo; fix "master" →"main" comment.
[bug]Reconcileservice-start.sh/service-stop.shsync targets(README says script/node/python/php; config lists script/node only).
[bug]sync-shared-files.ymlpaths:trigger: fixCODEOWNERS→SYNCED_CODEOWNERS; addscripts/template-sync.shandworkflows/template-sync*.yml.[bug]Addtemplate-sync.yml,template-sync-manual.yml, andscripts/template-sync.shtosync-config.ymlso implementer reposactually receive the pull-sync mechanism.
[feature]template-sync.sh: derive paths fromsync-config.ymlatruntime (decision #1), with directory expansion.
[docs]Document additive-only sync + the manual "remove a file fromtemplate branches" procedure.
[feature]Addvalidate-template-branches.yml+required-files.yml(fail if a branch is missing a required branch-specific file). (Drafts
produced; tune the per-branch lists.)
[feature]Disk-size validation workflow. Scheduled; one job perrunner —
runs-on: hubcheckszpool list/zfs list/df -h /,runs-on: vpschecksdf -h /. Threshold breach → Zulip alert and/or openan issue. No SSH (each runner checks its own host).
4. Documentation review & comment standardization
[docs]Validate every documentation file against current behavior.Inventory (gather the ones not yet uploaded):
-
main:README.md-
docs:CONVENTION.md,INFRASTRUCTURE-HUB.md,INFRASTRUCTURE-VPS.md,ISSUES.md,LABELS.md,PULL_REQUESTS.md(+ aREADME.mdif one exists)- per template branch (need to gather):
template-issues/README.md,template-script/README.md,template-dotnet/README.md,template-node/README.md,template-python/README.md,template-php/README.md- inline doc-comments:
sync-config.yml,xegames.config.yml,labels.yml,.template-sync.yml[chore]Standardize comments in all non-synced files onmain—consistent
REFERENCE STUB — NOT SYNCEDbanner + house style onvalidate.sh,build.sh,ci-script.yml,promote.yml,labels.yml,xegames.config.yml,.template-sync.yml.[bug]Fix script header comments naming non-existent workflows(
validate.sh"ci.yml",service-start.sh/healthcheck.sh"deploy.yml").[docs]Fix known inconsistencies:-
ISSUES.md: board column "Completed" → "Done"-
ISSUES.md: templates live at repo-rootISSUE_TEMPLATE/, not.forgejo/ISSUE_TEMPLATE/- README branch-protection user
Xeplosion→xeplosion-
labels.yml:Kind/Featurecolor0075ca→#0075ca-
INFRASTRUCTURE-HUB.md: usable pool size "~930GB" vs "~806GB" → reconcile-
promote.ymlundocumented in README (add or remove)- Document
SYNC_GPG_KEY,FORGEJO_READ_TOKEN,OWNER/REPO_NAME[chore]CONVENTION.mdset -e/#!/bin/bashrule vs stubs that omitset -eandtemplate-sync.shusingenv bash— reconcile.[chore]CRLF vs.editorconfigeol = lf— normalize to LF + add.gitattributes.5. Security documentation (priority)
[docs]Add a Security section to themainREADME explaining how thesecurity model drove the structure, covering:
- per-repo unique deploy keys (leaked key = one service only)
-
nologinservice users, home isolation, onesudocommand each- the in-git deploy tradeoff (repo-controlled commands; mitigated by branch
protection + required review + synced authoritative workflows)
- GPG-signed sync commits; per-repo
RELEASE_TOKEN- why org variables vs secrets are split the way they are
[docs]Rewrite README Org Secrets to the infra model (org vars:SSH_PORT/VPS_HOST/HUB_HOST; org secrets: Zulip; per-repo secrets:SSH_PRIVATE_KEY/SSH_USER/DEPLOY_TARGET/RELEASE_TOKEN).[docs]UpdateINFRASTRUCTURE-HUB.md/INFRASTRUCTURE-VPS.mdto reflectthe in-git deploy model for templated stacks; clarify forced-command
deploy.shas the legacy/bespoke pattern (per decision #1).Risk or impact
branch, validate via manual dispatch against one template branch before
replacing the originals, and keep the old files until the new ones are proven.
security-docs work must land alongside it so the rationale is recorded.
Additional context
INFRASTRUCTURE-HUB.md/INFRASTRUCTURE-VPS.md, validated2026-06-20) are canonical for architecture.
doc review.
(2) workflow rewrite, (3) sync correctness +
.template-sync.yml, (4) deletiondocs + validation + disk-size workflow, (5) security docs + infra reconciliation.
Checklist