summary refs log tree commit diff
diff options
context:
space:
mode:
authorChrisChrome <chris@chrischro.me>2026-02-16 11:49:44 -0700
committerChrisChrome <chris@chrischro.me>2026-02-16 11:49:44 -0700
commitc1679ec394f36cefa74a412958412c707769ac09 (patch)
tree956a0d7ee9e538bf71796eb64ddd04d60e94db77
parentfix (diff)
downloadserver-ts-reg-ipchecks.tar.xz
Separate IP check options during registration reg-ipchecks
-rw-r--r--src/api/routes/auth/register.ts4
-rw-r--r--src/util/config/types/RegisterConfiguration.ts3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/api/routes/auth/register.ts b/src/api/routes/auth/register.ts

index 7da796eb9..5c40ce1d8 100644 --- a/src/api/routes/auth/register.ts +++ b/src/api/routes/auth/register.ts
@@ -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) { diff --git a/src/util/config/types/RegisterConfiguration.ts b/src/util/config/types/RegisterConfiguration.ts
index e71f16dd0..484ba66b1 100644 --- a/src/util/config/types/RegisterConfiguration.ts +++ b/src/util/config/types/RegisterConfiguration.ts
@@ -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; }