agent v0.3.8: fix crash UI notifications, auto Podman machine DNS, WordPress 7.0.0 ready template

This commit is contained in:
EduBox Dev
2026-06-26 15:24:21 +00:00
parent a414f03a59
commit cf8b66340a
15 changed files with 590 additions and 35 deletions
+16 -2
View File
@@ -62,6 +62,10 @@ func main() {
log.Printf("[%s Agent] version=%s node=%s data-dir=%s server=%s", APP_NAME, version, cfg.NodeID, *dataDir, cfg.Server)
// Ensure Podman machine DNS is configured on Windows/macOS so images can be
// pulled and containers can reach the internet.
ensurePodmanMachineDNS()
if *uiEnabled {
go startUI(*dataDir, cfg.NodeID, cfg.Server)
}
@@ -84,6 +88,11 @@ func main() {
cleanupWg.Add(1)
go func() {
defer cleanupWg.Done()
defer func() {
if r := recover(); r != nil {
log.Printf("PANIC in cleanup goroutine: %v", r)
}
}()
<-shutdownCh
log.Println("Cleaning up before exit...")
@@ -98,8 +107,8 @@ func main() {
if info.Status == "running" {
log.Printf("Stopping instance %s", id)
_ = dockerComposeStop(*dataDir, id)
info.Status = "stopped"
_ = sendMessage(WSMessage{Action: "instance_stopped", InstanceID: id})
inst[id].Status = "stopped"
go sendMessage(WSMessage{Action: "instance_stopped", InstanceID: id})
}
}
_ = saveInstances(*dataDir, inst)
@@ -127,6 +136,11 @@ func main() {
}
func startTailscaleAndReport(dataDir, nodeID, headscaleURL, authKey string) {
defer func() {
if r := recover(); r != nil {
log.Printf("PANIC in startTailscaleAndReport: %v", r)
}
}()
ip, err := startTailscale(dataDir, nodeID, headscaleURL, authKey)
if err != nil {
log.Printf("Tailscale error: %v", err)