Skip to content

Commit 3c473d1

Browse files
authored
Merge pull request hestiacp#1916 from jaapmarcus/fix/1913-ssl-rainloop
Multiple issues with Rainloop and FastCGI Cache
2 parents 3bc3000 + 5576990 commit 3c473d1

File tree

6 files changed

+37
-13
lines changed

6 files changed

+37
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file.
66
### Features
77

88
- Include DMARC record in DNS record list #1836
9-
- Enabled phpMyAdmin Single Sign On support
9+
- Enabled phpMyAdmin Single Sign On support #1460
1010
- Add command to add / delete from API_ALLOWED_IP list (#1904)
1111

1212
### Bugfixes
@@ -22,9 +22,11 @@ All notable changes to this project will be documented in this file.
2222
- Keep changes made by /install/upgrade/manual/install_awstats_geopip.sh on update HestiaCP (via Discord)
2323
- Refactor/improve PHP and HTML code @s0t (#1860)
2424
- Fixed XSS vulnerability in login page and a few other locations @briansemrau / @numanturle
25-
- Delete old session after after session_regenerate_id() @briansemrau
25+
- Delete old session after session_regenerate_id() @briansemrau
2626
- Improve error message when domain all ready exists on different account.
2727
- Fixed an issue where phpmyadmin did not update when Postgresql was available.
28+
- Webmail clients set to rainloop where not able to create a SSL certificate via LE #1913
29+
- Fixed an issue where plugin-hestia-change-pasword did not change the port on v-change-sys-port (Rainloop) #1895
2830
- Fixed an issue where HELO message was not set / error was created on NAT IP
2931

3032
## [1.4.2] - Service release

bin/v-add-fastcgi-cache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ source $HESTIA/conf/hestia.conf
3131
# Verifications #
3232
#----------------------------------------------------------#
3333

34-
check_args '2' "$#" 'USER DOMAIN DEBUG'
34+
check_args '2' "$#" 'USER DOMAIN [DURATION] [DEBUG] [RESTART]'
3535
is_format_valid 'user' 'domain'
3636
is_object_valid 'user' 'USER' "$user"
3737
is_object_unsuspended 'user' 'USER' "$user"
@@ -85,7 +85,7 @@ cat << EOF > $fastcgi
8585
set $no_cache 0;
8686
EOF
8787

88-
if [ ! -z "$debug" ]; then
88+
if [ "$debug" = 'yes' ]; then
8989
echo " add_header \"X-STATUS\" \"$status\";" >> $fastcgi
9090
fi
9191

bin/v-add-letsencrypt-domain

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,31 @@ for auth in $authz; do
315315
chown -R $user:$user $well_known
316316
fi
317317
else
318-
well_known="/var/lib/roundcube/.well-known"
319-
acme_challenge="$well_known/acme-challenge"
320-
mkdir -p $acme_challenge
321-
echo "$token.$THUMB" > $acme_challenge/$token
322-
chown -R $user:$user $well_known
318+
if [ "$WEB_SYSTEM" = 'nginx' ] || [ "$PROXY_SYSTEM" = 'nginx' ]; then
319+
conf="$HOMEDIR/$user/conf/mail/$root_domain/nginx.conf_letsencrypt"
320+
sconf="$HOMEDIR/$user/conf/mail/$root_domain/nginx.ssl.conf_letsencrypt"
321+
echo 'location ~ "^/\.well-known/acme-challenge/([-_A-Za-z0-9]+)$" {' \
322+
> $conf
323+
echo ' default_type text/plain;' >> $conf
324+
echo ' return 200 "$1.'$THUMB'";' >> $conf
325+
echo '}' >> $conf
326+
if [ ! -e "$sconf" ]; then
327+
ln -s "$conf" "$sconf"
328+
fi
329+
if [ ! -z "$PROXY_SYSTEM" ]; then
330+
$BIN/v-restart-proxy
331+
check_result $? "Proxy restart failed" > /dev/null
332+
fi
333+
else
334+
get_object_value 'mail' 'DOMAIN' "$domain" "WEBMAIL"
335+
if [ ! -z "$WEBMAIL" ]; then
336+
well_known="/var/lib/$WEBMAIL/.well-known"
337+
acme_challenge="$well_known/acme-challenge"
338+
mkdir -p $acme_challenge
339+
echo "$token.$THUMB" > $acme_challenge/$token
340+
chown -R $user:$user $well_known
341+
fi
342+
fi
323343
fi
324344
if [ "$WEB_SYSTEM" = 'nginx' ]; then
325345
$BIN/v-restart-web

bin/v-change-sys-port

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ else
7171
if [ -d /etc/roundcube/ ]; then
7272
sed -i "/password_hestia_port/c\$rcmail_config['password_hestia_port'] = '$PORT';" /etc/roundcube/plugins/password/config.inc.php
7373
fi
74+
if [ -d /etc/rainloop/ ]; then
75+
sed -i "/hestia_port/c\hestia_port = $PORT" /etc/rainloop/data/_data_/_default_/configs/plugin-hestia-change-password.ini
76+
fi
7477
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
7578

7679
# Restart services

install/deb/templates/mail/apache2/rainloop.stpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ SSLVerifyClient none
1010
SSLCertificateFile %home%/%user%/conf/mail/%root_domain%/ssl/%root_domain%.crt
1111
SSLCertificateKeyFile %home%/%user%/conf/mail/%root_domain%/ssl/%root_domain%.key
1212

13-
<Directory /var/lib/roundcube/>
13+
<Directory /var/lib/rainloop/>
1414
Options +FollowSymLinks
15-
# This is needed to parse /var/lib/roundcube/.htaccess. See its
15+
# This is needed to parse /var/lib/rainloop/.htaccess. See its
1616
# content before setting AllowOverride to None.
1717
AllowOverride All
1818
order allow,deny

web/add/mail/index.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,9 @@
276276

277277
// Flush field values on success
278278
if (empty($_SESSION['error_msg'])) {
279-
$_SESSION['ok_msg'] = sprintf(_('MAIL_ACCOUNT_CREATED_OK'),htmlentities(strtolower($_POST['v_account'])),htmlentities($_POST[v_domain]),htmlentities(strtolower($_POST['v_account'])),htmlentities($_POST[v_domain]));
279+
$_SESSION['ok_msg'] = sprintf(_('MAIL_ACCOUNT_CREATED_OK'),htmlentities(strtolower($_POST['v_account'])),htmlentities($_POST['v_domain']),htmlentities(strtolower($_POST['v_account'])),htmlentities($_POST['v_domain']));
280280
unset($v_account);
281281
unset($v_password);
282-
unset($v_password);
283282
unset($v_aliases);
284283
unset($v_fwd);
285284
unset($v_quota);

0 commit comments

Comments
 (0)