Skip to content

Deploy the console to Fly at apps.theoremweb.com - #206

Merged
Travis-Gilbert merged 1 commit into
mainfrom
Travis-Gilbert/fly-console-apps-theoremweb
Aug 16, 2026
Merged

Travis-Gilbert merged 1 commit into
mainfrom
Travis-Gilbert/fly-console-apps-theoremweb

Conversation

@Travis-Gilbert

@Travis-Gilbert Travis-Gilbert commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a repo-root Fly config and console Dockerfile so travis-commonplace-console can build from this checkout (fly deploy --config fly.console.toml).
  • Point health checks at /api/healthz and keep AUTH_URL on https://apps.theoremweb.com (apex Theseus stays on Vercel).
  • Fix two next build type errors that blocked the Fly image (ObjectActionReceipt.code, implicit position).

Live: https://apps.theoremweb.com ({"ok":true,"service":"commonplace-console"}). v2.theoremharness.com remains the Railway alias.

Related: #205

Test plan

  • fly deploy --config fly.console.toml --app travis-commonplace-console produced a passing /api/healthz
  • https://apps.theoremweb.com/api/healthz returns 200
  • https://apps.theoremweb.com/ redirects to /login
  • https://theoremweb.com still serves the apex Theseus site
  • Add GitHub OAuth callback https://apps.theoremweb.com/api/auth/callback/github if login against this host is still needed

The production Next image needs a repo-root Dockerfile, hoist-aware install, and two typecheck fixes so `next build` can complete on Fly.
@ecc-tools

ecc-tools Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 79a15f77-7a18-4f9b-88aa-587b3e9cce07


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread fly.console.toml
PORT = "8080"
HOSTNAME = "0.0.0.0"
AUTH_TRUST_HOST = "true"
AUTH_URL = "https://apps.theoremweb.com"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread apps/console/Dockerfile
Comment on lines +17 to +19
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread fly.console.toml
Comment on lines +17 to +21
[env]
PORT = "8080"
HOSTNAME = "0.0.0.0"
AUTH_TRUST_HOST = "true"
AUTH_URL = "https://apps.theoremweb.com"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread fly.console.toml
Comment on lines +17 to +21
[env]
PORT = "8080"
HOSTNAME = "0.0.0.0"
AUTH_TRUST_HOST = "true"
AUTH_URL = "https://apps.theoremweb.com"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@Travis-Gilbert
Travis-Gilbert merged commit 03c6b39 into main Aug 16, 2026
2 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant