From 6296633927b31c7cef495012a7891d7b97dc6a4a Mon Sep 17 00:00:00 2001 From: lapineige Date: Sun, 13 Aug 2023 19:49:08 +0200 Subject: [PATCH] removing doubles + reordering --- scripts/install | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/scripts/install b/scripts/install index 1fa0933..b9cf9ce 100644 --- a/scripts/install +++ b/scripts/install @@ -34,28 +34,21 @@ ynh_add_nginx_config #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 - -ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" - -chmod 400 "$install_dir/.env" -chown $app:$app "$install_dir/.env" +secret_key_base=$(ynh_string_random --length=24) +signing_salt=$(ynh_string_random --length=24) +_encryption_salt=$(ynh_string_random --length=24) # max file upload size MEDIA_UPLOAD_SIZE="${media_upload_size//[!0-9]/}000000" -ynh_replace_string --match_string="UPLOAD_LIMIT=MEDIA_UPLOAD_SIZE" --replace_string="UPLOAD_LIMIT=$MEDIA_UPLOAD_SIZE" --target_file="$install_dir/.env" -# Secret keys -ynh_print_warn --message="hello world $some_encryption_salt" -secret_key_base=$(ynh_string_random --length=24) -signing_salt=$(ynh_string_random --length=24) -some_encryption_salt=$(ynh_string_random --length=24) -ynh_print_warn --message="hello world $encryption_salt" -ynh_replace_string --match_string="__SECRET_KEY_BASE__" --replace_string="$secret_key_base" --target_file="$install_dir/.env" -ynh_replace_string --match_string="__SIGNING_SALT__" --replace_string="$signing_salt" --target_file="$install_dir/.env" -ynh_replace_string --match_string="__ENCRYPTION_SALT__" --replace_string="$some_encryption_salt" --target_file="$install_dir/.env" +ynh_script_progression --message="Adding a configuration file..." --weight=1 + +ynh_add_config --template="../conf/.env" --destination="$install_dir/.env" ynh_store_file_checksum --file="$install_dir/.env" +chmod 400 "$install_dir/.env" +chown $app:$app "$install_dir/.env" + #================================================= # SPECIFIC SETUP #=================================================