fix: matrix works with self-hosted element

This commit is contained in:
2025-12-06 00:35:48 +03:00
parent 3b506a7888
commit 8bbc0eda8f

View File

@@ -1,14 +1,25 @@
{ lib, config, ... }: let { lib, config, ... }: let
cfg = config.currentServer.matrix; cfg = config.currentServer.matrix;
shared_secret = "secret";
in { in {
config = { config = {
services.coturn = { services.coturn = rec {
enable = true; enable = true;
realm = cfg.matrixDomain; realm = cfg.matrixDomain;
use-auth-secret = true;
static-auth-secret = shared_secret;
cert = "${config.security.acme.certs.${realm}.directory}/full.pem";
pkey = "${config.security.acme.certs.${realm}.directory}/key.pem";
listening-ips = ["188.137.254.58"];
no-tcp-relay = true;
relay-ips = ["188.137.254.58"];
listening-port = 3478; listening-port = 3478;
tls-listening-port = 5349; tls-listening-port = 5349;
no-cli = true; no-cli = true;
extraConfig = ''
verbose
'';
}; };
networking.firewall = { networking.firewall = {
@@ -17,17 +28,14 @@ in {
allowedUDPPortRanges = [ allowedUDPPortRanges = [
{ from = 49152; to = 65535; } { from = 49152; to = 65535; }
]; ];
allowedTCPPortRanges = [
{ from = 50000; to = 51000; }
];
}; };
services.matrix-synapse.settings = { services.matrix-synapse.settings = {
turn_uris = [ turn_uris = [
"turn:${cfg.matrixDomain}:3478?transport=udp" "turn:${cfg.matrixDomain}:3478?transport=udp"
"turns:${cfg.matrixDomain}:5349?transport=tcp" "turn:${cfg.matrixDomain}:3478?transport=tcp"
]; ];
turn_shared_secret = "secret"; turn_shared_secret = shared_secret;
}; };
}; };
} }