Public: anyone can read this; the crew can change it.
Game boxes keep their worlds on the volume, and the agent updates itself #17264
Merged 31h 20m ago, live in production
Production box mc reported "The volume is not mounted": DO does not mount an attached volume, so Docker's data and every world sat on the root disk, which a replace destroys. Boot (DO and Hetzner): agent.sh --mount-volume before Docker.
-
Reviews
Changes requested — before the latest pushSelf-update is sound: the bearer is the box's token, the sha is checked before the script is put in place, the replace is atomic, and the unit has Restart=always. I found no high-severity security issue. Changes needed, in one round:
- (Fix first) The volume code has no test. The pull adds format-if-blank, mount, fstab and a one-time move of live game data to the volume. The tests cover only the boot config string, the diag wording and self-update. Add a test that runs
agent.sh --mount-volumewith the existing seams (FORGE_GAME_VOLUME, FORGE_GAME_DATA, FORGE_GAME_MOVE_DIR, FORGE_GAME_FSTAB) and stubbed mkfs, mount, blkid and rsync on PATH. It should show at least these cases: a blank device is formatted; a device with a signature but no filesystem is refused and not formatted; a volume that already holds data is refused and the root data is untouched; an rsync failure starts Docker again and leaves the data in place; a successful move writes fstab once. This is the code closest to the Never about data loss, so it needs the tests most. - The doc is missing. This changes how a box mounts its volume and how it takes a new agent, but docs/features/game-box.md is not touched. Say there how the volume is formatted, mounted and moved, how to read
.volume.login diag, and how a box updates itself. - The terminal side is not mentioned. Either show that the diag screen in src/tui/ already renders
disk.deviceanddisk.log, or add aNo door: <why>line to a commit. - In
volume_mount,mountpoint -q "$dir"returns success for any mount at that directory, even one that is not this volume. Compare the mounted source with$dev(findmnt) before saying the volume is mounted. - In
volume_move, thecompose stopresult is ignored. The volume mount andrm -f .compose-shahappen after Docker is started again, so a failed finalmountleaves Docker running on the root disk without any message to the forge. That case is also untested. - The comment above the
--mount-volumeassertion in test/game-box.test.ts still says the mount is 'waited for (a minute)'. Fix the stale line.
Changes requested — before the latest pushSince f4e9a160e9f9 only the stale comment in test/game-box.test.ts was removed (met). Two earlier asks are still open, and nothing in the new head touches them.
- Untested destructive path:
volume_movein src/games/agent.sh stops compose and Docker, rsyncs the data, and remounts. Nothing exercisesvolume_mountorvolume_move. The new agent test sets FORGE_GAME_VOLUME_CHECK=0, so the code never runs in a test. The hooks are already in the script (FORGE_GAME_VOLUME, FORGE_GAME_DATA, FORGE_GAME_MOVE_DIR, FORGE_GAME_FSTAB). Add a test that would fail without the behaviour. At minimum cover the refusal paths, which need no root: a volume that already holds data is refused and the root-disk data is untouched, and rsync missing leaves the data in place. A fakemount,mountpointandsystemctlon PATH is enough. The rollback after an rsync failure needs one too. volume_mountand the start-up check usemountpoint -q "$dir", which accepts any mount at the data directory, for example a tmpfs. Check that the mount's source is$dev(findmnt -n -o SOURCE --target "$dir") before treating the volume as mounted. Otherwise a wrong mount at that path skips both the mount and the move, and the box reports healthy.
The self-update itself is sound: the fetched script is checked against the sha256 the sync gave and with
bash -n, then moved into place atomically. The script route is authenticated by the box token and listed in API_ROUTES and the OpenAPI contract. The sync test and the agent update tests cover it. This is box-internal, so no terminal door is needed.ApprovedAll three earlier asks are met. (1) The
volume_moversync and rollback paths are now tested under bash with stubs: no rsync, rsync failing, compose not stopping, the final mount failing, and a good move that mounts, writes fstab once and drops the compose sha before Docker starts. (2) "Mounted" now means the mount's source is the volume device, with by-id links resolved, not that$diris a mountpoint. (3) The stale "waited for a minute" comment is gone.The new code is safe. Formatting happens only on a blank device. A device with a signature but no filesystem is refused. A volume that already holds data is refused. The old root-disk copy is left in place. A self-update runs only a script whose sha256 matches the one the sync answered and which passes
bash -n, and the script route answers 401 to anything but a box token. The terminal's new box screen shows an owner the raw tails and everyone else only the shared lines, and the how-to is indocs/features/game-box.md.Non-blocking:
volume_moveleaves/mnt/forge-volume-movebehind after a successful move. It is an empty mountpoint, so it does no harm. - (Fix first) The volume code has no test. The pull adds format-if-blank, mount, fstab and a one-time move of live game data to the volume. The tests cover only the boot config string, the diag wording and self-update. Add a test that runs
-
Checks
shipped production is serving it deploy c4333e8
-
History
- Game agent: its script route is the box's alone 6d0971d
- Game volume: mounted means the volume is the mount's source; a move mounts, writes fstab and drops the compose sha before Docker starts, and says so when it cannot; tested under bash with stubs ca5dc19
- Game agent: its script route is in the API family's list 3e14c52
- Check again: the boot-time test is reverted (#17346) 365cc17
- Game volume: drop the stale comment about waiting for the mount 66d4ff8
- Game volume: check again on a main that has the fork-follow split (#17260) 7225e8d
- A game box keeps its data on its volume and takes a newer agent by itself 54ca622
- Full suite red: 5 files in check run 01m8t8z3eb62ps5y9awx0thcz9 (#17360) f3e23c6
- The edge-kept duty files one owner finding for every page the edge does not keep, not one issue per page (#17355) 469706d
- Merge pull request #17247 from sold/game-console ac6850a
- /advisories: OSV and CISA KEV for npm, matched to every repository's lockfile, to view, search and paste (#17059) e47a0f6
- A tab forge keeps its data in SQLite wasm on OPFS behind one small store module (#17303) cd3a4ff
- Load highlighter grammars lazily behind an async loader (#16804 follow-up) (#17332) 49c2c02
- Main's own check starts in a slot of its own: no main check had started since 21:08Z (#17287) bda2cf9
- Check again: the boot-time test is reverted (#17346) f17589b
- The console: a shell on a game box through its agent, the owner's alone and all of it audited; and Hetzner's own console 2e23155
- Main's whole verification runs on a runner and hands back what it measured: releases stop cutting it (#17315) 7256b20
- In the suite, a push to a parent does not move its forks in the background unless a test of following turns it on (#17330) bac72da
- Merge pull request #17226 from sold/cloud-projects 8eddcc7
- Game servers: Minecraft Java as a ready-made /infra design (#17341) 97edd7b
<!-- look-pages 40d100ea9424 --> Look pages for 40d100e, from the gate:
look pages (none): this pull changes src/web/pages/games.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
<!-- look-pages 6d0971d96920 --> Look pages for 6d0971d, from the gate:
look pages (none): this pull changes src/web/pages/games.ts but the forge could not trace the route of /, /docs, /explore and 29 more (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
Production box mc reported "The volume is not mounted": DO does not mount an attached volume, so Docker's data and every world sat on the root disk, which a replace destroys.
agent.sh --mount-volumebefore Docker. It finds the volume by id, formats only when blkid and wipefs find nothing (never over data or a foreign signature), mounts it at the data dir and adds a nofail fstab line once.preflight: green.
🤖 Generated with Claude Code