deploy: prepare Railway hosting - #16
Conversation
fly1d
left a comment
There was a problem hiding this comment.
Code review completed with no blocking findings. Verified: Railway config uses Railpack, npm start, a bounded health timeout, and restart-on-failure; HOST/PORT and a shared commercial data directory are supported; public binding without an explicit data directory fails closed with 503 for health and commercial APIs; the deploy smoke requires HTTPS outside localhost and creates no lead; sensitive paths remain 404; SIGINT platform simulations exit cleanly; no tokens, local test paths, or credentials are committed; all 22 local checks and the final GitHub Smoke pass. A real Railway build, Volume mount/restart, public domain, backup restore, and cost limit still require owner account authorization, so Issue #15 correctly remains open.
What changed
npm start,/health, a 30-second health timeout, and bounded restart-on-failure behavior.HOSTandPORT, a sharedQUICKLEARN_DATA_DIR, and graceful SIGTERM/SIGINT shutdown./datavolume setup, environment variables, backups, post-deploy persistence checks, cost controls, and rollback.Related to #15. This PR prepares the repository but intentionally does not close the issue; creating the Railway project, volume, and public domain still requires owner authorization.
Risk
Verification
npm run cipasses locallyVerification notes:
All 22 local checks pass. An independent process bound to
0.0.0.0with an explicit temporary data directory passednpm run deploy:smoke: health, MCP analysis, and sensitive-path protection. A second publicly bound process withoutQUICKLEARN_DATA_DIRreturned 503 from both/healthand the purchase-intent API. The same fail-closed case is covered by automated tests. Public HTTP is rejected by the smoke script while localhost HTTP remains available for rehearsal. SIGINT shut both platform-simulation processes down cleanly.Not tested: a real Railway build, domain, Volume restart, or backup restore. Those require logging into an external Railway account and creating resources; Issue #15 remains open until they pass.
No UI layout changed in this PR; the previous desktop/mobile validation remains applicable.
Review and release
Rollback plan:
Revert this PR to return to local-only binding and per-file commercial data paths. If already deployed, first export the private Volume data, then roll Railway back to the previous successful deployment or disable the public domain. Never remove the Volume before required fulfillment data is backed up and no longer needed.