diff --git a/scripts/_common.sh b/scripts/_common.sh index 532b50a..bbe7df1 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ pkg_dependencies="php7.3-curl php7.3-dom php7.3-gd php7.3-json php7.3-mbstring p php_version="7.3" project_version="0.1.0-beta.10" core_version="0.1.0-beta.10" -ssowat_version="0.1.0-beta.10-1" +ssowat_version="0.1.0-beta.10-2" #================================================= # PERSONAL HELPERS diff --git a/scripts/change_url b/scripts/change_url index ef3dd3d..2426b07 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -99,6 +99,7 @@ fi #================================================= # ... #================================================= +ynh_replace_string "$old_domain$old_path" "$new_domain$new_path" "$final_path/config.php" #================================================= # GENERIC FINALISATION diff --git a/scripts/install b/scripts/install index 56b6dc5..7e489cc 100644 --- a/scripts/install +++ b/scripts/install @@ -95,7 +95,7 @@ ynh_script_progression --message="Installing dependencies..." --time --weight=1 ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script -ynh_install_php --phpversion=7.3 --package="$pkg_dependencies" +ynh_install_php --phpversion=${php_version} --package="$pkg_dependencies" #=================================================== # CREATE DEDICATED USER @@ -121,6 +121,7 @@ ynh_install_composer $php_version $final_path # Prepare Flarum temp directory tmp=/tmp/$app +ynh_secure_remove --file="$tmp" mkdir -p $tmp chown -R $app:www-data $tmp chmod -R 0775 $tmp @@ -248,7 +249,7 @@ ynh_mysql_execute_as_root "$sql_command" $db_name case $language in fr) ynh_script_progression --message="Installing French extension..." --time --weight=2 - install_and_activate_extension $app $php_version $final_path $db_name "milescellar/flarum-ext-french" "milescellar-french" + install_and_activate_extension $app $php_version $final_path $db_name "milescellar/lang-french" "milescellar-lang-french" sql_command="UPDATE \`settings\` SET \`value\` = 'fr' WHERE \`settings\`.\`key\` = 'default_locale'" ynh_mysql_execute_as_root "$sql_command" $db_name ;; @@ -262,7 +263,7 @@ esac if [ $bazaar_extension -eq 1 ]; then ynh_script_progression --message="Installing Bazaar extension..." --time --weight=2 - ynh_composer_exec $app $php_version $final_path "require flagrow/bazaar --ansi" + ynh_composer_exec $app $php_version $final_path "require extiverse/bazaar --ansi" fi #================================================= diff --git a/scripts/restore b/scripts/restore index de3f693..9a69ebe 100644 --- a/scripts/restore +++ b/scripts/restore @@ -77,6 +77,14 @@ ynh_restore_file --origin_path="/etc/php/${php_version}/fpm/pool.d/$app.conf" #================================================= # SPECIFIC RESTORATION +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 + +# Define and install dependencies +ynh_install_php --phpversion=${php_version} --package="$pkg_dependencies" + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8cbf5e6..1c4d34d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -121,7 +121,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." --time --weight=1 -ynh_install_php --phpversion=7.3 --package="$pkg_dependencies" +ynh_install_php --phpversion=${php_version} --package="$pkg_dependencies" #================================================= # CREATE DEDICATED USER @@ -168,6 +168,7 @@ if [[ $(dpkg --compare-versions $old_project_version lt "0.1.0-beta.8" && echo t # Backing up the app directory tmpbak="/tmp/${app}backup" + ynh_secure_remove --file="$tmpbak" mkdir -p $tmpbak cp -R $final_path/* $tmpbak