Skip to content

Commit 1a924f1

Browse files
authored
Merge pull request hestiacp#1142 from hestiacp/staging/fixes
Staging/fixes
2 parents 5298776 + 06a1ff4 commit 1a924f1

File tree

23 files changed

+241
-24
lines changed

23 files changed

+241
-24
lines changed

CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,29 @@ All notable changes to this project will be documented in this file.
99
- `UPGRADE_SEND_EMAIL` = Sends an email notification to admin email address
1010
- `UPGRADE_SEND_EMAIL_LOG` = Sends installation log output to admin email address
1111
- Upgrade process will now save logs to the `hst_backups` directory.
12+
- Support for removing backup remote location (#1083)
13+
- Add support Proftpd TLS Support
14+
- Add the possibility to assign user "Administrators" rights on login. Replaces "root" login. Notifications are only send towards the "admin" account email
15+
16+
## Buggfixes
17+
- Removed root login (root / root password )
18+
- Update apache2.conf replace Include with IncludeOptional (#1072)
19+
- Add ca-certificates, software-properties-common to the dependencies (#1073 + [Forum](https://forum.hestiacp.com/t/hestiscp-fails-on-new-debian-9-vps/1623/8) ) @daniel-eder
20+
- Fixed issues with database port during backup when port was missing (#1068)
21+
- Postqresql: forbid the use of upper case (#1084) causing issues with backup / creating database or user
22+
- Fixed permissions email account during restore (#1114)
23+
- Create .npm on creating new user (#1113) @hahagu
24+
- Fixed Access to a website without a ssl certificate on https shows the content of the first, valid ssl website (#1103)
25+
- Fixed an issue when installing --with-debs and version check (#1110)
26+
- Improved Translations Chinese @myrevery
27+
- File manager create directory with proper permissions
28+
- Removed loop ad v-rebuild-all (#1096)
29+
- Add $restart flag to v-add-web-domain-backend call (#1094) (#797) @bright-soft
30+
- Fixed an issue with Restore Failed on Domains with Mail Setups using SSL (#1069)
31+
- Fixed an issue with PHPMyAdmin button (#1078)
32+
- Changed WordPress name in Webapp installer (#1074)
33+
- Add a free disk space validation during backup routine (#1115)
1234

13-
## Bugfixes
1435

1536
## [1.2.3] - Service Release
1637
### Features

bin/v-add-user

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ RKEY='$(generate_password)'
188188
TWOFA=''
189189
QRCODE=''
190190
PHPCLI=''
191+
ROLE='user'
191192
SUSPENDED='no'
192193
SUSPENDED_USERS='0'
193194
SUSPENDED_WEB='0'

bin/v-backup-user

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ start_time=$(date '+%s')
5555
subj="$user → backup failed"
5656
email=$(grep CONTACT $HESTIA/data/users/admin/user.conf |cut -f 2 -d \')
5757

58+
# Validate available disk space (take usage * 2, due to the backup handling)
59+
let u_disk=$(grep "U_DISK=" $HESTIA/data/users/$user/user.conf |cut -f 2 -d \')*2
60+
let v_disk=$(($(stat -f --format="%a*%S" $BACKUP)))/1024/1024
61+
62+
if [ "$u_disk" -gt "$v_disk" ]; then
63+
echo "not enough diskspace available to perform the backup." |$SENDMAIL -s "$subj" $email $notify
64+
check_result $E_LIMIT "not enough diskspace available to perform the backup."
65+
fi
66+
5867
if [ -z "$BACKUP_TEMP" ]; then
5968
BACKUP_TEMP=$BACKUP
6069
fi

bin/v-change-user-package

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ RKEY='$RKEY'
104104
TWOFA='$TWOFA'
105105
QRCODE='$QRCODE'
106106
PHPCLI='$PHPCLI'
107+
ROLE='$ROLE'
107108
SUSPENDED='$SUSPENDED'
108109
SUSPENDED_USERS='$SUSPENDED_USERS'
109110
SUSPENDED_WEB='$SUSPENDED_WEB'

bin/v-change-user-role

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
# info: updates user role
3+
# options: USER ROLE
4+
5+
#----------------------------------------------------------#
6+
# Variable&Function #
7+
#----------------------------------------------------------#
8+
9+
# Argument definition
10+
user=$1
11+
role=$2
12+
13+
14+
# Includes
15+
source $HESTIA/func/main.sh
16+
source $HESTIA/conf/hestia.conf
17+
18+
19+
#----------------------------------------------------------#
20+
# Verifications #
21+
#----------------------------------------------------------#
22+
23+
# Reading user values
24+
source $USER_DATA/user.conf
25+
26+
is_format_valid 'user' 'role'
27+
is_object_valid 'user' 'USER' "$user"
28+
29+
is_object_unsuspended 'user' 'USER' "$user"
30+
31+
#----------------------------------------------------------#
32+
# Action #
33+
#----------------------------------------------------------#
34+
35+
update_user_value "$user" '$ROLE' "$role"
36+
37+
38+
#----------------------------------------------------------#
39+
# Hestia #
40+
#----------------------------------------------------------#
41+
42+
exit

bin/v-get-user-salt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ check_args '1' "$#" 'USER [IP] [SALT]'
6161
is_format_valid 'user'
6262

6363
# Checking user
64-
if [ ! -d "$HESTIA/data/users/$user" ] && [ "$user" != 'root' ]; then
64+
if [ ! -d "$HESTIA/data/users/$user" ]; then
6565
echo "Error: password missmatch"
6666
echo "$date $time $user $ip failed to login" >> $HESTIA/log/auth.log
6767
exit 9

bin/v-list-user

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ json_list() {
4545
"RKEY": "'$RKEY'",
4646
"TWOFA": "'$TWOFA'",
4747
"QRCODE": "'$QRCODE'",
48+
"ROLE": "'$ROLE'",
4849
"SUSPENDED": "'$SUSPENDED'",
4950
"SUSPENDED_USERS": "'$SUSPENDED_USERS'",
5051
"SUSPENDED_WEB": "'$SUSPENDED_WEB'",

func/main.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,13 @@ is_object_format_valid() {
900900
fi
901901
}
902902

903+
# Role validator
904+
is_role_valid (){
905+
if ! [[ "$1" =~ ^admin|user$ ]]; then
906+
check_result $E_INVALID "invalid $2 format :: $1"
907+
fi
908+
}
909+
903910
# Password validator
904911
is_password_format_valid() {
905912
if [ "${#1}" -lt '6' ]; then
@@ -989,6 +996,7 @@ is_format_valid() {
989996
quota) is_int_format_valid "$arg" 'quota' ;;
990997
record) is_common_format_valid "$arg" 'record';;
991998
restart) is_boolean_format_valid "$arg" 'restart' ;;
999+
role) is_role_valid "$arg" 'role' ;;
9921000
rtype) is_dns_type_format_valid "$arg" ;;
9931001
rule) is_int_format_valid "$arg" "rule id" ;;
9941002
service) is_service_format_valid "$arg" "$arg_name" ;;

func/rebuild.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ rebuild_user_conf() {
3131
if [ -z "${PHPCLI+x}" ]; then
3232
sed -i "/QRCODE/a PHPCLI=''" $USER_DATA/user.conf
3333
fi
34+
if [ -z "${ROLE+x}" ]; then
35+
sed -i "/PHPCLI/a ROLE='user'" $USER_DATA/user.conf
36+
fi
3437
# Run template trigger
3538
if [ -x "$HESTIA/data/packages/$PACKAGE.sh" ]; then
3639
$HESTIA/data/packages/$PACKAGE.sh "$user" "$CONTACT" "$NAME"

install/deb/apache2/apache2.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ LogFormat "%{Referer}i -> %U" referer
8080
LogFormat "%{User-agent}i" agent
8181
LogFormat "%b" bytes
8282

83-
Include conf.d/*.conf
83+
IncludeOptional conf.d/*.conf
8484
IncludeOptional conf.d/domains/*.conf
8585

8686
# Include the virtual host configurations:

0 commit comments

Comments
 (0)