Fix: Make management commands aware of the container environment (#9499)

This commit is contained in:
Trenton H 2025-03-26 14:17:10 -07:00 committed by GitHub
parent 6e694ad9ff
commit 9c68100dc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 44 additions and 15 deletions

View file

@ -0,0 +1,14 @@
#!/command/with-contenv /usr/bin/bash
# shellcheck shell=bash
set -e
cd "${PAPERLESS_SRC_DIR}"
if [[ $(id -u) == 0 ]]; then
s6-setuidgid paperless python3 manage.py createsuperuser "$@"
elif [[ $(id -un) == "paperless" ]]; then
python3 manage.py createsuperuser "$@"
else
echo "Unknown user."
fi