From 215aeb992fd53a2c1409faee6da38c3c9b68d828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 6 Feb 2023 19:57:59 +0100 Subject: [PATCH] Fix --- scripts/install | 14 +++++--------- scripts/restore | 14 +++++--------- scripts/upgrade | 14 +++++--------- 3 files changed, 15 insertions(+), 27 deletions(-) diff --git a/scripts/install b/scripts/install index 2e7c543..0b36f87 100644 --- a/scripts/install +++ b/scripts/install @@ -17,6 +17,11 @@ ynh_script_progression --message="Setting up source files..." --weight=7 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" +# Set permissions to app files +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" + #================================================= # NGINX CONFIGURATION #================================================= @@ -33,15 +38,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 34a1ef5..6a23353 100644 --- a/scripts/restore +++ b/scripts/restore @@ -16,6 +16,11 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" +# Set permissions to app files +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -33,15 +38,6 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 980460a..cac35fb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,6 +27,11 @@ then ynh_setup_source --dest_dir="$install_dir" --keep="content media system/extensions" fi +# Set permissions to app files +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" + #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -43,15 +48,6 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # END OF SCRIPT #=================================================