Skip to content

Commit

Permalink
update and lint
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
web-flow authored Jan 7, 2025
1 parent 5ca0238 commit 76871f0
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions backend/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
};

Expand Down Expand Up @@ -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)
Expand All @@ -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 () {
Expand Down

0 comments on commit 76871f0

Please sign in to comment.