mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
cli: introduce exit-node subcommand to list and filter exit nodes
This change introduces a new subcommand, `exit-node`, along with a subsubcommand of `list` and a `--filter` flag. Exit nodes without location data will continue to be displayed when `status` is used. Exit nodes with location data will only be displayed behind `exit-node list`, and in status if they are the active exit node. The `filter` flag can be used to filter exit nodes with location data by country. Exit nodes with Location.Priority data will have only the highest priority option for each country and city listed. For countries with multiple cities, a <Country> <Any> option will be displayed, indicating the highest priority node within that country. Updates tailscale/corp#13025 Signed-off-by: Charlotte Brandhorst-Satzkorn <charlotte@tailscale.com>
This commit is contained in:

committed by
Charlotte Brandhorst-Satzkorn

parent
9d89e85db7
commit
35bdbeda9f
@@ -747,6 +747,7 @@ func (b *LocalBackend) populatePeerStatusLocked(sb *ipnstate.StatusBuilder) {
|
||||
ShareeNode: p.Hostinfo.ShareeNode(),
|
||||
ExitNode: p.StableID != "" && p.StableID == exitNodeID,
|
||||
SSH_HostKeys: p.Hostinfo.SSH_HostKeys().AsSlice(),
|
||||
Location: p.Hostinfo.Location(),
|
||||
}
|
||||
peerStatusFromNode(ps, p)
|
||||
|
||||
|
@@ -273,6 +273,8 @@ type PeerStatus struct {
|
||||
// KeyExpiry, if present, is the time at which the node key expired or
|
||||
// will expire.
|
||||
KeyExpiry *time.Time `json:",omitempty"`
|
||||
|
||||
Location *tailcfg.Location `json:",omitempty"`
|
||||
}
|
||||
|
||||
type StatusBuilder struct {
|
||||
@@ -457,6 +459,7 @@ func (sb *StatusBuilder) AddPeer(peer key.NodePublic, st *PeerStatus) {
|
||||
if t := st.KeyExpiry; t != nil {
|
||||
e.KeyExpiry = ptr.To(*t)
|
||||
}
|
||||
e.Location = st.Location
|
||||
}
|
||||
|
||||
type StatusUpdater interface {
|
||||
|
Reference in New Issue
Block a user