-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iroh-dns-server)!: Make http rate limit configurable (#2772)
Hello, We are currently testing some new cloud features at [Spacedrive](https://github.com/spacedriveapp/spacedrive), and our implementation relies heavily on iroh. As part of this, we are deploying our own iroh-dns-server. However, since all of our backend services operate behind a reverse proxy, we noticed that the iroh-dns-server was frequently hitting its rate limit because it wasn’t aware of the proxy setup. To address this, I decided to implement a configurable rate limit for the iroh-dns-server. ## Description This PR adds a new entry to the `iroh-dns-server` TOML file for configuring the HTTP rate limit. The new configuration allows for disabling the rate limit and also supports configuring it to use the [SmartIPKeyExtract](https://github.com/benwis/tower-governor/blob/v0.4.2/src/key_extractor.rs#L85-L119), making it compatible with reverse proxies. ## Breaking Changes - `iroh-dns-server`'s configuration structure now has a new field allowing to choose the rate limiting algorithms. ## Notes & open questions :) ## Change checklist - [x] Self-review. - [x] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [x] Tests if relevant. - [x] All breaking changes documented.
- Loading branch information
1 parent
61acd96
commit fe684c2
Showing
6 changed files
with
78 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pkarr_put_rate_limit = "disabled" | ||
|
||
[http] | ||
port = 8080 | ||
bind_addr = "127.0.0.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pkarr_put_rate_limit = "smart" | ||
|
||
[https] | ||
port = 443 | ||
domains = ["irohdns.example.org"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters