From d568436d83126c7e92a1402e1551aa7235412481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Mon, 1 Jul 2024 19:18:34 +0200 Subject: [PATCH] conduit: Use new upstream delegation support --- configuration/services/conduit.nix | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/configuration/services/conduit.nix b/configuration/services/conduit.nix index 950165c..8734785 100644 --- a/configuration/services/conduit.nix +++ b/configuration/services/conduit.nix @@ -18,6 +18,13 @@ in server_name = domain; database_backend = "rocksdb"; + # Set up delegation: https://docs.conduit.rs/delegation.html#automatic-recommended + # This is primarily to make sliding sync work + well_known = { + client = "https://${domain}"; + server = "${domain}:443"; + }; + turn_uris = let address = "${config.services.coturn.realm}:${toString config.services.coturn.listening-port}"; @@ -230,19 +237,8 @@ in proxy_buffering off; ''; }; - - # Add Element X support - # TODO(tlater): Remove when no longer required: https://github.com/vector-im/element-x-android/issues/1085 - "=/.well-known/matrix/client" = { - alias = pkgs.writeText "well-known-matrix-client" (builtins.toJSON { - "m.homeserver".base_url = "https://${domain}"; - "org.matrix.msc3575.proxy".url = "https://${domain}"; - }); - - extraConfig = '' - default_type application/json; - add_header Access-Control-Allow-Origin "*"; - ''; + "/.well-known/matrix" = { + proxyPass = "http://${cfg.settings.global.address}:${toString cfg.settings.global.port}"; }; }; };