forked from mirrors/catstodon
Make rate limits even less strict
This commit is contained in:
parent
a2383b89e2
commit
a6d7063be9
2 changed files with 6 additions and 6 deletions
|
@ -11,7 +11,7 @@ class RateLimiter
|
|||
|
||||
statuses: {
|
||||
limit: 300,
|
||||
period: 1.hours.freeze,
|
||||
period: 1.hour.freeze,
|
||||
}.freeze,
|
||||
|
||||
reports: {
|
||||
|
|
|
@ -46,7 +46,7 @@ class Rack::Attack
|
|||
IpBlock.blocked?(req.remote_ip)
|
||||
end
|
||||
|
||||
throttle('throttle_authenticated_api', limit: 300, period: 5.minutes) do |req|
|
||||
throttle('throttle_authenticated_api', limit: 600, period: 5.minutes) do |req|
|
||||
req.authenticated_user_id if req.api_request?
|
||||
end
|
||||
|
||||
|
@ -54,11 +54,11 @@ class Rack::Attack
|
|||
req.remote_ip if req.api_request? && req.unauthenticated?
|
||||
end
|
||||
|
||||
throttle('throttle_api_media', limit: 30, period: 30.minutes) do |req|
|
||||
throttle('throttle_api_media', limit: 100, period: 30.minutes) do |req|
|
||||
req.authenticated_user_id if req.post? && req.path.match?('^/api/v\d+/media')
|
||||
end
|
||||
|
||||
throttle('throttle_media_proxy', limit: 30, period: 10.minutes) do |req|
|
||||
throttle('throttle_media_proxy', limit: 200, period: 10.minutes) do |req|
|
||||
req.remote_ip if req.path.start_with?('/media_proxy')
|
||||
end
|
||||
|
||||
|
@ -66,7 +66,7 @@ class Rack::Attack
|
|||
req.remote_ip if req.post? && req.path == '/api/v1/accounts'
|
||||
end
|
||||
|
||||
throttle('throttle_authenticated_paging', limit: 300, period: 15.minutes) do |req|
|
||||
throttle('throttle_authenticated_paging', limit: 1000, period: 15.minutes) do |req|
|
||||
req.authenticated_user_id if req.paging_request?
|
||||
end
|
||||
|
||||
|
@ -77,7 +77,7 @@ class Rack::Attack
|
|||
API_DELETE_REBLOG_REGEX = /\A\/api\/v1\/statuses\/[\d]+\/unreblog/.freeze
|
||||
API_DELETE_STATUS_REGEX = /\A\/api\/v1\/statuses\/[\d]+/.freeze
|
||||
|
||||
throttle('throttle_api_delete', limit: 30, period: 30.minutes) do |req|
|
||||
throttle('throttle_api_delete', limit: 30, period: 5.minutes) do |req|
|
||||
req.authenticated_user_id if (req.post? && req.path.match?(API_DELETE_REBLOG_REGEX)) || (req.delete? && req.path.match?(API_DELETE_STATUS_REGEX))
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue