Replace synapse with dendrite
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
checkConfig = true;
|
||||
ensureDatabases = [ "nextcloud" "gitea" ];
|
||||
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
|
||||
ensureDatabases = [ "nextcloud" "gitea" "dendrite" ];
|
||||
#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 = "nextcloud";
|
||||
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
|
||||
@@ -19,6 +19,9 @@
|
||||
} {
|
||||
name = "gitea";
|
||||
ensurePermissions."DATABASE gitea" = "ALL PRIVILEGES";
|
||||
} {
|
||||
name = "dendrite";
|
||||
ensurePermissions."DATABASE dendrite" = "ALL PRIVILEGES";
|
||||
} ];
|
||||
settings = {
|
||||
log_connections = true;
|
||||
@@ -36,7 +39,7 @@ root root postgres
|
||||
databases = [
|
||||
"gitea"
|
||||
"nextcloud"
|
||||
"synapse"
|
||||
"dendrite"
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
+18
-44
@@ -6,8 +6,6 @@
|
||||
let
|
||||
domain = "${config.networking.domain}";
|
||||
fqdn = "matrix.${domain}";
|
||||
fbRegistration = import ./synapse.nix.crypt {};
|
||||
fbRegistrationFile = "matrix/mautrix-facebook.json";
|
||||
in
|
||||
{
|
||||
services.nginx = {
|
||||
@@ -70,33 +68,29 @@ return 200 '${builtins.toJSON client}';
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc."${fbRegistrationFile}".text = builtins.toJSON fbRegistration;
|
||||
|
||||
services.matrix-synapse = {
|
||||
services.dendrite = {
|
||||
enable = true;
|
||||
httpPort = 8448;
|
||||
# Identify ourselves as the root of our own domain
|
||||
settings = {
|
||||
database.args = {
|
||||
user = "matrix-synapse";
|
||||
database = "synapse";
|
||||
global = {
|
||||
database.args = {
|
||||
connection_string = "postgresql://dendrite@localhost/dendrite?sslmode=disable";
|
||||
max_open_conns = 90;
|
||||
max_idle_conns = 5;
|
||||
conn_max_lifetime = -1;
|
||||
};
|
||||
server_name = "thehellings.com";
|
||||
trusted_third_party_id_servers = [
|
||||
"matrix.org"
|
||||
"vector.im"
|
||||
"jupiterbroadcasting.com"
|
||||
];
|
||||
# Generate this with {path-to-dendrite}/bin/generate-keys --private-key /etc/dendrite.pem
|
||||
private_key = "/etc/dendrite.pem";
|
||||
};
|
||||
server_name = "thehellings.com";
|
||||
client_api.registration_enabled = false;
|
||||
#registration_shared_secret = "B9EoPr2WV9hzwc7uL2Sx1JmvCeKDEOGCpB0uginQcQtEH4wzRtkSIdo7lltrjSQa";
|
||||
# Bind a single listener to localhost only, disable SSL/TLS, and put
|
||||
# it behind an nginx proxy
|
||||
listeners = [ {
|
||||
port = 8448;
|
||||
bind_addresses = ["127.0.0.1"];
|
||||
type = "http"; # Offload SSL/TLS to Nginx
|
||||
tls = false;
|
||||
resources = [ {
|
||||
names = [ "client" "federation" ];
|
||||
compress = false; # Offload compressiong to Nginx
|
||||
} ];
|
||||
} ];
|
||||
app_service_config_files = [
|
||||
"/etc/${fbRegistrationFile}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -105,24 +99,4 @@ return 200 '${builtins.toJSON client}';
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 80 443 ];
|
||||
};
|
||||
|
||||
# Enable Facebook bridge
|
||||
services.mautrix-facebook = {
|
||||
enable = true;
|
||||
settings = {
|
||||
homeserver = {
|
||||
address = "http://localhost:8448";
|
||||
domain = "thehellings.com";
|
||||
};
|
||||
bridge.permissions = {
|
||||
"@admin:thehellings.com" = "admin";
|
||||
"thehellings.com" = "user";
|
||||
};
|
||||
appservice = {
|
||||
as_token = fbRegistration.as_token;
|
||||
hs_token = fbRegistration.hs_token;
|
||||
};
|
||||
};
|
||||
registrationData = fbRegistration;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
x6ns0UtbX6AcSBJfaW25BVEVRXmKdZW7bRPFJvCvkt/nWw/qZPwDzwOhORRooyJR
|
||||
14MXmRGmL3nfhlnZahxblVrHkOwCje4ADrE/cNf4+V4AOMlnMbIwkH1a7y9jAsBF
|
||||
LbiBgQ1NOE/TcLHwmnCByKO6VkZG03e53skydYITVa6uummPLcvZVeL97Cx+8gfy
|
||||
QPXmyLFQ9DzR5vVDVkRIM1UK6eZWM5NyWdVoyhfiK4QP+KsPkmxsA3l/safrm8Qy
|
||||
U3LlyXuk/wmfk9ZiPp1cWmruH4xdfaVbYPeGhAqRdwSdIgngpR2CJJVc7d/rve3l
|
||||
86+9yM6TIH6EB09cmjvT+Luim8l/5qrG0eeK3d0iUGkrHRzLa/7VGnlxi8zZGn3m
|
||||
9k4qyZjAPG27d5/4wp3KsLFWKpvjiNetpRDMpHYJfjptvYg7WrYxndeRIBLf7MJ7
|
||||
jN7oQhKJSQLR3QhIv5nH7T0wsKWIv4ua8jEPi+/sqdCvHN4kBiwpUHyRCuBO12+2
|
||||
EeuB8GnILRv0gh9hfQBnPVdv8A3grgfZElc3UkwharcrRIgBsb7a3I+4TbyQd9Bq
|
||||
nVZgkl/5jRLd2SyRX68Ny1DYBzepH2nMh5v6Q6h+WFXsTC5INulitvLk1UUfnlvW
|
||||
CbiJl1TsGlJwJLI53WS7lO/mUWe6KEIp33eqHgnaNTXWrCbq4jdqj5l6Im7B5ciz
|
||||
WEbvkg+HFwOGLKdutk4fTyQucyPqEI/GP2uM9ZBLZKA=
|
||||
Reference in New Issue
Block a user