From 441755d9fbab98975f69d68ef74a87063dd13ed9 Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 30 Dec 2021 16:00:13 +0100 Subject: [PATCH] Fix change_url and add test cases for upgrade --- check_process | 10 +++++++++- scripts/change_url | 11 ++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/check_process b/check_process index 6d24bc6..87a0cef 100644 --- a/check_process +++ b/check_process @@ -12,6 +12,8 @@ setup_public=1 upgrade=1 upgrade=1 from_commit=7205455e0a806a49c48c6d2f005d80d1b74a3355 + upgrade=1 from_commit=fc55308f7521310d5c339139339896bb59bd73cd + upgrade=1 from_commit=e5dd30afa6a618344c9e7b927839d4e9ac8bfc56 backup_restore=1 multi_instance=1 change_url=1 @@ -20,5 +22,11 @@ Email= Notification=none ;;; Upgrade options ; commit=7205455e0a806a49c48c6d2f005d80d1b74a3355 - name=Merge pull request #55 from yunohost-bot/issue-and-pr-template + name=Previous version + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& + ; commit=fc55308f7521310d5c339139339896bb59bd73cd + name=Version 0.9.5 + manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& + ; commit=e5dd30afa6a618344c9e7b927839d4e9ac8bfc56 + name=Version 1.0.3~ynh2 manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666& diff --git a/scripts/change_url b/scripts/change_url index 594268b..0035ee1 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -20,6 +20,7 @@ new_domain=$YNH_APP_NEW_DOMAIN new_path=$YNH_APP_NEW_PATH app=$YNH_APP_INSTANCE_NAME +secret_key=$(ynh_string_random --length=50) #================================================= # LOAD SETTINGS @@ -81,15 +82,7 @@ then path_url="$new_path" # Create a dedicated NGINX config ynh_add_nginx_config -fi - -# change the config.local.conf -if [ $change_path -eq 1 ] && [ "$new_path" == "/" ]; then - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path';" --target_file="$final_path/config.local.php" -elif [ $change_path -eq 1 ] && [ "$old_path" == "/" ]; then - ynh_replace_string --match_string="const WWW_URI = '$old_path';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" -elif [ $change_path -eq 1 ]; then - ynh_replace_string --match_string="const WWW_URI = '$old_path/';" --replace_string="const WWW_URI = '$new_path/';" --target_file="$final_path/config.local.php" + ynh_add_config --template="config.local.yunohost.php" --destination="$final_path/config.local.yunohost.php" fi # Change the domain for NGINX