style(3149): restore the secrets script's original indentation
Review catch (argus): most of the pre-existing script body picked up ~14 leading spaces it never had, because replacing an inline `optionalString` with a named binding changed what the formatter treated as the block's base indent. Functionally invisible — nix strips the minimum common indentation and bash ignores the rest — but it made the diff read as "reindented everything, incidentally added a block" instead of "added a block". Net diff on this file is now 231 insertions and 2 deletions.
This commit is contained in:
parent
b4a3eb75b0
commit
3de7a4a1b1
1 changed files with 24 additions and 24 deletions
|
|
@ -455,32 +455,32 @@ in
|
||||||
SyslogIdentifier = "${unitName}-secrets";
|
SyslogIdentifier = "${unitName}-secrets";
|
||||||
};
|
};
|
||||||
script = ''
|
script = ''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Each is generated once and never rotated here: the
|
# Each is generated once and never rotated here: the
|
||||||
# session and storage keys are load-bearing for data
|
# session and storage keys are load-bearing for data
|
||||||
# already written (sessions, the encrypted store), so
|
# already written (sessions, the encrypted store), so
|
||||||
# replacing one is an operator action, not a boot action.
|
# replacing one is an operator action, not a boot action.
|
||||||
for f in ${lib.concatStringsSep " " randomKeys}; do
|
for f in ${lib.concatStringsSep " " randomKeys}; do
|
||||||
p=${lib.escapeShellArg stateDir}/"$f".key
|
p=${lib.escapeShellArg stateDir}/"$f".key
|
||||||
if [ ! -s "$p" ]; then
|
if [ ! -s "$p" ]; then
|
||||||
head -c 64 /dev/urandom | od -An -tx1 | tr -d ' \n' > "$p"
|
head -c 64 /dev/urandom | od -An -tx1 | tr -d ' \n' > "$p"
|
||||||
echo "generated $p"
|
echo "generated $p"
|
||||||
fi
|
fi
|
||||||
chmod 0600 "$p"
|
chmod 0600 "$p"
|
||||||
done
|
done
|
||||||
${oidcGenScript}
|
${oidcGenScript}
|
||||||
|
|
||||||
# A users database that exists and parses, with nobody in
|
# A users database that exists and parses, with nobody in
|
||||||
# it. authelia refuses to start without one, and the
|
# it. authelia refuses to start without one, and the
|
||||||
# alternative to an empty file is a placeholder account —
|
# alternative to an empty file is a placeholder account —
|
||||||
# which is a credential nobody meant to create.
|
# which is a credential nobody meant to create.
|
||||||
users=${lib.escapeShellArg cfg.usersFile}
|
users=${lib.escapeShellArg cfg.usersFile}
|
||||||
if [ ! -s "$users" ]; then
|
if [ ! -s "$users" ]; then
|
||||||
echo "users: {}" > "$users"
|
echo "users: {}" > "$users"
|
||||||
echo "seeded empty users database at $users"
|
echo "seeded empty users database at $users"
|
||||||
fi
|
fi
|
||||||
chmod 0600 "$users"
|
chmod 0600 "$users"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue