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

@@ -35,7 +35,7 @@ const internalNginx = {
return internalNginx.deleteConfig(host_type, host, false, true);
})
.then(() => {
if(host_type === 'ssl_passthrough_host' && !sslPassthroughEnabled){
if (host_type === 'ssl_passthrough_host' && !sslPassthroughEnabled){
// ssl passthrough is disabled
const meta = {
nginx_online: false,
@@ -65,7 +65,7 @@ const internalNginx = {
nginx_err: null
});
if(host_type === 'ssl_passthrough_host'){
if (host_type === 'ssl_passthrough_host'){
// If passthrough is disabled we have already marked the hosts as offline
if (sslPassthroughEnabled) {
return passthroughHostModel
@@ -110,7 +110,7 @@ const internalNginx = {
nginx_err: valid_lines.join('\n')
});
if(host_type === 'ssl_passthrough_host'){
if (host_type === 'ssl_passthrough_host'){
return passthroughHostModel
.query()
.where('is_deleted', 0)
@@ -255,7 +255,7 @@ const internalNginx = {
// Manipulate the data a bit before sending it to the template
if (host_type === 'ssl_passthrough_host') {
if(internalNginx.sslPassthroughEnabled()){
if (internalNginx.sslPassthroughEnabled()){
const allHosts = await passthroughHostModel
.query()
.where('is_deleted', 0)
@@ -267,9 +267,9 @@ const internalNginx = {
host.forwarding_host = internalNginx.addIpv6Brackets(host.forwarding_host);
return host;
}),
}
};
} else {
internalNginx.deleteConfig(host_type, host, false)
internalNginx.deleteConfig(host_type, host, false);
}
} else if (host_type !== 'default') {
@@ -300,7 +300,7 @@ const internalNginx = {
// Set the IPv6 setting for the host
host.ipv6 = internalNginx.ipv6Enabled();
locationsPromise.then(() => {
return locationsPromise.then(() => {
renderEngine
.parseAndRender(template, host)
.then((config_text) => {
@@ -320,8 +320,7 @@ const internalNginx = {
logger.warn('Could not write ' + filename + ':', err.message);
}
reject(new error.ConfigurationError(err.message));
});
throw new error.ConfigurationError(err.message);
});
});
},
@@ -519,8 +518,8 @@ const internalNginx = {
// Only run check if ipv6 is enabled
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;
if(ipv6Regex.test(ip)){
return `[${ip}]`
if (ipv6Regex.test(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.table('user_permission', (table) => {
table.dropColumn('ssl_passthrough_hosts');
})
});
})
.then(function () {
logger.info('[' + migrate_name + '] Table altered and permissions updated');