updated auto database

This commit is contained in:
naturallaw77 2024-12-16 18:31:03 -08:00
parent 322f3c924c
commit 3ae84cf77f
2 changed files with 12 additions and 3 deletions

View File

@ -349,14 +349,14 @@ in
services.postgresql.initialScript = pkgs.writeText "begin-init.sql" ''
CREATE ROLE "ncusr" WITH LOGIN PASSWORD '${config.age.secrets.nextclouddb.path}';
CREATE ROLE "ncusr" WITH LOGIN PASSWORD '${personalizatoin.nextclouddb}';
CREATE DATABASE "nextclouddb" WITH OWNER "ncusr"
TEMPLATE template0
LC_COLLATE = "C"
LC_CTYPE = "C";
CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD '${config.age.secrets.matrixdb.path}';
CREATE ROLE "matrix-synapse" WITH LOGIN PASSWORD '${personalization.matrixdb}';
CREATE DATABASE "matrix-synapse" WITH OWNER "matrix-synapse"
TEMPLATE template0
LC_COLLATE = "C"
@ -367,7 +367,7 @@ in
services.mysql.initialScript = pkgs.writeText "wordpress-init.sql" ''
CREATE DATABASE wordpressdb;
GRANT ALL ON *.* TO 'wpusr'@'localhost' IDENTIFIED BY '${config.age.secrets.wordpressdb.path}';
GRANT ALL ON *.* TO 'wpusr'@'localhost' IDENTIFIED BY '${personalizatoin.wordpressdb}';
FLUSH PRIVILEGES;
''
;

View File

@ -12,4 +12,13 @@ vaultwarden_url = builtins.readFile /var/lib/domains/vaultwarden;
external_ip_secret = builtins.readFile /var/lib/secrets/external_ip;
coturn_static_auth_secret = builtins.readFile /var/lib/secrets/turn;
##
matrixdb = builtins.readFile /var/lib/secrets/matrixdb;
nextclouddb = builtins.readFile /var/lib/secrets/nextclouddb;
wordpressdb = builtins.readFile /var/lib/secrets/wordpressdb;
}