mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-18 02:12:15 -05:00
27c2e8b938
[web] Add option to disable subnet rate limiting (+CE/SP Hotfix `5.2.1`) GitOrigin-RevId: 78d60c9638cede729dd93c3c2421f55b34c0dbfe
36 lines
1.4 KiB
Diff
36 lines
1.4 KiB
Diff
--- overleaf/services/web/app/src/infrastructure/RateLimiter.js
|
|
+++ overleaf/services/web/app/src/infrastructure/RateLimiter.js
|
|
@@ -39,7 +39,7 @@ class RateLimiter {
|
|
keyPrefix: `rate-limit:${name}`,
|
|
storeClient: rclient,
|
|
})
|
|
- if (opts.subnetPoints) {
|
|
+ if (opts.subnetPoints && !Settings.rateLimit?.subnetRateLimiterDisabled) {
|
|
this._subnetRateLimiter = new RateLimiterFlexible.RateLimiterRedis({
|
|
...opts,
|
|
points: opts.subnetPoints,
|
|
--- overleaf/services/web/config/settings.defaults.js
|
|
+++ overleaf/services/web/config/settings.defaults.js
|
|
@@ -777,6 +777,8 @@ module.exports = {
|
|
reloadModuleViewsOnEachRequest: process.env.NODE_ENV === 'development',
|
|
|
|
rateLimit: {
|
|
+ subnetRateLimiterDisabled:
|
|
+ process.env.SUBNET_RATE_LIMITER_DISABLED === 'true',
|
|
autoCompile: {
|
|
everyone: process.env.RATE_LIMIT_AUTO_COMPILE_EVERYONE || 100,
|
|
standard: process.env.RATE_LIMIT_AUTO_COMPILE_STANDARD || 25,
|
|
--- etc/overleaf/settings.js
|
|
+++ etc/overleaf/settings.js
|
|
@@ -212,6 +212,11 @@ const settings = {
|
|
enabled: process.env.OVERLEAF_CSP_ENABLED !== 'false',
|
|
},
|
|
|
|
+ rateLimit: {
|
|
+ subnetRateLimiterDisabled:
|
|
+ process.env.SUBNET_RATE_LIMITER_DISABLED !== 'false',
|
|
+ },
|
|
+
|
|
// These credentials are used for authenticating api requests
|
|
// between services that may need to go over public channels
|
|
httpAuthUsers,
|