Browse Source

Merge remote-tracking branch 'origin/bugfix-0708'

Kristan Kenney 6 years ago
parent
commit
d3e27fa82f

+ 1 - 2
bin/v-add-sys-theme

@@ -19,7 +19,7 @@ source $HESTIA/func/main.sh
 source $HESTIA/conf/hestia.conf
 
 # Define themes repository URL format
-HESTIA_THEMES_REPO="$HESTIA_GIT_REPO/$RELEASE_BRANCH/themes"
+HESTIA_THEMES_REPO="$HESTIA_GIT_REPO/$RELEASE_BRANCH/install/deb/themes"
 
 #----------------------------------------------------------#
 #                       Action                             #
@@ -48,7 +48,6 @@ fi
 # Check if theme name already exists as system theme
 if [ -e $HESTIA_THEMES/$theme.css ]; then
     echo "ERROR: System theme with the same name already exists: $theme."
-    echo "       To update system themes, run v-update-sys-themes."
     exit 1
 fi
 

+ 5 - 0
bin/v-change-sys-theme

@@ -18,6 +18,11 @@ source $HESTIA/conf/hestia.conf
 #                       Action                             #
 #----------------------------------------------------------#
 
+# Initialize local directory if it does not exist
+if [ ! -d "$HESTIA_THEMES_CUSTOM" ]; then
+    mkdir -p $HESTIA_THEMES_CUSTOM
+fi
+
 # Theme argument and file detection
 if [ -z "$theme" ]; then
     echo "ERROR: No theme specified."

+ 7 - 2
bin/v-list-sys-themes

