TailscaleServeService
Defined in: src/tailscale.ts:88
Dynamically (un)registers per-slot tailscale serve mappings as preview
listeners bind/tear down. ALL mutations run through ONE sequential queue
because tailscale serve read-modify-writes shared config — concurrent
execs race and lose entries (see serveRange history / removed eager path).
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TailscaleServeService(
opts):TailscaleServeService
Defined in: src/tailscale.ts:92
Parameters
Section titled “Parameters”Returns
Section titled “Returns”TailscaleServeService
Methods
Section titled “Methods”reconcileStartup()
Section titled “reconcileStartup()”reconcileStartup():
Promise<void>
Defined in: src/tailscale.ts:150
Clear the whole preview range at boot (recover stale mappings from a crashed
prior run). One queued op running the offs sequentially; tolerates per-port failure.
NOTE: this also removes any pre-existing MANUAL tailscale serve mappings in the
range — by design, since with SHEPHERD_PREVIEW_AUTO_SERVE on (default) Shepherd owns
the range and registers slots dynamically. The startup log below makes that explicit
so the ownership transfer isn’t silent for operators upgrading from a manual setup.
Returns
Section titled “Returns”Promise<void>
register()
Section titled “register()”register(
id,port):Promise<void>
Defined in: src/tailscale.ts:112
Parameters
Section titled “Parameters”string
number
Returns
Section titled “Returns”Promise<void>
snapshot()
Section titled “snapshot()”snapshot():
Record<string,ServeState>
Defined in: src/tailscale.ts:190
Returns
Section titled “Returns”Record<string, ServeState>
stopAll()
Section titled “stopAll()”stopAll():
void
Defined in: src/tailscale.ts:177
Synchronous shutdown teardown (process exit/SIGTERM): off only the slots we
registered (≤ active previews, capped at count). Worst-case wall time is
registered-slots × SYNC_TIMEOUT_MS (≤ 16 × 1.5s = 24s) and only approaches that
if tailscaled is hung; a healthy daemon offs each slot in well under a second.
Best-effort: any slot that errors/times out is skipped and self-heals on the next
boot’s reconcileStartup (which clears the whole range), so we never block exit on it.
Returns
Section titled “Returns”void
unregister()
Section titled “unregister()”unregister(
id):Promise<void>
Defined in: src/tailscale.ts:127
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<void>