From a44e1d59ce0124f6dd0267ec83cf6004df6718e1 Mon Sep 17 00:00:00 2001 From: Jason Hanes Date: Mon, 28 Apr 2014 23:54:26 -0700 Subject: [PATCH 01/49] Fixed spelling typo in 50x skel templates. --- install/debian/templates/web/skel/document_errors/50x.html | 2 +- install/rhel/templates/web/skel/document_errors/50x.html | 2 +- install/ubuntu/templates/web/skel/document_errors/50x.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install/debian/templates/web/skel/document_errors/50x.html b/install/debian/templates/web/skel/document_errors/50x.html index 85ba648b7..7d1f6a261 100755 --- a/install/debian/templates/web/skel/document_errors/50x.html +++ b/install/debian/templates/web/skel/document_errors/50x.html @@ -1,6 +1,6 @@ - 500 — Internal Sever Error + 500 — Internal Server Error -

%domain%

-

500

Internal Server Error

- Sorry, something went wrong :( + Something went wrong. Please try your request again.
- diff --git a/install/rhel/templates/web/skel/document_errors/50x.html b/install/rhel/templates/web/skel/document_errors/50x.html index 7d1f6a261..867414004 100755 --- a/install/rhel/templates/web/skel/document_errors/50x.html +++ b/install/rhel/templates/web/skel/document_errors/50x.html @@ -7,23 +7,20 @@ body {font-size:14px; color:#777777; font-family:arial; text-align:center;} h1 {font-size:180px; color:#99A7AF; margin: 70px 0 0 0;} h2 {color: #DE6C5D; font-family: arial; font-size: 20px; font-weight: bold; letter-spacing: -1px; margin: -3px 0 39px;} - p {width:320px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } - div {width:320px; text-align:center; margin-left:auto;margin-right:auto;} + p {width:375px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } + div {width:375px; text-align:center; margin-left:auto;margin-right:auto;} a:link {color: #34536A;} a:visited {color: #34536A;} a:active {color: #34536A;} a:hover {color: #34536A;} -

%domain%

-

500

Internal Server Error

- Sorry, something went wrong :( + Something went wrong. Please try your request again.
- diff --git a/install/ubuntu/templates/web/skel/document_errors/50x.html b/install/ubuntu/templates/web/skel/document_errors/50x.html index 7d1f6a261..867414004 100755 --- a/install/ubuntu/templates/web/skel/document_errors/50x.html +++ b/install/ubuntu/templates/web/skel/document_errors/50x.html @@ -7,23 +7,20 @@ body {font-size:14px; color:#777777; font-family:arial; text-align:center;} h1 {font-size:180px; color:#99A7AF; margin: 70px 0 0 0;} h2 {color: #DE6C5D; font-family: arial; font-size: 20px; font-weight: bold; letter-spacing: -1px; margin: -3px 0 39px;} - p {width:320px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } - div {width:320px; text-align:center; margin-left:auto;margin-right:auto;} + p {width:375px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } + div {width:375px; text-align:center; margin-left:auto;margin-right:auto;} a:link {color: #34536A;} a:visited {color: #34536A;} a:active {color: #34536A;} a:hover {color: #34536A;} -

%domain%

-

500

Internal Server Error

- Sorry, something went wrong :( + Something went wrong. Please try your request again.
- From 560889139df449b6ad608f5e988cba919773021e Mon Sep 17 00:00:00 2001 From: Jason Hanes Date: Tue, 29 Apr 2014 00:20:48 -0700 Subject: [PATCH 03/49] 404 error page template updates. General markup cleanup and updates to error text for better readability. --- .../templates/web/skel/document_errors/404.html | 11 +++++------ .../rhel/templates/web/skel/document_errors/404.html | 11 +++++------ .../templates/web/skel/document_errors/404.html | 11 +++++------ 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/install/debian/templates/web/skel/document_errors/404.html b/install/debian/templates/web/skel/document_errors/404.html index 2cee77084..0baafafa9 100755 --- a/install/debian/templates/web/skel/document_errors/404.html +++ b/install/debian/templates/web/skel/document_errors/404.html @@ -1,28 +1,27 @@ - 404 — Not Found + 404 — Page Not Found -

%domain%

404

Page Not Found

- It seems that the page you were trying to reach does not exist anymore, or maybe it has just moved. - You can start again from the home or go back to previous page. + The page you were trying to reach does not exist. Or, maybe it has moved. + You can start again from home or go back to the previous page.
diff --git a/install/rhel/templates/web/skel/document_errors/404.html b/install/rhel/templates/web/skel/document_errors/404.html index 2cee77084..0baafafa9 100755 --- a/install/rhel/templates/web/skel/document_errors/404.html +++ b/install/rhel/templates/web/skel/document_errors/404.html @@ -1,28 +1,27 @@ - 404 — Not Found + 404 — Page Not Found -

%domain%

404

Page Not Found

- It seems that the page you were trying to reach does not exist anymore, or maybe it has just moved. - You can start again from the home or go back to previous page. + The page you were trying to reach does not exist. Or, maybe it has moved. + You can start again from home or go back to the previous page.
diff --git a/install/ubuntu/templates/web/skel/document_errors/404.html b/install/ubuntu/templates/web/skel/document_errors/404.html index 2cee77084..0baafafa9 100755 --- a/install/ubuntu/templates/web/skel/document_errors/404.html +++ b/install/ubuntu/templates/web/skel/document_errors/404.html @@ -1,28 +1,27 @@ - 404 — Not Found + 404 — Page Not Found -

%domain%

404

Page Not Found

- It seems that the page you were trying to reach does not exist anymore, or maybe it has just moved. - You can start again from the home or go back to previous page. + The page you were trying to reach does not exist. Or, maybe it has moved. + You can start again from home or go back to the previous page.
From 879547a8b3635c78e9f1306c6472dfdbf2dc7014 Mon Sep 17 00:00:00 2001 From: Jason Hanes Date: Tue, 29 Apr 2014 00:20:56 -0700 Subject: [PATCH 04/49] 403 error page template updates. General markup cleanup and updates to error text for better readability. --- .../debian/templates/web/skel/document_errors/403.html | 9 +++------ install/rhel/templates/web/skel/document_errors/403.html | 9 +++------ .../ubuntu/templates/web/skel/document_errors/403.html | 9 +++------ 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/install/debian/templates/web/skel/document_errors/403.html b/install/debian/templates/web/skel/document_errors/403.html index 9c3f6baab..795ba1edb 100755 --- a/install/debian/templates/web/skel/document_errors/403.html +++ b/install/debian/templates/web/skel/document_errors/403.html @@ -7,23 +7,20 @@ body {font-size:14px; color:#777777; font-family:arial; text-align:center;} h1 {font-size:180px; color:#99A7AF; margin: 70px 0 0 0;} h2 {color: #DE6C5D; font-family: arial; font-size: 20px; font-weight: bold; letter-spacing: -1px; margin: -3px 0 39px;} - p {width:320px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } - div {width:320px; text-align:center; margin-left:auto;margin-right:auto;} + p {width:375px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } + div {width:375px; text-align:center; margin-left:auto;margin-right:auto;} a:link {color: #34536A;} a:visited {color: #34536A;} a:active {color: #34536A;} a:hover {color: #34536A;} -

%domain%

-

403

Forbidden

- Unfortunately, you do not have permission to view this + You do not have permission to view this page.
- diff --git a/install/rhel/templates/web/skel/document_errors/403.html b/install/rhel/templates/web/skel/document_errors/403.html index 9c3f6baab..795ba1edb 100755 --- a/install/rhel/templates/web/skel/document_errors/403.html +++ b/install/rhel/templates/web/skel/document_errors/403.html @@ -7,23 +7,20 @@ body {font-size:14px; color:#777777; font-family:arial; text-align:center;} h1 {font-size:180px; color:#99A7AF; margin: 70px 0 0 0;} h2 {color: #DE6C5D; font-family: arial; font-size: 20px; font-weight: bold; letter-spacing: -1px; margin: -3px 0 39px;} - p {width:320px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } - div {width:320px; text-align:center; margin-left:auto;margin-right:auto;} + p {width:375px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } + div {width:375px; text-align:center; margin-left:auto;margin-right:auto;} a:link {color: #34536A;} a:visited {color: #34536A;} a:active {color: #34536A;} a:hover {color: #34536A;} -

%domain%

-

403

Forbidden

- Unfortunately, you do not have permission to view this + You do not have permission to view this page.
- diff --git a/install/ubuntu/templates/web/skel/document_errors/403.html b/install/ubuntu/templates/web/skel/document_errors/403.html index 9c3f6baab..795ba1edb 100755 --- a/install/ubuntu/templates/web/skel/document_errors/403.html +++ b/install/ubuntu/templates/web/skel/document_errors/403.html @@ -7,23 +7,20 @@ body {font-size:14px; color:#777777; font-family:arial; text-align:center;} h1 {font-size:180px; color:#99A7AF; margin: 70px 0 0 0;} h2 {color: #DE6C5D; font-family: arial; font-size: 20px; font-weight: bold; letter-spacing: -1px; margin: -3px 0 39px;} - p {width:320px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } - div {width:320px; text-align:center; margin-left:auto;margin-right:auto;} + p {width:375px; text-align:center; margin-left:auto;margin-right:auto; margin-top: 30px } + div {width:375px; text-align:center; margin-left:auto;margin-right:auto;} a:link {color: #34536A;} a:visited {color: #34536A;} a:active {color: #34536A;} a:hover {color: #34536A;} -

%domain%

-

403

Forbidden

- Unfortunately, you do not have permission to view this + You do not have permission to view this page.
- From 8668fbc7cc2732aa2105eb9c602da3d0c4dfe745 Mon Sep 17 00:00:00 2001 From: Jason Hanes Date: Tue, 29 Apr 2014 00:28:21 -0700 Subject: [PATCH 05/49] Update 50x meta desc. to be consistent with page title. --- install/debian/templates/web/skel/document_errors/50x.html | 2 +- install/rhel/templates/web/skel/document_errors/50x.html | 2 +- install/ubuntu/templates/web/skel/document_errors/50x.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install/debian/templates/web/skel/document_errors/50x.html b/install/debian/templates/web/skel/document_errors/50x.html index 867414004..a922a4cbf 100755 --- a/install/debian/templates/web/skel/document_errors/50x.html +++ b/install/debian/templates/web/skel/document_errors/50x.html @@ -2,7 +2,7 @@ 500 — Internal Server Error - + - -

SUSPEND

-

This site has been suspended

+

SUSPENDED

+

This website has been suspended.

- Please contact technical support departament. + Please contact the technical support department.
- diff --git a/install/rhel/templates/web/suspend/index.html b/install/rhel/templates/web/suspend/index.html index 9d4fa67b3..f2d04e1f0 100755 --- a/install/rhel/templates/web/suspend/index.html +++ b/install/rhel/templates/web/suspend/index.html @@ -1,12 +1,12 @@ - SUSPEND + Website Suspended - + - -

SUSPEND

-

This site has been suspended

+

SUSPENDED

+

This website has been suspended.

- Please contact technical support departament. + Please contact the technical support department.
- diff --git a/install/ubuntu/templates/web/suspend/index.html b/install/ubuntu/templates/web/suspend/index.html index 9d4fa67b3..f2d04e1f0 100755 --- a/install/ubuntu/templates/web/suspend/index.html +++ b/install/ubuntu/templates/web/suspend/index.html @@ -1,12 +1,12 @@ - SUSPEND + Website Suspended - + - -

SUSPEND

-

This site has been suspended

+

SUSPENDED

+

This website has been suspended.

- Please contact technical support departament. + Please contact the technical support department.
- From c42ad3712043dd0cba178f153414469e175d90b5 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 18 May 2014 20:29:27 +0300 Subject: [PATCH 09/49] release number incriment --- src/rpm/specs/vesta.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpm/specs/vesta.spec b/src/rpm/specs/vesta.spec index 1991ecb60..c503c316f 100644 --- a/src/rpm/specs/vesta.spec +++ b/src/rpm/specs/vesta.spec @@ -1,6 +1,6 @@ Name: vesta Version: 0.9.8 -Release: 8 +Release: 9 Summary: Vesta Control Panel Group: System Environment/Base License: GPL From 9409af3bd0aac45c5f4992550bc22f7beb27319b Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 20 May 2014 13:26:32 +0300 Subject: [PATCH 10/49] converted init.d to service cmd --- bin/v-restart-ftp | 2 +- bin/v-restart-mail | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/v-restart-ftp b/bin/v-restart-ftp index ad28339e2..611672797 100755 --- a/bin/v-restart-ftp +++ b/bin/v-restart-ftp @@ -45,7 +45,7 @@ if [ -z "$FTP_SYSTEM" ] || [ "$FTP_SYSTEM" = 'remote' ]; then fi # Restart system -/etc/init.d/$FTP_SYSTEM restart >/dev/null 2>&1 +service $FTP_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then send_email_report echo "Error: $FTP_SYSTEM restart failed" diff --git a/bin/v-restart-mail b/bin/v-restart-mail index 717752624..325f0f0f8 100755 --- a/bin/v-restart-mail +++ b/bin/v-restart-mail @@ -45,7 +45,7 @@ if [ -z "$MAIL_SYSTEM" ] || [ "$MAIL_SYSTEM" = 'remote' ]; then fi # Restart system -/etc/init.d/$MAIL_SYSTEM restart >/dev/null 2>&1 +service $MAIL_SYSTEM restart >/dev/null 2>&1 if [ $? -ne 0 ]; then send_email_report echo "Error: $MAIL_SYSTEM restart failed" From 4836872eab91adf63d51692dd00e41d7991928cf Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 21 May 2014 00:31:24 +0300 Subject: [PATCH 11/49] fix vesta ssl permissions --- src/rpm/specs/vesta.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpm/specs/vesta.spec b/src/rpm/specs/vesta.spec index c503c316f..14dd029d8 100644 --- a/src/rpm/specs/vesta.spec +++ b/src/rpm/specs/vesta.spec @@ -40,7 +40,7 @@ if [ $1 -ge 2 ]; then if [ -e /usr/local/vesta/upd/add_fwd_only.sh ]; then /usr/local/vesta/upd/add_fwd_only.sh fi - if [ -e /usr/local/vesta/fix_vesta_ssl_permissions.sh ]; then + if [ -e /usr/local/vesta/upd/fix_vesta_ssl_permissions.sh ]; then /usr/local/vesta/upd/fix_vesta_ssl_permissions.sh fi fi From 451de9de96521446205bc4cd9fd153f6dbe7afd2 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 25 May 2014 14:14:31 +0300 Subject: [PATCH 12/49] New installer --- install/vst-install-rhel.sh | 212 ++++++++++++++++++++++-------------- 1 file changed, 131 insertions(+), 81 deletions(-) diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index 098115969..19a95b4a0 100644 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Vesta RHEL/CentOS installer v.03 +# Vesta RHEL/CentOS installer v.04 #----------------------------------------------------------# # Variables&Functions # @@ -13,20 +13,26 @@ VERSION='0.9.8/rhel' YUM_REPO='/etc/yum.repos.d/vesta.repo' software="nginx httpd mod_ssl mod_ruid2 mod_extract_forwarded mod_fcgid php php-bcmath php-cli php-common php-gd php-imap php-mbstring php-mcrypt - php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc + php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc quota e2fsprogs phpMyAdmin awstats webalizer vsftpd mysql mysql-server exim dovecot clamd spamassassin curl roundcubemail bind bind-utils bind-libs mc screen ftp libpng libjpeg libmcrypt mhash zip unzip openssl flex rssh libxml2 ImageMagick sqlite pcre sudo bc jwhois mailx lsof tar telnet rsync rrdtool GeoIP freetype ntp openssh-clients vesta vesta-nginx vesta-php" +# Help help() { echo "usage: $0 [OPTIONS] - -d, --disable-remi Disable remi - -e, --email Define email address - -h, --help Print this help and exit + -d, --disable-remi Disable remi repository + -e, --email Set email address -f, --force Force installation - -n, --noupdate Do not run yum update command" + -h, --help Print this help and exit + -n, --noupdate Do not run yum update command + -m, --mysql-password Set MySQL password instead of generating it + -p, --password Set admin password instead of generating it + -s, --hostname Set server hostname + -q, --quota Enable File System Quota" + exit 1 } @@ -50,11 +56,15 @@ gen_pass() { for arg; do delim="" case "$arg" in - --help) args="${args}-h " ;; - --disable-remi) args="${args}-d " ;; - --force) args="${args}-f " ;; - --email) args="${args}-e " ;; - --noupdate) args="${args}-n " ;; + --disable-remi) args="${args}-d " ;; + --email) args="${args}-e " ;; + --force) args="${args}-f " ;; + --help) args="${args}-h " ;; + --noupdate) args="${args}-n " ;; + --mysql-password) args="${args}-m " ;; + --password) args="${args}-p " ;; + --hostname) args="${args}-s " ;; + --quota) args="${args}-q " ;; *) [[ "${arg:0:1}" == "-" ]] || delim="\"" args="${args}${delim}${arg}${delim} ";; esac @@ -62,13 +72,17 @@ done eval set -- "$args" # Getopt -while getopts "dhfne:" Option; do +while getopts "dhfnqe:m:p:s:" Option; do case $Option in d) disable_remi='yes' ;; # Disable remi repo h) help ;; # Help e) email=$OPTARG ;; # Set email f) force='yes' ;; # Force install n) noupdate='yes' ;; # Disable yum update + m) mpass=$OPTARG ;; # MySQL pasword + p) vpass=$OPTARG ;; # Admin password + s) servername=$OPTARG ;; # Server hostname + q) quota='yes' ;; # Enable quota *) help ;; # Default esac done @@ -212,8 +226,16 @@ if [ -z $email ]; then exit 1 fi - # Check email + # Define email read -p 'Please enter valid email address: ' email + + # Define server hostname + if [ -z "$servername" ]; then + read -p "Please enter hostname [$(hostname)]: " servername + fi + if [ -z "$servername" ]; then + servername=$(hostname) + fi fi # Validate email @@ -459,6 +481,84 @@ if [ -e '/etc/selinux/config' ]; then setenforce 0 fi +# Vesta configuration +echo "export VESTA='/usr/local/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 'export PATH' >> /root/.bash_profile +source /root/.bash_profile +wget $CHOST/$VERSION/vesta.log -O /etc/logrotate.d/vesta + +# Directory tree +mkdir -p $VESTA/conf +mkdir -p $VESTA/log +mkdir -p $VESTA/ssl +mkdir -p $VESTA/data +mkdir -p $VESTA/data/ips +mkdir -p $VESTA/data/queue +mkdir -p $VESTA/data/users +touch $VESTA/data/queue/backup.pipe +touch $VESTA/data/queue/disk.pipe +touch $VESTA/data/queue/webstats.pipe +touch $VESTA/data/queue/restart.pipe +touch $VESTA/data/queue/traffic.pipe +chmod 750 $VESTA/conf +chmod 750 $VESTA/data/users +chmod 750 $VESTA/data/ips +chmod -R 750 $VESTA/data/queue +ln -s /usr/local/vesta/log /var/log/vesta +touch /var/log/vesta/system.log +touch /var/log/vesta/nginx-error.log +touch /var/log/vesta/auth.log +chmod 660 /var/log/vesta/* +adduser backup +ln -s /home/backup /backup +chmod a+x /backup + +# vesta.conf +wget $CHOST/$VERSION/vesta.conf -O $VESTA/conf/vesta.conf +if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then + sed -i "s/clamav//g" $VESTA/conf/vesta.conf + sed -i "s/spamassassin//g" $VESTA/conf/vesta.conf +fi + +# Set server hostname +/usr/local/vesta/bin/v-change-sys-hostname $servername 2>/dev/null + +# Templates +cd /usr/local/vesta/data +wget $CHOST/$VERSION/packages.tar.gz -O packages.tar.gz +tar -xzf packages.tar.gz +rm -f packages.tar.gz +cd /usr/local/vesta/data +wget $CHOST/$VERSION/templates.tar.gz -O templates.tar.gz +tar -xzf templates.tar.gz +rm -f templates.tar.gz +chmod -R 755 /usr/local/vesta/data/templates +cp templates/web/skel/public_html/index.html /var/www/html/ +sed -i 's/%domain%/It worked!/g' /var/www/html/index.html +if [ "$srv_type" = 'micro' ]; then + rm -f /usr/local/vesta/data/templates/web/httpd/phpfcgid.* +fi + +# Generating SSL certificate +$VESTA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \ + 'San Francisco' 'Vesta Control Panel' 'IT' > /tmp/vst.pem + +# Parsing merged certificate file +crt_end=$(grep -n "END CERTIFICATE-" /tmp/vst.pem |cut -f 1 -d:) +key_start=$(grep -n "BEGIN RSA" /tmp/vst.pem |cut -f 1 -d:) +key_end=$(grep -n "END RSA" /tmp/vst.pem |cut -f 1 -d:) + +# Adding SSL certificate +cd /usr/local/vesta/ssl +sed -n "1,${crt_end}p" /tmp/vst.pem > certificate.crt +sed -n "$key_start,${key_end}p" /tmp/vst.pem > certificate.key +chown root:mail /usr/local/vesta/ssl/* +chmod 660 /usr/local/vesta/ssl/* +rm /tmp/vst.pem + # Disabling iptables chkconfig iptables off service iptables stop @@ -536,17 +636,14 @@ if [ "$?" -ne 0 ]; then fi # MySQL configuration -mpass=$(gen_pass) if [ "$srv_type" = 'micro' ]; then wget $CHOST/$VERSION/mysql-512.cnf -O /etc/my.cnf else wget $CHOST/$VERSION/mysql.cnf -O /etc/my.cnf fi - chkconfig mysqld on service mysqld start if [ "$?" -ne 0 ]; then - # Fix for aio on OpenVZ if [ -e "/proc/user_beancounters" ]; then sed -i "s/#innodb_use_native_aio/innodb_use_native_aio/g" /etc/my.cnf @@ -559,6 +656,11 @@ if [ "$?" -ne 0 ]; then fi fi +# Generating MySQL password if it wasn't set +if [ -z "$mpass" ]; then + mpass=$(gen_pass) +fi + mysqladmin -u root password $mpass echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf chmod 600 /root/.my.cnf @@ -676,69 +778,6 @@ mysql -e "GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY '$r'" sed -i "s/%password%/$r/g" /etc/roundcubemail/db.inc.php mysql roundcube < /usr/share/doc/roundcubemail-*/SQL/mysql.initial.sql -# Vesta configuration -echo "export VESTA='/usr/local/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 'export PATH' >> /root/.bash_profile -source /root/.bash_profile -wget $CHOST/$VERSION/vesta.log -O /etc/logrotate.d/vesta - -# Directory tree -mkdir -p $VESTA/conf -mkdir -p $VESTA/log -mkdir -p $VESTA/ssl -mkdir -p $VESTA/data -mkdir -p $VESTA/data/ips -mkdir -p $VESTA/data/queue -mkdir -p $VESTA/data/users -touch $VESTA/data/queue/backup.pipe -touch $VESTA/data/queue/disk.pipe -touch $VESTA/data/queue/webstats.pipe -touch $VESTA/data/queue/restart.pipe -touch $VESTA/data/queue/traffic.pipe -chmod 750 $VESTA/conf -chmod 750 $VESTA/data/users -chmod 750 $VESTA/data/ips -chmod -R 750 $VESTA/data/queue -ln -s /usr/local/vesta/log /var/log/vesta -touch /var/log/vesta/system.log -touch /var/log/vesta/nginx-error.log -touch /var/log/vesta/auth.log -chmod 660 /var/log/vesta/* -adduser backup -ln -s /home/backup /backup -chmod a+x /backup - -# vesta.conf -wget $CHOST/$VERSION/vesta.conf -O $VESTA/conf/vesta.conf -if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then - sed -i "s/clamav//g" $VESTA/conf/vesta.conf - sed -i "s/spamassassin//g" $VESTA/conf/vesta.conf -fi - -# Templates -cd /usr/local/vesta/data -wget $CHOST/$VERSION/packages.tar.gz -O packages.tar.gz -tar -xzf packages.tar.gz -rm -f packages.tar.gz -cd /usr/local/vesta/data -wget $CHOST/$VERSION/templates.tar.gz -O templates.tar.gz -tar -xzf templates.tar.gz -rm -f templates.tar.gz -chmod -R 755 /usr/local/vesta/data/templates -cp templates/web/skel/public_html/index.html /var/www/html/ -sed -i 's/%domain%/It worked!/g' /var/www/html/index.html -if [ "$srv_type" = 'micro' ]; then - rm -f /usr/local/vesta/data/templates/web/httpd/phpfcgid.* -fi - -# Default SSL keys -cd /usr/local/vesta/ssl -wget $CHOST/$VERSION/certificate.crt -O certificate.crt -wget $CHOST/$VERSION/certificate.key -O certificate.key - # Adding admin user if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then chattr -i /home/admin/conf > /dev/null 2>&1 @@ -750,7 +789,13 @@ fi if [ ! -z "$(grep ^admin: /etc/group)" ] && [ "$force" = 'yes' ]; then groupdel admin > /dev/null 2>&1 fi -vpass=$(gen_pass) + +# Generating admin password if it wasn't set +if [ -z "$vpass" ]; then + vpass=$(gen_pass) +fi + +# Adding vesta account $VESTA/bin/v-add-user admin $vpass $email default System Administrator if [ $? -ne 0 ]; then echo "Error: can't create admin user" @@ -759,7 +804,7 @@ fi $VESTA/bin/v-change-user-shell admin bash $VESTA/bin/v-change-user-language admin en -# Configure mysql host +# Configuring mysql host $VESTA/bin/v-add-database-host mysql localhost root $mpass $VESTA/bin/v-add-database admin default default $(gen_pass) mysql @@ -808,6 +853,11 @@ $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" # Build inititall rrd images $VESTA/bin/v-update-sys-rrd +# Enable file system quota +if [ "$quota" = 'yes' ]; then + $VESTA/bin/v-add-sys-quota +fi + # Start system service chkconfig vesta on service vesta start From 9b5ed17d3c145a73cdacf893e23af7c2fb364697 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 25 May 2014 14:38:50 +0300 Subject: [PATCH 13/49] new path for roundcube database --- install/vst-install-rhel.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index 19a95b4a0..54ef51747 100644 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -776,7 +776,11 @@ r="$(gen_pass)" mysql -e "CREATE DATABASE roundcube" mysql -e "GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY '$r'" sed -i "s/%password%/$r/g" /etc/roundcubemail/db.inc.php -mysql roundcube < /usr/share/doc/roundcubemail-*/SQL/mysql.initial.sql +if [ -e "/usr/share/roundcubemail/SQL/mysql.initial.sql" ]; then + mysql roundcube < /usr/share/roundcubemail/SQL/mysql.initial.sql +else + mysql roundcube < /usr/share/doc/roundcubemail-*/SQL/mysql.initial.sql +fi # Adding admin user if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then From 9b5696279946cd8914c69a0d324bb7e7b6c87e7a Mon Sep 17 00:00:00 2001 From: Vasily Kraev Date: Tue, 27 May 2014 12:30:34 +0400 Subject: [PATCH 14/49] add more extensions for static files in nginx config --- web/add/web/index.php | 8 +++++--- web/templates/admin/add_web.html | 2 +- web/templates/admin/edit_web.html | 2 +- web/templates/user/edit_web.html | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/web/add/web/index.php b/web/add/web/index.php index d72fb8510..0c13cf58e 100644 --- a/web/add/web/index.php +++ b/web/add/web/index.php @@ -25,9 +25,11 @@ $v_ftp_email = $panel[$user]['CONTACT']; if (empty($_POST['v_proxy'])) $v_adv = 'yes'; if (!empty($_POST['v_ftp'])) $v_adv = 'yes'; - $v_proxy_ext = 'jpg, jpeg, gif, png, ico, svg, css, zip, tgz, gz, rar, bz2, exe, pdf, '; - $v_proxy_ext .= 'doc, xls, ppt, txt, odt, ods, odp, odf, tar, bmp, rtf, js, mp3, avi, '; - $v_proxy_ext .= 'mpeg, flv, html, htm'; + $v_proxy_ext = 'jpeg, jpg, png, gif, bmp, ico, svg, tif, tiff, css, js, htm, html, ttf,'; + $v_proxy_ext .= 'otf, webp, woff, txt, csv, rtf, doc, docx, xls, xlsx, ppt, pptx, odf, '; + $v_proxy_ext .= 'odp, ods, odt, pdf, psd, ai, eot, eps, ps, zip, tar, tgz, gz, rar, '; + $v_proxy_ext .= 'bz2, 7z, aac, m4a, mp3, mp4, ogg, wav, wma, 3gp, avi, flv, m4v, mkv, '; + $v_proxy_ext .= 'mov, mp4, mpeg, mpg, wmv, exe, iso, dmg, swf'; if ($_POST['v_proxy_ext'] != $v_proxy_ext) $v_adv = 'yes'; // Protect input diff --git a/web/templates/admin/add_web.html b/web/templates/admin/add_web.html index c1ef3db55..6f50d67a5 100644 --- a/web/templates/admin/add_web.html +++ b/web/templates/admin/add_web.html @@ -163,7 +163,7 @@ - + diff --git a/web/templates/admin/edit_web.html b/web/templates/admin/edit_web.html index 2466293fd..3ef861501 100644 --- a/web/templates/admin/edit_web.html +++ b/web/templates/admin/edit_web.html @@ -324,7 +324,7 @@ - ' . __('Prefix will be automaticaly added to username',$user."_") . '' ?> + ' . __('Prefix will be automaticaly added to username',$user."_") . '' ?> diff --git a/web/templates/user/edit_web.html b/web/templates/user/edit_web.html index 4b51deed9..1b0998feb 100644 --- a/web/templates/user/edit_web.html +++ b/web/templates/user/edit_web.html @@ -134,7 +134,7 @@ - + From c1d3e564df6f69945171b46ec0a5db74e8cf2d44 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 6 Jun 2014 14:42:14 +0300 Subject: [PATCH 15/49] Actuall quota size was 10 times lesser. Fixes #152. --- bin/v-update-user-quota | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-update-user-quota b/bin/v-update-user-quota index 99b2e11d6..f248662ed 100755 --- a/bin/v-update-user-quota +++ b/bin/v-update-user-quota @@ -32,7 +32,7 @@ is_object_valid 'user' 'USER' "$user" # Updating disk quota soft=$(get_user_value '$DISK_QUOTA') -soft=$((soft * 100)) +soft=$((soft * 1000)) hard=$((soft + 50000)) mnt=$(df -P /home |awk '{print $6}' |tail -n1) From 1d8800726e287022aef93df13fec5c16cd9d6f9d Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 6 Jun 2014 14:44:26 +0300 Subject: [PATCH 16/49] Import sys env. Fixes #153 --- bin/v-update-sys-vesta-all | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/v-update-sys-vesta-all b/bin/v-update-sys-vesta-all index f73ef95e7..75bc036f1 100755 --- a/bin/v-update-sys-vesta-all +++ b/bin/v-update-sys-vesta-all @@ -9,6 +9,9 @@ # Variable&Function # #----------------------------------------------------------# +# Importing system variables +source /etc/profile + # Includes source $VESTA/func/main.sh source $VESTA/conf/vesta.conf From 64a85a82db43193c57bd1de58f649b8461644b45 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 9 Jun 2014 20:21:02 +0300 Subject: [PATCH 17/49] changed free memeory overlay style to linear --- bin/v-update-sys-rrd-mem | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/v-update-sys-rrd-mem b/bin/v-update-sys-rrd-mem index 69b0de918..515ec2802 100755 --- a/bin/v-update-sys-rrd-mem +++ b/bin/v-update-sys-rrd-mem @@ -95,11 +95,11 @@ rrdtool graph $RRD/mem/$period-mem.png \ GPRINT:used:'LAST: Current\:''%8.0lf' \ GPRINT:used:'MIN: Min\:''%8.0lf' \ GPRINT:used:'MAX: Max\:''%8.0lf\j' \ - AREA:free#1c74cd:"FREE" \ + LINE1:free#1c74cd:"FREE" \ GPRINT:free:'LAST: Current\:''%8.0lf' \ GPRINT:free:'MIN: Min\:''%8.0lf' \ GPRINT:free:'MAX: Max\:''%8.0lf\j'\ - LINE1:swap#f57900:"SWAP" \ + LINE2:swap#f57900:"SWAP" \ GPRINT:swap:'LAST:Current\:''%8.0lf' \ GPRINT:swap:'MIN:Min\:''%8.0lf' \ GPRINT:swap:'MAX:Max\:''%8.0lf\j' &>/dev/null; result=$? From cba75321f01355d1e9f58e24efc3bc897dd36902 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 9 Jun 2014 20:23:09 +0300 Subject: [PATCH 18/49] New installer for Debian --- install/vst-install-debian.sh | 211 +++++++++++++++++++++------------- 1 file changed, 131 insertions(+), 80 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index d4f8856c3..e457c3cd5 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Vesta Debian installer v.01 +# Vesta Debian installer v.04 #----------------------------------------------------------# # Variables&Functions # @@ -16,15 +16,19 @@ software="nginx apache2 apache2-utils apache2.2-common apache2-suexec-custom php5-curl libapache2-mod-php5 vsftpd mc exim4 exim4-daemon-heavy clamav-daemon flex dovecot-imapd dovecot-pop3d phpMyAdmin awstats webalizer jwhois rssh git spamassassin roundcube roundcube-mysql - roundcube-plugins sudo bc ftp lsof ntpdate rrdtool + roundcube-plugins sudo bc ftp lsof ntpdate rrdtool quota e2fslibs dnsutils vesta vesta-nginx vesta-php" help() { echo "usage: $0 [OPTIONS] - -e, --email Define email address - -h, --help Print this help and exit + -e, --email Set email address -f, --force Force installation - -n, --noupdate Do not run apt-get upgrade command" + -h, --help Print this help and exit + -n, --noupdate Do not run yum update command + -m, --mysql-password Set MySQL password instead of generating it + -p, --password Set admin password instead of generating it + -s, --hostname Set server hostname + -q, --quota Enable File System Quota" exit 1 } @@ -48,10 +52,14 @@ gen_pass() { for arg; do delim="" case "$arg" in - --help) args="${args}-h " ;; - --force) args="${args}-f " ;; - --email) args="${args}-e " ;; - --noupdate) args="${args}-n " ;; + --email) args="${args}-e " ;; + --force) args="${args}-f " ;; + --help) args="${args}-h " ;; + --noupdate) args="${args}-n " ;; + --mysql-password) args="${args}-m " ;; + --password) args="${args}-p " ;; + --hostname) args="${args}-s " ;; + --quota) args="${args}-q " ;; *) [[ "${arg:0:1}" == "-" ]] || delim="\"" args="${args}${delim}${arg}${delim} ";; esac @@ -59,12 +67,16 @@ done eval set -- "$args" # Getopt -while getopts "dhfne:" Option; do +while getopts "dhfnqe:m:p:s:" Option; do case $Option in h) help ;; # Help e) email=$OPTARG ;; # Set email - f) force='yes' ;; # Force apt-get install - n) noupdate='yes' ;; # Disable apt-get upgrade + f) force='yes' ;; # Force install + n) noupdate='yes' ;; # Disable yum update + m) mpass=$OPTARG ;; # MySQL pasword + p) vpass=$OPTARG ;; # Admin password + s) servername=$OPTARG ;; # Server hostname + q) quota='yes' ;; # Enable quota *) help ;; # Default esac done @@ -216,6 +228,14 @@ if [ -z $email ]; then # Check email read -p 'Please enter valid email address: ' email + + # Define server hostname + if [ -z "$servername" ]; then + read -p "Please enter hostname [$(hostname)]: " servername + fi + if [ -z "$servername" ]; then + servername=$(hostname) + fi fi # Validate email @@ -399,6 +419,86 @@ rm -f /usr/sbin/policy-rc.d # Set writable permission on tmp directory chmod 777 /tmp +# Vesta configuration +echo "export VESTA='/usr/local/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 'export PATH' >> /root/.bash_profile +source /root/.bash_profile +wget $CHOST/$VERSION/vesta.log -O /etc/logrotate.d/vesta + +# Directory tree +mkdir -p $VESTA/conf +mkdir -p $VESTA/log +mkdir -p $VESTA/ssl +mkdir -p $VESTA/data +mkdir -p $VESTA/data/ips +mkdir -p $VESTA/data/queue +mkdir -p $VESTA/data/users +touch $VESTA/data/queue/backup.pipe +touch $VESTA/data/queue/disk.pipe +touch $VESTA/data/queue/webstats.pipe +touch $VESTA/data/queue/restart.pipe +touch $VESTA/data/queue/traffic.pipe +chmod 750 $VESTA/conf +chmod 750 $VESTA/data/users +chmod 750 $VESTA/data/ips +chmod -R 750 $VESTA/data/queue +ln -s /usr/local/vesta/log /var/log/vesta +touch /var/log/vesta/system.log +touch /var/log/vesta/nginx-error.log +touch /var/log/vesta/auth.log +chmod 660 /var/log/vesta/* +adduser backup > /dev/null 2>&1 +mkdir -p /home/backup +chown backup:backup /home/backup +ln -s /home/backup /backup +chmod a+x /backup + +# vesta.conf +wget $CHOST/$VERSION/vesta.conf -O $VESTA/conf/vesta.conf +if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then + sed -i "s/clamav-daemon//g" $VESTA/conf/vesta.conf + sed -i "s/spamassassin//g" $VESTA/conf/vesta.conf +fi + +# Set server hostname +/usr/local/vesta/bin/v-change-sys-hostname $servername 2>/dev/null + +# Templates +cd /usr/local/vesta/data +wget $CHOST/$VERSION/packages.tar.gz -O packages.tar.gz +tar -xzf packages.tar.gz +rm -f packages.tar.gz +cd /usr/local/vesta/data +wget $CHOST/$VERSION/templates.tar.gz -O templates.tar.gz +tar -xzf templates.tar.gz +rm -f templates.tar.gz +chmod -R 755 /usr/local/vesta/data/templates +cp templates/web/skel/public_html/index.html /var/www/ +sed -i 's/%domain%/It worked!/g' /var/www/index.html +if [ "$srv_type" = 'micro' ]; then + rm -f /usr/local/vesta/data/templates/web/apache2/phpfcgid.* +fi + +# Generating SSL certificate +$VESTA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \ + 'San Francisco' 'Vesta Control Panel' 'IT' > /tmp/vst.pem + +# Parsing merged certificate file +crt_end=$(grep -n "END CERTIFICATE-" /tmp/vst.pem |cut -f 1 -d:) +key_start=$(grep -n "BEGIN RSA" /tmp/vst.pem |cut -f 1 -d:) +key_end=$(grep -n "END RSA" /tmp/vst.pem |cut -f 1 -d:) + +# Adding SSL certificate +cd /usr/local/vesta/ssl +sed -n "1,${crt_end}p" /tmp/vst.pem > certificate.crt +sed -n "$key_start,${key_end}p" /tmp/vst.pem > certificate.key +chown root:mail /usr/local/vesta/ssl/* +chmod 660 /usr/local/vesta/ssl/* +rm /tmp/vst.pem + # Enable password auth sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config service ssh restart @@ -488,8 +588,12 @@ if [ "$?" -ne 0 ]; then exit 1 fi +# Generating MySQL password if it wasn't set +if [ -z "$mpass" ]; then + mpass=$(gen_pass) +fi + # MySQL configuration -mpass=$(gen_pass) wget $CHOST/$VERSION/my.cnf -O /etc/mysql/my.cnf mysql_install_db update-rc.d mysql defaults @@ -503,7 +607,7 @@ mysqladmin -u root password $mpass echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf chmod 600 /root/.my.cnf mysql -e "DELETE FROM mysql.user WHERE User=''" -mysql -e "DROP DATABASE test" +mysql -e "DROP DATABASE test" > /dev/null 2>&1 mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'" mysql -e "DELETE FROM mysql.user WHERE user='' or password='';" mysql -e "FLUSH PRIVILEGES" @@ -621,6 +725,7 @@ wget $CHOST/$VERSION/roundcube-driver.php -O \ wget $CHOST/$VERSION/roundcube-pw.conf -O \ /etc/roundcube/plugins/password/config.inc.php r="$(gen_pass)" +mysql -e "DROP DATABASE roundcube" > /dev/null 2>&1 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 @@ -628,71 +733,6 @@ mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql mkdir -p /var/log/roundcube/error chmod -R 777 /var/log/roundcube -# Vesta configuration -echo "export VESTA='/usr/local/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 'export PATH' >> /root/.bash_profile -source /root/.bash_profile -wget $CHOST/$VERSION/vesta.log -O /etc/logrotate.d/vesta - -# Directory tree -mkdir -p $VESTA/conf -mkdir -p $VESTA/log -mkdir -p $VESTA/ssl -mkdir -p $VESTA/data -mkdir -p $VESTA/data/ips -mkdir -p $VESTA/data/queue -mkdir -p $VESTA/data/users -touch $VESTA/data/queue/backup.pipe -touch $VESTA/data/queue/disk.pipe -touch $VESTA/data/queue/webstats.pipe -touch $VESTA/data/queue/restart.pipe -touch $VESTA/data/queue/traffic.pipe -chmod 750 $VESTA/conf -chmod 750 $VESTA/data/users -chmod 750 $VESTA/data/ips -chmod -R 750 $VESTA/data/queue -ln -s /usr/local/vesta/log /var/log/vesta -touch /var/log/vesta/system.log -touch /var/log/vesta/nginx-error.log -touch /var/log/vesta/auth.log -chmod 660 /var/log/vesta/* -adduser backup > /dev/null 2>&1 -mkdir -p /home/backup -chown backup:backup /home/backup -ln -s /home/backup /backup -chmod a+x /backup - -# vesta.conf -wget $CHOST/$VERSION/vesta.conf -O $VESTA/conf/vesta.conf -if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then - sed -i "s/clamav-daemon//g" $VESTA/conf/vesta.conf - sed -i "s/spamassassin//g" $VESTA/conf/vesta.conf -fi - -# Templates -cd /usr/local/vesta/data -wget $CHOST/$VERSION/packages.tar.gz -O packages.tar.gz -tar -xzf packages.tar.gz -rm -f packages.tar.gz -cd /usr/local/vesta/data -wget $CHOST/$VERSION/templates.tar.gz -O templates.tar.gz -tar -xzf templates.tar.gz -rm -f templates.tar.gz -chmod -R 755 /usr/local/vesta/data/templates -cp templates/web/skel/public_html/index.html /var/www/ -sed -i 's/%domain%/It worked!/g' /var/www/index.html -if [ "$srv_type" = 'micro' ]; then - rm -f /usr/local/vesta/data/templates/web/apache2/phpfcgid.* -fi - -# Default SSL keys -cd /usr/local/vesta/ssl -wget $CHOST/$VERSION/certificate.crt -O certificate.crt -wget $CHOST/$VERSION/certificate.key -O certificate.key - # Adding admin user if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then chattr -i /home/admin/conf > /dev/null 2>&1 @@ -704,7 +744,13 @@ fi if [ ! -z "$(grep ^admin: /etc/group)" ]; then groupdel admin > /dev/null 2>&1 fi -vpass=$(gen_pass) + +# Generating admin password if it wasn't set +if [ -z "$vpass" ]; then + vpass=$(gen_pass) +fi + +# Adding vesta account $VESTA/bin/v-add-user admin $vpass $email default System Administrator if [ $? -ne 0 ]; then echo "Error: can't create admin user" @@ -762,6 +808,11 @@ $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" # Build inititall rrd images $VESTA/bin/v-update-sys-rrd +# Enable file system quota +if [ "$quota" = 'yes' ]; then + $VESTA/bin/v-add-sys-quota +fi + # Start system service update-rc.d vesta defaults service vesta stop > /dev/null 2>&1 From 7e494680bc96cb98187b31a8416cc93c607efb99 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 9 Jun 2014 20:24:13 +0300 Subject: [PATCH 19/49] Shared SSL certificate --- install/debian/dovecot/conf.d/10-ssl.conf | 4 ++-- install/debian/exim4.conf.template | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install/debian/dovecot/conf.d/10-ssl.conf b/install/debian/dovecot/conf.d/10-ssl.conf index e1d444239..3aaff6eec 100644 --- a/install/debian/dovecot/conf.d/10-ssl.conf +++ b/install/debian/dovecot/conf.d/10-ssl.conf @@ -1,3 +1,3 @@ ssl = yes -ssl_cert = Date: Sat, 14 Jun 2014 11:49:08 +0300 Subject: [PATCH 20/49] Shared SSL certificate --- install/ubuntu/dovecot/conf.d/10-ssl.conf | 4 ++-- install/ubuntu/exim4.conf.template | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/install/ubuntu/dovecot/conf.d/10-ssl.conf b/install/ubuntu/dovecot/conf.d/10-ssl.conf index e1d444239..3aaff6eec 100644 --- a/install/ubuntu/dovecot/conf.d/10-ssl.conf +++ b/install/ubuntu/dovecot/conf.d/10-ssl.conf @@ -1,3 +1,3 @@ ssl = yes -ssl_cert = Date: Sat, 14 Jun 2014 11:50:57 +0300 Subject: [PATCH 21/49] Improved spelling --- install/vst-install-debian.sh | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index e457c3cd5..08189f3aa 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -499,7 +499,7 @@ chown root:mail /usr/local/vesta/ssl/* chmod 660 /usr/local/vesta/ssl/* rm /tmp/vst.pem -# Enable password auth +# Enable SSH password auth sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config service ssh restart @@ -554,9 +554,9 @@ wget $CHOST/$VERSION/apache2-status.conf \ wget $CHOST/$VERSION/apache2.log -O /etc/logrotate.d/apache2 rm -f /etc/apache2/conf.d/vesta.conf echo > /etc/apache2/conf.d/vesta.conf -echo "# Powever by vesta" > /etc/apache2/sites-available/default -echo "# Powever by vestas" > /etc/apache2/sites-available/default-ssl -echo "# Powever by vestas" > /etc/apache2/ports.conf +echo "# Powevered by vesta" > /etc/apache2/sites-available/default +echo "# Powevered by vesta" > /etc/apache2/sites-available/default-ssl +echo "# Powevered by vesta" > /etc/apache2/ports.conf touch /var/log/apache2/access.log touch /var/log/apache2/error.log mkdir -p /var/log/apache2/domains @@ -665,12 +665,6 @@ tar -xzf dovecot-conf.d.tar.gz rm -f dovecot-conf.d.tar.gz chown -R root:root /etc/dovecot gpasswd -a dovecot mail -if [ "$codename" = 'precise' ]; then - dovecot_ssl_conf="/etc/dovecot/conf.d/10-ssl.conf" - echo "ssl = yes" > $dovecot_ssl_conf - echo "ssl_cert = > $dovecot_ssl_conf - echo "ssl_key = > $dovecot_ssl_conf -fi update-rc.d dovecot defaults service dovecot stop > /dev/null 2>&1 service dovecot start @@ -715,6 +709,7 @@ wget $CHOST/$VERSION/apache2-pma.conf -O /etc/phpmyadmin/apache.conf wget $CHOST/$VERSION/pma.conf -O /etc/phpmyadmin/config.inc.php ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf mv -f /etc/phpmyadmin/config-db.php /etc/phpmyadmin/config-db.php_ +chmod 777 /var/lib/phpmyadmin/tmp # Roundcube configuration wget $CHOST/$VERSION/apache2-webmail.conf -O /etc/roundcube/apache.conf @@ -733,7 +728,7 @@ mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql mkdir -p /var/log/roundcube/error chmod -R 777 /var/log/roundcube -# Adding admin user +# Deleting old admin user account if exists if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then chattr -i /home/admin/conf > /dev/null 2>&1 userdel -f admin @@ -750,7 +745,7 @@ if [ -z "$vpass" ]; then vpass=$(gen_pass) fi -# Adding vesta account +# Adding admin account $VESTA/bin/v-add-user admin $vpass $email default System Administrator if [ $? -ne 0 ]; then echo "Error: can't create admin user" @@ -789,7 +784,7 @@ $VESTA/bin/v-add-dns-domain admin default.domain $vst_ip # Add default mail domain $VESTA/bin/v-add-mail-domain admin default.domain -# Configuring crond +# Configuring cron jobs command='sudo /usr/local/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' @@ -805,7 +800,7 @@ $VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" command='sudo /usr/local/vesta/bin/v-update-sys-rrd' $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" -# Build inititall rrd images +# Building inititall rrd images $VESTA/bin/v-update-sys-rrd # Enable file system quota From 2e77a533236bd231064612bd5103b3a827e8aa08 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 14 Jun 2014 11:51:27 +0300 Subject: [PATCH 22/49] New installer for Ubuntu --- install/vst-install-ubuntu.sh | 249 ++++++++++++++++++++-------------- 1 file changed, 146 insertions(+), 103 deletions(-) diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index b4e718585..65bcac2ad 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Vesta Ubuntu installer v.01 +# Vesta Ubuntu installer v.04 #----------------------------------------------------------# # Variables&Functions # @@ -14,17 +14,21 @@ software="nginx apache2 apache2-utils apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf libapache2-mod-fcgid bind9 idn mysql-server mysql-common mysql-client php5-common php5-cgi php5-mysql php5-curl libapache2-mod-php5 vsftpd mc exim4 exim4-daemon-heavy - clamav-daemon flex dovecot-imapd dovecot-pop3d phpMyAdmin awstats - webalizer jwhois rssh git spamassassin roundcube roundcube-mysql + clamav-daemon flex dovecot-imapd dovecot-pop3d phpMyAdmin awstats e2fslibs + webalizer jwhois rssh git spamassassin roundcube roundcube-mysql quota roundcube-plugins apparmor-utils sudo bc ftp lsof ntpdate rrdtool dnsutils vesta vesta-nginx vesta-php" help() { echo "usage: $0 [OPTIONS] - -e, --email Define email address - -h, --help Print this help and exit + -e, --email Set email address -f, --force Force installation - -n, --noupdate Do not run apt-get upgrade command" + -h, --help Print this help and exit + -n, --noupdate Do not run yum update command + -m, --mysql-password Set MySQL password instead of generating it + -p, --password Set admin password instead of generating it + -s, --hostname Set server hostname + -q, --quota Enable File System Quota" exit 1 } @@ -48,10 +52,14 @@ gen_pass() { for arg; do delim="" case "$arg" in - --help) args="${args}-h " ;; - --force) args="${args}-f " ;; - --email) args="${args}-e " ;; - --noupdate) args="${args}-n " ;; + --email) args="${args}-e " ;; + --force) args="${args}-f " ;; + --help) args="${args}-h " ;; + --noupdate) args="${args}-n " ;; + --mysql-password) args="${args}-m " ;; + --password) args="${args}-p " ;; + --hostname) args="${args}-s " ;; + --quota) args="${args}-q " ;; *) [[ "${arg:0:1}" == "-" ]] || delim="\"" args="${args}${delim}${arg}${delim} ";; esac @@ -59,12 +67,16 @@ done eval set -- "$args" # Getopt -while getopts "dhfne:" Option; do +while getopts "dhfnqe:m:p:s:" Option; do case $Option in h) help ;; # Help e) email=$OPTARG ;; # Set email - f) force='yes' ;; # Force apt-get install - n) noupdate='yes' ;; # Disable apt-get upgrade + f) force='yes' ;; # Force install + n) noupdate='yes' ;; # Disable yum update + m) mpass=$OPTARG ;; # MySQL pasword + p) vpass=$OPTARG ;; # Admin password + s) servername=$OPTARG ;; # Server hostname + q) quota='yes' ;; # Enable quota *) help ;; # Default esac done @@ -89,9 +101,9 @@ else fi os=$(head -n 1 /etc/issue | cut -f 1 -d ' ') release=$(head -n 1 /etc/issue | cut -f 2 -d ' ' ) -codename=$(lsb_release -cs | grep "[precise|raring|saucy]") +codename=$(lsb_release -cs | egrep "precise|quantal|raring|saucy|trusty") if [ -z "$codename" ]; then - echo 'Error: only Ubuntu 12.04, 13.04 and 13.10 is supported' + echo "Error: Ubuntu $(lsb_release -r|awk '{print $2}') is not supported" exit 1 fi @@ -214,6 +226,14 @@ if [ -z $email ]; then # Check email read -p 'Please enter valid email address: ' email + + # Define server hostname + if [ -z "$servername" ]; then + read -p "Please enter hostname [$(hostname)]: " servername + fi + if [ -z "$servername" ]; then + servername=$(hostname) + fi fi # Validate email @@ -252,9 +272,6 @@ apt=/etc/apt/sources.list.d echo "deb http://nginx.org/packages/ubuntu/ $codename nginx" > $apt/nginx.list wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key apt-key add /tmp/nginx_signing.key -if [ $codename = 'trusty' ]; then - sed -i "s/trusty/saucy/g" $apt/nginx.list -fi # Install vesta repo echo "deb http://$RHOST/$codename/ $codename vesta" > $apt/vesta.list @@ -400,7 +417,91 @@ rm -f /usr/sbin/policy-rc.d # Set writable permission on tmp directory chmod 777 /tmp -# Enable password auth +# Vesta configuration +echo "export VESTA='/usr/local/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 'export PATH' >> /root/.bash_profile +source /root/.bash_profile +wget $CHOST/$VERSION/vesta.log -O /etc/logrotate.d/vesta + +# Directory tree +mkdir -p $VESTA/conf +mkdir -p $VESTA/log +mkdir -p $VESTA/ssl +mkdir -p $VESTA/data +mkdir -p $VESTA/data/ips +mkdir -p $VESTA/data/queue +mkdir -p $VESTA/data/users +touch $VESTA/data/queue/backup.pipe +touch $VESTA/data/queue/disk.pipe +touch $VESTA/data/queue/webstats.pipe +touch $VESTA/data/queue/restart.pipe +touch $VESTA/data/queue/traffic.pipe +chmod 750 $VESTA/conf +chmod 750 $VESTA/data/users +chmod 750 $VESTA/data/ips +chmod -R 750 $VESTA/data/queue +ln -s /usr/local/vesta/log /var/log/vesta +touch /var/log/vesta/system.log +touch /var/log/vesta/nginx-error.log +touch /var/log/vesta/auth.log +chmod 660 /var/log/vesta/* +adduser backup > /dev/null 2>&1 +mkdir -p /home/backup +chown backup:backup /home/backup +ln -s /home/backup /backup +chmod a+x /backup + +# vesta.conf +wget $CHOST/$VERSION/vesta.conf -O $VESTA/conf/vesta.conf +if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then + sed -i "s/clamav-daemon//g" $VESTA/conf/vesta.conf + sed -i "s/spamassassin//g" $VESTA/conf/vesta.conf +fi + +# Set server hostname +/usr/local/vesta/bin/v-change-sys-hostname $servername 2>/dev/null + +# Templates +cd /usr/local/vesta/data +wget $CHOST/$VERSION/packages.tar.gz -O packages.tar.gz +tar -xzf packages.tar.gz +rm -f packages.tar.gz +cd /usr/local/vesta/data +wget $CHOST/$VERSION/templates.tar.gz -O templates.tar.gz +tar -xzf templates.tar.gz +rm -f templates.tar.gz +if [ "$codename" = 'saucy' ] || [ "$codename" = 'trusty' ]; then + sed -i "s/Include /IncludeOptional /g" \ + $VESTA/data/templates/web/apache2/*tpl +fi +chmod -R 755 /usr/local/vesta/data/templates +cp templates/web/skel/public_html/index.html /var/www/ +sed -i 's/%domain%/It worked!/g' /var/www/index.html +if [ "$srv_type" = 'micro' ]; then + rm -f /usr/local/vesta/data/templates/web/apache2/phpfcgid.* +fi + +# Generating SSL certificate +$VESTA/bin/v-generate-ssl-cert $(hostname) $email 'US' 'California' \ + 'San Francisco' 'Vesta Control Panel' 'IT' > /tmp/vst.pem + +# Parsing merged certificate file +crt_end=$(grep -n "END CERTIFICATE-" /tmp/vst.pem |cut -f 1 -d:) +key_start=$(grep -n "BEGIN RSA" /tmp/vst.pem |cut -f 1 -d:) +key_end=$(grep -n "END RSA" /tmp/vst.pem |cut -f 1 -d:) + +# Adding SSL certificate +cd /usr/local/vesta/ssl +sed -n "1,${crt_end}p" /tmp/vst.pem > certificate.crt +sed -n "$key_start,${key_end}p" /tmp/vst.pem > certificate.key +chown root:mail /usr/local/vesta/ssl/* +chmod 660 /usr/local/vesta/ssl/* +rm /tmp/vst.pem + +# Enable SSH password auth sed -i "s/rdAuthentication no/rdAuthentication yes/g" /etc/ssh/sshd_config service ssh restart @@ -456,9 +557,9 @@ fi wget $CHOST/$VERSION/apache2-status.conf \ -O /etc/apache2/mods-enabled/status.conf wget $CHOST/$VERSION/apache2.log -O /etc/logrotate.d/apache2 -echo "# Powever by vesta" > /etc/apache2/sites-available/default -echo "# Powever by vesta" > /etc/apache2/sites-available/default-ssl -echo "# Powever by vesta" > /etc/apache2/ports.conf +echo "# Powevered by vesta" > /etc/apache2/sites-available/default +echo "# Powevered by vesta" > /etc/apache2/sites-available/default-ssl +echo "# Powevered by vesta" > /etc/apache2/ports.conf mkdir -p /etc/apache2/conf.d rm -f /etc/apache2/conf.d/vesta.conf echo > /etc/apache2/conf.d/vesta.conf @@ -491,6 +592,11 @@ if [ "$?" -ne 0 ]; then exit 1 fi +# Generating MySQL password if it wasn't set +if [ -z "$mpass" ]; then + mpass=$(gen_pass) +fi + # MySQL configuration mpass=$(gen_pass) wget $CHOST/$VERSION/my.cnf -O /etc/mysql/my.cnf @@ -506,7 +612,7 @@ mysqladmin -u root password $mpass echo -e "[client]\npassword='$mpass'\n" > /root/.my.cnf chmod 600 /root/.my.cnf mysql -e "DELETE FROM mysql.user WHERE User=''" -mysql -e "DROP DATABASE test" +mysql -e "DROP DATABASE test" > /dev/null 2>&1 mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'" mysql -e "DELETE FROM mysql.user WHERE user='' or password='';" mysql -e "FLUSH PRIVILEGES" @@ -564,12 +670,6 @@ tar -xzf dovecot-conf.d.tar.gz rm -f dovecot-conf.d.tar.gz chown -R root:root /etc/dovecot gpasswd -a dovecot mail -if [ "$codename" = 'precise' ]; then - dovecot_ssl_conf="/etc/dovecot/conf.d/10-ssl.conf" - echo "ssl = yes" > $dovecot_ssl_conf - echo "ssl_cert = > $dovecot_ssl_conf - echo "ssl_key = > $dovecot_ssl_conf -fi update-rc.d dovecot defaults service dovecot stop > /dev/null 2>&1 service dovecot start @@ -630,7 +730,8 @@ wget $CHOST/$VERSION/roundcube-driver.php -O \ wget $CHOST/$VERSION/roundcube-pw.conf -O \ /etc/roundcube/plugins/password/config.inc.php r="$(gen_pass)" -mysql -e "CREATE DATABASE roundcube" +mysql -e "DROP DATABASE roundcube" > /dev/null 2>&1 +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 mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql @@ -643,76 +744,7 @@ fi mkdir -p /var/log/roundcube/error chmod -R 777 /var/log/roundcube -# Vesta configuration -echo "export VESTA='/usr/local/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 'export PATH' >> /root/.bash_profile -source /root/.bash_profile -wget $CHOST/$VERSION/vesta.log -O /etc/logrotate.d/vesta - -# Directory tree -mkdir -p $VESTA/conf -mkdir -p $VESTA/log -mkdir -p $VESTA/ssl -mkdir -p $VESTA/data -mkdir -p $VESTA/data/ips -mkdir -p $VESTA/data/queue -mkdir -p $VESTA/data/users -touch $VESTA/data/queue/backup.pipe -touch $VESTA/data/queue/disk.pipe -touch $VESTA/data/queue/webstats.pipe -touch $VESTA/data/queue/restart.pipe -touch $VESTA/data/queue/traffic.pipe -chmod 750 $VESTA/conf -chmod 750 $VESTA/data/users -chmod 750 $VESTA/data/ips -chmod -R 750 $VESTA/data/queue -ln -s /usr/local/vesta/log /var/log/vesta -touch /var/log/vesta/system.log -touch /var/log/vesta/nginx-error.log -touch /var/log/vesta/auth.log -chmod 660 /var/log/vesta/* -adduser backup > /dev/null 2>&1 -mkdir -p /home/backup -chown backup:backup /home/backup -ln -s /home/backup /backup -chmod a+x /backup - -# vesta.conf -wget $CHOST/$VERSION/vesta.conf -O $VESTA/conf/vesta.conf -if [ "$srv_type" = 'micro' ] || [ "$srv_type" = 'small' ]; then - sed -i "s/clamav-daemon//g" $VESTA/conf/vesta.conf - sed -i "s/spamassassin//g" $VESTA/conf/vesta.conf -fi - -# Templates -cd /usr/local/vesta/data -wget $CHOST/$VERSION/packages.tar.gz -O packages.tar.gz -tar -xzf packages.tar.gz -rm -f packages.tar.gz -cd /usr/local/vesta/data -wget $CHOST/$VERSION/templates.tar.gz -O templates.tar.gz -tar -xzf templates.tar.gz -rm -f templates.tar.gz -if [ "$codename" = 'saucy' ] || [ "$codename" = 'trusty' ]; then - sed -i "s/Include /IncludeOptional /g" \ - $VESTA/data/templates/web/apache2/*tpl -fi -chmod -R 755 /usr/local/vesta/data/templates -cp templates/web/skel/public_html/index.html /var/www/ -sed -i 's/%domain%/It worked!/g' /var/www/index.html -if [ "$srv_type" = 'micro' ]; then - rm -f /usr/local/vesta/data/templates/web/apache2/phpfcgid.* -fi - -# Default SSL keys -cd /usr/local/vesta/ssl -wget $CHOST/$VERSION/certificate.crt -O certificate.crt -wget $CHOST/$VERSION/certificate.key -O certificate.key - -# Adding admin user +# Deleting old admin user account if exists if [ ! -z "$(grep ^admin: /etc/passwd)" ] && [ "$force" = 'yes' ]; then chattr -i /home/admin/conf > /dev/null 2>&1 userdel -f admin @@ -723,7 +755,13 @@ fi if [ ! -z "$(grep ^admin: /etc/group)" ]; then groupdel admin > /dev/null 2>&1 fi -vpass=$(gen_pass) + +# Generating admin password if it wasn't set +if [ -z "$vpass" ]; then + vpass=$(gen_pass) +fi + +# Adding admin account $VESTA/bin/v-add-user admin $vpass $email default System Administrator if [ $? -ne 0 ]; then echo "Error: can't create admin user" @@ -762,7 +800,7 @@ $VESTA/bin/v-add-dns-domain admin default.domain $vst_ip # Add default mail domain $VESTA/bin/v-add-mail-domain admin default.domain -# Configuring crond +# Configuring cron jobs command='sudo /usr/local/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' @@ -778,9 +816,14 @@ $VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" command='sudo /usr/local/vesta/bin/v-update-sys-rrd' $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" -# Build inititall rrd images +# Building inititall rrd images $VESTA/bin/v-update-sys-rrd +# Enable file system quota +if [ "$quota" = 'yes' ]; then + $VESTA/bin/v-add-sys-quota +fi + # Start system service update-rc.d vesta defaults service vesta stop > /dev/null 2>&1 From 23b28a73d8d686e10eac21fc13bc574e6a5c49db Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 14 Jun 2014 11:52:47 +0300 Subject: [PATCH 23/49] RRD graph for Exim --- bin/v-list-sys-rrd | 11 +++-- bin/v-update-sys-rrd | 5 ++ bin/v-update-sys-rrd-mail | 96 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 4 deletions(-) create mode 100755 bin/v-update-sys-rrd-mail diff --git a/bin/v-list-sys-rrd b/bin/v-list-sys-rrd index 49b0b2e78..2dc026b91 100755 --- a/bin/v-list-sys-rrd +++ b/bin/v-list-sys-rrd @@ -37,6 +37,9 @@ json_list_rrd() { [ "$type" = 'ssh' ]; then title="$(echo $rrd| tr '[:lower:]' '[:upper:]') Usage" fi + if [ "$type" = 'mail' ]; then + title="Exim Usage" + fi if [ "$type" = 'db' ]; then db_type=$(echo $rrd|cut -f 1 -d _ |sed -e 's/mysql/MySQL/g' \ -e 's/pgsql/PostgreSQL/g' ) @@ -84,14 +87,14 @@ if [ -n "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then rrd_types="$rrd_types web" fi +if [ -n "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then + rrd_types="$rrd_types mail" +fi + if [ -n "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'no' ]; then rrd_types="$rrd_types db" fi -#if [ -n "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then -# rrd_types="$rrd_types mail" -#fi - if [ -n "$FTP_SYSTEM" ] && [ "$FTP_SYSTEM" != 'no' ]; then rrd_types="$rrd_types ftp" fi diff --git a/bin/v-update-sys-rrd b/bin/v-update-sys-rrd index 6420f6079..81cc6d64e 100755 --- a/bin/v-update-sys-rrd +++ b/bin/v-update-sys-rrd @@ -110,6 +110,11 @@ for period in $periods; do $BIN/v-update-sys-rrd-$PROXY_SYSTEM $period >/dev/null 2>&1 fi + # Updating mail stats + if [ ! -z "$MAIL_SYSTEM" ] && [ "$MAIL_SYSTEM" != 'no' ]; then + $BIN/v-update-sys-rrd-mail $period >/dev/null 2>&1 + fi + # Updating ftp stats if [ ! -z "$FTP_SYSTEM" ] && [ "$FTP_SYSTEM" != 'no' ]; then $BIN/v-update-sys-rrd-ftp $period >/dev/null 2>&1 diff --git a/bin/v-update-sys-rrd-mail b/bin/v-update-sys-rrd-mail new file mode 100755 index 000000000..1f01b52d3 --- /dev/null +++ b/bin/v-update-sys-rrd-mail @@ -0,0 +1,96 @@ +#!/bin/bash +# info: update mail rrd +# options: PERIOD +# +# The function is for updating mail rrd database and graphic. + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +period=${1-daily} + +# Includes +source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Switching on time period +case $period in + daily) start='-1d'; end='now'; grid='MINUTE:30:HOUR:1:HOUR:4:0:%H:%M';; + weekly) start='-7d'; end='now'; grid='HOUR:8:DAY:1:DAY:1:0:%a %d';; + monthly) start='-1m'; end='now'; grid='WEEK:1:WEEK:1:WEEK:1:0:%b %d';; + yearly) start='-1y'; end='now'; grid='MONTH:1:YEAR:1:MONTH:2:2419200:%b';; + *) exit $E_RRD ;; +esac + +# Checking directory +if [ ! -d "$RRD/mail" ]; then + mkdir $RRD/mail +fi + +# Checking database +if [ ! -e "$RRD/mail/mail.rrd" ]; then + # Adding database + rrdtool create $RRD/mail/mail.rrd --step $RRD_STEP \ + DS:A:GAUGE:600:U:U \ + RRA:AVERAGE:0.5:1:600 \ + RRA:AVERAGE:0.5:6:700 \ + RRA:AVERAGE:0.5:24:775 \ + RRA:AVERAGE:0.5:288:797 \ + RRA:MAX:0.5:1:600 \ + RRA:MAX:0.5:6:700 \ + RRA:MAX:0.5:24:775 \ + RRA:MAX:0.5:288:797 +fi + +# Parsing data +if [ "$period" = 'daily' ]; then + a=0 + a=$(exim -bpc) + + # Updating rrd database + rrdtool update $RRD/mail/mail.rrd N:$a +fi + +# Updating daily graph +rrdtool graph $RRD/mail/$period-mail.png \ + --imgformat PNG \ + --height="120" \ + --width="440" \ + --start "$start" \ + --end "$end" \ + --vertical-label "Queue Size" \ + --x-grid "$grid" \ + -c "BACK#7a766d" \ + -c "SHADEA#7a766d" \ + -c "SHADEB#7a766d" \ + -c "FONT#FFFFFF" \ + -c "CANVAS#302c2d" \ + -c "GRID#666666" \ + -c "MGRID#AAAAAA" \ + -c "FRAME#302c2d" \ + -c "ARROW#FFFFFF" \ + DEF:a=$RRD/mail/mail.rrd:A:AVERAGE \ + COMMENT:'\r' \ + LINE1:a#fefda0:"Emails " \ + GPRINT:a:'LAST:Current\:''%8.0lf' \ + GPRINT:a:'MIN:Min\:''%8.0lf' \ + GPRINT:a:'MAX:Max\:''%8.0lf\j' &>/dev/null; result=$? + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +if [ "$result" -ne 0 ]; then + exit $E_RRD +fi + +exit From b5acf1f2b2a80ec41d8d64c061104997b023b4fc Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 14 Jun 2014 11:54:01 +0300 Subject: [PATCH 24/49] Added back button and imporved html layout --- web/templates/login.html | 15 ++++++++++----- web/templates/reset_1.html | 11 ++++++----- web/templates/reset_2.html | 11 ++++++----- web/templates/reset_3.html | 19 ++++++++----------- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/web/templates/login.html b/web/templates/login.html index df6eb4261..d6c838bcc 100644 --- a/web/templates/login.html +++ b/web/templates/login.html @@ -22,7 +22,12 @@ - + + + + + + @@ -45,10 +50,10 @@ - - - - + diff --git a/web/templates/reset_1.html b/web/templates/reset_1.html index cdc3a71eb..291ecba83 100644 --- a/web/templates/reset_1.html +++ b/web/templates/reset_1.html @@ -8,7 +8,7 @@ Vesta Control Panel -
+ @@ -36,10 +37,10 @@ - - - - + diff --git a/web/templates/reset_2.html b/web/templates/reset_2.html index 8658078ee..917bb0ff1 100644 --- a/web/templates/reset_2.html +++ b/web/templates/reset_2.html @@ -16,7 +16,7 @@ - + @@ -28,6 +28,7 @@ + @@ -36,10 +37,10 @@ - - - - + diff --git a/web/templates/reset_3.html b/web/templates/reset_3.html index 396f55f41..fdd0192ea 100644 --- a/web/templates/reset_3.html +++ b/web/templates/reset_3.html @@ -4,10 +4,10 @@ - -
+ Vesta Control Panel + @@ -34,12 +34,9 @@ - - - - @@ -48,10 +45,10 @@
- - - - +
From 3b5f5f738b2439d14a494231bfdcfcdf5d12ed0c Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 14 Jun 2014 11:54:46 +0300 Subject: [PATCH 25/49] little bit more contrast background --- web/css/main.css | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/web/css/main.css b/web/css/main.css index cfa86d9b1..331b58592 100644 --- a/web/css/main.css +++ b/web/css/main.css @@ -1,6 +1,7 @@ body { font-family: Arial, Helvetica, sans-serif; background-color: #e5e5e5; + background-color: #e1e8e8; margin: 0; padding: 0; border: 0; @@ -52,7 +53,7 @@ td { } .top-link:active{ - color: #2361a1; + color: #333; background-color: #f1f1f1; } @@ -65,7 +66,7 @@ td { line-height: 22px; padding: 0 20px 2px; color: #333; - background-color: #f1f1f1; + background-color: #e2e2e2; } .top-selected-link:hover { @@ -195,6 +196,7 @@ td { height: 58px; line-height: 1.4em; font-size: 9pt; + font-family: Arial, Helvetica, sans-serif; color: #333; decoration: none; } @@ -838,12 +840,12 @@ td { } .generate:hover { - color: #7fa1cb; + background-color: #f79b44; + color: #fff; } .generate:active { - background-color: #f79b44; - color: #fff; + background-color: #999; } .vst-advanced { @@ -903,19 +905,18 @@ td { } .login-bottom { - color: #ebe9dc; text-align: right; vertical-align:top; - width: 500px; + width: 474px; height: 50px; margin: 0; + padding: 0 26px 0 0; } .vestacp{ font-size: 8pt; - color: #222; + color: #505050; text-align: right; - padding: 0 8px 0 0; } .error { From 18879e39907c146d9f5142deac56c0bfd1bcbc83 Mon Sep 17 00:00:00 2001 From: jlamer Date: Sun, 15 Jun 2014 16:03:25 +0200 Subject: [PATCH 26/49] Update vst-install-debian.sh Fixed few spelling problems ... --- install/vst-install-debian.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 08189f3aa..8dd53c611 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -24,7 +24,7 @@ help() { -e, --email Set email address -f, --force Force installation -h, --help Print this help and exit - -n, --noupdate Do not run yum update command + -n, --noupdate Do not apt-get upgrade command -m, --mysql-password Set MySQL password instead of generating it -p, --password Set admin password instead of generating it -s, --hostname Set server hostname @@ -72,7 +72,7 @@ while getopts "dhfnqe:m:p:s:" Option; do h) help ;; # Help e) email=$OPTARG ;; # Set email f) force='yes' ;; # Force install - n) noupdate='yes' ;; # Disable yum update + n) noupdate='yes' ;; # Disable apt-get upgrade m) mpass=$OPTARG ;; # MySQL pasword p) vpass=$OPTARG ;; # Admin password s) servername=$OPTARG ;; # Server hostname @@ -89,7 +89,7 @@ fi # Check supported version if [ -e '/etc/redhat-release' ] || [ -e '/etc/lsb-release' ]; then - echo 'Error: sorry, this installer can work only on Debian 7' + echo 'Error: sorry, this installer works only on Debian 7' exit 1 fi @@ -554,9 +554,9 @@ wget $CHOST/$VERSION/apache2-status.conf \ wget $CHOST/$VERSION/apache2.log -O /etc/logrotate.d/apache2 rm -f /etc/apache2/conf.d/vesta.conf echo > /etc/apache2/conf.d/vesta.conf -echo "# Powevered by vesta" > /etc/apache2/sites-available/default -echo "# Powevered by vesta" > /etc/apache2/sites-available/default-ssl -echo "# Powevered by vesta" > /etc/apache2/ports.conf +echo "# Powered by vesta" > /etc/apache2/sites-available/default +echo "# Powered by vesta" > /etc/apache2/sites-available/default-ssl +echo "# Powered by vesta" > /etc/apache2/ports.conf touch /var/log/apache2/access.log touch /var/log/apache2/error.log mkdir -p /var/log/apache2/domains From 1a009ce84e37db4ce7e1e144cc448b23dd9b5353 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jun 2014 12:26:49 +0300 Subject: [PATCH 27/49] a couple spelling errors --- install/vst-install-debian.sh | 2 +- install/vst-install-ubuntu.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 8dd53c611..f3a7eacd4 100644 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -24,7 +24,7 @@ help() { -e, --email Set email address -f, --force Force installation -h, --help Print this help and exit - -n, --noupdate Do not apt-get upgrade command + -n, --noupdate Do not run apt-get upgrade command -m, --mysql-password Set MySQL password instead of generating it -p, --password Set admin password instead of generating it -s, --hostname Set server hostname diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index 65bcac2ad..b40d4f8d9 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -24,7 +24,7 @@ help() { -e, --email Set email address -f, --force Force installation -h, --help Print this help and exit - -n, --noupdate Do not run yum update command + -n, --noupdate Do not run apt-get upgrade command -m, --mysql-password Set MySQL password instead of generating it -p, --password Set admin password instead of generating it -s, --hostname Set server hostname @@ -72,7 +72,7 @@ while getopts "dhfnqe:m:p:s:" Option; do h) help ;; # Help e) email=$OPTARG ;; # Set email f) force='yes' ;; # Force install - n) noupdate='yes' ;; # Disable yum update + n) noupdate='yes' ;; # Disable apt-get upgrade m) mpass=$OPTARG ;; # MySQL pasword p) vpass=$OPTARG ;; # Admin password s) servername=$OPTARG ;; # Server hostname @@ -89,7 +89,7 @@ fi # Check supported version if [ -e '/etc/redhat-release' ]; then - echo 'Error: sorry, this installer can work only on Debian or Ubuntu' + echo 'Error: sorry, this installer works only on Ubuntu' exit 1 fi @@ -557,9 +557,9 @@ fi wget $CHOST/$VERSION/apache2-status.conf \ -O /etc/apache2/mods-enabled/status.conf wget $CHOST/$VERSION/apache2.log -O /etc/logrotate.d/apache2 -echo "# Powevered by vesta" > /etc/apache2/sites-available/default -echo "# Powevered by vesta" > /etc/apache2/sites-available/default-ssl -echo "# Powevered by vesta" > /etc/apache2/ports.conf +echo "# Powered by vesta" > /etc/apache2/sites-available/default +echo "# Powered by vesta" > /etc/apache2/sites-available/default-ssl +echo "# Powered by vesta" > /etc/apache2/ports.conf mkdir -p /etc/apache2/conf.d rm -f /etc/apache2/conf.d/vesta.conf echo > /etc/apache2/conf.d/vesta.conf From b9dd6f4b73be3a7245957eef4cd45dc3f086ab01 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jun 2014 12:28:13 +0300 Subject: [PATCH 28/49] data-count div instead of table --- web/css/main.css | 32 +++++++++---------- web/templates/admin/list_backup.html | 24 ++++++-------- web/templates/admin/list_backup_detail.html | 1 - .../admin/list_backup_exclusions.html | 12 ++----- web/templates/admin/list_cron.html | 24 ++++++-------- web/templates/admin/list_db.html | 23 ++++++------- web/templates/admin/list_dns.html | 23 ++++++------- web/templates/admin/list_dns_rec.html | 24 ++++++-------- web/templates/admin/list_ip.html | 23 ++++++------- web/templates/admin/list_log.html | 23 ++++++------- web/templates/admin/list_mail.html | 23 ++++++------- web/templates/admin/list_mail_acc.html | 23 ++++++------- web/templates/admin/list_packages.html | 23 ++++++------- web/templates/admin/list_rrd.html | 2 +- web/templates/admin/list_search.html | 23 ++++++------- web/templates/admin/list_stats.html | 24 ++++++-------- web/templates/admin/list_user.html | 23 ++++++------- web/templates/admin/list_web.html | 23 ++++++------- web/templates/user/list_cron.html | 24 ++++++-------- web/templates/user/list_db.html | 23 ++++++------- web/templates/user/list_dns.html | 23 ++++++------- web/templates/user/list_dns_rec.html | 25 ++++++--------- web/templates/user/list_mail.html | 24 ++++++-------- web/templates/user/list_mail_acc.html | 23 ++++++------- web/templates/user/list_search.html | 23 ++++++------- web/templates/user/list_stats.html | 24 ++++++-------- web/templates/user/list_user.html | 23 ++++++------- web/templates/user/list_web.html | 23 ++++++------- 28 files changed, 237 insertions(+), 371 deletions(-) diff --git a/web/css/main.css b/web/css/main.css index 331b58592..b2a114e83 100644 --- a/web/css/main.css +++ b/web/css/main.css @@ -1,6 +1,5 @@ body { font-family: Arial, Helvetica, sans-serif; - background-color: #e5e5e5; background-color: #e1e8e8; margin: 0; padding: 0; @@ -28,7 +27,7 @@ td { .top { width: 1000px; position: fixed; background: #fff; - border-bottom: 1px solid #e5e5e5; + border-bottom: 1px solid #e1e8e8; } .top-menu { @@ -66,7 +65,7 @@ td { line-height: 22px; padding: 0 20px 2px; color: #333; - background-color: #e2e2e2; + background-color: #f0f0f0; } .top-selected-link:hover { @@ -126,7 +125,7 @@ td { height: 111px; width: 167px; margin: 0; - border-bottom: 1px solid #e5e5e5; + border-bottom: 1px solid #e1e8e8; } .nav-lnk { @@ -146,7 +145,7 @@ td { width: 119px; float:left; cursor: pointer; - border-bottom: 1px solid #e5e5e5; + border-bottom: 1px solid #e1e8e8; } .nav-block:hover { @@ -320,13 +319,13 @@ td { } .submenu-select-link:hover { - text-decoration: underline; + color: #fff; + background-color: #f79b44; } .submenu-select-link:active { color: #fff; - background-color: #f79b44; - text-decoration: underline; + background-color: #777; } .submenu-select-dropdown { @@ -460,7 +459,7 @@ td { .data-row:hover { margin: 0; - background-color: #f7f6ed; + background-color: #f0f0f0; } .data-row:active { @@ -573,11 +572,9 @@ td { .data-count { font-family: Arial, Helvetica, sans-serif; - background-color: #f3f3f3; - color: #555; + color: #505050; font-size: 8pt; - margin: 18px 0 0 0; - padding: 0 16px 0 0; + padding: 20px 0 20px 174px; } .chart1 { @@ -635,7 +632,7 @@ td { .counter-name { white-space: nowrap; vertical-align:top; - line-height: 1.3em; + line-height: 1.2em; font-size: 10pt; color: #222; padding: 2px 4px 1px 0; @@ -651,7 +648,7 @@ td { .counter-value { vertical-align:top; - line-height: 1.3em; + line-height: 1.2em; font-size: 10pt; color: #222; padding: 2px 0 1px 2px; @@ -858,12 +855,13 @@ td { } .vst-advanced:hover { - color: #7fa1cb; + color: #fff; + background-color: #f79b44; } .vst-advanced:active { color: #fff; - background-color: #f79b44; + background-color: #777; } .fixed{ diff --git a/web/templates/admin/list_backup.html b/web/templates/admin/list_backup.html index 837c5b81c..3fb26ed11 100644 --- a/web/templates/admin/list_backup.html +++ b/web/templates/admin/list_backup.html @@ -135,19 +135,13 @@ - - - - - -
- -
+
+ +
- diff --git a/web/templates/admin/list_backup_detail.html b/web/templates/admin/list_backup_detail.html index a33709886..51dad6dc5 100644 --- a/web/templates/admin/list_backup_detail.html +++ b/web/templates/admin/list_backup_detail.html @@ -264,4 +264,3 @@ - diff --git a/web/templates/admin/list_backup_exclusions.html b/web/templates/admin/list_backup_exclusions.html index a0da3ce53..f78b20ee5 100644 --- a/web/templates/admin/list_backup_exclusions.html +++ b/web/templates/admin/list_backup_exclusions.html @@ -81,13 +81,7 @@ - - - - - -
- ... -
+
+ ... +
- diff --git a/web/templates/admin/list_cron.html b/web/templates/admin/list_cron.html index e52dd9cb7..aa58a26b0 100644 --- a/web/templates/admin/list_cron.html +++ b/web/templates/admin/list_cron.html @@ -138,19 +138,13 @@ - - - - - -
- -
+
+ +
- diff --git a/web/templates/admin/list_db.html b/web/templates/admin/list_db.html index 4ca3dbf04..7d541a81a 100644 --- a/web/templates/admin/list_db.html +++ b/web/templates/admin/list_db.html @@ -159,18 +159,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_dns.html b/web/templates/admin/list_dns.html index 52e6cbeb1..c8091cbca 100644 --- a/web/templates/admin/list_dns.html +++ b/web/templates/admin/list_dns.html @@ -144,18 +144,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_dns_rec.html b/web/templates/admin/list_dns_rec.html index 29e3554ab..e8ebff34b 100644 --- a/web/templates/admin/list_dns_rec.html +++ b/web/templates/admin/list_dns_rec.html @@ -88,19 +88,13 @@ ?> - - - - - -
- - -
+
+ +
diff --git a/web/templates/admin/list_ip.html b/web/templates/admin/list_ip.html index bdd38396a..730e79533 100644 --- a/web/templates/admin/list_ip.html +++ b/web/templates/admin/list_ip.html @@ -135,18 +135,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_log.html b/web/templates/admin/list_log.html index f3a616403..b8771006c 100644 --- a/web/templates/admin/list_log.html +++ b/web/templates/admin/list_log.html @@ -46,18 +46,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_mail.html b/web/templates/admin/list_mail.html index b92729552..1850c5239 100644 --- a/web/templates/admin/list_mail.html +++ b/web/templates/admin/list_mail.html @@ -170,18 +170,13 @@ ?> - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_mail_acc.html b/web/templates/admin/list_mail_acc.html index f7de2b12a..7281384a1 100644 --- a/web/templates/admin/list_mail_acc.html +++ b/web/templates/admin/list_mail_acc.html @@ -142,18 +142,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_packages.html b/web/templates/admin/list_packages.html index 92ebb3333..7b15ea3be 100644 --- a/web/templates/admin/list_packages.html +++ b/web/templates/admin/list_packages.html @@ -159,18 +159,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_rrd.html b/web/templates/admin/list_rrd.html index 3910ffa02..f6eac4b2a 100644 --- a/web/templates/admin/list_rrd.html +++ b/web/templates/admin/list_rrd.html @@ -67,4 +67,4 @@ } ?> - \ No newline at end of file + diff --git a/web/templates/admin/list_search.html b/web/templates/admin/list_search.html index f6e51cdd3..a18044292 100644 --- a/web/templates/admin/list_search.html +++ b/web/templates/admin/list_search.html @@ -193,18 +193,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/admin/list_stats.html b/web/templates/admin/list_stats.html index 69658f152..ff8f8cf28 100644 --- a/web/templates/admin/list_stats.html +++ b/web/templates/admin/list_stats.html @@ -194,19 +194,13 @@ - - - - - -
- -
+
+ +
- diff --git a/web/templates/admin/list_user.html b/web/templates/admin/list_user.html index efa6201cf..3615c3ead 100644 --- a/web/templates/admin/list_user.html +++ b/web/templates/admin/list_user.html @@ -249,18 +249,13 @@ - - - - -
- - -
+
+ +
diff --git a/web/templates/admin/list_web.html b/web/templates/admin/list_web.html index 30ba742f2..5d65c2ed7 100644 --- a/web/templates/admin/list_web.html +++ b/web/templates/admin/list_web.html @@ -209,18 +209,13 @@ - - - - -
- - -
+
+ +
diff --git a/web/templates/user/list_cron.html b/web/templates/user/list_cron.html index 48497801e..067df3d8b 100644 --- a/web/templates/user/list_cron.html +++ b/web/templates/user/list_cron.html @@ -126,19 +126,13 @@ - - - - - -
- -
+
+ +
- diff --git a/web/templates/user/list_db.html b/web/templates/user/list_db.html index 626b394a3..f94ffb9e9 100644 --- a/web/templates/user/list_db.html +++ b/web/templates/user/list_db.html @@ -147,18 +147,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/user/list_dns.html b/web/templates/user/list_dns.html index 12c3f5547..a1544aee9 100644 --- a/web/templates/user/list_dns.html +++ b/web/templates/user/list_dns.html @@ -132,18 +132,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/user/list_dns_rec.html b/web/templates/user/list_dns_rec.html index 227dd233f..933b0a6e3 100644 --- a/web/templates/user/list_dns_rec.html +++ b/web/templates/user/list_dns_rec.html @@ -86,19 +86,14 @@ ?> - - - - - -
- - -
+ +
+ +
diff --git a/web/templates/user/list_mail.html b/web/templates/user/list_mail.html index 75ce9a08d..6491339d4 100644 --- a/web/templates/user/list_mail.html +++ b/web/templates/user/list_mail.html @@ -158,18 +158,14 @@ ?> - - - - - -
- -
+ +
+ +
diff --git a/web/templates/user/list_mail_acc.html b/web/templates/user/list_mail_acc.html index 8120d6ab2..f661b5854 100644 --- a/web/templates/user/list_mail_acc.html +++ b/web/templates/user/list_mail_acc.html @@ -130,18 +130,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/user/list_search.html b/web/templates/user/list_search.html index 414f6b306..373eb5c96 100644 --- a/web/templates/user/list_search.html +++ b/web/templates/user/list_search.html @@ -170,18 +170,13 @@ - - - - - -
- -
+
+ +
diff --git a/web/templates/user/list_stats.html b/web/templates/user/list_stats.html index 33d805598..cb6553677 100644 --- a/web/templates/user/list_stats.html +++ b/web/templates/user/list_stats.html @@ -179,19 +179,13 @@ - - - - - -
- -
+
+ +
- diff --git a/web/templates/user/list_user.html b/web/templates/user/list_user.html index 15af6372b..9f122f8ef 100644 --- a/web/templates/user/list_user.html +++ b/web/templates/user/list_user.html @@ -174,18 +174,13 @@ - - - - -
- - -
+
+ +
diff --git a/web/templates/user/list_web.html b/web/templates/user/list_web.html index 27bac6504..2fd60dec7 100644 --- a/web/templates/user/list_web.html +++ b/web/templates/user/list_web.html @@ -197,18 +197,13 @@ - - - - -
- - -
+
+ +
From 3b7eee439360e5ff560a5612b1f8b6bd77b14011 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 16 Jun 2014 12:28:33 +0300 Subject: [PATCH 29/49] Fixed NameServer validation bug --- func/domain.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/func/domain.sh b/func/domain.sh index 1bf1cde8a..fc10c38da 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -491,9 +491,9 @@ is_dns_nameserver_valid() { if [ ! -z "$remote" ]; then zone=$USER_DATA/dns/$d.conf a_record=$(echo $r |cut -f 1 -d '.') - record=$(grep "RECORD='$a_record'" $zone| grep "TYPE='A'") - if [ -z "$record" ]; then - echo "Error: corresponding A record $a_record.$d is not exist" + n_record=$(grep "RECORD='$a_record'" $zone| grep "TYPE='A'") + if [ -z "$n_record" ]; then + echo "Error: corresponding A record $a_record.$d does not exist" log_event "$E_NOTEXIST" "$EVENT" exit $E_NOTEXIST fi From 809c4b41e1002f9bcc22dd2f30963dd0bde0a253 Mon Sep 17 00:00:00 2001 From: kotso Date: Mon, 16 Jun 2014 17:07:51 +0400 Subject: [PATCH 30/49] Fix DNS_USER variable names In all other files DNS_USER variable is in upper case, here in lower case and when adding remote dns host you are not able to change DNS_USER --- bin/v-add-remote-dns-host | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/v-add-remote-dns-host b/bin/v-add-remote-dns-host index a9bdd25c4..9562840c3 100755 --- a/bin/v-add-remote-dns-host +++ b/bin/v-add-remote-dns-host @@ -17,6 +17,9 @@ password=$4 type=${5-api} dns_user=${6-dns-cluster} +# fix for variable name in other files +DNS_USER=$dns_user + # Includes source $VESTA/func/main.sh source $VESTA/func/remote.sh From 01357404bb362d083dd587634022d526d7b9c9dc Mon Sep 17 00:00:00 2001 From: demlasjr Date: Mon, 16 Jun 2014 18:08:57 +0200 Subject: [PATCH 31/49] Changing conversion: 1 mb = 1024 kb I found that quota is using MB as 1024 KB, but in vestacp, if you set quota for a package 1024 MB, it's showing you 1,02 GB inside the panel. If you edit the package and add 1000 MB, it's showing correctly in the panel, 1GB, but quota is exceeded at 976 MB. humanize_usage use 1000 MB as 1GB instead of 1024 MB, so I fixed it. --- web/inc/main.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/inc/main.php b/web/inc/main.php index abd34fb26..2ce468130 100644 --- a/web/inc/main.php +++ b/web/inc/main.php @@ -151,12 +151,12 @@ function humanize_time($usage) { } function humanize_usage($usage) { - if ( $usage > 1000 ) { - $usage = $usage / 1000; - if ( $usage > 1000 ) { - $usage = $usage / 1000 ; - if ( $usage > 1000 ) { - $usage = $usage / 1000 ; + if ( $usage > 1024 ) { + $usage = $usage / 1024; + if ( $usage > 1024 ) { + $usage = $usage / 1024 ; + if ( $usage > 1024 ) { + $usage = $usage / 1024 ; $usage = number_format($usage, 2); $usage = $usage."".__('pb'); } else { From 6bee67c723d9720fc1b289b208ec5e1a9481a206 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Thu, 19 Jun 2014 23:59:51 +0300 Subject: [PATCH 32/49] Argument length increase. Fixes #165 --- func/main.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/func/main.sh b/func/main.sh index 93cb4caa1..6864545cb 100644 --- a/func/main.sh +++ b/func/main.sh @@ -740,11 +740,16 @@ validate_format_mhdmw() { # proxy extention or DNS record validate_format_common() { exclude="[!|#|$|^|&|(|)|+|=|{|}|:|<|>|?|/|\|\"|'|;|%|\`| ]" - if [[ "$1" =~ $exclude ]] || [ 200 -le ${#1} ]; then + if [[ "$1" =~ $exclude ]]; then echo "Error: $2 $1 is not valid" log_event "$E_INVALID" "$EVENT" exit $E_INVALID fi + if [ 400 -le ${#1} ]; then + echo "Error: $2 $1 is too long" + log_event "$E_INVALID" "$EVENT" + exit $E_INVALID + fi } # DNS record value From a06a90e5bb762eed3bc6c766332e62102585ffe5 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 20 Jun 2014 00:00:15 +0300 Subject: [PATCH 33/49] Custom FTP dir --- bin/v-add-web-domain-ftp | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/bin/v-add-web-domain-ftp b/bin/v-add-web-domain-ftp index d6c3fb45f..129e3939d 100755 --- a/bin/v-add-web-domain-ftp +++ b/bin/v-add-web-domain-ftp @@ -1,6 +1,6 @@ #!/bin/bash # info: add ftp account for web domain. -# options: USER DOMAIN FTP_USER FTP_PASSWORD +# options: USER DOMAIN FTP_USER FTP_PASSWORD FTP_PATH # # The function creates addutional ftp account for web domain. @@ -15,6 +15,7 @@ domain=$(idn -t --quiet -u "$2" ) domain_idn=$(idn -t --quiet -a "$domain") ftp_user=${1}_${3} ftp_password=$4 +ftp_path=$5 # Includes source $VESTA/func/main.sh @@ -30,7 +31,7 @@ EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9" # Verifications # #----------------------------------------------------------# -check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD' +check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD [FTP_PATH]' validate_format 'user' 'domain' 'ftp_user' 'ftp_password' is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM' is_object_valid 'user' 'USER' "$user" @@ -47,7 +48,7 @@ get_domain_values 'web' check_ftp_user=$(grep "^$ftp_user:" /etc/passwd) if [ ! -z "$check_ftp_user" ] && [ "$FTP_USER" != "$ftp_user" ]; then echo "Error: ftp user $ftp_user already exists" - log_event "$E_EXISTS $EVENT" + log_event "$E_EXISTS" "$EVENT" exit $E_EXISTS fi @@ -61,12 +62,29 @@ if [ -e "/usr/bin/rssh" ]; then shell='/usr/bin/rssh' fi +# Define path +if [ -z "$ftp_path" ]; then + ftp_path="$HOMEDIR/$user/web/$domain" +else + ftp_path=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path") + if [ -z "$(echo $ftp_path |grep $HOMEDIR/$user/web/$domain)" ]; then + echo "Error: path $ftp_path is invalid" + log_event "$E_INVALID" "$EVENT" + exit $E_INVALID + fi +fi + +# Create ftp docroot +mkdir -p $ftp_path +chown $user:$user $ftp_path +chmod 751 $ftp_path + # Adding user /usr/sbin/useradd $ftp_user \ -s $shell \ -o -u $(id -u $user) \ -g $(id -u $user) \ - -M -d "$HOMEDIR/$user/web/$domain" > /dev/null 2>&1 + -M -d "$ftp_path" > /dev/null 2>&1 echo "$ftp_user:$ftp_password" | /usr/sbin/chpasswd ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)" @@ -79,6 +97,9 @@ ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)" update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" +add_object_key "web" 'DOMAIN' "$domain" 'FTP_PATH' 'PROXY' +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path" + # Logging log_history "added ftp account $ftp_user for $domain" log_event "$OK" "$EVENT" From 2570dc984c36c1daf651c78e80cbe3ca4c3f76ea Mon Sep 17 00:00:00 2001 From: Kovacs Akos Date: Fri, 20 Jun 2014 00:21:53 +0200 Subject: [PATCH 34/49] Hungarian language file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created by Kovács Ákos. --- web/inc/i18n/hu.php | 443 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 443 insertions(+) create mode 100644 web/inc/i18n/hu.php diff --git a/web/inc/i18n/hu.php b/web/inc/i18n/hu.php new file mode 100644 index 000000000..25b52d700 --- /dev/null +++ b/web/inc/i18n/hu.php @@ -0,0 +1,443 @@ + 'Csomagok', + 'IP' => 'IP', + 'Graphs' => 'Grafikonok', + 'Statistics' => 'Statisztikák', + 'Log' => 'Log', + 'Services' => 'Szolgáltatások', + 'Updates' => 'Frissítések', + 'Log in' => 'Belépés', + 'Log out' => 'Kilépés', + + 'USER' => 'FELHASZNÁLÓ', + 'WEB' => 'WEB', + 'DNS' => 'DNS', + 'MAIL' => 'MAIL', + 'DB' => 'ADATBÁZIS', + 'CRON' => 'CRON', + 'BACKUP' => 'MENTÉS', + + 'Add User' => 'Új felhasználó', + 'Add Domain' => 'Új domain', + 'Add Web Domain' => 'Új Web Domain', + 'Add DNS Domain' => 'Új DNS Domain', + 'Add DNS Record' => 'Új DNS Record', + 'Add Mail Domain' => 'Új Mail Domain', + 'Add Mail Account' => 'Új Mail fiók', + 'Add Database' => 'Új adatbázis', + 'Add Cron Job' => 'Új Cron Job', + 'Create Backup' => 'Mentés készítése', + 'Configure' => 'Beállítás', + 'Restore All' => 'Összes visszaállítása', + 'Add Package' => 'Csomag hozzáadása', + 'Add IP' => 'Új IP', + 'Search' => 'Keresés', + 'Overall Statistics' => 'Átfogó statisztikák', + 'Daily' => 'Napi', + 'Weekly' => 'Heti', + 'Monthly' => 'Havi', + 'Yearly' => 'Éves', + 'Add' => 'Hozzáadás', + 'Back' => 'Vissza', + 'Save' => 'Mentés', + 'Submit' => 'OK', + + 'toggle all' => 'összes kinyit/bezár', + 'apply to selected' => 'alkalmazás a kiválasztottakra', + 'rebuild' => 'újratelepít', + 'rebuild web' => 'web újraépítés', + 'rebuild dns' => 'dns újraépítés', + 'rebuild mail' => 'mail újraépítés', + 'rebuild db' => 'adatbázis újraépítés', + 'rebuild cron' => 'cron újraépítés', + 'update counters' => 'számlálók frissítése', + 'suspend' => 'felfüggeszt', + 'unsuspend' => 'újraaktivál', + 'delete' => 'törlés', + 'show per user' => 'felhasználónként listáz', + 'login as' => 'bejelentkezés, mint', + 'logout' => 'kilépés', + 'edit' => 'szerkesztés', + 'open webstats' => 'statisztikák megnyitása', + 'view logs' => 'logok megnyitása', + 'list records' => '%s record listázása', + 'add record' => 'rekord hozzáadása', + 'list accounts' => '%s fiók listázása', + 'add account' => 'fiók hozzáadása', + 'open webmail' => 'webmail megnyitása', + 'open %s' => '%s megnyitása', + 'download' => 'letöltés', + 'restore' => 'visszaállítás', + 'configure restore settings' => 'visszaállítási beállítások konfigurálása', + 'stop' => 'stop', + 'start' => 'start', + 'restart' => 'újraindítás', + 'update' => 'frissítés', + 'generate' => 'létrehoz', + 'Generate CSR' => 'CSR generálás', + 'reread IP' => 'IP újraolvasása', + 'enable autoupdate' => 'automatikus frissítés engedélyezése', + 'disable autoupdate' => 'automatikus frissítés tiltása', + + 'Adding User' => 'Felhasználó hozzáadása', + 'Editing User' => 'Felhasználó szerkesztése', + 'Adding Domain' => 'Domain hozzáadása', + 'Editing Domain' => 'Domain szerkesztése', + 'Adding DNS Domain' => 'DNS Domain hozzáadása', + 'Editing DNS Domain' => 'DNS Domain szerkesztése', + 'Adding DNS Record' => 'DNS Rekord hozzáadása', + 'Editing DNS Record' => 'DNS Record szerkesztése', + 'Adding Mail Domain' => 'Mail Domain hozzáadása', + 'Editing Mail Domain' => 'Mail Domain szerkesztése', + 'Adding Mail Account' => 'Mail Fiók hozzáadása', + 'Editing Mail Account' => 'Mail Fiók szerkesztése', + 'Adding database' => 'Adatbázis hozzáadása', + 'Editing Cron Job' => 'Cron Job szerkesztése', + 'Adding Cron Job' => 'Cron Job hozzáadása', + 'Editing Database' => 'Adatbázis szerkesztése', + 'Adding Package' => 'Csomag hozzáadása', + 'Editing Package' => 'Csomag szerkesztése', + 'Adding IP address' => 'IP cím hozzáadása', + 'Editing IP Address' => 'IP cím szerkesztése', + 'Editing Backup Exclusions' => 'Mentési kivételek szerkesztése', + 'Generating CSR' => 'CSR generálása', + 'Listing' => 'Listázás', + 'Search Results' => 'Keresési eredmények', + + 'active' => 'aktív', + 'spnd' => 'felfüggesztett', + 'suspended' => 'felfüggesztett', + 'running' => 'fut', + 'stopped' => 'megállított', + 'outdated' => 'elavult', + 'updated' => 'frissített', + + 'yes' => 'igen', + 'no' => 'nem', + 'none' => 'egyik sem', + 'pb' => 'pb', + 'tb' => 'tb', + 'gb' => 'gb', + 'mb' => 'mb', + 'minute' => 'perc', + 'hour' => 'óra', + 'day' => 'nap', + 'days' => 'nap', + 'hours' => 'óra', + 'minutes' => 'perc', + 'month' => 'hónap', + 'package' => 'csomag', + 'Bandwidth' => 'Sávszélesség', + 'Disk' => 'Lemezterület', + 'Web' => 'Web', + 'Mail' => 'Mail', + 'Databases' => 'Adatbázis', + 'User Directories' => 'Felhasználói könyvtárak', + 'Template' => 'Sablon', + 'Web Template' => 'Apache sablon, + 'Proxy Template' => 'Nginx sablon', + 'DNS Template' => 'DNS sablon', + 'Web Domains' => 'Web Domainek', + 'SSL Domains' => 'SSL Domainek', + 'Web Aliases' => 'Web Alias', + 'per domain' => 'domainenként', + 'DNS domains' => 'DNS Domainek', + 'DNS domains' => 'DNS Domainek', + 'DNS records' => 'DNS recordok' , + 'Name Servers' => 'Name Serverek', + 'Mail Domains' => 'Mail Domainek', + 'Mail Accounts' => 'Mail Fiókok', + 'Cron Jobs' => 'Cron Jobs', + 'SSH Access' => 'SSH hozzáférés', + 'IP Addresses' => 'IP Címek', + 'Backups' => 'Mentések', + 'Backup System' => 'Mentési rendszer', + 'backup exclusions' => 'kihagyás a mentésből', + 'template' => 'sablon', + 'SSL Support' => 'SSL támogatás', + 'SSL Home Directory' => 'SSL kezdőlap', + 'Proxy Support' => 'Nginx támogatás', + 'Proxy Extensions' => 'Nginx kiterjesztések', + 'Web Statistics' => 'Web statisztikák', + 'Additional FTP Account' => 'Hozzáadott FTP', + 'SOA' => 'SOA', + 'TTL' => 'TTL', + 'Expire' => 'Lejár', + 'Records' => 'Rekordok', + 'Catchall email' => 'Catchall email', + 'AntiVirus Support' => 'AntiVirus támogatás', + 'AntiSpam Support' => 'AntiSpam támogatás', + 'DKIM Support' => 'DKIM támogatás', + 'Accounts' => 'Fiókok', + 'Quota' => 'Kvóta', + 'Autoreply' => 'Automatikus válasz', + 'Forward to' => 'Továbbítás', + 'Do not store forwarded mail' => 'Továbbított e-mailek mentésének tiltása', + 'database' => 'adatbázis', + 'User' => 'Felhasználó', + 'Host' => 'Hoszt', + 'Charset' => 'Karakterkódolás', + 'Min' => 'Perc', + 'Hour' => 'Óra', + 'Day' => 'Nap', + 'Month' => 'Hónap', + 'Day of week' => 'A hét napja', + 'local' => 'helyi', + 'Run Time' => 'Futási idő', + 'Backup Size' => 'Mentés mérete', + 'SYS' => 'SYS', + 'Domains' => 'Domainek', + 'Status' => 'Státusz', + 'shared' => 'megosztott', + 'dedicated' => 'dedikált', + 'Owner' => 'Tulajdonos', + 'Users' => 'Felhasználók', + 'Load Average' => 'Load átlag', + 'Memory Usage' => 'Memória használat', + 'HTTPD Usage' => 'HTTPD használat', + 'NGINX Usage' => 'NGINX használat', + 'MySQL Usage on localhost' => 'MySQL használat a localhoston', + 'PostgreSQL Usage on localhost' => 'PostgreSQL használat a localhoston', + 'Bandwidth Usage eth0' => 'eth0 sávszélesség használat', + 'FTP Usage' => 'FTP használat', + 'SSH Usage' => 'SSH használat', + 'reverse proxy' => 'fordított proxy', + 'web server' => 'web szerver', + 'dns server' => 'dns szerver', + 'mail server' => 'mail szerver', + 'pop/imap server' => 'pop/imap szerver', + 'email antivirus' => 'email antivirus', + 'email antispam' => 'email antispam', + 'database server' => 'adatbázis szerver', + 'ftp server' => 'ftp szerver', + 'job scheduler' => 'job ütemező', + 'CPU' => 'CPU', + 'Memory' => 'Memória', + 'Uptime' => 'Futási idő', + 'core package' => 'alapcsomag', + 'php interpreter' => 'php értelmező', + 'internal web server' => 'külső web szerver', + 'Version' => 'Verzió', + 'Release' => 'Kiadás', + 'Architecture' => 'Architektúra', + 'Object' => 'Objektum', + 'Owner' => 'Tulajdonos', + 'Username' => 'Felhasználónév', + 'Password' => 'Jelszó', + 'Email' => 'Email', + 'Package' => 'Csomag', + 'Language' => 'Nyelv', + 'First Name' => 'Keresztnév', + 'Last Name' => 'Vezetéknév', + 'Send login credentials to email address' => 'Belépési adatok küldése e-mailben', + 'Default Template' => 'Alapértelmezett sablon', + 'Default Name Servers' => 'Alapértelmezett névszerverek', + 'Domain' => 'Domain', + 'DNS Support' => 'DNS támogatás', + 'Mail Support' => 'Mail támogatás', + 'Advanced options' => 'Haladó beállítások', + 'Aliases' => 'Aliaszok', + 'SSL Certificate' => 'SSL igazolás', + 'SSL Key' => 'SSL kulcs', + 'SSL Certificate Authority / Intermediate' => 'SSL igazolás engedélyezése', + 'SSL CSR' => 'SSL CSR', + 'optional' => 'opcionális', + 'internal' => 'belső', + 'Statistics Authorization' => 'Statisztika engedélyezése', + 'Statistics Auth' => 'Statisztika engedélyezése', + 'Account' => 'Fiók', + 'Prefix will be automaticaly added to username' => 'A(z) %s előtag automatikusan hozzáadásra kerül a felhasználónévhez.', + 'Send FTP credentials to email' => 'FTP adatok küldése e-mailben', + 'Expiration Date' => 'Lejárati dárum', + 'YYYY-MM-DD' => 'ÉÉÉÉ-HH-NN', + 'Name servers' => 'Névszerverek', + 'Record' => 'Rekord', + 'IP or Value' => 'IP avgy érték', + 'Priority' => 'Prioritás', + 'Record Number' => 'Rekord száma', + 'in megabytes' => 'megabájtokban', + 'Message' => 'üzenet', + 'use local-part' => 'helyi rész használata', + 'one or more email addresses' => 'egy vagy több e-mail cím', + 'Prefix will be automaticaly added to database name and database user' => 'A(z) %s előtag automatikusan hozzáadásra kerül az adatbázis felhasználónévhez', + 'Database' => 'Adatbázis', + 'Type' => 'Típus', + 'Minute' => 'Perc', + 'Command' => 'Parancs', + 'Package Name' => 'Csomagnév', + 'Netmask' => 'Netmask', + 'Interface' => 'Interfész', + 'Shared' => 'Megosztott', + 'Assigned user' => 'Hozzárendelt felhasználó', + 'Assigned domain' => 'Hozzárendelt domain', + 'NAT IP association' => 'NAT IP hozzárendelés', + 'shell' => 'rendszerhéj', + 'web domains' => 'web domainek', + 'web aliases' => 'web aliaszok', + 'dns records' => 'dns rekordok', + 'mail domains' => 'mail domainek', + 'mail accounts' => 'mail fiókok', + 'accounts' => 'fiókok', + 'databases' => 'adatbázisok', + 'cron jobs' => 'cron jobs', + 'backups' => 'mentések', + 'quota' => 'kvóta', + 'day of week' => 'a hét napja', + 'cmd' => 'cmd', + 'users' => 'felhasználók', + 'domains' => 'domainek', + 'aliases' => 'aliaszok', + 'records' => 'rekordok', + 'jobs' => 'jobs', + 'username' => 'felhasználónév', + 'password' => 'jelszó', + 'type' => 'típus', + 'charset' => 'karakterkódolás', + 'domain' => 'domain', + 'ip' => 'ip', + 'ip address' => 'ip cím', + 'IP address' => 'IP cím', + 'netmask' => 'netmaszk', + 'interface' => 'interfész', + 'assigned user' => 'hozzárendelt felhasználó', + 'ns1' => 'ns1', + 'ns2' => 'ns2', + 'user' => 'felhasználó', + 'email' => 'email', + 'first name' => 'vezetéknév', + 'last name' => 'keresztnév', + 'account' => 'fiók', + 'ssl certificate' => 'ssl hitelesítés', + 'ssl key' => 'ssl kulcs', + 'stats user password' => 'stats user password', + 'stats username' => 'stats username', + 'stats password' => 'stats password', + 'ftp user password' => 'ftp felhasználónév', + 'ftp user' => 'ftp felhasználó', + 'Last 70 lines of %s.%s.log' => 'A %s.%s.log utolsó 70 sora', + 'Download AccessLog' => 'AccessLog letöltése', + 'Download ErrorLog' => 'ErrorLog letöltése', + 'Country' => 'Ország', + '2 letter code' => '2 Irányítószám', + 'State / Province' => 'Megye', + 'City / Locality' => 'Város', + 'Organization' => 'Szervezet', + + '1 account' => '1 fiók', + '%s accounts' => '%s fiók', + '1 domain' => '1 domain', + '%s domains' => '%s domainek', + '1 record' => '1 rekord', + '%s records' => '%s recordok', + '1 mail account' => '1 mail fiók', + '%s mail accounts' => '%s mail fiókok', + '1 database' => '1 adatbázis', + '%s databases' => '%s adatbázis', + '1 cron job' => '1 cron job', + '%s cron jobs' => '%s cron job', + '1 archive' => '1 archívum', + '%s archives' => '%s archívum', + '1 package' => '1 csomag', + '%s packages' => '%s csomag', + '1 IP address' => '1 IP cím', + '%s IP addresses' => '%s IP cím', + '1 month' => '1 hónap', + '%s months' => '%s hónap', + '1 log record' => '1 log rekord', + '%s log records' => '%s log rekord', + '1 object' => '1 objektum', + '%s objects' => '%s objektum', + 'no exclusions' => 'nincs kihagyás', + + 'USER_CREATED_OK' => '%s felhasználó sikeresen létrehozva.', + 'WEB_DOMAIN_CREATED_OK' => '%s domain sikeresen létrehozva.', + 'DNS_DOMAIN_CREATED_OK' => '%s DNS domain sikeresen létrehozva.', + 'DNS_RECORD_CREATED_OK' => '%s.%s rekord sikeresen létrehozva.', + 'MAIL_DOMAIN_CREATED_OK' => '%s ail domain sikeresen létrehozva.', + 'MAIL_ACCOUNT_CREATED_OK' => '%s@%s mail fiók sikeresen létrehozva.', + 'DATABASE_CREATED_OK' => '%s adatbázis sikeresen létrehozva.', + 'CRON_CREATED_OK' => 'Cron job sikeresen létrehozva.', + 'IP_CREATED_OK' => '%s IP cím sikeresen létrehozva.', + 'PACKAGE_CREATED_OK' => 'A(z) %s csomag sikeresen létrehozva.', + 'SSL_GENERATED_OK' => 'A tanúsítvány sikeresen létrehozva.', + 'Autoupdate has been successfully enabled' => 'Az automatikus frissítés bekapcsolva.', + 'Autoupdate has been successfully disabled' => 'Az automatikus frissítés kikapcsolva.', + 'Changes has been saved.' => 'A módosítások sikeresen mentésre kerültek.', + 'Confirmation' => 'Megerősítés', + 'DELETE_USER_CONFIRMATION' => 'Biztos, hogy törölni szeretnéd %s felhasználót?', + 'SUSPEND_USER_CONFIRMATION' => 'Biztos, hogy felfüggeszted %s felhasználót?', + 'UNSUSPEND_USER_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni %s felhasználót?', + 'DELETE_DOMAIN_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s domaint?', + 'SUSPEND_DOMAIN_CONFIRMATION' => 'Biztos, hogy felfüggeszted a(z) %s domaint?', + 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a(z) %s domaint?', + 'DELETE_RECORD_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s rekordot?', + 'SUSPEND_RECORD_CONFIRMATION' => 'Biztos, hogy felfüggeszted a(z) %s rekordot?', + 'UNSUSPEND_RECORD_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a(z) %s rekordot?', + 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s -t?', + 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Biztos, hogy felfüggeszted a(z) %s -t?', + 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a(z) %s -t?', + 'DELETE_DATABASE_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s adatbázist?', + 'SUSPEND_DATABASE_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a(z) %s adatbázist?', + 'UNSUSPEND_DATABASE_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a(z) %s adatbázist?', + 'DELETE_CRON_CONFIRMATION' => 'Biztos, hogy törlöd a cron job-ot?', + 'SUSPEND_CRON_CONFIRMATION' => 'Biztos, hogy felfüggeszted a cron job-ot?', + 'UNSUSPEND_CRON_CONFIRMATION' => 'Biztos, hogy újra szeretnéd aktiválni a cron job-ot?', + 'DELETE_BACKUP_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s mentést?', + 'DELETE_EXCLUSION_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s kivételt?', + 'DELETE_PACKAGE_CONFIRMATION' => 'Biztos, hogy törlöd a(z) %s csomagot?', + 'DELETE_IP_CONFIRMATION' => 'Biztos, hogy törlöd a(z) IP címet?', + 'Welcome' => 'Üdvözöljük', + 'LOGGED_IN_AS' => 'Belépve, mint %s', + 'Error' => 'Hiba', + 'Invalid username or password' => 'Hibás felhasználónév vagy jelszó', + 'Invalid username or code' => 'Hibás felhasználónév vagy kód + 'Passwords not match' => 'A jelszavak nem egyeznek meg', + 'Please enter valid email address.' => 'Kérlek valós e-mail címet adj meg!', + 'Field "%s" can not be blank.' => 'A(z) "%s" mező nem lehet üres.', + 'Password is too short.' => 'A jelszó túl rövid.(minimum 6 karakter)', + 'Error code:' => 'Hibakód: %s', + 'SERVICE_ACTION_FAILED' => 'A(z) "%s" "%s" meghiúsult', + 'IP address is in use' => 'Az IP cím használatban van.', + 'BACKUP_SCHEDULED' => 'A feladat végrehajtás alatt. A mentés elkészültéről e-mail értesítést fogunk küldeni.', + 'BACKUP_EXISTS' => 'Egy mentés már folyamatban van. Kérlek várj, míg elkészül.', + 'RESTORE_SCHEDULED' => 'A feladat a végrehajtási sorba került. A mentés elkészültéről e-mail értesítést fogunk küldeni.', + 'RESTORE_EXISTS' => 'Egy visszaállítás már folyamatban van. Kérlek várj, míg elkészül.', + + 'WEB_EXCLUSIONS' => "Írd be a domain nevet, soronként egyet. Az összes kihagyásához használj "*" -ot. Adott könyvtár kihagyásához használd a következő formátumot: domain.com:public_html/cache:public_html/tmp", + 'DNS_EXCLUSIONS' => "Írd be a domain nevet, soronként egyet. Az összes kihagyásához használj "*" -ot.", + 'MAIL_EXCLUSIONS' => "Írd be a domain nevet, soronként egyet. Az összes domain kihagyásához használj "*" -ot. Adott fiók kihagyásához használd a következő formátumot: domain.com:info:support:postmaster", + 'DB_EXCLUSIONS' => "Írd be az adatbázis teljes nevét, soronként egyet. Az összes adatbázis kihagyásához használj "*" -ot", + 'CRON_EXCLUSIONS' => "Az összes job kihagyásához használj "*" -ot.", + 'USER_EXCLUSIONS' => "Írd be a könyvtár nevét, soronként egyet. Az összes kihagyásához használj "*" -ot.", + + 'Welcome to Vesta Control Panel' => 'Üdv, a Kezelőfelület!', + 'MAIL_FROM' => 'Kezelőfelület ', + 'GREETINGS_GORDON_FREEMAN' => "Üdv, %s %s,\n", + 'GREETINGS' => "Üdv,\n", + 'ACCOUNT_READY' => "A fiókod létrejött és készen áll a használatra.\n\nhttps://%s/login/\nFelhasználónév: %s\nJelszó: %s\n\n--\nKezelőfelület\n", + + 'FTP login credentials' => 'FTP belépési adatok', + 'FTP_ACCOUNT_READY' => "Az FTP felhasználó létrejött és készen áll a használatra.\n\nKiszolgáló: %s\nFelhasználónév: %s_%s\nJelszó: %s\n\n--\nKezelőfelület\n", + + 'Database Credentials' => 'Adatbázis adatok', + 'DATABASE_READY' => "Az adatbázis létrejött és készen áll a használatra.\n\nAdatbázis: %s\nFelhasználónév: %s\nJelszó: %s\n%s\n\n--\nKezelőfelület\n", + + 'forgot password' => 'elfelejtett jelszó', + 'Confirm' => 'Megerősít', + 'New Password' => 'Új jelszó', + 'Confirm Password' => 'Jelszó megerősítése', + 'Reset' => 'Visszaállít', + 'Reset Code' => 'Kód újragenerálása', + 'RESET_NOTICE' => '', + 'RESET_CODE_SENT' => 'A jelszó visszaállításhoz szükséges kód elküldésre került az e-mail címedre
', + 'MAIL_RESET_SUBJECT' => 'Jelszó újragenerálás %s -kor', + 'PASSWORD_RESET_REQUEST' => "A panel jelszavad visszaállításához kattints a következő linkre:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nAlternatively, vagy használd a következőt https://%s/reset/?action=code&user=%s és írd be a kódot:\n%s\n\nHa nem Te kérted a visszaállítást, kérlek hagyd figyelmen kívül ezt a levelet.\n\n--\nKezelőfelület\n", +); From 7e2a37771e4d4e6e2f4c145e8f5c5035e423c093 Mon Sep 17 00:00:00 2001 From: Bashar Al-Abdulhadi Date: Mon, 30 Jun 2014 12:30:56 +0300 Subject: [PATCH 35/49] ar.php Arabic Language file --- web/inc/i18n/ar.php | 441 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 441 insertions(+) create mode 100644 web/inc/i18n/ar.php diff --git a/web/inc/i18n/ar.php b/web/inc/i18n/ar.php new file mode 100644 index 000000000..0aba39923 --- /dev/null +++ b/web/inc/i18n/ar.php @@ -0,0 +1,441 @@ + 'الحزم', + 'IP' => 'بروتوكول إنترنت', + 'Graphs' => 'رسوم بيانية', + 'Statistics' => 'إحصائيات', + 'Log' => 'سجل', + 'Services' => 'خدمات', + 'Updates' => 'تحديثات', + 'Log in' => 'تسجيل الدخول', + 'Log out' => 'تسجيل الخروج', + + 'USER' => 'المستخدم', + 'WEB' => 'الشبكة', + 'DNS' => 'نظام أسماء النظاقات', + 'MAIL' => 'البريد', + 'DB' => 'قاعدة بيانات', + 'CRON' => 'مجدول الوظائف', + 'BACKUP' => 'النسخ الإحتياطية', + + 'Add User' => 'إضافة مستخدم', + 'Add Domain' => 'إضافة نطاق', + 'Add Web Domain' => 'إضافة نطاق شبكة', + 'Add DNS Domain' => 'تسجيل نطاق في النظام', + 'Add DNS Record' => 'إضافة سجل للنظام', + 'Add Mail Domain' => 'إضافة نطاق بريدي', + 'Add Mail Account' => 'إضافة حساب بريدي', + 'Add Database' => 'إضافة قاعدة بيانات', + 'Add Cron Job' => 'إضافة وظيفة مجدولة', + 'Create Backup' => 'إنشاء نسخة احتياطية', + 'Configure' => 'تهيئة', + 'Restore All' => 'استرجاع الكل', + 'Add Package' => 'إضافة رزمة', + 'Add IP' => 'إضافة بروتوكول إنترنت', + 'Search' => 'بحث', + 'Overall Statistics' => 'إحصائيات عامة', + 'Daily' => 'يومي', + 'Weekly' => 'أسبوعي', + 'Monthly' => 'شهري', + 'Yearly' => 'سنوي', + 'Add' => 'إضافة', + 'Back' => 'رجوع', + 'Save' => 'حفظ', + 'Submit' => 'تسليم', + + 'toggle all' => 'تبديل الجميع', + 'apply to selected' => 'تطبيق على ما تم اختياره', + 'rebuild' => 'إعادة إنشاء', + 'rebuild web' => 'إعادة إنشاء الشبكة', + 'rebuild dns' => 'إعادة إنشاء نظام أسماء النطاقات', + 'rebuild mail' => 'إعادة إنشاء البريد', + 'rebuild db' => 'إعادة إنشاء قاعدة البيانات', + 'rebuild cron' => 'إعادة إنشاء مجدول الوظائف', + 'update counters' => 'تحديث العدادات', + 'suspend' => 'تعليق', + 'unsuspend' => 'إلغاء التعليق', + 'delete' => 'حذف', + 'show per user' => 'عرض حسب المستخدم', + 'login as' => 'تسجيل الدخول ك', + 'logout' => 'تسجيل الخروج', + 'edit' => 'تعديل', + 'open webstats' => 'فتح احصائيات الشبكة', + 'view logs' => 'عرض السجلات', + 'list records' => 'عرض السجلات', + 'add record' => 'إضافة سجل', + 'list accounts' => 'عرض الحسابات', + 'add account' => 'إضافة حساب', + 'open webmail' => 'فتح شبكة البريد', + 'open %s' => 'فتح %s', + 'download' => 'تحميل', + 'restore' => 'استرجاع', + 'configure restore settings' => 'تهيئة إعدادات الاسترجاع', + 'stop' => 'إيقاف', + 'start' => 'بدء', + 'restart' => 'إعادة تشغيل', + 'update' => 'تحديث', + 'generate' => 'تكوين', + 'Generate CSR' => 'تكوين طلب توقيع شهادة', + 'reread IP' => 'إعادة قراءة بروتوكول الإنترنت', + 'enable autoupdate' => 'تمكين التحديث التلقائي', + 'disable autoupdate' => 'تعطيل التحديث التلقائي', + + 'Adding User' => 'جاري إضافة مستخدم', + 'Editing User' => 'جاري تعديل المستخدم', + 'Adding Domain' => 'جاري إضافة نطاق', + 'Editing Domain' => 'جاري تعديل النطاق', + 'Adding DNS Domain' => 'جاري إضافة نطاق للنظام', + 'Editing DNS Domain' => 'جاري تعديل النطاق بالنظام', + 'Adding DNS Record' => 'جاري إضافة سجل للنظام', + 'Editing DNS Record' => 'جاري تعديل السحجل بالنظام', + 'Adding Mail Domain' => 'جاري إضافة نطاق بريدي', + 'Editing Mail Domain' => 'جاري تعديل النظاق البريدي', + 'Adding Mail Account' => 'جاري إضافة حساب بريدي', + 'Editing Mail Account' => 'جاري تعديل الحساب البريدي', + 'Adding database' => 'جاري إضافة قاعدة بيانات', + 'Editing Cron Job' => 'جاري تعديل وظيفة مجدولة', + 'Adding Cron Job' => 'جاري إضافة وظيفة مجدولة', + 'Editing Database' => 'جاري تعديل قاعدة البيانات', + 'Adding Package' => 'جاري إضافة رزمة', + 'Editing Package' => 'جاري تعديل الرزمة', + 'Adding IP address' => 'جاري إضافة عنوان بروتوكول إنترنت', + 'Editing IP Address' => 'جاري تعديل عنوان بروتوكول إنترنت', + 'Editing Backup Exclusions' => 'جاري تعديل استثناءات النسخة الاحتياطية', + 'Generating CSR' => 'جاري إنشاء طلب توقيع شهادة', + 'Listing' => 'قائمة', + 'Search Results' => 'نتائج البحث', + + 'active' => 'نشط', + 'spnd' => 'معلق', + 'suspended' => 'معلق', + 'running' => 'يعمل', + 'stopped' => 'متوقف', + 'outdated' => 'نسخة قديمة', + 'updated' => 'محدث', + + 'yes' => 'نعم', + 'no' => 'لا', + 'none' => 'لا شيء', + 'pb' => 'pb', + 'tb' => 'tb', + 'gb' => 'gb', + 'mb' => 'mb', + 'minute' => 'دقيقة', + 'hour' => 'ساعة', + 'day' => 'يوم', + 'days' => 'أيام', + 'hours' => 'ساعات', + 'minutes' => 'دقائق', + 'month' => 'شهر', + 'package' => 'رزمة', + 'Bandwidth' => 'عرض النطاق', + 'Disk' => 'إسطوانة', + 'Web' => 'شبكة', + 'Mail' => 'بريد', + 'Databases' => 'قواعد بيانات', + 'User Directories' => 'مجلدات المستخدم', + 'Template' => 'نموذج', + 'Web Template' => 'أباتشي نموذج', + 'Proxy Template' => 'Nginx نموذج', + 'DNS Template' => 'نظام أسماء النطاقات نموذج', + 'Web Domains' => 'نطاقات الشبكة', + 'SSL Domains' => 'نطاقات آمنة', + 'Web Aliases' => 'اختصارات الشبكة', + 'per domain' => 'لكل نطاق', + 'DNS domains' => 'نطاقات النظام', + 'DNS domains' => 'نطاقات النظام', + 'DNS records' => 'سجلات النظام' , + 'Name Servers' => 'خوادم الأسماء', + 'Mail Domains' => 'نطاقات البريد', + 'Mail Accounts' => 'حسابات البريد', + 'Cron Jobs' => 'الوظائق المجدولة', + 'SSH Access' => 'وصول بعيد آمن', + 'IP Addresses' => 'عنوان بروتوكول انترنت', + 'Backups' => 'نسخ احتياطية', + 'Backup System' => 'نظام النسخ الاحتياطي', + 'backup exclusions' => 'استثناءات النسخ الاحتياطي', + 'template' => 'نموذج', + 'SSL Support' => 'دعم طبقة المقبض الآمن', + 'SSL Home Directory' => 'المجلد الرئيسي لطبقة المقبض الآمن', + 'Proxy Support' => 'Nginx دعم', + 'Proxy Extensions' => 'Nginx إمتدادات', + 'Web Statistics' => 'إحصائيات الشبكة', + 'Additional FTP Account' => 'حساب بروتوكول نقل الملفات إضافي', + 'SOA' => 'هيكلية الخدمات الموجهة', + 'TTL' => 'الوقت المتبقي للخروج', + 'Expire' => 'تنقضي', + 'Records' => 'سجلات', + 'Catchall email' => 'حصل كل البريد', + 'AntiVirus Support' => 'دعم مضاد الفيروسات', + 'AntiSpam Support' => 'دعم مضاد البريد المزعج', + 'DKIM Support' => 'دعم مفاتيح النطاقات', + 'Accounts' => 'حسابات', + 'Quota' => 'حصة', + 'Autoreply' => 'الرد الآلي', + 'Forward to' => 'إعادة توجيه ل', + 'Do not store forwarded mail' => 'لا تحتفظ بنسخة من البريد المعاد توجيهه', + 'database' => 'قاعدة بيانات', + 'User' => 'مستخدم', + 'Host' => 'مضيف', + 'Charset' => 'حزمة نص', + 'Min' => 'دقيقة', + 'Hour' => 'ساعة', + 'Day' => 'يوم', + 'Month' => 'شهر', + 'Day of week' => 'اليوم في الإسبوع', + 'local' => 'محلي', + 'Run Time' => 'وقت التشغيل', + 'Backup Size' => 'حجم النسخة الاحتياطية', + 'SYS' => 'نظام', + 'Domains' => 'نطاقات', + 'Status' => 'حالة', + 'shared' => 'مشارك', + 'dedicated' => 'موجه', + 'Owner' => 'مالك', + 'Users' => 'مستخدمين', + 'Load Average' => 'متوسط التحميل', + 'Memory Usage' => 'استخدام الذاكرة', + 'HTTPD Usage' => 'استخدام نظام بروتوكول نقل النص التشعبي', + 'NGINX Usage' => 'NGINX استخدام', + 'MySQL Usage on localhost' => 'استخدام قاعدة بيانات MySql على المضيف المحلي', + 'PostgreSQL Usage on localhost' => 'PostgreSQL استخدام قاعدة بيانات على المضيف المحلي', + 'Bandwidth Usage eth0' => 'eth0 استخدام سعة النطاق على منفذ', + 'FTP Usage' => 'استخدام بروتوكول نقل الملفات', + 'SSH Usage' => 'استخدام الوصول البعيد الآمن', + 'reverse proxy' => 'الوكيل العكسي', + 'web server' => 'خادم الشبكة', + 'dns server' => 'خادم نظام أسماء النطاقات', + 'mail server' => 'خادم البريد', + 'pop/imap server' => 'pop/imap خادم', + 'email antivirus' => 'مضاد فيروسات البريد', + 'email antispam' => 'مضاد البريد المزعج', + 'database server' => 'خادم قاعدة البيانات', + 'ftp server' => 'خادم بروتوكول نقل الملفات', + 'job scheduler' => 'مجدول الوظائف', + 'CPU' => 'وحدة المعالجة المركزية', + 'Memory' => 'الذاكرة', + 'Uptime' => 'وقت التشغيل', + 'core package' => 'الرزمة الأساسية', + 'php interpreter' => 'php مترجم', + 'internal web server' => 'خادم الشبكة الداخلي', + 'Version' => 'إصدار', + 'Release' => 'نسخة', + 'Architecture' => 'هيكلية', + 'Object' => 'عنصر', + 'Owner' => 'مالك', + 'Username' => 'اسم المستخدم', + 'Password' => 'كلمة المرور', + 'Email' => 'بريد', + 'Package' => 'رزمة', + 'Language' => 'لغة', + 'First Name' => 'الإسم الأول', + 'Last Name' => 'الإسم الأخير', + 'Send login credentials to email address' => 'إرسال معلومات الدخول لعنوان البريد', + 'Default Template' => 'نموذج افتراضي', + 'Default Name Servers' => 'أسماء الخوادم الافتراضية', + 'Domain' => 'نطاق', + 'DNS Support' => 'دعم نظام أسماء النطاقات', + 'Mail Support' => 'دعم البريد', + 'Advanced options' => 'خيارات متقدمة', + 'Aliases' => 'اختصارات', + 'SSL Certificate' => 'شهادة طبقة مقبس آمن', + 'SSL Key' => 'مفتاح طبقة المقبس الآمن', + 'SSL Certificate Authority / Intermediate' => 'سلطة / متوسط شهادة طبقة المقبس الآمن ', + 'SSL CSR' => 'طلب توقيع شهادة باستخدام طبقة المقبس الآمن', + 'optional' => 'اختياري', + 'internal' => 'داخلي', + 'Statistics Authorization' => 'احصائيات الصلاحيات', + 'Statistics Auth' => 'إحصائيات الصلاحيات', + 'Account' => 'حساب', + 'Prefix will be automaticaly added to username' => 'سيضاف بشكل آلي لأسم المستخدم %s اختصار', + 'Send FTP credentials to email' => 'إرسال معلومات الاعتماد لبروتوكول نقل الملفات للبريد', + 'Expiration Date' => 'تاريخ الانتهاء', + 'YYYY-MM-DD' => 'YYYY-MM-DD', + 'Name servers' => 'خوادم الأسماء', + 'Record' => 'سجل', + 'IP or Value' => 'بروتوكول إنترنت أو قيمة', + 'Priority' => 'أولوية', + 'Record Number' => 'عدد السجلات', + 'in megabytes' => 'ب ميجا بابت', + 'Message' => 'رسالة', + 'use local-part' => 'استخدم جزء محلي', + 'one or more email addresses' => 'عنوان بريدي واحد أو أكثر', + 'Prefix will be automaticaly added to database name and database user' => 'الاختصار سيتم إضافته بشكل آلي لإسم قاعدة البيانات واسم المستخدم %s', + 'Database' => 'قاعدة بيانات', + 'Type' => 'نوع', + 'Minute' => 'دقيقة', + 'Command' => 'أمر', + 'Package Name' => 'إسم الرزمة', + 'Netmask' => 'قناع الشبكة', + 'Interface' => 'واجهة', + 'Shared' => 'مشارك', + 'Assigned user' => 'المستخدم المعين', + 'Assigned domain' => 'النطاق المعين', + 'NAT IP association' => 'جمعية ترجمة عناوين بروتوكول الانترنت', + 'shell' => 'منصب', + 'web domains' => 'نطاقات شبكة', + 'web aliases' => 'اسماء الشبكة المستعارة', + 'dns records' => 'سجلات نظام أسماء النطاقات', + 'mail domains' => 'نطاقات البريد', + 'mail accounts' => 'حسابات البريد', + 'accounts' => 'حسابات', + 'databases' => 'قواعد بيانات', + 'cron jobs' => 'وظائف مجدولة', + 'backups' => 'نسخ احتياطية', + 'quota' => 'حصة', + 'day of week' => 'اليوم من الإسبوع', + 'cmd' => 'أمر', + 'users' => 'مستخدمين', + 'domains' => 'نطاقات', + 'aliases' => 'أسماء مستعارة', + 'records' => 'سجلات', + 'jobs' => 'وظائف', + 'username' => 'اسم المستخدم', + 'password' => 'كلمة المرور', + 'type' => 'نوع', + 'charset' => 'حزمة نص', + 'domain' => 'نطاق', + 'ip' => 'بروتوكول إنترنت', + 'ip address' => 'عنوان بروتوكول إنترنت', + 'IP address' => 'عنوان بروتوكول إنترنت', + 'netmask' => 'قناع شبكة', + 'interface' => 'واجهة', + 'assigned user' => 'المستخدم المعين', + 'ns1' => 'مساحة اسم 1', + 'ns2' => 'مساحة اسم 2', + 'user' => 'مستخدم', + 'email' => 'بريد', + 'first name' => 'الإسم الأول', + 'last name' => 'الاسم الأخير', + 'account' => 'حساب', + 'ssl certificate' => 'شهادة طبقة مقبس آمن', + 'ssl key' => 'مفتاح طبقة مقبس آمن', + 'stats user password' => 'كلمة مرور مستخدم الإحصائيات', + 'stats username' => 'مستخدم الإحصائيات', + 'stats password' => 'كلمة مرور الإحصائيات', + 'ftp user password' => 'كلمة مرور مستخدم بروتوكول نقل الملفات', + 'ftp user' => 'مستخدم بروتوكول نقل الملفات', + 'Last 70 lines of %s.%s.log' => 'آخر 70 سطر في %s.%s.log', + 'Download AccessLog' => 'تحميل سجلات الوصول', + 'Download ErrorLog' => 'تحميل سجلات الأخطاء', + 'Country' => 'البلد', + '2 letter code' => 'كود من رسالتين', + 'State / Province' => 'ولاية / مقاطعة', + 'City / Locality' => 'المدينة / المنطقة', + 'Organization' => 'مؤسسة', + + '1 account' => '1 حساب', + '%s accounts' => 'حسابات %s', + '1 domain' => '1 نطاق', + '%s domains' => 'نطاقات %s', + '1 record' => '1 سجل', + '%s records' => 'سجلات %s', + '1 mail account' => '1 حساب بريد', + '%s mail accounts' => 'حسابات بريد %s', + '1 database' => '1 قاعدة بيانات', + '%s databases' => 'قواعد بيانات %s', + '1 cron job' => '1 وظيفة مجدولة', + '%s cron jobs' => 'وظائف مجدولة %s', + '1 archive' => '1 أرشيف', + '%s archives' => 'أرشيف %s', + '1 package' => '1 رزمة', + '%s packages' => 'رزم %s', + '1 IP address' => '1 عنوان بروتوكول إنترنت', + '%s IP addresses' => 'عناوين بروتوكول إنترنت %s', + '1 month' => '1 شهر', + '%s months' => 'أشهر %s', + '1 log record' => '1 سجل', + '%s log records' => 'سجلات %s', + '1 object' => '1 عنصر', + '%s objects' => 'عناصر %s', + 'no exclusions' => 'لا استثناءات', + + 'USER_CREATED_OK' => 'المستخدم %s تم إنشائه بنجاح', + 'WEB_DOMAIN_CREATED_OK' => 'النطاق %sتم إنشائه بنجاح .', + 'DNS_DOMAIN_CREATED_OK' => 'النطاق %s تم إنشائه بنجاح.', + 'DNS_RECORD_CREATED_OK' => 'السجل %s.%s تم إنشائه بنجاح.', + 'MAIL_DOMAIN_CREATED_OK' => 'نطاق البريد %s تم إنشائه بنجاح.', + 'MAIL_ACCOUNT_CREATED_OK' => 'حساب البريد %s@%s تم إنشائه بنجاح', + 'DATABASE_CREATED_OK' => 'قاعدة البيانات %s تم إنشائها بنجاح', + 'CRON_CREATED_OK' => 'الوظيفة المجدولة تم إنشائها بنجاح.', + 'IP_CREATED_OK' => 'عنوان بروتوكول الإنترنت %s تم إنشائه بنجاح.', + 'PACKAGE_CREATED_OK' => 'الرزمة %s تم إنشائها بنجاح.', + 'SSL_GENERATED_OK' => 'تم إنشاء الشهادة بنجاح.', + 'Autoupdate has been successfully enabled' => 'تم تفيعل التحديث التلقائي بنجاح', + 'Autoupdate has been successfully disabled' => 'تم تعطيل التحديث التلقائي بنجاح', + 'Changes has been saved.' => 'تم حفظ التغييرات بنجاح.', + 'Confirmation' => 'Confirmation', + 'DELETE_USER_CONFIRMATION' => 'هل تريد فعلا حذف المستخدم %s?', + 'SUSPEND_USER_CONFIRMATION' => 'هل تريد فعلا تعليق المستخدم %s?', + 'UNSUSPEND_USER_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق المستخدم %s?', + 'DELETE_DOMAIN_CONFIRMATION' => 'هل تريد فعلا حذف النطاق %s?', + 'SUSPEND_DOMAIN_CONFIRMATION' => 'هل تريد فعلا تعليق النطاق %s?', + 'UNSUSPEND_DOMAIN_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق النطاق %s?', + 'DELETE_RECORD_CONFIRMATION' => 'هل تريد فعلا حذف السجل %s?', + 'SUSPEND_RECORD_CONFIRMATION' => 'هل تريد فعلا تعليق السجل %s?', + 'UNSUSPEND_RECORD_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق السجل %s?', + 'DELETE_MAIL_ACCOUNT_CONFIRMATION' => 'هل تريد فعلا حذف %s?', + 'SUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'هل تريد فعلا تعليق %s?', + 'UNSUSPEND_MAIL_ACCOUNT_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق %s?', + 'DELETE_DATABASE_CONFIRMATION' => 'هل تريد فعلا حذف قاعدة البيانات %s?', + 'SUSPEND_DATABASE_CONFIRMATION' => 'هل تريد فعلا تعليق قاعدة البيانات %s?', + 'UNSUSPEND_DATABASE_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق قاعدة البيانات %s?', + 'DELETE_CRON_CONFIRMATION' => 'هل تريد فعلا حذف الوظيفة المجدولة?', + 'SUSPEND_CRON_CONFIRMATION' => 'هل تريد فعلا تعليق الوظيفة المجدولة?', + 'UNSUSPEND_CRON_CONFIRMATION' => 'هل تريد فعلا إلغاء تعليق الوظيفة المجدولة?', + 'DELETE_BACKUP_CONFIRMATION' => 'هل تريد فعلا حذف التسخة الاحتياطية %s ?', + 'DELETE_EXCLUSION_CONFIRMATION' => 'هل تريد فعلا حذف الاستثناء %s?', + 'DELETE_PACKAGE_CONFIRMATION' => 'هل تريد فعلا حذف الرزمة %s?', + 'DELETE_IP_CONFIRMATION' => 'هل تريد فعلا حذف عنوان بروتوكول الإنترنت %s?', + 'Welcome' => 'أهلا وسهلا', + 'LOGGED_IN_AS' => 'تم تسجيل الدخول ك %s', + 'Error' => 'خطأ', + 'Invalid username or password' => 'خطأ في اسم المستخدم أو كلمة المرور', + 'Invalid username or code' => 'خطأ في اسم المستخدم أو في الكود', + 'Passwords not match' => 'كلمات المرور غير متطابقة', + 'Please enter valid email address.' => 'برجاء إدخال عنوان بريد إلكتروني صحيح.', + 'Field "%s" can not be blank.' => 'العنصر "%s" لا يمكن أن يبقى فارغا.', + 'Password is too short.' => 'كلمة المرور قصيرة جدا (على الأقل ح حروف)', + 'Error code:' => 'كود الخطأ: %s', + 'SERVICE_ACTION_FAILED' => '"%s" "%s" فشل', + 'IP address is in use' => 'عنوان بروتوكول الإنترنت مستخدم بالفعل', + 'BACKUP_SCHEDULED' =>'تم إضافة الوظيفة لطابور المهام. سيتم إرسال بريد إلكتروني لك عندما تجهز النسخة الاحتياطية للتحميل.', + 'BACKUP_EXISTS' => 'يوجد عملية نسخ احتياطي تعمل حاليا. برجاء الانتظار حتى تنتهي عملية النسخ الاحتياطي.', + 'RESTORE_SCHEDULED' => ' تم إضافة الوظيفة لطابور المهام. سيتم إرسال بريد إلكتروني لك عندما تجهز النسخة الاحتياطية للتحميل.', + 'RESTORE_EXISTS' =>'يوجد عملية استعادة تعمل حاليا. برجاء الانتظار حتى تنتهي عملية الاستعادة قبل البدء بعملية جديدة.', + + 'WEB_EXCLUSIONS' => "اكتب اسم النطاق. واحد في كل سطر. لاستثناء جميع النطاقات استخدم *.. لاستثناء جميع مجالات النطاق استخدم الصيغة التالية: domain.com:public_html/cache:public_html/tmp", + 'DNS_EXCLUSIONS' => "اكتب اسم النطاق, واحد في كل سطر. لاستثناء جميع النطاقات استخدم *", + 'MAIL_EXCLUSIONS' => "اكتب اسم النطاق, واحد في كل سطر. لاستثناء جميع النطاقات استخدم *. لاستثناء حسابات معينة استخدم الصيغة: domain.com:info:support:postmaster", + 'DB_EXCLUSIONS' => "اكتب اسم قاعدة البيانات بالكامل, واحدة في كل سطر. لاستثناء جميع قواعد البيانات استخدم *", + 'CRON_EXCLUSIONS' => "لاستثناء جميع الوظائف المجدولة استخدم *", + 'USER_EXCLUSIONS' => "اكتب اسم المجلد, واحد في كل سطر. لاستثناء جميع المجلدات استخدم *", + + 'Welcome to Vesta Control Panel' => 'Vesta أهلا بكم في لوحة تحكم', + 'MAIL_FROM' => 'Vesta لوحة تحكم ', + 'GREETINGS_GORDON_FREEMAN' => "مرحبا, %s %s,\n", + 'GREETINGS' => "مرحبا,\n", + 'ACCOUNT_READY' => "تم انشاء حسابك بنجاح وهو جاهز للاستخدام.\n\nhttps://%s/login/\nUsername: %s\nPassword: %s\n\n--\nVesta Control Panel\n", + + 'FTP login credentials' => 'معلومات اعتماد الدخول لبروتوكول نقل الملفات', + 'FTP_ACCOUNT_READY' => "تم إنشاء حساب بروتوكول نقل الملفات وهو جاهز للاستخدام.\n\nHostname: %s\nUsername: %s_%s\nPassword: %s\n\n--\nVesta Control Panel\n", + + 'Database Credentials' => 'معلومات اعتماد قاعدة البيانات', + 'DATABASE_READY' => "تم انشاء قاعدة البيانات بنجاح.\n\nDatabase: %s\nUser: %s\nPassword: %s\n%s\n\n--\nVesta Control Panel\n", + + 'forgot password' => 'نسيت كلمة المرور', + 'Confirm' => 'تأكيد', + 'New Password' => 'كلمة مرور جديدة', + 'Confirm Password' => 'تأكيد كلمة المرور', + 'Reset' => 'إعادة تعيين', + 'Reset Code' => 'إعادة تعيين الكود', + 'RESET_NOTICE' => '', + 'RESET_CODE_SENT' => 'لقد تم إرسال كود إعادة تعيين كلمة المرور لعنوان بريدك الإلكتروني
', + 'MAIL_RESET_SUBJECT' => 'تم إعادة تعيين كلمة المرور %s', + 'PASSWORD_RESET_REQUEST' => "لإعادة تعيين كلمة مرور لوحة التحكم , برجاء اتباع الرابط التالي link:\nhttps://%s/reset/?action=confirm&user=%s&code=%s\n\nAlternatively, بامكانك أيضا اتباع الرابط التالي https://%s/reset/?action=code&user=%s وادخال كود إعادة التعيين التالي code:\n%s\n\n إذا لم تطلب إعادة تعيين كلمة المرور, برجاء تجاهل هذه الرسالة وتقبل اعتذارنا.\n\n--\nVesta Control Panel\n", +); From a5c47c3576959b284277e61fc874f0b95858c2bc Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 4 Jul 2014 01:17:04 +0300 Subject: [PATCH 36/49] Added FTP_SHELL controller --- bin/v-add-web-domain-ftp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/v-add-web-domain-ftp b/bin/v-add-web-domain-ftp index 129e3939d..72faef347 100755 --- a/bin/v-add-web-domain-ftp +++ b/bin/v-add-web-domain-ftp @@ -56,10 +56,14 @@ if [ ! -z "$FTP_USER" ]; then /usr/sbin/userdel -f $FTP_USER > /dev/null 2>&1 fi -# Define shell -shell='/sbin/nologin' -if [ -e "/usr/bin/rssh" ]; then - shell='/usr/bin/rssh' +# Define ftp user shell +if [ -z "$FTP_SHELL" ]; then + shell='/sbin/nologin' + if [ -e "/usr/bin/rssh" ]; then + shell='/usr/bin/rssh' + fi +else + shell=$FTP_SHELL fi # Define path From 8d01d5d796284e54031ce2d1ec8ec7fc39dfea63 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 4 Jul 2014 16:46:46 +0300 Subject: [PATCH 37/49] multiple ftp accounts --- bin/v-add-web-domain-ftp | 49 +++++++++++++++++++++---------------- bin/v-delete-web-domain-ftp | 36 +++++++++++++++++++-------- bin/v-list-web-domains | 4 +-- 3 files changed, 56 insertions(+), 33 deletions(-) diff --git a/bin/v-add-web-domain-ftp b/bin/v-add-web-domain-ftp index 72faef347..06dc99cc6 100755 --- a/bin/v-add-web-domain-ftp +++ b/bin/v-add-web-domain-ftp @@ -1,8 +1,8 @@ #!/bin/bash # info: add ftp account for web domain. -# options: USER DOMAIN FTP_USER FTP_PASSWORD FTP_PATH +# options: USER DOMAIN FTP_USER FTP_PASSWORD [FTP_PATH] # -# The function creates addutional ftp account for web domain. +# The function creates additional ftp account for web domain. #----------------------------------------------------------# @@ -38,13 +38,6 @@ is_object_valid 'user' 'USER' "$user" is_object_unsuspended 'user' 'USER' "$user" is_object_valid 'web' 'DOMAIN' "$domain" is_object_unsuspended 'web' 'DOMAIN' "$domain" - - -#----------------------------------------------------------# -# Action # -#----------------------------------------------------------# - -get_domain_values 'web' check_ftp_user=$(grep "^$ftp_user:" /etc/passwd) if [ ! -z "$check_ftp_user" ] && [ "$FTP_USER" != "$ftp_user" ]; then echo "Error: ftp user $ftp_user already exists" @@ -52,9 +45,13 @@ if [ ! -z "$check_ftp_user" ] && [ "$FTP_USER" != "$ftp_user" ]; then exit $E_EXISTS fi -if [ ! -z "$FTP_USER" ]; then - /usr/sbin/userdel -f $FTP_USER > /dev/null 2>&1 -fi + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Get domain values +get_domain_values 'web' # Define ftp user shell if [ -z "$FTP_SHELL" ]; then @@ -70,20 +67,22 @@ fi if [ -z "$ftp_path" ]; then ftp_path="$HOMEDIR/$user/web/$domain" else + # Validating path ftp_path=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path") if [ -z "$(echo $ftp_path |grep $HOMEDIR/$user/web/$domain)" ]; then echo "Error: path $ftp_path is invalid" log_event "$E_INVALID" "$EVENT" exit $E_INVALID fi + # MKDIR if path doesn't exist + if [ ! -e $ftp_path ]; then + mkdir -p $ftp_path + chown $user:$user $ftp_path + chmod 751 $ftp_path + fi fi -# Create ftp docroot -mkdir -p $ftp_path -chown $user:$user $ftp_path -chmod 751 $ftp_path - -# Adding user +# Adding ftp user /usr/sbin/useradd $ftp_user \ -s $shell \ -o -u $(id -u $user) \ @@ -97,15 +96,23 @@ ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)" # Vesta # #----------------------------------------------------------# +# Concatenating ftp variables +if [ ! -z "$FTP_USER" ]; then + ftp_user="$FTP_USER:$ftp_user" + ftp_md5="$FTP_MD5:$ftp_md5" + ftp_path="$FTP_PATH:$ftp_path" +fi + +# Adding new key into web.conf +add_object_key "web" 'DOMAIN' "$domain" 'FTP_PATH' 'PROXY' + # Update config update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" - -add_object_key "web" 'DOMAIN' "$domain" 'FTP_PATH' 'PROXY' update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path" # Logging -log_history "added ftp account $ftp_user for $domain" +log_history "added ftp account ${1}_${3} for $domain" log_event "$OK" "$EVENT" exit diff --git a/bin/v-delete-web-domain-ftp b/bin/v-delete-web-domain-ftp index 2b776e304..9b0e83fbd 100755 --- a/bin/v-delete-web-domain-ftp +++ b/bin/v-delete-web-domain-ftp @@ -1,6 +1,6 @@ #!/bin/bash -# info: delete webdomain ftp account. -# options: USER DOMAIN +# info: delete webdomain ftp account +# options: USER DOMAIN FTP_USER # # The function deletes additional ftp account. @@ -13,6 +13,7 @@ user=$1 domain=$(idn -t --quiet -u "$2" ) domain_idn=$(idn -t --quiet -a "$domain") +ftp_user=$3 # Includes source $VESTA/func/main.sh @@ -24,14 +25,19 @@ source $VESTA/conf/vesta.conf # Verifications # #----------------------------------------------------------# -check_args '2' "$#" 'USER DOMAIN' -validate_format 'user' 'domain' +check_args '3' "$#" 'USER DOMAIN FTP_USER' +validate_format 'user' 'domain' 'ftp_user' is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM' is_object_valid 'user' 'USER' "$user" is_object_unsuspended 'user' 'USER' "$user" is_object_valid 'web' 'DOMAIN' "$domain" is_object_unsuspended 'web' 'DOMAIN' "$domain" -is_object_value_exist 'web' 'DOMAIN' "$domain" '$FTP_USER' +get_domain_values 'web' +if [ -z "$(echo $FTP_USER | tr ':' '\n' | grep ^$ftp_user$)" ]; then + echo "Error: account $ftp_user doesn't exist" + log_event "$E_NOTEXIST" "$EVENT" + exit $E_NOTEXIST +fi #----------------------------------------------------------# @@ -39,20 +45,30 @@ is_object_value_exist 'web' 'DOMAIN' "$domain" '$FTP_USER' #----------------------------------------------------------# # Deleting ftp user -get_domain_values 'web' -/usr/sbin/userdel -f $FTP_USER >> /dev/null 2>&1 +/usr/sbin/userdel -f $ftp_user >> /dev/null 2>&1 #----------------------------------------------------------# # Vesta # #----------------------------------------------------------# +# Rebuild FTP variables +position=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep ":$ftp_user$" |\ + cut -f 1 -d:) +ftp_user=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ + cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') +ftp_md5=$(echo $FTP_MD5 |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ + cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') +ftp_path=$(echo $FTP_PATH |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ + cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') + # Update config -update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' '' -update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' '' +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path" # Logging -log_history "deleted ftp account $FTP_USER for $domain" +log_history "deleted ftp account ${3} for $domain" log_event "$OK" "$EVENT" exit diff --git a/bin/v-list-web-domains b/bin/v-list-web-domains index d39b7aac8..95f061702 100755 --- a/bin/v-list-web-domains +++ b/bin/v-list-web-domains @@ -34,8 +34,8 @@ is_object_valid 'user' 'USER' "$user" conf=$USER_DATA/web.conf # Defining fileds to select -fields="\$DOMAIN \$IP \$IP6 \$U_DISK \$U_BANDWIDTH \$TPL \$ALIAS" -fields="$fields \$STATS \$STATS_USER \$SSL \$SSL_HOME \$FTP_USER" +fields="\$DOMAIN \$IP \$IP6 \$U_DISK \$U_BANDWIDTH \$TPL \$ALIAS \$STATS" +fields="$fields \$STATS_USER \$SSL \$SSL_HOME \$FTP_USER \$FTP_PATH" fields="$fields \$PROXY \$PROXY_EXT \$SUSPENDED \$TIME \$DATE" # Listing domains From 003959d6fcb2516af39a036c3eb9be4c3ac0bb01 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 5 Jul 2014 10:20:42 +0300 Subject: [PATCH 38/49] Cleaned up dev stuff --- bin/v-change-user-language | 8 -------- 1 file changed, 8 deletions(-) diff --git a/bin/v-change-user-language b/bin/v-change-user-language index 3bc437a84..22011151b 100755 --- a/bin/v-change-user-language +++ b/bin/v-change-user-language @@ -49,14 +49,6 @@ else update_user_value "$user" '$LANGUAGE' "$language" fi -exit -# Changing user contact email -old_email=$(get_user_value '$CONTACT') -update_user_value "$user" '$CONTACT' "$email" -pw_str=$(grep -n "^$user:" /etc/passwd) -str=$(echo "$pw_str" | cut -f 1 -d :) -sed -i "$str s/$old_email/$email/g" /etc/passwd - #----------------------------------------------------------# # Vesta # From d16a63056629d03cee7f6e898663df3ae577e367 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 5 Jul 2014 10:21:40 +0300 Subject: [PATCH 39/49] multiple ftp account support --- bin/v-add-web-domain-ftp | 39 ++++++------ bin/v-change-web-domain-ftp-password | 71 ++++++++++++++++++++++ bin/v-change-web-domain-ftp-path | 89 ++++++++++++++++++++++++++++ bin/v-delete-web-domain | 10 +++- bin/v-delete-web-domain-ftp | 12 ++-- bin/v-list-web-domain | 6 +- 6 files changed, 203 insertions(+), 24 deletions(-) create mode 100755 bin/v-change-web-domain-ftp-password create mode 100755 bin/v-change-web-domain-ftp-path diff --git a/bin/v-add-web-domain-ftp b/bin/v-add-web-domain-ftp index 06dc99cc6..be10e90b8 100755 --- a/bin/v-add-web-domain-ftp +++ b/bin/v-add-web-domain-ftp @@ -53,7 +53,7 @@ fi # Get domain values get_domain_values 'web' -# Define ftp user shell +# Defining ftp user shell if [ -z "$FTP_SHELL" ]; then shell='/sbin/nologin' if [ -e "/usr/bin/rssh" ]; then @@ -63,22 +63,22 @@ else shell=$FTP_SHELL fi -# Define path +# Defining path if [ -z "$ftp_path" ]; then - ftp_path="$HOMEDIR/$user/web/$domain" + ftp_path_a="$HOMEDIR/$user/web/$domain" else - # Validating path - ftp_path=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path") - if [ -z "$(echo $ftp_path |grep $HOMEDIR/$user/web/$domain)" ]; then - echo "Error: path $ftp_path is invalid" + # Validating absolute path + ftp_path_a=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path") + if [ -z "$(echo $ftp_path_a |grep $HOMEDIR/$user/web/$domain)" ]; then + echo "Error: absolute path $ftp_path_a is invalid" log_event "$E_INVALID" "$EVENT" exit $E_INVALID fi - # MKDIR if path doesn't exist - if [ ! -e $ftp_path ]; then - mkdir -p $ftp_path - chown $user:$user $ftp_path - chmod 751 $ftp_path + # Creating ftp user home directory + if [ ! -e "$ftp_path_a" ]; then + mkdir -p $ftp_path_a + chown $user:$user "$ftp_path_a" + chmod 751 "$ftp_path_a" fi fi @@ -87,32 +87,37 @@ fi -s $shell \ -o -u $(id -u $user) \ -g $(id -u $user) \ - -M -d "$ftp_path" > /dev/null 2>&1 + -M -d "$ftp_path_a" > /dev/null 2>&1 + +# Set ftp user password echo "$ftp_user:$ftp_password" | /usr/sbin/chpasswd -ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)" +ftp_md5=$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow) #----------------------------------------------------------# # Vesta # #----------------------------------------------------------# +# Transforming absolute path to relative +ftp_path_r=$(echo $ftp_path_a |sed "s%$HOMEDIR/$user/web/$domain%%") + # Concatenating ftp variables if [ ! -z "$FTP_USER" ]; then ftp_user="$FTP_USER:$ftp_user" ftp_md5="$FTP_MD5:$ftp_md5" - ftp_path="$FTP_PATH:$ftp_path" + ftp_path="$FTP_PATH:$ftp_path_r" fi # Adding new key into web.conf add_object_key "web" 'DOMAIN' "$domain" 'FTP_PATH' 'PROXY' -# Update config +# Updating config update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path" # Logging -log_history "added ftp account ${1}_${3} for $domain" +log_history "added ftp account ${1}_${3}@$domain" log_event "$OK" "$EVENT" exit diff --git a/bin/v-change-web-domain-ftp-password b/bin/v-change-web-domain-ftp-password new file mode 100755 index 000000000..c4cd90f98 --- /dev/null +++ b/bin/v-change-web-domain-ftp-password @@ -0,0 +1,71 @@ +#!/bin/bash +# info: change ftp user password. +# options: USER DOMAIN FTP_USER FTP_PASSWORD +# +# The function changes ftp user password. + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +user=$1 +domain=$(idn -t --quiet -u "$2" ) +domain_idn=$(idn -t --quiet -a "$domain") +ftp_user=$3 +ftp_password=$4 + +# Includes +source $VESTA/func/main.sh +source $VESTA/func/domain.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD' +validate_format 'user' 'domain' 'ftp_user' 'ftp_password' +is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM' +is_object_valid 'user' 'USER' "$user" +is_object_unsuspended 'user' 'USER' "$user" +is_object_valid 'web' 'DOMAIN' "$domain" +is_object_unsuspended 'web' 'DOMAIN' "$domain" +get_domain_values 'web' +if [ -z "$(echo $FTP_USER | tr ':' '\n' | grep ^$ftp_user$)" ]; then + echo "Error: account $ftp_user doesn't exist" + log_event "$E_NOTEXIST" "$EVENT" + exit $E_NOTEXIST +fi + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Changing ftp user password +echo "$ftp_user:$ftp_password" | /usr/sbin/chpasswd +ftp_md5=$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow) + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +# Rebuilding FTP variables +position=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep ":$ftp_user$" |\ + cut -f 1 -d:) +ftp_md5=$(echo $FTP_MD5 |tr ':' '\n' |grep -n '' |\ + sed -e "s%^$position:.*%$position:$ftp_md5%" |\ + cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') + +# Updating config +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" + +# Logging +log_history "changed password for $ftp_user on $domain" +log_event "$OK" "$EVENT" + +exit diff --git a/bin/v-change-web-domain-ftp-path b/bin/v-change-web-domain-ftp-path new file mode 100755 index 000000000..f4489c0a1 --- /dev/null +++ b/bin/v-change-web-domain-ftp-path @@ -0,0 +1,89 @@ +#!/bin/bash +# info: change path for ftp user. +# options: USER DOMAIN FTP_USER FTP_PATH +# +# The function changes ftp user path. + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +user=$1 +domain=$(idn -t --quiet -u "$2" ) +domain_idn=$(idn -t --quiet -a "$domain") +ftp_user=$3 +ftp_path=$4 + +# Includes +source $VESTA/func/main.sh +source $VESTA/func/domain.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PATH' +validate_format 'user' 'domain' 'ftp_user' +is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM' +is_object_valid 'user' 'USER' "$user" +is_object_unsuspended 'user' 'USER' "$user" +is_object_valid 'web' 'DOMAIN' "$domain" +is_object_unsuspended 'web' 'DOMAIN' "$domain" +get_domain_values 'web' +if [ -z "$(echo $FTP_USER | tr ':' '\n' | grep ^$ftp_user$)" ]; then + echo "Error: account $ftp_user doesn't exist" + log_event "$E_NOTEXIST" "$EVENT" + exit $E_NOTEXIST +fi +ftp_path_a=$(readlink -f "$HOMEDIR/$user/web/$domain/$ftp_path") +if [ -z "$(echo $ftp_path_a |grep $HOMEDIR/$user/web/$domain)" ]; then + echo "Error: absolute path $ftp_path_a is invalid" + log_event "$E_INVALID" "$EVENT" + exit $E_INVALID +fi + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# MKDIR if path doesn't exist +if [ ! -e "$ftp_path_a" ]; then + mkdir -p "$ftp_path_a" + chown $user:$user "$ftp_path_a" + chmod 751 "$ftp_path_a" +fi + +# Chaning ftp user path +pw_str=$(grep -n "^$ftp_user:" /etc/passwd) +str=$(echo "$pw_str" | cut -f 1 -d :) +old_path=$(echo "$pw_str" | cut -f 7 -d :) +sed -i "$str s%$old_path%$ftp_path_a%g" /etc/passwd + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +# Transforming absolute path to relative +ftp_path_r=$(echo $ftp_path_a |sed "s%$HOMEDIR/$user/web/$domain%%") + +# Rebuilding FTP variables +position=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep ":$ftp_user$" |\ + cut -f 1 -d:) +ftp_path=$(echo $FTP_PATH |tr ':' '\n' |grep -n '' |\ + sed -e "s%^$position:.*%$position:$ftp_path_r%" |\ + cut -f 2 -d :| sed -e ':a;N;$!ba;s/\n/:/g') + +# Updating config +update_object_value 'web' 'DOMAIN' "$domain" '$FTP_PATH' "$ftp_path" + +# Logging +log_history "changed path to $ftp_path_a for $ftp_user@$domain" +log_event "$OK" "$EVENT" + +exit diff --git a/bin/v-delete-web-domain b/bin/v-delete-web-domain index 68c86d2fc..3ee9121d2 100755 --- a/bin/v-delete-web-domain +++ b/bin/v-delete-web-domain @@ -89,9 +89,15 @@ if [ ! -z "$STATS" ] && [ "$STATS" != 'no' ]; then rm -f /etc/awstats/$STATS.$domain.conf fi -# Deleting ftp account +# Deleting ftp users if [ ! -z "$FTP_USER" ]; then - /usr/sbin/userdel -f $FTP_USER >> /dev/null 2>&1 + for ftp_user in ${FTP_USER//:/ }; do + /usr/sbin/userdel $ftp_user >> /dev/null 2>&1 + if [ "$?" != 0 ]; then + sed -i "/^$ftp_user:/d" /etc/passwd + sed -i "/^$ftp_user:/d" /etc/shadow + fi + done fi # Deleting directory diff --git a/bin/v-delete-web-domain-ftp b/bin/v-delete-web-domain-ftp index 9b0e83fbd..01b8ac479 100755 --- a/bin/v-delete-web-domain-ftp +++ b/bin/v-delete-web-domain-ftp @@ -45,22 +45,26 @@ fi #----------------------------------------------------------# # Deleting ftp user -/usr/sbin/userdel -f $ftp_user >> /dev/null 2>&1 +/usr/sbin/userdel $ftp_user >> /dev/null 2>&1 +if [ "$?" != 0 ]; then + sed -i "/^$ftp_user:/d" /etc/passwd + sed -i "/^$ftp_user:/d" /etc/shadow +fi #----------------------------------------------------------# # Vesta # #----------------------------------------------------------# -# Rebuild FTP variables +# Rebuilding FTP variables position=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep ":$ftp_user$" |\ cut -f 1 -d:) ftp_user=$(echo $FTP_USER |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') ftp_md5=$(echo $FTP_MD5 |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ - cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') + cut -f 2 -d :| sed -e ':a;N;$!ba;s/\n/:/g') ftp_path=$(echo $FTP_PATH |tr ':' '\n' |grep -n '' |grep -v "^$position:" |\ - cut -f 2 -d :| sed -e "/^$/d"| sed -e ':a;N;$!ba;s/\n/:/g') + cut -f 2 -d :| sed -e ':a;N;$!ba;s/\n/:/g') # Update config update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" diff --git a/bin/v-list-web-domain b/bin/v-list-web-domain index 9a8ea34d7..8a1c794de 100755 --- a/bin/v-list-web-domain +++ b/bin/v-list-web-domain @@ -76,7 +76,11 @@ conf=$USER_DATA/web.conf # Defining fileds to select fields='$DOMAIN $IP $IP6 $U_DISK $U_BANDWIDTH $TPL $ALIAS $STATS $STATS_USER - $SSL $SSL_HOME $FTP_USER $PROXY $PROXY_EXT $SUSPENDED $TIME $DATE' + $SSL $SSL_HOME $FTP_USER $FTP_PATH $PROXY $PROXY_EXT $DOCUMENT_ROOT + $SUSPENDED $TIME $DATE' + +# Defining document root +DOCUMENT_ROOT="$HOMEDIR/$user/web/$domain/public_html" # Listing domains case $format in From 90a75b1aed6edeaa75f55a1c0982af137fb69f49 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 5 Jul 2014 10:22:24 +0300 Subject: [PATCH 40/49] foricble user deletition --- bin/v-delete-user | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/v-delete-user b/bin/v-delete-user index d05cc7d9d..07efd7496 100755 --- a/bin/v-delete-user +++ b/bin/v-delete-user @@ -89,8 +89,14 @@ fi sed -i "/ $user$/d" $VESTA/data/queue/disk.pipe sed -i "/ $user$/d" $VESTA/data/queue/traffic.pipe -# Removing system user -/usr/sbin/userdel -f $user +# Deleting system user +/usr/sbin/userdel -f $user >> /dev/null 2>&1 +if [ "$?" != 0 ]; then + sed -i "/^$user:/d" /etc/passwd + sed -i "/^$user:/d" /etc/shadow +fi + +# Deleting user directories chattr -i $HOMEDIR/$user/conf rm -rf $HOMEDIR/$user rm -f /var/spool/mail/$user From 6e20e88330beff34b207169f97380a6b1afebd2a Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sat, 5 Jul 2014 10:23:05 +0300 Subject: [PATCH 41/49] deprecated function --- bin/v-change-web-domain-ftp | 63 ------------------------------------- 1 file changed, 63 deletions(-) delete mode 100755 bin/v-change-web-domain-ftp diff --git a/bin/v-change-web-domain-ftp b/bin/v-change-web-domain-ftp deleted file mode 100755 index a69cf510e..000000000 --- a/bin/v-change-web-domain-ftp +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# info: add ftp account for web domain. -# options: USER DOMAIN FTP_USER FTP_PASSWORD -# -# The function creates addutional ftp account for web domain. - - -#----------------------------------------------------------# -# Variable&Function # -#----------------------------------------------------------# - -# Argument defenition -user=$1 -domain=$(idn -t --quiet -u "$2" ) -domain_idn=$(idn -t --quiet -a "$domain") -ftp_user=${1}_${3} -ftp_password=$4 - -# Includes -source $VESTA/func/main.sh -source $VESTA/func/domain.sh -source $VESTA/conf/vesta.conf - - -#----------------------------------------------------------# -# Verifications # -#----------------------------------------------------------# - -check_args '4' "$#" 'USER DOMAIN FTP_USER FTP_PASSWORD' -validate_format 'user' 'domain' 'ftp_user' 'ftp_password' -is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM' -is_object_valid 'user' 'USER' "$user" -is_object_unsuspended 'user' 'USER' "$user" -is_object_valid 'web' 'DOMAIN' "$domain" -is_object_unsuspended 'web' 'DOMAIN' "$domain" -is_object_value_empty 'web' 'DOMAIN' "$domain" '$FTP_USER' - - -#----------------------------------------------------------# -# Action # -#----------------------------------------------------------# - -# Adding user -/usr/sbin/adduser $ftp_user -g $user -s /sbin/nologin -M \ - -d "$HOMEDIR/$user/web/$domain" > /dev/null 2>&1 -echo "$ftp_user:$ftp_password" | /usr/sbin/chpasswd - -ftp_md5="$(awk -v user=$ftp_user -F : 'user == $1 {print $2}' /etc/shadow)" - - -#----------------------------------------------------------# -# Vesta # -#----------------------------------------------------------# - -# Update config -update_object_value 'web' 'DOMAIN' "$domain" '$FTP_USER' "$ftp_user" -update_object_value 'web' 'DOMAIN' "$domain" '$FTP_MD5' "$ftp_md5" - -# Logging -log_history "added ftp account $ftp_user for $domain" -log_event "$OK" "$EVENT" - -exit From 667ae61355a5c5796cc00f6dd8c4288a22681689 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 6 Jul 2014 14:42:13 +0300 Subject: [PATCH 42/49] Fix webstats analyzer on Ubuntu 14.04 --- bin/v-add-web-domain-stats | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/bin/v-add-web-domain-stats b/bin/v-add-web-domain-stats index 5d6056d18..8ee057618 100755 --- a/bin/v-add-web-domain-stats +++ b/bin/v-add-web-domain-stats @@ -52,20 +52,20 @@ upd_web_domain_values # Adding statistic config cat $WEBTPL/$type/$type.tpl |\ - sed -e "s/%ip%/$ip/g" \ - -e "s/%web_port%/$WEB_PORT/g" \ - -e "s/%web_system%/$WEB_SYSTEM/g" \ - -e "s/%web_ssl_port%/$WEB_SSL_PORT/g" \ - -e "s/%rgroups%/$WEB_RGROUPS/g" \ - -e "s/%proxy_system%/$PROXY_SYSTEM/g" \ - -e "s/%proxy_port%/$PROXY_PORT/g" \ - -e "s/%proxy_ssl_port%/$PROXY_SSL_PORT/g" \ - -e "s/%domain_idn%/$domain_idn/g" \ - -e "s/%domain%/$domain/g" \ - -e "s/%user%/$user/g" \ - -e "s/%home%/${HOMEDIR////\/}/g" \ - -e "s/%alias%/${aliases//,/ }/g" \ - -e "s/%alias_idn%/${aliases_idn//,/ }/g" \ + sed -e "s|%ip%|$ip|g" \ + -e "s|%web_port%|$WEB_PORT|g" \ + -e "s|%web_system%|$WEB_SYSTEM|g" \ + -e "s|%web_ssl_port%|$WEB_SSL_PORT|g" \ + -e "s|%rgroups%|$WEB_RGROUPs|g" \ + -e "s|%proxy_system%|$PROXY_SYSTEM|g" \ + -e "s|%proxy_port%|$PROXY_PORT|g" \ + -e "s|%proxy_ssl_port%|$PROXY_SSL_PORT|g" \ + -e "s|%domain_idn%|$domain_idn|g" \ + -e "s|%domain%|$domain|g" \ + -e "s|%user%|$user|g" \ + -e "s|%home%|$HOMEDIR|g" \ + -e "s|%alias%|${aliases//,/ }|g" \ + -e "s|%alias_idn%|${aliases_idn//,/ }|g" \ > $HOMEDIR/$user/conf/web/$type.$domain.conf if [ "$type" == 'awstats' ]; then From 62c05fb08f368a69f89539ee8399ad5871148a17 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 6 Jul 2014 14:55:29 +0300 Subject: [PATCH 43/49] Fix MySQL autostart issue on Ubuntu 14.04 --- install/vst-install-ubuntu.sh | 4 +++- src/deb/vesta/postinst | 5 +++++ upd/fix_mysql_startup.sh | 11 +++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 upd/fix_mysql_startup.sh diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index b40d4f8d9..74f4b4cf6 100644 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -601,7 +601,9 @@ fi mpass=$(gen_pass) wget $CHOST/$VERSION/my.cnf -O /etc/mysql/my.cnf mysql_install_db -update-rc.d mysql defaults +if [ "$release" != '14.04' ]; then + update-rc.d mysql defaults +fi service mysql stop > /dev/null 2>&1 service mysql start if [ "$?" -ne 0 ]; then diff --git a/src/deb/vesta/postinst b/src/deb/vesta/postinst index 0673f3b6b..7559a345e 100755 --- a/src/deb/vesta/postinst +++ b/src/deb/vesta/postinst @@ -15,4 +15,9 @@ if [ -x "/usr/local/vesta/upd/fix_vesta_ssl_permissions.sh" ]; then /usr/local/vesta/upd/fix_vesta_ssl_permissions.sh fi +# Run MySQL autostart fixed +if [ -x "/usr/local/vesta/upd/fix_mysql_startup.sh" ]; then + /usr/local/vesta/upd/fix_mysql_startup.sh +fi + exit 0 diff --git a/upd/fix_mysql_startup.sh b/upd/fix_mysql_startup.sh new file mode 100755 index 000000000..33684f134 --- /dev/null +++ b/upd/fix_mysql_startup.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Fix MySQL autostart for Ubuntu 14.04 +if [ -e "/etc/issue" ]; then + release=$(head -n 1 /etc/issue | cut -f 2 -d ' ' ) + if [ "$release" = '14.04' ]; then + update-rc.d mysql disable + fi +fi + +exit From f851da5db1815c4a304ae847c00e170ea66b4480 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 6 Jul 2014 16:05:14 +0300 Subject: [PATCH 44/49] Fix backup exclusion for cron --- bin/v-update-user-backup-exclusions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-update-user-backup-exclusions b/bin/v-update-user-backup-exclusions index 7cb2f6678..898a1d55b 100755 --- a/bin/v-update-user-backup-exclusions +++ b/bin/v-update-user-backup-exclusions @@ -67,7 +67,7 @@ echo "WEB='$WEB'" > $USER_DATA/backup-excludes.conf echo "DNS='$DNS'" >> $USER_DATA/backup-excludes.conf echo "MAIL='$MAIL'" >> $USER_DATA/backup-excludes.conf echo "DB='$DB'" >> $USER_DATA/backup-excludes.conf -echo "CRON='$DB'" >> $USER_DATA/backup-excludes.conf +echo "CRON='$CRON'" >> $USER_DATA/backup-excludes.conf echo "USER='$USER'" >> $USER_DATA/backup-excludes.conf chmod 660 $USER_DATA/backup-excludes.conf From 6d4da8dfe5aad934ea80c79713db2ccc7394980b Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 6 Jul 2014 19:02:04 +0300 Subject: [PATCH 45/49] fixed remote port for dns-cluster --- bin/v-add-remote-dns-host | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/v-add-remote-dns-host b/bin/v-add-remote-dns-host index 9562840c3..835f97f36 100755 --- a/bin/v-add-remote-dns-host +++ b/bin/v-add-remote-dns-host @@ -16,8 +16,6 @@ user=$3 password=$4 type=${5-api} dns_user=${6-dns-cluster} - -# fix for variable name in other files DNS_USER=$dns_user # Includes @@ -45,9 +43,10 @@ is_dnshost_alive # Action # #----------------------------------------------------------# -# Concatentating db host string -str="HOST='$host' USER='$user' PASSWORD='$password' DNS_USER='$dns_user'" -str="$str TYPE='$type' SUSPENDED='no' TIME='$TIME' DATE='$DATE'" +# Concatentating dns host string +str="HOST='$host' PORT='$port' USER='$user' PASSWORD='$password'" +str="$str DNS_USER='$dns_user' TYPE='$type' SUSPENDED='no'" +str="$str TIME='$TIME' DATE='$DATE'" # Adding host to dns-cluster.conf echo "$str" >> $VESTA/conf/dns-cluster.conf From b985c7ad9c86fe733788f96774e82c9ed7b2ea58 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 7 Jul 2014 00:22:27 +0300 Subject: [PATCH 46/49] Fix for tar < 1.24 to preserve directory ownership --- bin/v-restore-user | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/v-restore-user b/bin/v-restore-user index 1615e6ce6..5971ca836 100755 --- a/bin/v-restore-user +++ b/bin/v-restore-user @@ -363,11 +363,16 @@ if [ "$web" != 'no' ]; then exit $E_PARSING fi + # Fix for tar < 1.24 + find $HOMEDIR/$user/web/$domain -type d \ + -exec chown -h $user:$user {} \; + # ReChown files if uid differs if [ "$old_uid" -ne "$new_uid" ]; then find $HOMEDIR/$user/web/$domain/ -user $old_uid \ -exec chown -h $user:$user {} \; fi + done # Restart WEB From 2b40f8422c29b0ac3f5635da728efbd5f70e4a47 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 8 Jul 2014 14:34:49 +0300 Subject: [PATCH 47/49] removed debug info on quota set --- bin/v-add-user | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/v-add-user b/bin/v-add-user index 732fde24e..9fb122319 100755 --- a/bin/v-add-user +++ b/bin/v-add-user @@ -207,7 +207,6 @@ chmod 660 $USER_DATA/user.conf # Updating quota if [ "$DISK_QUOTA" = 'yes' ]; then - echo "Setting quota" $BIN/v-update-user-quota "$user" fi From d083b12153a26a2f8b78ba606ac1bde1ac31fa6c Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 8 Jul 2014 14:35:11 +0300 Subject: [PATCH 48/49] Urlencoder for DNS Cluster API --- func/remote.sh | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/func/remote.sh b/func/remote.sh index 8f386594a..61b050065 100644 --- a/func/remote.sh +++ b/func/remote.sh @@ -6,11 +6,21 @@ send_api_cmd() { USER=admin fi - auth="user=$USER&password=$PASSWORD&returncode=yes" - cmd="cmd=$1" - args="arg1=$2&arg2=$3&arg3=$4&arg4=$5&arg5=$6&arg6=$7&arg7=$8&arg8=$9" - args=$(echo "$args" |sed -e "s/+/%2B/g") - answer=$(curl -s -k --data "$auth&$cmd&$args" https://$HOST:$PORT/api/) + answer=$(curl -s -k \ + --data-urlencode "user=$USER" \ + --data-urlencode "password=$PASSWORD" \ + --data-urlencode "returncode=yes" \ + --data-urlencode "cmd=$1" \ + --data-urlencode "arg1=$2" \ + --data-urlencode "arg2=$3" \ + --data-urlencode "arg3=$4" \ + --data-urlencode "arg4=$5" \ + --data-urlencode "arg5=$6" \ + --data-urlencode "arg6=$7" \ + --data-urlencode "arg7=$8" \ + --data-urlencode "arg8=$9" \ + https://$HOST:$PORT/api/) + if [ "$answer" != '0' ]; then return 1 else @@ -90,7 +100,7 @@ is_dnshost_alive() { $send_cmd v-list-sys-config if [ $? -ne 0 ]; then echo "Error: $type connection to $HOST failed" - log_event "$E_CONNECT $EVENT" + log_event "$E_CONNECT" "$EVENT" exit $E_CONNECT fi @@ -104,7 +114,7 @@ is_dnshost_alive() { $send_cmd v-list-user $DNS_USER if [ $? -ne 0 ]; then echo "Error: dns user $DNS_USER doesn't exist" - log_event "$E_NOTEXIST $EVENT" + log_event "$E_NOTEXIST" "$EVENT" exit $E_NOTEXIST fi } @@ -146,7 +156,7 @@ remote_dns_health_check() { echo -e "\n\n--\nVesta Control Panel\n$(hostname)" >> $tmpfile cat $tmpfile | $send_mail -s "$subj" $email - log_event "$E_CONNECT $EVENT" + log_event "$E_CONNECT" "$EVENT" dconf="../../../conf/dns-cluster" update_object_value "$dconf" 'HOST' "$HOST" '$SUSPENDED' 'yes' fi From 179cca9566c7ec0c44dc2a8ccfceb31dbf63a99c Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 9 Jul 2014 00:57:19 +0300 Subject: [PATCH 49/49] multiftp support --- bin/v-list-user | 3 ++- func/rebuild.sh | 44 +++++++++++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/bin/v-list-user b/bin/v-list-user index ea818ac1f..817fb8422 100755 --- a/bin/v-list-user +++ b/bin/v-list-user @@ -70,6 +70,7 @@ is_object_valid 'user' 'USER' "$user" # Defining config conf=$USER_DATA/user.conf +HOME=$HOMEDIR/$user # Defining fileds to select fields='$USER $FNAME $LNAME $PACKAGE $WEB_TEMPLATE $PROXY_TEMPLATE @@ -81,7 +82,7 @@ fields='$USER $FNAME $LNAME $PACKAGE $WEB_TEMPLATE $PROXY_TEMPLATE $U_DISK_DIRS $U_DISK_WEB $U_DISK_MAIL $U_DISK_DB $U_BANDWIDTH $U_WEB_DOMAINS $U_WEB_SSL $U_WEB_ALIASES $U_DNS_DOMAINS $U_DNS_RECORDS $U_MAIL_DOMAINS $U_MAIL_DKIM $U_MAIL_ACCOUNTS $U_DATABASES $U_CRON_JOBS - $U_BACKUPS $LANGUAGE $TIME $DATE' + $U_BACKUPS $LANGUAGE $HOME $TIME $DATE' # Listing user case $format in diff --git a/func/rebuild.sh b/func/rebuild.sh index de3cc4fec..22ca03106 100644 --- a/func/rebuild.sh +++ b/func/rebuild.sh @@ -318,21 +318,36 @@ rebuild_web_domain_conf() { $WEBTPL/$PROXY_SYSTEM/$PROXY.sh $user $domain $ip $HOMEDIR $docroot fi - # Checking ftp - if [ ! -z "$FTP_USER" ]; then - if [ -z "$(grep ^$FTP_USER: /etc/passwd)" ]; then - shell='/sbin/nologin' - if [ -e "/usr/bin/rssh" ]; then - shell='/usr/bin/rssh' - fi - /usr/sbin/useradd $FTP_USER \ + # Defining ftp user shell + if [ -z "$FTP_SHELL" ]; then + shell='/sbin/nologin' + if [ -e "/usr/bin/rssh" ]; then + shell='/usr/bin/rssh' + fi + else + shell=$FTP_SHELL + fi + + # Checking ftp users + for ftp_user in ${FTP_USER//:/ }; do + if [ -z "$(grep ^$ftp_user: /etc/passwd)" ]; then + # Parsing ftp user variables + position=$(echo $FTP_USER | tr ':' '\n' | grep -n '' |\ + grep ":$ftp_user$" | cut -f 1 -d:) + ftp_path=$(echo $FTP_PATH | tr ':' '\n' | grep -n '' |\ + grep "^$position:" | cut -f 2 -d :) + ftp_md5=$(echo $FTP_MD5 | tr ':' '\n' | grep -n '' |\ + grep "^$position:" | cut -f 2 -d :) + + # Adding ftp user + /usr/sbin/useradd $ftp_user \ -s $shell \ -o -u $(id -u $user) \ -g $(id -u $user) \ - -M -d "$HOMEDIR/$user/web/$domain" > /dev/null 2>&1 + -M -d "$HOMEDIR/$user/web/$domain${ftp_path}" >/dev/null 2>&1 - # Update password - shadow=$(grep "^$FTP_USER:" /etc/shadow) + # Updating ftp user password + shadow=$(grep "^$ftp_user:" /etc/shadow) shdw3=$(echo "$shadow" | cut -f3 -d :) shdw4=$(echo "$shadow" | cut -f4 -d :) shdw5=$(echo "$shadow" | cut -f5 -d :) @@ -340,15 +355,14 @@ rebuild_web_domain_conf() { shdw7=$(echo "$shadow" | cut -f7 -d :) shdw8=$(echo "$shadow" | cut -f8 -d :) shdw9=$(echo "$shadow" | cut -f9 -d :) - shadow_str="$FTP_USER:$FTP_MD5:$shdw3:$shdw4:$shdw5:$shdw6" + shadow_str="$ftp_user:$ftp_md5:$shdw3:$shdw4:$shdw5:$shdw6" shadow_str="$shadow_str:$shdw7:$shdw8:$shdw9" - chmod u+w /etc/shadow - sed -i "/^$FTP_USER:*/d" /etc/shadow + sed -i "/^$ftp_user:*/d" /etc/shadow echo "$shadow_str" >> /etc/shadow chmod u-w /etc/shadow fi - fi + done } # DNS domain rebuild