envknob, hostinfo, ipn/ipnlocal: add start of opt-in remote update support

Updates #6907

Change-Id: I85db4f6f831dd5ff7a9ef4bfa25902607e0c1558
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2023-01-21 10:04:43 -08:00
committed by Brad Fitzpatrick
parent b74db24149
commit b6aa1c1f22
7 changed files with 131 additions and 1 deletions

View File

@@ -92,7 +92,8 @@ type CapabilityVersion int
// - 52: 2023-01-05: client can handle c2n POST /logtail/flush
// - 53: 2023-01-18: client respects explicit Node.Expired + auto-sets based on Node.KeyExpiry
// - 54: 2023-01-19: Node.Cap added, PeersChangedPatch.Cap, uses Node.Cap for ExitDNS before Hostinfo.Services fallback
const CurrentCapabilityVersion CapabilityVersion = 54
// - 55: 2023-01-23: start of c2n GET+POST /update handler
const CurrentCapabilityVersion CapabilityVersion = 55
type StableID string
@@ -528,6 +529,7 @@ type Hostinfo struct {
ShareeNode bool `json:",omitempty"` // indicates this node exists in netmap because it's owned by a shared-to user
NoLogsNoSupport bool `json:",omitempty"` // indicates that the user has opted out of sending logs and support
WireIngress bool `json:",omitempty"` // indicates that the node wants the option to receive ingress connections
AllowsUpdate bool `json:",omitempty"` // indicates that the node has opted-in to admin-console-drive remote updates
Machine string `json:",omitempty"` // the current host's machine type (uname -m)
GoArch string `json:",omitempty"` // GOARCH value (of the built binary)
GoArchVar string `json:",omitempty"` // GOARM, GOAMD64, etc (of the built binary)

View File

@@ -137,6 +137,7 @@ var _HostinfoCloneNeedsRegeneration = Hostinfo(struct {
ShareeNode bool
NoLogsNoSupport bool
WireIngress bool
AllowsUpdate bool
Machine string
GoArch string
GoArchVar string

View File

@@ -50,6 +50,7 @@ func TestHostinfoEqual(t *testing.T) {
"ShareeNode",
"NoLogsNoSupport",
"WireIngress",
"AllowsUpdate",
"Machine",
"GoArch",
"GoArchVar",

View File

@@ -276,6 +276,7 @@ func (v HostinfoView) ShieldsUp() bool { return v.ж.ShieldsUp }
func (v HostinfoView) ShareeNode() bool { return v.ж.ShareeNode }
func (v HostinfoView) NoLogsNoSupport() bool { return v.ж.NoLogsNoSupport }
func (v HostinfoView) WireIngress() bool { return v.ж.WireIngress }
func (v HostinfoView) AllowsUpdate() bool { return v.ж.AllowsUpdate }
func (v HostinfoView) Machine() string { return v.ж.Machine }
func (v HostinfoView) GoArch() string { return v.ж.GoArch }
func (v HostinfoView) GoArchVar() string { return v.ж.GoArchVar }
@@ -312,6 +313,7 @@ var _HostinfoViewNeedsRegeneration = Hostinfo(struct {
ShareeNode bool
NoLogsNoSupport bool
WireIngress bool
AllowsUpdate bool
Machine string
GoArch string
GoArchVar string