deploy: move authelia's three host paths out of swarm.authelia
`usersFile`, `hostClientSecretDir` and `hostUsersFile` are filesystem paths that only exist on the machine running the `swarm-authelia` container. A hive that does not run it has nothing at any of them, so they fail the swarm-wide test the namespace's header states. `usersFile` is a path *inside* the container and still belongs on the deploy side: a path's scope is the scope of the filesystem it names, and that filesystem is this host's container root. The two `host*` options are `readOnly` and derived, so nothing can set them through the rename shims — those serve readers. The shims are still required: `mkRenamedOptionModule` is what keeps an out-of-tree module reading the old path resolving at all. Seven reads went through an alias rather than a full path (`autheliaCfg.hostClientSecretDir` in five modules, `.hostUsersFile` in a sixth, `swarmCfg.authelia.hostClientSecretDir` in a seventh). Every one of those files already binds `deployCfg`, so the repoint needed no new alias. Four more sites were prose, including one in `docs/`, which no grep restricted to `nix/` would have found.
This commit is contained in:
parent
9d55cba786
commit
9c09653603
12 changed files with 102 additions and 74 deletions
|
|
@ -483,8 +483,11 @@ in
|
|||
clientSecretFile = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default =
|
||||
if queueLocal then "${swarmCfg.authelia.hostClientSecretDir}/hive-${cfg.hiveName}.secret" else null;
|
||||
defaultText = lib.literalExpression ''"''${swarm.authelia.hostClientSecretDir}/hive-''${hiveName}.secret" when this host runs both the queue and the IdP, else null'';
|
||||
if queueLocal then
|
||||
"${deployCfg.authelia.hostClientSecretDir}/hive-${cfg.hiveName}.secret"
|
||||
else
|
||||
null;
|
||||
defaultText = lib.literalExpression ''"''${deploy.authelia.hostClientSecretDir}/hive-''${hiveName}.secret" when this host runs both the queue and the IdP, else null'';
|
||||
example = "/var/lib/secrets/swarm-queue-client.secret";
|
||||
description = ''
|
||||
Path to a file holding the plaintext client secret for this
|
||||
|
|
@ -498,7 +501,7 @@ in
|
|||
this host. On any other hive the secret has to get here somehow,
|
||||
and the swarm does not distribute it — copy it out of the swarm
|
||||
host's
|
||||
{option}`services.hyperhive.swarm.authelia.hostClientSecretDir`
|
||||
{option}`services.hyperhive.deploy.authelia.hostClientSecretDir`
|
||||
with whatever secret management this deployment already uses.
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue