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

Fix #1296 Logrotate broken (#2192)

* Fix bug in v-search-domain-owner

* Fix bug with logrotate not working on Debian 11 and Ubuntu 20.04

See #1296

"Bug" is caused due to changes in logrotate:

See:
https://askubuntu.com/a/1275673

* Fix bug in v-log-user-login

* Update hestia-nginx.conf 

Require rebuild of packages!

* Update version  hestia-nginx, hestia-php and hestia package

* Adjust chmod folder in /var/log/hestia/log to /var/log/hestia
Jaap Marcus 4 лет назад
Родитель
Сommit
679d7c4039

+ 1 - 1
bin/v-log-user-login

@@ -32,7 +32,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 check_args '2' "$#" 'USER IP SESSION_ID USER_AGENT [AUTHLOG] [REASON]'
 is_format_valid 'user' 'ip'
 is_common_format_valid "$session_id" "SESSION_ID"
-is_common_format_valid "$user_agent" "USER_AGENT"
+format_no_quotes "$user_agent" "USER_AGENT"
 is_common_format_valid "$authlog" "AUTHLOG"
 is_common_format_valid "$reason" "REASON"
 

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

@@ -30,7 +30,7 @@ source_conf "$HESTIA/conf/hestia.conf"
 
 check_args '1' "$#" 'DOMAIN [TYPE]'
 
-if_format_valid 'domain'
+is_format_valid 'domain'
 
 # Perform verification if read-only mode is enabled
 check_hestia_demo_mode

+ 1 - 1
install/deb/logrotate/hestia

