feat: rate limiting

This commit is contained in:
f 2025-03-08 20:05:04 -03:00
parent 1aff1fa604
commit 5e0f075d13
3 changed files with 7 additions and 4 deletions

View File

@ -13,6 +13,9 @@ ENABLE_RESERVATIONS=false
ENABLE_BACKUPS=true
TZ=UTC
LOG_LEVEL=info
VISITOR_REQUEST_LIMIT_BURST=60
VISITOR_REQUEST_LIMIT_REPLENISH=5s
VISITOR_REQUEST_LIMIT_EXEMPT_HOSTS=""
COMPOSE_FILE=compose.yml
#SMTP_ENABLED=1

View File

@ -1 +1 @@
export SERVER_YML_VERSION=v1
export SERVER_YML_VERSION=v2

View File

@ -280,9 +280,9 @@ visitor-subscription-limit: 30
# exempt from request rate limiting. Hostnames are resolved at the time the server is started.
# Example: "1.2.3.4,ntfy.example.com,8.7.6.0/24"
#
visitor-request-limit-burst: 60
visitor-request-limit-replenish: "5s"
# visitor-request-limit-exempt-hosts: ""
visitor-request-limit-burst: {{ env "VISITOR_REQUEST_LIMIT_BURST" }}
visitor-request-limit-replenish: "{{ env "VISITOR_REQUEST_LIMIT_REPLENISH" }}"
visitor-request-limit-exempt-hosts: "{{ env "VISITOR_REQUEST_LIMIT_EXEMPT_HOSTS" }}"
# Rate limiting: Hard daily limit of messages per visitor and day. The limit is reset
# every day at midnight UTC. If the limit is not set (or set to zero), the request