From b40e2615b301f4b23afc25849f045621130e2710 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Thu, 21 Sep 2023 19:05:38 +0200 Subject: [PATCH 01/21] Adapt upgrade script --- scripts/upgrade | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index e90d10f..5ea4283 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,6 +35,22 @@ then ynh_setup_source --dest_dir="$install_dir" fi +#================================================= +# ACTUAL UPDATE +#================================================= + +ynh_script_progression --message="Proceeding to migration..." + +/usr/bin/php$phpversion $install_dir/bin/console doctrine:migration:migrate + +/usr/bin/php$phpversion $install_dir/bin/console zusam:migration + +ynh_script_progression --message="Pulling in external libraries with Composer..." + +ynh_install_composer -c "2.4.2" -w $install_dir/api/ + +cp $install_dir/app/dist/* $install_dir/public/ + chown -R $app:www-data "$install_dir" #================================================= From 259872d3ff9648be78aa99b4ddc4314e41ef6de1 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Thu, 21 Sep 2023 19:13:56 +0200 Subject: [PATCH 02/21] Fix error in path to api/bin/console --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5ea4283..1eb2485 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,9 +41,9 @@ fi ynh_script_progression --message="Proceeding to migration..." -/usr/bin/php$phpversion $install_dir/bin/console doctrine:migration:migrate +/usr/bin/php$phpversion $install_dir/api/bin/console doctrine:migration:migrate -/usr/bin/php$phpversion $install_dir/bin/console zusam:migration +/usr/bin/php$phpversion $install_dir/api/bin/console zusam:migration ynh_script_progression --message="Pulling in external libraries with Composer..." From 737ba0c7164b134e3be712c010392f4b036d5fb6 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Thu, 21 Sep 2023 19:28:19 +0200 Subject: [PATCH 03/21] Try to follow the upgrade procedure by the book --- scripts/upgrade | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 1eb2485..d3999ab 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,7 +32,10 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" + #ynh_setup_source --dest_dir="$install_dir" + + # We try as described in the app's official doc + cd $install_dir && curl -Ls https://github.com/zusam/zusam/archive/refs/tags/0.5.4.tar.gz | tar xz --strip 1 fi #================================================= From a87f113716439d20bcbf85df3a6cd4ab6c182223 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Thu, 21 Sep 2023 22:17:58 +0200 Subject: [PATCH 04/21] Try another approach --- scripts/upgrade | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index d3999ab..9e665ab 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,10 +32,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - #ynh_setup_source --dest_dir="$install_dir" - - # We try as described in the app's official doc - cd $install_dir && curl -Ls https://github.com/zusam/zusam/archive/refs/tags/0.5.4.tar.gz | tar xz --strip 1 + ynh_setup_source --dest_dir="$install_dir" fi #================================================= @@ -44,15 +41,15 @@ fi ynh_script_progression --message="Proceeding to migration..." -/usr/bin/php$phpversion $install_dir/api/bin/console doctrine:migration:migrate +pushd $install_dir + ynh_script_progression --message="Proceeding to migration..." + ynh_exec_as $app php$phpversion bin/console doctrine:migration:migrate + ynh_exec_as $app php$phpversion bin/console zusam:migration -/usr/bin/php$phpversion $install_dir/api/bin/console zusam:migration - -ynh_script_progression --message="Pulling in external libraries with Composer..." - -ynh_install_composer -c "2.4.2" -w $install_dir/api/ - -cp $install_dir/app/dist/* $install_dir/public/ + ynh_script_progression --message="Pulling in external libraries with Composer..." + ynh_install_composer + cp app/dist/* public/ +popd chown -R $app:www-data "$install_dir" From 1c9bdee14dada29f8ddf9658cf5dc54e0d98a963 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Thu, 21 Sep 2023 22:39:01 +0200 Subject: [PATCH 05/21] path to bin/console (api/bin/console) --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9e665ab..6e1638d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -43,8 +43,8 @@ ynh_script_progression --message="Proceeding to migration..." pushd $install_dir ynh_script_progression --message="Proceeding to migration..." - ynh_exec_as $app php$phpversion bin/console doctrine:migration:migrate - ynh_exec_as $app php$phpversion bin/console zusam:migration + ynh_exec_as $app php$phpversion api/bin/console doctrine:migration:migrate + ynh_exec_as $app php$phpversion api/bin/console zusam:migration ynh_script_progression --message="Pulling in external libraries with Composer..." ynh_install_composer From 18c86a6bf60d8a8c6bc39951e324eaf47e21b8ca Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Thu, 21 Sep 2023 22:42:30 +0200 Subject: [PATCH 06/21] run migration commands as root --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6e1638d..3753a1a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -43,8 +43,8 @@ ynh_script_progression --message="Proceeding to migration..." pushd $install_dir ynh_script_progression --message="Proceeding to migration..." - ynh_exec_as $app php$phpversion api/bin/console doctrine:migration:migrate - ynh_exec_as $app php$phpversion api/bin/console zusam:migration + php$phpversion api/bin/console doctrine:migration:migrate + php$phpversion api/bin/console zusam:migration ynh_script_progression --message="Pulling in external libraries with Composer..." ynh_install_composer From fe8ede2194ff550fed9053526bc8d9ca6afba84c Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Thu, 21 Sep 2023 22:46:23 +0200 Subject: [PATCH 07/21] set path for composer --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3753a1a..6855819 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -47,7 +47,7 @@ pushd $install_dir php$phpversion api/bin/console zusam:migration ynh_script_progression --message="Pulling in external libraries with Composer..." - ynh_install_composer + ynh_install_composer -w $install_dir/api/ cp app/dist/* public/ popd From cf59955857dea98cdc3842ac1a9faeb1e1832481 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Thu, 21 Sep 2023 22:50:18 +0200 Subject: [PATCH 08/21] try to use a specific composer version --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6855819..047a211 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -47,7 +47,7 @@ pushd $install_dir php$phpversion api/bin/console zusam:migration ynh_script_progression --message="Pulling in external libraries with Composer..." - ynh_install_composer -w $install_dir/api/ + ynh_install_composer -c "2.4.2" -w $install_dir/api/ cp app/dist/* public/ popd From 8237e7175a0048120bd1331398e7a5c999126a74 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sat, 23 Sep 2023 20:32:01 +0200 Subject: [PATCH 09/21] We try removing cache before migrating --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 047a211..ffb2e41 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -43,6 +43,7 @@ ynh_script_progression --message="Proceeding to migration..." pushd $install_dir ynh_script_progression --message="Proceeding to migration..." + rm -rf $install_dir/api/var/cache/ php$phpversion api/bin/console doctrine:migration:migrate php$phpversion api/bin/console zusam:migration From 9e25897e6ffd4487aa44df6f9893670439cebc65 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sat, 23 Sep 2023 22:11:35 +0200 Subject: [PATCH 10/21] We try -r option for ynh_setup_source --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ffb2e41..81f218b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,7 +32,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" + ynh_setup_source -r --dest_dir="$install_dir" fi #================================================= From 43dfa4e8f76543ac0e65b4572f33197ae6a0b91c Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sat, 23 Sep 2023 22:26:49 +0200 Subject: [PATCH 11/21] Try again --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 81f218b..74972e6 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,7 +32,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source -r --dest_dir="$install_dir" + ynh_setup_source --dest_dir="$install_dir" --full-replace fi #================================================= From 6a91340fd6118dcdfb079bc16ddf9e49e5f21f79 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sat, 23 Sep 2023 22:42:04 +0200 Subject: [PATCH 12/21] Typo --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 74972e6..aeb5d9f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -32,7 +32,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --full-replace + ynh_setup_source --dest_dir="$install_dir" --full_replace fi #================================================= From 54ccf25dbe33f0ff293162678edc8545274759d5 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sat, 23 Sep 2023 22:49:58 +0200 Subject: [PATCH 13/21] Remove api/config/packages/sensio_framework_extra.yaml when updating --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index aeb5d9f..855df3b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,6 +33,7 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --full_replace + rm -f $install_dir/api/config/packages/sensio_framework_extra.yaml fi #================================================= From b0f089b7124b18c81dd0b90f3894283474a88927 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sat, 23 Sep 2023 22:59:09 +0200 Subject: [PATCH 14/21] cp -r needed for app/dist? --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 855df3b..6f77bce 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -50,7 +50,7 @@ pushd $install_dir ynh_script_progression --message="Pulling in external libraries with Composer..." ynh_install_composer -c "2.4.2" -w $install_dir/api/ - cp app/dist/* public/ + cp -r app/dist/* public/ popd chown -R $app:www-data "$install_dir" From 4a648968a262060b894e7e4caa3325a8741215ca Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sat, 23 Sep 2023 23:59:47 +0200 Subject: [PATCH 15/21] Try to get rid of prompt during upgrade --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6f77bce..16cc2c7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -45,8 +45,8 @@ ynh_script_progression --message="Proceeding to migration..." pushd $install_dir ynh_script_progression --message="Proceeding to migration..." rm -rf $install_dir/api/var/cache/ - php$phpversion api/bin/console doctrine:migration:migrate - php$phpversion api/bin/console zusam:migration + php$phpversion api/bin/console --no-interaction --allow-no-migration doctrine:migration:migrate + php$phpversion api/bin/console --no-interaction --allow-no-migration zusam:migration ynh_script_progression --message="Pulling in external libraries with Composer..." ynh_install_composer -c "2.4.2" -w $install_dir/api/ From 37efa501785bd045f88c76279552de59d29177a7 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sun, 24 Sep 2023 00:06:24 +0200 Subject: [PATCH 16/21] Same player try again --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 16cc2c7..ff7b0bb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -45,8 +45,8 @@ ynh_script_progression --message="Proceeding to migration..." pushd $install_dir ynh_script_progression --message="Proceeding to migration..." rm -rf $install_dir/api/var/cache/ - php$phpversion api/bin/console --no-interaction --allow-no-migration doctrine:migration:migrate - php$phpversion api/bin/console --no-interaction --allow-no-migration zusam:migration + php$phpversion api/bin/console doctrine:migration:migrate --no-interaction --allow-no-migration + php$phpversion api/bin/console zusam:migration --no-interaction --allow-no-migration ynh_script_progression --message="Pulling in external libraries with Composer..." ynh_install_composer -c "2.4.2" -w $install_dir/api/ From b8431b793bbf5c72a1a7216f7b5ce7e06c8c803b Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sun, 24 Sep 2023 00:08:54 +0200 Subject: [PATCH 17/21] removing non existing options --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ff7b0bb..a6be8b7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,7 +46,7 @@ pushd $install_dir ynh_script_progression --message="Proceeding to migration..." rm -rf $install_dir/api/var/cache/ php$phpversion api/bin/console doctrine:migration:migrate --no-interaction --allow-no-migration - php$phpversion api/bin/console zusam:migration --no-interaction --allow-no-migration + php$phpversion api/bin/console zusam:migration ynh_script_progression --message="Pulling in external libraries with Composer..." ynh_install_composer -c "2.4.2" -w $install_dir/api/ From 5cf66d03f97486d8bcfb3f38409b0f0db27d8f74 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sun, 24 Sep 2023 00:24:54 +0200 Subject: [PATCH 18/21] remove sensio_framework_extra.yaml only if it exists --- scripts/upgrade | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index a6be8b7..b05c8c0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,7 +33,10 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" --full_replace - rm -f $install_dir/api/config/packages/sensio_framework_extra.yaml + if [ -f $install_dir/api/config/packages/sensio_framework_extra.yaml ] + then + rm -f $install_dir/api/config/packages/sensio_framework_extra.yaml + fi fi #================================================= From c3ab997af080f08550ae492e6b21049822ea058f Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sun, 24 Sep 2023 00:49:31 +0200 Subject: [PATCH 19/21] update manifest.toml & tests.toml --- manifest.toml | 2 +- tests.toml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 5ae0475..e921340 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Zusam" description.en = "Truly private space for you and your friends" description.fr = "Espace entièrement privé pour vous et vos amis" -version = "0.5.4~ynh1" +version = "0.5.4~ynh2" maintainers = ["Papa Dragon"] diff --git a/tests.toml b/tests.toml index f453551..04f44d4 100644 --- a/tests.toml +++ b/tests.toml @@ -4,3 +4,6 @@ test_format = 1.0 args.first_user = "package_checker" args.first_group = "SuperGroup" + + test_upgrade_from.6cea5ff5b8d5984e34ca8b3749e342fa96d3779d.name = "Upgrade from 0.5.3~ynh1" + test_upgrade_from.00e87799b98e083dfbee1c1b601e74f05db6a7d9.name = "Upgrade from 0.5.4~ynh1" From 19dd4dff2fa0922e2f86d3486bf9746e52cf5351 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 23 Sep 2023 22:49:41 +0000 Subject: [PATCH 20/21] 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 a6f410e..02a6687 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The goal is to make a stable, extensible, lightweight and user-friendly way to s - Low server footprint -**Shipped version:** 0.5.4~ynh1 +**Shipped version:** 0.5.4~ynh2 **Demo:** https://demo.zusam.org diff --git a/README_fr.md b/README_fr.md index 94c4271..f598145 100644 --- a/README_fr.md +++ b/README_fr.md @@ -29,7 +29,7 @@ L'objectif est de disposer d'un outil stable, extensible, léger et convivial po - Faible empreinte serveur -**Version incluse :** 0.5.4~ynh1 +**Version incluse :** 0.5.4~ynh2 **Démo :** https://demo.zusam.org From 74e7c3efe98ef281e302b6da302cb2dc7c53458d Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Sun, 24 Sep 2023 01:12:16 +0200 Subject: [PATCH 21/21] remove rm from upgrade script and replace with ynh_secure_remove --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index b05c8c0..c2f456c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -35,7 +35,7 @@ then ynh_setup_source --dest_dir="$install_dir" --full_replace if [ -f $install_dir/api/config/packages/sensio_framework_extra.yaml ] then - rm -f $install_dir/api/config/packages/sensio_framework_extra.yaml + ynh_secure_remove $install_dir/api/config/packages/sensio_framework_extra.yaml fi fi @@ -47,7 +47,7 @@ ynh_script_progression --message="Proceeding to migration..." pushd $install_dir ynh_script_progression --message="Proceeding to migration..." - rm -rf $install_dir/api/var/cache/ + ynh_secure_remove $install_dir/api/var/cache/ php$phpversion api/bin/console doctrine:migration:migrate --no-interaction --allow-no-migration php$phpversion api/bin/console zusam:migration