automc: operator UI on AUTOMC_UI_BINDING
CI / validate (push) Successful in 12s
CI / docker (push) Successful in 15s

Adds a separate HTTP server (not the upstream API on :25590) for the
operator dashboard. Single-page UI with two panes:
  * routes table — current pg-synced mappings, polled every 2s
  * logs — SSE stream backed by a logrus hook + 500-entry ring buffer

Opt-in via AUTOMC_UI_BINDING (e.g. ":8082"); unset = no-op, behaves
exactly like upstream. Designed to live behind server-manager's
/infra/mc-router/* reverse-proxy.

Patch is internal/automc-only, same fork philosophy as the rest —
upstream files stay verbatim.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 18:03:48 +02:00
parent 004ee6dbfd
commit e2ce0453fa
4 changed files with 394 additions and 0 deletions
+9
View File
@@ -20,5 +20,14 @@ func Wire(ctx context.Context) error {
s := newSyncer(dsn, waker)
go s.run(ctx)
logrus.Info("automc: pg route sync started")
// Operator UI on a separate port — upstream's API_BINDING stays
// JSON-only and untouched. Enable by setting AUTOMC_UI_BINDING (e.g.
// ":8082"); leave unset to skip and behave exactly like upstream.
if uiBinding := os.Getenv("AUTOMC_UI_BINDING"); uiBinding != "" {
bus := NewLogBus(500)
logrus.AddHook(&logrusBusHook{bus: bus})
startUI(ctx, uiBinding, bus)
}
return nil
}