From e1e511e67b7fa79ff25e05bcb98295864ba0aa75 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 4 Jan 2022 20:29:31 +0100 Subject: [PATCH 01/17] Apply last example_ynh --- doc/DISCLAIMER.md | 3 +-- doc/DISCLAIMER_fr.md | 3 +-- scripts/_common.sh | 1 + scripts/remove | 16 ++++++++-------- scripts/restore | 3 ++- scripts/upgrade | 1 + 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 576ef0a..23eca0e 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,2 +1 @@ -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * LDAP module can be installed +* LDAP module can be installed diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 7a8ff5f..091edf3 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -1,2 +1 @@ -* Toute limitation connue, contrainte ou élément qui ne fonctionne pas, comme (mais sans s'y limiter) : - * Le module d'authentification LDAP peut être installé +* Le module d'authentification LDAP peut être installé diff --git a/scripts/_common.sh b/scripts/_common.sh index e5daee9..88b3046 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,6 +6,7 @@ YNH_PHP_VERSION="7.3" +# dependencies used by the app pkg_dependencies="curl libzip-dev php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-soap" #================================================= diff --git a/scripts/remove b/scripts/remove index 5fba8f1..f0c04b5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -31,14 +31,6 @@ ynh_script_progression --message="Removing the MySQL database..." # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE APP MAIN DIR #================================================= @@ -63,6 +55,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # SPECIFIC REMOVE #================================================= diff --git a/scripts/restore b/scripts/restore index 40f3f7a..3f90a5d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -39,7 +39,8 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS diff --git a/scripts/upgrade b/scripts/upgrade index 51bb121..8cf2e6a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) From 92e344edf0c9407843c5e37f6b0b010c1e70f6fb Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Tue, 4 Jan 2022 19:29:36 +0000 Subject: [PATCH 02/17] Auto-update README --- README.md | 3 +-- README_fr.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eefb74f..1b31821 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,7 @@ Open source constituent relationship management (CRM) for non-profits, NGOs and ## Disclaimers / important information -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * LDAP module can be installed +* LDAP module can be installed ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 9584481..669711d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,8 +24,7 @@ Gestion des relations avec les constituants (GRC/CRM) pour les organisations à ## Avertissements / informations importantes -* Toute limitation connue, contrainte ou élément qui ne fonctionne pas, comme (mais sans s'y limiter) : - * Le module d'authentification LDAP peut être installé +* Le module d'authentification LDAP peut être installé ## Documentations et ressources From 4c57deec393d259d03f47e518410426b6cffb03c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 4 Jan 2022 23:50:16 +0100 Subject: [PATCH 03/17] Upgrade to 5.44.0 --- README.md | 2 +- README_fr.md | 2 +- conf/civicrm-drupal.src | 4 ++-- conf/civicrm-l10n.src | 4 ++-- manifest.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index eefb74f..42b1c30 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Open source constituent relationship management (CRM) for non-profits, NGOs and advocacy organizations. -**Shipped version:** 5.38.0.7.0~ynh1 +**Shipped version:** 5.44.0.7.0~ynh1 **Demo:** https://civicrm.org/demo diff --git a/README_fr.md b/README_fr.md index 9584481..e5815fa 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Gestion des relations avec les constituants (GRC/CRM) pour les organisations à but non lucratif, les ONG et les organisations de défense des droits. -**Version incluse :** 5.38.0.7.0~ynh1 +**Version incluse :** 5.44.0.7.0~ynh1 **Démo :** https://civicrm.org/demo diff --git a/conf/civicrm-drupal.src b/conf/civicrm-drupal.src index ff551d1..3a21475 100644 --- a/conf/civicrm-drupal.src +++ b/conf/civicrm-drupal.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.38.0/civicrm-5.38.0-drupal.tar.gz -SOURCE_SUM=991e31f1b6cbabaf8747b0d9b2c7859485fefc72bf4dfe21c8468fb32b5896a5 +SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.44.0/civicrm-5.44.0-drupal.tar.gz +SOURCE_SUM=133428fad1b2ea32553c795adb55ae65d9f8df3a1d4f78dbc64d4addc5db6fd4 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/civicrm-l10n.src b/conf/civicrm-l10n.src index ff551d1..f283fcb 100644 --- a/conf/civicrm-l10n.src +++ b/conf/civicrm-l10n.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.38.0/civicrm-5.38.0-drupal.tar.gz -SOURCE_SUM=991e31f1b6cbabaf8747b0d9b2c7859485fefc72bf4dfe21c8468fb32b5896a5 +SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.44.0/civicrm-5.44.0-l10n.tar.gz +SOURCE_SUM=c996ab7e347996ea519f20cc74c94ace9aeb04f1ab738df55721ae6f16b2e495 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 85940be..31cf976 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "CRM for non-profits, NGOs and advocacy organizations", "fr": "CRM pour organisations à but non lucratif et ONG" }, - "version": "5.38.0.7.0~ynh1", + "version": "5.44.0.7.0~ynh1", "url": "https://civicrm.org", "upstream": { "license": "AGPL-3.0-or-later", From de59ef7c17c680343516cb8d84c18afa371fe514 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 5 Jan 2022 01:05:48 +0100 Subject: [PATCH 04/17] Implement mysql hook --- conf/mysql_hook_regen_conf | 31 +++++++++++++++++++++++++++++++ scripts/backup | 2 ++ scripts/install | 5 ++--- scripts/remove | 4 ++++ scripts/restore | 3 +++ scripts/upgrade | 5 ++--- 6 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 conf/mysql_hook_regen_conf diff --git a/conf/mysql_hook_regen_conf b/conf/mysql_hook_regen_conf new file mode 100644 index 0000000..271f9fb --- /dev/null +++ b/conf/mysql_hook_regen_conf @@ -0,0 +1,31 @@ +#!/bin/bash + +source /usr/share/yunohost/helpers + +force=${2:-0} # 0/1 --force argument +dryrun=${3:-0} # 0/1 --dry-run argument +pending_conf=$4 # Path of the pending conf file + + +do_pre_regen() { + ynh_replace_string --match_string="thread_stack = 128K" --replace_string="thread_stack = 192K" --target_file="${pending_conf}/../mysql/etc/mysql/my.cnf" +} + +do_post_regen() { + regen_conf_files=$1 +} + +case "$1" in + pre) + do_pre_regen + ;; + post) + do_post_regen + ;; + *) + echo "Hook called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0 \ No newline at end of file diff --git a/scripts/backup b/scripts/backup index 89da2d0..7002dcc 100644 --- a/scripts/backup +++ b/scripts/backup @@ -63,6 +63,8 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/cron.d/$app" +ynh_backup --src_path="/usr/share/yunohost/hooks/conf_regen/34-mysql_$app" + #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index 1358eb3..17d4a0c 100644 --- a/scripts/install +++ b/scripts/install @@ -120,9 +120,8 @@ ynh_add_fpm_config --usage=low --footprint=low #================================================= ynh_script_progression --message="Upgrading thread_stack..." -ynh_replace_string --match_string="thread_stack = 128K" --replace_string="thread_stack = 192K" --target_file="/etc/mysql/my.cnf" - -ynh_systemd_action --service_name=mysql --action="restart" +cp -R ../conf/mysql_hook_regen_conf /usr/share/yunohost/hooks/conf_regen/34-mysql_$app +yunohost tools regen-conf mysql --force #================================================= # CREATE DRUSH ALIAS diff --git a/scripts/remove b/scripts/remove index 5fba8f1..b860279 100644 --- a/scripts/remove +++ b/scripts/remove @@ -73,6 +73,10 @@ ynh_script_progression --message="Removing various files..." # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" +# Remove MySQL Hook +ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/34-mysql_$app" +yunohost tools regen-conf mysql --force + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 40f3f7a..54a8dca 100644 --- a/scripts/restore +++ b/scripts/restore @@ -102,6 +102,9 @@ ynh_script_progression --message="Restoring various files..." ynh_restore_file --origin_path="/etc/cron.d/$app" +ynh_restore_file --origin_path="/usr/share/yunohost/hooks/conf_regen/34-mysql_$app" +yunohost tools regen-conf mysql --force + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 51bb121..53beac6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -114,9 +114,8 @@ ynh_add_fpm_config --usage=low --footprint=low #================================================= ynh_script_progression --message="Upgrading thread_stack..." -ynh_replace_string --match_string="thread_stack = 128K" --replace_string="thread_stack = 192K" --target_file="/etc/mysql/my.cnf" - -ynh_systemd_action --service_name=mysql --action="restart" +cp -R ../conf/mysql_hook_regen_conf /usr/share/yunohost/hooks/conf_regen/34-mysql_$app +yunohost tools regen-conf mysql --force #================================================= # SETUP THE CRON FILE From 34972001a68bd83d010a65b067d920ab3a7c905b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 5 Jan 2022 02:05:31 +0100 Subject: [PATCH 05/17] Update nginx.conf --- conf/nginx.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/nginx.conf b/conf/nginx.conf index 442848d..780ae07 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -3,7 +3,9 @@ location __PATH__/ { # Path to source alias __FINALPATH__/__NAME__/ ; + index index.php; + if (!-e $request_filename) { rewrite ^__PATH__/(.+)$ __PATH__/index.php?q=$1 last; From 844abb886a77cc150904983ca22f2d1177f10910 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 6 Jan 2022 21:56:16 +0100 Subject: [PATCH 06/17] Fix hook --- conf/mysql_hook_regen_conf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/conf/mysql_hook_regen_conf b/conf/mysql_hook_regen_conf index 271f9fb..f5757b1 100644 --- a/conf/mysql_hook_regen_conf +++ b/conf/mysql_hook_regen_conf @@ -1,14 +1,12 @@ #!/bin/bash -source /usr/share/yunohost/helpers - force=${2:-0} # 0/1 --force argument dryrun=${3:-0} # 0/1 --dry-run argument pending_conf=$4 # Path of the pending conf file do_pre_regen() { - ynh_replace_string --match_string="thread_stack = 128K" --replace_string="thread_stack = 192K" --target_file="${pending_conf}/../mysql/etc/mysql/my.cnf" + sed --in-place "s@thread_stack = 128K@thread_stack = 192K@g" "${pending_conf}/../mysql/etc/mysql/my.cnf" } do_post_regen() { From 9aae8b8b9193f11a9564fae1ccfc5bc7a072f33b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Fri, 7 Jan 2022 19:49:04 +0100 Subject: [PATCH 07/17] n DISCLAIMER.md: 'Any known limitations [...] --- doc/DISCLAIMER.md | 3 +-- doc/DISCLAIMER_fr.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/DISCLAIMER.md b/doc/DISCLAIMER.md index 576ef0a..23eca0e 100644 --- a/doc/DISCLAIMER.md +++ b/doc/DISCLAIMER.md @@ -1,2 +1 @@ -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * LDAP module can be installed +* LDAP module can be installed diff --git a/doc/DISCLAIMER_fr.md b/doc/DISCLAIMER_fr.md index 7a8ff5f..091edf3 100644 --- a/doc/DISCLAIMER_fr.md +++ b/doc/DISCLAIMER_fr.md @@ -1,2 +1 @@ -* Toute limitation connue, contrainte ou élément qui ne fonctionne pas, comme (mais sans s'y limiter) : - * Le module d'authentification LDAP peut être installé +* Le module d'authentification LDAP peut être installé From ac2765a37e211c0ccf1072ec3eb6f199e5af8a40 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 7 Jan 2022 18:49:09 +0000 Subject: [PATCH 08/17] Auto-update README --- README.md | 3 +-- README_fr.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eefb74f..1b31821 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,7 @@ Open source constituent relationship management (CRM) for non-profits, NGOs and ## Disclaimers / important information -* Any known limitations, constrains or stuff not working, such as (but not limited to): - * LDAP module can be installed +* LDAP module can be installed ## Documentation and resources diff --git a/README_fr.md b/README_fr.md index 9584481..669711d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -24,8 +24,7 @@ Gestion des relations avec les constituants (GRC/CRM) pour les organisations à ## Avertissements / informations importantes -* Toute limitation connue, contrainte ou élément qui ne fonctionne pas, comme (mais sans s'y limiter) : - * Le module d'authentification LDAP peut être installé +* Le module d'authentification LDAP peut être installé ## Documentations et ressources From b2b3fe4b884e4323b689d5b0125a44f8411e7d66 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 10 Jan 2022 19:50:17 +0100 Subject: [PATCH 09/17] Update conf/mysql_hook_regen_conf Co-authored-by: Alexandre Aubin --- conf/mysql_hook_regen_conf | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/conf/mysql_hook_regen_conf b/conf/mysql_hook_regen_conf index f5757b1..da33537 100644 --- a/conf/mysql_hook_regen_conf +++ b/conf/mysql_hook_regen_conf @@ -1,29 +1,10 @@ #!/bin/bash -force=${2:-0} # 0/1 --force argument -dryrun=${3:-0} # 0/1 --dry-run argument -pending_conf=$4 # Path of the pending conf file +action=$1 +pending_dir=$4 +mysqlconf="${pending_dir}/../mysql/etc/mysql/my.cnf" +[[ "$action" == "pre" ]] || exit 0 +[[ -e "$mysqlconf" ]] || exit 0 -do_pre_regen() { - sed --in-place "s@thread_stack = 128K@thread_stack = 192K@g" "${pending_conf}/../mysql/etc/mysql/my.cnf" -} - -do_post_regen() { - regen_conf_files=$1 -} - -case "$1" in - pre) - do_pre_regen - ;; - post) - do_post_regen - ;; - *) - echo "Hook called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -exit 0 \ No newline at end of file +sed --in-place "s@thread_stack = 128K@thread_stack = 192K@g" "${mysqlconf}" \ No newline at end of file From c88271b31db4a96919c91e5625a8b9dc5fb494e2 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 13 Jan 2022 20:51:10 +0100 Subject: [PATCH 10/17] ynh_exec_as --- scripts/install | 30 +++++++++++++++--------------- scripts/upgrade | 16 ++++++++-------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/scripts/install b/scripts/install index 17d4a0c..d0b5e33 100644 --- a/scripts/install +++ b/scripts/install @@ -157,21 +157,21 @@ chown -R $app:www-data "$final_path" update-alternatives --set php /usr/bin/php$phpversion pushd "$final_path" - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush pm-download -y drupal-7 --drupal-project-rename=$app + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush pm-download -y drupal-7 --drupal-project-rename=$app - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app site-install $install_profil --account-name=$admin --account-pass=$password --account-mail=$admin_mail --db-url=mysql://$db_user:$db_pwd@localhost/$db_name --site-name="$app" --locale=$language --yes - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-download drush_language - #ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-download ldap - #ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-enable -y ldap_servers ldap_user ldap_authentication ldap_authorization ldap_authorization_drupal_role - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-download l10n_update - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-enable -y l10n_update - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app language-add $language - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app language-default $language - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app cache-clear drush - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update-refresh - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-update - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app core-cron + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app site-install $install_profil --account-name=$admin --account-pass=$password --account-mail=$admin_mail --db-url=mysql://$db_user:$db_pwd@localhost/$db_name --site-name="$app" --locale=$language --yes + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app pm-download drush_language + #ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app pm-download ldap + #ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app pm-enable -y ldap_servers ldap_user ldap_authentication ldap_authorization ldap_authorization_drupal_role + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app pm-download l10n_update + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app pm-enable -y l10n_update + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app language-add $language + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app language-default $language + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app cache-clear drush + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app l10n-update-refresh + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app l10n-update + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app pm-update + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app core-cron ynh_setup_source --dest_dir="$final_path/$app/sites/all/modules/civicrm" --source_id="civicrm-drupal" ynh_setup_source --dest_dir="$final_path/$app/sites/all/modules/civicrm" --source_id="civicrm-l10n" @@ -182,7 +182,7 @@ pushd "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush --include="$final_path/$app/sites/all/modules/civicrm/drupal/drush" @$app civicrm-install --dbhost="localhost" --dbname="$db_name" --dbpass="$db_pwd" --dbuser="$db_user" --destination="sites/all/modules" --site_url="$domain$path_url" --ssl=on + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush --include="$final_path/$app/sites/all/modules/civicrm/drupal/drush" @$app civicrm-install --dbhost="localhost" --dbname="$db_name" --dbpass="$db_pwd" --dbuser="$db_user" --destination="sites/all/modules" --site_url="$domain$path_url" --ssl=on popd update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION} diff --git a/scripts/upgrade b/scripts/upgrade index 17ac0be..563b2ee 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -149,16 +149,16 @@ chown -R $app:www-data "$final_path" update-alternatives --set php /usr/bin/php$phpversion pushd "$final_path" - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 1 - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app cache-clear all - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-update -y drupal - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app cache-clear all - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update-refresh - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app l10n-update + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 1 + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app cache-clear all + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app pm-update -y drupal + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app cache-clear all + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app l10n-update-refresh + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app l10n-update - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush --include="$final_path/$app/sites/all/modules/civicrm/drupal/drush" @$app -y civicrm-upgrade-db + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush --include="$final_path/$app/sites/all/modules/civicrm/drupal/drush" @$app -y civicrm-upgrade-db - ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 0 + ynh_exec_warn_less ynh_exec_as $app env PATH=$PATH drush @$app variable-set --exact maintenance_mode 0 chmod 750 "$final_path" chmod -R o-rwx "$final_path" From ba3004f28e5f306f00c12f55615bc04080086c51 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 14 Aug 2022 23:18:12 +0200 Subject: [PATCH 11/17] Removing hook --- conf/mysql_hook_regen_conf | 10 ---------- scripts/install | 8 -------- scripts/upgrade | 11 +++-------- 3 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 conf/mysql_hook_regen_conf diff --git a/conf/mysql_hook_regen_conf b/conf/mysql_hook_regen_conf deleted file mode 100644 index da33537..0000000 --- a/conf/mysql_hook_regen_conf +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -action=$1 -pending_dir=$4 -mysqlconf="${pending_dir}/../mysql/etc/mysql/my.cnf" - -[[ "$action" == "pre" ]] || exit 0 -[[ -e "$mysqlconf" ]] || exit 0 - -sed --in-place "s@thread_stack = 128K@thread_stack = 192K@g" "${mysqlconf}" \ No newline at end of file diff --git a/scripts/install b/scripts/install index d0b5e33..f5e663a 100644 --- a/scripts/install +++ b/scripts/install @@ -115,14 +115,6 @@ ynh_add_fpm_config --usage=low --footprint=low #================================================= # SPECIFIC SETUP -#================================================= -# UPGRADE THREAD_STACK -#================================================= -ynh_script_progression --message="Upgrading thread_stack..." - -cp -R ../conf/mysql_hook_regen_conf /usr/share/yunohost/hooks/conf_regen/34-mysql_$app -yunohost tools regen-conf mysql --force - #================================================= # CREATE DRUSH ALIAS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 563b2ee..96b7310 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -59,6 +59,9 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/34-mysql_$app" +yunohost tools regen-conf mysql --force + #================================================= # CREATE DEDICATED USER #================================================= @@ -110,14 +113,6 @@ ynh_add_fpm_config --usage=low --footprint=low #================================================= # SPECIFIC UPGRADE -#================================================= -# UPGRADE THREAD_STACK -#================================================= -ynh_script_progression --message="Upgrading thread_stack..." - -cp -R ../conf/mysql_hook_regen_conf /usr/share/yunohost/hooks/conf_regen/34-mysql_$app -yunohost tools regen-conf mysql --force - #================================================= # SETUP THE CRON FILE #================================================= From aae220a0837fd4fa864f1bc60df43f513c3e2542 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 14 Aug 2022 23:21:21 +0200 Subject: [PATCH 12/17] Upgrade to 5.52.2 --- README.md | 2 +- README_fr.md | 2 +- conf/civicrm-drupal.src | 4 ++-- conf/civicrm-l10n.src | 4 ++-- manifest.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c6f0905..1f015f0 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in Open source constituent relationship management (CRM) for non-profits, NGOs and advocacy organizations. -**Shipped version:** 5.44.0.7.0~ynh1 +**Shipped version:** 5.52.2~ynh1 **Demo:** https://civicrm.org/demo diff --git a/README_fr.md b/README_fr.md index d956178..6631f8e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -14,7 +14,7 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Gestion des relations avec les constituants (GRC/CRM) pour les organisations à but non lucratif, les ONG et les organisations de défense des droits. -**Version incluse :** 5.44.0.7.0~ynh1 +**Version incluse :** 5.52.2~ynh1 **Démo :** https://civicrm.org/demo diff --git a/conf/civicrm-drupal.src b/conf/civicrm-drupal.src index 3a21475..d278e39 100644 --- a/conf/civicrm-drupal.src +++ b/conf/civicrm-drupal.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.44.0/civicrm-5.44.0-drupal.tar.gz -SOURCE_SUM=133428fad1b2ea32553c795adb55ae65d9f8df3a1d4f78dbc64d4addc5db6fd4 +SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.52.2/civicrm-5.52.2-drupal.tar.gz +SOURCE_SUM=39be21dcbde98b51a05b04c753477f9ea74eb30e3c45f73a00f5e6b3988ab1b8 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/civicrm-l10n.src b/conf/civicrm-l10n.src index f283fcb..a55e5ed 100644 --- a/conf/civicrm-l10n.src +++ b/conf/civicrm-l10n.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.44.0/civicrm-5.44.0-l10n.tar.gz -SOURCE_SUM=c996ab7e347996ea519f20cc74c94ace9aeb04f1ab738df55721ae6f16b2e495 +SOURCE_URL=https://storage.googleapis.com/civicrm/civicrm-stable/5.52.2/civicrm-5.52.2-l10n.tar.gz +SOURCE_SUM=b857dfd08e30153a8485cefd3650e3c72769de093d0f691bb873007cf65bd1ec SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 31cf976..f8c4364 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "CRM for non-profits, NGOs and advocacy organizations", "fr": "CRM pour organisations à but non lucratif et ONG" }, - "version": "5.44.0.7.0~ynh1", + "version": "5.52.2~ynh1", "url": "https://civicrm.org", "upstream": { "license": "AGPL-3.0-or-later", From f14b77ea56d5ef8f434eb33e96ec4f6751badedc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 14 Aug 2022 23:22:01 +0200 Subject: [PATCH 13/17] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index f8c4364..bb40fbe 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "name": "yalh76" }, "requirements": { - "yunohost": ">= 4.2.0" + "yunohost": ">= 11.0" }, "multi_instance": true, "services": [ From 56af6c2d24e556b0b6e6ba723ee37b819a953a17 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 14 Aug 2022 21:22:06 +0000 Subject: [PATCH 14/17] Auto-update README --- README.md | 20 +++++++++++--------- README_fr.md | 28 +++++++++++++++++----------- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 1f015f0..0da233f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # CiviCRM on Drupal 7 for YunoHost -[![Integration level](https://dash.yunohost.org/integration/civicrm_drupal7.svg)](https://dash.yunohost.org/appci/app/civicrm_drupal7) ![](https://ci-apps.yunohost.org/ci/badges/civicrm_drupal7.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/civicrm_drupal7.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/civicrm_drupal7.svg)](https://dash.yunohost.org/appci/app/civicrm_drupal7) ![Working status](https://ci-apps.yunohost.org/ci/badges/civicrm_drupal7.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/civicrm_drupal7.maintain.svg) [![Install CiviCRM on Drupal 7 with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=civicrm_drupal7) *[Lire ce readme en français.](./README_fr.md)* @@ -20,11 +20,12 @@ Open source constituent relationship management (CRM) for non-profits, NGOs and **Shipped version:** 5.52.2~ynh1 + **Demo:** https://civicrm.org/demo ## Screenshots -![](./doc/screenshots/screenshot.png) +![Screenshot of CiviCRM on Drupal 7](./doc/screenshots/screenshot.png) ## Disclaimers / important information @@ -32,21 +33,22 @@ Open source constituent relationship management (CRM) for non-profits, NGOs and ## Documentation and resources -* Official app website: https://civicrm.org/ -* Official admin documentation: https://docs.civicrm.org/ -* Upstream app code repository: https://github.com/civicrm/civicrm-drupal -* YunoHost documentation for this app: https://yunohost.org/app_civicrm_drupal7 -* Report a bug: https://github.com/YunoHost-Apps/civicrm_drupal7_ynh/issues +* Official app website: +* Official admin documentation: +* Upstream app code repository: +* YunoHost documentation for this app: +* Report a bug: ## Developer info Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/civicrm_drupal7_ynh/tree/testing). To try the testing branch, please proceed like that. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/civicrm_drupal7_ynh/tree/testing --debug or sudo yunohost app upgrade civicrm_drupal7 -u https://github.com/YunoHost-Apps/civicrm_drupal7_ynh/tree/testing --debug ``` -**More info regarding app packaging:** https://yunohost.org/packaging_apps \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_fr.md b/README_fr.md index 6631f8e..51e9a22 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,10 +1,14 @@ + + # CiviCRM on Drupal 7 pour YunoHost -[![Niveau d'intégration](https://dash.yunohost.org/integration/civicrm_drupal7.svg)](https://dash.yunohost.org/appci/app/civicrm_drupal7) ![](https://ci-apps.yunohost.org/ci/badges/civicrm_drupal7.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/civicrm_drupal7.maintain.svg) +[![Niveau d'intégration](https://dash.yunohost.org/integration/civicrm_drupal7.svg)](https://dash.yunohost.org/appci/app/civicrm_drupal7) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/civicrm_drupal7.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/civicrm_drupal7.maintain.svg) [![Installer CiviCRM on Drupal 7 avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=civicrm_drupal7) *[Read this readme in english.](./README.md)* -*[Lire ce readme en français.](./README_fr.md)* > *Ce package vous permet d'installer CiviCRM on Drupal 7 rapidement et simplement sur un serveur YunoHost. Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.* @@ -14,13 +18,14 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour Gestion des relations avec les constituants (GRC/CRM) pour les organisations à but non lucratif, les ONG et les organisations de défense des droits. -**Version incluse :** 5.52.2~ynh1 +**Version incluse :** 5.52.2~ynh1 + **Démo :** https://civicrm.org/demo ## Captures d'écran -![](./doc/screenshots/screenshot.png) +![Capture d'écran de CiviCRM on Drupal 7](./doc/screenshots/screenshot.png) ## Avertissements / informations importantes @@ -28,21 +33,22 @@ Gestion des relations avec les constituants (GRC/CRM) pour les organisations à ## Documentations et ressources -* Site officiel de l'app : https://civicrm.org/ -* Documentation officielle de l'admin : https://docs.civicrm.org/ -* Dépôt de code officiel de l'app : https://github.com/civicrm/civicrm-drupal -* Documentation YunoHost pour cette app : https://yunohost.org/app_civicrm_drupal7 -* Signaler un bug : https://github.com/YunoHost-Apps/civicrm_drupal7_ynh/issues +* Site officiel de l'app : +* Documentation officielle de l'admin : +* Dépôt de code officiel de l'app : +* Documentation YunoHost pour cette app : +* Signaler un bug : ## Informations pour les développeurs Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/civicrm_drupal7_ynh/tree/testing). Pour essayer la branche testing, procédez comme suit. -``` + +``` bash sudo yunohost app install https://github.com/YunoHost-Apps/civicrm_drupal7_ynh/tree/testing --debug ou sudo yunohost app upgrade civicrm_drupal7 -u https://github.com/YunoHost-Apps/civicrm_drupal7_ynh/tree/testing --debug ``` -**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps \ No newline at end of file +**Plus d'infos sur le packaging d'applications :** From 8509a94e2e5519d3d11d92b97fc03efcfd5885e7 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 14 Aug 2022 23:50:32 +0200 Subject: [PATCH 15/17] Apply example_ynh --- check_process | 6 +++--- manifest.json | 10 +++++----- scripts/_common.sh | 8 +++++--- scripts/backup | 2 -- scripts/install | 27 +++++++++++++-------------- scripts/remove | 4 ---- scripts/restore | 33 +++++++++++++++------------------ scripts/upgrade | 22 +++++++++++----------- 8 files changed, 52 insertions(+), 60 deletions(-) diff --git a/check_process b/check_process index 23f5720..02484f9 100644 --- a/check_process +++ b/check_process @@ -2,10 +2,10 @@ ; Manifest domain="domain.tld" path="/path" - admin="john" - language="fr" is_public=1 - password="pass" + language="fr" + admin="john" + password="1Strong-Password" install_profil="minimal" ; Checks pkg_linter=1 diff --git a/manifest.json b/manifest.json index bb40fbe..4358471 100644 --- a/manifest.json +++ b/manifest.json @@ -29,7 +29,7 @@ "mysql" ], "arguments": { - "install" : [ + "install": [ { "name": "domain", "type": "domain" @@ -40,10 +40,6 @@ "example": "/drupal7", "default": "/drupal7" }, - { - "name": "admin", - "type": "user" - }, { "name": "is_public", "type": "boolean", @@ -59,6 +55,10 @@ "choices": ["fr", "en"], "default": "en" }, + { + "name": "admin", + "type": "user" + }, { "name": "password", "type": "password" diff --git a/scripts/_common.sh b/scripts/_common.sh index 88b3046..5deec2d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,11 +3,13 @@ #================================================= # COMMON VARIABLES #================================================= +# PHP APP SPECIFIC +#================================================= -YNH_PHP_VERSION="7.3" +php_dependencies="php$YNH_DEFAULT_PHP_VERSION-fpm php$YNH_DEFAULT_PHP_VERSION-cli php$YNH_DEFAULT_PHP_VERSION-gd php$YNH_DEFAULT_PHP_VERSION-mysql php$YNH_DEFAULT_PHP_VERSION-xml php$YNH_DEFAULT_PHP_VERSION-ldap php$YNH_DEFAULT_PHP_VERSION-mbstring php$YNH_DEFAULT_PHP_VERSION-curl php$YNH_DEFAULT_PHP_VERSION-soap" -# dependencies used by the app -pkg_dependencies="curl libzip-dev php${YNH_PHP_VERSION}-fpm php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-soap" +# dependencies used by the app (must be on a single line) +pkg_dependencies="curl libzip-dev $php_dependencies" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index 7002dcc..89da2d0 100644 --- a/scripts/backup +++ b/scripts/backup @@ -63,8 +63,6 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_backup --src_path="/etc/cron.d/$app" -ynh_backup --src_path="/usr/share/yunohost/hooks/conf_regen/34-mysql_$app" - #================================================= # BACKUP THE MYSQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index f5e663a..f582122 100644 --- a/scripts/install +++ b/scripts/install @@ -25,16 +25,16 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH -admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC language=$YNH_APP_ARG_LANGUAGE +admin=$YNH_APP_ARG_ADMIN password=$YNH_APP_ARG_PASSWORD install_profil=$YNH_APP_ARG_INSTALL_PROFIL -admin_mail=$(ynh_user_get_info --username=$admin --key=mail) -phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME +admin_mail=$(ynh_user_get_info --username=$admin --key=mail) + #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= @@ -53,10 +53,9 @@ ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=language --value=$language +ynh_app_setting_set --app=$app --key=admin --value=$admin ynh_app_setting_set --app=$app --key=install_profil --value=$install_profil -ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion #================================================= # STANDARD MODIFICATIONS @@ -73,7 +72,7 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Configuring system user..." # Create a system user -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # CREATE A MYSQL DATABASE @@ -97,6 +96,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring PHP-FPM..." + +# Create a dedicated PHP-FPM config +ynh_add_fpm_config + #================================================= # NGINX CONFIGURATION #================================================= @@ -105,14 +112,6 @@ ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring PHP-FPM..." - -# Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low - #================================================= # SPECIFIC SETUP #================================================= diff --git a/scripts/remove b/scripts/remove index cdb4611..f0c04b5 100644 --- a/scripts/remove +++ b/scripts/remove @@ -73,10 +73,6 @@ ynh_script_progression --message="Removing various files..." # Remove a cron file ynh_secure_remove --file="/etc/cron.d/$app" -# Remove MySQL Hook -ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/34-mysql_$app" -yunohost tools regen-conf mysql --force - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 938f8f6..df10b1c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -44,20 +44,13 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= ynh_script_progression --message="Recreating the dedicated system user..." # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # RESTORE THE APP MAIN DIR @@ -70,13 +63,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." - -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - #================================================= # SPECIFIC RESTORATION #================================================= @@ -87,6 +73,20 @@ ynh_script_progression --message="Reinstalling dependencies..." # Define and install dependencies ynh_install_app_dependencies $pkg_dependencies +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." + +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" + +#================================================= +# RESTORE THE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the NGINX web server configuration..." + +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + #================================================= # RESTORE THE MYSQL DATABASE #================================================= @@ -103,9 +103,6 @@ ynh_script_progression --message="Restoring various files..." ynh_restore_file --origin_path="/etc/cron.d/$app" -ynh_restore_file --origin_path="/usr/share/yunohost/hooks/conf_regen/34-mysql_$app" -yunohost tools regen-conf mysql --force - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 96b7310..40f44d6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,9 +18,9 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) +language=$(ynh_app_setting_get --app=$app --key=language) admin=$(ynh_app_setting_get --app=$app --key=admin) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) @@ -68,7 +68,7 @@ yunohost tools regen-conf mysql --force ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app --home_dir=$final_path +ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -88,14 +88,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # UPGRADE DEPENDENCIES #================================================= @@ -109,7 +101,15 @@ ynh_install_app_dependencies $pkg_dependencies ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low +ynh_add_fpm_config + +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." + +# Create a dedicated NGINX config +ynh_add_nginx_config #================================================= # SPECIFIC UPGRADE From a3c9bd3f2364b098f28143e56806c7d672521cd0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 15 Aug 2022 00:09:33 +0200 Subject: [PATCH 16/17] fix missing phpversion --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index f582122..c345e93 100644 --- a/scripts/install +++ b/scripts/install @@ -132,7 +132,7 @@ mkdir -p "$final_path/.composer" ynh_add_config --template="../conf/composer.json" --destination="$final_path/.composer/composer.json" -ynh_install_composer --phpversion="$phpversion" --workdir="$final_path/.composer" +ynh_install_composer --workdir="$final_path/.composer" export PATH="$final_path/.composer/vendor/bin:$PATH" diff --git a/scripts/upgrade b/scripts/upgrade index 40f44d6..48d6dbd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -125,7 +125,7 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" #================================================= ynh_script_progression --message="Upgrading Composer..." -ynh_install_composer --phpversion="$phpversion" --workdir="$final_path/.composer" +ynh_install_composer --workdir="$final_path/.composer" export PATH="$final_path/.composer/vendor/bin:$PATH" From 50f8d972df082e4177598ce5f5c40fa8d776b24f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 15 Aug 2022 03:01:29 +0200 Subject: [PATCH 17/17] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index c345e93..06cfbe8 100644 --- a/scripts/install +++ b/scripts/install @@ -103,6 +103,7 @@ ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config ynh_add_fpm_config +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # NGINX CONFIGURATION