Skip to content

t3 serve --host tailnet binds the tailnet address only #5

Closed

Description

@Khang5687

Parent

Spec: #1 — Exposure as a set of listen interfaces (bind-hosts lane).

What to build

The first end-to-end tracer through the CLI and server.

--host, T3CODE_HOST, and the desktop bootstrap envelope accept comma-separated kind keywords (loopback, tailnet, lan) and/or IPv4 addresses. --host may be repeated and values union. A legacy single IP and 0.0.0.0 keep their current meaning. Anything else fails fast with a message listing the accepted forms. Help text is updated.

The server config holds a selection. At launch the resolver runs against the real interface map and the first resolved address feeds the already-prefactored readers (bind, auth policy, runtime state, startup output). If more than one address resolves, bind the first and emit a warning — a temporary state removed by the multi-bind ticket. Resolver warnings surface in runtime state and startup output.

Demo: t3 serve --host tailnet → reachable on the 100.x address, the LAN address is refused, the pairing URL uses the tailnet address. With Tailscale down → loopback only, warning printed.

Acceptance criteria

  • CLI precedence suite: every accepted --host form; repeated flags union; flag > env > bootstrap precedence unchanged; legacy IP and wildcard; the error message for an unknown token lists accepted forms.
  • Seam 1: --host tailnet with an injected map lacking a CGNAT address → only 127.0.0.1 accepts; runtime state carries the loopback-only warning; policy loopback-only.
  • Seam 1: --host loopback → 127.0.0.1 accepts, [::1] refused, policy loopback-only.
  • Seam 1: a selection resolving to a non-loopback address → policy remote-reachable; session-cookie naming follows the same predicate.
  • Startup output (connection string, pairing URL, QR) uses the first non-loopback resolved address, else loopback.
  • Legacy --host 0.0.0.0 remains a single wildcard listener with remote-reachable (the characterization case still passes).
  • t3 pair unchanged and green.
  • The server depends on the tailscale package only for the resolver; no tailscale CLI invocation anywhere on the server.

Blocked by

Activity

  1. added
    ready-for-agent
    on Sep 6, 2026
  2. added a commit that references this issue on Sep 15, 2026
  3. Khang5687 commented on Sep 15, 2026

    @Khang5687
    OwnerAuthor

    Merged into fork-main via #12. Loopback interim recorded in ADR 0003 and pinned on #6.

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

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions