Add SIGHUP handler to reload certs
we have to reload directory server certs out of process
This commit is contained in:
@@ -37,7 +37,6 @@ const acme2 = require('./acme2.js'),
|
||||
constants = require('./constants.js'),
|
||||
crypto = require('crypto'),
|
||||
debug = require('debug')('box:reverseproxy'),
|
||||
directoryServer = require('./directoryserver.js'),
|
||||
dns = require('./dns.js'),
|
||||
domains = require('./domains.js'),
|
||||
ejs = require('ejs'),
|
||||
@@ -408,8 +407,8 @@ async function renewCert(fqdn, domainObject) {
|
||||
// FIXME: this doesn't work across processes. maybe directory server has to become a process of it's own
|
||||
if (domainObject.domain === settings.dashboardDomain() && getAcmeCertificatePathSync(settings.dashboardFqdn(), domainObject).certFilePath === acmePaths.certFilePath) {
|
||||
debug('renewCert: directory server certificate changed');
|
||||
const [restartError] = await safe(directoryServer.handleCertChanged());
|
||||
if (restartError) debug(`renewCert: error updating directory server on cert change: ${restartError.message}`);
|
||||
const [reloadError] = await safe(shell.promises.exec('renewCert', 'systemctl reload --no-block box'));
|
||||
if (reloadError) debug(`renewCert: error updating directory server on cert change: ${reloadError.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user