restore: add skipDnsSetup flag

part of #737
This commit is contained in:
Girish Ramakrishnan
2021-02-24 14:56:09 -08:00
parent d74537868a
commit 5b51f73be4
4 changed files with 28 additions and 13 deletions
+9 -4
View File
@@ -23,7 +23,8 @@ const apps = require('./apps.js'),
tasks = require('./tasks.js'),
_ = require('underscore');
function start(callback) {
function start(options, callback) {
assert.strictEqual(typeof options, 'object');
assert.strictEqual(typeof callback, 'function');
if (process.env.BOX_ENV === 'test' && !process.env.TEST_CREATE_INFRA) return callback();
@@ -52,7 +53,7 @@ function start(callback) {
async.series([
(next) => { if (existingInfra.version !== infra.version) removeAllContainers(next); else next(); },
markApps.bind(null, existingInfra), // mark app state before we start addons. this gives the db import logic a chance to mark an app as errored
markApps.bind(null, existingInfra, options), // mark app state before we start addons. this gives the db import logic a chance to mark an app as errored
services.startServices.bind(null, existingInfra),
fs.writeFile.bind(fs, paths.INFRA_VERSION_FILE, JSON.stringify(infra, null, 4))
], function (error) {
@@ -118,10 +119,14 @@ function removeAllContainers(callback) {
], callback);
}
function markApps(existingInfra, callback) {
function markApps(existingInfra, options, callback) {
assert.strictEqual(typeof existingInfra, 'object');
assert.strictEqual(typeof options, 'object');
assert.strictEqual(typeof callback, 'function');
if (existingInfra.version === 'none') { // cloudron is being restored from backup
debug('markApps: restoring installed apps');
apps.restoreInstalledApps(callback);
apps.restoreInstalledApps(options, callback);
} else if (existingInfra.version !== infra.version) {
debug('markApps: reconfiguring installed apps');
reverseProxy.removeAppConfigs(); // should we change the cert location, nginx will not start