Skip to content

Commit 1ad306c

Browse files
authored
Merge branch 'main' into staging/nginx-conf
2 parents 3282dee + a9fa2e3 commit 1ad306c

File tree

191 files changed

+683
-7158
lines changed

Some content is hidden

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

191 files changed

+683
-7158
lines changed

.drone.yml

Lines changed: 147 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,101 @@
1+
---
2+
kind: pipeline
3+
type: ssh
4+
name: Ubuntu | Nginx + Apache2
5+
6+
concurrency:
7+
limit: 1
8+
9+
server:
10+
host:
11+
from_secret: server_address
12+
user:
13+
from_secret: username
14+
ssh_key:
15+
from_secret: ssh_key
16+
17+
platform:
18+
os: linux
19+
arch: amd64
20+
21+
steps:
22+
- name: Download submodules
23+
image: alpine/git
24+
commands:
25+
- git submodule update --init --recursive
26+
- name: Build Hestia package and install
27+
commands:
28+
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
29+
- name: Run system / user tests
30+
commands:
31+
- bats ./test/test.bats
32+
- name: Run restore tests
33+
commands:
34+
- bats ./test/restore.bats
35+
- name: Run config tests
36+
commands:
37+
- bats ./test/config-tests.bats
38+
39+
trigger:
40+
event: [ pull_request, push ]
41+
ref:
42+
- refs/heads/staging/*
43+
- refs/heads/beta
44+
- refs/heads/release
45+
- refs/heads/main
46+
- refs/pull/*/head
47+
48+
---
49+
kind: pipeline
50+
type: ssh
51+
name: Debian | Nginx
52+
53+
concurrency:
54+
limit: 1
55+
56+
server:
57+
host:
58+
from_secret: server_address2
59+
user:
60+
from_secret: username
61+
ssh_key:
62+
from_secret: ssh_key
63+
64+
platform:
65+
os: linux
66+
arch: amd64
67+
68+
steps:
69+
- name: Download submodules
70+
image: alpine/git
71+
commands:
72+
- git submodule update --init --recursive
73+
- name: Build Hestia package install
74+
commands:
75+
- ./src/hst_autocompile.sh --hestia --install '~localsrc'
76+
- name: Run system / user tests
77+
commands:
78+
- bats ./test/test.bats
79+
- name: Run restore tests
80+
commands:
81+
- bats ./test/restore.bats
82+
- name: Run Letsencrypt test against Staging
83+
commands:
84+
- cp /root/le-env.sh /tmp/hestia-le-env.sh
85+
- bats ./test/letsencrypt.bats
86+
- name: Run config tests
87+
commands:
88+
- bats ./test/config-tests.bats
89+
90+
trigger:
91+
event: [ pull_request, push ]
92+
ref:
93+
- refs/heads/staging/*
94+
- refs/heads/beta
95+
- refs/heads/release
96+
- refs/heads/main
97+
- refs/pull/*/head
98+
199
---
2100
kind: pipeline
3101
type: docker
@@ -8,7 +106,7 @@ concurrency:
8106

9107
steps:
10108
- name: Shellcheck
11-
image: koalaman/shellcheck-alpine
109+
image: koalaman/shellcheck-alpine:v0.8.0
12110
commands:
13111
- ./test/shellcheck.sh
14112
- name: PHP 8.1
@@ -18,14 +116,55 @@ steps:
18116

19117
trigger:
20118
event: [ pull_request, push ]
21-
ref:
22-
- refs/heads/staging/*
23-
- refs/heads/beta
24-
- refs/heads/release
25-
- refs/heads/main
26-
- refs/pull/*/head
27119

