mirror of
https://github.com/YunoHost-Apps/civicrm_drupal7_ynh.git
synced 2024-09-03 18:16:19 +02:00
commit
e5263194b6
14 changed files with 133 additions and 137 deletions
25
README.md
25
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: <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>
|
||||
|
||||
## 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
|
||||
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
||||
|
|
31
README_fr.md
31
README_fr.md
|
@ -1,10 +1,14 @@
|
|||
<!--
|
||||
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
|
||||
It shall NOT be edited by hand.
|
||||
-->
|
||||
|
||||
# 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 : <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>
|
||||
|
||||
## 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
|
||||
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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é
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue