Fix: fix user checks in management scripts (#11928)

This commit is contained in:
shamoon
2026-01-28 13:45:12 -08:00
committed by GitHub
parent 891f4a2faf
commit 6913f9d79c
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 manage_superuser "$@"
elif [[ $(id -un) == "paperless" ]]; then
python3 manage.py manage_superuser "$@"
elif [[ $(id -u) == 0 ]]; then
s6-setuidgid paperless python3 manage.py manage_superuser "$@"
elif [[ $(id -un) == "paperless" ]]; then
python3 manage.py manage_superuser "$@"
else
echo "Unknown user."
exit 1
fi