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
-21
View File
@@ -6,10 +6,6 @@ exports = module.exports = {
// these values come from the cache
dashboardDomain,
setDashboardLocation,
setMailLocation,
mailFqdn,
mailDomain,
dashboardOrigin,
dashboardFqdn,
@@ -73,8 +69,6 @@ const gDefaults = (function () {
const result = { };
result[exports.DASHBOARD_DOMAIN_KEY] = '';
result[exports.DASHBOARD_FQDN_KEY] = '';
result[exports.MAIL_DOMAIN_KEY] = '';
result[exports.MAIL_FQDN_KEY] = '';
return result;
})();
@@ -150,8 +144,6 @@ async function initCache() {
gCache = {
dashboardDomain: allSettings[exports.DASHBOARD_DOMAIN_KEY],
dashboardFqdn: allSettings[exports.DASHBOARD_FQDN_KEY],
mailDomain: allSettings[exports.MAIL_DOMAIN_KEY],
mailFqdn: allSettings[exports.MAIL_FQDN_KEY],
};
}
@@ -167,19 +159,6 @@ async function setDashboardLocation(dashboardDomain, dashboardFqdn) {
gCache.dashboardFqdn = dashboardFqdn;
}
async function setMailLocation(mailDomain, mailFqdn) {
assert.strictEqual(typeof mailDomain, 'string');
assert.strictEqual(typeof mailFqdn, 'string');
await set(exports.MAIL_DOMAIN_KEY, mailDomain);
await set(exports.MAIL_FQDN_KEY, mailFqdn);
gCache.mailDomain = mailDomain;
gCache.mailFqdn = mailFqdn;
}
function dashboardDomain() { return gCache.dashboardDomain; }
function dashboardFqdn() { return gCache.dashboardFqdn; }
function mailDomain() { return gCache.mailDomain; }
function mailFqdn() { return gCache.mailFqdn; }
function dashboardOrigin() { return 'https://' + dashboardFqdn(); }