Просмотр исходного кода

Merge branch 'main' into feature/2020-08_change-raster-logo-to-vector-svg

arx 5 лет назад
Родитель
Сommit
80e0abdccc

+ 1 - 0
CHANGELOG.md

@@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
 - Improved reliability of list handling when using IP lists.
 - Enforce minimum password requirements with visual indication of password strength.
 - Improved installer version detection.
+- Fix MariaDB service detection.
  
 ## [1.2.1] - Service Release
 ### Features

+ 1 - 1
README.md

@@ -2,7 +2,7 @@
 
 [Hestia Control Panel](https://www.hestiacp.com/)
 ==================================================
-**Latest stable release:** Version 1.2.1 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
+**Latest stable release:** Version 1.2.2 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
 
 **Web:** [www.hestiacp.com](https://www.hestiacp.com/)<br>
 **Documentation:** [docs.hestiacp.com](https://docs.hestiacp.com/)<br>

+ 0 - 1
bin/v-add-mail-domain-ssl

@@ -28,7 +28,6 @@ if [[ "$domain" =~ .*\.$ ]]; then
     domain=$(echo "$domain" |sed -e "s/\.$//")
 fi
 
-domain=$(idn -t --quiet -u "$domain" )
 domain_idn=$(idn -t --quiet -a "$domain")
 
 # Includes

+ 0 - 1
bin/v-add-sys-webmail

@@ -26,7 +26,6 @@ if [[ "$domain" =~ .*\.$ ]]; then
     domain=$(echo "$domain" |sed -e "s/\.$//")
 fi
 
-domain=$(idn -t --quiet -u "$domain" )
 domain_idn=$(idn -t --quiet -a "$domain")
 
 # Includes

+ 3 - 0
bin/v-add-user

@@ -183,6 +183,9 @@ CONTACT='$email'
 CRON_REPORTS='yes'
 MD5='$(awk -v user=$user -F : 'user == $1 {print $2}' /etc/shadow)'
 RKEY='$(generate_password)'
+TWOFA=''
+QRCODE=''
+PHPCLI=''
 SUSPENDED='no'
 SUSPENDED_USERS='0'
 SUSPENDED_WEB='0'

+ 2 - 2
bin/v-add-user-2fa

@@ -51,8 +51,8 @@ secret=${array[0]}
 qrcode=${array[1]}
 
 # Save the secret in user config (needs encryption?)
-sed -i "/RKEY/a TWOFA='$secret'" $USER_DATA/user.conf
-sed -i "/TWOFA/a QRCODE='$qrcode'" $USER_DATA/user.conf
+update_user_value "$user" '$TWOFA' "$secret"
+update_user_value "$user" '$QRCODE' "$qrcode"
 
 #----------------------------------------------------------#
 #                       Hestia                             #

+ 1 - 1
bin/v-add-web-domain-ssl

@@ -32,7 +32,7 @@ if [[ "$domain" =~ .*\.$ ]]; then
     domain=$(echo "$domain" |sed -e "s/\.$//")
 fi
 
-domain=$(idn -t --quiet -u "$domain" )
+domain=$domain
 domain_idn=$(idn -t --quiet -a "$domain")
 
 # Includes

+ 1 - 1
bin/v-add-web-domain-stats

@@ -75,7 +75,7 @@ cat $WEBTPL/$type/$type.tpl |\
         -e "s|%domain%|$domain|g" \
         -e "s|%user%|$user|g" \
         -e "s|%home%|$HOMEDIR|g" \
-        -e "s|%alias%|${aliases//,/ }|g" \
+        -e "s|%alias%|$stats_alias|g" \
         -e "s|%alias_idn%|$stats_alias|g" \
     > $HOMEDIR/$user/conf/web/$domain/$type.conf
 

+ 5 - 3
bin/v-change-user-package

@@ -78,8 +78,7 @@ is_package_avalable() {
 change_user_package() {
     eval $(cat $USER_DATA/user.conf)
     eval $(cat $HESTIA/data/packages/$package.pkg |egrep -v "TIME|DATE")
-    echo "FNAME='$FNAME'
-LNAME='$LNAME'
+    echo "NAME='$NAME'
 PACKAGE='$package'
 WEB_TEMPLATE='$WEB_TEMPLATE'
 BACKEND_TEMPLATE='$BACKEND_TEMPLATE'
@@ -102,6 +101,9 @@ CONTACT='$CONTACT'
 CRON_REPORTS='$CRON_REPORTS'
 MD5='$MD5'
 RKEY='$RKEY'
+TWOFA='$TWOFA'
+QRCODE='$QRCODE'
+PHPCLI='$PHPCLI'
 SUSPENDED='$SUSPENDED'
 SUSPENDED_USERS='$SUSPENDED_USERS'
 SUSPENDED_WEB='$SUSPENDED_WEB'
@@ -166,7 +168,7 @@ shell=$(grep -w "$shell_conf" /etc/shells |head -n1)
 
 # Run template trigger
 if [ -x "$HESTIA/data/packages/$package.sh" ]; then
-    $HESTIA/data/packages/$package.sh "$user" "$CONTACT" "$FNAME" "$LNAME"
+    $HESTIA/data/packages/$package.sh "$user" "$CONTACT" "$NAME"
 fi
 
 # Update disk quota

+ 2 - 6
bin/v-change-user-php-cli

@@ -62,12 +62,8 @@ sed -i "/alias php='env/d" "$FILE"
 
 echo "alias php='env php$version'" >> $FILE
 
-# Change language
-if [ -z "$(grep PHPCLI $USER_DATA/user.conf)" ]; then
-    sed -i "s/^TIME/PHPCLI='$version'\nTIME/g" $USER_DATA/user.conf
-else
-    update_user_value "$user" '$PHPCLI' "$version"
-fi
+update_user_value "$user" '$PHPCLI' "$version"
+
 
 #----------------------------------------------------------#
 #                       Hestia                             #

+ 1 - 1
bin/v-delete-dns-domain

@@ -12,7 +12,7 @@
 
 # Argument definition
 user=$1
-domain=$(idn -t --quiet -u "$2" )
+domain=$2
 restart="$3"
 
 # Includes

+ 1 - 1
bin/v-delete-mail-domain-dkim

@@ -11,7 +11,7 @@
 
 # Argument definition
 user=$1
-domain=$(idn -t --quiet -u "$2" )
+domain=$2
 domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
 
 # Includes

+ 2 - 2
bin/v-delete-user-2fa

@@ -43,8 +43,8 @@ if [ -z "$TWOFA" ]; then
 fi
 
 # Remove 2FA from user config
-sed -i '/TWOFA=/d' $USER_DATA/user.conf
-sed -i '/QRCODE=/d' $USER_DATA/user.conf
+update_user_value "$user" '$TWOFA' ""
+update_user_value "$user" '$QRCODE' ""
 
 #----------------------------------------------------------#
 #                       Hestia                             #

+ 1 - 1
bin/v-delete-web-domain-stats-user

@@ -14,7 +14,7 @@
 
 # Argument definition
 user=$1
-domain=$(idn -t --quiet -u "$2" )
+domain=$2
 restart=$3
 
 # Includes

+ 12 - 4
bin/v-list-sys-services

@@ -221,16 +221,24 @@ fi
 # Checking DB system
 if [ ! -z "$DB_SYSTEM" ] && [ "$DB_SYSTEM" != 'remote' ]; then
     for db in ${DB_SYSTEM//,/ }; do
-        proc_name=''
         service="$db"
+        proc_name=''
         if [ "$service" = 'mysql' ]; then
-            if [ -d "/etc/sysconfig" ]; then
-                service='mysqld'
+            if [ -e "/lib/systemd/system/mariadb.service" ]; then
+                service='mariadb'
                 proc_name='mysqld'
-                if [ -e "/usr/lib/systemd/system/mariadb.service" ]; then
+            fi
+            if [ -f /usr/bin/mysqladmin ]; then
+                mariadb_v=`mysqladmin --version | awk 'NR==1{print $5}' | head -c 4`
+                if [ $mariadb_v = "10.5" ]; then
                     service='mariadb'
+                    proc_name='mariadbd'
                 fi
             fi
+            if [ -d "/etc/sysconfig" ]; then
+                service='mysqld'
+                proc_name='mysqld'
+            fi
         fi
         if [ "$service" == 'pgsql' ]; then
             service='postgresql'

+ 1 - 5
bin/v-rebuild-users

@@ -1,6 +1,6 @@
 #!/bin/bash
 # info: rebuild system user
-# options: USER [RESTART]
+# options: [RESTART]
 #
 # The function rebuilds system user accounts.
 
@@ -24,10 +24,6 @@ export PATH=$PATH:/usr/sbin
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-check_args '1' "$#" 'USER [RESTART]'
-is_format_valid 'user'
-is_object_valid 'user' 'USER' "$user"
-is_object_unsuspended 'user' 'USER' "$user"
 
 
 #----------------------------------------------------------#

+ 1 - 1
bin/v-search-domain-owner

@@ -10,7 +10,7 @@
 #----------------------------------------------------------#
 
 # Argument definition
-domain=$(idn -t --quiet -u "$1" )
+domain=$1
 type=${2-any}
 
 # Includes

+ 11 - 1
func/rebuild.sh

@@ -17,10 +17,20 @@ rebuild_user_conf() {
     # Update FNAME LNAME to NAME
     if [ -z "$NAME" ]; then 
         NAME="$FNAME $LNAME"
+        if [ -z $FNAME ]; then NAME=""; fi
+        
         sed -i "s/FNAME='$FNAME'/NAME='$NAME'/g" $USER_DATA/user.conf
         sed -i "/LNAME='$LNAME'/d" $USER_DATA/user.conf  
     fi
-
+    if [ -z "${TWOFA+x}" ]; then 
+        sed -i "/RKEY/a TWOFA=''" $USER_DATA/user.conf 
+    fi
+    if [ -z "${QRCODE+x}" ]; then
+        sed -i "/TWOFA/a QRCODE=''" $USER_DATA/user.conf 
+    fi
+    if [ -z "${PHPCLI+x}" ]; then 
+        sed -i "/QRCODE/a PHPCLI=''" $USER_DATA/user.conf 
+    fi
     # Run template trigger
     if [ -x "$HESTIA/data/packages/$PACKAGE.sh" ]; then
         $HESTIA/data/packages/$PACKAGE.sh "$user" "$CONTACT" "$NAME"

+ 1 - 1
install/deb/templates/web/awstats/index.tpl

@@ -3,7 +3,7 @@
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <title>Awstats log analyzer </title>
 </head>
-<frameset rows="60,*" cols="*">
+<frameset rows="80,*" cols="*">
     <frame src="nav.html" name="nav" scrolling="no" noresize>
     <frame src="%month%/index.html" name="stats">
 </frameset>

+ 2 - 2
install/deb/templates/web/awstats/nav.tpl

@@ -12,9 +12,9 @@
 <tr>
     <td><img src="logo.svg" alt="hestia"></td>
     <td><form name="period" action="" method="get">
-        <select name="select" ONCHANGE="change()">
+    <select name="select" ONCHANGE="change()">
 %select_month%
-        </select>
+    </select>
     </form>
     </td>
 </tr>

+ 2 - 2
install/hst-install-debian.sh

@@ -23,7 +23,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.2.2-alpha'
+HESTIA_INSTALL_VER='1.2.3-alpha'
 pma_v='5.0.2'
 multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4")
 fpm_v="7.3"
@@ -599,7 +599,7 @@ fi
 # Installing MariaDB repo
 if [ "$mysql" = 'yes' ]; then
     echo "[ * ] MariaDB"
-    echo "deb [arch=amd64] https://mirror.mva-n.net/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
+    echo "deb [arch=amd64] https://mirror.mva-n.net/mariadb/repo/$mariadb_v/debian $codename main" > $apt/mariadb.list
     apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' > /dev/null 2>&1
 fi
 

+ 2 - 2
install/hst-install-ubuntu.sh

@@ -23,7 +23,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.2.2-alpha'
+HESTIA_INSTALL_VER='1.2.3-alpha'
 pma_v='5.0.2'
 multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4")
 fpm_v="7.3"
@@ -572,7 +572,7 @@ fi
 # Installing MariaDB repo
 if [ "$mysql" = 'yes' ]; then
     echo "[ * ] MariaDB"
-    echo "deb [arch=amd64] https://mirror.mva-n.net/mariadb/repo/$mariadb_v/$VERSION $codename main" > $apt/mariadb.list
+    echo "deb [arch=amd64] https://mirror.mva-n.net/mariadb/repo/$mariadb_v/ubuntu $codename main" > $apt/mariadb.list
     apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' > /dev/null 2>&1
 fi
 

+ 1 - 52
install/upgrade/versions/latest.sh

@@ -1,58 +1,7 @@
 #!/bin/sh
 
-# Hestia Control Panel upgrade script for target version 1.2.2
+# Hestia Control Panel upgrade script for target version 1.2.3
 
 #######################################################################################
 #######                      Place additional commands below.                   #######
 #######################################################################################
-
-# Update template files to add warnings
-# Backup current templates
-echo "[ ! ] Updating default web domain templates..."
-$BIN/v-update-web-templates
-echo "[ ! ] Updating default mail domain templates..."
-$BIN/v-update-mail-templates
-echo "[ ! ] Updating default DNS zone templates..."
-$BIN/v-update-dns-templates
-
-# Enhance Vsftpd security
-if [ "$FTP_SYSTEM" = "vsftpd" ]; then
-    echo "[ ! ] Hardening Vsftpd TLS configuration..."
-    if [ -e /etc/vsftpd.conf ]; then
-        rm -f /etc/vsftpd.conf
-    fi
-    cp -f $HESTIA_INSTALL_DIR/vsftpd/vsftpd.conf /etc/
-    chmod 644 /etc/vsftpd.conf
-fi
-
-
-# Rework apt repositories
-apt="/etc/apt/sources.list.d"
-echo "[ * ] Hardening APT repositories..."
-if [ -f "$apt/nginx.list" ]; then
-    if grep -q "http://nginx.org/packages/mainline/" $apt/nginx.list; then
-        echo "  ----- NGINX"
-        sed -i "s/http\:\/\/nginx.org/https\:\/\/nginx.org/g" $apt/nginx.list
-    fi
-fi
-
-if [ -f "$apt/php.list" ]; then
-    if grep -q "http://packages.sury.org/" $apt/php.list; then
-        echo "  ----- PHP"
-        sed -i "s/http\:\/\/packages.sury.org/https\:\/\/packages.sury.org/g" $apt/php.list
-    fi
-fi
-
-if [ -f "$apt/mariadb.list" ]; then
-    if grep -q "http://ams2.mirrors.digitalocean.com" $apt/mariadb.list; then
-        echo "  ----- MariaDB"
-        sed -i "s/http\:\/\/ams2.mirrors.digitalocean.com/https\:\/\/mirror.mva-n.net/g" $apt/mariadb.list
-    fi
-fi
-
-if [ -f "$apt/postgresql.list" ]; then
-    if grep -q "http://apt.postgresql.org" $apt/postgresql.list; then
-        echo "  ----- PostgreSQL"
-        sed -i "s/http\:\/\/apt.postgresql.org/https\:\/\/apt.postgresql.org/g" $apt/postgresql.list
-    fi
-fi

+ 48 - 0
install/upgrade/versions/previous/1.2.2.sh

@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# Hestia Control Panel upgrade script for target version 1.2.2
+
+#######################################################################################
+#######                      Place additional commands below.                   #######
+#######################################################################################
+
+# Enhance Vsftpd security
+if [ "$FTP_SYSTEM" = "vsftpd" ]; then
+    echo "[ ! ] Hardening Vsftpd TLS configuration..."
+    if [ -e /etc/vsftpd.conf ]; then
+        rm -f /etc/vsftpd.conf
+    fi
+    cp -f $HESTIA_INSTALL_DIR/vsftpd/vsftpd.conf /etc/
+    chmod 644 /etc/vsftpd.conf
+fi
+
+# Rework apt repositories
+apt="/etc/apt/sources.list.d"
+echo "[ * ] Hardening APT repositories..."
+if [ -f "$apt/nginx.list" ]; then
+    if grep -q "http://nginx.org/packages/mainline/" $apt/nginx.list; then
+        echo "  ----- NGINX"
+        sed -i "s/http\:\/\/nginx.org/https\:\/\/nginx.org/g" $apt/nginx.list
+    fi
+fi
+
+if [ -f "$apt/php.list" ]; then
+    if grep -q "http://packages.sury.org/" $apt/php.list; then
+        echo "  ----- PHP"
+        sed -i "s/http\:\/\/packages.sury.org/https\:\/\/packages.sury.org/g" $apt/php.list
+    fi
+fi
+
+if [ -f "$apt/mariadb.list" ]; then
+    if grep -q "http://ams2.mirrors.digitalocean.com" $apt/mariadb.list; then
+        echo "  ----- MariaDB"
+        sed -i "s/http\:\/\/ams2.mirrors.digitalocean.com/https\:\/\/mirror.mva-n.net/g" $apt/mariadb.list
+    fi
+fi
+
+if [ -f "$apt/postgresql.list" ]; then
+    if grep -q "http://apt.postgresql.org" $apt/postgresql.list; then
+        echo "  ----- PostgreSQL"
+        sed -i "s/http\:\/\/apt.postgresql.org/https\:\/\/apt.postgresql.org/g" $apt/postgresql.list
+    fi
+fi

+ 1 - 1
src/deb/hestia/control

@@ -1,7 +1,7 @@
 Source: hestia
 Package: hestia
 Priority: optional
-Version: 1.2.2-alpha
+Version: 1.2.3-alpha
 Section: admin
 Maintainer: HestiaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com

+ 1 - 0
web/js/pages/edit_user.js

@@ -11,6 +11,7 @@ randomString = function(min_length = 16) {
         randomString();
     }else{
         $('input[name=v_password]').val(randomstring);
+        App.Actions.WEB.update_v_password();
     }    
 }
 

+ 4 - 4
web/templates/admin/add_db.html

@@ -94,11 +94,11 @@
                             </tr>
                             <tr>
                                 <td class="vst-text">
-                                    <?php print('Your password must have at least');?>
+                                    <?php print __('Your password must have at least');?>
                                     <ul>
-                                        <li><?php print('8 characters long');?></li>
-                                        <li><?php print('1 uppercase & 1 lowercase character');?></li>
-                                        <li><?php print('1 number');?></li>
+                                        <li><?php print __('8 characters long');?></li>
+                                        <li><?php print __('1 uppercase & 1 lowercase character');?></li>
+                                        <li><?php print __('1 number');?></li>
                                     </ul>
                                 </td>
                             </tr>

+ 4 - 4
web/templates/admin/add_mail_acc.html

@@ -78,11 +78,11 @@
                         </tr>
                         <tr>
                             <td class="vst-text">
-                                <?php print('Your password must have at least');?>
+                                <?php print __('Your password must have at least');?>
                                 <ul>
-                                    <li><?php print('8 characters long');?></li>
-                                    <li><?php print('1 uppercase & 1 lowercase character');?></li>
-                                    <li><?php print('1 number');?></li>
+                                    <li><?php print __('8 characters long');?></li>
+                                    <li><?php print __('1 uppercase & 1 lowercase character');?></li>
+                                    <li><?php print __('1 number');?></li>
                                 </ul>
                             </td>
                         </tr>

+ 4 - 4
web/templates/admin/add_user.html

@@ -74,11 +74,11 @@
                             </tr>
                             <tr>
                                 <td class="vst-text">
-                                    <?php print('Your password must have at least');?>
+                                    <?php print __('Your password must have at least');?>
                                     <ul>
-                                        <li><?php print('8 characters long');?></li>
-                                        <li><?php print('1 uppercase & 1 lowercase character');?></li>
-                                        <li><?php print('1 number');?></li>
+                                        <li><?php print __('8 characters long');?></li>
+                                        <li><?php print __('1 uppercase & 1 lowercase character');?></li>
+                                        <li><?php print __('1 number');?></li>
                                     </ul>
                                 </td>
                             </tr>

+ 4 - 4
web/templates/admin/edit_db.html

@@ -89,11 +89,11 @@
                             </tr>
                             <tr>
                                 <td class="vst-text">
-                                    <?php print('Your password must have at least');?>
+                                    <?php print __('Your password must have at least');?>
                                     <ul>
-                                        <li><?php print('8 characters long');?></li>
-                                        <li><?php print('1 uppercase & 1 lowercase character');?></li>
-                                        <li><?php print('1 number');?></li>
+                                        <li><?php print __('8 characters long');?></li>
+                                        <li><?php print __('1 uppercase & 1 lowercase character');?></li>
+                                        <li><?php print __('1 number');?></li>
                                     </ul>
                                 </td>
                             </tr>

+ 4 - 4
web/templates/admin/edit_mail_acc.html

@@ -79,11 +79,11 @@
                         </tr>
                         <tr>
                             <td class="vst-text">
-                                <?php print('Your password must have at least');?>
+                                <?php print __('Your password must have at least');?>
                                 <ul>
-                                    <li><?php print('8 characters long');?></li>
-                                    <li><?php print('1 uppercase & 1 lowercase character');?></li>
-                                    <li><?php print('1 number');?></li>
+                                    <li><?php print __('8 characters long');?></li>
+                                    <li><?php print __('1 uppercase & 1 lowercase character');?></li>
+                                    <li><?php print __('1 number');?></li>
                                     </ul>
                             </td>
                         </tr>

+ 4 - 4
web/templates/admin/edit_user.html

@@ -79,11 +79,11 @@
                             </tr>
                             <tr>
                                 <td class="vst-text">
-                                    <?php print('Your password must have at least');?>
+                                    <?php print __('Your password must have at least');?>
                                     <ul>
-                                        <li><?php print('8 characters long');?></li>
-                                        <li><?php print('1 uppercase & 1 lowercase character');?></li>
-                                        <li><?php print('1 number');?></li>
+                                        <li><?php print __('8 characters long');?></li>
+                                        <li><?php print __('1 uppercase & 1 lowercase character');?></li>
+                                        <li><?php print __('1 number');?></li>
                                     </ul>
                                 </td>
                             </tr>                            

+ 4 - 4
web/templates/user/edit_user.html

@@ -79,11 +79,11 @@
                             </tr>
                             <tr>
                                 <td class="vst-text">
-                                    <?php print('Your password must have at least');?>
+                                    <?php print __('Your password must have at least');?>
                                     <ul>
-                                        <li><?php print('8 characters long');?></li>
-                                        <li><?php print('1 uppercase & 1 lowercase character');?></li>
-                                        <li><?php print('1 number');?></li>
+                                        <li><?php print __('8 characters long');?></li>
+                                        <li><?php print __('1 uppercase & 1 lowercase character');?></li>
+                                        <li><?php print __('1 number');?></li>
                                     </ul>
                                 </td>
                             </tr>