8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-24 04:13:12 +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:
chirac 2018-03-03 00:47:23 +01:00
commit 38ed79a1f1
2 changed files with 4 additions and 2 deletions

View file

@ -305,6 +305,7 @@ fi
echo "Ecriture de settings_local" echo "Ecriture de settings_local"
django_secret_key=$(python -c "import random; print(''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789%=+') for i in range(50)]))") 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 cp re2o/settings_local.example.py re2o/settings_local.py
if [ $sql_bdd_type == 1 ] 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 sed -i 's/db_engine/django.db.backends.postgresql_psycopg2/g' re2o/settings_local.py
fi fi
sed -i 's/SUPER_SECRET_KEY/'"$django_secret_key"'/g' re2o/settings_local.py 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/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_name_value/'"$sql_name"'/g' re2o/settings_local.py
sed -i 's/db_user_value/'"$sql_login"'/g' re2o/settings_local.py sed -i 's/db_user_value/'"$sql_login"'/g' re2o/settings_local.py

View file

@ -26,8 +26,8 @@ SECRET_KEY = 'SUPER_SECRET_KEY'
DB_PASSWORD = 'SUPER_SECRET_DB' DB_PASSWORD = 'SUPER_SECRET_DB'
# AES key for secret key encryption # AES key for secret key encryption length must be a multiple of 16
AES_KEY = 'WHAT_A_WONDERFULL_KEY' AES_KEY = 'THE_AES_KEY'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!