mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
regenconf: force systemd, nginx, php and fail2ban conf to be owned by root
This commit is contained in:
parent
daf51e94bd
commit
e649c092a3
3 changed files with 21 additions and 0 deletions
|
@ -181,6 +181,15 @@ do_post_regen() {
|
|||
# NB: x permission for 'others' is important for ssl-cert (and maybe mdns), otherwise slapd will fail to start because can't access the certs
|
||||
chmod 755 /etc/yunohost
|
||||
|
||||
chown root:root /etc/systemd/system/*.service
|
||||
chmod 644 /etc/systemd/system/*.service
|
||||
|
||||
if ls -l /etc/php/*/fpm/pool.d/*.conf
|
||||
then
|
||||
chown root:root /etc/php/*/fpm/pool.d/*.conf
|
||||
chmod 644 /etc/php/*/fpm/pool.d/*.conf
|
||||
fi
|
||||
|
||||
# Certs
|
||||
# We do this with find because there could be a lot of them...
|
||||
chown -R root:ssl-cert /etc/yunohost/certs
|
||||
|
|
|
@ -144,6 +144,12 @@ do_pre_regen() {
|
|||
do_post_regen() {
|
||||
regen_conf_files=$1
|
||||
|
||||
if ls -l /etc/nginx/conf.d/*.d/*.conf
|
||||
then
|
||||
chown root:root /etc/nginx/conf.d/*.d/*.conf
|
||||
chmod 644 /etc/nginx/conf.d/*.d/*.conf
|
||||
fi
|
||||
|
||||
[ -z "$regen_conf_files" ] && exit 0
|
||||
|
||||
# create NGINX conf directories for domains
|
||||
|
|
|
@ -24,6 +24,12 @@ do_pre_regen() {
|
|||
do_post_regen() {
|
||||
regen_conf_files=$1
|
||||
|
||||
if ls -l /etc/fail2ban/jail.d/*.conf
|
||||
then
|
||||
chown root:root /etc/fail2ban/jail.d/*.conf
|
||||
chmod 644 /etc/fail2ban/jail.d/*.conf
|
||||
fi
|
||||
|
||||
[[ -z "$regen_conf_files" ]] \
|
||||
|| systemctl reload fail2ban
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue