Try new onlyoffice version

This commit is contained in:
Théo Barnouin 2025-05-28 14:42:19 +02:00
parent 1455814df5
commit 13b06e86a4
5 changed files with 32 additions and 12 deletions

View file

@ -35,6 +35,10 @@ in {
file = ./secrets/netboxDBPass.age;
owner = "postgres";
};
onlyofficeDBPass = {
file = ./secrets/onlyofficeDBPass.age;
owner = "postgres";
};
};
services = {
crowdsec = {
@ -65,6 +69,7 @@ in {
host authentik authentik 192.168.1.125/32 md5
host grafana grafana 192.168.1.27/32 md5
host netbox netbox 192.168.1.90/32 md5
host onlyoffice onlyoffice 192.168.1.20/32 md5
";
initialScript = pkgs.writeText "init-sql-script" ''
CREATE ROLE nextcloud WITH LOGIN CREATEDB;
@ -86,6 +91,10 @@ in {
CREATE ROLE netbox WITH LOGIN CREATEDB;
CREATE DATABASE netbox;
GRANT ALL PRIVILEGES ON DATABASE netbox TO netbox;
CREATE ROLE onlyoffice WITH LOGIN CREATEDB;
CREATE DATABASE onlyoffice;
GRANT ALL PRIVILEGES ON DATABASE onlyoffice TO onlyoffice;
'';
};
};
@ -116,6 +125,9 @@ in {
password := trim(both from replace(pg_read_file('${netboxDBPass}'), E'\n', '''));
EXECUTE format('ALTER ROLE netbox WITH PASSWORD '''%s''';', password);
password := trim(both from replace(pg_read_file('${onlyofficeDBPass}'), E'\n', '''));
EXECUTE format('ALTER ROLE onlyoffice WITH PASSWORD '''%s''';', password);
END $$;
EOF
'';