Avoid 600 permissions for Apache-less variant

This commit is contained in:
Peca 2025-08-04 15:19:22 +02:00
commit 8680995e66
2 changed files with 10 additions and 4 deletions

View file

@ -49,10 +49,10 @@ find /home/$user/mail/*/ -maxdepth 1 -type d -exec chmod g-rwx {} \;
find /home/$user/conf/dns/ -type f -exec chown root:bind {} \; find /home/$user/conf/dns/ -type f -exec chown root:bind {} \;
find /home/$user/conf/ -type d -exec chown root:root {} \; find /home/$user/conf/ -type d -exec chown root:root {} \;
find /home/$user/web/*/public_html/ -type d -exec chmod 755 {} + for domain in $(/usr/local/vesta/bin/v-list-web-domains $user plain |cut -f 1); do
find /home/$user/web/*/public_html/ -type f -exec chmod 644 {} + /usr/local/vesta/bin/v-fix-website-permissions $domain $user
find /home/$user/web/*/public_html/ -exec chown $user:$user {} \; echo "--------------------------------"
find /home/$user/web/*/ -name "*.php" -type f -exec chmod 600 {} + done
echo "Done, permissions fixed for user: $user" echo "Done, permissions fixed for user: $user"

View file

@ -28,6 +28,7 @@ USER=$user
# Includes # Includes
source /usr/local/vesta/func/main.sh source /usr/local/vesta/func/main.sh
source /usr/local/vesta/conf/vesta.conf
if [ -z "$user" ]; then if [ -z "$user" ]; then
check_result $E_NOTEXIST "domain $domain doesn't exist" check_result $E_NOTEXIST "domain $domain doesn't exist"
@ -77,6 +78,11 @@ find public_html/ -type d ! -user $USER -exec chown $USER:$USER {} +
find public_html/ -type f ! \( -name "*.php" -o -name "*.env" \) ! -user $USER -exec chown $USER:$USER {} + find public_html/ -type f ! \( -name "*.php" -o -name "*.env" \) ! -user $USER -exec chown $USER:$USER {} +
php_chmod="600" php_chmod="600"
if [ "$WEB_SYSTEM" = 'nginx' ]; then
php_chmod="644"
fi
if [ -f "/home/php_chmod" ]; then if [ -f "/home/php_chmod" ]; then
php_chmod=$(cat /home/php_chmod) php_chmod=$(cat /home/php_chmod)
fi fi