mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-17 05:55:41 +00:00
ipn/localapi: move cert fetching code to localapi, cache, add cert subcommand
Updates #1235 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
@@ -36,7 +36,6 @@ var debugCmd = &ffcli.Command{
|
||||
fs.BoolVar(&debugArgs.netMap, "netmap", true, "whether to include netmap in --ipn mode")
|
||||
fs.BoolVar(&debugArgs.localCreds, "local-creds", false, "print how to connect to local tailscaled")
|
||||
fs.StringVar(&debugArgs.file, "file", "", "get, delete:NAME, or NAME")
|
||||
fs.StringVar(&debugArgs.getCert, "get-acme-cert", "", "hostname to start ACME flow for (debug)")
|
||||
return fs
|
||||
})(),
|
||||
}
|
||||
@@ -50,16 +49,12 @@ var debugArgs struct {
|
||||
file string
|
||||
prefs bool
|
||||
pretty bool
|
||||
getCert string
|
||||
}
|
||||
|
||||
func runDebug(ctx context.Context, args []string) error {
|
||||
if len(args) > 0 {
|
||||
return errors.New("unknown arguments")
|
||||
}
|
||||
if debugArgs.getCert != "" {
|
||||
return debugGetCert(ctx, debugArgs.getCert)
|
||||
}
|
||||
if debugArgs.localCreds {
|
||||
port, token, err := safesocket.LocalTCPPortAndToken()
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user