The standalone binary now reads its config file every -reload-interval
(default 5s) and on SIGHUP. When the content changes, it builds a new
gateway and sends new requests to it. Requests that already run finish
on the old gateway, which closes when the last one leaves or after
-reload-drain-timeout (default 10m).
A config that does not decode or that New() rejects is logged, and the
old gateway keeps serving. SIGHUP rebuilds even when the content is
unchanged, so a rotated file: secret takes effect.
One atomic word holds the request count and the retired flag. With two
separate atomics, a reload between them could close a gateway that a
new request is still serving.
cmd/gateway runs the middleware as its own HTTP server behind Traefik.
It reads a YAML config, converts it to JSON and decodes it with
DisallowUnknownFields, so a misspelled key stops startup. It warns
when metrics.allowedCIDRs is set, because behind a proxy the source
address is the proxy's.
The Makefile gains build-binary, docker-build and run-local targets.
The Dockerfile builds from the committed vendor tree and stamps
main.version from the VERSION build argument. go.mod lists
go.yaml.in/yaml/v3 as a direct dependency.
Claude-Session: https://claude.ai/code/session_01V5jYJNxpDFdJkyyExpADrv