mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-26 00:17:48 +00:00
@@ -16,6 +16,7 @@ type Machine struct {
|
||||
ID uint64 `gorm:"primary_key"`
|
||||
MachineKey string `gorm:"type:varchar(64);unique_index"`
|
||||
NodeKey string
|
||||
DiscoKey string
|
||||
IPAddress string
|
||||
|
||||
Registered bool // temp
|
||||
@@ -44,6 +45,10 @@ func (m Machine) toNode() (*tailcfg.Node, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dKey, err := wgcfg.ParseHexKey(m.DiscoKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
addrs := []netaddr.IPPrefix{}
|
||||
allowedIPs := []netaddr.IPPrefix{}
|
||||
|
||||
@@ -81,6 +86,7 @@ func (m Machine) toNode() (*tailcfg.Node, error) {
|
||||
Key: tailcfg.NodeKey(nKey),
|
||||
KeyExpiry: *m.Expiry,
|
||||
Machine: tailcfg.MachineKey(mKey),
|
||||
DiscoKey: tailcfg.DiscoKey(dKey),
|
||||
Addresses: addrs,
|
||||
AllowedIPs: allowedIPs,
|
||||
Endpoints: endpoints,
|
||||
|
Reference in New Issue
Block a user