README.md

Tailscale phone connection for Paseo #

This plugin starts one foreground Tailscale Serve proxy for its daemon and adds Phone connection to the sidebar footer. Press it to see the full HTTPS URL, Copy URL, and the direct-connection fields Host, Port, and Use SSL: On. Paseo presents the summary in a popover on wide layouts and a bottom sheet on compact layouts. Opening it keeps the current workspace/session in place.

Details and diagnostics opens the Tailscale page. The same page is available from Settings → Plugins → tailscale-serve → Tailscale. It shows the supplying daemon's label/home, optional validated checkout, owned process, mapping, explicit health check, recent logs, and lifecycle controls. Text supports native selection; clipboard failures retain that fallback and report the failure.

Requires Paseo 0.13.x on both daemon and app, an installed connected Tailscale CLI, and HTTPS enabled for the tailnet. Desktop 0.13.0 and Tailscale 1.102.3 were used to verify the APIs and mapping format. No npm dependencies or separate Node installation are needed by the running plugin. Everything edition is optional.

Connecting from iPhone #

Connect the phone to the same Tailscale network. In Paseo choose Settings → Add host → Direct connection. Enter the displayed hostname without https://, the displayed port, and turn Use SSL on. Supply this daemon's password if one is configured. The endpoint is a direct connection, not a relay pairing link.

For example, a daemon on 127.0.0.1:59979 is exposed at https://<machine>.<tailnet>.ts.net:59979/. The HTTPS port is the actual daemon port, leaving 443 for other services. Distinct checkout daemons use their own ports; use the home/checkout shown in the summary to identify the source.

What the status means #

  • Starting / Stopping: the current lifecycle phase is shown.
  • Ready: an owned live foreground child and a fresh exact hostname, HTTPS port, root handler, and loopback target were observed. No Funnel exposure was found for that port. This does not establish phone reachability or login.
  • Needs attention: startup/child failure, a missing/conflicting mapping, unavailable Tailscale inspection, or stale observations. Ordinary proxy failure leaves this plugin's RPC/UI available for diagnostics and explicit Retry.
  • Stopped: temporarily stopped; use Start to expose this daemon again.
  • Unavailable: disconnected host, failed RPC read, or initial loading.

Observations are cached for five seconds and collected once across concurrent RPC readers. Client surfaces share a host-scoped query cache and polling timer: five seconds with connection content open, ten seconds for the sidebar alone. Refresh joins in-flight work. Failed reads and host disconnection immediately remove Ready; observations expire after 30 seconds without revalidation. A known address may remain selectable/copyable, clearly labeled as unverified.

Check connection from daemon explicitly requests the server-derived HTTPS /api/health endpoint with normal certificate validation, no redirects, an eight-second socket timeout/ten-second deadline, and an 8 KiB response limit. Paseo 0.13.0 exposes this read-only route without authentication and returns {status: "ok", timestamp: ...}. Results distinguish expected daemon response, HTTP/authentication response, DNS, TLS, and transport failure. This checks from the daemon machine; phone Tailscale membership, access rules and app login still need checking on the phone. Opening or refreshing the UI never runs this probe.

The recent log preview is bounded in memory (200 records / 64 KiB, 4096 characters per record), with truncation metadata. The UI shows a short contained excerpt; full ordinary plugin logs remain available through Paseo. History resets on reload.

Lifecycle and recovery #

The foreground command is:

tailscale serve --bg=false --https=<daemon-port> http://127.0.0.1:<daemon-port>

Startup waits for a live assigned loopback listener in $PASEO_HOME/paseo.pid, including an initial port zero. IPv6 loopback is supported. Before every attempt it checks Tailscale/MagicDNS and refuses an occupied node Serve/Funnel port, including foreground mappings. It never adopts an existing mapping, resets Serve, enables Funnel, launches a detached/background process, or stops another child. Unknown configuration shapes fail closed. The CLI's documented root JSON null means no configuration; virtual-IP Services entries are separate from the node listener and are preserved.

Startup/retry adds only this exact MagicDNS name to persisted daemon.hostnames through the bundled Paseo CLI, preserving other allowed names. That entry remains after Stop. Status, logs, and health reads never repair configuration.

Start is available after Stop; Retry after failure. Neither retries automatically. Stop requires confirmation because it closes the route and can disconnect phones or other clients. The daemon/workspaces remain running; the final result may not reach a client using the closed route. Keep Desktop or a terminal available first. Stop is temporary: plugin reload or daemon restart automatically starts a new attempt. Use Paseo's Disable control for a persistent stop.

Controls reserve UUID receipts before scheduling work. Expected plugin instance, attempt and revision fence stale clients. Duplicate identical requests return the same receipt; conflicting payloads reject. Only one lifecycle operation runs, except Stop may cancel an in-progress Start. No new child starts before the old child exits. Lost acknowledgements require Reconcile request and refresh; the UI never automatically resubmits an unresolved request. The server retains at most 100 receipts (20 in status), with lookup for older retained receipts. Reload creates a new instance and clears this history; it is not durable storage. If a result is unknown/expired, inspect current state and recover from Desktop or terminal rather than replaying the old envelope.

Reload, disable, removal, daemon shutdown, and loss of daemon IPC stop the owned child: SIGINT, then SIGKILL after one second if necessary. Foreground Serve removes its session on CLI exit. Closing Desktop leaves daemon and proxy running. Force-killing the plugin itself bypasses cleanup; prefer normal lifecycle actions.

The checkout launcher discovers this directory automatically:

nix run ./experimental/paseo-everything-edition#reload -- tailscale-serve
nix run ./experimental/paseo-everything-edition#logs -- tailscale-serve

Use #restart to restart the whole checkout instance or #stop to stop its daemon and proxy. Without the launcher, use Paseo's plugin settings or its CLI with the correct --home. CLI defaults to tailscale on the daemon PATH; override with PASEO_TAILSCALE_BINARY=/absolute/path/to/tailscale before daemon restart. PASEO_CLI supplies the bundled configuration CLI. Optional PASEO_CHECKOUT_ROOT is shown only if its canonical .paseo-dev is this home.

Verification #

nix flake check ./experimental/paseo-everything-edition runs fake-CLI lifecycle, conflict, failure, cancellation, concurrency, cache/log bounds and client-state tests. The foreground JSON fixture is sanitized from Tailscale 1.102.3. Its empty JSON semantics are confirmed by the Tailscale CLI source. Public UI integration follows the Paseo plugin reference.

The opt-in installed-app harness uses disposable homes, two different daemon ports, and a fake CLI whose foreground mapping follows child lifetime. It checks standalone operation without Everything edition, real RPC validation and UI, copy success/denial, diagnostics and lifecycle controls, delayed host switching, RPC failure and host disconnection. Screenshots and an acceptance record go outside the repository:

python3 experimental/paseo-everything-edition/tests/smoke_tailscale_ui.py \
  --helper /path/to/paseo-checkout-helper \
  --artifacts /private/tmp/paseo-tailscale-ui

Run installed-app harnesses sequentially. Desktop viewport/media/text emulation is not physical iPhone coverage. A real Tailscale 1.102.3 check also passed against a disposable daemon: exact foreground mapping, normal-TLS /api/health, Stop/Start, and complete cleanup with the existing Serve configuration preserved exactly.

Remaining manual acceptance: physical iPhone sheet gestures/safe areas/selection/copy/direct login/larger text. Do not stop another daemon's proxy or reset Serve configuration for these checks.