Deploy the console to Fly at apps.theoremweb.com - #206
Conversation
The production Next image needs a repo-root Dockerfile, hoist-aware install, and two typecheck fixes so `next build` can complete on Fly.
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36a3b5a0b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| PORT = "8080" | ||
| HOSTNAME = "0.0.0.0" | ||
| AUTH_TRUST_HOST = "true" | ||
| AUTH_URL = "https://apps.theoremweb.com" |
There was a problem hiding this comment.
Keep the Console on its canonical host
When this Fly configuration is deployed, AUTH_URL makes apps.theoremweb.com an independently authenticated product origin even though the Console constitution fixes v2.theoremharness.com as the canonical host and Railway as its deployment path. This creates a second production deployment that can drift in code, secrets, sessions, and OAuth configuration; keep the Fly hostname as a redirect/alias to the canonical deployment rather than hosting another Console instance.
AGENTS.md reference: apps/console/AGENTS.md:L18-L22
Useful? React with 👍 / 👎.
| ARG NEXT_PUBLIC_THEOREM_GATEWAY_URL= | ||
| ENV NEXT_PUBLIC_CONSOLE_CHAT_URL=$NEXT_PUBLIC_CONSOLE_CHAT_URL | ||
| ENV NEXT_PUBLIC_THEOREM_GATEWAY_URL=$NEXT_PUBLIC_THEOREM_GATEWAY_URL |
There was a problem hiding this comment.
Supply the gateway URL during the Fly build
For images built from the checked-in Fly configuration, this argument remains empty because [build.args] supplies only NEXT_PUBLIC_CONSOLE_CHAT_URL. Since this public variable is inlined during next build, runtime secrets cannot repair it: program runs that return only a recording_id open prototype.stage without a gateway base, and the stage renders its named unavailable state instead of loading the recording. Provide NEXT_PUBLIC_THEOREM_GATEWAY_URL in fly.console.toml or a usable build-time default.
Useful? React with 👍 / 👎.
| [env] | ||
| PORT = "8080" | ||
| HOSTNAME = "0.0.0.0" | ||
| AUTH_TRUST_HOST = "true" | ||
| AUTH_URL = "https://apps.theoremweb.com" |
There was a problem hiding this comment.
Point the deployment doctor at the Fly origin
In the Fly environment, neither DOCTOR_PUBLIC_BASE_URL nor Railway's RAILWAY_PUBLIC_DOMAIN is set, so /api/doctor falls through to its hard-coded https://v2.theoremharness.com base. Consequently, invoking the doctor on apps.theoremweb.com probes the separate Railway deployment and can report healthy routes even when this Fly instance is broken. Set DOCTOR_PUBLIC_BASE_URL to the Fly hostname in this environment block.
Useful? React with 👍 / 👎.
| [env] | ||
| PORT = "8080" | ||
| HOSTNAME = "0.0.0.0" | ||
| AUTH_TRUST_HOST = "true" | ||
| AUTH_URL = "https://apps.theoremweb.com" |
There was a problem hiding this comment.
Inject revision metadata for the Fly deployment
The GET handler in src/app/api/version/route.ts identifies code solely from RAILWAY_GIT_COMMIT_SHA or GITHUB_SHA, but this Fly environment supplies neither value and the Docker context excludes .git. As a result, /api/version returns git.sha: null for this deployment, defeating the endpoint's purpose of distinguishing a current image from a stale one. Pass the deployed revision into one of the names the handler reads, or extend the handler and config with explicit Fly revision metadata.
Useful? React with 👍 / 👎.
Summary
travis-commonplace-consolecan build from this checkout (fly deploy --config fly.console.toml)./api/healthzand keepAUTH_URLonhttps://apps.theoremweb.com(apex Theseus stays on Vercel).next buildtype errors that blocked the Fly image (ObjectActionReceipt.code, implicitposition).Live: https://apps.theoremweb.com (
{"ok":true,"service":"commonplace-console"}).v2.theoremharness.comremains the Railway alias.Related: #205
Test plan
fly deploy --config fly.console.toml --app travis-commonplace-consoleproduced a passing/api/healthzhttps://apps.theoremweb.com/api/healthzreturns 200https://apps.theoremweb.com/redirects to/loginhttps://theoremweb.comstill serves the apex Theseus sitehttps://apps.theoremweb.com/api/auth/callback/githubif login against this host is still needed