From fbb9d9f9c0e07c600c19717e882acb4fb42dc90d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 15 May 2021 16:33:18 +0200 Subject: [PATCH] fix rights --- manifest.json | 2 +- scripts/install | 14 +++++++++----- scripts/restore | 4 +++- scripts/upgrade | 5 ++++- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/manifest.json b/manifest.json index fc84d62..4d44854 100644 --- a/manifest.json +++ b/manifest.json @@ -17,7 +17,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.1.7" + "yunohost": ">= 4.2.4" }, "multi_instance": false, "services": [ diff --git a/scripts/install b/scripts/install index 628a39d..d4d7e2d 100644 --- a/scripts/install +++ b/scripts/install @@ -87,16 +87,20 @@ ynh_add_fpm_config --usage=low --footprint=low # SECURE FILES AND DIRECTORIES #================================================= -# Set right permissions for curl install -chown -R $app: $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring permissions..." --weight=1 +ynh_script_progression --message="Configuring permissions..." --time --weight=1 -# Make app public if necessary or protect it -[ $is_public -eq 0 ] || ynh_permission_update --permission="main" --add="visitors" +# Make app public if necessary +if [ $is_public -eq 1 ] +then + ynh_permission_update --permission="main" --add="visitors" +fi #================================================= # RELOAD NGINX diff --git a/scripts/restore b/scripts/restore index 080f407..e511c60 100644 --- a/scripts/restore +++ b/scripts/restore @@ -65,7 +65,9 @@ ynh_system_user_create --username=$app #================================================= # Restore permissions on app files -chown -R $app: $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index e4e0fcf..9d067c9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,7 +79,10 @@ ynh_add_fpm_config --usage=low --footprint=low #================================================= cp -a ../sources/* $final_path -chown -R $app: $final_path + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION