YunoHost-Apps / wordpress_ynh

WordPress package for YunoHost
https://wordpress.org/
GNU General Public License v3.0
26 stars 30 forks source link

Hide exposed .user.js file from Internet (and/or allow nginx configuration changes for admin only) #224

Open LowMem opened 1 year ago

LowMem commented 1 year ago

Bug description

Please allow .user.js file to be hidden from internet when installing Wordfence module (recommended in Hardening Wordpress.

This is due to nginx webserver use. I could get rid of security warning following manual configuration, but I believe it will appear again on update.

Context

Steps to reproduce

```sh
sudo yunohost app install wordpress
```

Expected behavior

What would be really great, would be to be able to add some nginx config block in Wordpress configuration in admin panel. This would allow to hide such file and also any other file exposed by any other wordpress module.

Logs

Nothing has failed. Wordpress needs manual nginx configuration changes when using Wordfence (a well known Wordpress module).

LowMem commented 1 year ago

I forgot to mention that manual change to nginx configuration file is (only) to add such block to /etc/nginx/conf.d/<wordpress_ynh_URL_used>.d/wordpress.conf file:

location ~ ^/\.user\.ini {
deny all;
}