From 5fc73f3136afeeb03cb084143837da30d1b84a0f Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 10 Apr 2021 00:55:38 +0200 Subject: [PATCH 1/7] Apply example_ynh --- README.md | 4 ++-- README_fr.md | 4 ++-- manifest.json | 18 +----------------- scripts/backup | 2 +- scripts/change_url | 20 ++++++++++---------- scripts/install | 38 +++++++++++++++++--------------------- scripts/remove | 8 ++++---- scripts/restore | 26 +++++++++++--------------- scripts/upgrade | 36 ++++++++++++++---------------------- 9 files changed, 62 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index ff79c63..345b01e 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ LDAP module can be installed #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/drupal%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/drupal/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/drupal%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/drupal/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/drupal.svg)](https://ci-apps.yunohost.org/ci/apps/drupal/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/drupal.svg)](https://ci-apps-arm.yunohost.org/ci/apps/drupal/) ## Links diff --git a/README_fr.md b/README_fr.md index 7c4436f..56b4d6f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -29,8 +29,8 @@ Le module d'authentification LDAP peut être installé. #### Architectures supportées -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/drupal%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/drupal/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/drupal%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/drupal/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/drupal.svg)](https://ci-apps.yunohost.org/ci/apps/drupal/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/drupal.svg)](https://ci-apps-arm.yunohost.org/ci/apps/drupal/) ## Liens diff --git a/manifest.json b/manifest.json index 2582c4a..9d7e25f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A content management framework written in PHP", "fr": "Un système de gestion de contenu écrit en PHP" }, - "version": "8.9.7~ynh1", + "version": "8.9.7~ynh2", "url": "https://www.drupal.org", "license": "GPL-2.0-or-later", "maintainer": { @@ -26,38 +26,22 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain name for Drupal", - "fr": "Choisissez un nom de domaine pour Drupal" - }, "example": "example.com" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for Drupal", - "fr": "Choisissez un chemin pour Drupal" - }, "example": "/drupal", "default": "/drupal" }, { "name": "admin", "type": "user", - "ask": { - "en": "Choose an admin user", - "fr": "Choisissez l'administrateur" - }, "example": "johndoe" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public application?", - "fr": "Est-ce une application publique ?" - }, "default": true }, { diff --git a/scripts/backup b/scripts/backup index fd931cd..f2401c9 100644 --- a/scripts/backup +++ b/scripts/backup @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers diff --git a/scripts/change_url b/scripts/change_url index 75b45a9..eb2c6ae 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -35,9 +35,9 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) #================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP #================================================= -ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." # Backup the current version of the app ynh_backup_before_upgrade @@ -45,7 +45,7 @@ ynh_clean_setup () { # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -72,23 +72,23 @@ fi #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating nginx web server configuration..." +ynh_script_progression --message="Updating NGINX web server configuration..." nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf -# Change the path in the nginx config file +# Change the path in the NGINX config file if [ $change_path -eq 1 ] then - # Make a backup of the original nginx config file if modified + # Make a backup of the original NGINX config file if modified ynh_backup_if_checksum_is_different --file="$nginx_conf_path" - # Set global variables for nginx helper + # Set global variables for NGINX helper domain="$old_domain" path_url="$new_path" - # Create a dedicated nginx config + # Create a dedicated NGINX config ynh_add_nginx_config fi -# Change the domain for nginx +# Change the domain for NGINX if [ $change_domain -eq 1 ] then # Delete file checksum for the old conf file location @@ -114,7 +114,7 @@ ynh_add_config --template="../conf/example.site.yml" --destination="$final_path/ #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/install b/scripts/install index bc18786..bf55c3b 100644 --- a/scripts/install +++ b/scripts/install @@ -67,6 +67,14 @@ ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -88,28 +96,24 @@ ynh_setup_source --dest_dir="$final_path" mkdir -p "$final_path/$app" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R root:$app "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring nginx web server..." +ynh_script_progression --message="Configuring NGINX web server..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." - -# Create a system user -ynh_system_user_create --username=$app --home_dir="$final_path" - #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring php-fpm..." +ynh_script_progression --message="Configuring PHP-FPM..." -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) @@ -174,14 +178,6 @@ ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php" #================================================= # GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." - -# Set permissions to app files -chown -R $app: $final_path - #================================================= # SETUP SSOWAT #================================================= @@ -198,7 +194,7 @@ fi #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/remove b/scripts/remove index c5d854e..d6f734c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -51,17 +51,17 @@ ynh_secure_remove --file="$final_path" #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing nginx web server configuration..." +ynh_script_progression --message="Removing NGINX web server configuration..." -# Remove the dedicated nginx config +# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= # REMOVE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Removing php-fpm configuration..." +ynh_script_progression --message="Removing PHP-FPM configuration..." -# Remove the dedicated php-fpm config +# Remove the dedicated PHP-FPM config ynh_remove_fpm_config #================================================= diff --git a/scripts/restore b/scripts/restore index c651863..d81ee5c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,7 @@ # IMPORT GENERIC HELPERS #================================================= -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts +# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source ../settings/scripts/ynh_add_swap source /usr/share/yunohost/helpers @@ -21,7 +21,7 @@ ynh_abort_if_errors #================================================= # LOAD SETTINGS #================================================= -ynh_script_progression --message="Loading settings..." +ynh_script_progression --message="Loading installation settings..." app=$YNH_APP_INSTANCE_NAME @@ -47,17 +47,10 @@ test ! -d $final_path \ #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring 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 APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring the app main directory..." - -ynh_restore_file --origin_path="$final_path" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -67,12 +60,15 @@ ynh_script_progression --message="Recreating the dedicated system user..." ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= -# RESTORE USER RIGHTS +# RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring user rights..." +ynh_script_progression --message="Restoring the app main directory..." -# Restore permissions on app files -chown -R $app: $final_path +ynh_restore_file --origin_path="$final_path" + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R root:$app "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -124,7 +120,7 @@ ynh_add_swap --size=$swap_needed #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading nginx web server and php-fpm..." +ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index e9dc774..fee3502 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -53,7 +53,7 @@ ynh_script_progression --message="Backing up the app before upgrading (may take # Backup the current version of the app ynh_backup_before_upgrade ynh_clean_setup () { - # restore it if the upgrade fails + # Restore it if the upgrade fails ynh_restore_upgradebackup } # Exit if an error occurs during the execution of the script @@ -61,12 +61,20 @@ ynh_abort_if_errors #================================================= # STANDARD UPGRADE STEPS +#================================================= +# 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" + #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading nginx web server configuration..." +ynh_script_progression --message="Upgrading NGINX web server configuration..." -# Create a dedicated nginx config +# Create a dedicated NGINX config ynh_add_nginx_config #================================================= @@ -76,20 +84,12 @@ ynh_script_progression --message="Upgrading dependencies..." ynh_install_app_dependencies $pkg_dependencies -#================================================= -# 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" - #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading php-fpm configuration..." +ynh_script_progression --message="Upgrading PHP-FPM configuration..." -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) @@ -148,18 +148,10 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" #================================================= # GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." - -# Set permissions on app files -chown -R $app: $final_path - #================================================= # RELOAD NGINX #================================================= -ynh_script_progression --message="Reloading nginx web server..." +ynh_script_progression --message="Reloading NGINX web server..." ynh_systemd_action --service_name=nginx --action=reload From 6378be00686bd1a18258df49224512365d1834d4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 10 Apr 2021 23:28:14 +0200 Subject: [PATCH 2/7] Apply last example_ynh --- check_process | 2 +- scripts/install | 5 +++-- scripts/upgrade | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/check_process b/check_process index 8c11094..9b4c909 100644 --- a/check_process +++ b/check_process @@ -16,7 +16,7 @@ setup_public=1 upgrade=1 # 8.7.1~ynh1 - # upgrade=1 from_commit=f0af5b7a8e58615fe8ad73e3c1d6fe8d1369f061 + #upgrade=1 from_commit=f0af5b7a8e58615fe8ad73e3c1d6fe8d1369f061 # 8.9.7~ynh1 upgrade=1 from_commit=08ca36cc16691ed64a11034c810f5adefb21186a backup_restore=1 diff --git a/scripts/install b/scripts/install index bf55c3b..6532b5d 100644 --- a/scripts/install +++ b/scripts/install @@ -151,8 +151,6 @@ export PATH="$final_path/vendor/bin:$PATH" #================================================= ynh_script_progression --message="Installing Drupal..." -chown -R $app: $final_path - update-alternatives --set php /usr/bin/php$phpversion pushd "$final_path" @@ -176,6 +174,9 @@ ynh_script_progression --message="Storing the config file checksum..." # Calculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php" +chmod 400 "$final_path/$app/sites/default/settings.php" +chown $app:$app "$final_path/$app/sites/default/settings.php" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index fee3502..bf0c66d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -139,6 +139,9 @@ ynh_script_progression --message="Storing the config file checksum..." # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum --file="$final_path/$app/sites/default/settings.php" +chmod 400 "$final_path/$app/sites/default/settings.php" +chown $app:$app "$final_path/$app/sites/default/settings.php" + #================================================= # SETUP THE CRON FILE #================================================= From c6777185ef93f54ad0397b9458f9d060c584faa4 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 11 Apr 2021 22:34:21 +0200 Subject: [PATCH 3/7] Fix rights --- scripts/install | 2 +- scripts/remove | 4 ++-- scripts/restore | 30 +++++++++++++++--------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/scripts/install b/scripts/install index 6532b5d..4744d0b 100644 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ mkdir -p "$final_path/$app" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION diff --git a/scripts/remove b/scripts/remove index d6f734c..51b5697 100644 --- a/scripts/remove +++ b/scripts/remove @@ -64,6 +64,8 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# SPECIFIC REMOVE #================================================= # REMOVE SWAP #================================================= @@ -71,8 +73,6 @@ ynh_script_progression --message="Removing swap..." ynh_del_swap -#================================================= -# SPECIFIC REMOVE #================================================= # REMOVE THE CRON FILE #================================================= diff --git a/scripts/restore b/scripts/restore index d81ee5c..fa4c5dc 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,7 +68,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION @@ -84,6 +84,20 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC RESTORATION +#================================================= +# RESTORE THE CRON FILE +#================================================= +ynh_script_progression --message="Restoring the cron file..." + +ynh_restore_file --origin_path="/etc/cron.d/$app" + +#================================================= +# ADD SWAP +#================================================= +ynh_script_progression --message="Adding swap..." + +ynh_add_swap --size=$swap_needed + #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -101,20 +115,6 @@ 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_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql -#================================================= -# RESTORE THE CRON FILE -#================================================= -ynh_script_progression --message="Restoring the cron file..." - -ynh_restore_file --origin_path="/etc/cron.d/$app" - -#================================================= -# ADD SWAP -#================================================= -ynh_script_progression --message="Adding swap..." - -ynh_add_swap --size=$swap_needed - #================================================= # GENERIC FINALIZATION #================================================= From f8dbe70af7a41ec26967e02d95274effa99100d6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 13 Apr 2021 01:06:18 +0200 Subject: [PATCH 4/7] Fix rights --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 4744d0b..a49069f 100644 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ mkdir -p "$final_path/$app" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index fa4c5dc..8d4dfb4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,7 +68,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index bf0c66d..65b4063 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,6 +69,19 @@ 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" +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + mkdir -p "$final_path/$app" +fi + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= From c90c37161e536b16dc9e77c8fa99b4078e30b4bc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 14 Apr 2021 19:59:21 +0200 Subject: [PATCH 5/7] Fix install --- scripts/install | 4 ++++ scripts/upgrade | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/scripts/install b/scripts/install index a49069f..d3bc6e9 100644 --- a/scripts/install +++ b/scripts/install @@ -151,6 +151,10 @@ export PATH="$final_path/vendor/bin:$PATH" #================================================= ynh_script_progression --message="Installing Drupal..." +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + update-alternatives --set php /usr/bin/php$phpversion pushd "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index 65b4063..cb2a712 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -131,6 +131,10 @@ ynh_script_progression --message="Upgrading Drupal..." ynh_backup_if_checksum_is_different --file="$final_path/$app/sites/default/settings.php" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + update-alternatives --set php /usr/bin/php$phpversion pushd "$final_path" From 34111f65ff38b2e2937b94aa9ab60f67b0300b57 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 15 Apr 2021 20:28:06 +0200 Subject: [PATCH 6/7] Fix chmod --- scripts/install | 4 ++-- scripts/restore | 2 +- scripts/upgrade | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index d3bc6e9..d6e3e24 100644 --- a/scripts/install +++ b/scripts/install @@ -96,7 +96,7 @@ ynh_setup_source --dest_dir="$final_path" mkdir -p "$final_path/$app" -chmod 750 "$final_path" +chmod -R 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -151,7 +151,7 @@ export PATH="$final_path/vendor/bin:$PATH" #================================================= ynh_script_progression --message="Installing Drupal..." -chmod 750 "$final_path" +chmod -R 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" diff --git a/scripts/restore b/scripts/restore index 8d4dfb4..c4071ab 100644 --- a/scripts/restore +++ b/scripts/restore @@ -66,7 +66,7 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" -chmod 750 "$final_path" +chmod -R 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index cb2a712..af1eb45 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -78,7 +78,7 @@ then mkdir -p "$final_path/$app" fi -chmod 750 "$final_path" +chmod -R 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -131,7 +131,7 @@ ynh_script_progression --message="Upgrading Drupal..." ynh_backup_if_checksum_is_different --file="$final_path/$app/sites/default/settings.php" -chmod 750 "$final_path" +chmod -R 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" From c9183cdcaa0bbf3765c346382040c6486fdd15e5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 17 Apr 2021 18:31:20 +0200 Subject: [PATCH 7/7] Fix recursive chmod --- scripts/install | 4 ++-- scripts/restore | 2 +- scripts/upgrade | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index d6e3e24..d3bc6e9 100644 --- a/scripts/install +++ b/scripts/install @@ -96,7 +96,7 @@ ynh_setup_source --dest_dir="$final_path" mkdir -p "$final_path/$app" -chmod -R 750 "$final_path" +chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -151,7 +151,7 @@ export PATH="$final_path/vendor/bin:$PATH" #================================================= ynh_script_progression --message="Installing Drupal..." -chmod -R 750 "$final_path" +chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" diff --git a/scripts/restore b/scripts/restore index c4071ab..8d4dfb4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -66,7 +66,7 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" -chmod -R 750 "$final_path" +chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index af1eb45..cb2a712 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -78,7 +78,7 @@ then mkdir -p "$final_path/$app" fi -chmod -R 750 "$final_path" +chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" @@ -131,7 +131,7 @@ ynh_script_progression --message="Upgrading Drupal..." ynh_backup_if_checksum_is_different --file="$final_path/$app/sites/default/settings.php" -chmod -R 750 "$final_path" +chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path"