From 3dbd2e68a7eabacdb5a8d24ca42cf26bb78cef47 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 14 Jul 2020 12:56:01 +0200 Subject: [PATCH 1/9] update to upstream --- README.md | 8 ++------ README_fr.md | 10 +++------- conf/app.src | 4 ++-- conf/nginx.conf | 2 +- manifest.json | 10 ++++------ scripts/_common.sh | 43 +++++++++---------------------------------- 6 files changed, 21 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index d4a6eb1..fca5f99 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Garradin +# Garradin for YunoHost [![Integration level](https://dash.yunohost.org/integration/garradin.svg)](https://dash.yunohost.org/appci/app/garradin) ![](https://ci-apps.yunohost.org/ci/badges/garradin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/garradin.maintain.svg) [![Install Garradin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=garradin) @@ -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:** 0.9.6 +**Shipped version:** 0.9.7 ## Screenshots @@ -45,9 +45,6 @@ LDAP is not supported yet. * The application is ONLY translated into french. -**More info on the documentation page:** -https://yunohost.org/packaging_apps - ## Links * Report a bug: https://github.com/YunoHost-Apps/garradin_ynh/issues @@ -60,7 +57,6 @@ https://yunohost.org/packaging_apps Developer info ---------------- -**Only if you want to use a testing branch for coding, instead of merging directly into master.** Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/garradin_ynh/tree/testing). To try the testing branch, please proceed like that. diff --git a/README_fr.md b/README_fr.md index ff88f39..c29bc61 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,17 +1,17 @@ -# Garradin +# Garradin pour YunoHost [![Niveau d'intégration](https://dash.yunohost.org/integration/garradin.svg)](https://dash.yunohost.org/appci/app/garradin) ![](https://ci-apps.yunohost.org/ci/badges/garradin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/garradin.maintain.svg) [![Installer Garradin avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=garradin) *[Read this readme in english.](./README.md)* -> *Ce package vous permet d'installer REPLACEBYYOURAPP rapidement et simplement sur un serveur YunoHost. +> *Ce package vous permet d'installer Garradin rapidement et simplement sur un serveur YunoHost. Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* ## Vue d'ensemble Garradin est un logiciel libre de gestion associative. il permet de gérer des membres. -**Version incluse :** 0.9.6 +**Version incluse :** 0.9.7 ## Captures d'écran @@ -44,9 +44,6 @@ Garradin est un logiciel libre de gestion associative. il permet de gérer des m * Garradin n'est disponible qu'en français. -**Plus d'informations sur la page de documentation :** -https://yunohost.org/packaging_apps - ## Liens * Signaler un bug : https://github.com/YunoHost-Apps/garradin_ynh/issues @@ -59,7 +56,6 @@ https://yunohost.org/packaging_apps Informations pour les développeurs ---------------- -**Seulement si vous voulez utiliser une branche de test pour le codage, au lieu de fusionner directement dans la banche principale.** Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/garradin_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. diff --git a/conf/app.src b/conf/app.src index 793816f..234cc57 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-0.9.6.tar.bz2 -SOURCE_SUM=a0c4dcc6adc25a6f093bc09b0ed4c7efcbfde0726b790431c293112800ccc282 +SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-0.9.7.tar.bz2 +SOURCE_SUM=659b1e2fada284f76d6a37f592c6e7068eb883bb8361392de207aff79ad53af7 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.bz2 SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index efd6ba0..9b17fcc 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,5 +1,5 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__ { +location __PATH__/ { # Path to source alias __FINALPATH__/www/ ; diff --git a/manifest.json b/manifest.json index 6a94ac3..466e3c7 100644 --- a/manifest.json +++ b/manifest.json @@ -2,21 +2,19 @@ "name": "Garradin", "id": "garradin", "packaging_format": 1, - "requirements": { - "yunohost": ">=3.7.0" - }, "description": { "en": "Software to manage association", "fr": "Logiciel libre de gestion d'association" }, - - "version": "0.9.6~ynh3", - + "version": "0.9.7~ynh1", "url": "http://garradin.eu/a-propos/", "license": "GPL-3.0-or-later", "maintainer": { "name": "frju365", "email": "win10@tutanota.com" + }, + "requirements": { + "yunohost": ">=3.7.1" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 768fbe1..0a022c4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,39 +8,14 @@ pkg_dependencies="php-sqlite3" -# ============= FUTURE YUNOHOST HELPER ============= +#================================================= +# PERSONAL HELPERS +#================================================= -# Check if a permission exists -# -# While waiting for this new helper https://github.com/YunoHost/yunohost/pull/905 -# We have to use another one because the new helper use a new YunoHost command, not available for now. -# -# usage: ynh_permission_has_user --permission=permission --user=user -# | arg: -p, --permission - the permission to check -# | arg: -u, --user - the user seek in the permission -# -# example: ynh_permission_has_user --permission=main --user=visitors -# -# Requires YunoHost version 3.7.1 or higher. -ynh_permission_has_user() { - local legacy_args=pu - # Declare an array to define the options of this helper. - declare -Ar args_array=( [p]=permission= [u]=user= ) - local permission - local user - # Manage arguments with getopts - ynh_handle_getopts_args "$@" +#================================================= +# EXPERIMENTAL HELPERS +#================================================= - if ! ynh_permission_exists --permission=$permission - then - return 1 - fi - - # List all permissions - # Filter only the required permission with a multiline sed (Here a cut from the permission to the next one), remove the url and his value - perm="$(yunohost user permission list --full --output-as plain | sed --quiet "/^#$app.$permission/,/^#[[:alnum:]]/p" | sed "/^##url/,+1d")" - # Remove all lines starting by # (got from the plain output before) - allowed_users="$(echo "$perm" | grep --invert-match '^#')" - # Grep the list of users an return the result if the user is indeed into the list - echo "$allowed_users" | grep --quiet --word "$user" -} +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= From f62b7561b38ab4b023d8bd24993905278872988d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 14 Jul 2020 13:13:35 +0200 Subject: [PATCH 2/9] clean up --- README.md | 3 +-- scripts/backup | 11 ++++++----- scripts/change_url | 9 ++++----- scripts/install | 21 ++++++++++----------- scripts/remove | 14 +++++++------- scripts/restore | 16 ++++++++-------- scripts/upgrade | 40 +++++++++++----------------------------- 7 files changed, 47 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index fca5f99..776fbd5 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ Garradin is a free association managing software. * [Official demo](https://garradin.eu/essai/) - ## Documentation * Official documentation: https://fossil.kd2.org/garradin/wiki?name=Documentation @@ -43,7 +42,7 @@ LDAP is not supported yet. ## Limitations -* The application is ONLY translated into french. +* Garradin is only available in French. ## Links diff --git a/scripts/backup b/scripts/backup index 27102aa..c8fb622 100644 --- a/scripts/backup +++ b/scripts/backup @@ -20,37 +20,38 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +#================================================= +# DECLARE DATA AND CONF FILES TO BACKUP +#================================================= +ynh_print_info --message="Declaring files to be backed up..." + #================================================= # STANDARD BACKUP STEPS #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_script_progression --message="Backing up the main app directory..." --time --weight=1 ynh_backup --src_path="$final_path" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Backing up nginx web server configuration..." --time --weight=1 ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Backing up php-fpm configuration..." --time --weight=1 ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --time --last +ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index d112cdc..3e10993 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) @@ -50,7 +50,7 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating nginx web server configuration..." --weight=3 nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf final_path=/var/www/$app @@ -90,15 +90,14 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading nginx web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload #================================================= # last configuration #================================================= -#================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index ec67600..f080a8e 100644 --- a/scripts/install +++ b/scripts/install @@ -28,7 +28,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --time --weight=1 +ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/var/www/$app test ! -e "$final_path" || ynh_die "This path already contains a folder" @@ -44,7 +44,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --time --weight=1 +ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain @@ -53,14 +53,14 @@ ynh_app_setting_set --app=$app --key=path --value=$path_url #================================================= # Install dependency to convert tracks to a readable format for the browser #================================================= -ynh_script_progression --message="Installing dependencies..." --time --weight=1 +ynh_script_progression --message="Installing dependencies..." --weight=9 ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Configuring system user..." --time --weight=1 +ynh_script_progression --message="Configuring system user..." --weight=1 # Create a system user ynh_system_user_create --username=$app @@ -68,24 +68,23 @@ ynh_system_user_create --username=$app #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --time --weight=1 +ynh_script_progression --message="Setting up source files..." --weight=4 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" - #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." --time --weight=1 +ynh_script_progression --message="Configuring nginx web server..." --weight=2 # Create a dedicated nginx config ynh_add_nginx_config #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." --time --weight=1 +ynh_script_progression --message="Configuring php-fpm..." --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config @@ -102,7 +101,7 @@ ynh_app_setting_delete --app=$app --key=skipped_uris #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --time --weight=1 +ynh_script_progression --message="Configuring permissions..." --weight=1 # Make app public if necessary if [ $is_public -eq 1 ] @@ -132,7 +131,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading nginx web server..." --weight=1 systemctl reload nginx @@ -140,4 +139,4 @@ systemctl reload nginx # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --time --last \ No newline at end of file +ynh_script_progression --message="Installation of $app completed" --last \ No newline at end of file diff --git a/scripts/remove b/scripts/remove index aac63fd..eef1b1e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -22,7 +22,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # REMOVE DEPENDENCIES #================================================= -ynh_script_progression --message="Removing dependencies..." --time --weight=1 +ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies @@ -30,7 +30,7 @@ ynh_remove_app_dependencies #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --time --weight=1 +ynh_script_progression --message="Removing app main directory..." --weight=5 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -38,7 +38,7 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Removing nginx web server configuration..." --weight=1 # Remove the dedicated nginx config ynh_remove_nginx_config @@ -46,7 +46,7 @@ ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." --time --weight=1 +ynh_script_progression --message="Removing php-fpm configuration..." --weight=1 # Remove the dedicated php-fpm config ynh_remove_fpm_config @@ -56,7 +56,7 @@ ynh_remove_fpm_config #================================================= # REMOVE DEDICATED USER #================================================= -ynh_script_progression --message="Removing the dedicated system user..." --time --weight=1 +ynh_script_progression --message="Removing the dedicated system user..." --weight=2 # Delete a system user ynh_system_user_delete --username=$app @@ -65,4 +65,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --time --last \ No newline at end of file +ynh_script_progression --message="Removal of $app completed" --last diff --git a/scripts/restore b/scripts/restore index 53d9726..5271f2e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -20,7 +20,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." --time --weight=1 +ynh_script_progression --message="Loading settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -31,7 +31,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # CHECK IF THE APP CAN BE RESTORED #================================================= -ynh_script_progression --message="Validating restoration parameters..." --time --weight=1 +ynh_script_progression --message="Validating restoration parameters..." --weight=1 ynh_webpath_available $domain $path_url \ || ynh_die "Path not available: ${domain}${path_url}" @@ -49,14 +49,14 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --time --weight=1 +ynh_script_progression --message="Restoring the app main directory..." --weight=5 ynh_restore_file "$final_path" #================================================= # RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1 +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 # Create the dedicated user (if not existing) ynh_system_user_create --username=$app @@ -71,7 +71,7 @@ chown -R $app:$app $final_path #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restore php-fpm configuration..." --time --weight=1 +ynh_script_progression --message="Restore php-fpm configuration..." --weight=1 ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" @@ -80,7 +80,7 @@ ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --time --weight=1 +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies @@ -90,7 +90,7 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." --time --weight=1 +ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=1 ynh_systemd_action --service_name=php7.0-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload @@ -99,4 +99,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --time --last \ No newline at end of file +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index a708b02..b5f5e7f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -12,7 +12,7 @@ source /usr/share/yunohost/helpers #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading installation settings..." --time --weight=1 +ynh_script_progression --message="Loading installation settings..." --weight=1 app=$YNH_APP_INSTANCE_NAME @@ -23,18 +23,12 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) || ynh_die "This p # CHECK VERSION #================================================= -### This helper will compare the version of the currently installed app and the version of the upstream package. -### $upgrade_type can have 2 different values -### - UPGRADE_APP if the upstream app version has changed -### - UPGRADE_PACKAGE if only the YunoHost package has changed -### ynh_check_app_version_changed will stop the upgrade if the app is up to date. -### UPGRADE_APP should be used to upgrade the core app only if there's an upgrade to do. upgrade_type=$(ynh_check_app_version_changed) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If final_path doesn't exist, create it if [ -z "$final_path" ]; then @@ -94,22 +88,10 @@ ynh_clean_setup () { # Exit if an error occurs during the execution of the script ynh_abort_if_errors -# #================================================= -# # CHECK THE PATH -# #================================================= - -# Normalize the URL path syntax -# N.B. : this is for app installations before YunoHost 2.7 -# where this value might be something like /foo/ or foo/ -# instead of /foo .... -# If nobody installed your app before 2.7, then you may -# safely remove this line -#path_url=$(ynh_normalize_url_path --path_url=$path_url) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." --time --weight=1 +ynh_script_progression --message="Upgrading source files..." --weight=5 if [ "$upgrade_type" == "UPGRADE_APP" ] then @@ -120,23 +102,22 @@ fi #================================================= # UPGRADE DEPENDENCIES #================================================= -ynh_script_progression --message="Upgrading dependencies..." --time --weight=1 +ynh_script_progression --message="Upgrading dependencies..." --weight=3 ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER #================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1 +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 # Create a dedicated user (if not existing) ynh_system_user_create --username=$app - #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=1 # Create a dedicated nginx config ynh_add_nginx_config @@ -144,7 +125,7 @@ ynh_add_nginx_config #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=1 # Create a dedicated php-fpm config ynh_add_fpm_config @@ -193,7 +174,7 @@ chmod 755 $final_path -R #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Upgrading permissions configuration..." --time --weight=1 +ynh_script_progression --message="Upgrading permissions configuration..." --weight=1 # Create the visitors permission if needed if ! ynh_permission_exists --permission "visitors"; then @@ -203,11 +184,12 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." --time --weight=1 +ynh_script_progression --message="Reloading nginx web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --time --last \ No newline at end of file + +ynh_script_progression --message="Upgrade of $app completed" --last From 78f5cc6877039e7c172fd75302584a9055fe6c21 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 14 Jul 2020 13:18:10 +0200 Subject: [PATCH 3/9] pull request template --- .../pull_request_template.md | 18 ------------------ pull_request_template.md | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE/pull_request_template.md create mode 100644 pull_request_template.md diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index 9979eb1..0000000 --- a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ /dev/null @@ -1,18 +0,0 @@ -## Problem -- - -## Solution -- - -## PR Status -- - -## Validation ---- -*Minor decision* -- **Upgrade previous version** : -- [ ] **Code review** : -- [ ] **Approval (LGTM)** : -- [ ] **Approval (LGTM)** : -- **CI succeeded** : [![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/garradin_ynh%20xxx%20(Official)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/nextcloud_ynh%20xxx%20(Official)/) -When the PR is mark as ready to merge, you have to wait for 3 days before really merge it. diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 0000000..23b89b0 --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,19 @@ +## Problem +- *Description of why you made this PR* + +## Solution +- *And how do you fix that problem* + +## PR Status +- [ ] Code finished. +- [ ] Tested with Package_check. +- [ ] Fix or enhancement tested. +- [ ] Upgrade from last version tested. +- [ ] Can be reviewed and tested. + +## Package_check results +--- +*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* + +[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/garradin_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/garradin_ynh%20PR-NUM-%20(USERNAME)/) + From d8f670f7cecb97d700e96510fb1dc4cafb997bd7 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 14 Jul 2020 13:58:15 +0200 Subject: [PATCH 4/9] cleaning up --- pull_request_template.md | 1 - scripts/install | 2 +- scripts/upgrade | 7 ++++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pull_request_template.md b/pull_request_template.md index 23b89b0..2db70f4 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -16,4 +16,3 @@ *If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* [![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/garradin_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/garradin_ynh%20PR-NUM-%20(USERNAME)/) - diff --git a/scripts/install b/scripts/install index f080a8e..9169c22 100644 --- a/scripts/install +++ b/scripts/install @@ -139,4 +139,4 @@ systemctl reload nginx # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last \ No newline at end of file +ynh_script_progression --message="Installation of $app completed" --last diff --git a/scripts/upgrade b/scripts/upgrade index b5f5e7f..22afa25 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) || ynh_die "This path already contains a folder" + #================================================= # CHECK VERSION #================================================= @@ -61,7 +62,7 @@ fi #================================================= # Backup Data #================================================= -ynh_script_progression --message="Backing up the data before upgrading (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the data before upgrading (may take a while)..." --weight=1 bdd=$final_path/association.sqlite squelettes=$final_path/www/squelettes @@ -77,7 +78,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --time --weight=1 +ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 # Backup the current version of the app ynh_backup_before_upgrade @@ -134,7 +135,7 @@ ynh_add_fpm_config # Change options in file config.dist.php # and copy in local.dist.php #================================================= -ynh_script_progression --message="final configuration needed..." --time --weight=1 +ynh_script_progression --message="final configuration needed..." --weight=1 key=$(ynh_string_random --length=50) cp -a $final_path/config.dist.php $final_path/config.local.php From bc4ad82598c05baaa8a6cd68522c033b822e7f5a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 4 Oct 2020 18:42:48 +0200 Subject: [PATCH 5/9] Upgrade to 7.3 --- conf/nginx.conf | 2 +- conf/php-fpm.conf | 2 +- manifest.json | 4 ++-- scripts/_common.sh | 9 ++++----- scripts/backup | 3 ++- scripts/install | 15 +++++---------- scripts/restore | 23 +++++------------------ scripts/upgrade | 10 ++-------- 8 files changed, 22 insertions(+), 46 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index e07a530..b73524a 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -26,7 +26,7 @@ if ($scheme = http) { location ~ [^/]\.php(/|$) { try_files $uri $uri/ /_route.php; fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php/php7.0-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param REMOTE_USER $remote_user; diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 3f4bc72..5b710a8 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -30,7 +30,7 @@ group = __USER__ ; specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. -listen = /var/run/php/php7.0-fpm-__NAMETOCHANGE__.sock +listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock ; Set listen(2) backlog. A value of '-1' means unlimited. ; Default Value: 128 (-1 on FreeBSD and OpenBSD) diff --git a/manifest.json b/manifest.json index c2860ae..b1d0dfe 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Software to manage association", "fr": "Logiciel libre de gestion d'association" }, - "version": "0.9.8~ynh3", + "version": "0.9.8~ynh4", "url": "http://garradin.eu/a-propos/", "license": "GPL-3.0-or-later", "maintainer": { @@ -14,7 +14,7 @@ "email": "win10@tutanota.com" }, "requirements": { - "yunohost": ">=3.7.1" + "yunohost": ">=3.8.1" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 98e0574..2c8ba86 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,11 +4,10 @@ # COMMON VARIABLES #================================================= # dependencies used by the app -if [ "$lsb_release --codename --short" = "buster"]; then - pkg_dependencies="php7.3-sqlite3" -else [ "$lsb_release --codename --short" = "stretch"] - pkg_dependencies="php7.0-sqlite3" -fi + +YNH_PHP_VERSION="7.3" + +extra_php_dependencies="php${YNH_PHP_VERSION}-sqlite3" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 21116d2..2ba0d4f 100644 --- a/scripts/backup +++ b/scripts/backup @@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP @@ -50,7 +51,7 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index b5a23ea..c445033 100644 --- a/scripts/install +++ b/scripts/install @@ -49,13 +49,6 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url -#================================================= -# Install dependency to convert tracks to a readable format for the browser -#================================================= -ynh_script_progression --message="Installing dependencies..." --weight=10 - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # CREATE DEDICATED USER #================================================= @@ -77,6 +70,7 @@ ynh_setup_source --dest_dir="$final_path" # NGINX CONFIGURATION #================================================= ynh_script_progression --message="Configuring NGINX web server..." --weight=2 + # Create a dedicated nginx config ynh_add_nginx_config @@ -85,8 +79,9 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Configuring PHP-FPM..." --weight=5 -# Create a dedicated php-fpm config -ynh_add_fpm_config +# Create a dedicated PHP-FPM config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # Files owned by user app @@ -133,7 +128,7 @@ fi #================================================= ynh_script_progression --message="Reloading NGINX web server..." --weight=1 -systemctl reload nginx +ynh_systemd_action --service_name=nginx --action=reload #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index 3726ba2..2c407ff 100644 --- a/scripts/restore +++ b/scripts/restore @@ -27,6 +27,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -71,26 +72,12 @@ chown -R $app:$app $final_path #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restore php-fpm configuration..." --weight=1 +ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=50 -ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=10 +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restore PHP-FPM configuration..." --weight=30 - -ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= # GENERIC FINALIZATION #================================================= @@ -98,7 +85,7 @@ ynh_restore_file --origin_path="/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=1 -ynh_systemd_action --service_name=php7.0-fpm --action=reload +ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 396e7bc..f2ada7e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) || ynh_die "This path already contains a folder" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -100,13 +101,6 @@ then ynh_setup_source --dest_dir="$final_path" fi -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -ynh_script_progression --message="Upgrading dependencies..." --weight=5 - -ynh_install_app_dependencies $pkg_dependencies - #================================================= # CREATE DEDICATED USER #================================================= @@ -129,7 +123,7 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" #======================================================= # backup bdd, squelettes directory and config.local.php From 1f1bba035eaed124304ccf02b3012ebc9425a686 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 4 Oct 2020 18:48:34 +0200 Subject: [PATCH 6/9] Update app.src --- conf/app.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.src b/conf/app.src index a24c59a..01152be 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://fossil.kd2.org/garradin/uv/garradin-0.9.8.tar.bz2 -SOURCE_SUM=98aa01b86521ff66dcc951ab6f0eb1915e3cee5dada15ba20c96ab72512f1e83 +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 From fc73512f5d43c0deff95b6ea22c052bd517cb71c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 4 Oct 2020 18:51:41 +0200 Subject: [PATCH 7/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 007502b..ac562df 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Garradin for YunoHost -[![Integration level](https://dash.yunohost.org/integration/garradin.svg)](https://dash.yunohost.org/appci/app/garradin) ![](https://ci-apps.yunohost.org/ci/badges/garradin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/garradin.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/garradin.svg)](https://dash.yunohost.org/appci/app/garradin) ![](https://ci-apps.yunohost.org/ci/badges/garradin.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/garradin.maintain.svg) [![Install Garradin with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=garradin) *[Lire ce readme en français.](./README_fr.md)* From f660cd55bab050f9b1cd20fc2a9b9aac82262c3c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 4 Oct 2020 18:59:23 +0200 Subject: [PATCH 8/9] Small typos --- scripts/install | 2 +- scripts/remove | 12 ++---------- scripts/restore | 8 ++++---- scripts/upgrade | 4 ++-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/scripts/install b/scripts/install index c445033..bbf505d 100644 --- a/scripts/install +++ b/scripts/install @@ -134,4 +134,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression --message="Installation of Garradin completed" --last diff --git a/scripts/remove b/scripts/remove index b5f4d8c..ee1cc6b 100644 --- a/scripts/remove +++ b/scripts/remove @@ -19,18 +19,10 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --time --weight=10 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE APP MAIN DIR #================================================= -ynh_script_progression --message="Removing app main directory..." --weight=3 +ynh_script_progression --message="Removing Garradin main directory..." --weight=3 # Remove the app directory securely ynh_secure_remove --file="$final_path" @@ -65,4 +57,4 @@ ynh_system_user_delete --username=$app # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression --message="Removal of Garradin completed" --last diff --git a/scripts/restore b/scripts/restore index 2c407ff..f23b8ad 100644 --- a/scripts/restore +++ b/scripts/restore @@ -50,7 +50,7 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=5 +ynh_script_progression --message="Restoring Garradin main directory..." --weight=5 ynh_restore_file "$final_path" @@ -72,7 +72,7 @@ chown -R $app:$app $final_path #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=50 +ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=6 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" @@ -83,7 +83,7 @@ ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependenc #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload @@ -92,4 +92,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression --message="Restoration completed for Garradin" --last diff --git a/scripts/upgrade b/scripts/upgrade index f2ada7e..940e1d9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,7 +79,7 @@ fi #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=30 +ynh_script_progression --message="Backing up Garradin before upgrading (may take a while)..." --weight=30 # Backup the current version of the app ynh_backup_before_upgrade @@ -182,4 +182,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression --message="Upgrade of Garradin completed" --last From 3197fc1da6a2bf8a55c08c33e9c1d94a7efd3b53 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 4 Oct 2020 19:03:24 +0200 Subject: [PATCH 9/9] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index b1d0dfe..1427759 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Software to manage association", "fr": "Logiciel libre de gestion d'association" }, - "version": "0.9.8~ynh4", + "version": "0.9.8.1~ynh4", "url": "http://garradin.eu/a-propos/", "license": "GPL-3.0-or-later", "maintainer": {