7884fb1c5f
- 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.
52 lines
2.4 KiB
Markdown
52 lines
2.4 KiB
Markdown
# Fork status — Timemachine/mc-router
|
|
|
|
This is a **soft fork** of [`itzg/mc-router`](https://github.com/itzg/mc-router) maintained for the [automc](https://git.timemachine.center/Timemachine/automc) Minecraft management platform.
|
|
|
|
## Branch model
|
|
|
|
| Branch | Tracks | Contents |
|
|
|---|---|---|
|
|
| `main` | `upstream/main` (github.com/itzg/mc-router) | Verbatim mirror. **Do not commit here.** |
|
|
| `automc` | branched from `v1.42.1` | Soft fork; carries the automc-specific patch. |
|
|
|
|
## Patch surface
|
|
|
|
Minimal — designed for low-friction rebases.
|
|
|
|
| Path | Type | Why |
|
|
|---|---|---|
|
|
| `cmd/mc-router/main.go` | edit | 1 import line + 4-line `automc.Wire(ctx)` call. Only upstream file modified. |
|
|
| `internal/automc/` | new dir | Self-contained extension package — no upstream conflicts possible. |
|
|
| `docs/AUTOMC.md` | new | Operator doc for the extensions. See [`docs/AUTOMC.md`](docs/AUTOMC.md). |
|
|
| `Makefile` | edit | Appended `sync-upstream` + `automc-build` targets. |
|
|
| `go.mod` / `go.sum` | edit | Added `github.com/jackc/pgx/v5 v5.8.0` for LISTEN/NOTIFY. |
|
|
| `FORK.md` | new | This file. |
|
|
|
|
Everything else stays untouched. No edits to `server/`, `mcproto/`, `cmd/mc-router/` beyond the wire-call.
|
|
|
|
## What the fork adds
|
|
|
|
1. **Postgres LISTEN/NOTIFY route source** — drop-in alternative to `--routes-config`, `--api-binding`, K8s, and Docker route sources. Pulled in via `AUTOMC_DSN` env var.
|
|
2. **HTTP waker integration** — registers a `WakerFunc` per route that POSTs to a control-plane (`AUTOMC_WAKER_URL`) and polls until `state=running`.
|
|
|
|
Both are opt-in. With `AUTOMC_DSN` unset, the binary behaves exactly like upstream `itzg/mc-router`.
|
|
|
|
See [`docs/AUTOMC.md`](docs/AUTOMC.md) for env vars, schema, troubleshooting.
|
|
|
|
## Sync from upstream
|
|
|
|
```
|
|
make sync-upstream
|
|
```
|
|
|
|
Rebases `automc` onto `upstream/main`, runs `go build ./...` and `go test ./internal/automc/...`. If `server.Routes.CreateMapping` signature changes, only [`internal/automc/pgsync.go`](internal/automc/pgsync.go) needs adjustment.
|
|
|
|
## Reporting issues
|
|
|
|
| Where it goes | What |
|
|
|---|---|
|
|
| [`Timemachine/mc-router`](https://git.timemachine.center/Timemachine/mc-router/issues) | automc-specific bugs (pg sync, waker, fork mechanics) |
|
|
| [`itzg/mc-router`](https://github.com/itzg/mc-router/issues) | Upstream core bugs (routing, mcproto, REST API) |
|
|
|
|
If unsure, file upstream first — most reports turn out to be upstream-side.
|