summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@tailscale.com>2021-03-12 06:43:33 -0800
committerDavid Crawshaw <crawshaw@tailscale.com>2021-03-12 08:03:38 -0800
commit005c67a0db315716c48b7c25ceb4b1013899de1d (patch)
tree12ed0605623550b877fbe81bfa9a9812cf5ad0fa
parent1bc3c03562f26bfa9e4e6ad5ef71132ef2cc1847 (diff)
downloadtailscale-crawshaw/tailscalestatus.tar.xz
tailscale-crawshaw/tailscalestatus.zip
ipnstate, ipnlocal: add AuthURL to statuscrawshaw/tailscalestatus
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
-rw-r--r--ipn/ipnlocal/local.go1
-rw-r--r--ipn/ipnstate/ipnstate.go7
2 files changed, 8 insertions, 0 deletions
diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go
index e0af0c656..89b2562a9 100644
--- a/ipn/ipnlocal/local.go
+++ b/ipn/ipnlocal/local.go
@@ -213,6 +213,7 @@ func (b *LocalBackend) UpdateStatus(sb *ipnstate.StatusBuilder) {
defer b.mu.Unlock()
sb.SetBackendState(b.state.String())
+ sb.SetAuthURL(b.authURL)
// TODO: hostinfo, and its networkinfo
// TODO: EngineStatus copy (and deprecate it?)
diff --git a/ipn/ipnstate/ipnstate.go b/ipn/ipnstate/ipnstate.go
index c1232f335..b89f7bb08 100644
--- a/ipn/ipnstate/ipnstate.go
+++ b/ipn/ipnstate/ipnstate.go
@@ -27,6 +27,7 @@ import (
// Status represents the entire state of the IPN network.
type Status struct {
BackendState string
+ AuthURL string // current URL provided by control to authorize client
TailscaleIPs []netaddr.IP // Tailscale IP(s) assigned to this node
Self *PeerStatus
@@ -110,6 +111,12 @@ func (sb *StatusBuilder) SetBackendState(v string) {
sb.st.BackendState = v
}
+func (sb *StatusBuilder) SetAuthURL(v string) {
+ sb.mu.Lock()
+ defer sb.mu.Unlock()
+ sb.st.AuthURL = v
+}
+
func (sb *StatusBuilder) SetMagicDNSSuffix(v string) {
sb.mu.Lock()
defer sb.mu.Unlock()