mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-14 23:17:29 +00:00
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:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user