initial commit

This commit is contained in:
2026-08-25 14:27:22 +01:00
commit 7c9723fd95
14 changed files with 902 additions and 0 deletions

30
launcher/checks.py Normal file
View File

@@ -0,0 +1,30 @@
# checks.py
import socket
class SystemChecks:
def __init__(self, network_targets, ziti_target):
self.network_targets = network_targets
self.ziti_target = ziti_target
def check_network_status(self):
"""Loops through configured network targets and returns True if any succeed."""
for host, port in self.network_targets:
if self._tcp_ping(host, int(port), timeout=1.5):
return True
return False
def check_ziti_status(self):
"""Probes the configured Ziti target endpoint."""
if not self.ziti_target:
return False
host, port = self.ziti_target
return self._tcp_ping(host, int(port), timeout=1.0)
def _tcp_ping(self, host, port, timeout=1):
try:
with socket.create_connection((host, port), timeout=timeout):
return True
except OSError:
return False