Watch
0
0
Fork
You've already forked hyperhive
0

the queue's exporter asks every request for a login the gateway supplies

This commit is contained in:
atlas 2026-11-27 15:42:53 +01:00 • committed by maia
commit da53e19636

View file

@ -28,4 +28,26 @@ rec {
# The Secret the store's pod loads its credentials from
# (../k8s/render.nix names it `<service>-credentials`).
secretName = store: "swarm-${store}-credentials";
# The queue's exporter takes the same kind of login, with a difference: its
# flag takes no file, so the pod gets the password's bcrypt hash from the
# Secret `exporter.secretName` (key `hashKey`, environment variable
# `hashEnv`, argument `-http_pass`), and the gateway's `/metrics` location
# for the queue sends the password itself in the header `exporter.nginxFile`
# sets. The password and the hash are files only root reads. `cost` is NATS's
# own default for `nats server passwd`; the exporter compares with
# `bcrypt.CompareHashAndPassword`, which reads the cost from the hash, and
# only for a value that starts with `$2a$`.
exporter = {
user = "swarm-exporter";
leaf = "swarm/services/nats/exporter-auth";
passwordFile = "${dir}/nats.password";
nginxFile = "${dir}/nats.conf";
hashFile = "${dir}/nats.hash";
secretName = "swarm-nats-exporter-auth";
hashKey = "hash";
hashEnv = "EXPORTER_HASH";
cost = 11;
hashPrefix = "$2a$";
};
}