f
This commit is contained in:
@@ -238,6 +238,29 @@ def _run(result: Any, args: List[str], config: Dict[str, Any]) -> int:
|
||||
_add_startup_check(startup_table, "FOUND" if cf else "MISSING", "Cookies", detail=str(cf) if cf else "Not found")
|
||||
except Exception: pass
|
||||
|
||||
# ZeroTier Hosting
|
||||
zt_conf = config.get("networking", {}).get("zerotier", {})
|
||||
if zt_conf.get("serve"):
|
||||
from SYS.background_services import ensure_zerotier_server_running
|
||||
ensure_zerotier_server_running()
|
||||
|
||||
serve_target = zt_conf.get("serve")
|
||||
port = zt_conf.get("port") or 999
|
||||
status = "OFFLINE"
|
||||
detail = f"Sharing: {serve_target} on port {port}"
|
||||
try:
|
||||
from API.HTTP import HTTPClient
|
||||
# Probing 127.0.0.1 is more reliable on Windows than localhost
|
||||
with HTTPClient(timeout=1.0, retries=0) as client:
|
||||
resp = client.get(f"http://127.0.0.1:{port}/health")
|
||||
if resp.status_code == 200:
|
||||
status = "ONLINE"
|
||||
payload = resp.json()
|
||||
detail += f" (Live: {payload.get('name', 'unknown')})"
|
||||
except Exception:
|
||||
pass
|
||||
_add_startup_check(startup_table, status, "ZeroTier Host", detail=detail)
|
||||
|
||||
except Exception as exc:
|
||||
debug(f"Status check failed: {exc}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user