Skip to content

Commit a7321e9

Browse files
committed
version update
1 parent 68a34e1 commit a7321e9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

upd/convert-templates.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
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
410
sed -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
107113
done
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

110144
exit

0 commit comments

Comments
 (0)