HydraCore
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)

GET
/internal/edge/health

Response Body

curl -X GET "https://loading/internal/edge/health"
null

Get Edge Routes

Return the full domain → VPS route table for the edge proxy.

Query logic:

  1. 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)
  2. Join to that specific instance (must be running + have VPN IP)
  3. 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)

GET
/internal/edge/routes

Response Body

curl -X GET "https://loading/internal/edge/routes"
{
  "hmac_sha256": "string",
  "routes": [
    {
      "domain": "string",
      "gateway_port": 18789,
      "vpn_ip": "string"
    }
  ],
  "version": 0
}