chadtmiller.com/monolith
An atproto PDS
0
0
PDS_BIND_ADDRESS: the server listens where it is told, 127.0.0.1 by default
Merged Approved
This adds PDS_BIND_ADDRESS. It is read before the start line, parsed as an IP address, and used for the listener's bind. It defaults to 127.0.0.1, and an empty value counts as unset.
- Spec: the change is in
spec/PDS.mdand inOPERATIONS.md's Starts, and the README states what is built without history. - Harness: the new checks only add constraints. The unset case must not answer on the outside address.
0.0.0.0must answer on both addresses.::1must answer on[::1]and not on127.0.0.1.localhostand[::1]must exit 1. The parts that need an outside address or the IPv6 loopback skip when the machine lacks one, and the pull says so. - Server: it uses only std and tokio and adds no crates.
One gap, which I do not hold the approval for. The spec says an address no interface has makes pds serve exit 1 with why on standard error, and the server's bind-failure path does that. No harness check covers it, though. If you want it covered, a start with a non-local address such as 203.0.113.1 would show it. If you would rather not require it, say in the spec that it is unchecked.
Merged as af117b9
PDS_BIND_ADDRESSlets the server listen on an address other than 127.0.0.1, so it can run in a container or behind a proxy on another machine. Unset, nothing changes.Claude Opus 5.5 · high
What changes
Spec.
spec/PDS.md:PDS_BIND_ADDRESS, an IPv4 or IPv6 address,127.0.0.1by default. The server listens on that address alone: bound to::1, it does not answer on127.0.0.1./metricsstays on the loopback. A value that is no address as written (localhost,[::1], a port with it) exits 1 before anything reaches standard output; an address it cannot listen on exits 1 too.spec/OPERATIONS.md's Starts gives the checks.Harness.
checks/operations.mjs, in the end-of-run lifecycle: as the run starts it, the server does not answer on the machine's first non-loopback IPv4 address. Started with0.0.0.0, it answers there and on127.0.0.1. Started with::1, it answers on[::1]and not on127.0.0.1. Each part runs where the machine has that address.localhostand[::1]join the starts that must exit 1.Server.
pds-server'srunreads the variable before thestartline and binds(address, PDS_PORT).pds serve --helpnames it.Why
The server was reachable only from a proxy on the same host, which rules out Railway, Fly, k8s and any container platform. The loopback stays the default: a server put before the internet by mistake is worse than one that must be told where to listen.
How it was checked
step 31 (seed 1): the server's listener differs, with0.0.0.0: no answer on192.168.12.196within 30 s.0.0.0.0. It fails at the first check: an answer on192.168.12.196with the variable unset. Put back.compare.mjs --steps 30 --seed 1passes with all four parts run:listening on 0.0.0.0,listening on ::1, and both bad values refused.just quickhere;just gatesis left to the pull'sgatesworkflow.Shortcomings
0.0.0.0parts are skipped. Without IPv6's loopback (Docker with IPv6 off), the::1part is skipped. The bad values always run.::is not run: whether it takes IPv4 too is the system's choice, and the spec says so rather than check it./metricscannot be reached from another container. That isOPERATIONS.md's design, left as it is.