Advertise Tailscale Serve HTTPS startup URLs #2835
main fromrefs/pull/2835/head·opened View on GitHubRelated to #2834
Summary#
- advertise the Tailscale Serve HTTPS URL in startup and pairing output after Serve setup completes
- add
--tailscale-serve-host/T3CODE_TAILSCALE_SERVE_HOSTfor explicit MagicDNS host overrides - fall back to the normal HTTP startup URL when Serve setup or Tailscale status discovery is unavailable
Notes#
I saw the project note that PRs are not currently being accepted, so this is offered as a small implementation reference for the linked feature request. Please feel free to use, adapt, or ignore it.
Validation#
bun fmtbun lintbun typecheckbunx vitest run --reporter=verboseinapps/server
Note
Advertise Tailscale Serve HTTPS URLs at server startup#
- Adds
resolveAdvertisedStartupBaseUrlin startupAccess.ts that builds an HTTPS Tailnet base URL when Tailscale Serve is configured, using either an explicit--tailscale-serve-hostflag or MagicDNS name fromtailscale status. - Headless serve access info (connection string and pairing URL) now uses the HTTPS Tailnet URL when available, falling back to the local HTTP base URL on error or when Tailscale Serve is unconfigured.
- Introduces
TailscaleServeRuntimein tailscaleServeRuntime.ts, a coordination service using aDeferred<boolean>to signal whether Tailscale Serve was configured successfully during server startup. - Adds the
--tailscale-serve-hostCLI flag andT3CODE_TAILSCALE_SERVE_HOSTenv var to override the advertised hostname. - Behavioral Change: startup URLs shown to users (including pairing URLs) may now be HTTPS Tailnet addresses rather than local HTTP URLs when Tailscale Serve is active.
Note
Medium Risk Changes what users see for pairing and browser open URLs when Tailscale Serve is enabled; misconfiguration could point clients at the wrong host, but failures fall back to HTTP.
Overview
When --tailscale-serve is enabled, startup and headless pairing output can now advertise an HTTPS Tailnet base URL instead of only the local HTTP bind address.
The server adds resolveAdvertisedStartupBaseUrl, which waits on a new TailscaleServeRuntime signal (Serve setup succeeded or not), then builds the URL from --tailscale-serve-host / T3CODE_TAILSCALE_SERVE_HOST or from MagicDNS via tailscale status, with fallback to the existing HTTP URL if Serve or discovery fails. Headless connection strings, pairing URLs, and browser startup targets use that advertised URL.
Config and docs cover the new host override and MagicDNS discovery behavior.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4c019e81e036fe2f78aa6d3226b6195cefb4776e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
Approvability#
Verdict: Needs human review
This PR introduces new user-facing behavior by changing how startup URLs are advertised based on Tailscale Serve configuration. New features that modify runtime behavior shown to users warrant human review.
You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Closing as part of backlog cleanup: this PR is stale, currently conflicting with main, has no approval, and has not had active remediation for 30+ days. If the change is still relevant, please rebase onto current main and request reopening or submit a focused current diff. Thank you for the contribution.
juliusmarminge closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
b790894c-9b24-4b9e-874d-41c1adacb5beYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
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