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 = {