mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-07 16:15:55 +02:00
Update 99-run.sh
This commit is contained in:
@@ -6,19 +6,12 @@
|
|||||||
#################
|
#################
|
||||||
exec redis-server & bashio::log.info "Starting redis"
|
exec redis-server & bashio::log.info "Starting redis"
|
||||||
|
|
||||||
################
|
|
||||||
# Starting app #
|
|
||||||
################
|
|
||||||
/./usr/local/bin/paperless_cmd.sh & bashio::log.info "Starting app"
|
|
||||||
|
|
||||||
###############################
|
###############################
|
||||||
# Create user if not existing #
|
# Create user if not existing #
|
||||||
###############################
|
###############################
|
||||||
# Origin : https://github.com/linuxserver/docker-paperless-ngx/blob/main/root/etc/cont-init.d/99-migrations
|
# Origin : https://github.com/linuxserver/docker-paperless-ngx/blob/main/root/etc/cont-init.d/99-migrations
|
||||||
|
|
||||||
bashio::net.wait_for 8000 localhost 900
|
echo "# Creating user admin
|
||||||
|
|
||||||
bashio::log.info "Creating default user"
|
|
||||||
cat << EOF | python3 manage.py shell
|
cat << EOF | python3 manage.py shell
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
|
|
||||||
@@ -26,11 +19,11 @@ from django.contrib.auth import get_user_model
|
|||||||
UserModel = get_user_model()
|
UserModel = get_user_model()
|
||||||
|
|
||||||
if len(UserModel.objects.all()) == 1:
|
if len(UserModel.objects.all()) == 1:
|
||||||
print("Creating new user")
|
print('Creating new user')
|
||||||
user = UserModel.objects.create_user('admin', password='admin')
|
user = UserModel.objects.create_user('admin', password='admin')
|
||||||
user.is_superuser = True
|
user.is_superuser = True
|
||||||
user.is_staff = True
|
user.is_staff = True
|
||||||
user.save()
|
user.save()
|
||||||
EOF
|
EOF" >> /sbin/docker-entrypoint.sh
|
||||||
|
|
||||||
bashio::log.info "Initial username and password are admin. Please change in the administration panel of the webUI after login."
|
bashio::log.info "Initial username and password are admin. Please change in the administration panel of the webUI after login."
|
||||||
|
|||||||
Reference in New Issue
Block a user