mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-28 03:04:07 +00:00
Separate IP check options during registration
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user