From 52fd6f4e038073638285e0d2c9baabae4a9a885b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 25 Mar 2023 16:22:49 +0100 Subject: [PATCH] c3d2-web: add matrix well-known entries --- hosts/c3d2-web/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hosts/c3d2-web/default.nix b/hosts/c3d2-web/default.nix index b3bd4dd3..81b78c47 100644 --- a/hosts/c3d2-web/default.nix +++ b/hosts/c3d2-web/default.nix @@ -50,6 +50,21 @@ in # Mastodon "~ ^/.well-known/webfinger".return = "301 https://c3d2.social/.well-known/webfinger?resource=acct%3ac3d2%40c3d2.social"; + # Matrix + "~ ^/.well-known/matrix/server" = { + return = "200 '{\"m.server\": \"matrix.c3d2.de:443\"}'"; + extraConfig = '' + add_header Content-Type application/json; + ''; + }; + "~ ^/.well-known/matrix/client" = { + return = "200 '{\"m.homeserver\": {\"base_url\": \"https://matrix.c3d2.de\"}}'"; + extraConfig = '' + add_header "Content-Type" application/json; + add_header "Access-Control-Allow-Origin" *; + ''; + }; + # SpaceAPI "/status.png".proxyPass = "http://[${hostRegistry.spaceapi.ip6}]:3000/status.png"; "/spaceapi.json".proxyPass = "http://[${hostRegistry.spaceapi.ip6}]:3000/spaceapi.json";