hive-forge: inline the webhook-host binding, used once
Her review: don't declare a `let` for a single use. The comment that justified the binding moves to the use site and drops the claim it was carrying — that `swarm.ui.domain` and `swarm.domain` can diverge — keeping only the part that holds either way: this reads the same option swarm-controller builds its public URL from, so the allow-list entry and the target it must match are one value rather than two spellings.
This commit is contained in:
parent
b9919164e4
commit
a44107c617
1 changed files with 7 additions and 11 deletions
|
|
@ -9,13 +9,6 @@ let
|
||||||
gatewayCfg = config.services.hyperhive.gateway;
|
gatewayCfg = config.services.hyperhive.gateway;
|
||||||
hyperhiveDomain = config.services.hyperhive.domain;
|
hyperhiveDomain = config.services.hyperhive.domain;
|
||||||
swarmDomain = config.services.hyperhive.swarm.domain;
|
swarmDomain = config.services.hyperhive.swarm.domain;
|
||||||
# The host the swarm-controller's webhooks actually target. NOT
|
|
||||||
# `swarm.domain`: `swarm-controller.nix` builds `SWARM_CONTROLLER_PUBLIC_URL`
|
|
||||||
# from `swarm.ui.domain`, which merely *defaults* to the swarm domain and is
|
|
||||||
# documented as overridable. Reading the other one would be right until
|
|
||||||
# someone takes that option up, and then wrong in a way whose only symptom is
|
|
||||||
# a refused delivery.
|
|
||||||
swarmUiDomain = config.services.hyperhive.swarm.ui.domain;
|
|
||||||
tlsCfg = config.services.hyperhive.deploy.hive-controller.tls;
|
tlsCfg = config.services.hyperhive.deploy.hive-controller.tls;
|
||||||
networkCfg = config.services.hyperhive.network;
|
networkCfg = config.services.hyperhive.network;
|
||||||
|
|
||||||
|
|
@ -828,9 +821,12 @@ in
|
||||||
# deny '<swarm host>(10.42.0.1:443)' — webhook can only call
|
# deny '<swarm host>(10.42.0.1:443)' — webhook can only call
|
||||||
# allowed HTTP servers
|
# allowed HTTP servers
|
||||||
#
|
#
|
||||||
# ⚠️ `swarm.ui.domain`, NOT `swarm.domain`: swarm-controller.nix
|
# Read from `swarm.ui.domain` because that is the option
|
||||||
# builds its `SWARM_CONTROLLER_PUBLIC_URL` from the former, which
|
# `swarm-controller.nix` builds `SWARM_CONTROLLER_PUBLIC_URL`
|
||||||
# only *defaults* to the latter and is documented as overridable.
|
# from. One value, two readers — an allow-list entry and the
|
||||||
|
# target it must match are two spellings of one address
|
||||||
|
# otherwise, and the failure is a delivery refused for a host
|
||||||
|
# nobody typed wrong.
|
||||||
#
|
#
|
||||||
# Not gated on `deploy.swarm-ui.enable`, even though that is what
|
# Not gated on `deploy.swarm-ui.enable`, even though that is what
|
||||||
# makes the controller register the hooks: in a spread deployment
|
# makes the controller register the hooks: in a spread deployment
|
||||||
|
|
@ -845,7 +841,7 @@ in
|
||||||
"external"
|
"external"
|
||||||
hyperhiveDomain
|
hyperhiveDomain
|
||||||
]
|
]
|
||||||
++ lib.optional (swarmDomain != null) swarmUiDomain
|
++ lib.optional (swarmDomain != null) config.services.hyperhive.swarm.ui.domain
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
log.LEVEL = "Warn";
|
log.LEVEL = "Warn";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue