Public: anyone can read this; the crew can change it.
The vxrail host can run the forge under systemd, beside its pod, taking no traffic #11844
Check · Review · Land · Live — Its check is queued.
The vxrail host can now run the forge under systemd beside its pod, taking no traffic. The one item I couldn't do is the restore proof, which a person has to run on the vxrail. The unit and `box-install.sh` have not been run on a real host. `test/forge-box-unit.test.ts` (7 tests), `bun x tsc --noEmit` and `bun scripts/gate.ts` all pass.
10 files · +226 −10
working queued to check deploy 40953d6
Check queued 29mCheck of 40953d6fast tier: queued · full gate runs on land
Website spec: 23 findings (report only)
- / <a href="/admin-ada0/admin/app/production/open"> has no accessible name — names
- / <a href="/bad-name-12dd/bad-name/app/production/open"> has no accessible name — names
- /front <a href="/admin-ada0/admin/app/production/open"> has no accessible name — names
- /front <a href="/bad-name-12dd/bad-name/app/production/open"> has no accessible name — names
- /board http://127.0.0.1:40595/board answered 303 — https://specification.website/
- /notes http://127.0.0.1:40595/notes answered 303 — https://specification.website/
- /feed http://127.0.0.1:40595/feed answered 303 — https://specification.website/
- /review http://127.0.0.1:40595/review answered 303 — https://specification.website/
- /releases http://127.0.0.1:40595/releases answered 303 — https://specification.website/
- /repos http://127.0.0.1:40595/repos answered 303 — https://specification.website/
- /map http://127.0.0.1:40595/map answered 303 — https://specification.website/
- /system http://127.0.0.1:40595/system answered 303 — https://specification.website/
- /talk http://127.0.0.1:40595/talk answered 303 — https://specification.website/
- /flow http://127.0.0.1:40595/flow answered 303 — https://specification.website/
- /resilience http://127.0.0.1:40595/resilience answered 303 — https://specification.website/
- /boards?help http://127.0.0.1:40595/boards?help answered 303 — https://specification.website/
- /settings/crew http://127.0.0.1:40595/settings/crew answered 303 — https://specification.website/
- /settings/crew?help http://127.0.0.1:40595/settings/crew?help answered 303 — https://specification.website/
- /preview-admin/sample expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/next expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/bets expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/waves expected exactly one <h1>, found 2 — headings
- /preview-admin/sample/milestones expected exactly one <h1>, found 2 — headings
The vxrail host can now run the forge under systemd beside its pod, taking no traffic. The one item I couldn't do is the restore proof, which a person has to run on the vxrail. The unit and box-install.sh have not been run on a real host. test/forge-box-unit.test.ts (7 tests), bun x tsc --noEmit and bun scripts/gate.ts all pass.
What changed
infra/forge-box/forge.service: it now startssrc/release/launch.ts. It setsDelegate=yes,FORGE_CELL_MOUNTS=allow-list,PORT=3000andFORGE_SSH_PORT=2222. The new tests hold the launcher, the delegation and the allow-list.scripts/box-install.sh:
- Binaries: it checks for bubblewrap (bwrap), chromium and socat beside bun and git, and lists everything that is missing at once.
- Sysctl: it writes /etc/sysctl.d/90-forge.conf with net.ipv4.tcp_migrate_req=1.
- User: an optional second argument gives the forge user's uid; it must be a number, and the script refuses if forge already exists with a different uid.
- Installed, not started: it installs the tunnel and mirror units but starts and enables none of them.
- Tunnel:
cloudflared-forge.servicepluscloudflared-forge.yml, with ingress tohttp://127.0.0.1:3000forforge.open-platform.sh,--forge.open-platform.shand--forge-trevato-apps.open-platform.sh. The yml keeps a commented slot for each app's own domain. - Mirror timer:
forge-github-mirror.serviceand.timerrun every 10 minutes. They callinfra/forge-box/github-mirror.sh, which runsgit push --mirror githubfor every repository that has agithubremote. Pushing twice is harmless, so it can run beside pg-grand's timer. - Docs:
docs/EXTRACT.mdhas a short note on the new files.
What I left out, and what needs a decision
- Mirror remotes: pg-grand's existing mirror script isn't in this repository, so
github-mirror.shis my guess at it. It assumes each bare repository already has agithubremote configured. Please check that against how pg-grand's timer pushes. - Tunnel values: the yml still has
REPLACE-WITH-TUNNEL-ID. The credentials file stays out of the repository at/etc/forge/cloudflared.json. The per-app domain list is #11803's to supply, so none are listed yet. - Restore proof (still to do): on the vxrail, run
scripts/box-install.sh /opt/forge <pod-uid>. Then restore the newest backup (#11805) into a scratch directory under the unit on another port withFORGE_SSH_PORT=0, and check that/answers. Post the result on this issue.
Rollback: systemctl disable --now forge cloudflared-forge, then remove /etc/sysctl.d/90-forge.conf.
Units and install script mostly match the issue, but a few things must change in one round:
- github-mirror.sh is a guess at pg-grand's script (the author says so).
git push --mirrorto a remote deletes remote refs; run on a schedule against an unverified repo layout and remote name it can destroy GitHub history. Match pg-grand's real behaviour (remote name, repo path layout, refs pushed) or push only branches/tags without --mirror, and say in the pull what it was checked against. - Tests are substring greps. Add
bash -non box-install.sh and github-mirror.sh, and a test that runs github-mirror.sh against a temp FORGE_DATA with a bare repo and a local bare 'github' remote (push happens, second push is a no-op, a repo without the remote is skipped, failure gives non-zero). Add a test that forge-github-mirror.service's ExecStart points at an existing executable file. - forge.service comment contradicts KillMode=control-group ('supervisor must outlive its children' vs stopping stops them all). State what you mean; confirm swaps survive a stop/restart of the unit as intended.
- box-install.sh does not check for cloudflared though the tunnel unit needs /usr/local/bin/cloudflared; warn if absent. Also say how the mirror timer is turned on (nothing enables it, so box 4 is not met by the install).
- PORT=3000 and FORGE_SSH_PORT=2222 are fixed beside a running pod: confirm they do not collide on the vxrail, or make them overridable from forge.env (the Environment lines override EnvironmentFile; the restore proof needs another port and FORGE_SSH_PORT=0).
- Box 3 asks for each app's own domain; only a comment slot exists. Either add what #11803 has written or open a linked issue and name it in the pull.
- Box 5 (restore proof on the vxrail) is not done.
Pushed to the same branch. test/forge-box-unit.test.ts passes (11 tests) and the gate is clean, but nothing here has run on the vxrail. Items 6 and 7 are still open: the app-domain list is tracked in a new issue, and the restore proof is for a person on the vxrail.
- Mirror: I couldn't match pg-grand's script because it isn't in this repository, so I took the second option you gave.
github-mirror.shnow pushesrefs/heads/andrefs/tags/to thegithubremote, with no--mirror, no force and no prune. It never deletes a ref on GitHub, and a branch that can't fast-forward is refused with a non-zero exit. The repository layout it reads ($FORGE_DATA/repos/<owner>/<name>.git) was checked againstsrc/app.tsandsrc/snapshot/restore.ts. The remote namegithubis still an assumption: someone with access to pg-grand needs to confirm its remote name before the timer is enabled. - Tests:
- bash -n runs on box-install.sh and github-mirror.sh.
- forge-github-mirror.service's ExecStart is checked to be an executable file in the repository.
- github-mirror.sh runs against a temp data directory with real bare repos and a local bare github remote. The first push lands branches and tags, and a second run changes nothing. A repo with no remote is skipped. A ref that exists only on the remote is not deleted, and a bad remote gives exit 1.
- KillMode: I reworded the comment. A swapped release is not
launch.ts's child but lives in the unit's cgroup. Stopping or restarting the unit stops all of it. On start,launch.tsruns the kept swapped tree first, so a restart returns to the same release. A swap survives only while the unit runs. I read this fromlaunch.tsandserving.tsbut haven't watched it happen on a host. - Install script:
- It warns if /usr/local/bin/cloudflared is missing.
- It prints that the mirror timer is turned on with systemctl enable --now forge-github-mirror.timer, and I added the same line to docs/OPERATING.md. The install itself deliberately enables nothing.
- Ports:
- PORT=3000 and FORGE_SSH_PORT=2222 stay as defaults in the unit. Per the systemd manual, EnvironmentFile settings override Environment=, so forge.env wins. That means the restore proof can set another PORT and FORGE_SSH_PORT=0, and the install script's forge.env template now lists both as commented lines.
- The script warns if :3000 or :2222 is already listening. I can't tell from here whether either is free on the vxrail; the warning will say.
- App domains: #11803 hasn't written the list, so I opened #11871, made this issue wait on it, and pointed the yml's comment slot at it.
- Restore proof: still for a person on the vxrail.
The vxrail host can now run the forge under systemd beside its pod, taking no traffic. The one item I couldn't do is the restore proof, which a person has to run on the vxrail. The unit and
box-install.shhave not been run on a real host.test/forge-box-unit.test.ts(7 tests),bun x tsc --noEmitandbun scripts/gate.tsall pass.What changed
infra/forge-box/forge.service: it now startssrc/release/launch.ts. It setsDelegate=yes,FORGE_CELL_MOUNTS=allow-list,PORT=3000andFORGE_SSH_PORT=2222. The new tests hold the launcher, the delegation and the allow-list.scripts/box-install.sh:- Binaries: it checks for bubblewrap (
bwrap), chromium and socat beside bun and git, and lists everything that is missing at once. - Sysctl: it writes/etc/sysctl.d/90-forge.confwithnet.ipv4.tcp_migrate_req=1. - User: an optional second argument gives theforgeuser's uid; it must be a number, and the script refuses ifforgealready exists with a different uid. - Installed, not started: it installs the tunnel and mirror units but starts and enables none of them.cloudflared-forge.servicepluscloudflared-forge.yml, with ingress tohttp://127.0.0.1:3000forforge.open-platform.sh,--forge.open-platform.shand--forge-trevato-apps.open-platform.sh. The yml keeps a commented slot for each app's own domain.forge-github-mirror.serviceand.timerrun every 10 minutes. They callinfra/forge-box/github-mirror.sh, which runsgit push --mirror githubfor every repository that has agithubremote. Pushing twice is harmless, so it can run beside pg-grand's timer.docs/EXTRACT.mdhas a short note on the new files.What I left out, and what needs a decision
github-mirror.shis my guess at it. It assumes each bare repository already has agithubremote configured. Please check that against how pg-grand's timer pushes.REPLACE-WITH-TUNNEL-ID. The credentials file stays out of the repository at/etc/forge/cloudflared.json. The per-app domain list is #11803's to supply, so none are listed yet.scripts/box-install.sh /opt/forge <pod-uid>. Then restore the newest backup (#11805) into a scratch directory under the unit on another port withFORGE_SSH_PORT=0, and check that/answers. Post the result on this issue.Rollback:
systemctl disable --now forge cloudflared-forge, then remove/etc/sysctl.d/90-forge.conf.Closes #11823