Skip to content

Commit 8ad50fc

Browse files
authored
Merge branch 'staging/features' into staging/fixes
2 parents fd2d7dc + 7803316 commit 8ad50fc

File tree

19 files changed

+198
-14
lines changed

19 files changed

+198
-14
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ All notable changes to this project will be documented in this file.
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.
1212
- 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
1315

14-
## Bugfixes
16+
## Buggfixes
17+
- Removed root login (root / root password )
1518
- Update apache2.conf replace Include with IncludeOptional (#1072)
16-
1719
- 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
1820
- Fixed issues with database port during backup when port was missing (#1068)
1921
- Postqresql: forbid the use of upper case (#1084) causing issues with backup / creating database or user

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-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/proftpd/proftpd.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ ServerAdmin root@localhost
44
DefaultServer on
55
DefaultRoot ~ !adm
66

7+
Include /etc/proftpd/tls.conf
8+
79
<IfModule mod_vroot.c>
810
VRootEngine on
911
VRootAlias /etc/security/pam_env.conf etc/security/pam_env.conf

install/deb/proftpd/tls.conf

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#
2+
# Proftpd sample configuration for FTPS connections.
3+
#
4+
# Note that FTPS impose some limitations in NAT traversing.
5+
# See http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-TLS.html
6+
# for more information.
7+
#
8+
<IfModule mod_dso.c>
9+
# If mod_tls was built as a shared/DSO module, load it
10+
LoadModule mod_tls.c
11+
</IfModule>
12+
<IfModule mod_tls.c>
13+
TLSEngine on
14+
TLSLog /var/log/proftpd/tls.log
15+
# this is an example of protocols, proftp works witl all, but use only the most secure ones like TLSv1.1 and TLSv1.2
16+
TLSProtocol TLSv1.1 TLSv1.2
17+
#
18+
# Server SSL certificate. You can generate a self-signed certificate using
19+
# a command like:
20+
#
21+
# openssl req -x509 -newkey rsa:1024 \
22+
# -keyout /etc/ssl/private/proftpd.key -out /etc/ssl/certs/proftpd.crt \
23+
# -nodes -days 365
24+
#
25+
# The proftpd.key file must be readable by root only. The other file can be
26+
# readable by anyone.
27+
#
28+
# chmod 0600 /etc/ssl/private/proftpd.key
29+
# chmod 0640 /etc/ssl/private/proftpd.key
30+
#
31+
TLSRSACertificateFile /usr/local/hestia/ssl/certificate.crt
32+
TLSRSACertificateKeyFile /usr/local/hestia/ssl/certificate.key
33+
#
34+
# CA the server trusts...
35+
#TLSCACertificateFile /etc/ssl/certs/CA.pem
36+
# ...or avoid CA cert and be verbose
37+
#TLSOptions NoCertRequest EnableDiags
38+
# ... or the same with relaxed session use for some clients (e.g. FireFtp)
39+
#TLSOptions NoCertRequest EnableDiags NoSessionReuseRequired
40+
#
41+
#
42+
# Per default drop connection if client tries to start a renegotiate
43+
# This is a fix for CVE-2009-3555 but could break some clients.
44+
#
45+
#TLSOptions AllowClientRenegotiations
46+
#
47+
TLSOptions NoSessionReuseRequired AllowClientRenegotiations
48+
# Authenticate clients that want to use FTP over TLS?
49+
#
50+
#TLSVerifyClient off
51+
#
52+
# Are clients required to use FTP over TLS when talking to this server?
53+
#
54+
TLSRequired off
55+
#
56+
# Allow SSL/TLS renegotiations when the client requests them, but
57+
# do not force the renegotations. Some clients do not support
58+
# SSL/TLS renegotiations; when mod_tls forces a renegotiation, these
59+
# clients will close the data connection, or there will be a timeout
60+
# on an idle data connection.
61+
#
62+
TLSRenegotiate required off
63+
</IfModule>

0 commit comments

Comments
 (0)