fix: merge postgres postStart with inbuilt
This commit is contained in:
parent
b626e8e19c
commit
3e9918fc6b
1 changed files with 2 additions and 9 deletions
|
|
@ -31,15 +31,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.postgresql.postStart = lib.mkAfter ''
|
systemd.services.postgresql.postStart = lib.mkAfter ''
|
||||||
$PSQL -tA <<'EOF'
|
${config.services.postgresql.package}/bin/psql -tAc \
|
||||||
DO $$
|
"ALTER ROLE shlink PASSWORD '$(tr -d '\n' < ${config.sops.secrets.shlink-db-password.path})';"
|
||||||
DECLARE pw TEXT;
|
|
||||||
BEGIN
|
|
||||||
pw := trim(both from pg_read_file('${config.sops.secrets.shlink-db-password.path}'));
|
|
||||||
EXECUTE format('ALTER USER shlink PASSWORD %L', pw);
|
|
||||||
END
|
|
||||||
$$;
|
|
||||||
EOF
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
services.caddy.virtualHosts."ily.rs" = {
|
services.caddy.virtualHosts."ily.rs" = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue