isolation: forward HIVE_MATRIX_URL so matrix daemon reaches the gateway

This commit is contained in:
damocles 2026-06-15 21:38:34 +02:00
commit d15ecff6d2
3 changed files with 32 additions and 1 deletions

View file

@ -764,6 +764,26 @@ in
else
"http://127.0.0.1:${toString config.services.hyperhive.forge.httpPort}";
}
// lib.optionalAttrs config.services.hyperhive.matrix.enable {
# In-cluster matrix homeserver URL for each agent's
# hive-matrix-daemon. Same shape + rationale as HIVE_FORGE_URL:
# - Isolated (private netns): reach tuwunel via the gateway vhost
# (`matrix.<domain>`) on plain http:80 — host loopback is dead.
# - Shared netns: direct host loopback on the tuwunel port.
# gatewayHost null-guard falls back to loopback so a domain-less
# config doesn't break eval (it just won't work under isolation,
# which needs a gateway anyway). Forwarded to agents by meta.rs
# alongside HIVE_FORGE_URL; shares the #1693 ordering caveat.
HIVE_MATRIX_URL =
if
config.services.hyperhive.network.enable
&& config.services.hyperhive.network.isolateContainers
&& config.services.hyperhive.matrix.gatewayHost != null
then
"http://${config.services.hyperhive.matrix.gatewayHost}"
else
"http://127.0.0.1:${toString config.services.hyperhive.matrix.httpPort}";
}
// lib.optionalAttrs config.services.hyperhive.matrix.gui.enable {
# Availability flags read by the dashboard's `/api/state`.
# Matrix GUI lives entirely on the gateway nginx (matrix tab