feat(nix): the matrix gateway host moves to chat.<swarm.domain>
Both halves change: the parent, because a swarm runs one homeserver and
every hive reaches it; and the label, because `chat` names the service
people use rather than the protocol it speaks.
⚠️ `serverName` is deliberately NOT touched, and the two are now
documented as the different things they are. `gatewayHost` is a routing
detail -- the API listener nginx proxies `/_matrix/*` to, which clients
rediscover through `.well-known`. `serverName` is the matrix identifier
baked into every user and room id: changing it is a different
homeserver, not a rename, so it still falls back to the bare hive
domain. A note at the fallback says so, since that binding is where a
future edit would most plausibly "fix" the inconsistency.
Old deployments pin `matrix.<hive domain>` -- exactly what the old
default rendered -- and dnsmasq already lists `gatewayHost` explicitly,
so a pinned or moved name stays routed either way.
This commit is contained in:
parent
727743507c
commit
ff84ca947d
1 changed files with 33 additions and 13 deletions
|
|
@ -8,6 +8,12 @@ let
|
||||||
cfg = config.services.hyperhive.swarm.matrix;
|
cfg = config.services.hyperhive.swarm.matrix;
|
||||||
networkCfg = config.services.hyperhive.network;
|
networkCfg = config.services.hyperhive.network;
|
||||||
hyperhiveDomain = config.services.hyperhive.domain;
|
hyperhiveDomain = config.services.hyperhive.domain;
|
||||||
|
swarmDomain = config.services.hyperhive.swarm.domain;
|
||||||
|
# ⚠️ Falls back to the HIVE domain, and must keep doing so even though
|
||||||
|
# `gatewayHost` moved to the swarm's: `serverName` is the matrix
|
||||||
|
# identifier baked into every user and room id, so changing it is a
|
||||||
|
# different homeserver rather than a rename. The two are independent on
|
||||||
|
# purpose — see the `gatewayHost` description below.
|
||||||
effectiveServerName = if cfg.serverName != null then cfg.serverName else hyperhiveDomain;
|
effectiveServerName = if cfg.serverName != null then cfg.serverName else hyperhiveDomain;
|
||||||
|
|
||||||
# fluffychat-web build fixes: nixpkgs's `flutter341.buildFlutterApplication`
|
# fluffychat-web build fixes: nixpkgs's `flutter341.buildFlutterApplication`
|
||||||
|
|
@ -194,23 +200,37 @@ in
|
||||||
|
|
||||||
gatewayHost = lib.mkOption {
|
gatewayHost = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.str;
|
type = lib.types.nullOr lib.types.str;
|
||||||
# Total on a null hive domain so the required-domain assertion in
|
# `chat.` under the SWARM domain — both halves change: a swarm runs
|
||||||
|
# one homeserver, and the label follows the service rather than the
|
||||||
|
# protocol.
|
||||||
|
#
|
||||||
|
# Total on a null swarm domain so the required-domain assertion in
|
||||||
# hive-network.nix is the thing that fires; see the comment there.
|
# hive-network.nix is the thing that fires; see the comment there.
|
||||||
default = if hyperhiveDomain == null then "matrix.invalid" else "matrix.${hyperhiveDomain}";
|
default = if swarmDomain == null then "chat.invalid" else "chat.${swarmDomain}";
|
||||||
defaultText = lib.literalExpression ''"matrix.''${services.hyperhive.domain}"'';
|
defaultText = lib.literalExpression ''"chat.''${services.hyperhive.swarm.domain}"'';
|
||||||
example = "matrix.example.com";
|
example = "matrix.example.com";
|
||||||
description = ''
|
description = ''
|
||||||
Public hostname for the matrix homeserver behind the gateway.
|
Public hostname for the matrix homeserver behind the gateway.
|
||||||
Defaults to `matrix.''${services.hyperhive.domain}` (sub-domain
|
Defaults to `chat.''${services.hyperhive.swarm.domain}` — the
|
||||||
shape — see `docs/gateway.md`). Set to `null` to skip the
|
swarm's domain, because a swarm runs **one** homeserver. Set to
|
||||||
gateway vhost (tuwunel stays direct on `httpPort`). See
|
`null` to skip the gateway vhost (tuwunel stays direct on
|
||||||
`docs/gateway.md` for the vhost map + matrix discovery flow,
|
`httpPort`). See `docs/gateway.md` for the vhost map + matrix
|
||||||
and the federation port-8448 caveat at the bottom of that doc.
|
discovery flow, and the federation port-8448 caveat at the
|
||||||
|
bottom of that doc.
|
||||||
|
|
||||||
Note: `gatewayHost` is the API listener hostname (where nginx
|
⚠️ **`gatewayHost` and `serverName` are different things, and
|
||||||
proxies `/_matrix/*`); `serverName` is the matrix-identifier
|
only this one moved.** `gatewayHost` is the API listener
|
||||||
domain embedded irrevocably in user/room IDs (default = bare
|
hostname (where nginx proxies `/_matrix/*`) and is free to
|
||||||
hive-domain). The two are distinct.
|
change: it is a routing detail clients rediscover through
|
||||||
|
`.well-known`. `serverName` is the matrix-identifier domain
|
||||||
|
embedded **irrevocably** in every user and room id — changing
|
||||||
|
that is a different homeserver, not a rename, so it still
|
||||||
|
defaults to the bare hive domain and is untouched here.
|
||||||
|
|
||||||
|
A deployment that was running before this moved keeps its
|
||||||
|
current name by pinning
|
||||||
|
`matrix.''${services.hyperhive.domain}` here — exactly what the
|
||||||
|
old default rendered.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue