Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

31 рядки
1.2 KiB

  1. #!/bin/bash
  2. gen_key() {
  3. echo "=================================================================================="
  4. echo "Note: Please copy this key and keep it in a secure place."
  5. echo "Then you should manually edit your pinry/local_settings.py"
  6. echo "and replace SECRET_KEY with new secret-key if you had previously generated a"
  7. echo "pinry/local_settings.py."
  8. echo "If no previous pinry/local_settings.py generated, you can have a look and edit it."
  9. echo "If you want to use docker-compose, just edit docker-compose.yml and use 'docker-compose up'"
  10. SECRET_KEY=$(bash /pinry/docker/scripts/gen_key.sh)
  11. echo ""
  12. echo "Your secret-key is(also saved/overwritten your docker's /data/production_secret_key.txt):"
  13. echo ""
  14. echo ${SECRET_KEY}
  15. echo "=================================================================================="
  16. }
  17. local_settings_file="/data/local_settings.py"
  18. # Create local_settings.py
  19. if [ ! -f "${local_settings_file}" ];
  20. then
  21. cp "/pinry/pinry/settings/local_settings.example.py" "${local_settings_file}"
  22. gen_key
  23. sed -i "s/secret\_key\_place\_holder/${SECRET_KEY}/" "${local_settings_file}"
  24. fi
  25. cp "${local_settings_file}" "/pinry/pinry/settings/local_settings.py"