Add :ap_routes rate limit

This commit is contained in:
Egor Kislitsyn 2019-08-20 22:10:36 +07:00
parent 10696ce2ee
commit 8d899d6197
3 changed files with 6 additions and 2 deletions

View file

@ -548,7 +548,8 @@ config :pleroma, :rate_limit,
statuses_actions: {10_000, 15}, statuses_actions: {10_000, 15},
status_id_action: {60_000, 3}, status_id_action: {60_000, 3},
password_reset: {1_800_000, 5}, password_reset: {1_800_000, 5},
account_confirmation_resend: {8_640_000, 5} account_confirmation_resend: {8_640_000, 5},
ap_routes: {60_000, 15}
# Import environment specific config. This must remain at the bottom # Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above. # of this file so it overrides the configuration defined above.

View file

@ -71,7 +71,8 @@ config :pleroma, Pleroma.ScheduledActivity,
config :pleroma, :rate_limit, config :pleroma, :rate_limit,
search: [{1000, 30}, {1000, 30}], search: [{1000, 30}, {1000, 30}],
app_account_creation: {10_000, 5}, app_account_creation: {10_000, 5},
password_reset: {1000, 30} password_reset: {1000, 30},
ap_routes: nil
config :pleroma, :http_security, report_uri: "https://endpoint.com" config :pleroma, :http_security, report_uri: "https://endpoint.com"

View file

@ -22,6 +22,8 @@ defmodule Pleroma.Web.OStatus.OStatusController do
alias Pleroma.Web.Router alias Pleroma.Web.Router
alias Pleroma.Web.XML alias Pleroma.Web.XML
plug(Pleroma.Plugs.RateLimiter, :ap_routes when action in [:object, :activity])
plug(Pleroma.Web.FederatingPlug when action in [:salmon_incoming]) plug(Pleroma.Web.FederatingPlug when action in [:salmon_incoming])
plug( plug(