hosts/plover: update Keycloak config

This commit is contained in:
Gabriel Arazas 2022-12-17 22:23:36 +08:00
parent c008debd74
commit 9f4d0e470c

View File

@ -17,6 +17,10 @@ let
# However, this is set on our own. # However, this is set on our own.
vaultwardenDbName = "vaultwarden"; vaultwardenDbName = "vaultwarden";
# This is also set on our own.
keycloakUser = config.services.keycloak.database.username;
keycloakDbName = if config.services.keycloak.database.createLocally then keycloakUser else config.services.keycloak.database.username;
# The head of the Borgbase hostname. # The head of the Borgbase hostname.
borgbase-remote = "cr6pf13r"; borgbase-remote = "cr6pf13r";
in in
@ -198,7 +202,7 @@ in
}; };
# There's no database and user checks for Vaultwarden service. # There's no database and user checks for Vaultwarden service.
ensureDatabases = [ vaultwardenDbName ]; ensureDatabases = [ vaultwardenDbName keycloakDbName ];
ensureUsers = [ ensureUsers = [
{ {
name = vaultwardenUser; name = vaultwardenUser;
@ -213,6 +217,13 @@ in
"SCHEMA ${config.services.gitea.user}" = "ALL PRIVILEGES"; "SCHEMA ${config.services.gitea.user}" = "ALL PRIVILEGES";
}; };
} }
{
name = keycloakUser;
ensurePermissions = {
"DATABASE ${keycloakDbName}" = "ALL PRIVILEGES";
"SCHEMA ${keycloakDbName}" = "ALL PRIVILEGES";
};
}
]; ];
}; };