Implement general CAA DNS records for all issuers

This commit is contained in:
Marc-André Kolly
2019-07-28 16:28:29 +02:00
parent d4e5e32c14
commit 64fe300e42
9 changed files with 51 additions and 52 deletions

View File

@@ -131,9 +131,15 @@ class Dns
}
// additional required records for CAA if activated
if ($domain['caa'] == '1') {
if (!is_null($domain['caa'])) {
// check for CAA content later
self::addRequiredEntry('@', 'CAA', $required_entries);
// additional required records by subdomain setting
if ($domain['iswildcarddomain'] == '1') {
self::addRequiredEntry('*', 'CAA', $required_entries);
} elseif ($domain['wwwserveralias'] == '1') {
self::addRequiredEntry('www', 'CAA', $required_entries);
}
}
// additional required records for SPF and DKIM if activated
@@ -287,7 +293,16 @@ class Dns
// CAA
if (array_key_exists("CAA", $required_entries)) {
$zonerecords[] = new DnsEntry('@', 'CAA', '0 issue "letsencrypt.org"');
foreach ($required_entries as $type => $records) {
if ($type == 'CAA') {
foreach ($records as $record) {
$caa_entries = explode(PHP_EOL, $domain['caa']);
foreach ($caa_entries as $entry) {
$zonerecords[] = new DnsEntry($record, 'CAA', self::encloseTXTContent($entry));
}
}
}
}
}
}

View File

@@ -215,17 +215,14 @@ return array(
'value' => array()
),
'caa' => array(
'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
'visible' => $ssl_ipsandports != '' ? true : false,
'style' => 'align-top',
'label' => $lng['admin']['caa']['title'],
'desc' => $lng['admin']['caa']['description'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
'type' => 'textarea',
'value' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? '0 issue "letsencrypt.org"' : '') : ''),
'cols' => 60,
'rows' => 5
),
'http2' => array(
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1',

View File

@@ -251,19 +251,14 @@ return array(
)
),
'caa' => array(
'visible' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
'visible' => $ssl_ipsandports != '' ? true : false,
'style' => 'align-top',
'label' => $lng['admin']['caa']['title'],
'desc' => $lng['admin']['caa']['description'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['caa']
)
'type' => 'textarea',
'value' => $result['caa'],
'cols' => 60,
'rows' => 5
),
'http2' => array(
'visible' => ($ssl_ipsandports != '' ? true : false) && \Froxlor\Settings::Get('system.webserver') != 'lighttpd' && \Froxlor\Settings::Get('system.http2_support') == '1',

View File

@@ -109,17 +109,14 @@ return array(
'value' => array()
),
'caa' => array(
'visible' => \Froxlor\Settings::Get('system.leenabled') == '1' ? true : false,
'visible' => $ssl_ipsandports != '' ? true : false,
'style' => 'align-top',
'label' => $lng['customer']['caa']['title'],
'desc' => $lng['customer']['caa']['description'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
'type' => 'textarea',
'value' => (\Froxlor\Settings::Get('system.leenabled') == '1' ? ($ssl_ipsandports != '' ? '0 issue "letsencrypt.org"' : '') : ''),
'cols' => 60,
'rows' => 5
),
'hsts_maxage' => array(
'label' => $lng['admin']['domain_hsts_maxage']['title'],

View File

@@ -129,19 +129,14 @@ return array(
)
),
'caa' => array(
'visible' => \Froxlor\Settings::Get('system.leenabled') == '1' ? true : false,
'visible' => $ssl_ipsandports != '' ? true : false,
'style' => 'align-top',
'label' => $lng['customer']['caa']['title'],
'desc' => $lng['customer']['caa']['description'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
$result['caa']
)
'type' => 'textarea',
'value' => $result['caa'],
'cols' => 60,
'rows' => 5
),
'hsts_maxage' => array(
'label' => $lng['admin']['domain_hsts_maxage']['title'],