Skip to content

Commit b9c523a

Browse files
committed
Merge branch 'main' into release
2 parents a5c82f5 + bca0496 commit b9c523a

File tree

41 files changed

+406
-43
lines changed

Some content is hidden

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

41 files changed

+406
-43
lines changed

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [1.4.6] - Service release
5+
6+
### Features
7+
8+
- Add support for custom install hooks #1757
9+
- Add template for CraftCMS #1973 @anvme
10+
- Upgrade Filegator to 7.6.0
11+
12+
### Bugfixes
13+
14+
- Fix #1961 Renewal Apache2 only SSL certificate fails
15+
- Fixed #1956 to prevent reset of defined webmail client.
16+
- Explicitly disable cron reports #1978
17+
- Fixed an issue where in rare cases certificate failed to install @dpeca and @myvesta
18+
- Fixed an issue where composer failed to install when .composer folder is missing
19+
- Fix #1980 Lets Encrypt Auto Renewal Reverts Webmail Client back to Roundcube
20+
421
## [1.4.5] - Service release
522

623
### Bugfixes
724

825
- Revert #1943 and rework it to fix possible errors occuring on v-rebuild-cron-jobs.
926
- Fixed #1956 to prevent reset of defined webmail client.
27+
- Explicitly disable cron reports #1978
1028

1129
## [1.4.4] - Service release
1230

1331
### Features
1432

1533
- Add nginx user_agent separation to desktop/mobile (e.g. for fastcgi cache)
1634
- Run phpmyadmin folder under www-data user instead of "user" improving security. (@bet0x)
17-
- Added new template for mod php users to access phpmymyadmin
35+
- Added new template for mod php users to access phpmyadmin
1836

1937
### Bugfixes
2038

bin/v-add-letsencrypt-domain

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,12 @@ if [ ! -z "$mail" ]; then
127127
fi
128128
fi
129129

130-
log_file="/var/log/hestia/LE-${user}-${domain}-$(date +%Y%m%d-%H%M%S).log"
130+
log_file="/var/log/hestia/LE-${user}-${domain}.log"
131131
touch "$log_file"
132132
chmod 600 "$log_file"
133133

134134
echo -e "\n\n=============================
135+
Date Time: $(date +%Y-%m-%d) $(date +%H:%M:%S)
135136
WEB_SYSTEM: ${WEB_SYSTEM}
136137
PROXY_SYSTEM: ${PROXY_SYSTEM}
137138
user: ${user}
@@ -331,7 +332,7 @@ for auth in $authz; do
331332
check_result $? "Proxy restart failed" > /dev/null
332333
fi
333334
else
334-
get_object_value 'mail' 'DOMAIN' "$domain" "WEBMAIL"
335+
get_object_value 'mail' 'DOMAIN' "$root_domain" "WEBMAIL"
335336
if [ ! -z "$WEBMAIL" ]; then
336337
well_known="/var/lib/$WEBMAIL/.well-known"
337338
acme_challenge="$well_known/acme-challenge"
@@ -473,11 +474,11 @@ if [[ "$status" -ne 200 ]]; then
473474
fi
474475

475476
# Splitting up downloaded pem
476-
crt_end=$(grep -n END $ssl_dir/$domain.pem |head -n1 |cut -f1 -d:)
477+
crt_end=$(grep -n 'END CERTIFICATE' $ssl_dir/$domain.pem |head -n1 |cut -f1 -d:)
477478
head -n $crt_end $ssl_dir/$domain.pem > $ssl_dir/$domain.crt
478479

479480
pem_lines=$(wc -l $ssl_dir/$domain.pem |cut -f 1 -d ' ')
480-
ca_end=$(grep -n "BEGIN" $ssl_dir/$domain.pem |tail -n1 |cut -f 1 -d :)
481+
ca_end=$(grep -n 'BEGIN CERTIFICATE' $ssl_dir/$domain.pem |tail -n1 |cut -f 1 -d :)
481482
ca_end=$(( pem_lines - crt_end + 1 ))
482483
tail -n $ca_end $ssl_dir/$domain.pem > $ssl_dir/$domain.ca
483484

bin/v-add-mail-domain-ssl

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,32 @@ fi
7878
# Call routine to add SSL configuration to mail domain
7979
add_mail_ssl_config
8080

