Skip to content

Commit a28d7f1

Browse files
author
thom
committed
Fix #5719
1 parent 6c096ff commit a28d7f1

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

install/tpl/apache_apps.vhost.master

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@
5858
<tmpl_var name="ssl_comment">SSLStaplingReturnResponderErrors Off
5959
</tmpl_if>
6060

61-
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
62-
<IfModule mod_ssl.c>
63-
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
64-
</IfModule>
65-
</tmpl_if>
66-
6761
<IfModule mod_headers.c>
6862
RequestHeader unset Proxy early
6963
</IfModule>
@@ -127,6 +121,10 @@
127121
RewriteRule ^/rspamd/(.*) http://127.0.0.1:11334/$1 [P]
128122
{/tmpl_if}
129123

130-
131-
132124
</VirtualHost>
125+
126+
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
127+
<IfModule mod_ssl.c>
128+
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
129+
</IfModule>
130+
</tmpl_if>

server/conf/apache_apps.vhost.master

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@
5858
<tmpl_var name="ssl_comment">SSLStaplingReturnResponderErrors Off
5959
</tmpl_if>
6060

61-
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
62-
<IfModule mod_ssl.c>
63-
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
64-
</IfModule>
65-
</tmpl_if>
66-
6761
<IfModule mod_headers.c>
6862
RequestHeader unset Proxy early
6963
</IfModule>
@@ -127,6 +121,10 @@
127121
RewriteRule ^/rspamd/(.*) http://127.0.0.1:11334/$1 [P]
128122
{/tmpl_if}
129123

130-
131-
132124
</VirtualHost>
125+
126+
<tmpl_if name='apache_version' op='>=' value='2.3.3' format='version'>
127+
<IfModule mod_ssl.c>
128+
<tmpl_var name="ssl_comment">SSLStaplingCache shmcb:/var/run/ocsp(128000)
129+
</IfModule>
130+
</tmpl_if>

server/plugins-available/apps_vhost_plugin.inc.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function update($event_name, $data) {
106106
$vhost_port_listen = '#';
107107
}
108108
$tpl->setVar('vhost_port_listen', $vhost_port_listen);
109-
109+
110110
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
111111
if($mail_config['content_filter'] == 'rspamd'){
112112
$use_rspamd = true;
@@ -127,6 +127,17 @@ function update($event_name, $data) {
127127
$content = str_replace('{apps_vhost_basedir}', $web_config['website_basedir'], $content);
128128
$content = str_replace('{vhost_port_listen}', $vhost_port_listen, $content);
129129
/* end of backwards compatibility section */
130+
/* Check if SSL should be enabled: */
131+
if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key')) {
132+
$tpl->setVar('ssl_comment','');
133+
} else {
134+
$tpl->setVar('ssl_comment','#');
135+
}
136+
if(is_file($install_dir.'/interface/ssl/ispserver.crt') && is_file($install_dir.'/interface/ssl/ispserver.key') && is_file($install_dir.'/interface/ssl/ispserver.bundle')) {
137+
$tpl->setVar('ssl_bundle_comment','');
138+
} else {
139+
$tpl->setVar('ssl_bundle_comment','#');
140+
}
130141

131142
$app->system->file_put_contents("$vhost_conf_dir/apps.vhost", $content);
132143

@@ -194,7 +205,7 @@ function update($event_name, $data) {
194205
}
195206
$content = str_replace('{use_tcp}', $use_tcp, $content);
196207
$content = str_replace('{use_socket}', $use_socket, $content);
197-
208+
198209
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
199210
if($mail_config['content_filter'] == 'rspamd'){
200211
$use_rspamd = '';

0 commit comments

Comments
 (0)