mirror of
https://github.com/YunoHost-Apps/drupal7_ynh.git
synced 2024-09-03 18:26:19 +02:00
Merge pull request #40 from YunoHost-Apps/example
Apply last example_ynh
This commit is contained in:
commit
b45e894c4b
17 changed files with 73 additions and 72 deletions
|
@ -11,7 +11,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
|
||||||
## Overview
|
## Overview
|
||||||
Free and open-source content management framework.
|
Free and open-source content management framework.
|
||||||
|
|
||||||
**Shipped version:** 7.80
|
**Shipped version:** 7.84
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install
|
||||||
## Vue d'ensemble
|
## Vue d'ensemble
|
||||||
Framework de gestion de contenu libre et open-source.
|
Framework de gestion de contenu libre et open-source.
|
||||||
|
|
||||||
**Version incluse:** 7.80
|
**Version incluse:** 7.84
|
||||||
|
|
||||||
## Captures d'écran
|
## Captures d'écran
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
;; Test complet
|
;; Test complet
|
||||||
; Manifest
|
; Manifest
|
||||||
domain="domain.tld" (DOMAIN)
|
domain="domain.tld"
|
||||||
path="/path" (PATH)
|
path="/path"
|
||||||
admin="john" (USER)
|
admin="john"
|
||||||
language="en"
|
language="en"
|
||||||
is_public=1 (PUBLIC|public=1|private=0)
|
is_public=1
|
||||||
password="pass"
|
password="pass"
|
||||||
install_profil="minimal"
|
install_profil="minimal"
|
||||||
; Checks
|
; Checks
|
||||||
|
|
|
@ -9,11 +9,6 @@ location __PATH__/ {
|
||||||
rewrite ^__PATH__/(.+)$ __PATH__/index.php?q=$1 last;
|
rewrite ^__PATH__/(.+)$ __PATH__/index.php?q=$1 last;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Force usage of https
|
|
||||||
if ($scheme = http) {
|
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
|
||||||
}
|
|
||||||
|
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
|
||||||
|
|
0
doc/.gitkeep
Normal file
0
doc/.gitkeep
Normal file
1
doc/DESCRIPTION.md
Normal file
1
doc/DESCRIPTION.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Free and open-source content management framework.
|
1
doc/DESCRIPTION_fr.md
Normal file
1
doc/DESCRIPTION_fr.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Framework de gestion de contenu libre et open-source.
|
1
doc/DISCLAIMER.md
Normal file
1
doc/DISCLAIMER.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* LDAP module can be installed
|
1
doc/DISCLAIMER_fr.md
Normal file
1
doc/DISCLAIMER_fr.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Le module d'authentification LDAP peut être installé
|
0
doc/screenshots/.gitkeep
Normal file
0
doc/screenshots/.gitkeep
Normal file
BIN
doc/screenshots/screenshot.png
Normal file
BIN
doc/screenshots/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 247 KiB |
|
@ -6,14 +6,19 @@
|
||||||
"en": "Old version of a content management framework written in PHP",
|
"en": "Old version of a content management framework written in PHP",
|
||||||
"fr": "Ancienne version d'un système de gestion de contenu écrit en PHP"
|
"fr": "Ancienne version d'un système de gestion de contenu écrit en PHP"
|
||||||
},
|
},
|
||||||
"version": "7.80~ynh2",
|
"version": "7.84~ynh1",
|
||||||
"url": "https://www.drupal.org",
|
"url": "https://www.drupal.org",
|
||||||
|
"upstream": {
|
||||||
|
"license": "GPL-2.0-or-later",
|
||||||
|
"website": "https://www.drupal.org",
|
||||||
|
"userdoc": "https://www.drupal.org/docs/7"
|
||||||
|
},
|
||||||
"license": "GPL-2.0-or-later",
|
"license": "GPL-2.0-or-later",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "yalh76"
|
"name": "yalh76"
|
||||||
},
|
},
|
||||||
"requirements": {
|
"requirements": {
|
||||||
"yunohost": ">= 4.2.0"
|
"yunohost": ">= 4.3.0"
|
||||||
},
|
},
|
||||||
"multi_instance": true,
|
"multi_instance": true,
|
||||||
"services": [
|
"services": [
|
||||||
|
@ -25,8 +30,7 @@
|
||||||
"install" : [
|
"install" : [
|
||||||
{
|
{
|
||||||
"name": "domain",
|
"name": "domain",
|
||||||
"type": "domain",
|
"type": "domain"
|
||||||
"example": "example.com"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "path",
|
"name": "path",
|
||||||
|
@ -36,8 +40,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "admin",
|
"name": "admin",
|
||||||
"type": "user",
|
"type": "user"
|
||||||
"example": "johndoe"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
|
|
|
@ -58,7 +58,7 @@ ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC BACKUP
|
# SPECIFIC BACKUP
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP A CRON FILE
|
# BACKUP VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/cron.d/$app"
|
ynh_backup --src_path="/etc/cron.d/$app"
|
||||||
|
|
|
@ -71,7 +71,7 @@ ynh_install_app_dependencies $pkg_dependencies
|
||||||
ynh_script_progression --message="Configuring system user..."
|
ynh_script_progression --message="Configuring system user..."
|
||||||
|
|
||||||
# Create a 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
|
# CREATE A MYSQL DATABASE
|
||||||
|
@ -148,21 +148,21 @@ chown -R $app:www-data "$final_path"
|
||||||
update-alternatives --set php /usr/bin/php$phpversion
|
update-alternatives --set php /usr/bin/php$phpversion
|
||||||
|
|
||||||
pushd "$final_path"
|
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 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 sudo -u $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 drush_language
|
||||||
#ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-download ldap
|
#ynh_exec_warn_less ynh_exec_as $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 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 sudo -u $app env PATH=$PATH drush @$app pm-download l10n_update
|
ynh_exec_warn_less ynh_exec_as $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 ynh_exec_as $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 ynh_exec_as $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 ynh_exec_as $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 ynh_exec_as $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 ynh_exec_as $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 l10n-update
|
||||||
ynh_exec_warn_less sudo -u $app env PATH=$PATH drush @$app pm-update
|
ynh_exec_warn_less ynh_exec_as $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 core-cron
|
||||||
|
|
||||||
chmod 750 "$final_path"
|
chmod 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
|
|
|
@ -31,14 +31,6 @@ ynh_script_progression --message="Removing the MySQL database..."
|
||||||
# Remove a database if it exists, along with the associated user
|
# Remove a database if it exists, along with the associated user
|
||||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
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
|
# REMOVE APP MAIN DIR
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -63,12 +55,20 @@ ynh_script_progression --message="Removing PHP-FPM configuration..."
|
||||||
# Remove the dedicated PHP-FPM config
|
# Remove the dedicated PHP-FPM config
|
||||||
ynh_remove_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
|
# SPECIFIC REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE THE CRON FILE
|
# REMOVE VARIOUS FILES
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Removing the cron file..."
|
ynh_script_progression --message="Removing various files..."
|
||||||
|
|
||||||
# Remove a cron file
|
# Remove a cron file
|
||||||
ynh_secure_remove --file="/etc/cron.d/$app"
|
ynh_secure_remove --file="/etc/cron.d/$app"
|
||||||
|
|
|
@ -39,8 +39,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Validating restoration parameters..."
|
ynh_script_progression --message="Validating restoration parameters..."
|
||||||
|
|
||||||
ynh_webpath_available --domain=$domain --path_url=$path_url \
|
|
||||||
|| ynh_die --message="Path not available: ${domain}${path_url}"
|
|
||||||
test ! -d $final_path \
|
test ! -d $final_path \
|
||||||
|| ynh_die --message="There is already a directory: $final_path "
|
|| ynh_die --message="There is already a directory: $final_path "
|
||||||
|
|
||||||
|
@ -59,7 +57,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_script_progression --message="Recreating the dedicated system user..."
|
ynh_script_progression --message="Recreating the dedicated system user..."
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# 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
|
# RESTORE THE APP MAIN DIR
|
||||||
|
@ -86,12 +84,6 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC RESTORATION
|
# SPECIFIC RESTORATION
|
||||||
#=================================================
|
|
||||||
# RESTORE THE CRON FILE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REINSTALL DEPENDENCIES
|
# REINSTALL DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -109,6 +101,13 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||||
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# RESTORE VARIOUS FILES
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Restoring various files..."
|
||||||
|
|
||||||
|
ynh_restore_file --origin_path="/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -31,18 +31,6 @@ ynh_script_progression --message="Checking version..."
|
||||||
|
|
||||||
upgrade_type=$(ynh_check_app_version_changed)
|
upgrade_type=$(ynh_check_app_version_changed)
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
|
||||||
|
|
||||||
# Cleaning legacy permissions
|
|
||||||
if ynh_legacy_permissions_exists; then
|
|
||||||
ynh_legacy_permissions_delete_all
|
|
||||||
|
|
||||||
ynh_app_setting_delete --app=$app --key=is_public
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -59,13 +47,25 @@ ynh_abort_if_errors
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
|
#=================================================
|
||||||
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||||
|
|
||||||
|
# Cleaning legacy permissions
|
||||||
|
if ynh_legacy_permissions_exists; then
|
||||||
|
ynh_legacy_permissions_delete_all
|
||||||
|
|
||||||
|
ynh_app_setting_delete --app=$app --key=is_public
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CREATE DEDICATED USER
|
# CREATE DEDICATED USER
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Making sure dedicated system user exists..."
|
ynh_script_progression --message="Making sure dedicated system user exists..."
|
||||||
|
|
||||||
# Create a dedicated user (if not existing)
|
# 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
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -136,14 +136,14 @@ chown -R $app:www-data "$final_path"
|
||||||
update-alternatives --set php /usr/bin/php$phpversion
|
update-alternatives --set php /usr/bin/php$phpversion
|
||||||
|
|
||||||
pushd "$final_path"
|
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 ynh_exec_as $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 ynh_exec_as $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 ynh_exec_as $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 ynh_exec_as $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 ynh_exec_as $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 l10n-update
|
||||||
|
|
||||||
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 750 "$final_path"
|
||||||
chmod -R o-rwx "$final_path"
|
chmod -R o-rwx "$final_path"
|
||||||
|
|
Loading…
Reference in a new issue