From 3a877009fd9774eda9eef01f1dccab2a11862cf3 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Wed, 17 Mar 2021 00:17:31 +0100 Subject: [PATCH 01/12] script for old versions to upgrade cleanly --- conf/nginx.conf | 2 +- manifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 9ad0765..6a8bd52 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/www/ ; + alias __FINALPATH__/www/; if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; diff --git a/manifest.json b/manifest.json index bc4c5a7..e8c3916 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "win10@tutanota.com" }, "requirements": { - "yunohost": ">=4.0" + "yunohost": ">=4.0" }, "multi_instance": true, "services": [ From d1b7aa2c99714eb5dcd8f6ec706503f572f822c8 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Wed, 17 Mar 2021 00:52:27 +0100 Subject: [PATCH 02/12] add a condition in upgrade if version outdated before 0.9.8 --- conf/0.9.8.src | 6 ++++++ scripts/upgrade | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 conf/0.9.8.src diff --git a/conf/0.9.8.src b/conf/0.9.8.src new file mode 100644 index 0000000..0be6dec --- /dev/null +++ b/conf/0.9.8.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-0.9.8.1.tar.bz2 +SOURCE_SUM=7cc64b51c9721c2dd7ee510f245bcfc4693ee07f74581ad74003906eb4716ef1 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.bz2 +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 34f12fb..288da31 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,6 +25,11 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) # CHECK VERSION #================================================= +if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then + ynh_setup_source --dest_dir="$final_path" --source_id="0.9.8" + ynh_local_curl "/www/admin/index.php" +fi + upgrade_type=$(ynh_check_app_version_changed) #================================================= From 298db507ff673c0f8268d7fed777b76ef3116ccb Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Wed, 17 Mar 2021 01:33:54 +0100 Subject: [PATCH 03/12] remove ynh_local_curl --- scripts/upgrade | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 288da31..21bf618 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,7 +27,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then ynh_setup_source --dest_dir="$final_path" --source_id="0.9.8" - ynh_local_curl "/www/admin/index.php" fi upgrade_type=$(ynh_check_app_version_changed) From ef06ea81fa4831ec5d0f4eb65145805a6bcf85f0 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Wed, 17 Mar 2021 01:54:56 +0100 Subject: [PATCH 04/12] correct indexation --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 48e634e..7cef4cd 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "win10@tutanota.com" }, "requirements": { - "yunohost": ">=4.0" + "yunohost": ">=4.0" }, "multi_instance": true, "services": [ From 4ef838910929b6c3d8c47e1d23422c8c08f050c4 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Mon, 29 Mar 2021 18:05:33 +0200 Subject: [PATCH 05/12] symply add a message if version is too old to begin with the 0.9.8 update --- conf/0.9.8.src | 6 ------ scripts/upgrade | 9 +++++---- 2 files changed, 5 insertions(+), 10 deletions(-) delete mode 100644 conf/0.9.8.src diff --git a/conf/0.9.8.src b/conf/0.9.8.src deleted file mode 100644 index 0be6dec..0000000 --- a/conf/0.9.8.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-0.9.8.1.tar.bz2 -SOURCE_SUM=7cc64b51c9721c2dd7ee510f245bcfc4693ee07f74581ad74003906eb4716ef1 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.bz2 -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 21bf618..55fe4e4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,13 +24,14 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION #================================================= - if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then - ynh_setup_source --dest_dir="$final_path" --source_id="0.9.8" + ynh_print_info --message="Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that: + 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug'" + ynh_die "Sorry your version is outdated and need first an update to version O.9.8.1" +else + upgrade_type=$(ynh_check_app_version_changed) fi -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= From d5ccc4493df1e81d0dc597c4c9d74ba6e70eb6bf Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Mon, 29 Mar 2021 18:14:45 +0200 Subject: [PATCH 06/12] more explanation in the message --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 55fe4e4..e12d8ab 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -26,7 +26,8 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then ynh_print_info --message="Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that: - 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug'" + 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug' + and please first connect to your garradin admin page before updating to version 1.0.*" ynh_die "Sorry your version is outdated and need first an update to version O.9.8.1" else upgrade_type=$(ynh_check_app_version_changed) From eb703d713003bf85129f1d41f64bb7b2de922af5 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Mon, 29 Mar 2021 18:18:18 +0200 Subject: [PATCH 07/12] update to 1.0.7 --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 277328f..eb6ff36 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in ## Overview Garradin is a free association managing software. -**Shipped version:** 1.0.6 +**Shipped version:** 1.0.7 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 340610b..d472910 100644 --- a/README_fr.md +++ b/README_fr.md @@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install ## Vue d'ensemble Garradin est un logiciel libre de gestion associative. il permet de gérer des membres. -**Version incluse :** 1.0.6 +**Version incluse :** 1.0.7 ## Captures d'écran diff --git a/conf/app.src b/conf/app.src index dc2a031..cd191db 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-1.0.6.tar.bz2 -SOURCE_SUM=dcb2b5481fdd9ca2544f1e1f81fff1067d6eb7189e0f8547c98f6413040cf65b +SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-1.0.7.tar.bz2 +SOURCE_SUM=bf54afad2ebd1e04cb5fa7f5a2033a7c790e30e7fb69b6795b103d66dfcb6c06 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.bz2 SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 7cef4cd..7ca9676 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Software to manage association", "fr": "Logiciel libre de gestion d'association" }, - "version": "1.0.6~ynh1", + "version": "1.0.7~ynh1", "url": "http://garradin.eu/a-propos/", "license": "GPL-3.0-or-later", "maintainer": { From 142836f0f3361b3c2542975d77002dd877b898a4 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Mon, 29 Mar 2021 19:10:54 +0200 Subject: [PATCH 08/12] more explanation in the messages --- scripts/upgrade | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e12d8ab..5c20f28 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,10 +25,8 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) # CHECK VERSION #================================================= if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then - ynh_print_info --message="Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that: - 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug' - and please first connect to your garradin admin page before updating to version 1.0.*" - ynh_die "Sorry your version is outdated and need first an update to version O.9.8.1" + ynh_print_info --message="Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that:'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug' and please first connect to your garradin admin page before next update to version 1.0.*" + ynh_die "Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that: 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug' and please first connect to your garradin admin page before next update to version 1.0.*" else upgrade_type=$(ynh_check_app_version_changed) fi From 8a2ff1a1aef5bbf4723e9e68224f62cb55f62d99 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Mon, 29 Mar 2021 20:27:48 +0200 Subject: [PATCH 09/12] clean syntax for scripts with new release helpers in yunohost --- manifest.json | 12 ------------ scripts/backup | 2 +- scripts/install | 3 --- scripts/upgrade | 36 ++++++------------------------------ 4 files changed, 7 insertions(+), 46 deletions(-) diff --git a/manifest.json b/manifest.json index 7ca9676..0545d5b 100644 --- a/manifest.json +++ b/manifest.json @@ -26,29 +26,17 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for Garradin", - "fr": "Choisissez un domaine pour Garradin" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Garradin", - "fr": "Choisissez un chemin pour Garradin" - }, "example": "/garradin", "default": "/garradin" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "help": { "en": "The SSO is not implemented for this app and yunohost is not sure for hundred of users...", "fr": "Le SSO n'est pas implémenté pour cette application et yunohost n'est pas sûr pour une centaine d'utilisateurs..." diff --git a/scripts/backup b/scripts/backup index 2ba0d4f..551df9d 100644 --- a/scripts/backup +++ b/scripts/backup @@ -20,7 +20,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." +ynh_print_info "Declaring files to be backed up..." app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/install b/scripts/install index 65582d4..9ff666a 100644 --- a/scripts/install +++ b/scripts/install @@ -33,9 +33,6 @@ ynh_script_progression --message="Validating installation parameters..." --weigh final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" -# Normalize the URL path syntax -path_url=$(ynh_normalize_url_path $path_url) - # Check web path availability ynh_webpath_available $domain $path_url # Register (book) web path diff --git a/scripts/upgrade b/scripts/upgrade index 5c20f28..fd06324 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,8 +25,8 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) # CHECK VERSION #================================================= if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then - ynh_print_info --message="Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that:'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug' and please first connect to your garradin admin page before next update to version 1.0.*" - ynh_die "Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that: 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug' and please first connect to your garradin admin page before next update to version 1.0.*" + ynh_print_info --message="Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that: 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug'" + ynh_die "Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that: 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug'" else upgrade_type=$(ynh_check_app_version_changed) fi @@ -42,28 +42,6 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi -### If nobody installed your app before 3.7, -### then you may safely remove these lines - -# Cleaning legacy permissions -# is_public=$(ynh_app_setting_get --app=$app --key=is_public) - -if [ -n "$is_public" ]; then - # Remove protected_uris - ynh_app_setting_delete --app=$app --key=protected_uris - - #Removing skipped/unprotected_uris under certain conditions, remove the visitors group added during the migration process of 3.7 - #Remove skipped_uris. If the app was public, add visitors again to the main permission - if ynh_permission_has_user --permission=main --user=visitors - then - ynh_app_setting_delete --app=$app --key=skipped_uris - ynh_permission_update --permission "main" --add "visitors" - else - ynh_app_setting_delete --app=$app --key=skipped_uris - fi - ynh_app_setting_delete --app=$app --key=is_public -fi - #================================================= # Backup Data #================================================= @@ -99,11 +77,7 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Upgrading source files..." --weight=5 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" -fi +$upgrade_type == "UPGRADE_APP" #================================================= # CREATE DEDICATED USER @@ -128,7 +102,7 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --package="$extra_php_dependencies" - +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #======================================================= # backup bdd, squelettes directory and config.local.php #======================================================= @@ -140,11 +114,13 @@ backup_squelettes=/tmp/squelettes if [ -d "$backup_squelettes" ] then cp -ar $backup_squelettes $final_path/www/squelettes + rm -r $backup_squelettes fi if [ -e "$backup_bdd" ] then cp -a $backup_bdd $final_path/association.sqlite + rm -r $backup_bdd fi key=$(ynh_string_random --length=50) From 2f5ec708a209c69ee36bd8d38750bd6ae72ca05b Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Mon, 29 Mar 2021 20:32:24 +0200 Subject: [PATCH 10/12] clean syntax for scripts with new release helpers in yunohost --- scripts/upgrade | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index fd06324..0faaaef 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -77,7 +77,11 @@ ynh_abort_if_errors #================================================= ynh_script_progression --message="Upgrading source files..." --weight=5 -$upgrade_type == "UPGRADE_APP" +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" +fi #================================================= # CREATE DEDICATED USER From 83779d120ed08db543962f43fcc0319d2e95d050 Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Mon, 29 Mar 2021 22:00:48 +0200 Subject: [PATCH 11/12] clean syntax for scripts with helpers in yunohost --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0faaaef..3875233 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -118,13 +118,13 @@ backup_squelettes=/tmp/squelettes if [ -d "$backup_squelettes" ] then cp -ar $backup_squelettes $final_path/www/squelettes - rm -r $backup_squelettes + ynh_secure_remove $backup_squelettes fi if [ -e "$backup_bdd" ] then cp -a $backup_bdd $final_path/association.sqlite - rm -r $backup_bdd + ynh_secure_remove $backup_bdd fi key=$(ynh_string_random --length=50) From 696d4be07d976b411b126b5015dd8f47959cf13f Mon Sep 17 00:00:00 2001 From: Robles Rodolphe Date: Tue, 30 Mar 2021 10:57:48 +0200 Subject: [PATCH 12/12] add explanation for message if version outdated --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 3875233..cb15d46 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,8 +25,8 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) # CHECK VERSION #================================================= if ynh_compare_current_package_version --comparison lt --version 0.9.8.1~ynh1; then - ynh_print_info --message="Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that: 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug'" - ynh_die "Sorry your version is outdated and need first an update to version O.9.8.1 with the branch 0.9.8, proceed like that: 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug'" + ynh_print_info --message="Sorry your version is outdated and need first an update to version 0.9.8.1 with the branch 0.9.8, proceed like that: 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug' and open your admin page to finalize before next update" + ynh_die "Sorry your version is outdated and need first an update to version 0.9.8.1 with the branch 0.9.8, proceed like that: 'sudo yunohost app upgrade garradin -u https://github.com/YunoHost-Apps/garradin_ynh/tree/0.9.8 --debug' and open your admin page to finalize before next update" else upgrade_type=$(ynh_check_app_version_changed) fi