diff --git a/backend/setup.js b/backend/setup.js index dcf878732..cdacb3ca1 100644 --- a/backend/setup.js +++ b/backend/setup.js @@ -104,12 +104,12 @@ const setupDefaultSettings = () => { }) .then(() => { settingModel - .query() - .where('id', 'default-site') - .first() - .then((row) => { - internalNginx.generateConfig('default', row); - }); + .query() + .where('id', 'default-site') + .first() + .then((row) => { + internalNginx.generateConfig('default', row); + }); }); }; @@ -154,8 +154,8 @@ const setupCertbotPlugins = () => { * @returns {Promise} */ const regenerateAllHosts = () => { - if (process.env.REGENERATE_ALL === 'true') { - return proxyModel + if (process.env.REGENERATE_ALL === 'true') { + return proxyModel .query() .where('is_deleted', 0) .andWhere('enabled', 1) @@ -167,43 +167,43 @@ const regenerateAllHosts = () => { }) .then(() => { return redirectModel - .query() - .where('is_deleted', 0) - .andWhere('enabled', 1) - .withGraphFetched('[certificate]') - .then((rows) => { - if (rows && rows.length) { - internalNginx.bulkGenerateConfigs('redirection_host', rows); - } - }); + .query() + .where('is_deleted', 0) + .andWhere('enabled', 1) + .withGraphFetched('[certificate]') + .then((rows) => { + if (rows && rows.length) { + internalNginx.bulkGenerateConfigs('redirection_host', rows); + } + }); }) .then(() => { return deadModel - .query() - .where('is_deleted', 0) - .andWhere('enabled', 1) - .withGraphFetched('[certificate]') - .then((rows) => { - if (rows && rows.length) { - internalNginx.bulkGenerateConfigs('dead_host', rows); - } - }); + .query() + .where('is_deleted', 0) + .andWhere('enabled', 1) + .withGraphFetched('[certificate]') + .then((rows) => { + if (rows && rows.length) { + internalNginx.bulkGenerateConfigs('dead_host', rows); + } + }); }) .then(() => { return streamModel - .query() - .where('is_deleted', 0) - .andWhere('enabled', 1) - .then((rows) => { - if (rows && rows.length) { - internalNginx.bulkGenerateConfigs('stream', rows); - } - }); + .query() + .where('is_deleted', 0) + .andWhere('enabled', 1) + .then((rows) => { + if (rows && rows.length) { + internalNginx.bulkGenerateConfigs('stream', rows); + } + }); }) .then(() => { utils.writeHash(); }); - } + } }; module.exports = function () {