Skip to content

Commit 22ee123

Browse files
author
Marius Burkard
committed
Option to exclude sub/aliasdomains from LetsEncrypt, implements #4880
1 parent 652c0b9 commit 22ee123

File tree

7 files changed

+20
-2
lines changed

7 files changed

+20
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE `web_domain` ADD COLUMN `ssl_letsencrypt_exclude` enum('n','y') NOT NULL DEFAULT 'n' AFTER `ssl_letsencrypt`;

install/sql/ispconfig3.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,7 @@ CREATE TABLE `web_domain` (
19431943
`rewrite_to_https` ENUM('y','n') NOT NULL DEFAULT 'n',
19441944
`ssl` enum('n','y') NOT NULL default 'n',
19451945
`ssl_letsencrypt` enum('n','y') NOT NULL DEFAULT 'n',
1946+
`ssl_letsencrypt_exclude` enum('n','y') NOT NULL DEFAULT 'n',
19461947
`ssl_state` varchar(255) NULL,
19471948
`ssl_locality` varchar(255) NULL,
19481949
`ssl_organisation` varchar(255) NULL,

interface/web/sites/form/web_childdomain.tform.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@
133133
'width' => '30',
134134
'maxlength' => '255'
135135
),
136+
'ssl_letsencrypt_exclude' => array (
137+
'datatype' => 'VARCHAR',
138+
'formtype' => 'CHECKBOX',
139+
'default' => 'n',
140+
'value' => array(0 => 'n', 1 => 'y')
141+
),
136142
'active' => array (
137143
'datatype' => 'VARCHAR',
138144
'formtype' => 'CHECKBOX',

interface/web/sites/lib/lang/de_web_childdomain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,5 @@ $wb['available_php_directive_snippets_txt'] = 'Verfügbare PHP-Direktiven-Schnip
115115
$wb['available_apache_directive_snippets_txt'] = 'Verfügbare Apache-Direktiven-Schnipsel:';
116116
$wb['available_nginx_directive_snippets_txt'] = 'Verfügbare nginx-Direktiven-Schnipsel:';
117117
$wb['Domain'] = 'Aliasdomain';
118+
$wb['ssl_letsencrypt_exclude_txt'] = 'Nicht in Let\'s Encrypt Zertifikat aufnehmen';
118119
?>

interface/web/sites/lib/lang/en_web_childdomain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,5 @@ $wb['available_php_directive_snippets_txt'] = 'Available PHP Directive Snippets:
115115
$wb['available_apache_directive_snippets_txt'] = 'Available Apache Directive Snippets:';
116116
$wb['available_nginx_directive_snippets_txt'] = 'Available nginx Directive Snippets:';
117117
$wb['Domain'] = 'Aliasdomain';
118+
$wb['ssl_letsencrypt_exclude_txt'] = 'Don\'t add to Let\'s Encrypt certificate';
118119
?>

interface/web/sites/templates/web_childdomain_edit.htm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ <h1><tmpl_var name="list_head_txt"></h1>
6767
<div class="col-sm-9"><select name="seo_redirect" id="seo_redirect" class="form-control">
6868
{tmpl_var name='seo_redirect'}
6969
</select></div>
70+
</div>
71+
</tmpl_if>
72+
<tmpl_if name="limit_ssl_letsencrypt" op="==" value="y">
73+
<div class="form-group">
74+
<label class="col-sm-3 control-label">{tmpl_var name='ssl_letsencrypt_exclude_txt'}</label>
75+
<div class="col-sm-9">
76+
{tmpl_var name='ssl_letsencrypt_exclude'}
77+
</div>
7078
</div>
7179
</tmpl_if>
7280
<div class="form-group">

server/lib/classes/letsencrypt.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,15 +203,15 @@ public function request_certificates($data, $server_type = 'apache') {
203203
}
204204

205205
//* then, add subdomain if we have
206-
$subdomains = $app->db->queryAllRecords('SELECT domain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'subdomain'");
206+
$subdomains = $app->db->queryAllRecords('SELECT domain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'subdomain' AND ssl_letsencrypt_exclude != 'y'");
207207
if(is_array($subdomains)) {
208208
foreach($subdomains as $subdomain) {
209209
$temp_domains[] = $subdomain['domain'];
210210
}
211211
}
212212

213213
//* then, add alias domain if we have
214-
$aliasdomains = $app->db->queryAllRecords('SELECT domain,subdomain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'alias'");
214+
$aliasdomains = $app->db->queryAllRecords('SELECT domain,subdomain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'alias' AND ssl_letsencrypt_exclude != 'y'");
215215
if(is_array($aliasdomains)) {
216216
foreach($aliasdomains as $aliasdomain) {
217217
$temp_domains[] = $aliasdomain['domain'];

0 commit comments

Comments
 (0)