diff --git a/scripts/install b/scripts/install index 8cd7942..0cabf53 100755 --- a/scripts/install +++ b/scripts/install @@ -70,6 +70,9 @@ popd # End of installation ynh_secure_remove $install_dir/INSTALLING +ynh_write_var_in_file --file="$install_dir/.env" --key="APP_DEBUG" --value="false" +ynh_write_var_in_file --file="$install_dir/.env" --key="APP_ENV" --value="production" +ynh_write_var_in_file --file="$install_dir/.env" --key="NOTIFY_UPDATES" --value="true" #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index 49953c5..70f2526 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,11 +28,17 @@ upgrade_type=$(ynh_check_app_version_changed) if [ "$upgrade_type" == "UPGRADE_APP" ] then + # Enable maintenance mode while upgrading + ynh_write_var_in_file --file="$install_dir/.env" --key="MAINTENANCE_MODE" --value="true" + ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src # Keep .env and database.sqlite ! ynh_setup_source --dest_dir="$install_dir" --keep=".env database/database.sqlite" + + # Remove this file as the app is already installed + ynh_secure_remove $install_dir/INSTALLING fi # $install_dir will automatically be initialized with some decent @@ -40,8 +46,8 @@ fi # ownership to all files such as after the ynh_setup_source step chown -R $app:www-data "$install_dir" -# Remove this file as the app is already installed -ynh_secure_remove $install_dir/INSTALLING +# Disable maintenance mode +ynh_write_var_in_file --file="$install_dir/.env" --key="MAINTENANCE_MODE" --value="false" #================================================= # REAPPLY SYSTEM CONFIGURATIONS