add a route for /_synapse/admin, point mjolnir at it

This is whitelisted to just bicep

As a side-effect it's also much easier to use synapse-admin now
This commit is contained in:
Daniel Olsen 2024-09-01 00:34:22 +02:00
parent 8610a59f35
commit 914eb35c5a
2 changed files with 13 additions and 1 deletions

View File

@ -11,7 +11,7 @@
services.mjolnir = {
enable = true;
pantalaimon.enable = false;
homeserverUrl = "http://127.0.0.1:8008";
homeserverUrl = "https://matrix.pvv.ntnu.no";
accessTokenFile = config.sops.secrets."matrix/mjolnir/access_token".path;
managementRoom = "!gsdeCoWjvYRBrzuiRq:pvv.ntnu.no";
protectedRooms = map (a: "https://matrix.to/#/${a}") [

View File

@ -157,6 +157,18 @@ in {
'';
};
}
{
locations."/_synapse/admin" = {
proxyPass = "http://$synapse_backend";
extraConfig = ''
allow 127.0.0.1;
allow ::1;
allow ${values.hosts.bicep.ipv4};
allow ${values.hosts.bicep.ipv6};
deny all;
'';
};
}
{
locations = let
connectionInfo = w: matrix-lib.workerConnectionResource "metrics" w;