diff --git a/modules/matrix/default.nix b/modules/matrix/default.nix index 55128b4..4c1de9a 100644 --- a/modules/matrix/default.nix +++ b/modules/matrix/default.nix @@ -17,6 +17,7 @@ matrix-synapse = { enable = true; server_name = "walkah.chat"; + public_baseurl = "https://matrix.walkah.chat"; enable_metrics = true; enable_registration = false; database_type = "psycopg2"; @@ -32,6 +33,11 @@ names = [ "client" "federation" ]; }]; }]; + + account_threepid_delegates = { + email = "https://vector.im"; + msisdn = "https://vector.im"; + }; }; }; } diff --git a/modules/matrix/nginx.nix b/modules/matrix/nginx.nix index 00e4efd..9fafab1 100644 --- a/modules/matrix/nginx.nix +++ b/modules/matrix/nginx.nix @@ -16,9 +16,19 @@ locations."= /.well-known/matrix/server".extraConfig = let server = { "m.server" = "matrix.walkah.chat:443"; }; in '' - add_header Content-Type application/json; + default_type application/json; + add_header Access-Control-Allow-Origin *; return 200 '${builtins.toJSON server}'; ''; + locations."= /.well-known/matrix/client".extraConfig = let + client = { + "m.homeserver" = { "base_url" = "https://matrix.walkah.chat"; }; + }; + in '' + default_type application/json; + add_header Access-Control-Allow-Origin *; + return 200 '${builtins.toJSON client}'; + ''; locations."/" = { root = pkgs.element-web; }; }; };