Merge pull request #5813 from vzagorovskiy/fix/regenerate-config-wrong-host-type

Use the row's own model and host type in regenerate-config
This commit is contained in:
jc21 authored and GitHub committed 2026-09-23 14:11:52 +10:00
commit 8509e1b378
1 file changed
+6 -6
+6 -6
View File
@@ -46,7 +46,7 @@ const logIt = (msg, type = "info") => logger[type](
// Let's do it. // Let's do it.
const processItems = async (model, type) => { const processItems = async (model, type, hostType) => {
const rows = await model const rows = await model
.query() .query()
.where("is_deleted", 0) .where("is_deleted", 0)
@@ -60,17 +60,17 @@ const processItems = async (model, type) => {
for (const row of rows) { for (const row of rows) {
if (!DRY_RUN) { if (!DRY_RUN) {
logIt(`[${type}] Regenerating config #${row.id}: ${row.domain_names ? row.domain_names.join(", ") : 'port ' + row.incoming_port}`); logIt(`[${type}] Regenerating config #${row.id}: ${row.domain_names ? row.domain_names.join(", ") : 'port ' + row.incoming_port}`);
await internalNginx.configure(proxyHostModel, "proxy_host", row); await internalNginx.configure(model, hostType, row);
} else { } else {
logIt(`[${type}] Skipping generation of config #${row.id}: ${row.domain_names ? row.domain_names.join(", ") : 'port ' + row.incoming_port}`); logIt(`[${type}] Skipping generation of config #${row.id}: ${row.domain_names ? row.domain_names.join(", ") : 'port ' + row.incoming_port}`);
} }
} }
}; };
await processItems(proxyHostModel, "Proxy Host"); await processItems(proxyHostModel, "Proxy Host", "proxy_host");
await processItems(redirectionHostModel, "Redirection Host"); await processItems(redirectionHostModel, "Redirection Host", "redirection_host");
await processItems(deadHostModel, "404 Host"); await processItems(deadHostModel, "404 Host", "dead_host");
await processItems(streamModel, "Stream"); await processItems(streamModel, "Stream", "stream");
logIt("Completed", "success"); logIt("Completed", "success");
process.exit(0); process.exit(0);