mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
SECURITY: Rate limit the creation of backups
This commit is contained in:

committed by
Loïc Guitaut

parent
272c31023d
commit
0bd64788d2
@ -34,6 +34,14 @@ class Admin::BackupsController < Admin::AdminController
|
||||
end
|
||||
|
||||
def create
|
||||
RateLimiter.new(
|
||||
current_user,
|
||||
"max-backups-per-minute",
|
||||
1,
|
||||
1.minute,
|
||||
apply_limit_to_staff: true,
|
||||
).performed!
|
||||
|
||||
opts = {
|
||||
publish_to_message_bus: true,
|
||||
with_uploads: params.fetch(:with_uploads) == "true",
|
||||
|
Reference in New Issue
Block a user