From 1fed9cb8d33f04b98d34ec74510d01b6d8b5c5e6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 23 Dec 2022 13:38:28 +0100 Subject: Don't need to use redis to block tracker ips There could be many of them, so reduce load by storing IPs directly inside node memory --- server/lib/redis.ts | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'server/lib') diff --git a/server/lib/redis.ts b/server/lib/redis.ts index c0e9aece7..451ddd0b6 100644 --- a/server/lib/redis.ts +++ b/server/lib/redis.ts @@ -8,7 +8,6 @@ import { AP_CLEANER, CONTACT_FORM_LIFETIME, RESUMABLE_UPLOAD_SESSION_LIFETIME, - TRACKER_RATE_LIMITS, TWO_FACTOR_AUTH_REQUEST_TOKEN_LIFETIME, USER_EMAIL_VERIFY_LIFETIME, USER_PASSWORD_CREATE_LIFETIME, @@ -157,16 +156,6 @@ class Redis { return this.exists(this.generateIPViewKey(ip, videoUUID)) } - /* ************ Tracker IP block ************ */ - - setTrackerBlockIP (ip: string) { - return this.setValue(this.generateTrackerBlockIPKey(ip), '1', TRACKER_RATE_LIMITS.BLOCK_IP_LIFETIME) - } - - async doesTrackerBlockIPExist (ip: string) { - return this.exists(this.generateTrackerBlockIPKey(ip)) - } - /* ************ Video views stats ************ */ addVideoViewStats (videoId: number) { @@ -365,10 +354,6 @@ class Redis { return `views-${videoUUID}-${ip}` } - private generateTrackerBlockIPKey (ip: string) { - return `tracker-block-ip-${ip}` - } - private generateContactFormKey (ip: string) { return 'contact-form-' + ip } -- cgit v1.2.3