-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a random password for admin user
- Loading branch information
1 parent
a3ced1e
commit de3f289
Showing
2 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,9 +73,12 @@ fi | |
# Add a default administration user to the django database, if not already done previously | ||
DJANGO_ADMIN_INITIALIZED_FILE=${POSTGRES_CLUSTER_DATA_DIRECTORY}/.django_admin_initialized | ||
if [[ ! -f ${DJANGO_ADMIN_INITIALIZED_FILE} ]]; then | ||
echo "Initialize the default django administrator user with username admin and password admin. Make sure to change both the username and the password as soon as possible!" | ||
export DJANGO_SUPERUSER_USERNAME=admin | ||
export DJANGO_SUPERUSER_PASSWORD=$(cat /dev/urandom | tr -dc 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$^&*-_=+' | head -c 10; echo) | ||
export DJANGO_SUPERUSER_EMAIL="[email protected]" | ||
echo "Initialize the default django administrator user with username ${DJANGO_SUPERUSER_USERNAME} and password ${DJANGO_SUPERUSER_PASSWORD}" | ||
cd /root/turing | ||
[email protected] DJANGO_SUPERUSER_USERNAME=admin DJANGO_SUPERUSER_PASSWORD=admin python3 manage.py createsuperuser --no-input | ||
python3 manage.py createsuperuser --no-input | ||
touch ${DJANGO_ADMIN_INITIALIZED_FILE} | ||
else | ||
echo "Not initializing again default django administrator" | ||
|