nixos/paperless: fix shellcheck findings with enableStrictShellChecks enabled (#349559)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user