diff --git a/src/cloudron.js b/src/cloudron.js index f7adf18a0..075dce61e 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -112,7 +112,8 @@ async function runStartupTasks() { tasks.push(async function () { if (!settings.dashboardDomain()) return; - await reverseProxy.writeDashboardConfig(settings.dashboardDomain()); + const domainObject = await domains.get(settings.dashboardDomain()); + await reverseProxy.writeDashboardConfig(domainObject); }); tasks.push(async function () { @@ -281,7 +282,7 @@ async function setDashboardDomain(domain, auditSource) { const domainObject = await domains.get(domain); if (!domain) throw new BoxError(BoxError.NOT_FOUND, 'No such domain'); - await reverseProxy.writeDashboardConfig(domain); + await reverseProxy.writeDashboardConfig(domainObject); const fqdn = dns.fqdn(constants.DASHBOARD_LOCATION, domainObject); await settings.setDashboardLocation(domain, fqdn); diff --git a/src/reverseproxy.js b/src/reverseproxy.js index 33091ec52..c17175dc9 100644 --- a/src/reverseproxy.js +++ b/src/reverseproxy.js @@ -452,12 +452,11 @@ async function writeDashboardNginxConfig(vhost, bundle) { await reload(); } -async function writeDashboardConfig(domain) { - assert.strictEqual(typeof domain, 'string'); +async function writeDashboardConfig(domainObject) { + assert.strictEqual(typeof domainObject, 'object'); - debug(`writeDashboardConfig: writing admin config for ${domain}`); + debug(`writeDashboardConfig: writing admin config for ${domainObject.domain}`); - const domainObject = await domains.get(domain); const dashboardFqdn = dns.fqdn(constants.DASHBOARD_LOCATION, domainObject); const bundle = await getCertificatePath(dashboardFqdn, domainObject.domain);