From 3c4c9dc1d2b1b595b35e04363367d9fadca20e6b Mon Sep 17 00:00:00 2001 From: kari-ts <135075563+kari-ts@users.noreply.github.com> Date: Tue, 7 May 2024 13:25:20 -0700 Subject: [PATCH] web: use EditPrefs instead of passing UpdatePrefs to starting (#12040) Web version of https://github.com/tailscale/tailscale-android/pull/370 This allows us to update the prefs rather than creating new prefs Updates tailscale/tailscale#11731 Signed-off-by: kari-ts --- client/web/web.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/web/web.go b/client/web/web.go index b0aefc589..9f9465db9 100644 --- a/client/web/web.go +++ b/client/web/web.go @@ -1150,7 +1150,15 @@ func (s *Server) tailscaleUp(ctx context.Context, st *ipnstate.Status, opt tails if !isRunning { ipnOptions := ipn.Options{AuthKey: opt.AuthKey} if opt.ControlURL != "" { - ipnOptions.UpdatePrefs = &ipn.Prefs{ControlURL: opt.ControlURL} + _, err := s.lc.EditPrefs(ctx, &ipn.MaskedPrefs{ + Prefs: ipn.Prefs{ + ControlURL: opt.ControlURL, + }, + ControlURLSet: true, + }) + if err != nil { + s.logf("edit prefs: %v", err) + } } if err := s.lc.Start(ctx, ipnOptions); err != nil { s.logf("start: %v", err)