diff --git a/server/src/server.ts b/server/src/server.ts index 5c82cc2d4..5fcd58923 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -26,11 +26,13 @@ const ipCheck = Config.protection?.ipChecker ? new IpChecker(Config.protection.ipChecker.baseUrl, Config.protection.ipChecker.key) : undefined; -const isVPN = new Map( - existsSync("isVPN.json") - ? Object.entries(JSON.parse(readFileSync("isVPN.json", "utf8")) as Record) - : undefined -); +const isVPN = Config.protection?.ipChecker + ? new Map() + : new Map( + existsSync("isVPN.json") + ? Object.entries(JSON.parse(readFileSync("isVPN.json", "utf8")) as Record) + : undefined + ); async function isVPNCheck(ip: string): Promise { if (!ipCheck) return false; @@ -382,7 +384,7 @@ if (isMainThread) { teamsCreated = {}; - if (protection.ipChecker) { + if (!Config.protection?.ipChecker) { writeFileSync("isVPN.json", JSON.stringify(Object.fromEntries(isVPN))); }