From 3c661796c8c7cdb48f1e8b967018ddbae10a02b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rard=20Collin?= Date: Wed, 14 Feb 2024 18:19:11 +0100 Subject: [PATCH 1/4] Fixed upgrade bug --- scripts/upgrade | 6 ++++++ tests.toml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index fc4a83b..a89f932 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,6 +41,12 @@ if [[ -n "${document_path:-}" ]]; then ynh_app_setting_set --app="$app" --key=document_dir --value="$document_dir" fi +# document dir has moved from html_path to data_dir, so set the variable accordingly +if [[ ${document_dir} == ${html_path}* ]]; then + document_dir=$data_dir/docs + ynh_app_setting_set --app="$app" --key=document_dir --value="$document_dir" +fi + if [[ -n "${html_path:-}" ]]; then # Migrate html_path to data_dir mv "$html_path/index.html" "$html_path/docs" "$data_dir" diff --git a/tests.toml b/tests.toml index 8489737..77f10a9 100644 --- a/tests.toml +++ b/tests.toml @@ -10,3 +10,5 @@ test_format = 1.0 # ------------------------------- test_upgrade_from.7852cc4bf44ff20ee51fe35f3f53dc105e0f6d79.name= "2023-01-07 - Added Ssh support for dev." + test_upgrade_from.e89eebdac9f59202202d07972e274ebe6fc7c51c.name= "Before Manifest v2." + \ No newline at end of file From 6c81b3cab934f7967ee0581b96d7c498c01791c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rard=20Collin?= Date: Wed, 14 Feb 2024 18:20:00 +0100 Subject: [PATCH 2/4] Upgrade version --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 1a2e1a1..e36f4da 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Dont-code Services" description.en = "Install services and databases needed to support Dont-code platform" description.fr = "Installe les services et base de données nécessaires pour utiliser la plateforme Dont-code" -version = "0.2.10~ynh5" +version = "0.2.10~ynh6" maintainers = ["Dont-code Team"] From 6dc077b63155a4f97fe19850cbbee5891ab5c802 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Wed, 14 Feb 2024 17:20:07 +0000 Subject: [PATCH 3/4] Auto-update README --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c6a619f..429e3a3 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to - As well any documents or images uploaded by users will be backed up -**Shipped version:** 0.2.10~ynh5 +**Shipped version:** 0.2.10~ynh6 **Demo:** https://dont-code.net/apps.html diff --git a/README_fr.md b/README_fr.md index 54a674d..e1d8194 100644 --- a/README_fr.md +++ b/README_fr.md @@ -32,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to - As well any documents or images uploaded by users will be backed up -**Version incluse :** 0.2.10~ynh5 +**Version incluse :** 0.2.10~ynh6 **Démo :** https://dont-code.net/apps.html From dca89fe3e5e064761d9f7f0b9d1b708ecb304ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rard=20Collin?= Date: Thu, 15 Feb 2024 15:30:59 +0100 Subject: [PATCH 4/4] Fix for double upgrade --- scripts/upgrade | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a89f932..d8e98b2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,13 +41,14 @@ if [[ -n "${document_path:-}" ]]; then ynh_app_setting_set --app="$app" --key=document_dir --value="$document_dir" fi -# document dir has moved from html_path to data_dir, so set the variable accordingly -if [[ ${document_dir} == ${html_path}* ]]; then - document_dir=$data_dir/docs - ynh_app_setting_set --app="$app" --key=document_dir --value="$document_dir" -fi - if [[ -n "${html_path:-}" ]]; then + + # document dir has moved from html_path to data_dir, so set the variable accordingly + if [[ ${document_dir} == ${html_path}* ]]; then + document_dir=$data_dir/docs + ynh_app_setting_set --app="$app" --key=document_dir --value="$document_dir" + fi + # Migrate html_path to data_dir mv "$html_path/index.html" "$html_path/docs" "$data_dir" old_doc_dir="$html_path/docs" @@ -62,6 +63,7 @@ if [[ -n "${html_path:-}" ]]; then ynh_backup_if_checksum_is_different --file="$install_dir/.env" ynh_replace_string --match_string="$old_doc_dir" --replace_string="$document_dir" --target_file="$install_dir/.env" ynh_store_file_checksum --file="$install_dir/.env" + fi # Regenerate the .env file if the document_url was incorrectly set before