Add superuser management script

This commit is contained in:
Chris Nagy
2021-03-14 19:43:22 +01:00
parent e4909c3133
commit e3ba968fef
3 changed files with 45 additions and 1 deletions

View File

@@ -49,6 +49,19 @@ wait_for_postgres() {
}
superuser() {
if [[ -n "${PAPERLESS_DBHOST}" ]]
then
wait_for_postgres
fi
if [[ ! -z "${PAPERLESS_ADMIN_PASSWORD}" ]]
then
sudo -HEu paperless python3 manage.py manage_superuser
fi
}
migrations() {
@@ -86,6 +99,7 @@ initialize() {
chown -R paperless:paperless /tmp/paperless
migrations
superuser
}