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;
|
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 = {
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
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