refactor: update postgresql password and hash file
All checks were successful
ci / treefmt (push) Successful in 2m48s

This commit is contained in:
Ceferino Patino 2026-06-30 21:53:41 -05:00
commit 72efc82c2a
Signed by: c4patino
SSH key fingerprint: SHA256:Wu+cU1t+7zVT9wzew/4meNmeulo66NzMqc22MdDBgXI
4 changed files with 13 additions and 26 deletions

View file

@ -55,30 +55,17 @@ in {
ensureDatabases = hostDatabases;
ensureUsers =
[
{
name = "pgbouncer_auth";
ensureClauses = let
secrets = readJsonOrEmpty "${inputs.self}/secrets/crypt/secrets.json";
hash = getIn "postgresql.pgbouncer_auth.hash" secrets;
in {
login = true;
password = hash;
};
}
]
++ (mainServices
|> map (service: {
name = service;
ensureDBOwnership = true;
ensureClauses = let
secrets = readJsonOrEmpty "${inputs.self}/secrets/crypt/secrets.json";
hash = getIn "postgresql.${service}.hash" secrets;
in {
login = true;
password = hash;
};
}));
mainServices
|> map (service: {
name = service;
ensureDBOwnership = true;
ensureClauses = let
secrets = readJsonOrEmpty "${inputs.self}/secrets/crypt/postgresql.json";
in {
login = true;
password = getIn "${service}.hash" secrets;
};
});
};
postgresqlBackup = {

View file

@ -52,8 +52,8 @@ in {
{
name = "pgbouncer_auth";
ensureClauses = let
secrets = readJsonOrEmpty "${inputs.self}/secrets/crypt/secrets.json";
hash = getIn "postgresql.pgbouncer_auth.hash" secrets;
secrets = readJsonOrEmpty "${inputs.self}/secrets/crypt/postgresql.json";
hash = getIn "pgbouncer_auth.hash" secrets;
in {
login = true;
password = hash;

Binary file not shown.

Binary file not shown.