From aba861c8143c0b23a3d327636bf79ebe13cc897d Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Thu, 11 Nov 2021 22:54:42 +0100 Subject: [PATCH 001/679] check spam if email smaller than 600 KB --- install/debian/10/exim/exim4.conf.template | 2 +- install/debian/11/exim/exim4.conf.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install/debian/10/exim/exim4.conf.template b/install/debian/10/exim/exim4.conf.template index cb79ab3c..70577b6e 100644 --- a/install/debian/10/exim/exim4.conf.template +++ b/install/debian/10/exim/exim4.conf.template @@ -174,7 +174,7 @@ acl_check_data: .ifdef SPAMASSASSIN warn !authenticated = * hosts = !+relay_from_hosts - condition = ${if < {$message_size}{100K}} + condition = ${if < {$message_size}{600K}} condition = ${if eq{$acl_m1}{yes}{yes}{no}} spam = nobody:true/defer_ok add_header = X-Spam-Score: $spam_score_int diff --git a/install/debian/11/exim/exim4.conf.template b/install/debian/11/exim/exim4.conf.template index d8bca393..a041b329 100644 --- a/install/debian/11/exim/exim4.conf.template +++ b/install/debian/11/exim/exim4.conf.template @@ -174,7 +174,7 @@ acl_check_data: .ifdef SPAMASSASSIN warn !authenticated = * hosts = !+relay_from_hosts - condition = ${if < {$message_size}{100K}} + condition = ${if < {$message_size}{600K}} condition = ${if eq{$acl_m1}{yes}{yes}{no}} spam = nobody:true/defer_ok add_header = X-Spam-Score: $spam_score_int From 8c4be97720bdda6f25db0a94c7150d779679d2f0 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Fri, 12 Nov 2021 23:04:46 +0100 Subject: [PATCH 002/679] Fix for "chmod: changing permissions" --- bin/v-add-web-domain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-add-web-domain b/bin/v-add-web-domain index aab09e6a..72de559a 100755 --- a/bin/v-add-web-domain +++ b/bin/v-add-web-domain @@ -90,7 +90,7 @@ done # Changing file owner & permission chown -R $user:$user $HOMEDIR/$user/web/$domain chown root:$user /var/log/$WEB_SYSTEM/domains/$domain.* $conf -sudo -u $user chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.* +chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.* sudo -u $user chmod 751 $HOMEDIR/$user/web/$domain $HOMEDIR/$user/web/$domain/* sudo -u $user chmod 551 $HOMEDIR/$user/web/$domain/stats $HOMEDIR/$user/web/$domain/logs sudo -u $user chmod 644 $HOMEDIR/$user/web/$domain/public_*html/*.* From 302e351252d2afa3428381bd11d72a03729a2438 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 14 Nov 2021 19:47:54 +0100 Subject: [PATCH 003/679] Many fixes for v-list-sys-services --- bin/v-list-sys-services | 142 ++++++++++++++++++++++--- web/templates/admin/list_services.html | 12 ++- 2 files changed, 133 insertions(+), 21 deletions(-) diff --git a/bin/v-list-sys-services b/bin/v-list-sys-services index 93f01a11..71133ac4 100755 --- a/bin/v-list-sys-services +++ b/bin/v-list-sys-services @@ -18,6 +18,8 @@ source $VESTA/conf/vesta.conf export PATH=$PATH:/sbin +debug=0 + # JSON list function json_list() { IFS=$'\n' @@ -50,6 +52,9 @@ shell_list() { echo "---- ----- --- --- ------" while read str; do eval $str + if [ "$STATE" = "stopped" ]; then + STATE='off' + fi echo "$NAME $STATE $CPU $MEM $RTIME" done < <(echo -e "$data" |grep NAME) } @@ -77,8 +82,17 @@ csv_list() { get_srv_state() { srv=$1 name=${2-$1} + procfolder=$4 + procfile=$5 state='running' + mem=0 + cpu=0 + rtime="0" + if [ $debug -eq 1 ]; then + echo "---------------------" + echo "$srv = $name" + fi # Searching related pids if [ -z $3 ]; then pids=$(pidof $name |tr ' ' '|') @@ -88,10 +102,23 @@ get_srv_state() { if [ -z "$pids" ] && [ "$name" != 'nginx' ]; then pids=$(pgrep $name |tr '\n' '|') fi + if [ "$name" = 'elasticsearch' ]; then + pids=$(ps -Af | grep 'elasticsearch' | grep -v 'grep' | awk '{print $2}' | tr '\n' '|') + fi + if [ "$name" = 'vesta-nginx' ]; then + pids=$(ps -Af | grep 'vesta/nginx' | grep -v 'grep' | awk '{print $2}' | tr '\n' '|') + fi + if [ "$name" = 'vesta-php' ]; then + pids=$(ps -Af | grep 'vesta/php' | grep -v 'grep' | awk '{print $2}' | tr '\n' '|') + fi + if [ $debug -eq 1 ]; then + echo "pids = $pids" + fi # Checking pid - if [ ! -z "$pids" ]; then + if [ -n "$pids" ]; then pid=$(echo "$pids" |cut -f 1 -d '|') + pids=${pids%|} pids=$(egrep "$pids" $tmp_file) # Calculating CPU usage @@ -103,7 +130,22 @@ get_srv_state() { # Searching pid file pid_file='' - if [ -e "/var/run/$srv.pid" ]; then + if [ ! -z "$procfolder" ]; then + if [ -f "/var/run/$procfolder/$srv.pid" ]; then + pid_file="/var/run/$procfolder/$srv.pid" + fi + fi + if [ -z "$pid_file" ] && [ ! -z "$procfolder" ] && [ ! -z "$procfile" ]; then + if [ -f "/var/run/$procfolder/$procfile.pid" ]; then + pid_file="/var/run/$procfolder/$procfile.pid" + fi + fi + if [ -z "$pid_file" ] && [ -z "$procfolder" ] && [ ! -z "$procfile" ]; then + if [ -f "/var/run/$procfile.pid" ]; then + pid_file="/var/run/$procfile.pid" + fi + fi + if [ -z "$pid_file" ] && [ -e "/var/run/$srv.pid" ]; then pid_file="/var/run/$srv.pid" fi if [ -z "$pid_file" ] && [ -e "/var/run/$srv/$srv.pid" ]; then @@ -112,18 +154,31 @@ get_srv_state() { if [ -z "$pid_file" ] && [ -e "/var/run/$name/$name.pid" ]; then pid_file="/var/run/$name/$name.pid" fi + if [ -z "$pid_file" ] && [ -f "/var/run/$name.pid" ]; then + pid_file="/var/run/$name.pid" + fi if [ -z "$pid_file" ] && [ -e "/proc/$pid" ]; then pid_file="/proc/$pid" fi + if [ $debug -eq 1 ]; then + echo "$srv = $name = $pid_file" + fi # Calculating uptime - if [ ! -z "$pid_file" ]; then + if [ -n "$pid_file" ]; then mtime=$(stat -c "%Y" $pid_file) rtime=$((ctime - mtime)) rtime=$((rtime / 60)) else rtime=0 fi + if [ "$pid_file" = "/proc/$pid" ]; then + if [ $debug -eq 1 ]; then + echo "getting pid lifetime via ps" + fi + rtime=$(ps -p 2877633 -o etimes | tail -n 1 | awk '{print $1}') + rtime=$((rtime / 60)) + fi else state='stopped' mem=0 @@ -151,14 +206,6 @@ if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'remote' ]; then data="$data MEM='$mem' RTIME='$rtime'" fi -# Checking WEB Backend -if [ ! -z "$WEB_BACKEND" ] && [ "$WEB_BACKEND" != 'remote' ]; then - proc_name=$(ls /usr/sbin/php*fpm* | rev | cut -d'/' -f 1 | rev) - get_srv_state $proc_name - data="$data\nNAME='$WEB_BACKEND' SYSTEM='backend server' STATE='$state'" - data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" -fi - # Checking WEB Proxy if [ ! -z "$PROXY_SYSTEM" ] && [ "$PROXY_SYSTEM" != 'remote' ]; then get_srv_state $PROXY_SYSTEM @@ -166,6 +213,18 @@ if [ ! -z "$PROXY_SYSTEM" ] && [ "$PROXY_SYSTEM" != 'remote' ]; then data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" fi +# Checking WEB Backend +if [ "$WEB_BACKEND" != 'remote' ]; then + php_versions=$(ls /usr/sbin/php*fpm* | cut -d'/' -f4 | sed 's|php-fpm||') + for version in $php_versions; do + proc_name="php-fpm${version}" + service_name="php${version}-fpm" + get_srv_state "$service_name" "$proc_name" '' 'php' + data="$data\nNAME='$service_name' SYSTEM='backend server' STATE='$state'" + data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" + done +fi + # DNS service=$DNS_SYSTEM if [ ! -z "$service" ] && [ "$service" != 'remote' ]; then @@ -177,14 +236,22 @@ fi # Checking MAIL system if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'remote' ]; then - get_srv_state $MAIL_SYSTEM + if [ "$MAIL_SYSTEM" = "exim4" ]; then + get_srv_state "$MAIL_SYSTEM" "$MAIL_SYSTEM" '' 'exim4' 'exim' + else + get_srv_state $MAIL_SYSTEM + fi data="$data\nNAME='$MAIL_SYSTEM' SYSTEM='mail server' STATE='$state'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" fi # Checking MAIL IMAP if [ ! -z "$IMAP_SYSTEM" ] && [ "$IMAP_SYSTEM" != 'remote' ]; then - get_srv_state $IMAP_SYSTEM + if [ "$IMAP_SYSTEM" = "dovecot" ]; then + get_srv_state "$IMAP_SYSTEM" "$IMAP_SYSTEM" '' 'dovecot' 'master' + else + get_srv_state $IMAP_SYSTEM + fi data="$data\nNAME='$IMAP_SYSTEM' SYSTEM='pop/imap server' STATE='$state'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" fi @@ -200,11 +267,19 @@ if [ ! -z "$ANTIVIRUS_SYSTEM" ] && [ "$ANTIVIRUS_SYSTEM" != 'remote' ]; then if [ "$ANTIVIRUS_SYSTEM" == 'clamav-daemon' ];then proc_name='clamd' fi - get_srv_state $ANTIVIRUS_SYSTEM $proc_name + get_srv_state $ANTIVIRUS_SYSTEM $proc_name '' 'clamav' 'clamd' fi data="$data\nNAME='$ANTIVIRUS_SYSTEM' SYSTEM='email antivirus'" data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'" proc_name='' + if [ ! -d "/etc/sysconfig" ]; then + if [ "$ANTIVIRUS_SYSTEM" == 'clamav-daemon' ];then + get_srv_state "clamav-freshclam" "freshclam" + data="$data\nNAME='clamav-freshclam' SYSTEM='email antivirus updater'" + data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'" + proc_name='' + fi + fi fi # Checking MAIL ANTISPAM @@ -220,6 +295,7 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'remote' ]; then proc_name='' service="$db" if [ "$service" = 'mysql' ]; then + proc_name='mysqld' release=$(cat /etc/debian_version | tr "." "\n" | head -n1) if [ "$release" -eq 11 ]; then service='mariadb' @@ -243,7 +319,7 @@ if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'remote' ]; then proc_name='postgres' fi fi - get_srv_state $service $proc_name + get_srv_state $service $proc_name '' 'mysqld' 'mysqld' data="$data\nNAME='$service' SYSTEM='database server' STATE='$state'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" proc_name='' @@ -259,11 +335,28 @@ fi # Checking CRON system if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'remote' ]; then - get_srv_state $CRON_SYSTEM + get_srv_state "$CRON_SYSTEM" "$CRON_SYSTEM" '' '' 'crond' data="$data\nNAME='$CRON_SYSTEM' SYSTEM='job scheduler' STATE='$state'" data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" fi +# Checking SSH daemon +if [ -e "/etc/ssh/sshd_config" ]; then + get_srv_state 'ssh' 'ssh' '' '' 'sshd' + data="$data\nNAME='ssh' SYSTEM='SSH Access' STATE='$state'" + data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" +fi + +# Checking Vesta nginx +get_srv_state 'vesta' 'vesta-nginx' '' '' 'vesta-nginx' +data="$data\nNAME='vesta-nginx' SYSTEM='Vesta nginx service' STATE='$state'" +data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" + +# Checking Vesta php-fpm +get_srv_state 'vesta' 'vesta-php' '' '' 'vesta-php' +data="$data\nNAME='vesta-php' SYSTEM='Vesta php service' STATE='$state'" +data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" + # Checking FIREWALL system if [ ! -z "$FIREWALL_SYSTEM" ] && [ "$FIREWALL_SYSTEM" != 'remote' ]; then state="stopped" @@ -277,11 +370,26 @@ fi # Checking FIREWALL Fail2ban extention if [ ! -z "$FIREWALL_EXTENSION" ]; then - get_srv_state $FIREWALL_EXTENSION fail2ban-server script + get_srv_state "$FIREWALL_EXTENSION" 'fail2ban-server' 'script' data="$data\nNAME='$FIREWALL_EXTENSION' SYSTEM='brute-force monitor'" data="$data STATE='$state' CPU='$cpu' MEM='$mem' RTIME='$rtime'" fi +# Checking ElasticSearch +if [ -d "/etc/elasticsearch" ]; then + get_srv_state 'elasticsearch' + data="$data\nNAME='elasticsearch' SYSTEM='ElasticSearch' STATE='$state'" + data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" +fi + +# Checking Redis +if [ -d "/etc/redis" ]; then + get_srv_state 'redis' 'redis-server' '' 'redis' 'redis-server' + data="$data\nNAME='redis' SYSTEM='Redis' STATE='$state'" + data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'" +fi + + # Listing data case $format in json) json_list ;; diff --git a/web/templates/admin/list_services.html b/web/templates/admin/list_services.html index 6012d2a3..45d6b18a 100644 --- a/web/templates/admin/list_services.html +++ b/web/templates/admin/list_services.html @@ -121,7 +121,11 @@ $status = 'suspended'; $action = 'start'; } - + + $realservice=$key; + if ($realservice=="vesta-php") $realservice="vesta"; + if ($realservice=="vesta-nginx") $realservice="vesta"; + $cpu = $data[$key]['CPU'] / 10; $cpu = number_format($cpu, 1); if ($cpu == '0.0') $cpu = 0; @@ -137,9 +141,9 @@
From d9202d91b9a0d334db272b738f2996f38fb1a6d9 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 14 Nov 2021 20:01:21 +0100 Subject: [PATCH 004/679] Avoid clamav fixes if clamav is disabled --- src/deb/vesta/postinst | 119 +++++++++++++++++++++-------------------- 1 file changed, 61 insertions(+), 58 deletions(-) diff --git a/src/deb/vesta/postinst b/src/deb/vesta/postinst index 8649087b..c9b9732c 100755 --- a/src/deb/vesta/postinst +++ b/src/deb/vesta/postinst @@ -141,48 +141,68 @@ if [ "$check_cron" -eq 0 ]; then crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;"; } | crontab - fi -# make sure clamav-daemon.service has mkdir fix -if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then - check_grep=$(grep -c 'mkdir' /lib/systemd/system/clamav-daemon.service) - if [ "$check_grep" -eq 0 ]; then - echo "=== patching clamav-daemon.service" - exec_pre1='ExecStartPre=-/bin/mkdir -p /var/run/clamav' - exec_pre2='ExecStartPre=-/bin/chown -R clamav:clamav /var/run/clamav' - sed -i "s|\[Service\]|[Service]\n$exec_pre1\n$exec_pre2|g" /lib/systemd/system/clamav-daemon.service - systemctl daemon-reload - systemctl restart clamav-daemon - systemctl restart clamav-freshclam - fi -fi - -# reverting to default clamd sock -if [ ! -f "/usr/local/vesta/data/upgrades/change-clamav-socket-v3" ]; then - touch /usr/local/vesta/data/upgrades/change-clamav-socket-v3 - if [ -f "/etc/clamav/clamd.conf" ]; then - sed -i "s#/var/lib/clamav/clamd.sock#/var/run/clamav/clamd.ctl#g" /etc/clamav/clamd.conf - if [ -f "/etc/exim4/exim4.conf.template" ]; then - sed -i "s#/var/lib/clamav/clamd.sock#/var/run/clamav/clamd.ctl#g" /etc/exim4/exim4.conf.template - fi - if [ -f "/lib/systemd/system/clamav-daemon.socket" ]; then - sed -i "s#/var/lib/clamav/clamd.sock#/run/clamav/clamd.ctl#g" /lib/systemd/system/clamav-daemon.socket - fi - systemctl daemon-reload - systemctl restart clamav-daemon - systemctl restart clamav-freshclam - if [ -f "/etc/exim4/exim4.conf.template" ]; then - systemctl restart exim4 - fi - fi -fi - -# reverting to default clamd sock -if [ ! -f "/usr/local/vesta/data/upgrades/change-clamav-socket-v4" ]; then - touch /usr/local/vesta/data/upgrades/change-clamav-socket-v4 - if [ -f "/etc/clamav/clamd.conf" ]; then - check_grep=$(grep -c '/var/lib/clamav/clamd.ctl' /etc/clamav/clamd.conf) - if [ "$check_grep" -eq 1 ]; then - sed -i "s#/var/lib/clamav/clamd.ctl#/var/run/clamav/clamd.ctl#g" /etc/clamav/clamd.conf +unit_files="$(systemctl list-unit-files | grep clamav-daemon)" +if [[ ! "$unit_files" =~ "disabled" ]]; then + # make sure clamav-daemon.service has mkdir fix + if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then + check_grep=$(grep -c 'mkdir' /lib/systemd/system/clamav-daemon.service) + if [ "$check_grep" -eq 0 ]; then + echo "=== patching clamav-daemon.service" + exec_pre1='ExecStartPre=-/bin/mkdir -p /var/run/clamav' + exec_pre2='ExecStartPre=-/bin/chown -R clamav:clamav /var/run/clamav' + sed -i "s|\[Service\]|[Service]\n$exec_pre1\n$exec_pre2|g" /lib/systemd/system/clamav-daemon.service + systemctl daemon-reload systemctl restart clamav-daemon + systemctl restart clamav-freshclam + fi + fi + + # reverting to default clamd sock + if [ ! -f "/usr/local/vesta/data/upgrades/change-clamav-socket-v3" ]; then + touch /usr/local/vesta/data/upgrades/change-clamav-socket-v3 + if [ -f "/etc/clamav/clamd.conf" ]; then + sed -i "s#/var/lib/clamav/clamd.sock#/var/run/clamav/clamd.ctl#g" /etc/clamav/clamd.conf + if [ -f "/etc/exim4/exim4.conf.template" ]; then + sed -i "s#/var/lib/clamav/clamd.sock#/var/run/clamav/clamd.ctl#g" /etc/exim4/exim4.conf.template + fi + if [ -f "/lib/systemd/system/clamav-daemon.socket" ]; then + sed -i "s#/var/lib/clamav/clamd.sock#/run/clamav/clamd.ctl#g" /lib/systemd/system/clamav-daemon.socket + fi + systemctl daemon-reload + systemctl restart clamav-daemon + systemctl restart clamav-freshclam + if [ -f "/etc/exim4/exim4.conf.template" ]; then + systemctl restart exim4 + fi + fi + fi + + # reverting to default clamd sock + if [ ! -f "/usr/local/vesta/data/upgrades/change-clamav-socket-v4" ]; then + touch /usr/local/vesta/data/upgrades/change-clamav-socket-v4 + if [ -f "/etc/clamav/clamd.conf" ]; then + check_grep=$(grep -c '/var/lib/clamav/clamd.ctl' /etc/clamav/clamd.conf) + if [ "$check_grep" -eq 1 ]; then + sed -i "s#/var/lib/clamav/clamd.ctl#/var/run/clamav/clamd.ctl#g" /etc/clamav/clamd.conf + systemctl restart clamav-daemon + fi + fi + fi + + # Block executable files inside zip/rar/tar archives in ClamAV + if [ ! -f "/usr/local/vesta/data/upgrades/clamav_block_exe_in_archives" ]; then + touch /usr/local/vesta/data/upgrades/clamav_block_exe_in_archives + if [ -f "/etc/exim4/exim4.conf.template" ]; then + check_grep=$(grep -c '#CLAMD' /etc/exim4/exim4.conf.template) + if [ "$check_grep" -eq 0 ]; then + folder="/var/lib/clamav" + if [ -d "$folder" ]; then + echo "=== Blocking executable files inside zip/rar/tar archives in ClamAV" + wget -nv -O $folder/foxhole_all.cdb http://c.myvestacp.com/tools/clamav/foxhole_all.cdb + chown clamav:clamav $folder/foxhole_all.cdb + service clamav-daemon restart + fi + fi fi fi fi @@ -204,23 +224,6 @@ if [ "$release" -eq 9 ] || [ "$release" -eq 10 ]; then fi fi -# Block executable files inside zip/rar/tar archives in ClamAV -if [ ! -f "/usr/local/vesta/data/upgrades/clamav_block_exe_in_archives" ]; then - touch /usr/local/vesta/data/upgrades/clamav_block_exe_in_archives - if [ -f "/etc/exim4/exim4.conf.template" ]; then - check_grep=$(grep -c '#CLAMD' /etc/exim4/exim4.conf.template) - if [ "$check_grep" -eq 0 ]; then - folder="/var/lib/clamav" - if [ -d "$folder" ]; then - echo "=== Blocking executable files inside zip/rar/tar archives in ClamAV" - wget -nv -O $folder/foxhole_all.cdb http://c.myvestacp.com/tools/clamav/foxhole_all.cdb - chown clamav:clamav $folder/foxhole_all.cdb - service clamav-daemon restart - fi - fi - fi -fi - # Clearing letsencrypt pipe if [ ! -f "/usr/local/vesta/data/upgrades/clearing-letsencrypt-pipe" ]; then touch /usr/local/vesta/data/upgrades/clearing-letsencrypt-pipe From b42d607ad141e2f82088a2ba629b508cdb812f39 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 14 Nov 2021 20:05:49 +0100 Subject: [PATCH 005/679] Version 0.9.8-26-51 --- src/deb/latest.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/deb/latest.txt b/src/deb/latest.txt index 53712deb..af812423 100644 --- a/src/deb/latest.txt +++ b/src/deb/latest.txt @@ -1 +1 @@ -vesta-0.9.8-26-50 +vesta-0.9.8-26-51 From a7d96a479bfb039b01a75f1845c568e7f9d65fbc Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 14 Nov 2021 20:16:27 +0100 Subject: [PATCH 006/679] Fixes only if ClamAV is enabled --- src/deb/vesta/postinst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/deb/vesta/postinst b/src/deb/vesta/postinst index c9b9732c..d06501bd 100755 --- a/src/deb/vesta/postinst +++ b/src/deb/vesta/postinst @@ -141,8 +141,9 @@ if [ "$check_cron" -eq 0 ]; then crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;"; } | crontab - fi -unit_files="$(systemctl list-unit-files | grep clamav-daemon)" -if [[ ! "$unit_files" =~ "disabled" ]]; then +if [ $(systemctl list-unit-files | grep clamav-daemon | grep -c "disabled") -eq 0 ]; then + # Fixes only if ClamAV is enabled + # make sure clamav-daemon.service has mkdir fix if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then check_grep=$(grep -c 'mkdir' /lib/systemd/system/clamav-daemon.service) From b62486ddd291382abccf162f2d542942152e613b Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 14 Nov 2021 20:20:29 +0100 Subject: [PATCH 007/679] Update Changelog.md --- Changelog.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Changelog.md b/Changelog.md index 4ecfde8f..3cf4b126 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,7 @@ +Version 0.9.8-26-51 [14-Nov-2021] +================================================== +* Many fixes for "List services" page (v-list-sys-services function) + Version 0.9.8-26-50 [07-Nov-2021] ================================================== * Many small bugfixes and CSRF fixes From de5f28459e7e2d53927f100e6ddc05ffc517d4ad Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 14 Nov 2021 21:11:34 +0100 Subject: [PATCH 008/679] $pid fix in v-list-sys-services --- bin/v-list-sys-services | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-list-sys-services b/bin/v-list-sys-services index 71133ac4..2b7e7890 100755 --- a/bin/v-list-sys-services +++ b/bin/v-list-sys-services @@ -176,7 +176,7 @@ get_srv_state() { if [ $debug -eq 1 ]; then echo "getting pid lifetime via ps" fi - rtime=$(ps -p 2877633 -o etimes | tail -n 1 | awk '{print $1}') + rtime=$(ps -p $pid -o etimes | tail -n 1 | awk '{print $1}') rtime=$((rtime / 60)) fi else From 8f6fe21dbf10e03705f649bd0e1538698e37cafc Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Wed, 17 Nov 2021 15:15:23 +0100 Subject: [PATCH 009/679] Dont match wildcardly *domains and databases* while restoring --- bin/v-restore-user | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/v-restore-user b/bin/v-restore-user index e9861d46..af451d88 100755 --- a/bin/v-restore-user +++ b/bin/v-restore-user @@ -476,7 +476,7 @@ if [ "$dns" != 'no' ] && [ ! -z "$DNS_SYSTEM" ]; then if [ -z "$dns" ] || [ "$dns" = '*' ]; then domains="$backup_domains" else - echo "$dns" |tr ',' '\n' > $tmpdir/selected.txt + echo "$dns" | tr ',' '\n' | sed -e "s/^/^/" > $tmpdir/selected.txt domains=$(echo "$backup_domains" |egrep -f $tmpdir/selected.txt) fi @@ -556,7 +556,7 @@ if [ "$mail" != 'no' ] && [ ! -z "$MAIL_SYSTEM" ]; then if [ -z "$mail" ] || [ "$mail" = '*' ]; then domains="$backup_domains" else - echo "$mail" |tr ',' '\n' > $tmpdir/selected.txt + echo "$mail" | tr ',' '\n' | sed -e "s/^/^/" > $tmpdir/selected.txt domains=$(echo "$backup_domains" |egrep -f $tmpdir/selected.txt) fi @@ -653,7 +653,7 @@ if [ "$db" != 'no' ] && [ ! -z "$DB_SYSTEM" ]; then if [ -z "$db" ] || [ "$db" = '*' ]; then databases="$backup_databases" else - echo "$db" |tr ',' '\n' > $tmpdir/selected.txt + echo "$db" |tr ',' '\n' | sed -e "s/$/$/" > $tmpdir/selected.txt databases=$(echo "$backup_databases" |egrep -f $tmpdir/selected.txt) fi From d36f1a355b3bcb1d37f6a9015b9c81c245f320e6 Mon Sep 17 00:00:00 2001 From: Anton Reutov