1
0
Fork 0
forked from svrjs/svrjs

Lint out the codebase.

This commit is contained in:
Dorian Niemiec 2024-08-25 09:25:06 +02:00
parent 9bb77f9d98
commit 8a54834276
2 changed files with 5 additions and 4 deletions

View file

@ -18,7 +18,7 @@ module.exports = (req, res, logFacilities, config, next) => {
};
module.exports.commands = {
block: (ip, logFacilities, passCommand) => {
block: (ip, log, passCommand) => {
if (ip == undefined || JSON.stringify(ip) == "[]") {
log("Cannot block non-existent IP.");
} else {
@ -32,10 +32,10 @@ module.exports.commands = {
}
process.config.blacklist = blocklist.raw;
log("IPs successfully blocked.");
passCommand(args, logFacilities);
passCommand(ip, log);
}
},
unblock: (ip, logFacilities, passCommand) => {
unblock: (ip, log, passCommand) => {
if (ip == undefined || JSON.stringify(ip) == "[]") {
log("Cannot unblock non-existent IP.");
} else {
@ -47,7 +47,7 @@ module.exports.commands = {
}
process.config.blacklist = blocklist.raw;
log("IPs successfully unblocked.");
passCommand(args, logFacilities);
passCommand(ip, log);
}
},
};

View file

@ -3,6 +3,7 @@ const sha256 = require("../utils/sha256.js");
const createRegex = require("../utils/createRegex.js");
const ipMatch = require("../utils/ipMatch.js");
const matchHostname = require("../utils/matchHostname.js");
const ipBlockList = require("../utils/ipBlockList.js");
const cluster = require("../utils/clusterBunShim.js");
// Brute force protection-related