Hand certificates and CA files to HAProxy as credentials

The settings only allow paths in the state directory, which is 0700 root
and which HAProxy (a user of its own) cannot enter. systemd reads the
files and gives the service copies; a path unit restarts it when one
changes. The load balancer test keeps its files in the state directory
now, and verifies the backends' certificate.
This commit is contained in:
2026-11-28 21:23:09 +01:00
parent 2ebf45af81
commit 20ec791827
4 changed files with 62 additions and 4 deletions
+3
View File
@@ -36,6 +36,9 @@ it had published before, which also removed the configuration's record if the na
- The `addr` column of `show stat` is empty. The web UI (`loadbalancer.go`) reads addresses from
`show servers state` (`srv_addr`, `srv_port`). The `loadbalancer` VM test checks that the real HAProxy has the
columns the page reads; keep it when upgrading HAProxy.
- Certificates and CA files live in `/var/lib/router` (0700 root), which HAProxy cannot enter: they go in through
`LoadCredential` and the config names `/run/credentials/haproxy.service/…` (`fileOf`). A path unit restarts
HAProxy when a file changes. 0.14.0 lacked this (fixed after the release; see the git log).
- The stats socket is the NixOS module's `/run/haproxy/haproxy.sock`; `System.HAProxySocket` overrides it in tests.
- A service's `hosts` become `router.dns.hosts` entries (`mkDefault`) pointing at the router's address in the LANs it
listens in; that is how inside and outside use one name.