1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wordpress_ynh.git synced 2024-09-03 20:36:10 +02:00

Fix uploads permissions

This commit is contained in:
tituspijean 2022-07-10 11:35:24 +02:00
parent ad45de733c
commit 5db4d15926
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
4 changed files with 24 additions and 11 deletions

View file

@ -3,3 +3,5 @@
php_admin_value[upload_max_filesize] = 50M
php_admin_value[memory_limit] = 64M
php_admin_value[post_max_size] = 50M
php_admin_value[upload_tmp_dir] = __FINALPATH__/wp-content/temp/

View file

@ -232,10 +232,14 @@ $wpcli_alias plugin activate wp-fail2ban-redux $plugin_network
# Set file and directories ownership
mkdir -p $final_path/wp-content/uploads
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
mkdir -p $final_path/wp-content/temp
chown -R $app:www-data "$final_path"
chmod g+s $final_path/wp-content/uploads
find "$final_path" -type d -exec chmod 750 {} \;
find "$final_path" -type f -exec chmod 640 {} \;
find "$final_path/wp-content/uploads" -type d -exec chmod 770 {} \;
find "$final_path/wp-content/temp" -type d -exec chmod 770 {} \;
setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/uploads"
setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/temp"
#=================================================
# STORE THE CONFIG FILE CHECKSUM

View file

@ -75,11 +75,15 @@ ynh_script_progression --message="Restoring the app main directory..."
ynh_restore_file --origin_path="$final_path"
# Set file and directories ownership
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
mkdir -p $final_path/wp-content/uploads
mkdir -p $final_path/wp-content/temp
chown -R $app:www-data "$final_path"
chmod g+s $final_path/wp-content/uploads
chmod g+s $(find $final_path/wp-content/uploads -type d)
find "$final_path" -type d -exec chmod 750 {} \;
find "$final_path" -type f -exec chmod 640 {} \;
find "$final_path/wp-content/uploads" -type d -exec chmod 770 {} \;
find "$final_path/wp-content/temp" -type d -exec chmod 770 {} \;
setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/uploads"
setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/temp"
chmod 400 "$final_path/wp-config.php"
chown $app:$app "$final_path/wp-config.php"

View file

@ -280,11 +280,14 @@ $wpcli_alias plugin is-installed http-authentication && $wpcli_alias plugin deac
# Set file and directories ownership
mkdir -p $final_path/wp-content/uploads
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
mkdir -p $final_path/wp-content/temp
chown -R $app:www-data "$final_path"
chmod g+s $final_path/wp-content/uploads
chmod g+s $(find $final_path/wp-content/uploads -type d)
find "$final_path" -type d -exec chmod 750 {} \;
find "$final_path" -type f -exec chmod 640 {} \;
find "$final_path/wp-content/uploads" -type d -exec chmod 770 {} \;
find "$final_path/wp-content/temp" -type d -exec chmod 770 {} \;
setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/uploads"
setfacl -Rm d:g:www-data:rwX "$final_path/wp-content/temp"
#=================================================
# STORE THE CHECKSUM OF THE CONFIG FILE