File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ # Check version
4+ source /usr/local/vesta/conf/vesta.conf
5+ if [ " $VERSION " != ' 0.9.7' ]; then
6+ exit
7+ fi
8+
39# Rename web system service
410sed -i " s/apache/httpd/g" /usr/local/vesta/conf/vesta.conf
511
@@ -106,5 +112,33 @@ for ip in $(ls /usr/local/vesta/data/ips); do
106112 > /etc/nginx/conf.d/$ip .conf
107113done
108114
115+ # Remove broken symlink protection
116+ sed -i ' /Symlinks protection/d' /etc/nginx/nginx.conf
117+ sed -i ' /disable_symlinks.*/d' /etc/nginx/nginx.conf
118+
119+ # Add improved symlink protection
120+ if [ -e " $TPL /nginx" ]; then
121+ for tpl in $( ls $TPL /nginx | grep -v proxy_ip.tpl) ; do
122+ check_symlink=$( grep disable_symlinks $TPL /nginx/$tpl )
123+ if [ -z " $check_symlink " ]; then
124+ insert=' disable_symlinks if_not_owner from=%docroot%;'
125+ sed -i " s/include %/$insert \n\ninclude %/" $TPL /nginx/$tpl
126+ triggered=' yes'
127+ fi
128+ done
129+
130+ if [ " $triggered " = ' yes' ]; then
131+ # Rebuild web domains
132+ for user in $( ls $VESTA /data/users) ; do
133+ v-rebuild-web-domains $user no
134+ done
135+
136+ # Restart proxy
137+ v-restart-proxy
138+ fi
139+ fi
140+
141+ # Update version
142+ sed -i ' s/0.9.7/0.9.8/' /usr/local/vesta/conf/vesta.conf
109143
110144exit
You can’t perform that action at this time.
0 commit comments