Skip to content

Desktop exposure carries a listen-interface selection #7

Closed

Description

@Khang5687

Parent

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

What to build

The desktop's exposure becomes a selection end to end, with no new UI yet.

  • Exposure state and the set-exposure IPC gain listenInterfaces. The legacy mode remains in state as a derived field (local-only iff exactly {loopback}). The legacy set-mode input is still accepted and mapped to presets, so untouched upstream consumers keep working.
  • Persisted desktop settings gain a listenInterfaces key with one-way migration from the legacy key (network-accessible → lan preset; local-only → {loopback}) and dual write of the derived legacy value so an upstream build reads something sane after a downgrade.
  • The bootstrap envelope carries the selection — never a pre-resolved IP and never a wildcard. The server resolves.
  • Any change to the selection (set inequality on kinds or addresses) requires a full relaunch; there is no hot rebind.
  • Tailscale Serve is available only when tailnet is selected; deselecting it disables Serve, mirroring today's local-only behaviour.
  • Advertised endpoints derive from the selection: loopback always; tailnet IP (and the MagicDNS HTTPS endpoint when Serve is on) only when tailnet is selected and resolved; one LAN endpoint per resolved LAN address only when lan is selected; one endpoint per explicit address. The existing manual endpoint flow is unchanged.
  • State carries resolved addresses and warnings, computed through the shared resolver for display; the server stays authoritative.

Demo: the existing switch turned on → the backend relaunches with the lan preset. A {loopback, tailnet} selection set via IPC (devtools) → relaunch, only the tailnet endpoint advertised, a LAN client refused. An upgraded settings file migrates without changing exposure.

Interim: until the multi-bind ticket lands, the lan preset binds first-address-plus-warning. Acceptable; note it in the PR.

Acceptance criteria

  • Desktop exposure layer tests (existing harness with mocked interfaces, Tailscale spawner, settings dir): migration from the legacy key, persistence round-trip, dual write, relaunch required on set change and not otherwise, Serve gating on tailnet, endpoints per selection (no LAN endpoint without lan, no tailnet endpoint without tailnet, explicit addresses advertised).
  • Legacy set-mode IPC still works and maps to presets; the derived mode in state is correct for every selection.
  • The bootstrap envelope carries the selection; the server parses it; the desktop never sends a resolved IP or a wildcard.
  • State exposes resolved addresses and warnings; the desktop network-access atom exposes selection, preset, resolved addresses, and warnings, and its existing test is updated and green (no UI changes).
  • Mobile untouched; the contracts change is purely additive.
  • New logic in fork-only modules; upstream files receive thin call-site edits only.

Blocked by

Activity

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

    @Khang5687
    OwnerAuthor

    Merged into fork-main via #14. Server-side duplicate fallback filed as #15.

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