Pulls mc_router_active_connections + mc_router_server_active_connections
from the Prometheus default registry on every /api/routes call. UI
gains an Active column on the routes table and the header subtitle
shows "N routes · M active conn".
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Same fix as svc-proxy: absolute /api/* hit the server-manager origin
when the UI is reverse-proxied at /infra/mc-router/. Switch to ./api/*
so the requests stay under the proxied prefix.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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>
Previously, the predefined "asleep" MOTD response on backend-dial-failure
was only served when the route had a waker registered. For static fleets
(no auto-scale) the gate left clients with a silently-closed TCP socket on
status-pings whenever the backend was down — they couldn't tell whether
the route was wrong, the host was offline, or the proxy was down.
Drop the `waker != nil` gate so any known route's dial-failure on
NextState=Status falls back to the configured asleep/loading MOTD. The
existing per-route override + global AUTO_SCALE_ASLEEP_MOTD chain handles
the actual text. Login attempts still close silently as before — only
status pings get the fallback.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- pgsync.go: filter rows where enabled IS NOT FALSE and domain IS NOT NULL,
matching the existing automc servers table (domain nullable, enabled
defaults true). Trigger doc now includes UPDATE OF enabled.
- .gitea/workflows/ci.yaml: build/test on push to automc branch + tags,
publish container as git.timemachine.center/timemachine/mc-router:automc.
- FORK.md: soft-fork relationship doc at repo root.
- docs/AUTOMC.md: quick-start recipe, troubleshooting table,
sync-lifecycle and waker-dispatch sequence diagrams.
Adds opt-in extension package internal/automc/ that:
- Subscribes to Postgres notifications on a 'servers' table and pushes
route changes into server.Routes (no file I/O, no fsnotify).
- Provides a WakerFunc that POSTs to a configurable HTTP control plane
(server-manager) and polls until state=running.
When AUTOMC_DSN is unset, Wire() is a no-op and the binary behaves
exactly like upstream itzg/mc-router. Single patch site in main.go
(import + 4-line call) keeps upstream rebases trivial.
See docs/AUTOMC.md for env vars and the expected DB schema/trigger.
* fix: Reduce log spam for sleeping servers
* fix: Fix autodownscaling for initial player connection
* fix: Instant route updating when a docker container is downscaled
* feat: Show asleep or loading motd while the server is waking up