- Go 93.4%
- Dockerfile 6.6%
|
All checks were successful
build / image (push) Successful in 18s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WeJ6iwfdAvxp53wXjd42WH |
||
|---|---|---|
| .forgejo/workflows | ||
| cmd/dispatch | ||
| deploy | ||
| .dockerignore | ||
| CLAUDE.md | ||
| dispatch | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
tachyne-dispatch
The tachyne cluster's public Minecraft front door (192.168.1.10:25565): a
tiny protocol-version router. It reads the client's Handshake, picks the
gateway deployment that serves that protocol, replays the handshake to it
and splices the two TCP streams byte-for-byte from then on. Unknown versions
get an honest local answer: a server-list ping showing what IS supported, or
a login disconnect naming the supported versions.
Deliberately dumb, by design:
- Version-blind beyond the handshake, identity-blind always. Dispatch never parses login, never sees names/UUIDs, and does no authorization — policy lives in the gateways (via tachyne-access). At most it may someday grow IP-level pre-filtering.
- One code path per connection: peek handshake → route → splice. No
per-version logic here; adding a protocol is a
DISPATCH_ROUTESentry (plus a gateway that serves it). - PROXY protocol v1 (
DISPATCH_PROXY=1): each spliced connection is prefixed with the real client address; both gateways parse it (tachyne-common/proxyproto) so access checks and logs see LAN IPs, not the pod SNAT. The Service usesexternalTrafficPolicy: Local— without it kube-proxy SNAT hides the source before dispatch ever sees it.
Configuration (env)
DISPATCH_LISTEN listen address (default ":25565")
DISPATCH_ROUTES "770-772=host:port,776=host:port" (required)
DISPATCH_SUPPORTED human-readable list for unknown versions
(default "1.21.5-1.21.8 and 26.2")
DISPATCH_PROXY "1" = prefix PROXY protocol v1 to backends
Live routing: 770-772 → tachyne-gw-java-770 svc :25570,
776 → tachyne-gw-java-776 svc :25565 (both cluster-internal — dispatch is
the only externally reachable Minecraft port, via externalIPs: [192.168.1.10]). Protocols 773–775 are deliberately unrouted (deprioritized;
they'd need per-connection translation in gw-770 first).
Build / deploy
go build ./... && go test ./...
kubectl --kubeconfig ~/.kube/tachyne.yaml -n tachyne apply -f deploy/
Forgejo CI builds + pushes the image on every push to main (same conventions
as the other tachyne repos: REGISTRY_TOKEN org secret, dind via the job
network's default gateway).