Fix dashboard config not getting generated

This commit is contained in:
Girish Ramakrishnan
2023-08-13 21:36:56 +05:30
parent a7be30a816
commit 2b53ea0260
4 changed files with 15 additions and 13 deletions
+7 -5
View File
@@ -13,7 +13,6 @@ const assert = require('assert'),
BoxError = require('./boxerror.js'),
dashboard = require('./dashboard.js'),
constants = require('./constants.js'),
cloudron = require('./cloudron.js'),
debug = require('debug')('box:provision'),
domains = require('./domains.js'),
eventlog = require('./eventlog.js'),
@@ -77,11 +76,12 @@ async function setupTask(domain, auditSource) {
try {
await dashboard.setupDnsAndCert(constants.DASHBOARD_SUBDOMAIN, domain, auditSource, (progress) => setProgress('setup', progress.message));
await ensureDhparams();
await cloudron.setLocation(domain);
await dashboard.setupLocation(domain, auditSource);
setProgress('setup', 'Done'),
await eventlog.add(eventlog.ACTION_PROVISION, auditSource, {});
} catch (error) {
gStatus.setup.errorMessage = error ? error.message : '';
debug(`setupTask: error ${error.message}`);
gStatus.setup.errorMessage = error.message;
}
gStatus.setup.active = false;
@@ -105,7 +105,7 @@ async function setup(domainConfig, ipv4Config, auditSource) {
const domain = domainConfig.domain.toLowerCase();
const zoneName = domainConfig.zoneName ? domainConfig.zoneName : (tld.getDomain(domain) || domain);
debug(`setup: Setting up Cloudron with domain ${domain} and zone ${zoneName}`);
debug(`setup: domain ${domain} and zone ${zoneName}`);
const data = {
zoneName: zoneName,
@@ -187,6 +187,7 @@ async function restoreTask(backupConfig, remotePath, ipv4Config, options, auditS
setImmediate(() => safe(platform.onActivated({ skipDnsSetup: options.skipDnsSetup }), { debug }));
} catch (error) {
debug('restoreTask: error. %o', error);
gStatus.restore.errorMessage = error ? error.message : '';
}
gStatus.restore.active = false;
@@ -240,8 +241,9 @@ async function restore(backupConfig, remotePath, version, ipv4Config, options, a
safe(restoreTask(backupConfig, remotePath, ipv4Config, options, auditSource), { debug }); // now that args are validated run the task in the background
} catch (error) {
debug('restore: error. %o', error);
gStatus.restore.active = false;
gStatus.restore.errorMessage = error ? error.message : '';
gStatus.restore.errorMessage = error.message;
throw error;
}
}