From e09e17d33dad1fe4765f185df49e45127dc42fdc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 28 Jul 2022 20:26:29 +0200 Subject: [PATCH] Fix rights --- scripts/_common.sh | 6 ++---- scripts/install | 8 -------- scripts/restore | 9 +-------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9a4df38..660f7d8 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -34,12 +34,10 @@ myynh_set_permissions () { [ $(find "$final_path" -type d | wc -l) -gt 0 ] && find "$final_path" -type d | xargs chmod 0755 [ $(find "$datadir" -type f | wc -l) -gt 0 ] && find "$datadir" -type f | xargs chmod 0644 [ $(find "$datadir" -type d | wc -l) -gt 0 ] && find "$datadir" -type d | xargs chmod 0755 - chown -R root:"$app" "$final_path" - chown -R "$app": "$final_path/private" - chown -R "$app": "$datadir" - chown root: "$datadir" chmod -R o-rwx "$final_path" + chown -R $app:www-data "$final_path" chmod -R o-rwx "$datadir" + chown -R $app:www-data "$datadir" } #Convert --data to --data-urlencode before ynh_local_curl diff --git a/scripts/install b/scripts/install index ab80173..6fd5462 100644 --- a/scripts/install +++ b/scripts/install @@ -83,10 +83,6 @@ ynh_setup_source --dest_dir="$tmpdir" myynh_clean_source mv "$tmpdir" "$final_path" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -117,10 +113,6 @@ ynh_app_setting_set --app=$app --key=datadir --value=$datadir mkdir -p $datadir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - #================================================= # ADD A CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index bfcc2ec..9f44279 100644 --- a/scripts/restore +++ b/scripts/restore @@ -54,10 +54,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$final_path" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" - #================================================= # RESTORE THE DATA DIRECTORY #================================================= @@ -67,10 +63,6 @@ ynh_restore_file --origin_path="$datadir" --not_mandatory mkdir -p $datadir -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - #================================================= # SPECIFIC RESTORATION #================================================= @@ -98,6 +90,7 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE USER RIGHTS #================================================= + myynh_set_permissions #=================================================