diff --git a/apps/docs/.eslintrc.js b/apps/docs/.eslintrc.js index d9af5f8202..8e930ff596 100644 --- a/apps/docs/.eslintrc.js +++ b/apps/docs/.eslintrc.js @@ -14,7 +14,6 @@ module.exports = { typescript: { project: "tsconfig.json", }, - caseSensitive: false, }, }, }; diff --git a/apps/docs/app/self-hosting/rate-limiting/page.mdx b/apps/docs/app/self-hosting/rate-limiting/page.mdx new file mode 100644 index 0000000000..f9a5f747dc --- /dev/null +++ b/apps/docs/app/self-hosting/rate-limiting/page.mdx @@ -0,0 +1,37 @@ +# Rate Limiting + +To protect the platform from abuse and ensure fair usage, rate limiting is enforced by default on an IP-address basis. If a client exceeds the allowed number of requests within the specified time window, the API will return a `429 Too Many Requests` status code. + +## Default Rate Limits + +The following rate limits apply to various endpoints: + +| **Endpoint** | **Rate Limit** | **Time Window** | +| ----------------------- | -------------- | --------------- | +| `POST /login` | 30 requests | 15 minutes | +| `POST /signup` | 30 requests | 60 minutes | +| `POST /verify-email` | 10 requests | 60 minutes | +| `POST /forgot-password` | 5 requests | 60 minutes | +| `GET /client-side-api` | 100 requests | 1 minute | +| `POST /share` | 100 requests | 60 minutes | + +If a request exceeds the defined rate limit, the server will respond with: + +```json +{ + "code": 429, + "error": "Too many requests, Please try after a while!" +} +``` + +## Disabling Rate Limiting + +For self-hosters, rate limiting can be disabled if necessary. However, we **strongly recommend keeping rate limiting enabled in production environments** to prevent abuse. + +To disable rate limiting, set the following environment variable: + +```bash +RATE_LIMITING_DISABLED=1 +``` + +After making this change, restart your server to apply the new setting. diff --git a/apps/docs/lib/navigation.ts b/apps/docs/lib/navigation.ts index d8cd399b66..75f56c3e4a 100644 --- a/apps/docs/lib/navigation.ts +++ b/apps/docs/lib/navigation.ts @@ -144,6 +144,7 @@ export const navigation: NavGroup[] = [ { title: "Integrations", href: "/self-hosting/integrations" }, { title: "License", href: "/self-hosting/license" }, { title: "Cluster Setup", href: "/self-hosting/cluster-setup" }, + { title: "Rate Limiting", href: "/self-hosting/rate-limiting" }, ], }, {