81-
# Add webmail configuration to mail domain
82-
WEBMAIL_TEMPLATE="default"
83-
if [ "$WEB_SYSTEM" = "nginx" ]; then
84-
WEBMAIL_TEMPLATE="web_system"
81+
if [ "$webmail" == "roundcube" ]; then
82+
WEBMAIL_TEMPLATE="default"
83+
if [ ! -z "$PROXY_SYSTEM" ]; then
84+
PROXY_TEMPLATE="default"
85+
fi
86+
# Add webmail configuration to mail domain
87+
WEBMAIL_TEMPLATE="default"
88+
if [ "$WEB_SYSTEM" = "nginx" ]; then
89+
WEBMAIL_TEMPLATE="web_system"
90+
fi
91+
elif [ "$webmail" == "rainloop" ]; then
92+
WEBMAIL_TEMPLATE="rainloop"
93+
if [ ! -z "$PROXY_SYSTEM" ]; then
94+
PROXY_TEMPLATE="default_rainloop"
95+
fi
96+
else
97+
WEBMAIL_TEMPLATE="disabled"
98+
if [ ! -z "$PROXY_SYSTEM" ]; then
99+
PROXY_TEMPLATE="default_disabled"
100+
fi
85101
fi
102+
86103
add_webmail_config "$WEB_SYSTEM" "${WEBMAIL_TEMPLATE}.stpl"
87104

88105
if [ ! -z "$PROXY_SYSTEM" ]; then
89-
add_webmail_config "$PROXY_SYSTEM" "default.stpl"
106+
add_webmail_config "$PROXY_SYSTEM" "${PROXY_TEMPLATE}.stpl"
90107
fi
91108

92109
# Increase value for domain

bin/v-add-sys-pma-sso

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ apikey=$($BIN/v-generate-api-key);
7575

7676
# copy config dir to /usr/share/phpmyadmin/
7777
cp -f $HESTIA_INSTALL_DIR/phpmyadmin/hestia-sso.php $PMA_INSTALL/hestia-sso.php
78-
chmod 644 $PMA_INSTALL/hestia-sso.php
78+
chmod 640 $PMA_INSTALL/hestia-sso.php
79+
chown root:www-data $PMA_INSTALL/hestia-sso.php
7980

8081
sed -i "s/%PHPMYADMIN_KEY%/$phpmyadminkey/g" $PMA_INSTALL/hestia-sso.php
8182
sed -i "s/%API_KEY%/$apikey/g" $PMA_INSTALL/hestia-sso.php
8283
sed -i "s/%API_HOST_NAME%/$(hostname)/g" $PMA_INSTALL/hestia-sso.php
8384
sed -i "s/%API_HESTIA_PORT%/$BACKEND_PORT/g" $PMA_INSTALL/hestia-sso.php
8485

85-
8686
# Check if config already contains the keys
8787
touch $PMA_CONFIG/hestia-sso.inc.php
8888
chmod 640 $PMA_CONFIG/hestia-sso.inc.php

bin/v-change-sys-port

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ else
7777
sed -i "/COMMENT='HESTIA'/c\RULE='2' ACTION='ACCEPT' PROTOCOL='TCP' PORT='$PORT' IP='0.0.0.0/0' COMMENT='HESTIA' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'" $HESTIA/data/firewall/rules.conf
7878

7979
# Restart services
80-
$HESTIA/bin/v-restart-service iptables
80+
if [ -n "$FIREWALL_SYSTEM" ] && [ "$FIREWALL_SYSTEM" != no ]; then
81+
$HESTIA/bin/v-restart-service iptables
82+
fi
8183

8284
# Check if Hestia is running
8385
if [[ $(ps -eaf | grep -i hestia |sed '/^$/d' | wc -l) > 1 ]]; then

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ if [ ! -z "$CUSTOM_DOCROOT" ]; then
8888
fi
8989

9090
# Checking backend pool configuration
91-
if [ "$backend_type" = "$user" ]; then
91+
if [[ "$backend_type" = "$user" && $WEB_BACKEND_POOL = 'user' ]]; then
9292
conf=$USER_DATA/web.conf
9393
fields='$DOMAIN'
9494
nohead=1

bin/v-restart-service

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,26 @@ is_format_valid 'service' 'restart'
3333
# Action #
3434
#----------------------------------------------------------#
3535

