diff --git a/scripts/install b/scripts/install index 1cc15ba..743c885 100644 --- a/scripts/install +++ b/scripts/install @@ -230,9 +230,12 @@ $wpcli_alias plugin activate authldap $plugin_network $wpcli_alias plugin activate companion-auto-update $plugin_network $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" chown -R $app:www-data "$final_path" +chmod g+s $final_path/wp-content/uploads #================================================= # STORE THE CONFIG FILE CHECKSUM diff --git a/scripts/restore b/scripts/restore index 41556c1..f9ee58f 100644 --- a/scripts/restore +++ b/scripts/restore @@ -74,9 +74,12 @@ 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" 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) chmod 400 "$final_path/wp-config.php" chown $app:$app "$final_path/wp-config.php" diff --git a/scripts/upgrade b/scripts/upgrade index 0481559..0e7a5e0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -277,9 +277,14 @@ $wpcli_alias plugin activate wp-fail2ban-redux $plugin_network # Disable broken plugin http-authentication $wpcli_alias plugin is-installed http-authentication && $wpcli_alias plugin deactivate http-authentication $plugin_network + +# Set file and directories ownership +mkdir -p $final_path/wp-content/uploads chmod 750 "$final_path" chmod -R o-rwx "$final_path" 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) #================================================= # STORE THE CHECKSUM OF THE CONFIG FILE