Separate IP check options during registration

This commit is contained in:
ChrisChrome
2026-02-16 11:49:44 -07:00
parent a500a5e6ea
commit c1679ec394
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -124,7 +124,7 @@ router.post(
}
}
if (!regTokenUsed && register.checkIp) {
if (!regTokenUsed && register.enableAbuseIpDb) {
const blacklist = await AbuseIpDbClient.getBlacklist();
if (blacklist) {
const entry = blacklist.data.find((e) => e.ipAddress === ip);
@@ -140,7 +140,9 @@ router.post(
console.log(`[Register] ${ip} blocked from registration: AbuseIPDB score ${checkIp.data.abuseConfidenceScore} >= ${register.blockAbuseIpDbAboveScore} (CHECK)`);
throw new HTTPError("Your IP is blocked from registration");
}
}
if (!regTokenUsed && register.enableIpData) {
const ipData = await IpDataClient.getIpInfo(ip);
if (ipData) {
if (!ipData.threat) {
@@ -34,5 +34,6 @@ export class RegisterConfiguration {
blockAbuseIpDbAboveScore: number = 75; // 0 to disable
incrementingDiscriminators: boolean = false; // random otherwise
defaultRights: string = "875069521787904"; // See `npm run generate:rights`
checkIp: boolean = true;
enableAbuseIpDb: boolean = false;
enableIpData: boolean = false;
}