aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2019-08-22 21:01:28 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2019-08-22 21:01:28 +0300
commit7101ba1a21ded292ba057f9aadec1756914b45e0 (patch)
tree6ee1e10eba5b579d7e469ac8a340bb496f564411
parent256ff09aa8068166a9f83e3159f060fd4598af76 (diff)
parent0e50e9e4fa5a5d33d36f4226e1d32a00bf53fc72 (diff)
downloadpleroma-7101ba1a21ded292ba057f9aadec1756914b45e0.tar.gz
Merge remote-tracking branch 'remotes/upstream/develop' into 1149-oban-job-queue
-rw-r--r--config/config.exs3
-rw-r--r--config/test.exs3
-rw-r--r--lib/pleroma/web/ostatus/ostatus_controller.ex5
-rw-r--r--test/user_test.exs3
-rw-r--r--test/web/activity_pub/transmogrifier_test.exs2
-rw-r--r--test/web/mastodon_api/mastodon_api_controller/update_credentials_test.exs1
6 files changed, 15 insertions, 2 deletions
diff --git a/config/config.exs b/config/config.exs
index b347df7e8..9794997d9 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -573,7 +573,8 @@ config :pleroma, :rate_limit,
statuses_actions: {10_000, 15},
status_id_action: {60_000, 3},
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
# of this file so it overrides the configuration defined above.
diff --git a/config/test.exs b/config/test.exs
index f897b5d48..a0fa67516 100644
--- a/config/test.exs
+++ b/config/test.exs
@@ -75,7 +75,8 @@ config :pleroma, Pleroma.ScheduledActivity,
config :pleroma, :rate_limit,
search: [{1000, 30}, {1000, 30}],
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"
diff --git a/lib/pleroma/web/ostatus/ostatus_controller.ex b/lib/pleroma/web/ostatus/ostatus_controller.ex
index c70063b84..fdba0f77f 100644
--- a/lib/pleroma/web/ostatus/ostatus_controller.ex
+++ b/lib/pleroma/web/ostatus/ostatus_controller.ex
@@ -22,6 +22,11 @@ defmodule Pleroma.Web.OStatus.OStatusController do
alias Pleroma.Web.Router
alias Pleroma.Web.XML
+ plug(
+ Pleroma.Plugs.RateLimiter,
+ {:ap_routes, params: ["uuid"]} when action in [:object, :activity]
+ )
+
plug(Pleroma.Web.FederatingPlug when action in [:salmon_incoming])
plug(
diff --git a/test/user_test.exs b/test/user_test.exs
index 3185cc1fb..733467398 100644
--- a/test/user_test.exs
+++ b/test/user_test.exs
@@ -543,6 +543,9 @@ defmodule Pleroma.UserTest do
avatar: %{some: "avatar"}
}
+ clear_config([:instance, :user_bio_length])
+ clear_config([:instance, :user_name_length])
+
test "it confirms validity" do
cs = User.remote_user_creation(@valid_remote)
assert cs.valid?
diff --git a/test/web/activity_pub/transmogrifier_test.exs b/test/web/activity_pub/transmogrifier_test.exs
index 86605c336..42f9672d0 100644
--- a/test/web/activity_pub/transmogrifier_test.exs
+++ b/test/web/activity_pub/transmogrifier_test.exs
@@ -25,6 +25,8 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
:ok
end
+ clear_config([:instance, :max_remote_account_fields])
+
describe "handle_incoming" do
test "it ignores an incoming notice if we already have it" do
activity = insert(:note_activity)
diff --git a/test/web/mastodon_api/mastodon_api_controller/update_credentials_test.exs b/test/web/mastodon_api/mastodon_api_controller/update_credentials_test.exs
index dd443495b..87ee82050 100644
--- a/test/web/mastodon_api/mastodon_api_controller/update_credentials_test.exs
+++ b/test/web/mastodon_api/mastodon_api_controller/update_credentials_test.exs
@@ -9,6 +9,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController.UpdateCredentialsTest do
use Pleroma.Web.ConnCase
import Pleroma.Factory
+ clear_config([:instance, :max_account_fields])
describe "updating credentials" do
test "sets user settings in a generic way", %{conn: conn} do