mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 19:51:41 +00:00
cmd/tailscale/cli: display currently active exit node in tailscale status
.
Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
parent
6064b6ff47
commit
a046b48593
@ -159,13 +159,18 @@ func runStatus(ctx context.Context, args []string) error {
|
|||||||
relay := ps.Relay
|
relay := ps.Relay
|
||||||
anyTraffic := ps.TxBytes != 0 || ps.RxBytes != 0
|
anyTraffic := ps.TxBytes != 0 || ps.RxBytes != 0
|
||||||
if !active {
|
if !active {
|
||||||
if anyTraffic {
|
if ps.ExitNode {
|
||||||
|
f("idle; exit node")
|
||||||
|
} else if anyTraffic {
|
||||||
f("idle")
|
f("idle")
|
||||||
} else {
|
} else {
|
||||||
f("-")
|
f("-")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
f("active; ")
|
f("active; ")
|
||||||
|
if ps.ExitNode {
|
||||||
|
f("exit node; ")
|
||||||
|
}
|
||||||
if relay != "" && ps.CurAddr == "" {
|
if relay != "" && ps.CurAddr == "" {
|
||||||
f("relay %q", relay)
|
f("relay %q", relay)
|
||||||
} else if ps.CurAddr != "" {
|
} else if ps.CurAddr != "" {
|
||||||
|
@ -234,6 +234,7 @@ func (b *LocalBackend) UpdateStatus(sb *ipnstate.StatusBuilder) {
|
|||||||
Created: p.Created,
|
Created: p.Created,
|
||||||
LastSeen: lastSeen,
|
LastSeen: lastSeen,
|
||||||
ShareeNode: p.Hostinfo.ShareeNode,
|
ShareeNode: p.Hostinfo.ShareeNode,
|
||||||
|
ExitNode: p.StableID != "" && p.StableID == b.prefs.ExitNodeID,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,6 +77,7 @@ type PeerStatus struct {
|
|||||||
LastSeen time.Time // last seen to tailcontrol
|
LastSeen time.Time // last seen to tailcontrol
|
||||||
LastHandshake time.Time // with local wireguard
|
LastHandshake time.Time // with local wireguard
|
||||||
KeepAlive bool
|
KeepAlive bool
|
||||||
|
ExitNode bool // true if this is the currently selected exit node.
|
||||||
|
|
||||||
// ShareeNode indicates this node exists in the netmap because
|
// ShareeNode indicates this node exists in the netmap because
|
||||||
// it's owned by a shared-to user and that node might connect
|
// it's owned by a shared-to user and that node might connect
|
||||||
@ -244,6 +245,9 @@ func (sb *StatusBuilder) AddPeer(peer key.Public, st *PeerStatus) {
|
|||||||
if st.KeepAlive {
|
if st.KeepAlive {
|
||||||
e.KeepAlive = true
|
e.KeepAlive = true
|
||||||
}
|
}
|
||||||
|
if st.ExitNode {
|
||||||
|
e.ExitNode = true
|
||||||
|
}
|
||||||
if st.ShareeNode {
|
if st.ShareeNode {
|
||||||
e.ShareeNode = true
|
e.ShareeNode = true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user