Skip to content

Commit e3159a4

Browse files
author
Kristan Kenney
committed
Merge branch 'bugfix-0704'
2 parents 8f77344 + 26fb29d commit e3159a4

File tree

143 files changed

+448
-366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+448
-366
lines changed

bin/v-change-dns-record

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ user=$1
1414
domain=$2
1515
domain_idn=$2
1616
id=$3
17-
dvalue=$(idn -t --quiet -u "$4" )
18-
priority=$5
19-
restart=$6
17+
record=$4
18+
type=$5
19+
dvalue=$(idn -t --quiet -u "$6" )
20+
priority=$7
21+
restart=$8
2022

2123
# Includes
2224
source $HESTIA/func/main.sh
@@ -33,8 +35,8 @@ format_domain_idn
3335
# Verifications #
3436
#----------------------------------------------------------#
3537

36-
check_args '4' "$#" 'USER DOMAIN ID VALUE [PRIORITY] [RESTART]'
37-
is_format_valid 'user' 'domain' 'id' 'dvalue'
38+
check_args '6' "$#" 'USER DOMAIN ID RECORD TYPE VALUE [PRIORITY] [RESTART]'
39+
is_format_valid 'user' 'domain' 'id' 'record' 'type' 'dvalue'
3840
is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
3941
is_object_valid 'user' 'USER' "$user"
4042
is_object_unsuspended 'user' 'USER' "$user"
@@ -77,7 +79,7 @@ time=$(echo "$time_n_date" |cut -f 1 -d \ )
7779
date=$(echo "$time_n_date" |cut -f 2 -d \ )
7880

7981
# Adding record
80-
dns_rec="ID='$id' RECORD='$RECORD' TYPE='$TYPE' PRIORITY='$priority'"
82+
dns_rec="ID='$id' RECORD='$record' TYPE='$type' PRIORITY='$priority'"
8183
dns_rec="$dns_rec VALUE='$dvalue' SUSPENDED='no' TIME='$time' DATE='$date'"
8284
echo "$dns_rec" >> $USER_DATA/dns/$domain.conf
8385

bin/v-list-sys-info

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ format=${1-shell}
1515
# Includes
1616
source $HESTIA/func/main.sh
1717