@@ -81,10 +81,15 @@ csv_list() {
 #----------------------------------------------------------#
 
 # Parsing templates
+
+# System provided themes
 themes=$(ls -v $HESTIA_THEMES/)
+themes=$(echo "$themes" | grep '\.css' | sed 's/\.css$//')
+
+# Custom themes
 themes_custom=$(ls -v $HESTIA_THEMES_CUSTOM/)
-themes=$(echo "$themes" |grep '\.css' |sed 's/\.css$//')
-themes_custom=$(echo "$themes_custom" |grep '\.css' |sed 's/\.css$//')
+themes_custom=$(echo "$themes_custom" | grep '\.css' | sed 's/\.css$//')
+
 
 # Listing data
 case $format in

+ 1 - 1
bin/v-update-sys-hestia-git

@@ -349,7 +349,7 @@ if [ "$HESTIA_B" = true ] ; then
 
     # Move needed directories
     cd $BUILD_DIR/hestiacp-$branch
-    mv bin func install themes web ../hestia_$HESTIA_V/usr/local/hestia/
+    mv bin func install web ../hestia_$HESTIA_V/usr/local/hestia/
 
     # Set permission
     cd ../hestia_$HESTIA_V/usr/local/hestia/bin

+ 0 - 43
bin/v-update-sys-themes

@@ -1,43 +0,0 @@
-#!/bin/bash
-# info: Updates system theme CSS files from Hestia Control 
-#       Panel GitHub repository using the $HESTIA_GIT_REPO
-#       varible set in $HESTIA/func/main.sh.
-#
-# Usage: v-update-sys-themes
-#
-
-#----------------------------------------------------------#
-#                    Variable&Function                     #
-#----------------------------------------------------------#
-
-# Includes
-source $HESTIA/func/main.sh
-source $HESTIA/conf/hestia.conf
-
-# Set temporary directory
-HESTIA_THEMES_TEMP="/tmp/hestia-themes"
-
-#----------------------------------------------------------#
-#                       Action                             #
-#----------------------------------------------------------#
-
-# Initialize download directory
-mkdir $HESTIA_THEMES_TEMP
-
-# Update system themes
-for theme in `ls $HESTIA_THEMES/`; do
-    echo "Downloading theme: $theme"
-    wget $HESTIA_GIT_REPO/$RELEASE_BRANCH/themes/$theme -O \ 
-        $HESTIA_THEMES_TEMP/$theme > /dev/null 2>&1
-    rm -f $HESTIA_THEMES/$theme
-    mv $HESTIA_THEMES_TEMP/$theme $HESTIA_THEMES/$theme
-done
-
-# Remove any temporary files and directories
-rm -rf $HESTIA_THEMES_TEMP
-
-#----------------------------------------------------------#
-#                       Hestia                             #
-#----------------------------------------------------------#
-
-exit

+ 1 - 1
func/main.sh

@@ -16,7 +16,7 @@ DNSTPL=$HESTIA/data/templates/dns
 RRD=$HESTIA/web/rrd
 SENDMAIL="$HESTIA/web/inc/mail-wrapper.php"
 HESTIA_GIT_REPO="https://raw.githubusercontent.com/hestiacp/hestiacp"
-HESTIA_THEMES="$HESTIA/themes"
+HESTIA_THEMES="$HESTIA_INSTALL_DIR/themes"
 HESTIA_THEMES_CUSTOM="$HESTIA/data/templates/themes"
 SCRIPT="$(basename $0)"
 

+ 1 - 1
func/upgrade.sh

@@ -121,7 +121,7 @@ upgrade_start_routine() {
     # Upgrade to Version 1.0.3
     if [ $VERSION = "1.0.2" ]; then
         source $HESTIA/install/upgrade/versions/previous/1.0.3.sh
-        VERSION="$new_version"
+        VERSION="1.0.3"
         upgrade_refresh_config
     fi
 

+ 0 - 0
themes/default.css → install/deb/themes/default.css


+ 1 - 5
install/hst-install-debian.sh

@@ -1125,10 +1125,6 @@ cp -rf $HESTIA_INSTALL_DIR/templates $HESTIA/data/
 mkdir -p /var/www/html
 mkdir -p /var/www/document_errors
 
-# Installing default themes
-mkdir -p $HESTIA/themes
-cp -rf $HESTIA_INSTALL_DIR/themes $HESTIA/themes/
-
 # Install default success page
 cp -rf $HESTIA_INSTALL_DIR/templates/web/unassigned/index.html /var/www/html/
 cp -rf $HESTIA_INSTALL_DIR/templates/web/skel/document_errors/* /var/www/document_errors/
@@ -1827,7 +1823,7 @@ fi
 $HESTIA/bin/v-change-sys-port $port
 
 # Set default theme
-$HESTIA/bin/v-change-sys-theme default
+$HESTIA/bin/v-change-sys-theme 'default'
 
 # Starting Hestia service
 update-rc.d hestia defaults

+ 1 - 5
install/hst-install-ubuntu.sh

@@ -1078,10 +1078,6 @@ cp -rf $HESTIA_INSTALL_DIR/templates $HESTIA/data/
 mkdir -p /var/www/html
 mkdir -p /var/www/document_errors
 
-# Installing default themes
-mkdir -p $HESTIA/themes
-cp -rf $HESTIA_INSTALL_DIR/themes $HESTIA/themes/
-
 # Install default success page
 cp -rf $HESTIA_INSTALL_DIR/templates/web/unassigned/index.html /var/www/html/
 cp -rf $HESTIA_INSTALL_DIR/templates/web/skel/document_errors/* /var/www/document_errors/
@@ -1714,7 +1710,7 @@ fi
 $HESTIA/bin/v-change-sys-port $port
 
 # Set default theme
-$HESTIA/bin/v-change-sys-theme default
+$HESTIA/bin/v-change-sys-theme 'default'
 
 # Starting Hestia service
 update-rc.d hestia defaults

+ 3 - 3
install/hst-install.sh

@@ -5,7 +5,7 @@
 #
 # Currently Supported Operating Systems:
 #
-#   Debian 8, 9
+#   Debian 8, 9, 10
 #   Ubuntu 16.04, 18.04
 #
 
@@ -54,7 +54,7 @@ no_support_message(){
     echo "Your operating system (OS) is not supported by"
     echo "Hestia Control Panel. Officially supported releases:"
     echo "****************************************************"
-    echo "  Debian 8, 9"
+    echo "  Debian 8, 9, 10"
     echo "  Ubuntu 16.04 LTS, 18.04 LTS"
     echo ""
     exit 1;
@@ -92,7 +92,7 @@ check_wget_curl(){
 
 # Check for supported operating system before proceeding with download
 # of OS-specific installer, and throw error message if unsupported OS detected.
-if [[ "$release" =~ ^(8|9|16.04|18.04)$ ]]; then
+if [[ "$release" =~ ^(8|9|10|16.04|18.04)$ ]]; then
     check_wget_curl $*
 else
     no_support_message

+ 10 - 5
install/upgrade/versions/latest.sh

@@ -9,7 +9,7 @@
 # Set default theme
 if [ -z $THEME ]; then
     echo "(*) Enabling support for themes..."
-    $BIN/v-change-sys-config-value 'THEME' default
+    $BIN/v-change-sys-theme 'default'
 fi
 
 # Reduce SSH login grace time
@@ -36,12 +36,17 @@ if [ ! -z "$IMAP_SYSTEM" ]; then
     fi
 fi
 
+# Fix restart queue
 if [ -z "$($BIN/v-list-cron-jobs admin | grep 'v-update-sys-queue restart')" ]; then
     command="sudo $BIN/v-update-sys-queue restart"
     $BIN/v-add-cron-job 'admin' '*/2' '*' '*' '*' '*' "$command"
 fi
 
-# Remove deprecated configuration line
-if cat /etc/clamav/clamd.conf | grep -q "DetectBrokenExecutables"; then
-    sed -i '/DetectBrokenExecutables/d' /etc/clamav/clamd.conf
-fi
+# Remove deprecated line from ClamAV configuration file
+if [ -e "/etc/clamav/clamd.conf" ]; then
+    clamd_conf_update_check=$(grep DetectBrokenExecutables /etc/clamav/clamd.conf)
+    if [ ! -z $clamd_conf_update_check ]; then
+        echo "(*) Updating ClamAV configuration..."
+        sed -i '/DetectBrokenExecutables/d' /etc/clamav/clamd.conf
+    fi
+fi

+ 0 - 8
install/upgrade/versions/previous/1.0.2.sh

@@ -6,14 +6,6 @@
 #######                      Place additional commands below.                   #######
 #######################################################################################
 
-#!/bin/sh
-
-# Hestia Control Panel upgrade script for target version 1.0.2
-
-#######################################################################################
-#######                      Place additional commands below.                   #######
-#######################################################################################
-
 # Replace dhparam 1024 with dhparam 4096
 echo "(*) Increasing Diffie-Hellman Parameter strength to 4096-bit..."
 if [ -e /etc/ssl/dhparam.pem ]; then

+ 1 - 1
src/hst_autocompile.sh

@@ -452,7 +452,7 @@ if [ "$HESTIA_B" = true ] ; then
 
     # Move needed directories
     cd $BUILD_DIR/hestiacp-$branch
-    mv bin func install themes web ../hestia_$HESTIA_V/usr/local/hestia/
+    mv bin func install web ../hestia_$HESTIA_V/usr/local/hestia/
 
     # Set permission
     cd ../hestia_$HESTIA_V/usr/local/hestia/bin