mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2025-12-19 05:47:46 +00:00
allow disabling of all rate limits (#505)
This commit is contained in:
@@ -35,6 +35,7 @@ Configuration is provided via environment variables:
|
|||||||
|K8S_FEATURE_SERVER_SERVICE_PORT| feature server port(required for K8S) |no|
|
|K8S_FEATURE_SERVER_SERVICE_PORT| feature server port(required for K8S) |no|
|
||||||
|JAMBONZ_RECORD_WS_USERNAME| recording websocket username|no|
|
|JAMBONZ_RECORD_WS_USERNAME| recording websocket username|no|
|
||||||
|JAMBONZ_RECORD_WS_PASSWORD| recording websocket password|no|
|
|JAMBONZ_RECORD_WS_PASSWORD| recording websocket password|no|
|
||||||
|
|DISABLE_RATE_LIMITS| disable rate limiting|no
|
||||||
|
|
||||||
#### Database dependency
|
#### 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:
|
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:
|
||||||
|
|||||||
5
app.js
5
app.js
@@ -170,7 +170,12 @@ if (process.env.JAMBONES_TRUST_PROXY) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const disableRateLimit = process.env.DISABLE_RATE_LIMITS === 'true' || process.env.DISABLE_RATE_LIMITS === '1';
|
||||||
|
|
||||||
|
if (!disableRateLimit) {
|
||||||
app.use(limiter);
|
app.use(limiter);
|
||||||
|
}
|
||||||
app.use(helmet());
|
app.use(helmet());
|
||||||
app.use(helmet.hidePoweredBy());
|
app.use(helmet.hidePoweredBy());
|
||||||
app.use(nocache());
|
app.use(nocache());
|
||||||
|
|||||||
Reference in New Issue
Block a user