Skip to content

Commit 2e05ab4

Browse files
author
Kristan Kenney
committed
Merge branch 'staging/sync' into main
2 parents 798cf36 + 71313e0 commit 2e05ab4

Some content is hidden

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

101 files changed

+1797
-449
lines changed

CHANGELOG.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
## [CURRENT] - Development
4+
## [1.3.0] - Major Release (Feature / Quality Update)
55
### Features
6-
- Use stronger ciphers and Disable TLS v1.1 for vsftpd.
6+
- Users can now choose to point a domain to a different document root (similar to domain parking).
7+
- The software update procedure will now perform a system health check prior to installation and repair missing environment variables.
8+
- Administrators now have control over software update notifications through the following settings in `$HESTIA/conf/hestia.conf` and through the Control Panel web interface:
9+
- `UPGRADE_SEND_EMAIL` = Sends an email notification to admin email address
10+
- `UPGRADE_SEND_EMAIL_LOG` = Sends installation log output to admin email address
11+
- Upgrade process will now save logs to the `hst_backups` directory.
12+
13+
## Bugfixes
14+
15+
## [1.2.3] - Service Release
16+
### Features
17+
- No new features have been introduced in this release.
18+
19+
### Bugfixes
20+
- Fixes an issue where non-ASCII characters were rejected in the password field.
21+
22+
## [1.2.2] - Service Release
23+
### Features
24+
- No new features have been introduced in this release.
725

826
### Bugfixes
927
- Create mailhelo.conf if it doesnt exist to prevent a error message during grep.
@@ -20,9 +38,10 @@ All notable changes to this project will be documented in this file.
2038
- Reworked the Let's Encrypt renew functionality to skip removed aliases.
2139
- Improved reliability of list handling when using IP lists.
2240
- Enforce minimum password requirements with visual indication of password strength.
41+
- Fixed an issue where user display name value was incorrectly set when changing packages.
2342
- Improved installer version detection.
24-
- Fix MariaDB service detection.
25-
43+
- Improved detection of MariaDB and MySQL services.
44+
2645
## [1.2.1] - Service Release
2746
### Features
2847
- Consolidated First and Last Name fields to a singular name field to simply input.
@@ -62,7 +81,6 @@ All notable changes to this project will be documented in this file.
6281
- Added BATS system for testing the functionality of Bash scripts (WIP).
6382
- Added **v-change-sys-db-alias** to change phpMyAdmin and phpPgAdmin access points (`v-change-sys-db-alias pma/pga myCustomURL`).
6483

