API by router
Edge routes
Get Edge Health
Proxy the edge-sync agent's health endpoint over WireGuard.
Returns the edge agent's self-reported sync state: last successful sync, consecutive failures, sync lag, domain count, Caddy reloads.
Forwards the edge agent's HTTP status code: 200 — edge healthy (last sync within 3× poll interval) 503 — edge degraded, unreachable, timed out, or errored
"Houston, we have a problem." — Jack Swigert, Apollo 13 (about edge proxies that stop syncing)
Response Body
curl -X GET "https://loading/internal/edge/health"nullGet Edge Routes
Return the full domain → VPS route table for the edge proxy.
Query logic:
- Find all TenantBranding rows with a verified custom_domain AND edge_instance_id pinned (domain_verified=True AND custom_domain IS NOT NULL AND edge_instance_id IS NOT NULL)
- Join to that specific instance (must be running + have VPN IP)
- Build route entries — one domain, one instance, no spraying
"One ring to rule them all, one ring to find them." — Gandalf (about one domain routing to exactly one instance, not all of them)
Response Body
curl -X GET "https://loading/internal/edge/routes"{
"hmac_sha256": "string",
"routes": [
{
"domain": "string",
"gateway_port": 18789,
"vpn_ip": "string"
}
],
"version": 0
}