mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 13:35:23 +00:00
Fill RegisterMethod field in Machine
This commit is contained in:
parent
9bac805d50
commit
fc0c519206
1
api.go
1
api.go
@ -397,6 +397,7 @@ func (h *Headscale) handleNewServer(c *gin.Context, db *gorm.DB, idKey wgcfg.Key
|
|||||||
m.IPAddress = ip.String()
|
m.IPAddress = ip.String()
|
||||||
m.NamespaceID = pak.NamespaceID
|
m.NamespaceID = pak.NamespaceID
|
||||||
m.AuthKeyID = uint(pak.ID)
|
m.AuthKeyID = uint(pak.ID)
|
||||||
|
m.RegisterMethod = "authKey"
|
||||||
m.Registered = true
|
m.Registered = true
|
||||||
db.Save(&m)
|
db.Save(&m)
|
||||||
|
|
||||||
|
1
cli.go
1
cli.go
@ -43,6 +43,7 @@ func (h *Headscale) RegisterMachine(key string, namespace string) error {
|
|||||||
m.IPAddress = ip.String()
|
m.IPAddress = ip.String()
|
||||||
m.NamespaceID = ns.ID
|
m.NamespaceID = ns.ID
|
||||||
m.Registered = true
|
m.Registered = true
|
||||||
|
m.RegisterMethod = "cli"
|
||||||
db.Save(&m)
|
db.Save(&m)
|
||||||
fmt.Println("Machine registered 🎉")
|
fmt.Println("Machine registered 🎉")
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user