Rename basic auth middleware

This commit is contained in:
Cohee
2023-12-15 18:43:00 +02:00
parent fad718baa1
commit dd7ac914a6
3 changed files with 4 additions and 7 deletions

View File

@ -7,7 +7,9 @@ const { color, getConfigValue } = require('../util');
const whitelistPath = path.join(process.cwd(), './whitelist.txt');
let whitelist = getConfigValue('whitelist', []);
let knownIPs = new Set();
const listen = getConfigValue('listen', false);
const whitelistMode = getConfigValue('whitelistMode', true);
if (fs.existsSync(whitelistPath)) {
try {
@ -18,11 +20,6 @@ if (fs.existsSync(whitelistPath)) {
}
}
const whitelistMode = getConfigValue('whitelistMode', true);
// IP Whitelist //
let knownIPs = new Set();
function getIpFromRequest(req) {
let clientIp = req.connection.remoteAddress;
let ip = ipaddr.parse(clientIp);