Add Tailscale Serve advertised URL support#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 607b104020
ℹ️ 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".
| return resolveTailscaleHttpsBaseUrl({ servePort: input.tailscaleServePort }).pipe( | ||
| Effect.catch((cause) => | ||
| Effect.logDebug("failed to resolve tailscale https startup url", { cause }).pipe( | ||
| Effect.as(null), | ||
| ), | ||
| ), | ||
| Effect.map((tailscaleBaseUrl) => tailscaleBaseUrl ?? input.httpBaseUrl), |
There was a problem hiding this comment.
Fall back when Tailscale Serve is not configured
When --tailscale-serve is set on a Tailnet machine where tailscale status --json succeeds but tailscale serve --bg fails, this still advertises the MagicDNS HTTPS URL. The actual Serve setup error is swallowed in apps/server/src/server.ts lines 374-379 so the backend keeps running on HTTP, but the headless output/startup pairing URL now points clients at an HTTPS endpoint that was never configured. This should be gated on successful Serve setup or probed before replacing input.httpBaseUrl.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 607b104020
ℹ️ 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".
| return resolveTailscaleHttpsBaseUrl({ servePort: input.tailscaleServePort }).pipe( | ||
| Effect.catch((cause) => | ||
| Effect.logDebug("failed to resolve tailscale https startup url", { cause }).pipe( | ||
| Effect.as(null), | ||
| ), | ||
| ), | ||
| Effect.map((tailscaleBaseUrl) => tailscaleBaseUrl ?? input.httpBaseUrl), |
There was a problem hiding this comment.
Gate advertised HTTPS on Serve success
When --tailscale-serve is enabled and tailscale status --json succeeds, this advertises the MagicDNS HTTPS URL even if the preceding ensureTailscaleServe call failed; I checked apps/server/src/server.ts, where that failure is caught and the server continues after only logging a warning. In that failure mode (for example tailscale serve --bg denied or unsupported while the daemon still reports status), headless output and startup links point users at a non-serving HTTPS URL instead of the still-working HTTP fallback.
Useful? React with 👍 / 👎.
607b104 to
4c019e8
Compare
Summary
--tailscale-serve-host/T3CODE_TAILSCALE_SERVE_HOSTconfig supportREMOTE.mdVerification
bun fmtbun lint(passes with existing warnings)bun typecheckbun --cwd apps/server vitest run src/cli/config.test.ts src/startupAccess.test.tsNote:
bun run testwas started, but theapps/serverVitest worker hung after other packages reported passing and was terminated. The focused server tests touched by this PR pass.