18+
# Retrieve Hestia Control Panel version number
19+
HESTIA_VERSION=$(grep VERSION $HESTIA/conf/hestia.conf | cut -d '=' -f2 | sed "s|'||g")
20+
HESTIA_RELEASE=$(grep RELEASE_BRANCH $HESTIA/conf/hestia.conf | cut -d '=' -f2 | sed "s|'||g")
21+
1822
# JSON list function
1923
json_list() {
2024
echo '{'
@@ -23,6 +27,8 @@ json_list() {
2327
"OS": "'$OS'",
2428
"VERSION": "'$VERSION'",
2529
"ARCH": "'$ARCH'",
30+
"HESTIA": "'$HESTIA_VERSION'",
31+
"RELEASE": "'$HESTIA_RELEASE'",
2632
"UPTIME": "'$UPTIME'",
2733
"LOADAVERAGE": "'$LOADAVERAGE'"
2834
}'
@@ -31,20 +37,20 @@ json_list() {
3137

3238
# SHELL list function
3339
shell_list() {
34-
echo "HOSTNAME OS VER ARCH UPTIME LA"
35-
echo "-------- -- --- ---- ------ --"
36-
echo "$HOSTNAME $OS $VERSION $ARCH $UPTIME $LOADAVERAGE"
40+
echo "HOSTNAME OS VER ARCH HESTIA RELEASE UPTIME LA"
41+
echo "-------- -- --- ---- ------ ------- ------ --"
42+
echo "$HOSTNAME $OS $VERSION $ARCH $HESTIA_VERSION $HESTIA_RELEASE $UPTIME $LOADAVERAGE"
3743
}
3844

3945
# PLAIN list function
4046
plain_list() {
41-
echo -e "$HOSTNAME\t$OS\t$VERSION\t$ARCH\t$UPTIME\t$LOADAVERAGE"
47+
echo -e "$HOSTNAME\t$OS\t$VERSION\t$ARCH\t$HESTIA_VERSION\t$HESTIA_RELEASE\t$UPTIME\t$LOADAVERAGE"
4248
}
4349

4450
# CSV list function
4551
csv_list() {
46-
echo "HOSTNAME,OS,VERSION,ARCH,UPTIME,LOADAVERAGE"
47-
echo "$HOSTNAME,$OS,$VERSION,$ARCH,$UPTIME,$LOADAVERAGE"
52+
echo "HOSTNAME,OS,VERSION,ARCH,HESTIA,RELEASE,UPTIME,LOADAVERAGE"
53+
echo "$HOSTNAME,$OS,$VERSION,$ARCH,$HESTIA_VERSION,$HESTIA_RELEASE,$UPTIME,$LOADAVERAGE"
4854
}
4955

5056

bin/v-list-sys-services

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ if [ ! -z "$CRON_SYSTEM" ] && [ "$CRON_SYSTEM" != 'remote' ]; then
263263
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
264264
fi
265265

266+
# Checking SSH daemon
267+
if [ -e "/etc/ssh/sshd_config" ]; then
268+
get_srv_state ssh
269+
data="$data\nNAME='ssh' SYSTEM='SSH Access' STATE='$state'"
270+
data="$data CPU='$cpu' MEM='$mem' RTIME='$rtime'"
271+
fi
272+
266273
# Checking FIREWALL system
267274
if [ ! -z "$FIREWALL_SYSTEM" ] && [ "$FIREWALL_SYSTEM" != 'remote' ]; then
268275
state="stopped"
@@ -274,6 +281,7 @@ if [ ! -z "$FIREWALL_SYSTEM" ] && [ "$FIREWALL_SYSTEM" != 'remote' ]; then
274281
data="$data STATE='$state' CPU='0' MEM='0' RTIME='$rtime'"
275282
fi
276283

284+
277285
# Checking FIREWALL Fail2ban extention
278286
if [ ! -z "$FIREWALL_EXTENSION" ]; then
279287
get_srv_state $FIREWALL_EXTENSION fail2ban-server script

bin/v-list-user-stats

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ is_object_valid 'user' 'USER' "$user"
122122
# Action #
123123
#----------------------------------------------------------#
124124

125+
# Ensure statistics are up to date
126+
$BIN/v-update-user-stats $user
127+
128+
125129
# Defining config
126130
conf=$USER_DATA/stats.log
127131
if [ ! -e "$conf" ]; then

bin/v-list-users-stats

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ check_args '0' "$#" '[FORMAT]'
121121
# Action #
122122
#----------------------------------------------------------#
123123

124+
# Ensure statistics are up to date
125+
for user in $(ls $HESTIA/data/users); do
126+
$BIN/v-update-user-stats $user
127+
done
128+
124129
# Defining config
125130
conf=$HESTIA/data/users/admin/overall_stats.log
126131
if [ ! -e "$conf" ]; then

bin/v-open-fs-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fi
2828
if [ ! -z "$src_file" ]; then
2929
rpath=$(readlink -f "$src_file")
3030
services="nginx|apache|httpd|php|ftp|bind|named|exim|dovecot|spamassassin"
31-
services="$services|clam|mysql|postgresql|pgsql|cron|fail2ban|iptables"
31+
services="$services|clam|mysql|postgresql|pgsql|cron|ssh|fail2ban|iptables"
3232
services="$services|my.cnf"
3333
spath=$(echo "$rpath" |egrep "$services")
3434
if [ -z "$spath" ]; then

bin/v-update-sys-hestia-git

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ if [ ! -z "$1" ]; then
9090
exit 1
9191
else
9292
branch=$1
93+
/usr/local/hestia/bin/v-change-sys-config-value 'RELEASE_BRANCH' "$branch"
9394
fi
9495
else
9596
source /usr/local/hestia/conf/hestia.conf

func/upgrade.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ upgrade_welcome_message() {
3333

3434
upgrade_complete_message() {
3535
# Add notification to panel
36-
$HESTIA/bin/v-add-user-notification admin 'Upgrade complete' 'Your server has been updated to Hestia Control Panel version '$new_version'.<br>Please report any bugs on GitHub at<br><a href="https://github.com/hestiacp/hestiacp/Issues" target="_new">https://github.com/hestiacp/hestiacp/Issues</a><br><br>Have a great day!'
36+
$HESTIA/bin/v-add-user-notification admin 'Upgrade complete' 'Your server has been updated to Hestia Control Panel <b>v'$new_version'</b>.<br><br>Please tell us about any bugs or issues by opening an issue report on <a href="https://github.com/hestiacp/hestiacp/issues" target="_new"><i class="fab fa-github"></i> GitHub</a> or e-mail <a href="mailto:info@hestiacp.com?Subject="['$new_version'] Bug Report: ">info@hestiacp.com</a>.<br><br><b>Have a wonderful day!</b><br><br><i class="fas fa-heart status-icon red"></i> The Hestia Control Panel development team'
3737

3838
# Echo message to console output
3939
echo

install/upgrade/versions/latest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Set default theme
1010
if [ -z $THEME ]; then
1111
echo "(*) Enabling support for themes..."
12-
$BIN/v-change-sys-theme default
12+
$BIN/v-change-sys-config-value 'THEME' default
1313
fi
1414

1515
# Reduce SSH login grace time

web/add/cron/autoupdate/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
if ($_SESSION['user'] == 'admin') {
1515
exec (HESTIA_CMD."v-add-cron-hestia-autoupdate", $output, $return_var);
16-
$_SESSION['error_msg'] = __('Autoupdate has been successfully enabled');
1716
unset($output);
1817
}
1918

0 commit comments

Comments
 (0)