From ea9c7f991aa8bfd19afe04ea54b7a59017450f90 Mon Sep 17 00:00:00 2001 From: Sonia Appasamy Date: Tue, 9 Jan 2024 17:01:43 -0500 Subject: [PATCH] cli/set: add printout when web client started Prints a helpful message with the web UI's address when running tailscale set --webclient. Updates tailscale/corp#16345 Signed-off-by: Sonia Appasamy --- cmd/tailscale/cli/set.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cmd/tailscale/cli/set.go b/cmd/tailscale/cli/set.go index a8d7a26af..02d4f5a06 100644 --- a/cmd/tailscale/cli/set.go +++ b/cmd/tailscale/cli/set.go @@ -12,6 +12,7 @@ import ( "os/exec" "github.com/peterbourgon/ff/v3/ffcli" + "tailscale.com/client/web" "tailscale.com/clientupdate" "tailscale.com/ipn" "tailscale.com/net/netutil" @@ -193,7 +194,15 @@ func runSet(ctx context.Context, args []string) (retErr error) { } _, err = localClient.EditPrefs(ctx, maskedPrefs) - return err + if err != nil { + return err + } + + if setArgs.runWebClient && len(st.TailscaleIPs) > 0 { + printf("\nWeb interface now running at %s:%d", st.TailscaleIPs[0], web.ListenPort) + } + + return nil } // calcAdvertiseRoutesForSet returns the new value for Prefs.AdvertiseRoutes based on the