Merge branch 'fix-160'
This commit is contained in:
commit
e1f054b6b5
@ -7,7 +7,9 @@ while ! ./manage.py migrate 2>&1; do
|
|||||||
sleep 3
|
sleep 3
|
||||||
done
|
done
|
||||||
|
|
||||||
# create superuser silently
|
if [ "$SKIP_SUPERUSER" == "true" ]; then
|
||||||
|
echo "↩️ Skip creating the superuser"
|
||||||
|
else
|
||||||
if [ -z ${SUPERUSER_NAME+x} ]; then
|
if [ -z ${SUPERUSER_NAME+x} ]; then
|
||||||
SUPERUSER_NAME='admin'
|
SUPERUSER_NAME='admin'
|
||||||
fi
|
fi
|
||||||
@ -29,8 +31,6 @@ if [ -z ${SUPERUSER_API_TOKEN+x} ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "💡 Username: ${SUPERUSER_NAME}, E-Mail: ${SUPERUSER_EMAIL}"
|
|
||||||
|
|
||||||
./manage.py shell --interface python << END
|
./manage.py shell --interface python << END
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from users.models import Token
|
from users.models import Token
|
||||||
@ -39,8 +39,11 @@ if not User.objects.filter(username='${SUPERUSER_NAME}'):
|
|||||||
Token.objects.create(user=u, key='${SUPERUSER_API_TOKEN}')
|
Token.objects.create(user=u, key='${SUPERUSER_API_TOKEN}')
|
||||||
END
|
END
|
||||||
|
|
||||||
|
echo "💡 Superuser Username: ${SUPERUSER_NAME}, E-Mail: ${SUPERUSER_EMAIL}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$SKIP_STARTUP_SCRIPTS" == "true" ]; then
|
if [ "$SKIP_STARTUP_SCRIPTS" == "true" ]; then
|
||||||
echo "☇ Skipping startup scripts"
|
echo "↩️ Skipping startup scripts"
|
||||||
else
|
else
|
||||||
for script in /opt/netbox/startup_scripts/*.py; do
|
for script in /opt/netbox/startup_scripts/*.py; do
|
||||||
echo "⚙️ Executing '$script'"
|
echo "⚙️ Executing '$script'"
|
||||||
@ -55,4 +58,6 @@ echo "✅ Initialisation is done."
|
|||||||
|
|
||||||
# launch whatever is passed by docker
|
# launch whatever is passed by docker
|
||||||
# (i.e. the RUN instruction in the Dockerfile)
|
# (i.e. the RUN instruction in the Dockerfile)
|
||||||
exec ${@}
|
#
|
||||||
|
# shellcheck disable=SC2068
|
||||||
|
exec $@
|
||||||
|
4
env/netbox.env
vendored
4
env/netbox.env
vendored
@ -20,7 +20,9 @@ REDIS_DATABASE=0
|
|||||||
REDIS_CACHE_DATABASE=1
|
REDIS_CACHE_DATABASE=1
|
||||||
REDIS_SSL=false
|
REDIS_SSL=false
|
||||||
SECRET_KEY=r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNj
|
SECRET_KEY=r8OwDznj!!dci#P9ghmRfdu1Ysxm0AiPeDCQhKE+N_rClfWNj
|
||||||
SUPERUSER_NAME=admin
|
SKIP_STARTUP_SCRIPTS=false
|
||||||
|
SKIP_SUPERUSER=true
|
||||||
|
SUPERUSER_NAME=admin2
|
||||||
SUPERUSER_EMAIL=admin@example.com
|
SUPERUSER_EMAIL=admin@example.com
|
||||||
SUPERUSER_PASSWORD=admin
|
SUPERUSER_PASSWORD=admin
|
||||||
SUPERUSER_API_TOKEN=0123456789abcdef0123456789abcdef01234567
|
SUPERUSER_API_TOKEN=0123456789abcdef0123456789abcdef01234567
|
||||||
|
Loading…
Reference in New Issue
Block a user