From 16dcd26216eeb11b86120efe2ced628a28a0a215 Mon Sep 17 00:00:00 2001 From: Dan Jenkins Date: Mon, 20 Oct 2025 15:58:34 +0100 Subject: [PATCH] allow disabling of all rate limits (#505) --- README.md | 1 + app.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 07f9a25..5679e20 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Configuration is provided via environment variables: |K8S_FEATURE_SERVER_SERVICE_PORT| feature server port(required for K8S) |no| |JAMBONZ_RECORD_WS_USERNAME| recording websocket username|no| |JAMBONZ_RECORD_WS_PASSWORD| recording websocket password|no| +|DISABLE_RATE_LIMITS| disable rate limiting|no #### Database dependency A mysql database is used to store long-lived objects such as Accounts, Applications, etc. To create the database schema, use or review the scripts in the 'db' folder, particularly: diff --git a/app.js b/app.js index a2c1c86..c39cfcb 100644 --- a/app.js +++ b/app.js @@ -170,7 +170,12 @@ if (process.env.JAMBONES_TRUST_PROXY) { }); } } -app.use(limiter); + +const disableRateLimit = process.env.DISABLE_RATE_LIMITS === 'true' || process.env.DISABLE_RATE_LIMITS === '1'; + +if (!disableRateLimit) { + app.use(limiter); +} app.use(helmet()); app.use(helmet.hidePoweredBy()); app.use(nocache());