Automatically create SECRET_KEY on init

This commit is contained in:
augustin64 2023-09-08 13:53:56 +02:00
parent 85c2740f9c
commit 89995f6419

View File

@ -7,6 +7,10 @@ init () {
mkdir -p "partitioncloud/static/thumbnails" mkdir -p "partitioncloud/static/thumbnails"
mkdir -p "partitioncloud/static/search-thumbnails" mkdir -p "partitioncloud/static/search-thumbnails"
if ! test -f "instance/config.py"; then
echo "SECRET_KEY=$(python3 -c 'import secrets; print(secrets.token_hex())')" > instance/config.py
done
if test -f "instance/partitioncloud.sqlite"; then if test -f "instance/partitioncloud.sqlite"; then
printf "Souhaitez vous supprimer la base de données existante ? [y/n] " printf "Souhaitez vous supprimer la base de données existante ? [y/n] "
read -r CONFIRMATION read -r CONFIRMATION