Commit Graph
2 Commits
Author SHA1 Message Date
lukaszraczylo 6766d92bdd feat(cmd): reload the standalone config when the file changes
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.
2026-11-26 16:26:10 +00:00
lukaszraczylo a593b6fc70 feat(cmd): add a standalone gateway binary and container image
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
2026-09-23 09:44:32 +01:00