Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flooding endpoint /api/streamer/featured #2319

Open
ornicar opened this issue Feb 20, 2023 · 0 comments · May be fixed by #2372
Open

flooding endpoint /api/streamer/featured #2319

ornicar opened this issue Feb 20, 2023 · 0 comments · May be fixed by #2372
Labels

Comments

@ornicar
Copy link
Collaborator

ornicar commented Feb 20, 2023

Many app clients seem to call that endpoint a lot more than should be necessary. Here's an example:

nginx log for a single IP address

[20/Feb/2023:10:11:57 +0000] "GET /api/status?v=8.0.0 HTTP/2.0" 200 51 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:11:57 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:11:57 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:11:57 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:11:58 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:11:58 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:11:59 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:11:59 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:00 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:02 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:07 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:07 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:08 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:10 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:12 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:14 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:16 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:18 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:19 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:21 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:23 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:25 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:28 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:30 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:32 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"
[20/Feb/2023:10:12:34 +0000] "GET /api/streamer/featured HTTP/2.0" 200 196 "http://localhost/" "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/109.0.5414.117 Mobile Safari/537.36 Lichobile/8.0.0"

I've set a custom ratelimit on that endpoint to prevent clients from being banned by the server. It would be nice if the app would have a local cache and call that endpoint at most every 15 seconds.

The endpoint is called from here.

@ornicar ornicar added the bug label Feb 20, 2023
@jas14 jas14 linked a pull request Jun 3, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant