add field for fullchain to be stored in ssl-certificates-table; create fullchain file if given (it's not used by froxlor); do not generate/renew certificates for disabled customers domains
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -688,7 +688,7 @@ opcache.interned_strings_buffer'),
|
|||||||
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||||
('panel', 'customer_hide_options', ''),
|
('panel', 'customer_hide_options', ''),
|
||||||
('panel', 'version', '0.9.39.5'),
|
('panel', 'version', '0.9.39.5'),
|
||||||
('panel', 'db_version', '201802130');
|
('panel', 'db_version', '201802250');
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_tasks`;
|
DROP TABLE IF EXISTS `panel_tasks`;
|
||||||
@@ -1004,6 +1004,7 @@ CREATE TABLE IF NOT EXISTS `domain_ssl_settings` (
|
|||||||
`ssl_ca_file` mediumtext,
|
`ssl_ca_file` mediumtext,
|
||||||
`ssl_cert_chainfile` mediumtext,
|
`ssl_cert_chainfile` mediumtext,
|
||||||
`ssl_csr_file` mediumtext,
|
`ssl_csr_file` mediumtext,
|
||||||
|
`ssl_fullchain_file` mediumtext,
|
||||||
`expirationdate` datetime DEFAULT NULL,
|
`expirationdate` datetime DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||||
|
|||||||
@@ -3939,3 +3939,12 @@ if (isFroxlorVersion('0.9.39.4')) {
|
|||||||
showUpdateStep("Updating from 0.9.39.4 to 0.9.39.5", false);
|
showUpdateStep("Updating from 0.9.39.4 to 0.9.39.5", false);
|
||||||
updateToVersion('0.9.39.5');
|
updateToVersion('0.9.39.5');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isDatabaseVersion('201802130')) {
|
||||||
|
|
||||||
|
showUpdateStep("Adding fullchain field to ssl certificates");
|
||||||
|
Database::query("ALTER TABLE `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` ADD `ssl_fullchain_file` mediumtext AFTER `ssl_csr_file`;");
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToDbVersion('201802250');
|
||||||
|
}
|
||||||
|
|||||||
@@ -89,6 +89,10 @@ class DomainSSL {
|
|||||||
$ssl_files['ssl_cert_chainfile'] = makeCorrectFile($sslcertpath.'/'.$domain['domain'].'_chain.pem');
|
$ssl_files['ssl_cert_chainfile'] = makeCorrectFile($sslcertpath.'/'.$domain['domain'].'_chain.pem');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// will only be generated to be used externally, froxlor does not need this
|
||||||
|
if ($dom_certs['ssl_fullchain_file'] != '') {
|
||||||
|
$ssl_files['ssl_fullchain_file'] = makeCorrectFile($sslcertpath.'/'.$domain['domain'].'_fullchain.pem');
|
||||||
|
}
|
||||||
// create them on the filesystem
|
// create them on the filesystem
|
||||||
foreach ($ssl_files as $type => $filename) {
|
foreach ($ssl_files as $type => $filename) {
|
||||||
if ($filename != '') {
|
if ($filename != '') {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
$version = '0.9.39.5';
|
$version = '0.9.39.5';
|
||||||
|
|
||||||
// Database version (YYYYMMDDC where C is a daily counter)
|
// Database version (YYYYMMDDC where C is a daily counter)
|
||||||
$dbversion = '201802130';
|
$dbversion = '201802250';
|
||||||
|
|
||||||
// Distribution branding-tag (used for Debian etc.)
|
// Distribution branding-tag (used for Debian etc.)
|
||||||
$branding = '';
|
$branding = '';
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ $certificates_stmt = Database::query("
|
|||||||
dom.`id` = domssl.`domainid`
|
dom.`id` = domssl.`domainid`
|
||||||
WHERE
|
WHERE
|
||||||
dom.`customerid` = cust.`customerid`
|
dom.`customerid` = cust.`customerid`
|
||||||
|
AND cust.deactivated = 0
|
||||||
AND dom.`letsencrypt` = 1
|
AND dom.`letsencrypt` = 1
|
||||||
AND dom.`aliasdomain` IS NULL
|
AND dom.`aliasdomain` IS NULL
|
||||||
AND dom.`iswildcarddomain` = 0
|
AND dom.`iswildcarddomain` = 0
|
||||||
@@ -92,6 +93,7 @@ $updcert_stmt = Database::prepare("
|
|||||||
`ssl_ca_file` = :ca,
|
`ssl_ca_file` = :ca,
|
||||||
`ssl_cert_chainfile` = :chain,
|
`ssl_cert_chainfile` = :chain,
|
||||||
`ssl_csr_file` = :csr,
|
`ssl_csr_file` = :csr,
|
||||||
|
`ssl_fullchain_file` = :fullchain,
|
||||||
`expirationdate` = :expirationdate
|
`expirationdate` = :expirationdate
|
||||||
");
|
");
|
||||||
|
|
||||||
@@ -182,6 +184,7 @@ if (Settings::Get('system.le_froxlor_enabled') == '1') {
|
|||||||
'ca' => $return['chain'],
|
'ca' => $return['chain'],
|
||||||
'chain' => $return['chain'],
|
'chain' => $return['chain'],
|
||||||
'csr' => $return['csr'],
|
'csr' => $return['csr'],
|
||||||
|
'fullchain' => $return['fullchain'],
|
||||||
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
|
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ $certificates_stmt = Database::query("
|
|||||||
dom.`id` = domssl.`domainid`
|
dom.`id` = domssl.`domainid`
|
||||||
WHERE
|
WHERE
|
||||||
dom.`customerid` = cust.`customerid`
|
dom.`customerid` = cust.`customerid`
|
||||||
|
AND cust.deactivated = 0
|
||||||
AND dom.`letsencrypt` = 1
|
AND dom.`letsencrypt` = 1
|
||||||
AND dom.`aliasdomain` IS NULL
|
AND dom.`aliasdomain` IS NULL
|
||||||
AND dom.`iswildcarddomain` = 0
|
AND dom.`iswildcarddomain` = 0
|
||||||
@@ -88,6 +89,7 @@ $updcert_stmt = Database::prepare("
|
|||||||
`ssl_ca_file` = :ca,
|
`ssl_ca_file` = :ca,
|
||||||
`ssl_cert_chainfile` = :chain,
|
`ssl_cert_chainfile` = :chain,
|
||||||
`ssl_csr_file` = :csr,
|
`ssl_csr_file` = :csr,
|
||||||
|
`ssl_fullchain_file` = :fullchain,
|
||||||
`expirationdate` = :expirationdate
|
`expirationdate` = :expirationdate
|
||||||
");
|
");
|
||||||
|
|
||||||
@@ -178,6 +180,7 @@ if (Settings::Get('system.le_froxlor_enabled') == '1') {
|
|||||||
'ca' => $return['chain'],
|
'ca' => $return['chain'],
|
||||||
'chain' => $return['chain'],
|
'chain' => $return['chain'],
|
||||||
'csr' => $return['csr'],
|
'csr' => $return['csr'],
|
||||||
|
'fullchain' => $return['fullchain'],
|
||||||
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
|
'expirationdate' => date('Y-m-d H:i:s', $newcert['validTo_time_t'])
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user