api: use req.ip instead of cloudflare headers, ratelimit ipv6 by prefix

allows for more versatile configurations that do not necessarily have to use cloudflare

also ratelimits IPv6 addresses by prefix instead of individual addresses
currently set at /56, which should not be too strict
(yet allows a /48 holder to make 256 as many requests instead of 2^80 as many requests), change if needed
This commit is contained in:
dumbmoron
2023-07-25 19:46:25 +00:00
committed by dumbmoron
parent b4f11b047e
commit a375000ae9
3 changed files with 16 additions and 3 deletions

View File

@@ -34,6 +34,7 @@
"express-rate-limit": "^6.3.0",
"ffmpeg-static": "^5.1.0",
"hls-parser": "^0.10.7",
"ipaddr.js": "2.1.0",
"nanoid": "^4.0.2",
"node-cache": "^5.1.2",
"psl": "1.9.0",