settings: move mailFqdn/Domain into mailServer

This commit is contained in:
Girish Ramakrishnan
2023-08-04 21:37:38 +05:30
parent 946e5caacb
commit 4cdf37b060
15 changed files with 78 additions and 73 deletions

View File

@@ -301,7 +301,8 @@ async function getCertificate(location) {
}
async function getMailCertificate() {
return await getCertificate({ domain: settings.mailDomain(), fqdn: settings.mailFqdn(), certificate: null, type: apps.LOCATION_TYPE_MAIL });
const { domain, fqdn } = await mailServer.getLocation();
return await getCertificate({ domain, fqdn, certificate: null, type: apps.LOCATION_TYPE_MAIL });
}
async function getDirectoryServerCertificate() {
@@ -642,7 +643,8 @@ async function checkCerts(options, auditSource, progressCallback) {
assert.strictEqual(typeof progressCallback, 'function');
let locations = [];
if (settings.dashboardFqdn() !== settings.mailFqdn()) locations.push({ domain: settings.mailDomain(), fqdn: settings.mailFqdn(), certificate: null, type: apps.LOCATION_TYPE_MAIL });
const { domain:mailDomain, fqdn:mailFqdn } = await mailServer.getLocation();
if (settings.dashboardFqdn() !== mailFqdn) locations.push({ domain: mailDomain, fqdn: mailFqdn, certificate: null, type: apps.LOCATION_TYPE_MAIL });
locations.push({ domain: settings.dashboardDomain(), fqdn: settings.dashboardFqdn(), certificate: null, type: apps.LOCATION_TYPE_DASHBOARD });
const allApps = (await apps.list()).filter(app => app.runState !== apps.RSTATE_STOPPED);