feat: add coturn to matrix
This commit is contained in:
parent
8451acdd8f
commit
709af80e73
6 changed files with 174 additions and 98 deletions
32
hosts/fw/modules/coturn.nix
Normal file
32
hosts/fw/modules/coturn.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
domain = "turn.cloonar.com";
|
||||
in
|
||||
{
|
||||
security.acme.certs."${domain}" = {
|
||||
group = "turnserver";
|
||||
postRun = "systemctl try-restart coturn.service";
|
||||
};
|
||||
|
||||
sops.secrets.coturn-static-secret = {
|
||||
owner = "turnserver";
|
||||
};
|
||||
|
||||
services.coturn = {
|
||||
enable = true;
|
||||
realm = domain;
|
||||
use-auth-secret = true;
|
||||
static-auth-secret-file = config.sops.secrets.coturn-static-secret.path;
|
||||
cert = "${config.security.acme.certs.${domain}.directory}/fullchain.pem";
|
||||
pkey = "${config.security.acme.certs.${domain}.directory}/key.pem";
|
||||
min-port = 49152;
|
||||
max-port = 49999;
|
||||
no-tcp-relay = true;
|
||||
no-cli = true;
|
||||
};
|
||||
|
||||
systemd.services.coturn = {
|
||||
after = [ "acme-${domain}.service" ];
|
||||
wants = [ "acme-${domain}.service" ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue