-
-
Notifications
You must be signed in to change notification settings - Fork 226
Add throttling to the whole website #4238
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
@copilot do we need the middleware if we install the throttling plugin? |
Yes, we still need our custom middleware. The The built-in Our custom
The package gives us the core rate limiting functionality, but our middleware implements the specific throttling strategy for the BLT website. |
@copilot please run the pre-commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to run the pre-commit
@DonnieBLT Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@copilot please run the pre commit to lint the code |
I've run the linting tools to format the code according to the project's standards. Made the following changes:
These changes have been committed in 0b39c7d. |
@copilot plesse push the commit |
@copilot lets not use docker for this, set it up similar to how the GitHub action test is and add the pre commit similar to that action |
@copilot lets not use docker for this, set it up similar to how the GitHub action test is and add the pre commit similar to that action |
I've set up the project to follow the GitHub Action test approach without using Docker. Created a new
Also added detailed documentation in These changes maintain the same workflow as the GitHub Action test configuration but avoid using Docker. |
Overview
This PR adds comprehensive rate limiting (throttling) to the entire BLT website, not just the API. This provides protection against abuse and DoS attacks by limiting the number of requests users can make in a given time period.
Implementation
django-ratelimit
package to project dependenciesCode Changes
The implementation consists of:
blt/middleware/throttling.py
blt/settings.py
docs/throttling.md
Testing
The throttling middleware has been tested to ensure:
Fixes #4220.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.fwupd.org
/usr/bin/fwupdmgr refresh
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.