mirror of
https://github.com/tale/headplane.git
synced 2026-08-19 09:26:18 +00:00
fix(agent): always spawn agent with pre-auth key and auto-approve
- Generate a fresh pre-auth key for every agent startup - Preserve existing tailscale state to avoid creating a new host - Auto-approve pending auth requests via /api/v1/auth/approve - Show approval link in settings UI as fallback Closes HP-558
This commit is contained in:
@@ -30,6 +30,17 @@ func main() {
|
||||
}
|
||||
|
||||
log.SetDebug(cfg.Debug)
|
||||
|
||||
if cfg.TSAuthKey == "" {
|
||||
log.Info("No TS_AUTHKEY provided; tsnet will use existing state or prompt for interactive login")
|
||||
} else {
|
||||
prefix := cfg.TSAuthKey
|
||||
if len(prefix) > 16 {
|
||||
prefix = prefix[:16]
|
||||
}
|
||||
log.Info("TS_AUTHKEY provided (prefix: %s); connecting with pre-auth key", prefix)
|
||||
}
|
||||
|
||||
agent := tsnet.NewAgent(cfg)
|
||||
defer agent.Shutdown()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user