mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-05 04:59:26 +09:00
db, state: keep the ephemeral flag a node was created with
The flag moves from the key to the node, so a login with another key no longer changes it. A user claiming a tagged node still clears it. v1 nodes carry the flag.
This commit is contained in:
1 parent
e747f01b49
commit
5ddc442ec3
22 files changed
+183
-57
No files matched your search
@@ -50,6 +50,7 @@ type Node struct {
|
||||
RegisterMethod string `enum:"REGISTER_METHOD_UNSPECIFIED,REGISTER_METHOD_AUTH_KEY,REGISTER_METHOD_CLI,REGISTER_METHOD_OIDC" json:"registerMethod"`
|
||||
GivenName string `json:"givenName"`
|
||||
Online bool `json:"online"`
|
||||
Ephemeral bool `json:"ephemeral"`
|
||||
ApprovedRoutes []string `json:"approvedRoutes" nullable:"false"`
|
||||
AvailableRoutes []string `json:"availableRoutes" nullable:"false"`
|
||||
SubnetRoutes []string `json:"subnetRoutes" nullable:"false"`
|
||||
@@ -600,6 +601,7 @@ func nodeFromView(view types.NodeView) Node {
|
||||
RegisterMethod: registerMethodEnum(view.RegisterMethod()),
|
||||
GivenName: view.GivenName(),
|
||||
Online: view.IsOnline().Valid() && view.IsOnline().Get(),
|
||||
Ephemeral: view.IsEphemeral(),
|
||||
ApprovedRoutes: nonNilStrings(util.PrefixesToString(view.ApprovedRoutes().AsSlice())),
|
||||
AvailableRoutes: nonNilStrings(util.PrefixesToString(view.AnnouncedRoutes())),
|
||||
SubnetRoutes: []string{},
|
||||
|
||||
Reference in new issue
Block a user