refactor: update postgresql password and hash file
All checks were successful
ci / treefmt (push) Successful in 2m48s
All checks were successful
ci / treefmt (push) Successful in 2m48s
This commit is contained in:
parent
bb9e5d34f6
commit
72efc82c2a
4 changed files with 13 additions and 26 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
BIN
secrets/crypt/postgresql.json
Normal file
BIN
secrets/crypt/postgresql.json
Normal file
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue