Skip to content

Commit 0a21840

Browse files
authored
Update envs for API rate limits (#416)
1 parent 931d6bc commit 0a21840

File tree

2 files changed

+168
-163
lines changed

2 files changed

+168
-163
lines changed

setup/env-variables/backend-env-variables.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -467,23 +467,27 @@ Use Invisible reCAPTCHA v2 for the latest versions. If using a previous version
467467

468468
## <mark style="background-color:orange;">API Rate Limits</mark>
469469

470-
| Variable | Description | Parameters |
471-
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
472-
| `API_RATE_LIMIT` | A global API rate limit: number or requests per second for all users. Implemented in [#5030](https://github.com/blockscout/blockscout/pull/5030) | <p>Version: v4.1.1+<br>Default: <code>10 req/sec</code><br>Applications: API</p> |
473-
| `API_RATE_LIMIT_BY_KEY` | A dedicated API rate limit per key for every type of API key (static or generated from Account module). Implemented in [#5080](https://github.com/blockscout/blockscout/pull/5080) | <p>Version: v4.1.1+<br>Default: <code>10 req/sec</code><br>Applications: API</p> |
474-
| `API_RATE_LIMIT_WHITELISTED_IPS` | Comma-separated whitelisted IPs list with dedicated rate limit. Implemented in [#5090](https://github.com/blockscout/blockscout/pull/5090) | <p>Version: v4.1.1+<br>Default: (empty)<br>Applications: API</p> |
475-
| `API_RATE_LIMIT_STATIC_API_KEY` | Static API key with dedicated API rate limit. Implemented in [#5080](https://github.com/blockscout/blockscout/pull/5080) | <p>Version: v4.1.1+<br>Default: (empty)<br>Applications: API</p> |
476-
| `API_NO_RATE_LIMIT_API_KEY` | API key with no rate limit. Implemented in [#10515](https://github.com/blockscout/blockscout/pull/10515) | <p>Version: v6.8.0+<br>Default: (empty)<br>Applications: API</p> |
477-
| `API_RATE_LIMIT_DISABLED` | If `true`, any type of rate limit is ignored. Implemented in [#6908](https://github.com/blockscout/blockscout/pull/6908) | <p>Version: v5.1.0+<br>Default: (empty)<br>Applications: API</p> |
478-
| `API_RATE_LIMIT_IS_BLOCKSCOUT_BEHIND_PROXY` | If `true`, then IP address of a client will be derived from proxy's headers (like `X-Forwarded-For`) using [RemoteIp](https://hexdocs.pm/remote_ip/RemoteIp.html) library. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>false</code><br>Applications: API</p> |
479-
| `API_RATE_LIMIT_BY_WHITELISTED_IP` | A dedicated API rate limit for whitelisted IPs. Implemented in [#5090](https://github.com/blockscout/blockscout/pull/5090) | <p>Version: v5.1.3+<br>Default: <code>50 req/sec</code><br>Applications: API</p> |
480-
| `API_RATE_LIMIT_BY_IP` | Global rate limit for an IP address for API v2 requests sent from UI. [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>3000</code><br>Applications: API</p> |
481-
| `API_RATE_LIMIT_HAMMER_REDIS_URL` | Redis DB URL for Hammer rate limit library. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Needs Recompile: ☑️<br>Version: v5.1.3+<br>Default: (empty)<br>Applications: API</p> |
482-
| `API_RATE_LIMIT_UI_V2_WITH_TOKEN` | Rate limit after submitting correct CAPTCHA. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>5</code><br>Applications: API</p> |
483-
| `API_RATE_LIMIT_TIME_INTERVAL` | Time interval of rate limit. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>1s</code><br>Applications: API</p> |
484-
| `API_RATE_LIMIT_BY_IP_TIME_INTERVAL` | Time interval of rate limit set by `API_RATE_LIMIT_BY_IP`. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>5m</code><br>Applications: API</p> |
485-
| `API_RATE_LIMIT_UI_V2_TOKEN_TTL_IN_SECONDS` | TTL for token issued after submitting correct CAPTCHA for an API v2 requests from UI. In seconds. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>1800</code><br>Applications: API</p> |
486-
| `ETH_JSON_RPC_MAX_BATCH_SIZE` | Max batch size for Eth JSON RPC requests. Implemented in [#9409](https://github.com/blockscout/blockscout/pull/9409) | <p>Version: v6.3.0+<br>Default: <code>5</code><br>Applications: API</p> |
470+
| Variable | Description | Parameters |
471+
| ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
472+
| `API_RATE_LIMIT` | A global API rate limit: number or requests per second for all users. Implemented in [#5030](https://github.com/blockscout/blockscout/pull/5030) | <p>Version: v4.1.1+<br>Default: <code>10 req/sec</code><br>Applications: API</p> |
473+
| `API_RATE_LIMIT_BY_KEY` | A dedicated API rate limit per key for every type of API key (static or generated from Account module). Implemented in [#5080](https://github.com/blockscout/blockscout/pull/5080) | <p>Version: v4.1.1+<br>Default: <code>10 req/sec</code><br>Applications: API</p> |
474+
| `API_RATE_LIMIT_WHITELISTED_IPS` | Comma-separated whitelisted IPs list with dedicated rate limit. Implemented in [#5090](https://github.com/blockscout/blockscout/pull/5090) | <p>Version: v4.1.1+<br>Default: (empty)<br>Applications: API</p> |
475+
| `API_RATE_LIMIT_STATIC_API_KEY` | Static API key with dedicated API rate limit. Implemented in [#5080](https://github.com/blockscout/blockscout/pull/5080) | <p>Version: v4.1.1+<br>Default: (empty)<br>Applications: API</p> |
476+
| `API_NO_RATE_LIMIT_API_KEY` | API key with no rate limit. Implemented in [#10515](https://github.com/blockscout/blockscout/pull/10515) | <p>Version: v6.8.0+<br>Default: (empty)<br>Applications: API</p> |
477+
| `API_RATE_LIMIT_DISABLED` | If `true`, any type of rate limit is ignored. Implemented in [#6908](https://github.com/blockscout/blockscout/pull/6908) | <p>Version: v5.1.0+<br>Default: (empty)<br>Applications: API</p> |
478+
| `API_RATE_LIMIT_IS_BLOCKSCOUT_BEHIND_PROXY` | If `true`, then IP address of a client will be derived from proxy's headers (like `X-Forwarded-For`) using [RemoteIp](https://hexdocs.pm/remote_ip/RemoteIp.html) library. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>false</code><br>Applications: API</p> |
479+
| `API_RATE_LIMIT_BY_WHITELISTED_IP` | A dedicated API rate limit for whitelisted IPs. Implemented in [#5090](https://github.com/blockscout/blockscout/pull/5090) | <p>Version: v5.1.3+<br>Default: <code>50 req/sec</code><br>Applications: API</p> |
480+
| `API_RATE_LIMIT_BY_IP` | Global rate limit for an IP address for API v2 requests sent from UI. [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>3000</code><br>Applications: API</p> |
481+
| `API_RATE_LIMIT_HAMMER_REDIS_URL` | Redis DB URL for Hammer rate limit library. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: (empty)<br>Applications: API</p> |
482+
| `API_RATE_LIMIT_UI_V2_WITH_TOKEN` | Rate limit after submitting correct CAPTCHA. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>5</code><br>Applications: API</p> |
483+
| `API_RATE_LIMIT_BY_IP_TIME_INTERVAL` | Time interval of rate limit set by `API_RATE_LIMIT_BY_IP`. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>5m</code><br>Applications: API</p> |
484+
| `API_RATE_LIMIT_UI_V2_TOKEN_TTL_IN_SECONDS` | TTL for token issued after submitting correct CAPTCHA for an API v2 requests from UI. In seconds. Implemented in [#7148](https://github.com/blockscout/blockscout/pull/7148) | <p>Version: v5.1.3+<br>Default: <code>1800</code><br>Applications: API</p> |
485+
| `ETH_JSON_RPC_MAX_BATCH_SIZE` | Max batch size for Eth JSON RPC requests. Implemented in [#9409](https://github.com/blockscout/blockscout/pull/9409) | <p>Version: v6.3.0+<br>Default: <code>5</code><br>Applications: API</p> |
486+
| `API_RATE_LIMIT_CONFIG_URL` | URL to fetch API rate limit configuration from external source. Implemented in [#12386](https://github.com/blockscout/blockscout/pull/12386) | <p>Version: master<br>Default: (empty)<br>Applications: API</p> |
487+
| `API_RATE_LIMIT_BY_KEY_TIME_INTERVAL` | Time interval for API rate limit by key. [Time format](backend-env-variables.md#time-format). Implemented in [#12386](https://github.com/blockscout/blockscout/pull/12386) | <p>Version: master<br>Default: <code>1s</code><br>Applications: API</p> |
488+
| `API_RATE_LIMIT_BY_WHITELISTED_IP_TIME_INTERVAL` | Time interval for API rate limit by whitelisted IP. [Time format](backend-env-variables.md#time-format). Implemented in [#12386](https://github.com/blockscout/blockscout/pull/12386) | <p>Version: master<br>Default: <code>1s</code><br>Applications: API</p> |
489+
| `API_RATE_LIMIT_UI_V2_WITH_TOKEN_TIME_INTERVAL` | Time interval for API rate limit for UI v2 with token. [Time format](backend-env-variables.md#time-format). Implemented in [#12386](https://github.com/blockscout/blockscout/pull/12386) | <p>Version: master<br>Default: <code>1s</code><br>Applications: API</p> |
490+
| `API_RATE_LIMIT_BY_ACCOUNT_API_KEY_TIME_INTERVAL` | Time interval for API rate limit by account API key. [Time format](backend-env-variables.md#time-format). Implemented in [#12386](https://github.com/blockscout/blockscout/pull/12386) | <p>Version: master<br>Default: <code>1s</code><br>Applications: API</p> |
487491

488492
## <mark style="background-color:orange;">General application rate Limits</mark>
489493

0 commit comments

Comments
 (0)