mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Rename basic auth middleware
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user