36-
# Get installed php versions
37-
php_versions=$(ls /usr/sbin/php*fpm* | cut -d'/' -f4 | sed 's|php-fpm||')
38-
39-
# Substitute php-fpm service name formats
40-
for version in $php_versions; do
41-
if [ "$service" = "php-fpm${version}" ]; then
42-
service="php${version}-fpm"
43-
fi
44-
done
45-
46-
# Multi-instance service restart request handling
47-
if [ "$service" = "php-fpm" ];then
36+
if [ -d /usr/sbin/php*/fpm/ ]; then
37+
# Get installed php versions
38+
php_versions=$(ls /usr/sbin/php*fpm* | cut -d'/' -f4 | sed 's|php-fpm||')
39+
40+
# Substitute php-fpm service name formats
4841
for version in $php_versions; do
49-
service_list="${service_list} php${version}-fpm"
42+
if [ "$service" = "php-fpm${version}" ]; then
43+
service="php${version}-fpm"
44+
fi
5045
done
51-
else
52-
service_list="$service"
53-
fi
54-
46+
47+
# Multi-instance service restart request handling
48+
if [ "$service" = "php-fpm" ];then
49+
for version in $php_versions; do
50+
service_list="${service_list} php${version}-fpm"
51+
done
52+
else
53+
service_list="$service"
54+
fi
55+
fi
5556
for service in $service_list; do
5657

5758
if [ "$service" = "iptables" ]; then

bin/v-update-sys-rrd-mysql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ case $period in
3737
*) exit $E_RRD ;;
3838
esac
3939

40+
notify="no"
41+
4042
# Checking directory
4143
if [ ! -d "$RRD/db" ]; then
4244
mkdir $RRD/db

func/main.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,8 @@ sync_cron_jobs() {
622622
if [ "$CRON_REPORTS" = 'yes' ]; then
623623
echo "MAILTO=$CONTACT" > $crontab
624624
echo 'CONTENT_TYPE="text/plain; charset=utf-8"' >> $crontab
625+
else
626+
echo 'MAILTO=""' > $crontab
625627
fi
626628

627629
while read line; do
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#=======================================================================#
2+
# Default Web Domain Template #
3+
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
4+
#=======================================================================#
5+
6+
server {
7+
listen %ip%:%web_ssl_port% ssl http2;
8+
server_name %domain_idn% %alias_idn%;
9+
root %sdocroot%/web;
10+
index index.php index.html index.htm;
11+
access_log /var/log/nginx/domains/%domain%.log combined;
12+
access_log /var/log/nginx/domains/%domain%.bytes bytes;
13+
error_log /var/log/nginx/domains/%domain%.error.log error;
14+
15+
ssl_certificate %ssl_pem%;
16+
ssl_certificate_key %ssl_key%;
17+
ssl_stapling on;
18+
ssl_stapling_verify on;
19+
20+
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
21+
22+
location = /favicon.ico {
23+
log_not_found off;
24+
access_log off;
25+
}
26+
27+
location = /robots.txt {
28+
allow all;
29+
log_not_found off;
30+
access_log off;
31+
}
32+
33+
location ~ /\.(?!well-known\/) {
34+
deny all;
35+
return 404;
36+
}
37+
38+
# Craft-specific location handlers to ensure AdminCP requests route through index.php
39+
# If you change your `cpTrigger`, change it here as well
40+
location ^~ /admin {
41+
try_files $uri $uri/ @phpfpm_nocache;
42+
}
43+
location ^~ /index.php/admin {
44+
try_files $uri $uri/ @phpfpm_nocache;
45+
}
46+
location ^~ /cpresources {
47+
try_files $uri $uri/ /index.php?$query_string;
48+
}
49+
location ^~ /actions {
50+
try_files $uri $uri/ /index.php?$query_string;
51+
}
52+
53+
location / {
54+
try_files $uri $uri/ /index.php?$args;
55+
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
56+
expires 30d;
57+
fastcgi_hide_header "Set-Cookie";
58+
}
59+
60+
location ~ [^/]\.php(/|$) {
61+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
62+
try_files $uri =404;
63+
fastcgi_pass %backend_lsnr%;
64+
fastcgi_index index.php;
65+
include /etc/nginx/fastcgi_params;
66+
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
67+
}
68+
}
69+
70+
location /error/ {
71+
alias %home%/%user%/web/%domain%/document_errors/;
72+
}
73+
74+
location /vstats/ {
75+
alias %home%/%user%/web/%domain%/stats/;
76+
include %home%/%user%/web/%domain%/stats/auth.conf*;
77+
}
78+
79+
include /etc/nginx/conf.d/phpmyadmin.inc*;
80+
include /etc/nginx/conf.d/phppgadmin.inc*;
81+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
82+
}

0 commit comments

Comments
 (0)