From 31ceb67e894410b63bb8e77dca275dd795772b19 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 1 May 2022 08:06:58 +0200 Subject: [PATCH] Fix --- scripts/install | 7 +++++-- scripts/restore | 8 ++++++++ scripts/upgrade | 19 ++++++++++++++----- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/scripts/install b/scripts/install index 6f46b54..f49a558 100644 --- a/scripts/install +++ b/scripts/install @@ -166,16 +166,19 @@ ynh_use_logrotate # SECURE FILES AND DIRECTORIES #================================================= -chown -R root: $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" # Only AgenDav user should write here chown -R $app ${final_path}/web/var/cache/{profiler,twig} # The AgenDav user should read here, but does not need to write # Other users should not be able to read as it stores passwords. -chown -R root:$app ${final_path}/web/config/ +chown -R $app ${final_path}/web/config/ chmod -R 750 ${final_path}/web/config/ + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/restore b/scripts/restore index 3058107..b6cb7d9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -74,6 +74,14 @@ chown -R $app ${final_path}/web/var/cache/{profiler,twig} chown -R root:$app ${final_path}/web/config/ chmod -R 750 ${final_path}/web/config/ +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8a10ace..08d9a76 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -113,10 +113,17 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Copy and set NGINX configuration ynh_add_nginx_config +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." +ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config @@ -149,14 +156,16 @@ ynh_use_logrotate --non-append # SECURE FILES AND DIRECTORIES #================================================= -chown -R root: $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" -# Only agendav user should write here +# Only AgenDav user should write here chown -R $app ${final_path}/web/var/cache/{profiler,twig} -# The agendav user should read here, but does not need to write +# The AgenDav user should read here, but does not need to write # Other users should not be able to read as it stores passwords. -chown -R root:$app ${final_path}/web/config/ +chown -R $app ${final_path}/web/config/ chmod -R 750 ${final_path}/web/config/ #=================================================