2024-10-15 17:46:44 -04:00
|
|
|
{ config, ... }:
|
2024-10-09 03:36:08 -04:00
|
|
|
{
|
2024-10-15 17:46:44 -04:00
|
|
|
imports = [
|
|
|
|
./nginx
|
|
|
|
];
|
|
|
|
|
2024-09-10 15:07:31 -04:00
|
|
|
services = {
|
2024-10-07 11:42:34 -04:00
|
|
|
coturn = {
|
2024-09-10 15:07:31 -04:00
|
|
|
enable = true;
|
|
|
|
no-cli = true;
|
|
|
|
no-tcp-relay = true;
|
|
|
|
min-port = 49000;
|
|
|
|
max-port = 50000;
|
|
|
|
use-auth-secret = true;
|
|
|
|
static-auth-secret = "will be world readable for local users :(";
|
2024-10-24 23:42:09 -04:00
|
|
|
realm = "turn.${config.domains.jim1}";
|
|
|
|
cert = "/var/lib/acme/turn.${config.domains.jim1}.com/fullchain.pem";
|
|
|
|
pkey = "/var/lib/acme/turn.${config.domains.jim1}.com/key.pem";
|
2024-09-10 15:07:31 -04:00
|
|
|
};
|
|
|
|
|
2024-09-10 15:10:58 -04:00
|
|
|
# Enable coturn on Synapse
|
|
|
|
matrix-synapse.settings = {
|
|
|
|
turn_uris = [
|
2024-10-24 23:42:09 -04:00
|
|
|
"turn:turn.${config.domains.jim1}:3478?transport=udp"
|
|
|
|
"turn:turn.${config.domains.jim1}:3478?transport=tcp"
|
2024-09-10 15:10:58 -04:00
|
|
|
];
|
2024-09-10 15:15:08 -04:00
|
|
|
turn_shared_secret = config.services.coturn.static-auth-secret;
|
2024-09-10 15:10:58 -04:00
|
|
|
turn_user_lifetime = "1h";
|
|
|
|
};
|
2024-09-10 15:07:31 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
# Open coturn ports
|
|
|
|
networking.firewall = {
|
|
|
|
allowedUDPPorts = [
|
|
|
|
3478 5349
|
|
|
|
];
|
|
|
|
allowedUDPPortRanges = [
|
|
|
|
{ from = 49000; to = 50000; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|