Skip to content

Commit 49aed0a

Browse files
authored
Merge pull request hestiacp#1473 from hestiacp/staging/release/v1.3.2
Release Hestia v1.3.2
2 parents 65908fb + 2a0c045 commit 49aed0a

37 files changed

+765
-32
lines changed

CHANGELOG.md

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

4+
## [1.3.2] - Service Release
5+
### Features
6+
- Added PHP v8.0 support for multiphp environment.
7+
8+
### Bugfixes
9+
- Improved session token handling in login as function, thanks to Vulnerability Laboratory - [Evolution Security GmbH]™.
10+
- Fixed an where fpm pool config was not deleted when changing backend template.
11+
- Improved bats testing with multiphp (5.6-8.0) tests.
12+
- Fixed an issue where full webmail path was loaded as default value.
13+
14+
415
## [1.3.1] - Service Release
516
### Features
617
- No new features have been introduced in this release.

README.md

Lines changed: 14 additions & 5 deletions
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.3.0 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md)<br>
5+
**Latest stable release:** Version 1.3.1 | [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>
@@ -19,17 +19,18 @@ Hestia Control Panel is designed to provide administrators an easy to use web an
1919
Features and Services
2020
----------------------------
2121
* Apache2 and NGINX with PHP-FPM
22-
* Multiple PHP versions (5.6 - 7.4, 7.3 as default for optimal compatibility)
22+
* Multiple PHP versions (5.6 - 7.4, 7.4 as default)
2323
* DNS Server (Bind) with clustering capabilities
2424
* POP/IMAP/SMTP mail services with Anti-Virus, Anti-Spam, and Webmail (ClamAV, SpamAssassin, and Roundcube)
2525
* MariaDB or PostgreSQL databases
2626
* Let's Encrypt SSL support with wildcard certificates
2727
* Firewall with brute-force attack detection and IP lists (iptables, fail2ban, and ipset).
2828

29-
Supported operating systems
29+
Supported platforms and operating systems
3030
----------------------------
31-
* Debian 10, 9
32-
* Ubuntu 20.04 LTS, 18.04 LTS, or 16.04 LTS
31+
* **CPU Architecture:** AMD64 (x86_64 Intel/AMD)
32+
* **Debian:** 10, 9
33+
* **Ubuntu:** 20.04 LTS, 18.04 LTS, or 16.04 LTS
3334
* **NOTE:** Hestia Control Panel must be installed on top of a fresh operating system installation to ensure proper functionality.
3435

3536
Installing Hestia Control Panel
@@ -65,6 +66,14 @@ bash hst-install.sh -h
6566
```
6667
Alternatively, @gabizz has made available a command-line script generator at https://gabizz.github.io/hestiacp-scriptline-generator/ which allows you to easily generate the installation command via GUI.
6768

69+
How to upgrade an existing installation
70+
============================
71+
Automatic Updates are enabled by default on new installations of Hestia Control Panel and can be managed from **Server Settings > Updates**. To manually check for and install available updates, use the apt package manager:
72+
```bash
73+
apt-get update
74+
apt-get upgrade
75+
```
76+
6877
Issues
6978
=============================
7079
If you've run into a problem, [file a new issue report via GitHub](https://github.com/hestiacp/hestiacp/issues) so that we may investigate further.

bin/v-add-letsencrypt-domain

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ query_le_v2() {
5555
# Save http response to file passed as "$4" arg or print to stdout if not provided
5656
# http response headers are always sent to stdout
5757
local save_to_file=${4:-"/dev/stdout"}
58-
curl --silent --dump-header /dev/stdout --data "$post_data" "$1" --header "$content" --output "$save_to_file"
58+
curl --location --insecure --retry 5 --retry-connrefused --silent --dump-header /dev/stdout --data "$post_data" "$1" --header "$content" --output "$save_to_file"
59+
debug_log "API call" "exit status: $?"
5960
}
6061

6162

@@ -100,17 +101,36 @@ fi
100101

101102

102103

104+
# Dump debug info
105+
debug_log() {
106+
echo -e "\n==[${1}]==\n${2}\n" >> "$log_file"
107+
}
108+
103109
#----------------------------------------------------------#
104110
# Action #
105111
#----------------------------------------------------------#
106112

113+
114+
115+
107116
# Generate correct variables for mail domain SSL certificates
108117
if [ ! -z "$mail" ]; then
109118
root_domain=$domain
110119
domain="mail.$root_domain"
111120
aliases="$WEBMAIL_ALIAS.$root_domain"
112121
fi
113122

123+
log_file="/var/log/hestia/LE-${user}-${domain}-$(date +%Y%m%d-%H%M%S).log"
124+
touch "$log_file"
125+
chmod 600 "$log_file"
126+
127+
echo -e "\n\n=============================
128+
WEB_SYSTEM: ${WEB_SYSTEM}
129+
PROXY_SYSTEM: ${PROXY_SYSTEM}
130+
user: ${user}
131+
domain: ${domain}
132+
" >> "$log_file"
133+
114134
# Registering LetsEncrypt user account
115135
$BIN/v-add-letsencrypt-user $user
116136
if [ "$?" -ne 0 ]; then
@@ -134,6 +154,12 @@ else
134154
proto="http-01"
135155
fi
136156

157+
echo -e "
158+
- aliases: ${aliases}
159+
- proto: ${proto}
160+
- wildcard: ${wildcard}
161+
" >> "$log_file"
162+
137163
# Check if dns records exist for requested domain/aliases
138164
if [ "$proto" = "http-01" ]; then
139165
for identifier in $(echo $domain,$aliases |tr ',' '\n' |sort -u); do
@@ -164,6 +190,9 @@ fi
164190
answer=$(curl -s -I "$LE_API/directory")
165191
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
166192
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
193+
194+
debug_log "Step 1" "- status: ${status}\n- nonce: ${nonce}\n- answer: ${answer}"
195+
167196
if [[ "$status" -ne 200 ]]; then
168197
# Delete DNS CAA record
169198
if [ ! -z "$DNS_SYSTEM" ]; then
@@ -192,6 +221,9 @@ nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
192221
authz=$(echo "$answer" |grep "acme/authz" |cut -f2 -d '"')
193222
finalize=$(echo "$answer" |grep 'finalize":' |cut -f4 -d '"')
194223
status=$(echo "$answer" |grep HTTP/ |tail -n1 |cut -f2 -d ' ')
224+
225+
debug_log "Step 2" "- status: ${status}\n- nonce: ${nonce}\n- authz: ${authz}\n- finalize: ${finalize}\n- payload: ${payload}\n- answer: ${answer}"
226+
195227
if [[ "$status" -ne 201 ]]; then
196228
# Delete DNS CAA record
197229
if [ ! -z "$DNS_SYSTEM" ]; then
@@ -212,6 +244,9 @@ for auth in $authz; do
212244
token=$(echo "$answer" |grep -A3 $proto |grep token |cut -f 4 -d \")
213245
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
214246
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
247+
248+
debug_log "Step 3" "- status: ${status}\n- nonce: ${nonce}\n- url: ${url}\n- token: ${token}\n- answer: ${answer}"
249+
215250
if [[ "$status" -ne 200 ]]; then
216251
# Delete DNS CAA record
217252
if [ ! -z "$DNS_SYSTEM" ]; then
@@ -303,6 +338,9 @@ for auth in $authz; do
303338
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
304339
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
305340
details=$(echo "$answer"| grep detail | cut -f 1 -d ',' | cut -f 2-4 -d ':' | cut -f 2 -d '"')
341+
342+
debug_log "Step 5" "- status: ${status}\n- nonce: ${nonce}\n- validation: ${validation}\n- details: ${details}\n- answer: ${answer}"
343+
306344
if [[ "$status" -ne 200 ]]; then
307345
# Delete DNS CAA record
308346
if [ ! -z "$DNS_SYSTEM" ]; then
@@ -315,6 +353,7 @@ for auth in $authz; do
315353
fi
316354
fi
317355
fi
356+
debug_log "Abort Step 5" "=> Wrong status"
318357
check_result $E_CONNECT "Let's Encrypt validation status $status. Details: $details"
319358
fi
320359

@@ -331,6 +370,7 @@ for auth in $authz; do
331370
fi
332371
fi
333372
fi
373+
debug_log "Abort Step 5" "=> Too many validation retries"
334374
check_result $E_CONNECT "Let's Encrypt domain validation timeout"
335375
fi
336376
sleep $((i*2))
@@ -362,14 +402,44 @@ answer=$(query_le_v2 "$finalize" "$payload" "$nonce")
362402
nonce=$(echo "$answer" |grep -i nonce |cut -f2 -d \ |tr -d '\r\n')
363403
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
364404
certificate=$(echo "$answer"|grep 'certificate":' |cut -f4 -d '"')
405+
406+
debug_log "Step 6" "- status: ${status}\n- nonce: ${nonce}\n- payload: ${payload}\n- certificate: ${certificate}\n- answer: ${answer}"
407+
365408
if [[ "$status" -ne 200 ]]; then
366409
[ -d "$ssl_dir" ] && rm -rf "$ssl_dir"
367410
check_result $E_CONNECT "Let's Encrypt finalize bad status $status"
368411
fi
369412

370413
# Downloading signed certificate / STEP 7
371-
answer=$(query_le_v2 "$certificate" "" "$nonce" "$ssl_dir/$domain.pem")
372-
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
414+
status=0
415+
retry=0
416+
417+
while [[ $status != 200 && $retry -lt 3 ]]; do
418+
419+
answer=$(query_le_v2 "$certificate" "" "$nonce" "$ssl_dir/$domain.pem")
420+
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
421+
422+
debug_log "Step 7" "- status: ${status}\n- retry: ${retry}\n- answer: ${answer}"
423+
424+
if [[ $status != 200 ]]; then
425+
retry=$((retry + 1))
426+
sleep $((retry * 2)) # Sleep for 2s, 4s, 6s, 8s
427+
fi
428+
429+
done
430+
431+
# Fallback on depreciated download method for certs (unauthenticated GET)
432+
if [[ $status != 200 ]]; then
433+
answer=$(curl --insecure --retry 5 --retry-connrefused --silent --dump-header /dev/stdout "$certificate" --output "$ssl_dir/$domain.pem")
434+
status=$(echo "$answer"|grep HTTP/ |tail -n1 |cut -f 2 -d ' ')
435+
436+
debug_log "Step 7 - Fallback" "- status: ${status}\n- answer: ${answer}"
437+
fi
438+
439+
debug_log "CERT DIR" "$(ls -las "$ssl_dir/")"
440+
debug_log "CERT PEM" "$(cat "$ssl_dir/$domain.pem")"
441+
442+
373443
if [[ "$status" -ne 200 ]]; then
374444
[ -d "$ssl_dir" ] && rm -rf "$ssl_dir"
375445
check_result $E_NOTEXIST "Let's Encrypt downloading signed cert failed status:$status"
@@ -384,10 +454,13 @@ ca_end=$(grep -n "BEGIN" $ssl_dir/$domain.pem |tail -n1 |cut -f 1 -d :)
384454
ca_end=$(( pem_lines - crt_end + 1 ))
385455
tail -n $ca_end $ssl_dir/$domain.pem > $ssl_dir/$domain.ca
386456

457+
debug_log "CERT CRT" "$(cat "$ssl_dir/$domain.crt")"
458+
debug_log "CERT CA-1" "$(cat "$ssl_dir/$domain.ca")"
387459
# Temporary fix for double "END CERTIFICATE"
388460
if [[ $(head -n 1 $ssl_dir/$domain.ca) = "-----END CERTIFICATE-----" ]]; then
389461
sed -i '1,2d' $ssl_dir/$domain.ca
390462
fi
463+
debug_log "CERT CA-2" "$(cat "$ssl_dir/$domain.ca")"
391464

392465
# Rename certs for mail
393466
if [ ! -z "$mail" ]; then
@@ -467,4 +540,7 @@ send_notice 'LETSENCRYPT' "$domain SSL has been installed successfully"
467540
# Logging
468541
log_event "$OK" "$ARGUMENTS"
469542

543+
# Cleanup debug since the SSL was issues succesfully
544+
rm -f "$log_file"
545+
470546
exit

bin/v-add-web-php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# options: VERSION
44
# labels: hestia
55
#
6-
# example: v-add-web-php 7.4
6+
# example: v-add-web-php 8.0
77
#
88
# The function checks and delete a fpm php version if not used by any domain.
99

@@ -32,7 +32,7 @@ php_fpm="/etc/init.d/php$version-fpm"
3232
# Verify php version format
3333
if [[ ! $version =~ ^[0-9]\.[0-9]+ ]]; then
3434
echo "The specified PHP version format is invalid, it should look like [0-9].[0-9]."
35-
echo "Example: 7.0, 7.4"
35+
echo "Example: 7.0, 7.4, 8.0"
3636
exit
3737
fi
3838

@@ -67,6 +67,11 @@ if [[ `echo "$version 7.2" | awk '{print ($1 < $2)}'` == 1 ]]; then
6767
mph="$mph php$version-mcrypt"
6868
fi
6969

70+
# Check if version is 8.0 or higher and drop php json.
71+
if [[ ${version:0:1} == "8" ]]; then
72+
mph=$(echo "$mph" | sed -e "s/php$version-json//")
73+
fi
74+
7075
if ! echo "$DB_SYSTEM" | grep -w 'mysql' >/dev/null; then
7176
mph=$(echo "$mph" | sed -e "s/php$version-mysql//")
7277
fi

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ check_hestia_demo_mode
5252
# Action #
5353
#----------------------------------------------------------#
5454

55-
# Deleting current backend
56-
delete_web_backend
57-
5855
# Prepare new backend configuration
5956
prepare_web_backend
6057

58+
# Deleting current backend
59+
delete_web_backend
60+
6161
# Allocating backend port
6262
backend_port=9000
6363
ports=$(grep -v '^;' $pool/* 2>/dev/null |grep listen |grep -o :[0-9].*)

install/deb/multiphp/apache2/PHP-56.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
4545
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
48+
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
4849

4950
if [ ! -f "$pool_file_56" ]; then
5051
echo "$pool_conf" > $pool_file_56
@@ -76,4 +77,9 @@ if [ -f "$pool_file_74" ]; then
7677
service php7.4-fpm restart
7778
fi
7879

80+
if [ -f "$pool_file_80" ]; then
81+
rm $pool_file_80
82+
service php8.0-fpm restart
83+
fi
84+
7985
exit 0

install/deb/multiphp/apache2/PHP-70.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
4545
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
48+
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
4849

4950
if [ -f "$pool_file_56" ]; then
5051
rm $pool_file_56
@@ -76,4 +77,9 @@ if [ -f "$pool_file_74" ]; then
7677
service php7.4-fpm restart
7778
fi
7879

80+
if [ -f "$pool_file_80" ]; then
81+
rm $pool_file_80
82+
service php8.0-fpm restart
83+
fi
84+
7985
exit 0

install/deb/multiphp/apache2/PHP-71.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
4545
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
48+
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
4849

4950
if [ -f "$pool_file_56" ]; then
5051
rm $pool_file_56
@@ -76,4 +77,9 @@ if [ -f "$pool_file_74" ]; then
7677
service php7.4-fpm restart
7778
fi
7879

80+
if [ -f "$pool_file_80" ]; then
81+
rm $pool_file_80
82+
service php8.0-fpm restart
83+
fi
84+
7985
exit 0

install/deb/multiphp/apache2/PHP-72.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
4545
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
48+
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
4849

4950
if [ -f "$pool_file_56" ]; then
5051
rm $pool_file_56
@@ -76,4 +77,9 @@ if [ -f "$pool_file_74" ]; then
7677
service php7.4-fpm restart
7778
fi
7879

80+
if [ -f "$pool_file_80" ]; then
81+
rm $pool_file_80
82+
service php8.0-fpm restart
83+
fi
84+
7985
exit 0

install/deb/multiphp/apache2/PHP-73.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
4545
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
48+
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
4849

4950
if [ -f "$pool_file_56" ]; then
5051
rm $pool_file_56
@@ -76,4 +77,9 @@ if [ -f "$pool_file_74" ]; then
7677
service php7.4-fpm restart
7778
fi
7879

80+
if [ -f "$pool_file_80" ]; then
81+
rm $pool_file_80
82+
service php8.0-fpm restart
83+
fi
84+
7985
exit 0

0 commit comments

Comments
 (0)