agent v0.3.16: statut service d'applications basé sur la connexion Tailscale effective

This commit is contained in:
EduBox Dev
2026-06-28 19:57:06 +00:00
parent adab165274
commit 41929be34c
3 changed files with 33 additions and 3 deletions
+27
View File
@@ -213,6 +213,33 @@ func getTailscaleIP() string {
return tsIP
}
// isTailscaleReady reports whether tailscaled is running and has successfully
// joined the tailnet (i.e. it has a Tailscale IP). This is a stronger check
// than isTailscaleRunning which only verifies the process exists.
func isTailscaleReady() bool {
if !isTailscaleRunning() {
return false
}
tsCmdMu.Lock()
socket := tsSocket
tsCmdMu.Unlock()
if socket == "" {
return false
}
statusCmd := exec.Command(tailscaleBin("tailscale"), "--socket="+socket, "status", "--json")
hideWindow(statusCmd)
out, err := statusCmd.Output()
if err != nil {
return false
}
var st tailscaleStatus
if err := json.Unmarshal(out, &st); err != nil {
return false
}
return len(st.Self.TailscaleIPs) > 0
}
// setupTailscaleServe configures Tailscale to proxy inbound Tailnet traffic
// on the given TCP port to localhost:<port>. This is required on Windows
// because userspace networking does not forward incoming connections to