mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 13:18:53 +00:00
ipn: add user pref for running web client
This is not currently exposed as a user-settable preference through `tailscale up` or `tailscale set`. Instead, the preference is set when turning the web client on and off via localapi. In a subsequent commit, the pref will be used to automatically start the web client on startup when appropriate. Updates tailscale/corp#14335 Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
@@ -2249,10 +2249,20 @@ func (h *Handler) serveWeb(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
// try to set pref, but ignore errors
|
||||
_, _ = h.b.EditPrefs(&ipn.MaskedPrefs{
|
||||
Prefs: ipn.Prefs{RunWebClient: true},
|
||||
RunWebClientSet: true,
|
||||
})
|
||||
w.WriteHeader(http.StatusOK)
|
||||
return
|
||||
case "/localapi/v0/web/stop":
|
||||
h.b.WebShutdown()
|
||||
// try to set pref, but ignore errors
|
||||
_, _ = h.b.EditPrefs(&ipn.MaskedPrefs{
|
||||
Prefs: ipn.Prefs{RunWebClient: false},
|
||||
RunWebClientSet: true,
|
||||
})
|
||||
w.WriteHeader(http.StatusOK)
|
||||
return
|
||||
default:
|
||||
|
Reference in New Issue
Block a user