serve matrix discovery at the swarm apex, keep the pinned hive case
This commit is contained in:
parent
c9649b258f
commit
2e7d49bb88
10 changed files with 187 additions and 83 deletions
|
|
@ -366,6 +366,27 @@ let
|
|||
name = "a named exposeHostPorts opens its bridge port on the host's own say-so";
|
||||
ok = builtins.elem 5432 (bridgePortsOrNone exposedPortsNoHive);
|
||||
}
|
||||
{
|
||||
# The default server name is the swarm domain, so the apex answers
|
||||
# discovery from `gatewayHost` alone: this fixture runs no homeserver and
|
||||
# no hive. The URLs carry no port, and `m.server` names 443 because the
|
||||
# spec reads a bare host as 8448. The `/` arm is the presence control on
|
||||
# the vhost; the pinned counterpart is in ./matrix-core.nix.
|
||||
name = "the swarm apex serves both matrix discovery routes under the default server name";
|
||||
ok =
|
||||
let
|
||||
l = swarmUiHere.services.nginx.virtualHosts."t.local".locations;
|
||||
in
|
||||
l ? "/"
|
||||
&& lib.hasInfix ''{"m.homeserver":{"base_url":"https://chat.t.local"}}'' (
|
||||
l."= /.well-known/matrix/client".extraConfig or ""
|
||||
)
|
||||
&& lib.hasInfix ''{"m.server":"chat.t.local:443"}'' (
|
||||
l."= /.well-known/matrix/server".extraConfig or ""
|
||||
)
|
||||
&& !(lib.hasInfix "auth_request" l."= /.well-known/matrix/client".extraConfig)
|
||||
&& !(lib.hasInfix "auth_request" l."= /.well-known/matrix/server".extraConfig);
|
||||
}
|
||||
{
|
||||
name = "the old swarm UI package spelling sets the controller's UI package, which the vhost serves";
|
||||
ok =
|
||||
|
|
@ -547,7 +568,7 @@ let
|
|||
vh = swarmServicesHere.services.nginx.virtualHosts;
|
||||
l = vh."h1.hives.t.local".locations;
|
||||
in
|
||||
l ? "/api/" && l ? "/health/" && vh."h1.t.local".locations ? "= /.well-known/matrix/client"
|
||||
l ? "/api/" && l ? "/health/" && vh."h1.t.local".locations ? "/"
|
||||
)
|
||||
&& !(noHiveLeafAnywhere swarmServicesHere);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue