feat: NetBox insights, host tools and configurable TUI
Test / test (pull_request) Successful in 4m15s

- info/open/whois: NetBox details (site, nested locations, rack units,
  role, platform, tenant, IPs per interface), web page, reverse IP lookup
- cache status, site, role, platform, tenant, location chain and rack;
  ask before connecting to hosts in ssh.warn_status (--force skips)
- ssh rules and command restrictions match site/role/platform/tenant/status
- tui.columns selects what the TUI shows; optional TCP reachability column;
  detail view (Ctrl+L), NetBox page (Ctrl+G), status/location filters
- resolver.fallback tries other strategies' addresses when unreachable
- copy-id, known-hosts reset and address-change notices
- export ansible (YAML/INI) and export ssh-config
- token: keyring stores NetBox tokens in the system keyring
- fix stale menu number in testenv configure test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-18 12:33:59 +01:00
1 parent e5bde9c61f
commit 1660bb3098
39 files changed
+4868 -96

No files matched your search

+36 -8
View File
@@ -17,14 +17,26 @@ import (
)
type Entry struct {
Resolver string `json:"resolver,omitempty"`
Name string `json:"name"`
IP string `json:"ip"`
Kind string `json:"kind"`
Tags []string `json:"tags,omitempty"`
Cluster string `json:"cluster,omitempty"`
CachedAt time.Time `json:"cached_at"`
LastUsed time.Time `json:"last_used,omitempty"`
Resolver string `json:"resolver,omitempty"`
Name string `json:"name"`
IP string `json:"ip"`
Kind string `json:"kind"`
Tags []string `json:"tags,omitempty"`
Cluster string `json:"cluster,omitempty"`
// ID, Status, Site, Role, Platform and Tenant come from NetBox; entries
// written by older versions lack them until the next refresh.
ID int `json:"id,omitempty"`
Status string `json:"status,omitempty"`
Site *config.Ref `json:"site,omitempty"`
Role *config.Ref `json:"role,omitempty"`
Platform *config.Ref `json:"platform,omitempty"`
Tenant *config.Ref `json:"tenant,omitempty"`
// Location is the chain of nested locations below the site, outermost first.
Location []config.Ref `json:"location,omitempty"`
Rack string `json:"rack,omitempty"`
Position string `json:"position,omitempty"`
CachedAt time.Time `json:"cached_at"`
LastUsed time.Time `json:"last_used,omitempty"`
// Static marks a host from the config's hosts: list. It never expires;
// it is stored only to remember LastUsed for the recently-used list.
Static bool `json:"static,omitempty"`
@@ -427,3 +439,19 @@ func (c *Cache) All() []Entry {
}
return out
}
// RefPtr returns nil for an empty reference, keeping the cache file small.
func RefPtr(r config.Ref) *config.Ref {
if r == (config.Ref{}) {
return nil
}
return &r
}
// RefOf returns the referenced value, or an empty Ref.
func RefOf(r *config.Ref) config.Ref {
if r == nil {
return config.Ref{}
}
return *r
}