Skip to content

Commit 679d7c4

Browse files
authored
Fix hestiacp#1296 Logrotate broken (hestiacp#2192)
* Fix bug in v-search-domain-owner * Fix bug with logrotate not working on Debian 11 and Ubuntu 20.04 See hestiacp#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
1 parent 58ed300 commit 679d7c4

File tree

11 files changed

+29
-19
lines changed

11 files changed

+29
-19
lines changed

bin/v-log-user-login

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ source_conf "$HESTIA/conf/hestia.conf"
3232
check_args '2' "$#" 'USER IP SESSION_ID USER_AGENT [AUTHLOG] [REASON]'
3333
is_format_valid 'user' 'ip'
3434
is_common_format_valid "$session_id" "SESSION_ID"
35-
is_common_format_valid "$user_agent" "USER_AGENT"
35+
format_no_quotes "$user_agent" "USER_AGENT"
3636
is_common_format_valid "$authlog" "AUTHLOG"
3737
is_common_format_valid "$reason" "REASON"
3838

bin/v-search-domain-owner

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ source_conf "$HESTIA/conf/hestia.conf"
3030

3131
check_args '1' "$#" 'DOMAIN [TYPE]'
3232

33-
if_format_valid 'domain'
33+
is_format_valid 'domain'
3434

3535
# Perform verification if read-only mode is enabled
3636
check_hestia_demo_mode

install/deb/logrotate/hestia

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/usr/local/hestia/log/*.log {
1+
/var/log/hestia/*.log {
22
rotate 12
33
monthly
44
missingok

install/hst-install-debian.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
2323
VERBOSE='no'
2424

2525
# Define software versions
26-
HESTIA_INSTALL_VER='1.4.18~alpha'
26+
HESTIA_INSTALL_VER='1.5.0~alpha'
2727
pma_v='5.1.1'
2828
rc_v="1.4.11"
2929
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
10511051
# Configuring logrotate for Hestia logs
10521052
cp -f $HESTIA_INSTALL_DIR/logrotate/hestia /etc/logrotate.d/hestia
10531053

1054+
rm -f /var/log/hestia
1055+
mkdir -p /var/log/hestia
1056+
ln -s /var/log/hestia $HESTIA/log
10541057
# Building directory tree and creating some blank files for Hestia
1055-
mkdir -p $HESTIA/conf $HESTIA/log $HESTIA/ssl $HESTIA/data/ips \
1058+
mkdir -p $HESTIA/conf $HESTIA/ssl $HESTIA/data/ips \
10561059
$HESTIA/data/queue $HESTIA/data/users $HESTIA/data/firewall \
10571060
$HESTIA/data/sessions
10581061
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 \
10611064
$HESTIA/log/nginx-error.log $HESTIA/log/auth.log
10621065
chmod 750 $HESTIA/conf $HESTIA/data/users $HESTIA/data/ips $HESTIA/log
10631066
chmod -R 750 $HESTIA/data/queue
1064-
chmod 660 $HESTIA/log/*
1065-
rm -f /var/log/hestia
1066-
ln -s $HESTIA/log /var/log/hestia
1067+
chmod 660 /var/log/hestia/*
10671068
chmod 770 $HESTIA/data/sessions
10681069

10691070
# Generating Hestia configuration

install/hst-install-ubuntu.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ HESTIA_INSTALL_DIR="$HESTIA/install/deb"
2323
VERBOSE='no'
2424

2525
# Define software versions
26-
HESTIA_INSTALL_VER='1.4.17~alpha'
26+
HESTIA_INSTALL_VER='1.5.0~alpha'
2727
pma_v='5.1.1'
2828
rc_v="1.4.11"
2929
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
10871087
# Configuring logrotate for Hestia logs
10881088
cp -f $HESTIA_INSTALL_DIR/logrotate/hestia /etc/logrotate.d/hestia
10891089

1090+
rm -f /var/log/hestia
1091+
mkdir -p /var/log/hestia
1092+
ln -s /var/log/hestia $HESTIA/log
10901093
# Building directory tree and creating some blank files for Hestia
1091-
mkdir -p $HESTIA/conf $HESTIA/log $HESTIA/ssl $HESTIA/data/ips \
1094+
mkdir -p $HESTIA/conf $HESTIA/ssl $HESTIA/data/ips \
10921095
$HESTIA/data/queue $HESTIA/data/users $HESTIA/data/firewall \
10931096
$HESTIA/data/sessions
10941097
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 \
10971100
$HESTIA/log/nginx-error.log $HESTIA/log/auth.log
10981101
chmod 750 $HESTIA/conf $HESTIA/data/users $HESTIA/data/ips $HESTIA/log
10991102
chmod -R 750 $HESTIA/data/queue
1100-
chmod 660 $HESTIA/log/*
1101-
rm -f /var/log/hestia
1102-
ln -s $HESTIA/log /var/log/hestia
1103+
chmod 660 /var/log/hestia/*
11031104
chmod 770 $HESTIA/data/sessions
11041105

11051106
# Generating Hestia configuration

install/upgrade/versions/1.4.18.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,12 @@ if [ -n "$MAIL_SYSTEM" ]; then
3434
for ip in $($BIN/v-list-sys-ips plain | cut -f1); do
3535
sed '/^HELO/d' $HESTIA/data/ips/$ip;
3636
done
37+
fi
38+
39+
if [ -L "/var/log/hestia" ]; then
40+
echo "[ ! ] Move /usr/local/hestia/log/* to /var/log/hestia/"
41+
rm /var/log/hestia
42+
cp $HESTIA/log/* /var/log/hestia
43+
rm -rf $HESTIA/log/
44+
ln -s /var/log/hestia $HESTIA/log
3745
fi

src/deb/hestia/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Source: hestia
22
Package: hestia
33
Priority: optional
4-
Version: 1.4.18~alpha
4+
Version: 1.5.0~alpha
55
Section: admin
66
Maintainer: HestiaCP <info@hestiacp.com>
77
Homepage: https://www.hestiacp.com

src/deb/nginx/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Source: hestia-nginx
22
Package: hestia-nginx
33
Priority: optional
4-
Version: 1.19.10
4+
Version: 1.21.3
55
Section: admin
66
Maintainer: HestiaCP <info@hestiacp.com>
77
Homepage: https://www.hestiacp.com

src/deb/nginx/nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
user admin;
33
worker_processes 1;
44
worker_rlimit_nofile 65535;
5-
error_log /usr/local/hestia/log/nginx-error.log;
5+
error_log /var/log/hestia/nginx-error.log;
66
pid /var/run/hestia-nginx.pid;
77

88
# Worker config
@@ -58,7 +58,7 @@ http {
5858
'"$status" $body_bytes_sent "$http_referer" '
5959
'"$http_user_agent" "$http_x_forwarded_for"';
6060
log_format bytes '$body_bytes_sent';
61-
access_log /usr/local/hestia/log/nginx-access.log main;
61+
access_log /var/log/hestia/nginx-access.log main;
6262

6363
# Mime settings
6464
include /usr/local/hestia/nginx/conf/mime.types;

src/deb/php/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Source: hestia-php
22
Package: hestia-php
33
Priority: optional
4-
Version: 7.4.22
4+
Version: 7.4.25
55
Section: admin
66
Maintainer: HestaCP <info@hestiacp.com>
77
Homepage: https://www.hestiacp.com

0 commit comments

Comments
 (0)