From c28dbeb19e12d0b6988bc3430a910e6f93bc6f55 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Fri, 22 Nov 2024 22:26:22 -0600 Subject: [PATCH] Expose more of the API --- hosts/linode/matrix.nix | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/hosts/linode/matrix.nix b/hosts/linode/matrix.nix index 45c146d..41dc922 100644 --- a/hosts/linode/matrix.nix +++ b/hosts/linode/matrix.nix @@ -2,7 +2,7 @@ # them by the following commands: # nix run nixpkgs.matrix-synapse # register_new_matrix_user -k "B9EoPr2WV9hzwc7uL2Sx1JmvCeKDEOGCpB0uginQcQtEH4wzRtkSIdo7lltrjSQa" http://localhost:8448 -{ config, ... }: +{ config, lib, ... }: let domain = "${config.networking.domain}"; fqdn = "matrix.${domain}"; @@ -52,11 +52,19 @@ in forceSSL = true; # Not the appropriate place for the chat client - locations."/".extraConfig = "return 404;"; - - locations."/_matrix" = { - proxyPass = "http://matrix.shire-zebra.ts.net:8448"; # Lacking the trailing / is correct - }; + locations = + (builtins.listToAttrs ( + builtins.map + (val: lib.nameValuePair "/_${val}" { proxyPass = "http://matrix.shire-zebra.ts.net:8448"; }) + [ + "matrix" + "synapse" + "dendrite" + ] + )) + // { + "/".extraConfig = "return 404;"; + }; }; }; };