nix: inline the swarm sub-path aliases at their use sites
autheliaCfg/forgeCfg/vmCfg/vlCfg were local re-exports of hyperhiveCfg.swarm.<subpath> — a shape that hides the full option path from grep, the same hazard #4356 fixed for the tls alias. Removed the six let-bindings and spelled the full hyperhiveCfg.swarm.<subpath>.<field> path at every use site instead. None of the read fields (url, machine, hiveClientPrefix, agentClientSuffix, domain, port) sit on the old side of a mkRenamedOptionModule in deploy.nix, so inlining the alias's own current path is correct as-is. Refs #4363 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
815f977d7c
commit
276bf8531a
6 changed files with 21 additions and 28 deletions
|
|
@ -40,7 +40,6 @@ let
|
|||
networkCfg = config.services.hyperhive.network;
|
||||
hyperhiveCfg = config.services.hyperhive;
|
||||
gatewayCfg = hyperhiveCfg.gateway;
|
||||
autheliaCfg = hyperhiveCfg.swarm.authelia;
|
||||
swarmDomain = hyperhiveCfg.swarm.domain;
|
||||
|
||||
# Total on a null swarm domain for the same reason every sibling module is:
|
||||
|
|
@ -56,7 +55,7 @@ let
|
|||
swarmAuthRequest = ''
|
||||
auth_request /__hive_authelia;
|
||||
auth_request_set $target_url $scheme://$http_host$request_uri;
|
||||
error_page 401 =302 https://${autheliaCfg.domain}/?rd=$target_url;
|
||||
error_page 401 =302 https://${hyperhiveCfg.swarm.authelia.domain}/?rd=$target_url;
|
||||
'';
|
||||
in
|
||||
{
|
||||
|
|
@ -241,14 +240,14 @@ in
|
|||
# reasoning as `swarm-ui.nix`'s own copy (measured against the
|
||||
# pinned authelia binary, not copied from an example).
|
||||
"= /__hive_authelia" = {
|
||||
proxyPass = "https://${autheliaCfg.domain}/api/authz/auth-request";
|
||||
proxyPass = "https://${hyperhiveCfg.swarm.authelia.domain}/api/authz/auth-request";
|
||||
# nixpkgs appends its OWN `Host $host` after extraConfig,
|
||||
# which would override verifiedProxyTo's — see the comment
|
||||
# on verifiedProxyTo in hive-gateway/vhost-lib.nix.
|
||||
recommendedProxySettings = false;
|
||||
extraConfig = ''
|
||||
internal;
|
||||
${gatewayCfg.lib.verifiedProxyTo autheliaCfg.domain}
|
||||
${gatewayCfg.lib.verifiedProxyTo hyperhiveCfg.swarm.authelia.domain}
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_set_header X-Original-Method $request_method;
|
||||
|
|
|
|||
Loading…
Reference in a new issue