feat: implement basic rate limiting by ip address #142

Merged
p4u1 merged 3 commits from rate-limits into master 2026-10-12 17:11:07 +00:00
Owner
<!-- Thank you for doing recipe maintenance work! Please mark all checklist items which are relevant for your changes. Please remove the checklist items which are not relevant for your changes. Feel free to remove this comment. --> * [x] I have deployed and tested my changes * [x] I have [updated relevant versions in `abra.sh`](https://docs.coopcloud.tech/maintainers/upgrade/#updating-versions-in-the-abrash) * [x] I have made my environment variable changes [backwards compatible](https://docs.coopcloud.tech/maintainers/upgrade/#backwards-compatible-environment-variable-changes) * [ ] I have added a [release note entry](https://docs.coopcloud.tech/maintainers/upgrade/#creating-new-release-notes)
Author
Owner

the middleware is enabled by default but only applies when applied to every service or individual services export it as a label.

there's another rate limit option to limit by host, which i've seen recommendations for nginx to enable in parallel to rate limits by ip with a higher limit. should i add that too?

also it supports redis for shared rate limits, so we could collaboratively rate limit between servers.

the middleware is enabled by default but only applies when applied to every service or individual services export it as a label. there's another rate limit option to limit by host, which i've seen recommendations for nginx to enable in parallel to rate limits by ip with a higher limit. should i add that too? also it supports redis for shared rate limits, so we could collaboratively rate limit between servers.
fauno force-pushed rate-limits from 2b40910287 to 28778ca411 2026-09-09 09:24:45 +00:00 Compare
@@ -25,0 +26,4 @@
rateLimit:
average: {{ or (env "RATE_LIMIT_AVERAGE") "100" }}
burst: {{ or (env "RATE_LIMIT_BURST") "200" }}
period: "1s"
Owner

Can you make this configurable too

Can you make this configurable too
fauno marked this conversation as resolved
.env.sample Outdated
@@ -252,0 +254,4 @@
# You can enable universal rate limits by setting RATE_LIMIT_EVERYTHING
# to true, otherwise each app needs to export their own middleware labels.
#
# https://doc.traefik.io/traefik/reference/routing-configuration/http/middlewares/ratelimit/
Owner

Can you add an example on how to enable a single service via the label?

Can you add an example on how to enable a single service via the label?
Author
Owner

it's included on the docs and the recipe has to support it, do you think it's not enough pointer?

it's included on the docs and the recipe has to support it, do you think it's not enough pointer?
p4u1 marked this conversation as resolved
Owner

there's another rate limit option to limit by host, which i've seen recommendations for nginx to enable in parallel to rate limits by ip with a higher limit. should i add that too?

also it supports redis for shared rate limits, so we could collaboratively rate limit between servers.

Let's add those in another pr

Could you add a release note? Would be nice to tell people about this :)

Also could you add a note on how to debug this setting? E.g. if there is a relevant metric about rate limiting

> there's another rate limit option to limit by host, which i've seen recommendations for nginx to enable in parallel to rate limits by ip with a higher limit. should i add that too? also it supports redis for shared rate limits, so we could collaboratively rate limit between servers. Let's add those in another pr Could you add a release note? Would be nice to tell people about this :) Also could you add a note on how to debug this setting? E.g. if there is a relevant metric about rate limiting
fauno added 1 commit 2026-10-03 04:31:53 +00:00
feat: implement basic rate limiting by ip address
continuous-integration/drone/pr Build is failing
21ea1dd698
fauno force-pushed rate-limits from 28778ca411 to 21ea1dd698 2026-10-03 04:31:53 +00:00 Compare
Owner

@fauno ping :)

@fauno ping :)
Author
Owner

@fauno ping :)

pong! i'll be back in a couple hours :)

> @fauno ping :) pong! i'll be back in a couple hours :)
fauno added 1 commit 2026-10-08 14:24:34 +00:00
feat: period is also configurable
continuous-integration/drone/pr Build is failing
c18fca9d7c
fauno added 1 commit 2026-10-08 14:40:54 +00:00
doc: release notes
continuous-integration/drone/pr Build is failing
2a2947160b
Author
Owner

added release notes!

added release notes!
Author
Owner

just discovered there's another strategy to group by request header which isn't documented further, but it looks like it could apply rate limits by specific headers, like user agents.

just discovered there's another strategy to [group by request header](https://doc.traefik.io/traefik/reference/routing-configuration/http/middlewares/ratelimit/#opt-sourceCriterion-requestHeaderName) which isn't documented further, but it looks like it could apply rate limits by specific headers, like user agents.
p4u1 approved these changes 2026-10-08 19:39:47 +00:00
p4u1 merged commit 3817644e75 into master 2026-10-12 17:11:07 +00:00
Sign in to join this conversation.