mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-21 20:34:06 +00:00
nixos/paperless: fix shellcheck findings with enableStrictShellChecks enabled
This commit is contained in:
parent
659f95ed9e
commit
c4a7c0fae5
@ -290,11 +290,12 @@ in
|
||||
''
|
||||
+ optionalString (cfg.passwordFile != null) ''
|
||||
export PAPERLESS_ADMIN_USER="''${PAPERLESS_ADMIN_USER:-admin}"
|
||||
export PAPERLESS_ADMIN_PASSWORD=$(cat $CREDENTIALS_DIRECTORY/PAPERLESS_ADMIN_PASSWORD)
|
||||
PAPERLESS_ADMIN_PASSWORD=$(cat "$CREDENTIALS_DIRECTORY/PAPERLESS_ADMIN_PASSWORD")
|
||||
export PAPERLESS_ADMIN_PASSWORD
|
||||
superuserState="$PAPERLESS_ADMIN_USER:$PAPERLESS_ADMIN_PASSWORD"
|
||||
superuserStateFile="${cfg.dataDir}/superuser-state"
|
||||
|
||||
if [[ $(cat "$superuserStateFile" 2>/dev/null) != $superuserState ]]; then
|
||||
if [[ $(cat "$superuserStateFile" 2>/dev/null) != "$superuserState" ]]; then
|
||||
${cfg.package}/bin/paperless-ngx manage_superuser
|
||||
echo "$superuserState" > "$superuserStateFile"
|
||||
fi
|
||||
@ -353,7 +354,8 @@ in
|
||||
tr -dc A-Za-z0-9 < /dev/urandom | head -c64 | ${pkgs.moreutils}/bin/sponge '${secretKeyFile}'
|
||||
)
|
||||
fi
|
||||
export PAPERLESS_SECRET_KEY=$(cat '${secretKeyFile}')
|
||||
PAPERLESS_SECRET_KEY="$(cat '${secretKeyFile}')"
|
||||
export PAPERLESS_SECRET_KEY
|
||||
if [[ ! $PAPERLESS_SECRET_KEY ]]; then
|
||||
echo "PAPERLESS_SECRET_KEY is empty, refusing to start."
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user