Skip to content

Commit

Permalink
fix: Application not loading after setting RACK_ATTACK_LIMIT ENV vari…
Browse files Browse the repository at this point in the history
…able [CW-2587] (#8044)
  • Loading branch information
mazenkhalil committed Oct 4, 2023
1 parent b71a580 commit 5c9ab21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env.example
Expand Up @@ -199,7 +199,7 @@ 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
# RACK_ATTACK_LIMIT=300
# ENABLE_RACK_ATTACK_WIDGET_API=true

## Running chatwoot as an API only server
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/rack_attack.rb
Expand Up @@ -46,7 +46,7 @@ def path_without_extentions
#
# Key: "rack::attack:#{Time.now.to_i/:period}:req/ip:#{req.ip}"

throttle('req/ip', limit: ENV.fetch('RACK_ATTACK_LIMIT', 3000), period: 1.minute, &:ip)
throttle('req/ip', limit: ENV.fetch('RACK_ATTACK_LIMIT', '3000').to_i, period: 1.minute, &:ip)

###-----------------------------------------------###
###-----Authentication Related Throttling---------###
Expand Down

0 comments on commit 5c9ab21

Please sign in to comment.