Documentation
¶
Overview ¶
Package tailscale is the `tailscale` command as an adapter: this computer's own tailnet addresses and name, the lookup of a connecting device by its address, and the ports Tailscale's own Serve or Funnel configuration names (spc-2610040741034208, decision D3).
abcd does not speak Tailscale's local API itself: how to reach it differs between the macOS app, the macOS standalone build and Linux, and the command already knows. The adapter runs three read-only commands and no other: `status --json --peers=false`, `whois --json <address>` and `serve status --json`. It never asks for a certificate and never changes Tailscale's state (decisions 21 and 23 of itd-2610032150577708), which TestTheAdapterNeverAsksForACertificateOrChangesTailscale holds.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotInstalled: no `tailscale` command on PATH and no app bundle. ErrNotInstalled = errors.New("the tailscale command is not installed") // ErrUnsafeCommand: the command found sits where someone else could // replace it. ErrUnsafeCommand = errors.New("the tailscale command found is not safe to run") // ErrNotRunning: Tailscale is not running, not logged in, or names no // address or name for this computer. ErrNotRunning = errors.New("Tailscale is not running on this computer") // ErrVersionBelowFloor: the installed release is older than VersionFloor. ErrVersionBelowFloor = errors.New("the installed Tailscale is older than this abcd reads") )
The adapter's refusals, each a sentinel a caller can test with errors.Is.
var BundledCommands = []string{"/Applications/Tailscale.app/Contents/MacOS/Tailscale"}
BundledCommands are the places the macOS app keeps its command, tried in order when PATH names none. The app's own wrapper on PATH execs the first.
var VersionFloor = [2]int{1, 102}
VersionFloor is the oldest Tailscale release whose command output this adapter has been shown to read, as major and minor. Source: the dated live receipt of 2026-10-05 (spc-2610040741034208 step 1, kept in the local tier), which ran `status --json --peers=false` and `whois --json` against 1.102.4 on macOS and recorded the keys parsed here; the status JSON's own help warns that the format changes between releases, so an older release is refused rather than read on trust.
Functions ¶
func Resolve ¶
Resolve finds the command once: on PATH through lookPath, then at the first of bundled that exists. It refuses, with ErrUnsafeCommand, a command that is not an absolute path, that sits inside the working tree (tree), in a world-writable folder, or that is itself world-writable: the conditions the plugin hooks refuse for abcd's own binary, because whoever can replace the command decides who the dashboard lets in.
Types ¶
type Client ¶
type Client struct {
// Path is the resolved command (Resolve).
Path string
// contains filtered or unexported fields
}
Client runs the resolved command.
func (*Client) ServedPorts ¶
ServedPorts lists every port Tailscale's own Serve or Funnel configuration names, sorted, so the dashboard never takes one. An answer that is not JSON is an error, never read as no configuration.
type Identity ¶
type Identity struct {
// Node is the device's stable id, the key a device is counted by.
Node string `json:"node"`
// Device is the device's name on the tailnet.
Device string `json:"device"`
// Login is the person's login name.
Login string `json:"login"`
// Person is the person's display name.
Person string `json:"person"`
// Tagged is set when the device carries a tag: it names a machine, not
// a person.
Tagged bool `json:"tagged"`
// another account: it belongs to someone else.
Shared bool `json:"shared"`
}
Identity is what Tailscale's lookup says about a connecting address.
type Self ¶
type Self struct {
// Name is the computer's MagicDNS name, without the trailing dot.
Name string
// Addrs are the computer's own Tailscale addresses, in the order
// Tailscale lists them.
Addrs []netip.Addr
// Version is the release string Tailscale reports.
Version string
}
Self is this computer as Tailscale names it.