Skip to content

Commit b60dad9

Browse files
authored
Properly document new limiter settings (#61)
1 parent 66de2cd commit b60dad9

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

config.dist.yml

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ kanae:
1818
# Whether the development mode should be enabled or not
1919
# This should be disabled during production
2020
dev_mode: False
21-
22-
# Global ratelimit for Kanae
23-
# Syntax is amount/minute. Ex: 1/minute
24-
ratelimits:
25-
- "10/second"
26-
2721

2822
# Prometheus exporter for Kanae. The following keys are used in order to control
2923
# the behavior of the Prometheus exporter
@@ -40,21 +34,59 @@ kanae:
4034
# it will always be set to 9555
4135
port: 9555
4236

37+
# Settings for Kanae's custom rate limiters
4338
limiter:
39+
40+
# Whether the rate limiters are enabled or not
4441
enabled: True
42+
43+
# Whether to inject the following headers into HTTP headers:
44+
# - X-RateLimit-Reset
45+
# - X-RateLimit-Remaining
46+
# - X-RateLimit-Limit
47+
# - Retry-After
4548
headers_enabled: False
49+
50+
# Whether to check the rate limit before the request_before chain
4651
auto_check: True
52+
53+
# Whether to swallow exceptions during rate limiting
4754
swallow_errors: True
55+
56+
# The type of retry-after header to use. Must be http-date or delta-seconds
57+
# See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After
4858
retry_after: "http-date"
49-
default_limits: ["10/second"]
59+
60+
# Default ratelimits throughout all routes
61+
# See https://limits.readthedocs.io/en/stable/quickstart.html#rate-limit-string-notation
62+
default_limits:
63+
- "10/second"
64+
65+
# Default shared ratelimits used throughout the application
66+
# This means that these limits below will be used as one rate limit throughout the application
67+
# LEAVE THIS BLANK if you have set the default limits
5068
application_limits: []
69+
70+
## Settings for falling back to memory-based storage
5171
in_memory_fallback:
72+
73+
# Whether to enable this feature or not
5274
enabled: True
75+
76+
# Limits used in the case of falling back to memory-based storage
5377
limits:
5478
- "15/second"
79+
80+
# Prefix for each key
5581
key_prefix: ""
82+
83+
# The style of the key. Must be either url or endpoint
84+
# - URL uses the actual path of the endpoint
85+
# - Endpoint uses the function module and name
5686
key_style: "url"
57-
storage_uri: ""
87+
88+
# Valkey storage-backend URI
89+
storage_uri: "valkey://localhost:6379/"
5890

5991
# These are used by SuperTokens for our backend auth
6092
auth:
@@ -112,8 +144,4 @@ auth:
112144
# The PostgreSQL connection URI that is used to connect to the database
113145
# The URI must be valid, and components will need to be quoted.
114146
# See https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
115-
postgres_uri: "postgresql://user:password@localhost:5432/user"
116-
117-
# The Redis connection URI that is used
118-
# See https://github.com/redis/lettuce/wiki/Redis-URI-and-connection-details#uri-syntax for URI syntax
119-
redis_uri: "redis://localhost:6379/0"
147+
postgres_uri: "postgresql://user:password@localhost:5432/user"

0 commit comments

Comments
 (0)