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

View file

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

Binary file not shown.

Binary file not shown.