This introduces rate limits for the ChannelReader to limit DDoS attacks and
attempts to upload repositories that are larger than a node is will to permit.
The limiter sets the total number of bytes it is will to accept in a single exchange, defaulting to 500MB. This means that initial fetches will prevent large repositories, but is plenty for new packfile data to be sent in subsequent fetch exchanges.
The limit can be configured within the node’s config file, under the limits.
This introduces rate limits for the ChannelReader to limit DDoS attacks and
attempts to upload repositories that are larger than a node is will to permit.
The limiter sets the total number of bytes it is will to accept in a single exchange, defaulting to 500MB. This means that initial fetches will prevent large repositories, but is plenty for new packfile data to be sent in subsequent fetch exchanges.
The limit can be configured within the node’s config file, under the limits.
Changes:
- Rebased
- Use
bytesize, the library has no deps – other thanserdevia the flag, and it handles fractionals better than what I had quickly sketched.
Changes:
- Accidentally pushed master, reverting
- Changed
has_reachedtoexceeded_by
Changes:
- Removed pre-commit yaml file
Changes:
- Rename ByteLimit to FetchPackSizeLimit
Changes:
- Reword
exceed_bydoc copy
Changes:
- Use
saturating_add
Changes:
- Reword doc comment again
Changes:
- Correct doc strings to remove ByteLimit, and use FetchPackSizeLimit instead