mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Add superuser management script
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
for command in document_archiver document_exporter document_importer mail_fetcher document_create_classifier document_index document_renamer document_retagger document_thumbnails document_sanity_checker;
|
||||
for command in document_archiver document_exporter document_importer mail_fetcher document_create_classifier document_index document_renamer document_retagger document_thumbnails document_sanity_checker manage_superuser;
|
||||
do
|
||||
echo "installing $command..."
|
||||
sed "s/management_command/$command/g" management_script.sh > /usr/local/bin/$command
|
||||
|
Reference in New Issue
Block a user