Conversation
Notices
-
meso (meso@asbestos.cafe)'s status on Saturday, 20-May-2023 20:39:00 JST meso @mint do you know how to filter accounts in an MRF by age? -
(mint@ryona.agency)'s status on Saturday, 20-May-2023 20:38:59 JST @meso @p made one for :danielstevens: to filter newly registered accounts on KFcc, ask him for a copy. -
Moon (moon@shitposter.club)'s status on Saturday, 20-May-2023 20:44:23 JST Moon defmodule Site.StopTryingToKillPawoo do #require Logger @behaviour Pleroma.Web.ActivityPub.MRF @impl true def filter( %{ "type" => "Like", "actor" => actor, } = message ) do actor_info = URI.parse(actor) if(actor_info.host == "pawoo.net") do user = Pleroma.User.get_cached_by_ap_id(actor) if((user.note_count < 3) && ((user.follower_count == 0) || (Timex.to_unix(user.inserted_at) < 1681228543))) do {:reject, "lol"} else {:ok, message} end else {:ok, message} end end @impl true def filter(object), do: {:ok, object} @impl true def describe, do: {:ok, %{}} end here’s an example of doing it.
likes this. -
Moon (moon@shitposter.club)'s status on Saturday, 20-May-2023 20:44:24 JST Moon @meso @mint I'll have an MRF to deal with this shortly. -
Zero :zt_think: :artix: (zero@strelizia.net)'s status on Saturday, 20-May-2023 22:40:41 JST Zero :zt_think: :artix: @meso @mint @Moon something like that maybe? Uuntested, but no compilation errors. I used a week, maybe that’s too much, easy to change tho.
defmodule Pleroma.Web.ActivityPub.MRF.NoNewAccounts do @behaviour Pleroma.Web.ActivityPub.MRF.Policy #require Logger @impl true def filter( %{ "type" => "Create", "actor" => actor } = message ) do _actor_info = URI.parse(actor) user = Pleroma.User.get_cached_by_ap_id(actor) old_enough = Timex.shift(NaiveDateTime.utc_now(), days: -7) if( # _actor_info.host == "pawoo.net" && Timex.to_unix(user.inserted_at) >= Timex.to_unix(old_enough) ) do #Logger.warn("[NoNewAccounts] Rejecting post from fresh account: #{inspect(user)}!") {:reject, "[NoNewAccounts] Rejecting post from fresh account!"} else {:ok, message} end end @impl true def filter(object), do: {:ok, object} @impl true def describe, do: {:ok, %{}} end likes this. -
meso (meso@asbestos.cafe)'s status on Saturday, 20-May-2023 22:40:42 JST meso @Moon @mint shouldnt it be checking if it's younger than that? -
Moon (moon@shitposter.club)'s status on Saturday, 20-May-2023 22:40:43 JST Moon @meso @mint yeah, modify as needed -
Moon (moon@shitposter.club)'s status on Saturday, 20-May-2023 22:40:44 JST Moon @meso @mint it's going to drop the posts completely. -
meso (meso@asbestos.cafe)'s status on Saturday, 20-May-2023 22:40:44 JST meso @Moon @mint >(Timex.to_unix(user.inserted_at) < 1681228543)
doesn't this make it check if it's older than that unix timestamp or am I just stupid? -
meso (meso@asbestos.cafe)'s status on Saturday, 20-May-2023 22:40:45 JST meso @Moon @mint make it strip images as well if thats possible -
Zero :zt_think: :artix: (zero@strelizia.net)'s status on Sunday, 21-May-2023 01:03:21 JST Zero :zt_think: :artix: @meso @Moon @mint eugh i suppose it’s important to check if the user is remote on this one :02_derp2:
defmodule Pleroma.Web.ActivityPub.MRF.NoNewAccounts do @behaviour Pleroma.Web.ActivityPub.MRF.Policy # require Logger alias Pleroma.Config alias Pleroma.User defp is_remote?(host) do my_host = Config.get([Pleroma.Web.Endpoint, :url, :host]) my_host != host end @impl true def filter( %{ "type" => "Create", "actor" => actor } = message ) do actor_info = URI.parse(actor) user = User.get_cached_by_ap_id(actor) old_enough = Timex.shift(NaiveDateTime.utc_now(), days: -7) if( # actor_info.host == "pawoo.net" && is_remote?(actor_info.host) && Timex.to_unix(user.inserted_at) >= Timex.to_unix(old_enough) ) do # Logger.warn("[NoNewAccounts] Rejecting post from fresh account: #{user.nickname}!") {:reject, "[NoNewAccounts] Rejecting post from fresh account!"} else {:ok, message} end end @impl true def filter(object), do: {:ok, object} @impl true def describe, do: {:ok, %{}} end likes this. -
pistolero :thispersondoesnotexist: (p@freespeechextremist.com)'s status on Sunday, 21-May-2023 02:35:27 JST pistolero :thispersondoesnotexist: @mint @meso Yeah, it's pretty trivial. base64'd blob below. He tweaked it so it doesn't check for KF. (HFS, it is easier to just ssh to the server than to navigate Gleason's six layers of cloudfed.)
ZGVmbW9kdWxlIFBsZXJvbWEuV2ViLkFjdGl2aXR5UHViLk1SRi5Ob05ld0tGc0Zvck5vdyBkbwoJ
YWxpYXMgUGxlcm9tYS5Vc2VyCglAYmVoYXZpb3VyIFBsZXJvbWEuV2ViLkFjdGl2aXR5UHViLk1S
Ri5Qb2xpY3kKCglAaW1wbCB0cnVlCglkZWYgZmlsdGVyKAoJCSV7CgkJCSJ0eXBlIiA9PiAiQ3Jl
YXRlIiwKCQkJImFjdG9yIiA9PiBhY3RvciwKCQl9ID0gbWVzc2FnZQoJKSBkbwoJCWlmIFN0cmlu
Zy5zdGFydHNfd2l0aD8oYWN0b3IsICJodHRwczovL2tpd2lmYXJtcy5jYy8iKSBkbwoJCQl1dCA9
IFRpbWV4LnRvX3VuaXgoRGF0ZVRpbWUudXRjX25vdykKCQkJYXQgPSBUaW1leC50b191bml4KFVz
ZXIuZ2V0X2NhY2hlZF9ieV9hcF9pZChhY3RvcikpCgkJCWlmIHV0LWF0IDwgNyoyNCo2MCo2MCBk
bwoJCQkJezplcnJvciwgIkNSVU5LIEZJWCBZT1VSIFNQQU0ifQoJCQllbHNlCgkJCQl7Om9rLCBt
ZXNzYWdlfQoJCQllbmQKCQllbHNlCgkJCXs6b2ssIG1lc3NhZ2V9CgkJZW5kCgllbmQKCUBpbXBs
IHRydWUKCWRlZiBmaWx0ZXIobWVzc2FnZSksIGRvOiB7Om9rLCBtZXNzYWdlfQoKCUBpbXBsIHRy
dWUKCWRlZiBkZXNjcmliZSwgZG86IHs6b2ssICV7fX0KZW5kCg== likes this.
-