From c8e6e71186b35e2179ed328ae3c78bdcd64c759d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 3 Feb 2023 13:03:41 +0100 Subject: [PATCH] Fix --- scripts/install | 6 +++++- scripts/restore | 12 ++++++++---- scripts/upgrade | 12 ++++++++---- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/scripts/install b/scripts/install index b6205b1..3c653cc 100644 --- a/scripts/install +++ b/scripts/install @@ -48,7 +48,11 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/config.json" --destination="$install_dir/config.json" -chmod 750 "$install_dir" +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" diff --git a/scripts/restore b/scripts/restore index fbc70ff..ed2f094 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,10 +26,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # GENERIC FINALIZATION #================================================= @@ -39,6 +35,14 @@ ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload +#================================================= +# SECURE FILES AND DIRECTORIES +#================================================= + +# Set permissions to app files +chmod -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 42e2d25..24b1307 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -51,10 +51,6 @@ then ynh_setup_source --dest_dir="$install_dir" --keep="config.json" fi -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # ADD A CONFIGURATION #================================================= @@ -70,6 +66,14 @@ 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 -R o-rwx "$install_dir" +chown -R $app:www-data "$install_dir" + #================================================= # END OF SCRIPT #=================================================