Fix user checks in management scripts

This commit is contained in:
shamoon
2026-01-28 09:48:49 -08:00
parent 891f4a2faf
commit d9091aa42b
17 changed files with 121 additions and 32 deletions

View File

@@ -6,7 +6,12 @@ set -e
cd "${PAPERLESS_SRC_DIR}"
if [[ -n "${USER_IS_NON_ROOT}" ]]; then
python3 manage.py document_index "$@"
elif [[ $(id -un) == "paperless" ]]; then
python3 manage.py document_index "$@"
elif [[ $(id -u) == 0 ]]; then
s6-setuidgid paperless python3 manage.py document_index "$@"
elif [[ $(id -un) == "paperless" ]]; then
python3 manage.py document_index "$@"
else
echo "Unknown user."
exit 1
fi