mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 20:03:11 +00:00
Merge branch 'create_aes_key_at_install' into 'master'
Crée la clé AES à l'installation. See merge request federez/re2o!85
This commit is contained in:
commit
38ed79a1f1
2 changed files with 4 additions and 2 deletions
|
@ -305,6 +305,7 @@ fi
|
|||
echo "Ecriture de settings_local"
|
||||
|
||||
django_secret_key=$(python -c "import random; print(''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789%=+') for i in range(50)]))")
|
||||
aes_key=$(python -c "import random; print(''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789%=+') for i in range(32)]))")
|
||||
|
||||
cp re2o/settings_local.example.py re2o/settings_local.py
|
||||
if [ $sql_bdd_type == 1 ]
|
||||
|
@ -314,6 +315,7 @@ else
|
|||
sed -i 's/db_engine/django.db.backends.postgresql_psycopg2/g' re2o/settings_local.py
|
||||
fi
|
||||
sed -i 's/SUPER_SECRET_KEY/'"$django_secret_key"'/g' re2o/settings_local.py
|
||||
sed -i 's/THE_AES_KEY/'"$aes_key"'/g' re2o/settings_local.py
|
||||
sed -i 's/SUPER_SECRET_DB/'"$sql_password"'/g' re2o/settings_local.py
|
||||
sed -i 's/db_name_value/'"$sql_name"'/g' re2o/settings_local.py
|
||||
sed -i 's/db_user_value/'"$sql_login"'/g' re2o/settings_local.py
|
||||
|
|
|
@ -26,8 +26,8 @@ SECRET_KEY = 'SUPER_SECRET_KEY'
|
|||
|
||||
DB_PASSWORD = 'SUPER_SECRET_DB'
|
||||
|
||||
# AES key for secret key encryption
|
||||
AES_KEY = 'WHAT_A_WONDERFULL_KEY'
|
||||
# AES key for secret key encryption length must be a multiple of 16
|
||||
AES_KEY = 'THE_AES_KEY'
|
||||
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
|
|
Loading…
Reference in a new issue