From 58f371347fc1e12af1ad33cb1967611b161f5dad Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 11 Nov 2018 21:30:38 +0100 Subject: [PATCH 1/2] [fix/enh] Upgrade to 0.1.0-beta.7.2 and fix upgrade logics [enh] Upgrade to 0.1.0-beta.7.2 [fix] Scripts remembers whether Flarum or its extension were upgraded or not. [fix] Bad logic test for Flarum versions comparison --- scripts/_common.sh | 2 +- scripts/upgrade | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index a69e3da..e96e9f6 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,5 +1,5 @@ # Version numbers -flarum_version="0.1.0-beta.7.1" +flarum_version="0.1.0-beta.7.2" ssowat_ext_ver="0.6" # Execute a command as another user diff --git a/scripts/upgrade b/scripts/upgrade index f9def61..b78523f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -114,14 +114,20 @@ fi # Downward compatibility: remove the v before version number if [[ $old_flarum_version == "v*" ]]; then $old_flarum_version = ${old_flarum_version:1}; fi # Check if upgrade of Flarum core is needed -if [[ $(dpkg --compare-versions $old_flarum_version lt $flarum_version) ]]; then +if [[ $(dpkg --compare-versions $old_flarum_version lt $flarum_version && echo true) ]]; then # Upgrade Flarum - exec_composer $app $final_path "require -n flarum/core:'$flarum_version'" + exec_composer $app $final_path "require -n flarum/core:$flarum_version" + # Database password has to be input on admin page after upgrade to 0.1.0-beta.7.2 + if [[ $flarum_version == "0.1.0-beta.7.2"]]; then + curl "https://$domain$path_url/admin" -H "Accept: */*" --compressed -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" --data "databasePassword=$db_pwd" + fi pushd $final_path exec_as $app php flarum cache:clear popd + upgraded_flarum=true else - echo "Flarum doesn't need any update, let's check the extension." + echo "Flarum does not need to be updated." + upgraded_flarum=false fi # Check if upgrade of SSOwat extension is needed @@ -132,6 +138,10 @@ if [[ $(dpkg --compare-versions $old_ssowat_ext_ver lt $ssowat_ext_ver && echo t ssowatdomain=$( Date: Sun, 11 Nov 2018 21:58:15 +0100 Subject: [PATCH 2/2] [fix] Allow insecure curl --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b78523f..7ef2beb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -118,8 +118,8 @@ if [[ $(dpkg --compare-versions $old_flarum_version lt $flarum_version && echo t # Upgrade Flarum exec_composer $app $final_path "require -n flarum/core:$flarum_version" # Database password has to be input on admin page after upgrade to 0.1.0-beta.7.2 - if [[ $flarum_version == "0.1.0-beta.7.2"]]; then - curl "https://$domain$path_url/admin" -H "Accept: */*" --compressed -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" --data "databasePassword=$db_pwd" + if [[ $flarum_version == "0.1.0-beta.7.2" ]]; then + curl "https://$domain$path_url/admin" -H "Accept: */*" --compressed -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" --data "databasePassword=$db_pwd" -k fi pushd $final_path exec_as $app php flarum cache:clear