hosts/plover: update Keycloak service config

This commit is contained in:
Gabriel Arazas 2023-02-09 18:10:46 +08:00
parent b1427c1c9f
commit 5ba2b6d846
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -62,12 +62,14 @@ in
# Modifying it a little bit for per-user schema. # Modifying it a little bit for per-user schema.
systemd.services.keycloak = { systemd.services.keycloak = {
path = [ config.services.postgresql.package ]; preStart = let
preStart = lib.mkAfter '' psqlBin = "${lib.getBin config.services.postgresql.package}/bin/psql";
# Setting up the appropriate schema for PostgreSQL secure schema usage. in
psql -tAc "SELECT 1 FROM information_schema.schemata WHERE schema_name='${keycloakUser}';" \ lib.mkAfter ''
| grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${keycloakUser};" # Setting up the appropriate schema for PostgreSQL secure schema usage.
''; ${psqlBin} -tAc "SELECT 1 FROM information_schema.schemata WHERE schema_name='${keycloakUser}';" \
| grep -q 1 || psql -tAc "CREATE SCHEMA IF NOT EXISTS AUTHORIZATION ${keycloakUser};"
'';
}; };
# Attaching it to the reverse proxy of choice. # Attaching it to the reverse proxy of choice.