diff options
author | Mark Felder <feld@feld.me> | 2023-12-09 18:32:26 -0500 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-03-19 12:15:10 -0400 |
commit | 7dfd148ff8a4f2d349d6d6f92d788effdaab36f3 (patch) | |
tree | 881d160fc90342119a000375508b5d1b650e72e9 /lib | |
parent | f775a1931b4f5625ad61fce8fabeb089375a80ac (diff) | |
download | pleroma-7dfd148ff8a4f2d349d6d6f92d788effdaab36f3.tar.gz pleroma-7dfd148ff8a4f2d349d6d6f92d788effdaab36f3.zip |
Logger metadata for inbound federation requests
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub_controller.ex | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub_controller.ex b/lib/pleroma/web/activity_pub/activity_pub_controller.ex index e38a94966..d2b2cae0b 100644 --- a/lib/pleroma/web/activity_pub/activity_pub_controller.ex +++ b/lib/pleroma/web/activity_pub/activity_pub_controller.ex @@ -52,6 +52,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do when action in [:activity, :object] ) + plug(:log_inbox_metadata when action in [:inbox]) plug(:set_requester_reachable when action in [:inbox]) plug(:relay_active? when action in [:relay]) @@ -521,6 +522,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do conn end + defp log_inbox_metadata(conn = %{params: %{"actor" => actor, "type" => type}}, _) do + Logger.metadata(actor: actor, type: type) + conn + end + + defp log_inbox_metadata(conn, _), do: conn + def upload_media(%{assigns: %{user: %User{} = user}} = conn, %{"file" => file} = data) do with {:ok, object} <- ActivityPub.upload( |