Skip to content

[Bug]: t3 service install ignores the desktop app's Network access / Tailscale HTTPS settings and binds loopback only #21238

Closed as not planned

Description

@felho

Before submitting

Area

apps/server

Steps to reproduce

macOS 26.5.2, T3 Code 0.1.0 (desktop via the t3-code cask, CLI via install.sh), main at da7c4f2.

  1. In the desktop app enable Network access and Tailscale HTTPS (Settings → Connections). Pair a phone and another Mac; both connect.
  2. Quit the desktop app so the environment does not depend on it (the documented reason for the background service).
  3. t3 service install.

Expected behavior

The service hosts the same environment with the same reachability the desktop app had, or service install offers --host / --tailscale-serve (the flags t3 serve already has), or at least warns that the exposure settings will not apply.

Actual behavior

The service starts on 127.0.0.1:3773 only. Every paired remote client shows the environment unavailable, with no hint why.

Mechanics:

  • The server takes host and Serve only from T3CODE_HOST / T3CODE_TAILSCALE_SERVE or the serve flags (apps/server/src/cli/config.ts L130, L158). It never reads desktop-settings.json, where the app persisted serverExposureMode: "network-accessible" and tailscaleServeEnabled: true.
  • renderBootServicePlist (apps/server/src/cloud/bootService.ts ~L152) emits only PATH, T3CODE_HOME and T3_BOOT_SERVICE_UNIT, and t3 service install has no host/serve flags.
  • Paired clients survive the switch (the auth_sessions rows are kept), so the data is all there; only the bind is lost.

Workaround

Add T3CODE_HOST and T3CODE_TAILSCALE_SERVE to the plist's EnvironmentVariables by hand and launchctl bootout / bootstrap. Two pitfalls worth a doc line even if the bug stays: the value must be a plist string (-bool true is silently dropped from the environment by launchd), and with Serve on, T3CODE_HOST must include loopback (0.0.0.0), because Serve proxies to 127.0.0.1:3773; a tailnet-IP-only bind answers 502. Both lines are lost again on t3 update (#12626).

Suggested fix

Either of: t3 service install accepts --host and --tailscale-serve and persists them in the unit; or the service reads the desktop exposure settings when it hosts the same T3CODE_HOME; plus a warning at install time when desktop-settings.json requests network exposure that the unit will not provide.

Activity

  1. juliusmarminge commented on Oct 18, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    This is a feature request, not a bug. The background service is not documented to take over the desktop app's exposure settings. Those settings belong to the desktop app, which passes them to the server it starts. A server started any other way, including the service, takes host and Tailscale Serve only from its flags or T3CODE_HOST / T3CODE_TAILSCALE_SERVE, and binds loopback when neither is set. That default is deliberate, so nothing is exposed to the network without an explicit choice.

    Having t3 service install inherit those settings, accept host and Serve options, or warn about the difference would all be new behavior. Please open it in Ideas: https://github.com/pingdotgg/t3code/discussions/new?category=ideas

    Environment you add to the unit by hand being dropped on t3 update is tracked in #12626. Your notes on string values and binding loopback with Serve are useful there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequested improvement or new capability.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions