feat(fleet): add shared WireGuard profiles and bounded rover transport

Add portable shared WireGuard profiles while retaining Tailscale and Worker boundaries. Bound rover command/telemetry delivery, recovery and diagnostic capture across Core and Node.
This commit is contained in:
DCCONSTRUCTIONS
2026-10-29 09:10:01 +03:00
parent bec20d63e2
commit e06ff9a214
180 changed files with 20140 additions and 400 deletions
+21
View File
@@ -0,0 +1,21 @@
"""Bounded, negotiated compression for the existing full Node heartbeat."""
import zlib
MAX_HEARTBEAT_BYTES = 8 * 1024 * 1024
def decode_heartbeat(body: bytes, encoding: str, path: str) -> bytes:
if not encoding:
return body
if encoding != "gzip" or path != "/v1/node/heartbeat":
raise ValueError("Unsupported encoding")
try:
stream = zlib.decompressobj(16 + zlib.MAX_WBITS)
decoded = stream.decompress(body, MAX_HEARTBEAT_BYTES + 1)
if (len(decoded) > MAX_HEARTBEAT_BYTES or not stream.eof
or stream.unused_data or stream.unconsumed_tail):
raise ValueError("Invalid compressed heartbeat")
return decoded
except zlib.error as error:
raise ValueError("Invalid compressed heartbeat") from error