From 055806b8f89dbec3502d443571540fd308730cc0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 23 Apr 2021 11:25:08 +0200 Subject: [PATCH] Fix --- scripts/install | 10 ++++++++-- scripts/upgrade | 45 ++++++++++++++++----------------------------- 2 files changed, 24 insertions(+), 31 deletions(-) diff --git a/scripts/install b/scripts/install index 3709717..7df3f20 100644 --- a/scripts/install +++ b/scripts/install @@ -96,9 +96,15 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Configuring Backdrop..." --weight=1 -salt="$(ynh_string_random --length=30)" +cp ../conf/settings.example.php "$final_path/settings.php" -ynh_add_config --template="../conf/settings.example.php" --destination="$final_path/settings.php" +# Change variables in ttrss configuration +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/settings.php" +ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$final_path/settings.php" +ynh_replace_string --match_string="__SALT__" --replace_string="$(ynh_string_random --length=30)" --target_file="$final_path/settings.php" + +# Recalculate and store the config file checksum into the app settings +ynh_store_file_checksum --file="$final_path/settings.php" #================================================= # SECURE FILES AND DIRECTORIES diff --git a/scripts/upgrade b/scripts/upgrade index 2416282..69a1bf9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,35 +81,6 @@ ynh_system_user_create --username=$app --home_dir="$final_path" # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=7 - - ynh_setup_source --dest_dir="$final_path" -fi - -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 - -# Create a dedicated NGINX config -ynh_add_nginx_config - -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 - -# Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" - -#================================================= -# SPECIFIC UPGRADE -#================================================= -# CONFIGURE BACKDROP -#================================================= - if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Reconfiguring Backdrop..." --weight=2 @@ -133,6 +104,22 @@ then ynh_secure_remove --file="$tmpdir" fi +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 + +# Create a dedicated NGINX config +ynh_add_nginx_config + +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 + +# Create a dedicated PHP-FPM config +ynh_add_fpm_config --package="$extra_php_dependencies" + #================================================= # GENERIC FINALIZATION #=================================================