Enable coTURN and fix the bugs present

This commit is contained in:
Lillian Violet 2024-03-24 21:03:17 +01:00
parent f3c0a84ccb
commit e595ac3931
3 changed files with 25 additions and 23 deletions

View file

@ -104,9 +104,24 @@
# Contabo ipv6 nameservers: "2a02:c207::1:53" "2a02:c207::2:53"
networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [22 80 443];
# Open ports in the firewall.
networking.firewall = {
enable = true;
allowPing = false;
allowedTCPPorts = [
22 # SSH
5349 # STUN tls
5350 # STUN tls alt
80 # http
443 # https
];
allowedUDPPortRanges = [
{
from = 49152;
to = 49999;
} # TURN relay
];
};
# networking.useNetworkd = true;

View file

@ -1,6 +1,11 @@
{
config,
pkgs,
...
}: {
sops.secrets."coturn-auth-secret".mode = "0440";
sops.secrets."coturn-auth-secret".owner = config.users.users.coturn.name;
sops.secrets."coturn-auth-secret".owner = config.users.users.turnserver.name;
users.users.nginx.extraGroups = ["turnserver"];
services.coturn = {
enable = true;
lt-cred-mech = true;
@ -23,24 +28,6 @@
max-port = 49999;
};
# Open ports in the firewall.
networking.firewall = {
enable = true;
allowPing = false;
allowedTCPPorts = [
5349 # STUN tls
5350 # STUN tls alt
80 # http
443 # https
];
allowedUDPPortRanges = [
{
from = 49152;
to = 49999;
} # TURN relay
];
};
# setup certs
services.nginx = {
enable = true;
@ -56,7 +43,6 @@
security.acme.certs = {
"turn.gladtherescake.eu" = {
group = "turnserver";
allowKeysForGroup = true;
postRun = "systemctl reload nginx.service; systemctl restart coturn.service";
};
};

View file

@ -14,5 +14,6 @@
./nextcloud
./postgres
./roundcube
./coturn
];
}