65-
6684
### Bugfixes
6785
- Prevent ability to change the password of a non-Hestia user account. Thanks to **Alexandre Zanni**!
6886
- Adjust Let's Encrypt validation check for IDN domains, thanks to **@zanami**!

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[Hestia Control Panel](https://www.hestiacp.com/)
44
==================================================
5-
**Latest stable release:** Version 1.2.2 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
5+
**Latest stable release:** Version 1.2.3 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
66

77
**Web:** [www.hestiacp.com](https://www.hestiacp.com/)<br>
88
**Documentation:** [docs.hestiacp.com](https://docs.hestiacp.com/)<br>

bin/v-add-web-domain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ time=$(echo "$time_n_date" |cut -f 1 -d \ )
169169
date=$(echo "$time_n_date" |cut -f 2 -d \ )
170170

171171
# Adding domain in web.conf
172-
echo "DOMAIN='$domain' IP='$ip' IP6='' ALIAS='$ALIAS' TPL='$WEB_TEMPLATE'\
172+
echo "DOMAIN='$domain' IP='$ip' IP6='' CUSTOM_DOCROOT='' ALIAS='$ALIAS' TPL='$WEB_TEMPLATE'\
173173
SSL='no' SSL_FORCE='no' SSL_HOME='same' LETSENCRYPT='no' FTP_USER='' FTP_MD5=''\
174174
BACKEND='$BACKEND_TEMPLATE' PROXY='$PROXY_TEMPLATE' PROXY_EXT='$PROXY_EXT'\
175175
STATS='' STATS_USER='' STATS_CRYPT='' U_DISK='0' U_BANDWIDTH='0'\

bin/v-add-web-domain-backend

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@ check_hestia_demo_mode
4141

4242
# Defining pool directory
4343
prepare_web_backend
44+
get_domain_values 'web'
4445

4546
# Checking backend configuration
46-
if [ -e "$pool/$backend_type.conf" ]; then
47-
exit
48-
fi
47+
#if [ -e "$pool/$backend_type.conf" ]; then
48+
# exit
49+
#fi
4950

5051
# Allocating backend port
5152
backend_port=9000
@@ -65,6 +66,13 @@ cat $WEBTPL/$WEB_BACKEND/$template.tpl |\
6566
-e "s|%backend%|$backend_type|g"\
6667
-e "s|%backend_version%|$backend_version|g" > $pool/$backend_type.conf
6768

69+
# Set correct document root path
70+
if [ ! -z "$CUSTOM_DOCROOT" ]; then
71+
docroot="$CUSTOM_DOCROOT"
72+
sed -i "s|/home\/$user\/web\/$domain\/public_html|$docroot|g" $pool/$backend_type.conf
73+
else
74+
docroot="$HOMEDIR/$user/web/$domain/public_html/"
75+
fi
6876

6977
#----------------------------------------------------------#
7078
# Hestia #

bin/v-change-web-domain-backend-tpl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ is_object_unsuspended 'user' 'USER' "$user"
3939
is_object_valid 'web' 'DOMAIN' "$domain"
4040
is_object_unsuspended 'web' 'DOMAIN' "$domain"
4141
is_backend_template_valid $template
42+
get_domain_values 'web'
4243

4344
# Perform verification if read-only mode is enabled
4445
check_hestia_demo_mode
@@ -48,11 +49,12 @@ check_hestia_demo_mode
4849
# Action #
4950
#----------------------------------------------------------#
5051

51-
prepare_web_backend
52-
53-
# Deleting backend
52+
# Deleting current backend
5453
delete_web_backend
5554

55+
# Prepare new backend configuration
56+
prepare_web_backend
57+
5658
# Allocating backend port
5759
backend_port=9000
5860
ports=$(grep -v '^;' $pool/* 2>/dev/null |grep listen |grep -o :[0-9].*)
@@ -72,6 +74,12 @@ cat $WEBTPL/$WEB_BACKEND/$template.tpl |\
7274
-e "s|%backend%|$backend_type|g"\
7375
-e "s|%backend_version%|$backend_version|g" > $pool/$backend_type.conf
7476

77+
# Set correct document root path
78+
if [ ! -z "$CUSTOM_DOCROOT" ]; then
79+
docroot="$CUSTOM_DOCROOT"
80+
sed -i "s|/home\/$user\/web\/$domain\/public_html|$docroot|g" $pool/$backend_type.conf
81+
fi
82+
7583
# Checking backend pool configuration
7684
if [ "$backend_type" = "$user" ]; then
7785
conf=$USER_DATA/web.conf

bin/v-change-web-domain-docroot

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
#!/bin/bash
2+
# info: Changes the document root for an existing web domain
3+
4+
# options: USER DOMAIN TARGET_DOMAIN [DIRECTORY]
5+
# example usage:
6+
# add custom docroot: v-change-web-domain-docroot admin domain.tld otherdomain.tld
7+
# points domain.tld to otherdomain.tld's document root.
8+
#
9+
# remove custom docroot: v-change-web-domain-docroot admin test.local default
10+
# returns document root to default value for domain.
11+
12+
# This call changes the document root of a chosen web domain
13+
# to another available domain under the user context.
14+
15+
16+
#----------------------------------------------------------#
17+
# Variable&Function #
18+
#----------------------------------------------------------#
19+
20+
# Argument definition
21+
user=$1
22+
domain=$2
23+
24+
# Export target domain and directory
25+
# so they are correctly passed through to domain.sh
26+
export target_domain=$3
27+
export target_directory=$4
28+
29+
# Includes
30+
source $HESTIA/func/main.sh
31+
source $HESTIA/func/domain.sh
32+
source $HESTIA/conf/hestia.conf
33+
34+
# Additional argument formatting
35+
format_domain
36+
37+
#----------------------------------------------------------#
38+
# Verifications #
39+
#----------------------------------------------------------#
40+
41+
check_args '2' "$#" 'USER DOMAIN TARGET_DOMAIN [DIRECTORY]'
42+
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
43+
# Check to ensure that target domain is valid if we're
44+
# not setting the docroot value back to defaults
45+
if [ "$target_domain" != "default" ]; then
46+
is_format_valid 'user' 'domain' 'target_domain'
47+
is_object_valid 'web' 'DOMAIN' "$target_domain"
48+
else
49+
is_format_valid 'user' 'domain'
50+
fi
51+
is_object_valid 'user' 'USER' "$user" "$user"
52+
is_object_unsuspended 'user' 'USER' "$user"
53+
is_object_valid 'web' 'DOMAIN' "$domain"
54+
is_object_unsuspended 'web' 'DOMAIN' "$domain"
55+
is_object_value_empty 'web' 'DOMAIN' "$domain" '$docroot'
56+
is_dir_symlink "$HOMEDIR/$user/web"
57+
is_dir_symlink "$HOMEDIR/$user/web/$target_domain"
58+
59+
# Perform verification if read-only mode is enabled
60+
check_hestia_demo_mode
61+
62+
#----------------------------------------------------------#
63+
# Action #
64+
#----------------------------------------------------------#
65+
66+
# Unset existing custom document root path
67+
if [ ! -z "$CUSTOM_DOCROOT" ]; then
68+
update_object_value 'web' 'DOMAIN' "$domain" '$CUSTOM_DOCROOT' ""
69+
fi
70+
71+
# If target domain value is 'default', remove the custom document root
72+
# value and rebuild web domain to restore default configuration.
73+
# Otherwise, set target document root path accordingly based on passed values.
74+
if [ "$target_domain" = "default" ]; then
75+
update_object_value 'web' 'DOMAIN' "$domain" '$CUSTOM_DOCROOT' ""
76+
else
77+
# Check for existence of specified directory under target domain's public_html folder
78+
if [ ! -z "$target_directory" ]; then
79+
if [ ! -e "$HOMEDIR/$user/web/$target_domain/public_html/$target_directory" ]; then
80+
echo "ERROR: Directory $target_directory does not exist under $HOMEDIR/$user/$target_domain/public_html/."
81+
exit 1
82+
else
83+
CUSTOM_DOCROOT="$HOMEDIR/$user/web/$target_domain/public_html/$target_directory/"
84+
fi
85+
else
86+
CUSTOM_DOCROOT="$HOMEDIR/$user/web/$target_domain/public_html/"
87+
fi
88+
add_object_key 'web' 'DOMAIN' "$domain" 'CUSTOM_DOCROOT' 'IP6'
89+
update_object_value 'web' 'DOMAIN' "$domain" '$CUSTOM_DOCROOT' "$CUSTOM_DOCROOT"
90+
fi
91+
92+
#----------------------------------------------------------#
93+
# Hestia #
94+
#----------------------------------------------------------#
95+
96+
# Rebuild domain configuration
97+
$BIN/v-rebuild-web-domain $user $domain
98+
99+
# Logging
100+
if [ "$target_domain" = "default" ]; then
101+
log_history "set web domain $domain to use default document root."
102+
else
103+
log_history "set web domain $domain to use document root from $target_domain."
104+
fi
105+
106+
log_event "$OK" "$ARGUMENTS"
107+
108+
# Unset variables
109+
unset target_domain
110+
unset target_directory
111+
112+
exit

0 commit comments

Comments
 (0)