@@ -1,4 +1,4 @@
-/usr/local/hestia/log/*.log {
+/var/log/hestia/*.log {
     rotate 12
     monthly
     missingok

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

@@ -23,7 +23,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.4.18~alpha'
+HESTIA_INSTALL_VER='1.5.0~alpha'
 pma_v='5.1.1'
 rc_v="1.4.11"
 multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0")
@@ -1051,8 +1051,11 @@ source /etc/profile.d/hestia.sh
 # Configuring logrotate for Hestia logs
 cp -f $HESTIA_INSTALL_DIR/logrotate/hestia /etc/logrotate.d/hestia
 
+rm -f /var/log/hestia
+mkdir -p /var/log/hestia
+ln -s /var/log/hestia $HESTIA/log
 # Building directory tree and creating some blank files for Hestia
-mkdir -p $HESTIA/conf $HESTIA/log $HESTIA/ssl $HESTIA/data/ips \
+mkdir -p $HESTIA/conf $HESTIA/ssl $HESTIA/data/ips \
     $HESTIA/data/queue $HESTIA/data/users $HESTIA/data/firewall \
     $HESTIA/data/sessions
 touch $HESTIA/data/queue/backup.pipe $HESTIA/data/queue/disk.pipe \
@@ -1061,9 +1064,7 @@ touch $HESTIA/data/queue/backup.pipe $HESTIA/data/queue/disk.pipe \
     $HESTIA/log/nginx-error.log $HESTIA/log/auth.log
 chmod 750 $HESTIA/conf $HESTIA/data/users $HESTIA/data/ips $HESTIA/log
 chmod -R 750 $HESTIA/data/queue
-chmod 660 $HESTIA/log/*
-rm -f /var/log/hestia
-ln -s $HESTIA/log /var/log/hestia
+chmod 660 /var/log/hestia/*
 chmod 770 $HESTIA/data/sessions
 
 # Generating Hestia configuration

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

@@ -23,7 +23,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
 VERBOSE='no'
 
 # Define software versions
-HESTIA_INSTALL_VER='1.4.17~alpha'
+HESTIA_INSTALL_VER='1.5.0~alpha'
 pma_v='5.1.1'
 rc_v="1.4.11"
 multiphp_v=("5.6" "7.0" "7.1" "7.2" "7.3" "7.4" "8.0")
@@ -1087,8 +1087,11 @@ source /etc/profile.d/hestia.sh
 # Configuring logrotate for Hestia logs
 cp -f $HESTIA_INSTALL_DIR/logrotate/hestia /etc/logrotate.d/hestia
 
+rm -f /var/log/hestia
+mkdir -p /var/log/hestia
+ln -s /var/log/hestia $HESTIA/log
 # Building directory tree and creating some blank files for Hestia
-mkdir -p $HESTIA/conf $HESTIA/log $HESTIA/ssl $HESTIA/data/ips \
+mkdir -p $HESTIA/conf $HESTIA/ssl $HESTIA/data/ips \
     $HESTIA/data/queue $HESTIA/data/users $HESTIA/data/firewall \
     $HESTIA/data/sessions
 touch $HESTIA/data/queue/backup.pipe $HESTIA/data/queue/disk.pipe \
@@ -1097,9 +1100,7 @@ touch $HESTIA/data/queue/backup.pipe $HESTIA/data/queue/disk.pipe \
     $HESTIA/log/nginx-error.log $HESTIA/log/auth.log
 chmod 750 $HESTIA/conf $HESTIA/data/users $HESTIA/data/ips $HESTIA/log
 chmod -R 750 $HESTIA/data/queue
-chmod 660 $HESTIA/log/*
-rm -f /var/log/hestia
-ln -s $HESTIA/log /var/log/hestia
+chmod 660 /var/log/hestia/*
 chmod 770 $HESTIA/data/sessions
 
 # Generating Hestia configuration

+ 8 - 0
install/upgrade/versions/1.4.18.sh

@@ -34,4 +34,12 @@ if [ -n "$MAIL_SYSTEM" ]; then
     for ip in $($BIN/v-list-sys-ips plain | cut -f1); do
         sed '/^HELO/d' $HESTIA/data/ips/$ip;
     done
+fi
+
+if [ -L "/var/log/hestia" ]; then
+    echo "[ ! ] Move /usr/local/hestia/log/* to /var/log/hestia/"
+    rm /var/log/hestia
+    cp $HESTIA/log/* /var/log/hestia
+    rm -rf $HESTIA/log/
+   ln -s /var/log/hestia $HESTIA/log
 fi

+ 1 - 1
src/deb/hestia/control

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

+ 1 - 1
src/deb/nginx/control

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

+ 2 - 2
src/deb/nginx/nginx.conf

@@ -2,7 +2,7 @@
 user                    admin;
 worker_processes        1;
 worker_rlimit_nofile    65535;
-error_log               /usr/local/hestia/log/nginx-error.log;
+error_log               /var/log/hestia/nginx-error.log;
 pid                     /var/run/hestia-nginx.pid;
 
 # Worker config
@@ -58,7 +58,7 @@ http {
                         '"$status" $body_bytes_sent "$http_referer" '
                         '"$http_user_agent" "$http_x_forwarded_for"';
     log_format  bytes   '$body_bytes_sent';
-    access_log          /usr/local/hestia/log/nginx-access.log main;
+    access_log          /var/log/hestia/nginx-access.log main;
     
     # Mime settings
     include             /usr/local/hestia/nginx/conf/mime.types;

+ 1 - 1
src/deb/php/control

@@ -1,7 +1,7 @@
 Source: hestia-php
 Package: hestia-php
 Priority: optional
-Version: 7.4.22
+Version: 7.4.25
 Section: admin
 Maintainer: HestaCP <info@hestiacp.com>
 Homepage: https://www.hestiacp.com

+ 1 - 1
src/hst_autocompile.sh

@@ -211,7 +211,7 @@ fi
 echo "Build version $BUILD_VER, with Nginx version $NGINX_V and PHP version $PHP_V"
 
 HESTIA_V="${BUILD_VER}_${BUILD_ARCH}"
-OPENSSL_V='1.1.1k'
+OPENSSL_V='1.1.1l'
 PCRE_V='8.45'
 ZLIB_V='1.2.11'