Don't create superuser with default credentials

This commit is contained in:
Tobias Genannt
2023-03-15 07:45:15 +01:00
parent ed309a15b4
commit 3e2bf7ec93
4 changed files with 24 additions and 12 deletions

View File

@ -82,6 +82,13 @@ END
echo "💡 Superuser Username: ${SUPERUSER_NAME}, E-Mail: ${SUPERUSER_EMAIL}"
fi
./manage.py shell --interface python <<END
from users.models import Token
old_default_token = Token.objects.get(key="0123456789abcdef0123456789abcdef01234567")
if old_default_token:
print("⚠️ Warning: You have the old default admin token in your database. This token is widely known; please remove it.")
END
echo "✅ Initialisation is done."
# Launch whatever is passed by docker