Skip to content
Source
Sign inSign up
pingdotgg/t3code

Advertise Tailscale Serve HTTPS startup URLs #2835

Closedjohnlombardo-dev(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/2835/headopened View on GitHub

Related 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_HOST for 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 fmt
  • bun lint
  • bun typecheck
  • bunx vitest run --reporter=verbose in apps/server

Note

Advertise Tailscale Serve HTTPS URLs at server startup

  • Adds resolveAdvertisedStartupBaseUrl in startupAccess.ts that builds an HTTPS Tailnet base URL when Tailscale Serve is configured, using either an explicit --tailscale-serve-host flag or MagicDNS name from tailscale 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 TailscaleServeRuntime in tailscaleServeRuntime.ts, a coordination service using a Deferred<boolean> to signal whether Tailscale Serve was configured successfully during server startup.
  • Adds the --tailscale-serve-host CLI flag and T3CODE_TAILSCALE_SERVE_HOST env 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.
Macroscope summarized 4c019e8.

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. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: b790894c-9b24-4b9e-874d-41c1adacb5be

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      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 and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. 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).
    4. 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.

    5. juliusmarminge closed this

Sign in to join this conversation.