Fixes eslint errors

This commit is contained in:
chaptergy
2021-10-12 15:42:22 +02:00
committed by L. Wlcek
parent b9ab4a2dca
commit c6a50e0561
5 changed files with 83 additions and 84 deletions

View File

@@ -267,9 +267,9 @@ const internalNginx = {
host.forwarding_host = internalNginx.addIpv6Brackets(host.forwarding_host); host.forwarding_host = internalNginx.addIpv6Brackets(host.forwarding_host);
return host; return host;
}), }),
} };
} else { } else {
internalNginx.deleteConfig(host_type, host, false) internalNginx.deleteConfig(host_type, host, false);
} }
} else if (host_type !== 'default') { } else if (host_type !== 'default') {
@@ -300,7 +300,7 @@ const internalNginx = {
// Set the IPv6 setting for the host // Set the IPv6 setting for the host
host.ipv6 = internalNginx.ipv6Enabled(); host.ipv6 = internalNginx.ipv6Enabled();
locationsPromise.then(() => { return locationsPromise.then(() => {
renderEngine renderEngine
.parseAndRender(template, host) .parseAndRender(template, host)
.then((config_text) => { .then((config_text) => {
@@ -320,8 +320,7 @@ const internalNginx = {
logger.warn('Could not write ' + filename + ':', err.message); logger.warn('Could not write ' + filename + ':', err.message);
} }
reject(new error.ConfigurationError(err.message)); throw new error.ConfigurationError(err.message);
});
}); });
}); });
}, },
@@ -520,7 +519,7 @@ const internalNginx = {
if (internalNginx.ipv6Enabled()) { if (internalNginx.ipv6Enabled()) {
const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/gi; const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/gi;
if (ipv6Regex.test(ip)){ if (ipv6Regex.test(ip)){
return `[${ip}]` return `[${ip}]`;
} }
} }
return ip; return ip;

View File

@@ -59,7 +59,7 @@ exports.down = function (knex/*, Promise*/) {
return knex.schema.dropTable('stream').then(() => { return knex.schema.dropTable('stream').then(() => {
return knex.schema.table('user_permission', (table) => { return knex.schema.table('user_permission', (table) => {
table.dropColumn('ssl_passthrough_hosts'); table.dropColumn('ssl_passthrough_hosts');
}) });
}) })
.then(function () { .then(function () {
logger.info('[' + migrate_name + '] Table altered and permissions updated'); logger.info('[' + migrate_name + '] Table altered and permissions updated');