bicep/matrix: serve server well-known
Eval nix flake / evals (push) Successful in 3m24s Details

This commit is contained in:
Daniel Lovbrotte Olsen 2023-11-28 08:36:56 +01:00
parent 7ac960c5ff
commit 27ba3f7a7f
1 changed files with 13 additions and 1 deletions

View File

@ -216,7 +216,19 @@ in {
services.redis.servers."".enable = true;
services.nginx.virtualHosts."matrix.pvv.ntnu.no" = lib.mkMerge [({
services.nginx.virtualHosts."matrix.pvv.ntnu.no" = lib.mkMerge [
({
locations."/.well-known/matrix/server" = {
return = ''
200 '{"m.server": "matrix.pvv.ntnu.no:443"}'
'';
extraConfig = ''
default_type application/json;
add_header Access-Control-Allow-Origin *;
'';
};
})
({
locations = let
connectionInfo = w: matrix-lib.workerConnectionResource "metrics" w;
socketAddress = w: let c = connectionInfo w; in "${c.host}:${toString (c.port)}";