Skip to content

Conversation

fenos
Copy link
Contributor

@fenos fenos commented Dec 7, 2022

What kind of change does this PR introduce?

feature

What is the new behavior?

Implementing in memory/redis based rate limiting, to the render routes

environment variables added:

ENABLE_RATE_LIMITER=true

RATE_LIMITER_DRIVER=redis # or memory
RATE_LIMITER_REDIS_URL=6379

RATE_LIMITER_RENDER_PATH_MAX_REQ_SEC=4 #max number of requests per second before being limited 

to enable the limiter set to true the ENABLE_RATE_LIMITER env

@coveralls
Copy link

coveralls commented Dec 7, 2022

Pull Request Test Coverage Report for Build 3642547321

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 38 of 78 (48.72%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.5%) to 86.172%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/monitoring/logger.ts 0 1 0.0%
src/http/routes/render/index.ts 4 6 66.67%
src/storage/renderer/renderer.ts 0 6 0.0%
src/http/routes/render/rate-limiter.ts 9 40 22.5%
Totals Coverage Status
Change from base Build 3637715512: -0.5%
Covered Lines: 4893
Relevant Lines: 5658

💛 - Coveralls

@fenos fenos force-pushed the feat/rate-limiting branch from 4d43518 to 3c45e34 Compare December 7, 2022 22:06
@fenos fenos force-pushed the feat/rate-limiting branch from 3c45e34 to 43f1455 Compare December 8, 2022 11:21
@fenos fenos merged commit f8ff71e into master Dec 8, 2022
@fenos fenos deleted the feat/rate-limiting branch December 8, 2022 11:32
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

🎉 This PR is included in version 0.26.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@MarzyCoder
Copy link

MarzyCoder commented Jun 20, 2025

@inian @fenos
Hi, I know this is very old. Nevertheless, I am very concerned about this issue. If I understand correctly, this change ensures that there is basic rate limiting for the Supabase storage. That's great!
But is there also a way to set custom rate limits in the supabase UI for specific buckets? That would be so great, as it would significantly improve the bandwidth-based billing. Would one of you be able to implement something like this, arrange it or give me a good tip?
I would be soo grateful for help!

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 this pull request may close these issues.

4 participants