# What the Victoria stores' listener credential is, where it lives, and who # names it. The store's pod, the gateway's vhost and the unit that mints and # publishes it (../k8s/store-credentials.nix) all spell it from here. # # The credential is the HTTP Basic login every route of the store's listener # asks for (`-httpAuth.username` and `-httpAuth.password`). The password is a # leaf of the swarm secret store, created by that unit when the store holds # none. The pod reads it from the Secret `secretName`; nginx sends it in the # `Authorization` header that `nginxFile` sets. rec { # The Basic login's user name, the same for every store. user = "swarm-store"; # The credential id the store's unit loads and the key of the Secret that # holds the password. credentialId = "store-auth"; # Under KV v2's `secret/` mount, as `bao kv` takes it. `store` is # `victorialogs` or `victoriametrics`. leaf = store: "swarm/services/${store}/store-auth"; # On the host, a directory only root reads: the password the Secret is made from, # and the nginx file the gateway's locations include. dir = "/var/lib/swarm-store-auth"; passwordFile = store: "${dir}/${store}.password"; nginxFile = store: "${dir}/${store}.conf"; # The Secret the store's pod loads its credentials from # (../k8s/render.nix names it `-credentials`). secretName = store: "swarm-${store}-credentials"; }