diff --git a/README.md b/README.md index eefb74f..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)* @@ -18,36 +18,37 @@ 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.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 -* 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 -* 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 9584481..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,36 +18,37 @@ 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.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 -* 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 -* 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 :** 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/conf/civicrm-drupal.src b/conf/civicrm-drupal.src index ff551d1..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.38.0/civicrm-5.38.0-drupal.tar.gz -SOURCE_SUM=991e31f1b6cbabaf8747b0d9b2c7859485fefc72bf4dfe21c8468fb32b5896a5 +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 ff551d1..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.38.0/civicrm-5.38.0-drupal.tar.gz -SOURCE_SUM=991e31f1b6cbabaf8747b0d9b2c7859485fefc72bf4dfe21c8468fb32b5896a5 +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/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; 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/manifest.json b/manifest.json index 85940be..4358471 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.52.2~ynh1", "url": "https://civicrm.org", "upstream": { "license": "AGPL-3.0-or-later", @@ -20,7 +20,7 @@ "name": "yalh76" }, "requirements": { - "yunohost": ">= 4.2.0" + "yunohost": ">= 11.0" }, "multi_instance": true, "services": [ @@ -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 e5daee9..5deec2d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -3,10 +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" -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/install b/scripts/install index 1358eb3..06cfbe8 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,15 @@ 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 +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) + #================================================= # NGINX CONFIGURATION #================================================= @@ -105,25 +113,8 @@ 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 -#================================================= -# UPGRADE THREAD_STACK -#================================================= -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" - #================================================= # CREATE DRUSH ALIAS #================================================= @@ -142,7 +133,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" @@ -158,21 +149,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" @@ -183,7 +174,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/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..df10b1c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -39,24 +39,18 @@ 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 -#================================================= -# 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 @@ -69,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 #================================================= @@ -86,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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 51bb121..48d6dbd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,15 +18,16 @@ 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) #================================================= # CHECK VERSION #================================================= +ynh_script_progression --message="Checking version..." upgrade_type=$(ynh_check_app_version_changed) @@ -58,13 +59,16 @@ 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 #================================================= 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 @@ -84,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 #================================================= @@ -105,19 +101,18 @@ 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 -#================================================= -# UPGRADE THREAD_STACK -#================================================= -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" - #================================================= # SETUP THE CRON FILE #================================================= @@ -130,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" @@ -149,16 +144,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"