swarm-controller: default matrixHomeserverUrl from swarm.matrix.gatewayHost
matrixHomeserverUrl re-derived gatewayHost's own default
(chat.${swarmDomain}) instead of reading gatewayHost itself, so a
deployment that pins gatewayHost away from that default (the exact
case hive-matrix.nix's own option doc describes) left the controller
calling a name nothing serves. Read matrix.gatewayHost directly,
mirroring hive-matrix.nix's ctlHomeserverUrl. Add module-eval cases
that pin gatewayHost and that null it out, alongside the existing
unpinned default case.
Closes #4757
This commit is contained in:
parent
9cbee27e6d
commit
3fc7a785fa
2 changed files with 43 additions and 4 deletions
|
|
@ -92,6 +92,7 @@ let
|
|||
|
||||
forgeCfg = config.services.hyperhive.swarm.forge;
|
||||
swarmDomain = config.services.hyperhive.swarm.domain;
|
||||
matrixCfg = config.services.hyperhive.swarm.matrix;
|
||||
|
||||
# The controller's forge client speaks TLS to `https://${forgeCfg.domain}`,
|
||||
# which the gateway serves with a leaf signed by the hive CA — a CA
|
||||
|
|
@ -558,10 +559,12 @@ in
|
|||
|
||||
matrixHomeserverUrl = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
# The same `chat.<swarm domain>` ./hive-matrix.nix serves its vhost on
|
||||
# (`gatewayHost`): a swarm runs one homeserver.
|
||||
default = if swarmDomain == null then null else "https://chat.${swarmDomain}";
|
||||
defaultText = lib.literalExpression ''"https://chat.''${services.hyperhive.swarm.domain}"'';
|
||||
# `gatewayHost`'s own vhost, not a re-derivation of its default: a
|
||||
# deployment that pins `gatewayHost` (e.g. to keep a name from before
|
||||
# it moved under the swarm domain) still has one homeserver, and this
|
||||
# option has to name the same one.
|
||||
default = if matrixCfg.gatewayHost == null then null else "https://${matrixCfg.gatewayHost}";
|
||||
defaultText = lib.literalExpression ''"https://''${services.hyperhive.swarm.matrix.gatewayHost}"'';
|
||||
example = "https://matrix.example.org";
|
||||
description = ''
|
||||
Client-server API base of the swarm's homeserver. The controller
|
||||
|
|
|
|||
Loading…
Reference in a new issue