From 3da8d35fa5da268ac9466139ec6dd89c0c25e013 Mon Sep 17 00:00:00 2001 From: MA Gang Date: Fri, 3 May 2024 14:32:33 +0200 Subject: [PATCH 1/2] Update docker-entrypoint.sh --- docker/docker-entrypoint.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 9b39689..3f46e09 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -82,6 +82,24 @@ END echo "💡 Superuser Username: ${SUPERUSER_NAME}, E-Mail: ${SUPERUSER_EMAIL}" fi +## Update superuser password and API Token if SUPERUSER_PASSWORD_OVERWRITE is true +## Doc +## https://docs.djangoproject.com/en/5.0/ref/models/querysets/#delete +if [ "$SUPERUSER_PASSWORD_OVERWRITE" == "true" ]; then +echo "will overwrite superuser password for Superuser Username: ${SUPERUSER_NAME}" + ./manage.py shell --interface python < Date: Fri, 3 May 2024 14:44:39 +0200 Subject: [PATCH 2/2] Update docker-entrypoint.sh check if ${SUPERUSER_NAME} exists before updating password and api token --- docker/docker-entrypoint.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 3f46e09..3b5c15a 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -86,17 +86,19 @@ fi ## Doc ## https://docs.djangoproject.com/en/5.0/ref/models/querysets/#delete if [ "$SUPERUSER_PASSWORD_OVERWRITE" == "true" ]; then -echo "will overwrite superuser password for Superuser Username: ${SUPERUSER_NAME}" +echo "will overwrite superuser password and api token for Superuser Username: ${SUPERUSER_NAME}" ./manage.py shell --interface python <