Fix Synapse installation

Fix the installation of the PostgreSQL install to set the locale
Add NGinx bouncer in front of Synapse
Fix Synapse install to work properly
This commit is contained in:
Greg Hellings
2022-04-12 15:11:56 +00:00
parent 28ebd30001
commit 00c1adfa2d
4 changed files with 130 additions and 5 deletions
+10 -5
View File
@@ -1,13 +1,18 @@
{ config, ... }:
{ config, pkgs, ... }:
{
services.postgresql = {
enable = true;
checkConfig = true;
ensureDatabases = [ "synapse" "nextcloud" ];
ensureDatabases = [ "nextcloud" ];
initialScript = pkgs.writeText "create-matrix-db.sql" ''
CREATE ROLE "matrix-synapse" WITH LOGIN;
CREATE DATABASE "synapse" WITH OWNER "matrix-synapse" TEMPLATE template0 LC_COLLATE = "C" LC_CTYPE = "C";
GRANT ALL PRIVILEGES ON DATABASE "synapse" TO "matrix-synapse";
''; # These are done manually in order to set the LC_COLLATE values properly
ensureUsers = [ {
name = "synapse";
ensurePermissions."DATABASE synapse" = "ALL PRIVILEGES";
name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
} {
name = "root";
ensurePermissions."ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
@@ -18,7 +23,7 @@
logging_collector = true;
};
identMap = ''
root root root
root root postgres
'';
};