From 28942d1bd21e2c7aabec012f8d15312a7d41d84d Mon Sep 17 00:00:00 2001 From: tigercodes Date: Mon, 11 Jul 2016 10:14:06 -0400 Subject: [PATCH 01/23] Opencart nginx template (tpl file) Template to support opencart seo url's. --- .../templates/web/nginx/php5-fpm/opencart.tpl | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 install/ubuntu/14.04/templates/web/nginx/php5-fpm/opencart.tpl diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/opencart.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/opencart.tpl new file mode 100644 index 00000000..e3669a19 --- /dev/null +++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/opencart.tpl @@ -0,0 +1,52 @@ +server { + listen %ip%:%web_port%; + server_name %domain_idn% %alias_idn%; + root %docroot%; + index index.php index.html index.htm; + access_log /var/log/nginx/domains/%domain%.log combined; + access_log /var/log/nginx/domains/%domain%.bytes bytes; + error_log /var/log/nginx/domains/%domain%.error.log error; + + location / { + + try_files $uri $uri/ @opencart; + + location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ { + expires max; + } + + location ~ [^/]\.php(/|$) { + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + if (!-f $document_root$fastcgi_script_name) { + return 404; + } + + fastcgi_pass %backend_lsnr%; + fastcgi_index index.php; + include /etc/nginx/fastcgi_params; + } + } + + location @opencart { + rewrite ^/(.+)$ /index.php?_route_=$1 last; + } + + error_page 403 /error/404.html; + error_page 404 /error/404.html; + error_page 500 502 503 504 /error/50x.html; + + location /error/ { + alias %home%/%user%/web/%domain%/document_errors/; + } + + location ~* "/\.(htaccess|htpasswd)$" { + deny all; + return 404; + } + + include /etc/nginx/conf.d/phpmyadmin.inc*; + include /etc/nginx/conf.d/phppgadmin.inc*; + include /etc/nginx/conf.d/webmail.inc*; + + include %home%/%user%/conf/web/nginx.%domain%.conf*; +} From dd8a96d09d3a3d6c10514775885ed42532bad317 Mon Sep 17 00:00:00 2001 From: huloza Date: Wed, 20 Jul 2016 05:45:40 -0400 Subject: [PATCH 02/23] Added TLSA Record Type for DNS sorry, i dont know the procedure for the Ideas but i created an Idea in Vesta Bug Tracker: https://bugs.vestacp.com/issues/306 This add one more option on the Type record in DNS Manager, no need extra validation, also the file: admin/add_dns_rec.html needs to be modified to add the new option tag. --- func/main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/func/main.sh b/func/main.sh index 617637b8..142ef46e 100644 --- a/func/main.sh +++ b/func/main.sh @@ -589,7 +589,7 @@ is_dbuser_format_valid() { # DNS record type validator is_dns_type_format_valid() { - known_dnstype='A,AAAA,NS,CNAME,MX,TXT,SRV,DNSKEY,KEY,IPSECKEY,PTR,SPF' + known_dnstype='A,AAAA,NS,CNAME,MX,TXT,SRV,DNSKEY,KEY,IPSECKEY,PTR,SPF,TLSA' if [ -z "$(echo $known_dnstype |grep -w $1)" ]; then check_result $E_INVALID "invalid dns record type format :: $1" fi From 9b7777d6fd6b3831b34be408b7b3e48f3fa9cf82 Mon Sep 17 00:00:00 2001 From: huloza Date: Wed, 20 Jul 2016 05:52:40 -0400 Subject: [PATCH 03/23] ADD TLSA RECORD option to the DNS Manager --- web/templates/admin/add_dns_rec.html | 1 + 1 file changed, 1 insertion(+) diff --git a/web/templates/admin/add_dns_rec.html b/web/templates/admin/add_dns_rec.html index 0ebc0552..2f5a00e5 100644 --- a/web/templates/admin/add_dns_rec.html +++ b/web/templates/admin/add_dns_rec.html @@ -80,6 +80,7 @@ + From 1c1ba0449cd15c060408522818b9489d1893aa3c Mon Sep 17 00:00:00 2001 From: dpeca Date: Wed, 20 Jul 2016 20:21:51 +0200 Subject: [PATCH 04/23] Removing AllowSupplementaryGroups from clamav.conf Option 'AllowSupplementaryGroups' is not allowed anymore on new version of ClamAV Reported as bug - https://bugs.vestacp.com/issues/279 Details - http://forum.vestacp.com/viewtopic.php?f=12&t=11884 --- install/debian/8/clamav/clamd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/debian/8/clamav/clamd.conf b/install/debian/8/clamav/clamd.conf index ea982697..4e04356e 100644 --- a/install/debian/8/clamav/clamd.conf +++ b/install/debian/8/clamav/clamd.conf @@ -8,7 +8,7 @@ LocalSocketMode 666 # TemporaryDirectory is not set to its default /tmp here to make overriding # the default with environment variables TMPDIR/TMP/TEMP possible User clamav -AllowSupplementaryGroups true +# AllowSupplementaryGroups true ScanMail true ScanArchive true ArchiveBlockEncrypted false From fb11b194b330d465a5fb761d8d6f4e7c30ec74d8 Mon Sep 17 00:00:00 2001 From: dpeca Date: Thu, 21 Jul 2016 00:45:26 +0200 Subject: [PATCH 05/23] Changing password_vesta_host to server hostname ''Vesta Password Driver for Roundcube'' will try to make a HTTPS request to Vesta, in order to change mail password. In /etc/roundcube/plugins/password/config.inc.php you have: $rcmail_config['password_vesta_host'] = 'localhost'; That 'localhost' must be changed to server hostname, because HTTPS to localhost will not works if your server hostname is not 'localhost', because SSL certs are not for 'localhost' but for server hostname. This line will change localhost to server hostname, and 'Vesta Password driver for Roundcube' will works. --- install/vst-install-debian.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 5dfb084f..13200314 100755 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -1069,6 +1069,7 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then mysql -e "CREATE DATABASE roundcube" mysql -e "GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY '$r'" sed -i "s/%password%/$r/g" /etc/roundcube/db.inc.php + sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql chmod a+r /etc/roundcube/main.inc.php if [ "$release" -eq 8 ]; then From e2da4fbb188d76426cd89bd41e1aec5fada95e7b Mon Sep 17 00:00:00 2001 From: dpeca Date: Thu, 21 Jul 2016 01:00:03 +0200 Subject: [PATCH 06/23] Roundcube log permission fix Roundcube is not able to write to /var/log/roundcube This is a fix for it. Reported as a bug long time ago - https://forum.vestacp.com/viewtopic.php?f=12&t=10114&p=39648#p38630 See last line at this post. In v16 you accepted my pull request for password driver, but that was just a partial fix, because it needs to fix log permissions too. Now here is a fix for roundcube log permissions. --- install/vst-install-debian.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 5dfb084f..d2933e13 100755 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -1125,6 +1125,14 @@ check_result $? "can't create admin user" $VESTA/bin/v-change-user-shell admin bash $VESTA/bin/v-change-user-language admin $lang +# RoundCube permissions fix +if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then + if [ ! -d "/var/log/roundcube" ]; then + mkdir /var/log/roundcube + fi + chown admin:admin /var/log/roundcube +fi + # Configuring system ips $VESTA/bin/v-update-sys-ip From c5ae7881af1dfc07e6763887d4491b7a63d91874 Mon Sep 17 00:00:00 2001 From: dpeca Date: Thu, 21 Jul 2016 01:57:22 +0200 Subject: [PATCH 07/23] Fix for SMTP and IMAP hostname in add_mail_acc.html template Dovecot and Exim4 is able to handle ONLY one TLS / SSL certs. In most cases - it is a cert ONLY for server hostname. So, if you point mail client to $v_domain for IMAP/SMTP TLS - mail client will popup a warning and it will say that certs are for server hostname - not for domain that client added. So, in most cases (in 99% percents) it is better to point mail client to server hostname - because Exim4 and Dovecot have valid cert for server hostname. --- web/templates/admin/add_mail_acc.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/templates/admin/add_mail_acc.html b/web/templates/admin/add_mail_acc.html index 70f2d5bc..725780ee 100644 --- a/web/templates/admin/add_mail_acc.html +++ b/web/templates/admin/add_mail_acc.html @@ -132,6 +132,7 @@
+ @@ -142,7 +143,7 @@ - + @@ -158,7 +159,7 @@ - + @@ -179,4 +180,4 @@
: william.cage@
:
:
:
-
\ No newline at end of file + From 5d6c0137c1fbe75ec7d5fa49cc117b6c8b81bdbd Mon Sep 17 00:00:00 2001 From: dpeca Date: Thu, 21 Jul 2016 02:27:51 +0200 Subject: [PATCH 08/23] Fix for: /usr/local/vesta/func/db.sh: line 390: [: : integer expression expected Every night cron is sending email with subject: Cron sudo /usr/local/vesta/bin/v-update-sys-queue disk And content of that email is: /usr/local/vesta/func/db.sh: line 390: [: : integer expression expected This is a fix for that bug. I guess mysql for some databases returns empty string for DB size, so this will handle that case. --- func/db.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/func/db.sh b/func/db.sh index c7514eea..59a30746 100644 --- a/func/db.sh +++ b/func/db.sh @@ -387,7 +387,7 @@ get_mysql_disk_usage() { query="SELECT SUM( data_length + index_length ) / 1024 / 1024 \"Size\" FROM information_schema.TABLES WHERE table_schema='$database'" usage=$(mysql_query "$query" |tail -n1) - if [ "$usage" == 'NULL' ] || [ "${usage:0:1}" -eq '0' ]; then + if [ "$usage" == '' ] || [ "$usage" == 'NULL' ] || [ "${usage:0:1}" -eq '0' ]; then usage=1 fi export LC_ALL=C From db4c2bcdf5e19c345658a1a8811c3603c365ce57 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 23 Jul 2016 15:17:12 -0400 Subject: [PATCH 09/23] *delete config if domain is not in user web.conf --- func/domain.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/func/domain.sh b/func/domain.sh index a163d259..75aaf373 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -271,8 +271,8 @@ del_web_config() { get_web_config_lines $WEBTPL/$1/$WEB_BACKEND/$2 $conf sed -i "$top_line,$bottom_line d" $conf - web_domains=$(grep DOMAIN $USER_DATA/web.conf |wc -l) - if [ "$web_domains" -eq '0' ]; then + web_domain=$(grep $domain $USER_DATA/web.conf |wc -l) + if [ "$web_domain" -eq '0' ]; then sed -i "/.*\/$user\/.*$1.conf/d" /etc/$1/conf.d/vesta.conf rm -f $conf fi From 8ea7cf60d39dfa51811e1b21eeef17775b15fb78 Mon Sep 17 00:00:00 2001 From: Tjebbe Lievens Date: Fri, 29 Jul 2016 18:35:06 +0200 Subject: [PATCH 10/23] Fix is_format_valid 'user' Error is showing but script isn't stopping when entering an invalid user. --- func/main.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/func/main.sh b/func/main.sh index 617637b8..de791b80 100644 --- a/func/main.sh +++ b/func/main.sh @@ -465,12 +465,12 @@ sync_cron_jobs() { is_user_format_valid() { if [ ${#1} -eq 1 ]; then if ! [[ "$1" =~ ^^[[:alnum:]]$ ]]; then - echo "invalid $2 format :: $1" + check_result $E_INVALID "invalid $2 format :: $1" fi else if ! [[ "$1" =~ ^[[:alnum:]][-|\.|_[:alnum:]]{0,28}[[:alnum:]]$ ]] then - echo "invalid $2 format :: $1" + check_result $E_INVALID "invalid $2 format :: $1" fi fi } From aacaf1b08fdb1c427827b462e25f69bbeda21f01 Mon Sep 17 00:00:00 2001 From: Tjebbe Lievens Date: Fri, 29 Jul 2016 18:51:18 +0200 Subject: [PATCH 11/23] Improve email validation --- func/main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/func/main.sh b/func/main.sh index 617637b8..920dd81c 100644 --- a/func/main.sh +++ b/func/main.sh @@ -612,7 +612,7 @@ is_dns_record_format_valid() { # Email format validator is_email_format_valid() { - if [[ ! "$1" =~ "@" ]] ; then + if [[ ! "$1" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,63}$ ]] ; then check_result $E_INVALID "invalid email format :: $1" fi } From 721731dbd54781bfdb2ad266556b07c03f699a0d Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 30 Jul 2016 02:57:54 -0400 Subject: [PATCH 12/23] *Append $idn_domain to DKIM record names --- bin/v-add-mail-domain-dkim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/v-add-mail-domain-dkim b/bin/v-add-mail-domain-dkim index fe709a59..4a71870c 100755 --- a/bin/v-add-mail-domain-dkim +++ b/bin/v-add-mail-domain-dkim @@ -63,11 +63,11 @@ fi # Adding dns records if [ ! -z "$DNS_SYSTEM" ] && [ -e "$USER_DATA/dns/$domain.conf" ]; then p=$(cat $USER_DATA/mail/$domain.pub |grep -v ' KEY---' |tr -d '\n') - record='_domainkey' + record="_domainkey.$domain_idn" policy="\"t=y; o=~;\"" $BIN/v-add-dns-record $user $domain $record TXT "$policy" - record='mail._domainkey' + record="mail._domainkey.$domain_idn" selector="\"k=rsa\; p=$p\"" $BIN/v-add-dns-record $user $domain $record TXT "$selector" fi From b060bb612e244eea514580a0d3ddacb86b4d8af7 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 31 Jul 2016 03:25:21 -0400 Subject: [PATCH 13/23] *Fix key size by increasing to 4096 to be more secure and be compliant to letsencrypt --- bin/v-add-letsencrypt-user | 2 +- bin/v-generate-ssl-cert | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/v-add-letsencrypt-user b/bin/v-add-letsencrypt-user index 431c2543..697d2ad0 100755 --- a/bin/v-add-letsencrypt-user +++ b/bin/v-add-letsencrypt-user @@ -12,7 +12,7 @@ # Argument definition user=$1 email=$2 -key_size=2048 +key_size=4096 # Includes source $VESTA/func/main.sh diff --git a/bin/v-generate-ssl-cert b/bin/v-generate-ssl-cert index 80912d78..b87a2d65 100755 --- a/bin/v-generate-ssl-cert +++ b/bin/v-generate-ssl-cert @@ -21,7 +21,7 @@ org=$6 org_unit=$7 aliases=$8 format=${9-shell} -KEY_SIZE=2048 +KEY_SIZE=4096 DAYS=365 # Includes From f8c8a33d40576426466044b6a60cdb3bf21304d3 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 31 Jul 2016 04:06:38 -0400 Subject: [PATCH 14/23] *Set VESTA global variable and use everywhere --- install/vst-install-debian.sh | 25 +++++++++++++------------ install/vst-install-rhel.sh | 28 ++++++++++++++-------------- install/vst-install-ubuntu.sh | 25 +++++++++++++------------ 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 5dfb084f..de744c70 100755 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -10,6 +10,7 @@ export DEBIAN_FRONTEND=noninteractive RHOST='apt.vestacp.com' CHOST='c.vestacp.com' VERSION='debian' +VESTA='/usr/local/vesta' memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9]) arch=$(uname -i) os='debian' @@ -506,10 +507,10 @@ mv -f /root/.my.cnf $vst_backups/mysql > /dev/null 2>&1 # Backup vesta service vesta stop > /dev/null 2>&1 -cp -r /usr/local/vesta/* $vst_backups/vesta > /dev/null 2>&1 +cp -r $VESTA/* $vst_backups/vesta > /dev/null 2>&1 apt-get -y remove vesta vesta-nginx vesta-php > /dev/null 2>&1 apt-get -y purge vesta vesta-nginx vesta-php > /dev/null 2>&1 -rm -rf /usr/local/vesta > /dev/null 2>&1 +rm -rf $VESTA > /dev/null 2>&1 #----------------------------------------------------------# @@ -644,10 +645,10 @@ wget $vestacp/sudo/admin -O /etc/sudoers.d/admin chmod 440 /etc/sudoers.d/admin # Configuring system env -echo "export VESTA='/usr/local/vesta'" > /etc/profile.d/vesta.sh +echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh chmod 755 /etc/profile.d/vesta.sh source /etc/profile.d/vesta.sh -echo 'PATH=$PATH:/usr/local/vesta/bin' >> /root/.bash_profile +echo 'PATH=$PATH:'$VESTA'/bin' >> /root/.bash_profile echo 'export PATH' >> /root/.bash_profile source /root/.bash_profile @@ -666,7 +667,7 @@ chmod 750 $VESTA/conf $VESTA/data/users $VESTA/data/ips $VESTA/log chmod -R 750 $VESTA/data/queue chmod 660 $VESTA/log/* rm -f /var/log/vesta -ln -s /usr/local/vesta/log /var/log/vesta +ln -s $VESTA/log /var/log/vesta chown admin:admin $VESTA/data/sessions chmod 770 $VESTA/data/sessions @@ -1160,19 +1161,19 @@ $VESTA/bin/v-add-domain admin $servername check_result $? "can't create $servername domain" # Adding cron jobs -command='sudo /usr/local/vesta/bin/v-update-sys-queue disk' +command="sudo $VESTA/bin/v-update-sys-queue disk" $VESTA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue traffic' +command="sudo $VESTA/bin/v-update-sys-queue traffic" $VESTA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue webstats' +command="sudo $VESTA/bin/v-update-sys-queue webstats" $VESTA/bin/v-add-cron-job 'admin' '30' '03' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue backup' +command="sudo $VESTA/bin/v-update-sys-queue backup" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-backup-users' +command="sudo $VESTA/bin/v-backup-users" $VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-user-stats' +command="sudo $VESTA/bin/v-update-user-stats" $VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-rrd' +command="sudo $VESTA/bin/v-update-sys-rrd" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" service cron restart diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index 37616e60..02dc49ad 100755 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -10,6 +10,7 @@ RHOST='r.vestacp.com' CHOST='c.vestacp.com' REPO='cmmnt' VERSION='rhel' +VESTA='/usr/local/vesta' memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9]) arch=$(uname -i) os=$(cut -f 1 -d ' ' /etc/redhat-release) @@ -527,8 +528,8 @@ mv /var/lib/pgsql/data $vst_backups/postgresql/ >/dev/null 2>&1 # Backing up Vesta configuration and data service vesta stop > /dev/null 2>&1 -mv /usr/local/vesta/data/* $vst_backups/vesta > /dev/null 2>&1 -mv /usr/local/vesta/conf/* $vst_backups/vesta > /dev/null 2>&1 +mv $VESTA/data/* $vst_backups/vesta > /dev/null 2>&1 +mv $VESTA/conf/* $vst_backups/vesta > /dev/null 2>&1 #----------------------------------------------------------# @@ -677,10 +678,10 @@ wget $vestacp/sudo/admin -O /etc/sudoers.d/admin chmod 440 /etc/sudoers.d/admin # Configuring system env -echo "export VESTA='/usr/local/vesta'" > /etc/profile.d/vesta.sh +echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh chmod 755 /etc/profile.d/vesta.sh source /etc/profile.d/vesta.sh -echo 'PATH=$PATH:/usr/local/vesta/bin' >> /root/.bash_profile +echo 'PATH=$PATH:'$VESTA'/bin' >> /root/.bash_profile echo 'export PATH' >> /root/.bash_profile source /root/.bash_profile @@ -699,7 +700,7 @@ chmod 750 $VESTA/conf $VESTA/data/users $VESTA/data/ips $VESTA/log chmod -R 750 $VESTA/data/queue chmod 660 $VESTA/log/* rm -f /var/log/vesta -ln -s /usr/local/vesta/log /var/log/vesta +ln -s $VESTA/log /var/log/vesta chown admin:admin $VESTA/data/sessions chmod 770 $VESTA/data/sessions @@ -1229,22 +1230,21 @@ fi $VESTA/bin/v-add-domain admin $servername check_result $? "can't create $servername domain" -# Adding cron jobs -command='sudo /usr/local/vesta/bin/v-update-sys-queue disk' +command="sudo $VESTA/bin/v-update-sys-queue disk" $VESTA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue traffic' +command="sudo $VESTA/bin/v-update-sys-queue traffic" $VESTA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue webstats' +command="sudo $VESTA/bin/v-update-sys-queue webstats" $VESTA/bin/v-add-cron-job 'admin' '30' '03' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue backup' +command="sudo $VESTA/bin/v-update-sys-queue backup" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-backup-users' +command="sudo $VESTA/bin/v-backup-users" $VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-user-stats' +command="sudo $VESTA/bin/v-update-user-stats" $VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-rrd' +command="sudo $VESTA/bin/v-update-sys-rrd" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" -service crond restart +service cron restart # Building inititall rrd images $VESTA/bin/v-update-sys-rrd diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index d71a4edc..5f3bd558 100755 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -10,6 +10,7 @@ export DEBIAN_FRONTEND=noninteractive RHOST='apt.vestacp.com' CHOST='c.vestacp.com' VERSION='ubuntu' +VESTA='/usr/local/vesta' memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9]) arch=$(uname -i) os='ubuntu' @@ -491,10 +492,10 @@ mv -f /root/.my.cnf $vst_backups/mysql > /dev/null 2>&1 # Backup vesta service vesta stop > /dev/null 2>&1 -cp -r /usr/local/vesta/* $vst_backups/vesta > /dev/null 2>&1 +cp -r $VESTA/* $vst_backups/vesta > /dev/null 2>&1 apt-get -y remove vesta vesta-nginx vesta-php > /dev/null 2>&1 apt-get -y purge vesta vesta-nginx vesta-php > /dev/null 2>&1 -rm -rf /usr/local/vesta > /dev/null 2>&1 +rm -rf $VESTA > /dev/null 2>&1 #----------------------------------------------------------# @@ -636,10 +637,10 @@ wget $vestacp/sudo/admin -O /etc/sudoers.d/admin chmod 440 /etc/sudoers.d/admin # Configuring system env -echo "export VESTA='/usr/local/vesta'" > /etc/profile.d/vesta.sh +echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh chmod 755 /etc/profile.d/vesta.sh source /etc/profile.d/vesta.sh -echo 'PATH=$PATH:/usr/local/vesta/bin' >> /root/.bash_profile +echo 'PATH=$PATH:'$VESTA'/bin' >> /root/.bash_profile echo 'export PATH' >> /root/.bash_profile source /root/.bash_profile @@ -658,7 +659,7 @@ chmod 750 $VESTA/conf $VESTA/data/users $VESTA/data/ips $VESTA/log chmod -R 750 $VESTA/data/queue chmod 660 $VESTA/log/* rm -f /var/log/vesta -ln -s /usr/local/vesta/log /var/log/vesta +ln -s $VESTA/log /var/log/vesta chown admin:admin $VESTA/data/sessions chmod 770 $VESTA/data/sessions @@ -1149,19 +1150,19 @@ $VESTA/bin/v-add-domain admin $servername check_result $? "can't create $servername domain" # Adding cron jobs -command='sudo /usr/local/vesta/bin/v-update-sys-queue disk' +command="sudo $VESTA/bin/v-update-sys-queue disk" $VESTA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue traffic' +command="sudo $VESTA/bin/v-update-sys-queue traffic" $VESTA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue webstats' +command="sudo $VESTA/bin/v-update-sys-queue webstats" $VESTA/bin/v-add-cron-job 'admin' '30' '03' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue backup' +command="sudo $VESTA/bin/v-update-sys-queue backup" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-backup-users' +command="sudo $VESTA/bin/v-backup-users" $VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-user-stats' +command="sudo $VESTA/bin/v-update-user-stats" $VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-rrd' +command="sudo $VESTA/bin/v-update-sys-rrd" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" service cron restart From 9ada699ddf95a4cafe8d8f0c060e4a6a98b6d171 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 31 Jul 2016 04:13:17 -0400 Subject: [PATCH 15/23] *Copy/paste fail --- install/vst-install-rhel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index 02dc49ad..0e0ee455 100755 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -1244,7 +1244,7 @@ command="sudo $VESTA/bin/v-update-user-stats" $VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" command="sudo $VESTA/bin/v-update-sys-rrd" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" -service cron restart +service crond restart # Building inititall rrd images $VESTA/bin/v-update-sys-rrd From db9be6d2446e7363d19985262b66c6d36f574f37 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 13 Aug 2016 17:19:55 -0400 Subject: [PATCH 16/23] *Strip double quotes and only add back if value has spaces or semicolon --- bin/v-add-dns-record | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/v-add-dns-record b/bin/v-add-dns-record index 113874d3..08f7be57 100755 --- a/bin/v-add-dns-record +++ b/bin/v-add-dns-record @@ -49,6 +49,12 @@ if [[ $rtype =~ NS|CNAME|MX|PTR|SRV ]]; then fi fi +dvalue=${dvalue//\"/} + +if [[ "dvalue" =~ [^\;\s] ]]; then + dvalue='"'"$dvalue"'"' +fi + #----------------------------------------------------------# # Verifications # From 5fd052ee07369490c9486163d8e73026e7295722 Mon Sep 17 00:00:00 2001 From: onbalt Date: Fri, 19 Aug 2016 18:25:15 +0300 Subject: [PATCH 17/23] Wrong variable in v-change-web-domain-backend-tpl Change variable $backend to $backend_type in v-change-web-domain-backend-tpl --- bin/v-change-web-domain-backend-tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/v-change-web-domain-backend-tpl b/bin/v-change-web-domain-backend-tpl index 40b11df1..67044d6d 100755 --- a/bin/v-change-web-domain-backend-tpl +++ b/bin/v-change-web-domain-backend-tpl @@ -45,7 +45,7 @@ is_backend_template_valid $template prepare_web_backend # Deleting backend -rm -f $pool/$backend.conf +rm -f $pool/$backend_type.conf # Allocating backend port backend_port=9000 @@ -63,10 +63,10 @@ cat $WEBTPL/$WEB_BACKEND/$template.tpl |\ -e "s|%user%|$user|"\ -e "s|%domain%|$domain|"\ -e "s|%domain_idn%|$domain_idn|"\ - -e "s|%backend%|$backend|g" > $pool/$backend.conf + -e "s|%backend%|$backend_type|g" > $pool/$backend_type.conf # Checking backend pool configuration -if [ "$backend" = "$user" ]; then +if [ "$backend_type" = "$user" ]; then conf=$USER_DATA/web.conf fields='$DOMAIN' nohead=1 From b3ccb9c9d9d94276568229d2a0dabbdaecdb16db Mon Sep 17 00:00:00 2001 From: onbalt Date: Sat, 20 Aug 2016 00:10:14 +0300 Subject: [PATCH 18/23] Update v-change-web-domain-tpl --- bin/v-change-web-domain-tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/v-change-web-domain-tpl b/bin/v-change-web-domain-tpl index 3366c313..93635230 100755 --- a/bin/v-change-web-domain-tpl +++ b/bin/v-change-web-domain-tpl @@ -54,9 +54,9 @@ fi # Defining variables for new vhost config prepare_web_domain_values -add_web_config "$WEB_SYSTEM" "$TPL.tpl" +add_web_config "$WEB_SYSTEM" "$template.tpl" if [ "$SSL" = 'yes' ]; then - add_web_config "$WEB_SYSTEM" "$TPL.stpl" + add_web_config "$WEB_SYSTEM" "$template.stpl" fi From fdd35376f10dd208731bcd4e427ff2450ad07025 Mon Sep 17 00:00:00 2001 From: core01 Date: Wed, 24 Aug 2016 21:21:21 +0300 Subject: [PATCH 19/23] Fixing incorrect load of image, css and js when using HTTPS --- install/debian/7/nginx/phpmyadmin.inc | 3 +++ install/debian/8/nginx/phpmyadmin.inc | 3 +++ install/rhel/5/nginx/phpmyadmin.inc | 4 ++++ install/rhel/6/nginx/phpmyadmin.inc | 3 +++ install/rhel/7/nginx/phpmyadmin.inc | 3 +++ install/ubuntu/12.04/nginx/phpmyadmin.inc | 3 +++ install/ubuntu/12.10/nginx/phpmyadmin.inc | 3 +++ install/ubuntu/13.04/nginx/phpmyadmin.inc | 3 +++ install/ubuntu/13.10/nginx/phpmyadmin.inc | 3 +++ install/ubuntu/14.04/nginx/phpmyadmin.inc | 3 +++ install/ubuntu/14.10/nginx/phpmyadmin.inc | 3 +++ install/ubuntu/15.04/nginx/phpmyadmin.inc | 3 +++ install/ubuntu/15.10/nginx/phpmyadmin.inc | 3 +++ 13 files changed, 40 insertions(+) diff --git a/install/debian/7/nginx/phpmyadmin.inc b/install/debian/7/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/debian/7/nginx/phpmyadmin.inc +++ b/install/debian/7/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/debian/8/nginx/phpmyadmin.inc b/install/debian/8/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/debian/8/nginx/phpmyadmin.inc +++ b/install/debian/8/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/rhel/5/nginx/phpmyadmin.inc b/install/rhel/5/nginx/phpmyadmin.inc index 09da5207..efd6f4c4 100644 --- a/install/rhel/5/nginx/phpmyadmin.inc +++ b/install/rhel/5/nginx/phpmyadmin.inc @@ -12,4 +12,8 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } + } diff --git a/install/rhel/6/nginx/phpmyadmin.inc b/install/rhel/6/nginx/phpmyadmin.inc index 09da5207..9c5a6882 100644 --- a/install/rhel/6/nginx/phpmyadmin.inc +++ b/install/rhel/6/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/rhel/7/nginx/phpmyadmin.inc b/install/rhel/7/nginx/phpmyadmin.inc index 09da5207..9c5a6882 100644 --- a/install/rhel/7/nginx/phpmyadmin.inc +++ b/install/rhel/7/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/12.04/nginx/phpmyadmin.inc b/install/ubuntu/12.04/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/12.04/nginx/phpmyadmin.inc +++ b/install/ubuntu/12.04/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/12.10/nginx/phpmyadmin.inc b/install/ubuntu/12.10/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/12.10/nginx/phpmyadmin.inc +++ b/install/ubuntu/12.10/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/13.04/nginx/phpmyadmin.inc b/install/ubuntu/13.04/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/13.04/nginx/phpmyadmin.inc +++ b/install/ubuntu/13.04/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/13.10/nginx/phpmyadmin.inc b/install/ubuntu/13.10/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/13.10/nginx/phpmyadmin.inc +++ b/install/ubuntu/13.10/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/14.04/nginx/phpmyadmin.inc b/install/ubuntu/14.04/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/14.04/nginx/phpmyadmin.inc +++ b/install/ubuntu/14.04/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/14.10/nginx/phpmyadmin.inc b/install/ubuntu/14.10/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/14.10/nginx/phpmyadmin.inc +++ b/install/ubuntu/14.10/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/15.04/nginx/phpmyadmin.inc b/install/ubuntu/15.04/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/15.04/nginx/phpmyadmin.inc +++ b/install/ubuntu/15.04/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/15.10/nginx/phpmyadmin.inc b/install/ubuntu/15.10/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/15.10/nginx/phpmyadmin.inc +++ b/install/ubuntu/15.10/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } From 4bc53a11429ec4872159a0ba76a0b5fd02c501ee Mon Sep 17 00:00:00 2001 From: Dmitry Bannik Date: Thu, 25 Aug 2016 02:33:19 +0300 Subject: [PATCH 20/23] Added default install "expect" to work for backup sftp --- install/vst-install-debian.sh | 4 ++-- install/vst-install-rhel.sh | 4 ++-- install/vst-install-ubuntu.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 5dfb084f..5507fd4e 100755 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -28,7 +28,7 @@ if [ "$release" -eq 8 ]; then mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils - bsdmainutils cron vesta vesta-nginx vesta-php" + bsdmainutils cron vesta vesta-nginx vesta-php expect" else software="nginx apache2 apache2-utils apache2.2-common apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf @@ -40,7 +40,7 @@ else mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils - bsdmainutils cron vesta vesta-nginx vesta-php" + bsdmainutils cron vesta vesta-nginx vesta-php expect" fi # Defining help function diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index db1903b2..33df4897 100755 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -26,7 +26,7 @@ if [ "$release" -eq 7 ]; then postgresql postgresql-server postgresql-contrib phpPgAdmin e2fsprogs openssh-clients ImageMagick curl mc screen ftp zip unzip flex sqlite pcre sudo bc jwhois mailx lsof tar telnet rrdtool net-tools ntp GeoIP freetype - fail2ban rsyslog iptables-services which vesta vesta-nginx vesta-php" + fail2ban rsyslog iptables-services which vesta vesta-nginx vesta-php expect" else software="nginx httpd mod_ssl mod_ruid2 mod_fcgid mod_extract_forwarded php php-common php-cli php-bcmath php-gd php-imap php-mbstring php-mcrypt @@ -36,7 +36,7 @@ else postgresql-server postgresql-contrib phpPgAdmin e2fsprogs openssh-clients ImageMagick curl mc screen ftp zip unzip flex sqlite pcre sudo bc jwhois mailx lsof tar telnet rrdtool net-tools ntp GeoIP freetype fail2ban - which vesta vesta-nginx vesta-php" + which vesta vesta-nginx vesta-php expect" fi # Defining help function diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index d71a4edc..401737c9 100755 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -26,7 +26,7 @@ software="nginx apache2 apache2-utils apache2.2-common mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils - bsdmainutils cron vesta vesta-nginx vesta-php" + bsdmainutils cron vesta vesta-nginx vesta-php expect" # Defining help function help() { From f1c46e9ab8baede4ecbf9d2efc8179b38560fbe9 Mon Sep 17 00:00:00 2001 From: Dmitry Bannik Date: Thu, 25 Aug 2016 02:48:13 +0300 Subject: [PATCH 21/23] fix charset russian language to send mail --- func/main.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/func/main.sh b/func/main.sh index b1503d6c..5f6d7fea 100644 --- a/func/main.sh +++ b/func/main.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Internal variables HOMEDIR='/home' BACKUP='/backup' @@ -448,6 +449,7 @@ sync_cron_jobs() { rm -f $crontab if [ "$CRON_REPORTS" = 'yes' ]; then echo "MAILTO=$CONTACT" > $crontab + echo 'CONTENT_TYPE="text/plain; charset=utf-8"' >> $crontab fi while read line; do eval $line From 33d795c60833995468c842e50ef7555221bdb7fa Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 29 Aug 2016 12:15:46 -0400 Subject: [PATCH 22/23] *Bugfix regex and variable --- bin/v-add-dns-record | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-add-dns-record b/bin/v-add-dns-record index 08f7be57..b785973c 100755 --- a/bin/v-add-dns-record +++ b/bin/v-add-dns-record @@ -51,7 +51,7 @@ fi dvalue=${dvalue//\"/} -if [[ "dvalue" =~ [^\;\s] ]]; then +if [[ "$dvalue" =~ [\;[:space:]] ]]; then dvalue='"'"$dvalue"'"' fi From cd2eed6fd3292dc7a94098d3d9cf336ba65f1ee0 Mon Sep 17 00:00:00 2001 From: Tjebbe Lievens Date: Mon, 29 Aug 2016 20:15:34 +0200 Subject: [PATCH 23/23] use [:alnum:] in regex --- func/main.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/func/main.sh b/func/main.sh index 920dd81c..dedd5a00 100644 --- a/func/main.sh +++ b/func/main.sh @@ -612,7 +612,7 @@ is_dns_record_format_valid() { # Email format validator is_email_format_valid() { - if [[ ! "$1" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,63}$ ]] ; then + if [[ ! "$1" =~ ^[A-Za-z0-9._%+-]+@[[:alnum:].-]+\.[A-Za-z]{2,63}$ ]] ; then check_result $E_INVALID "invalid email format :: $1" fi }