1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-30 11:37:44 +00:00

Set PG users in the respective config file

This commit is contained in:
RGBCube 2024-01-16 11:49:36 +03:00
parent b1fe5a5a32
commit fd99434022
No known key found for this signature in database
3 changed files with 19 additions and 10 deletions

View file

@ -13,6 +13,14 @@ in serverSystemConfiguration {
maxretry = 3; maxretry = 3;
}; };
services.postgresql = {
ensureDatabases = [ "grafana" ];
ensureUsers = [{
name = "grafana";
ensureDBOwnership = true;
}];
};
systemd.services.grafana.requires = [ "postgresql.service" ]; systemd.services.grafana.requires = [ "postgresql.service" ];
services.grafana = enabled { services.grafana = enabled {

View file

@ -7,6 +7,14 @@ let
in serverSystemConfiguration { in serverSystemConfiguration {
age.secrets."cube/password.nextcloud".owner = "nextcloud"; age.secrets."cube/password.nextcloud".owner = "nextcloud";
services.postgresql = {
ensureDatabases = [ "nextcloud" ];
ensureUsers = [{
name = "nextcloud";
ensureDBOwnership = true;
}];
};
systemd.services = { systemd.services = {
nextcloud-setup.requires = [ "postgresql.service" ]; nextcloud-setup.requires = [ "postgresql.service" ];
phpfpm-nextcloud.aliases = [ "nextcloud.service" ]; phpfpm-nextcloud.aliases = [ "nextcloud.service" ];

View file

@ -27,13 +27,11 @@
identMap = '' identMap = ''
# Map System DBUser # Map System DBUser
superuser_map root postgres superuser_map root ^(.*)$
superuser_map postgres postgres superuser_map postgres ^(.*)$
superuser_map /^(.*)$ \1 superuser_map /^(.*)$ \1
''; '';
ensureDatabases = [ "grafana" "nextcloud" ];
ensureUsers = [ ensureUsers = [
{ {
name = "postgres"; name = "postgres";
@ -46,12 +44,7 @@
}; };
} }
{ {
name = "grafana"; name = "root";
ensureDBOwnership = true;
}
{
name = "nextcloud";
ensureDBOwnership = true;
} }
]; ];