From c38fdfa7d57b98e713a217829ff5abd85f9d84b4 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Fri, 18 Aug 2023 05:25:05 +0200 Subject: Conduit well-known --- .../Rory-nginx/services/nginx/rory.gay/conduit.nix | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'host') diff --git a/host/Rory-nginx/services/nginx/rory.gay/conduit.nix b/host/Rory-nginx/services/nginx/rory.gay/conduit.nix index d8527bd..03072af 100755 --- a/host/Rory-nginx/services/nginx/rory.gay/conduit.nix +++ b/host/Rory-nginx/services/nginx/rory.gay/conduit.nix @@ -22,4 +22,47 @@ ''; }; #locations."/_synapse/client".proxyPass = "http://192.168.1.5:8008"; + + + locations."= /.well-known/matrix/server".extraConfig = '' + more_set_headers 'Content-Type application/json'; + more_set_headers 'Access-Control-Allow-Origin *'; + return 200 '${builtins.toJSON { + "m.server" = "conduit.rory.gay:443"; + }}'; + ''; + locations."= /.well-known/matrix/client".extraConfig = '' + more_set_headers 'Content-Type application/json'; + more_set_headers 'Access-Control-Allow-Origin *'; + return 200 '${builtins.toJSON { + "m.homeserver".base_url = "https://conduit.rory.gay"; + "m.identity_server".base_url = "https://conduit.rory.gay"; + } + }'; + ''; + locations."= /.well-known/matrix/support".extraConfig = '' + more_set_headers 'Content-Type application/json'; + more_set_headers 'Access-Control-Allow-Origin *'; + return 200 '${builtins.toJSON { + admins = [ + { + matrix_id = "@emma:rory.gay"; + role = "admin"; + } + { + matrix_id = "@alicia:rory.gay"; + role = "admin"; + } + { + matrix_id = "@root:rory.gay"; + role = "admin"; + } + { + matrix_id = "@rory:rory.gay"; + role = "admin"; + } + ]; + } + }'; + ''; } -- cgit 1.4.1