diff --git a/.env.example b/.env.example index a3a5bf7cc..efee18735 100644 --- a/.env.example +++ b/.env.example @@ -199,6 +199,8 @@ ANDROID_SHA256_CERT_FINGERPRINT=AC:73:8E:DE:EB:56:EA:CC:10:87:02:A7:65:37:7B:38: ## Rack Attack configuration ## To prevent and throttle abusive requests # ENABLE_RACK_ATTACK=true +# RACK_ATTACK_IP_LIMIT=3000 +# ENABLE_RACK_ATTACK_WIDGET_API=true ## Running chatwoot as an API only server ## setting this value to true will disable the frontend dashboard endpoints diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index e28ba7dfb..4993f304b 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -46,7 +46,7 @@ class Rack::Attack # # Key: "rack::attack:#{Time.now.to_i/:period}:req/ip:#{req.ip}" - throttle('req/ip', limit: 300, period: 1.minute, &:ip) + throttle('req/ip', limit: ENV.fetch('RACK_ATTACK_LIMIT', 3000), period: 1.minute, &:ip) ###-----------------------------------------------### ###-----Authentication Related Throttling---------###