cmd/tailscale/cli,ipn/ipnlocal,wgengine/magicsock: implement tailscale debug peer-relay-servers (#16577)

Updates tailscale/corp#30036

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited
2025-07-16 10:03:05 -07:00
committed by GitHub
parent 67514f5eb2
commit 3c6d17e6f1
6 changed files with 71 additions and 0 deletions

View File

@@ -356,6 +356,12 @@ func debugCmd() *ffcli.Command {
ShortHelp: "Print Go's runtime/debug.BuildInfo",
Exec: runGoBuildInfo,
},
{
Name: "peer-relay-servers",
ShortUsage: "tailscale debug peer-relay-servers",
ShortHelp: "Print the current set of candidate peer relay servers",
Exec: runPeerRelayServers,
},
}...),
}
}
@@ -1327,3 +1333,17 @@ func runDebugResolve(ctx context.Context, args []string) error {
}
return nil
}
func runPeerRelayServers(ctx context.Context, args []string) error {
if len(args) > 0 {
return errors.New("unexpected arguments")
}
v, err := localClient.DebugResultJSON(ctx, "peer-relay-servers")
if err != nil {
return err
}
e := json.NewEncoder(os.Stdout)
e.SetIndent("", " ")
e.Encode(v)
return nil
}