Fill RegisterMethod field in Machine

This commit is contained in:
Juan Font Alonso 2021-05-06 18:26:01 +02:00
parent 9bac805d50
commit fc0c519206
2 changed files with 2 additions and 0 deletions

1
api.go
View file

@ -397,6 +397,7 @@ func (h *Headscale) handleNewServer(c *gin.Context, db *gorm.DB, idKey wgcfg.Key
m.IPAddress = ip.String()
m.NamespaceID = pak.NamespaceID
m.AuthKeyID = uint(pak.ID)
m.RegisterMethod = "authKey"
m.Registered = true
db.Save(&m)

1
cli.go
View file

@ -43,6 +43,7 @@ func (h *Headscale) RegisterMachine(key string, namespace string) error {
m.IPAddress = ip.String()
m.NamespaceID = ns.ID
m.Registered = true
m.RegisterMethod = "cli"
db.Save(&m)
fmt.Println("Machine registered 🎉")
return nil