From e02557ba90495c2740a6673b5696c48530faada5 Mon Sep 17 00:00:00 2001 From: Daniel Patterson Date: Mon, 11 Apr 2022 14:26:50 +0100 Subject: [PATCH] Update well-known matrix --- hosts/dingserver/caddy.nix | 15 +++++++++++++-- hosts/dingserver/synapse.nix | 2 -- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/hosts/dingserver/caddy.nix b/hosts/dingserver/caddy.nix index f437d76..d60f114 100644 --- a/hosts/dingserver/caddy.nix +++ b/hosts/dingserver/caddy.nix @@ -1,6 +1,8 @@ { pkgs, lib, ... }: { + networking.firewall.allowedTCPPorts = [ 80 8448 443 ]; + services.caddy = { enable = true; virtualHosts = { @@ -18,6 +20,15 @@ ''; }; + "broccoli.town" = { + extraConfig = '' + header /.well-known/* "Access-Control-Allow-Origin" "*" + respond /.well-known/matrix/client "{\"m.homeserver\": {\"base_url\": \"https://broccoli.town\"}}" + reverse_proxy /_matrix/* http://localhost:8008 + reverse_proxy /_synapse/client/* http://localhost:8008 + ''; + }; + "chat.broccoli.town" = { extraConfig = '' header { @@ -29,8 +40,8 @@ root * ${pkgs.element-web.override { conf = { default_server_config."m.homeserver" = { - "base_url" = "https://matrix.broccoli.town"; - "server_name" = "matrix.broccoli.town"; + "base_url" = "https://broccoli.town"; + "server_name" = "broccoli.town"; }; }; } diff --git a/hosts/dingserver/synapse.nix b/hosts/dingserver/synapse.nix index 466e8f6..1bcf9e7 100644 --- a/hosts/dingserver/synapse.nix +++ b/hosts/dingserver/synapse.nix @@ -2,8 +2,6 @@ let fqdn = "matrix.broccoli.town"; in { - networking.firewall.allowedTCPPorts = [ 80 8448 443 ]; - services.matrix-synapse = { enable = true; settings = {