From c6e1d2eff39cc6a3e8b6b6a0d1afb9446afa8359 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 23 Sep 2019 17:59:12 +0200 Subject: [PATCH 1/6] [fix] Reinstall dependencies while restoring Closes #127 --- scripts/restore | 8 ++++++++ 1 file changed, 8 insertions(+) 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 #================================================= From 50694890c5e0e154c793ef619e9ac90d3156a35c Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 23 Sep 2019 17:59:36 +0200 Subject: [PATCH 2/6] [enh] Dynamic $php_version --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 56b6dc5..51b0b9a 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 diff --git a/scripts/upgrade b/scripts/upgrade index 8cbf5e6..74587ba 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 From 8ff44f7081ef41d3aadee0dddbcf3da7540439d5 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 23 Sep 2019 16:33:31 +0000 Subject: [PATCH 3/6] [fix] extensions names --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 51b0b9a..e766584 100644 --- a/scripts/install +++ b/scripts/install @@ -248,7 +248,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 +262,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 #================================================= From 84b8d5643a0d806f5351ba9734832177a448d367 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 23 Sep 2019 21:15:24 +0200 Subject: [PATCH 4/6] [fix] change_url edits config.php --- scripts/change_url | 1 + 1 file changed, 1 insertion(+) 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 From 9ae6b574e7c3dc1b493cbcfedf6b6829287e8e5c Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 23 Sep 2019 21:18:19 +0200 Subject: [PATCH 5/6] [fix] ssowat extension to beta.10-2 --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From e25dddecb68814fa526d742655e8b8322a924745 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Mon, 23 Sep 2019 21:23:42 +0200 Subject: [PATCH 6/6] [enh] clean before install or upgrade --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index e766584..7e489cc 100644 --- a/scripts/install +++ b/scripts/install @@ -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 diff --git a/scripts/upgrade b/scripts/upgrade index 74587ba..1c4d34d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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