feat: Wire up service registration to networking reconciliation

When a service is registered, updated, or deregistered, Central now
automatically regenerates HAProxy routes and dnsmasq DNS entries to
match the current set of registered services.

- L4 tcp-passthrough services (Wild Cloud) → HAProxy SNI routes
- L7 http services (Wild Works) → HAProxy Host-based reverse proxy
- All services with reach != off → dnsmasq DNS entries
- SSE events broadcast on config changes
- Reconciliation runs asynchronously (non-blocking)

This closes the loop: service registration is no longer inert — it
actually updates the networking stack.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-09 03:45:51 +00:00
parent 060a68b601
commit 5defc27f63
2 changed files with 111 additions and 0 deletions

View File

@@ -82,6 +82,10 @@ func NewAPI(dataDir, version string, allowedOrigins []string) (*API, error) {
sseManager: sseManager,
}
// Wire up service registration reconciliation: when services change,
// regenerate dnsmasq DNS entries and HAProxy routes.
api.services.SetReconcileFn(api.reconcileNetworking)
return api, nil
}