Skip to content

share_status: return structured endpoints with an explicit public/Funnel flag #43

Closed

Description

@TMHSDigital

Why it matters

share_status returns the CLI's human-readable text, so an agent can't reliably answer "is anything on this machine exposed to the internet right now?" That's the main safety question for a server whose headline feature is Serve/Funnel.

Evidence

src/tools/share.ts:45-56 returns { active, status: raw }, and active is a regex on /^No serve config/. tailscale serve status --json gives the full ServeConfig (TCP/Web handlers per host:port, and AllowFunnel per endpoint).

Suggested approach

Parse serve status --json into:

{ "active": true, "publicExposure": true,
  "endpoints": [{ "url": "https://devpc.tail1234.ts.net/", "httpsPort": 443, "path": "/", "proxy": "http://127.0.0.1:3000", "public": true }] }

Fall back to text if the JSON flag is unavailable on older clients. Use the same structure in stop_share before/after output and in the planned multi-share support.

Done when

share_status returns a typed list of endpoints with a per-endpoint public flag and a top-level publicExposure, backed by fixture tests from real CLI JSON.

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

    enhancementpriority: P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions