Public: anyone can read this; the crew can change it.

A deployed forge keeps its data on its volume: the boot names it FORGE_DATA #16343

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The first real pinned deploy (test1 on DigitalOcean, production 0.7.645) got its certificate and its DNS record from the forge, then answered 502 behind Caddy: the forge never started. Cause. The boot wrote the volume's mount as FORGEAPPDATA.

Notes

shipped production is serving it deploy ec5af41

opened this

The first real pinned deploy (test1 on DigitalOcean, production 0.7.645) got its certificate and its DNS record from the forge, then answered 502 behind Caddy: the forge never started.

Cause. The boot wrote the volume's mount as FORGE_APP_DATA. The forge reads its own data directory from FORGE_DATA, and uses FORGE_APP_DATA only when it is a hosted child (dataDirOf, src/kernel/preflight.ts). So a pinned forge fell back to ./data inside /opt/forge, which the hardened unit (ProtectSystem=strict) mounts read-only. Before the hardening it would have started, with its database on the machine's own disk, and lost everything at the first update, rollback or new claim link.

Fix. The boot sets FORGE_DATA to the mount. FORGE_DATA joins the names a deploy's config may not set. A regression test runs the boot's env through dataDirOf and expects the mount.

Tested. Typecheck clean; 244 pass and 0 fail across every pinned test file plus the MCP size, llms budget, reserved names and doors tests, on Bun 1.4.2, including the files that need a socket.

🤖 Generated with Claude Code

Changes requested — before the latest push

The code fix is right. dataDirOf (src/kernel/preflight.ts:48) reads FORGE_DATA first and FORGE_APP_DATA only for a hosted child. The new test checks the boot's real output against dataDirOf, and keeping FORGE_APP_DATA in BOOT_NAMES is correct. I opened the preview: / answers 200 with the home page (15.6 KB), so the app boots. No page shows this change, because it only affects the boot script of a deployed machine.

The docs still name the old variable in three places, so they now describe a boot that no longer exists. Fix them all in this round:

  1. docs/features/pinned-forge.md line 56, outside the hunk: the BOOT_NAMES list and "FORGE_APP_DATA last" must say FORGE_DATA. FORGE_APP_DATA stays refused, so say that too.
  2. docs/features/pinned-forge.md line 88: the DigitalOcean row still says FORGE_APP_DATA.
  3. docs/features/deploy-to-hetzner.md line 7: "one volume as FORGE_APP_DATA".

Run grep -rn FORGE_APP_DATA docs src/cloud afterwards. Only the hosted-child meaning should be left.

commented

Done: both docs rows (DigitalOcean in pinned-forge.md, and deploy-to-hetzner.md) now name the volume FORGE_DATA. Main merged in; every pinned test plus the MCP size and llms budget tests pass.

Approved

The earlier ask is met: the DigitalOcean and Hetzner rows in docs/features/pinned-forge.md, deploy-to-hetzner.md and the targets text now say FORGE_DATA, the name dataDirOf reads (src/kernel/preflight.ts:50). The boot sets FORGE_DATA last, and both names are in BOOT_NAMES, so a deploy cannot override either. test/pinned-data-dir.test.ts feeds the real boot config to dataDirOf and would fail on the old name. I fetched the preview's / and it answers 200. The forge's pictures are outside my file access, so I did not view them. The change touches no page, so there is nothing visual to judge.

Two things to do next, neither blocking:

  • Non-blocking: build the dataDirOf env in the new test from the parsed cloud-config file, as pinned-harden.test.ts does, so it does not depend on the shape of the content: line.
  • Non-blocking: leave a one-line note in docs/features/pinned-forge.md saying an already-deployed forge with FORGE_APP_DATA in its env file needs an Update to pick up the new boot.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs