diff options
author | tdback <tyler@tdback.net> | 2025-01-23 18:52:12 -0500 |
---|---|---|
committer | tdback <tyler@tdback.net> | 2025-01-23 18:52:12 -0500 |
commit | 522ca13e808d4f38ca8422138d2f4092923fc12a (patch) | |
tree | aa9a493e865851bec87548364c431db57cd66eb6 | |
parent | 20dd19beec16de06a5811d4f5aad5d57187c85d2 (diff) |
modules: use attribute for matrix port, use defaults for turn uris
-rw-r--r-- | modules/services/matrix/default.nix | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/modules/services/matrix/default.nix b/modules/services/matrix/default.nix index 61bc83b..c6d8755 100644 --- a/modules/services/matrix/default.nix +++ b/modules/services/matrix/default.nix @@ -6,8 +6,9 @@ ... }: let - fqdn = "synapse.${config.networking.domain}"; baseUrl = "https://${fqdn}"; + fqdn = "synapse.${config.networking.domain}"; + synPort = 8008; in { age.secrets = { @@ -89,10 +90,14 @@ in services.caddy = { enable = true; virtualHosts = { - ${fqdn}.extraConfig = '' - reverse_proxy /_matrix/* localhost:8008 - reverse_proxy /_synapse/client/* localhost:8008 - ''; + ${fqdn}.extraConfig = + let + localhost = "http://localhost:${builtins.toString synPort}"; + in + '' + reverse_proxy /_matrix/* ${localhost} + reverse_proxy /_synapse/client/* ${localhost} + ''; }; }; @@ -103,7 +108,7 @@ in server_name = config.networking.domain; public_baseurl = baseUrl; listeners = lib.singleton { - port = 8008; + port = synPort; bind_addresses = [ "::1" ]; type = "http"; tls = false; @@ -117,8 +122,8 @@ in }; }; turn_uris = with config.services.coturn; [ - "turn:${realm}:3487?transport=udp" - "turn:${realm}:3487?transport=tcp" + "turn:${realm}?transport=udp" + "turn:${realm}?transport=tcp" ]; }; }; |