120+
---
121+
kind: pipeline
122+
type: docker
123+
name: Push to beta atp server
124+
125+
platform:
126+
os: linux
127+
arch: amd64
128+
129+
steps:
130+
- name: Build
131+
image: debian:bullseye
132+
commands:
133+
- ln -snf /etc/localtime && echo CET > /etc/timezone
134+
- ./src/hst_autocompile.sh --dontinstalldeps --hestia --debug --cross --noinstall --keepbuild --debug '~localsrc'
135+
- mkdir -p ./hestia/
136+
- mv /tmp/hestiacp-src/deb/*.deb ./hestia/
137+
- name: Upload
138+
image: appleboy/drone-scp
139+
settings:
140+
host:
141+
from_secret: apt_server
142+
user: root
143+
key:
144+
from_secret: ssh_key
145+
port: 22
146+
command_timeout: 2m
147+
target: /root/
148+
source:
149+
- ./hestia/*
150+
- name: Publish
151+
image: appleboy/drone-ssh
152+
settings:
153+
host:
154+
from_secret: apt_server
155+
user: root
156+
key:
157+
from_secret: ssh_key
158+
port: 22
159+
command_timeout: 2m
160+
script:
161+
- freight-add ./hestia/*.deb apt/bionic apt/focal apt/jammy apt/stretch apt/buster apt/bullseye
162+
- freight-cache
163+
- rm -fr ./hestia/
164+
165+
trigger:
166+
event: [ promote]
28167

29168
---
30169
kind: signature
31-
hmac: 4eec34ee92f63737d6a976140e6e54adf637ebbb4836b17a083c560a4440c54f
170+
hmac: f89a311b0f023c6ee92dbdb56bcd23ec663ef9242269a6b70c1c222bac4380ee

CHANGELOG.md

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

4+
## [1.6.7] - Service release
5+
6+
### Bugfixes
7+
8+
- Fixed an issue with upgrade script Roundcube that caused issues with upgrade of new installs
9+
- Fixed an bug with DNS templates #2827
10+
- Update v-update-sys-hestia-git
11+
12+
## [1.6.6] - Service release
13+
14+
### Bugfixes
15+
16+
- Update DNS templates with CNAME for ftp, www and webmail (#2808)
17+
- Fix name server A record validation error (#2807)
18+
- Fixed issue with renaming domains and config files not properly removed (#2803)
19+
- Add loading indicator after clicking save button (#2740)
20+
- Improve hostname detection in mail-wrapper (#2805 @clarkchentw)
21+
22+
### Security
23+
24+
- Fixed an vulnerability in v-add-web-domain-redirect (CVE-2022-2636)
25+
- Fixed an vulnerability in Ubuntu that can lead in privilege escalation for admin to root user (CVE-2022-2626)
26+
27+
### Dependencies
28+
29+
- Update Roundcube to 1.6.0
30+
- Update Dokuwiki to "2022-07-31" Igor (#2811)
31+
32+
## [1.6.5] - Service release
33+
34+
### Bugfixes
35+
36+
- Add missing translation strings (#2778 @myrevery)
37+
- Add check if folder exists in v-change-web-domain-docroot (#2778)
38+
39+
### Security
40+
41+
- Improve random bytes generator (#2774)
42+
- Don't allow /inc/2fa/secret.php called from the web browser directly (#2784 @mayappear)
43+
- Improve CSRF Origin Check Bypass (#2785 @mayappear)
44+
- Fix vulnerability in Docuwiki Quick Install App @redstarp2 (CVE-2022-2550)
45+
46+
### Dependencies
47+
48+
- Update Filegator to 7.8.2
49+
450
## [1.6.4] - Service release
551

652
### Bugfixes

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.6.4 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <br>
5+
**Latest stable release:** Version 1.6.7 | [View Changelog](https://github.com/hestiacp/hestiacp/blob/release/CHANGELOG.md) | [![Build Status](https://drone.hestiacp.com/api/badges/hestiacp/hestiacp/status.svg?ref=refs/heads/main)](https://drone.hestiacp.com/hestiacp/hestiacp) <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-dns-record

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ if [ "$rtype" != "CAA" ]; then
7373
fi
7474
fi
7575

76+
if [ "$record" = "@" ] && [ "$rtype" = "CNAME" ]; then
77+
check_result $E_INVALID "CNAME on root is not allowed"
78+
fi
79+
7680
# Additional argument formatting
7781
format_domain
7882
format_domain_idn

bin/v-add-firewall-chain

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ protocol=$(echo $protocol|tr '[:lower:]' '[:upper:]')
2020
# Defining absolute path to iptables
2121
iptables="/sbin/iptables"
2222

23-
# Get hestia port by reading nginx.conf
24-
hestiaport=$(grep 'listen' $HESTIA/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")
25-
if [ -z "$hestiaport" ]; then
26-
hestiaport=8083
27-
fi
28-
2923
# Includes
3024
# shellcheck source=/etc/hestiacp/hestia.conf
3125
source /etc/hestiacp/hestia.conf
@@ -36,6 +30,12 @@ source $HESTIA/func/firewall.sh
3630
# load config file
3731
source_conf "$HESTIA/conf/hestia.conf"
3832

33+
# Get hestia port by reading nginx.conf
34+
hestiaport=$(grep 'listen' $HESTIA/nginx/conf/nginx.conf | awk '{print $2}' | sed "s|;||")
35+
if [ -z "$hestiaport" ]; then
36+
hestiaport=8083
37+
fi
38+
3939
#----------------------------------------------------------#
4040
# Verifications #
4141
#----------------------------------------------------------#

bin/v-add-letsencrypt-host

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
# Variables & Functions #
1212
#----------------------------------------------------------#
1313

14-
# Argument definition
15-
domain=$(hostname -f);
16-
if [ -z $domain ]; then
17-
domain=$HOSTNAME;
18-
fi
19-
user="$($HESTIA/bin/v-search-domain-owner "$domain" web)"
20-
[[ -z "$user" ]] && user="admin"
21-
2214
# Includes
2315
# shellcheck source=/etc/hestiacp/hestia.conf
2416
source /etc/hestiacp/hestia.conf
@@ -32,6 +24,14 @@ source_conf "$HESTIA/conf/hestia.conf"
3224
# Perform verification if read-only mode is enabled
3325
check_hestia_demo_mode
3426

27+
# Argument definition
28+
domain=$(hostname -f);
29+
if [ -z $domain ]; then
30+
domain=$HOSTNAME;
31+
fi
32+
user="$($HESTIA/bin/v-search-domain-owner "$domain" web)"
33+
[[ -z "$user" ]] && user="admin"
34+
3535
#----------------------------------------------------------#
3636
# Verifications #
3737
#----------------------------------------------------------#

bin/v-add-sys-roundcube

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ if [ -z "$HESTIA" ]; then
4646
HESTIA="/usr/local/hestia"
4747
fi
4848

49-
if [ -z "$HOMEDIR" ] || [ -z "$HESTIA_INSTALL_DIR" ]; then
49+
if [ -z "$HOMEDIR" ] || [ -z "$HESTIA_COMMON_DIR" ]; then
5050
echo "ERROR: Environment variables not present, installation aborted."
5151
exit 2
5252
fi
@@ -97,21 +97,21 @@ if [ "$UPDATE" == "no" ]; then
9797
rm -f -r $RC_INSTALL_DIR/config/
9898
ln -s $RC_CONFIG_DIR/ ./config
9999
# Replace with Hestia config
100-
cp -f $HESTIA_INSTALL_DIR/roundcube/main.inc.php $RC_CONFIG_DIR/config.inc.php
101-
cp -f $HESTIA_INSTALL_DIR/roundcube/mimetypes.php $RC_CONFIG_DIR/mimetypes.php
100+
cp -f $HESTIA_COMMON_DIR/roundcube/main.inc.php $RC_CONFIG_DIR/config.inc.php
101+
cp -f $HESTIA_COMMON_DIR/roundcube/mimetypes.php $RC_CONFIG_DIR/mimetypes.php
102102
chmod 644 $RC_CONFIG_DIR/*.php
103103

104-
cp -f $HESTIA_INSTALL_DIR/roundcube/hestia.php $RC_INSTALL_DIR/plugins/password/drivers/
104+
cp -f $HESTIA_COMMON_DIR/roundcube/hestia.php $RC_INSTALL_DIR/plugins/password/drivers/
105105
mkdir -p $RC_CONFIG_DIR/plugins/password
106106
mkdir -p $RC_CONFIG_DIR/plugins/newmail_notifier
107107
mkdir -p $RC_CONFIG_DIR/plugins/zipdownload
108108

109109
# Allow changes to the respective config / Create symlinks to /etc/roundcube/
110-
cp -f $HESTIA_INSTALL_DIR/roundcube/config.inc.php $RC_CONFIG_DIR/plugins/password/config.inc.php
110+
cp -f $HESTIA_COMMON_DIR/roundcube/config.inc.php $RC_CONFIG_DIR/plugins/password/config.inc.php
111111
ln -s $RC_CONFIG_DIR/plugins/password/config.inc.php ./plugins/password/config.inc.php
112-
cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_newmail_notifier.inc.php $RC_CONFIG_DIR/plugins/newmail_notifier/config.inc.php
112+
cp -f $HESTIA_COMMON_DIR/roundcube/plugins/config_newmail_notifier.inc.php $RC_CONFIG_DIR/plugins/newmail_notifier/config.inc.php
113113
ln -s $RC_CONFIG_DIR/plugins/newmail_notifier/config.inc.php ./plugins/newmail_notifier/config.inc.php
114-
cp -f $HESTIA_INSTALL_DIR/roundcube/plugins/config_zipdownload.inc.php $RC_CONFIG_DIR/plugins/zipdownload/config.inc.php
114+
cp -f $HESTIA_COMMON_DIR/roundcube/plugins/config_zipdownload.inc.php $RC_CONFIG_DIR/plugins/zipdownload/config.inc.php
115115
ln -s $RC_CONFIG_DIR/plugins/zipdownload/config.inc.php ./plugins/zipdownload/config.inc.php
116116

117117
# Set up correct permissions roundcube

bin/v-add-user

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ source_conf "$HESTIA/conf/hestia.conf"
3131

3232
is_user_free() {
3333
# these names may cause issues with MariaDB/MySQL database names and should be reserved:
34+
# sudo has been added due to Privilege escalation as sudo group has always sudo permission
3435
check_sysuser=$(php -r '$reserved_names=array("aria", "aria_log", "mysql", "mysql_upgrade", "ib", "ib_buffer",
35-
"ddl", "ddl_recovery", "performance"); if(in_array(strtolower($argv[1]), $reserved_names, true)){echo implode(", ", $reserved_names);}' "$user" );
36+
"ddl", "ddl_recovery", "performance", "sudo"); if(in_array(strtolower($argv[1]), $reserved_names, true)){echo implode(", ", $reserved_names);}' "$user" );
3637
if [ -n "$check_sysuser" ]; then
3738
check_result "$E_INVALID" "The user name '$user' is reserved and cannot be used. List of reserved names: $check_sysuser"
3839
return

bin/v-add-web-domain-backend

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ check_hestia_demo_mode
4949
prepare_web_backend
5050
get_domain_values 'web'
5151

52+
if [[ -n "$BACKEND" && "$BACKEND" != "$template" ]];then
53+
check_result "$E_EXISTS" "Pool already exists"
54+
fi
55+
5256
# Allocating backend port
5357
backend_port=9000
5458
ports=$(grep -v '^;' $pool/* 2>/dev/null |grep listen |grep -o :[0-9].*)

bin/v-add-web-domain-redirect

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,18 @@ is_object_unsuspended 'user' 'USER' "$user"
4242
is_object_valid 'web' 'DOMAIN' "$domain"
4343
is_object_unsuspended 'web' 'DOMAIN' "$domain"
4444

45-
scheme=0
4645
if [[ "$3" =~ http://|https:// ]]; then
4746
scheme=1
48-
regex='(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
49-
if ! [[ "$3" =~ $regex ]]; then
50-
echo "Invalid redirect"
51-
exit 2;
47+
isValidUrl=$(php -r '$url=$argv[1]; $url=filter_var($url,FILTER_VALIDATE_URL); echo $url;' "$3")
48+
if [ -z "$isValidUrl" ]; then
49+
check_result $E_INVALID "Invalid redirect"
5250
fi
5351
else
54-
regex='[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]'
55-
if ! [[ "$3" =~ $regex ]]; then
56-
echo "Invalid redirect"
57-
exit 2;
52+
isValidUrl=$(php -r '$url=$argv[1]; $url=filter_var($url,FILTER_VALIDATE_URL); echo $url;' "http://$3")
53+
if [ -z "$isValidUrl" ]; then
54+
check_result $E_INVALID "Invalid redirect"
5855
fi
59-
fi
56+
fi
6057

6158
# Perform verification if read-only mode is enabled
6259
check_hestia_demo_mode

0 commit comments

Comments
 (0)