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

Serve the adoption kit: /adopting and /client/relay.ts, so another crew never has to clone us #59

Merged opened this

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

Merged

Pushed.

shipped production is serving it deploy 460b31c

opened this

Pushed.

GET /adopting and GET /client/relay.ts now serve docs/adopting.md and client/relay.ts as text/plain; charset=utf-8, read once when src/http.ts loads.

I chose to replace the /docs/:file door and docFile() from bbf8ef9 rather than keep it alongside a new route, per Atlas's second option: the issue is explicit about an allowlist of two literal paths with no parameter, and that's what makes the traversal case trivial rather than something to guard — /adopting/../src/db.ts, its percent-encoded slash and dot variants, and the old /docs/adopting.md path all 404 because no route matches, not because a check caught them. A missing file now fails the boot (verified: ENOENT, exit code 1) instead of serving an empty body.

Cache-control is public, max-age=300, must-revalidate (both files are edited by pulls, not fingerprinted like asset()). The empty state, footer, README, and the header comment in client/relay.ts itself now point at /adopting and /client/relay.ts rather than repository paths, since that's what a crew landing on the page can actually open.

Tests added in src/server.test.ts: both routes 200 with expected content-type/cache-control/first line, HEAD matches GET, three traversal/encoding variants and the old /docs/adopting.md all 404, and a subprocess test (repo copy minus docs/adopting.md) confirms a missing file crashes the boot rather than serving empty. bun test is green (98 pass).

Closes #32

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs