Merge branch 'pr/86'

This commit is contained in:
myvesta 2020-08-19 14:10:12 +02:00
commit 83104523a0
4 changed files with 28 additions and 2 deletions

12
bin/v-restart-proxy Executable file → Normal file
View file

@ -49,8 +49,20 @@ if [ -z "$PROXY_SYSTEM" ] || [ "$PROXY_SYSTEM" = 'remote' ]; then
exit
fi
if [ -f "/usr/local/vesta/web/inc/nginx_proxy" ]; then
# if vesta is behind default nginx, restart in background with 15 sec delay
# background restart
if [ "$1" = 'background' ]; then
# Restart system
sleep 25
service $PROXY_SYSTEM restart >/dev/null 2>&1
if [ $? -ne 0 ]; then
send_email_report
check_result $E_RESTART "$PROXY_SYSTEM restart failed"
fi
# if vesta is behind default nginx, restart in background with 15 sec delay
# background restart
if [ "$1" = 'background' ]; then

View file

@ -409,7 +409,7 @@ if [ "$web" != 'no' ] && [ ! -z "$WEB_SYSTEM" ]; then
chown $user $tmpdir
chmod u+w $HOMEDIR/$user/web/$domain
sudo -u $user tar -xzpf $tmpdir/web/$domain/domain_data.tar.gz \
-C $HOMEDIR/$user/web/$domain/ --exclude=logs/* \
-C $HOMEDIR/$user/web/$domain/ --exclude=./logs/* \
2> $HOMEDIR/$user/web/$domain/restore_errors.log
if [ -e "$HOMEDIR/$user/web/$domain/restore_errors.log" ]; then
chown $user:$user $HOMEDIR/$user/web/$domain/restore_errors.log

View file

@ -322,7 +322,7 @@ delete_pgsql_database() {
psql_connect $HOST
query="REVOKE ALL PRIVILEGES ON DATABASE $database FROM $DBUSER"
psql_qyery "$query" > /dev/null
psql_query "$query" > /dev/null
query="DROP DATABASE $database"
psql_query "$query" > /dev/null

View file

@ -412,6 +412,20 @@ update_domain_zone() {
VALUE=$(idn --quiet -a -t "$VALUE")
fi
# Split long TXT entries into 255 chunks
if [ "$TYPE" = 'TXT' ]; then
txtlength=${#VALUE}
if [ $txtlength -gt 255 ]; then
if [[ ${VALUE:0:1} = '"' ]]; then
txtlength=$(( $txtlength - 2 ))
VALUE=${VALUE:1:txtlength}
fi
VALUE=$(echo $VALUE | fold -w 255 | xargs -I '$' echo -n ' "$"')
VALUE=${VALUE:1}
VALUE="($VALUE)"
fi
fi
if [ "$SUSPENDED" != 'yes' ]; then
eval echo -e "\"$fields\""|sed "s/%quote%/'/g" >> $zn_conf
fi