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

Merge pull request #179 from YunoHost-Apps/testing

Fix uploads permissions
This commit is contained in:
tituspijean 2022-07-10 15:09:55 +02:00 committed by GitHub
commit 4ab3a71c2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 12 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

@ -6,7 +6,7 @@
"en": "Create a beautiful blog or website easily",
"fr": "Logiciel de création de blog ou de site Web"
},
"version": "5.9.3~ynh1",
"version": "5.9.3~ynh2",
"url": "https://wordpress.org/",
"upstream": {
"license": "GPL-2.0",

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