Commit Graph

243 Commits

Author SHA1 Message Date
FloatingGhost 8c208f751d Fix filtering out incorrect addresses
ci/woodpecker/push/woodpecker Pipeline is pending Details
2023-05-23 13:46:25 +01:00
FloatingGhost 037f881187 Fix create processing in direct message disabled 2023-05-23 13:16:20 +01:00
FloatingGhost ab34680554 switch to using an enum system for DM acceptance 2023-05-23 10:29:08 +01:00
FloatingGhost d310f99d6a Add MRFs for direct message manipulation 2023-05-22 23:53:44 +01:00
FloatingGhost 9d9c26b833 Ensure Gun is Gone 2022-12-11 19:26:21 +00:00
FloatingGhost 68894089e8 Do not fetch anything from blocked instances
ci/woodpecker/push/woodpecker Pipeline is pending Details
2022-12-10 00:09:45 +00:00
FloatingGhost 9db4c2429f Remove FollowBotPolicy 2022-12-09 19:59:27 +00:00
FloatingGhost 6f83ae27aa extend reject MRF to check if originating instance is blocked 2022-12-09 19:57:29 +00:00
ilja 1f863f0a36 Fix MRF policies to also work with Update
ci/woodpecker/pr/woodpecker Pipeline failed Details
Objects who got updated would just pass through several of the MRF policies, undoing moderation in some situations.
In the relevant cases we now check not only for Create activities, but also Update activities.

I checked which ones checked explicitly on type Create using `grep '"type" => "Create"' lib/pleroma/web/activity_pub/mrf/*`.

The following from that list have not been changed:
* lib/pleroma/web/activity_pub/mrf/follow_bot_policy.ex
    * Not relevant for moderation
* lib/pleroma/web/activity_pub/mrf/keyword_policy.ex
    * Already had a test for Update
* lib/pleroma/web/activity_pub/mrf/object_age_policy.ex
    * In practice only relevant when fetching old objects (e.g. through Like or Announce). These are always wrapped in a Create.
* lib/pleroma/web/activity_pub/mrf/reject_non_public.ex
    * We don't allow changing scope with Update, so not relevant here
2022-12-08 23:22:05 +01:00
ilja ce517ff4e5 Fix tagpolicy to also work with Update
ci/woodpecker/pr/woodpecker Pipeline is pending Details
Objects who got updated would just pass the TagPolicy, undoing the moderation that was set in place for the Actor.
Now we check not only for Create activities, but also Update activities.
2022-12-08 21:53:42 +01:00
floatingghost 2641dcdd15 Post editing (#202)
ci/woodpecker/push/woodpecker Pipeline was successful Details
Rebased from #103

Co-authored-by: Tusooa Zhu <tusooa@kazv.moe>
Co-authored-by: FloatingGhost <hannah@coffee-and-dreams.uk>
Reviewed-on: #202
2022-09-06 19:24:02 +00:00
FloatingGhost 85137f591f Add ability to obfuscate domains in MRF transparency
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
2022-08-27 11:57:57 +01:00
floatingghost 1419eee5df Quote posting (#113)
ci/woodpecker/push/docs Pipeline is pending Details
ci/woodpecker/push/release Pipeline is pending Details
ci/woodpecker/push/test Pipeline is pending Details
Reviewed-on: #113
2022-07-25 16:30:06 +00:00
floatingghost 364b6969eb Use finch everywhere (#33)
ci/woodpecker/push/lint Pipeline failed Details
ci/woodpecker/push/test unknown status Details
ci/woodpecker/push/release Pipeline was successful Details
Reviewed-on: #33
2022-07-04 16:30:38 +00:00
Hélène 8f140deb8f StealEmojiPolicy: fix String rejected_shortcodes
* rejected_shortcodes is defined as a list of strings in the
  configuration description. As such, database-based configuration was
  led to handle those settings as strings, and not as the actually
  expected type, Regex.
* This caused each message passing through this MRF, if a rejected
  shortcode was set and the emoji did not exist already on the instance,
  to fail federating, as an exception was raised, swiftly caught and
  mostly silenced.
* This commit fixes the issue by introducing new behavior: strings are
  now handled as perfect matches for an emoji shortcode (meaning that if
  the emoji-to-be-pulled's shortcode is in the blacklist, it will be
  rejected), while still supporting Regex types as before.
2022-06-29 20:47:45 +01:00
Ilja 661d0ba481 Also use actor_type to determine if an account is a bot in antiFollowbotPolicy 2022-06-29 20:47:44 +01:00
FloatingGhost 6e1d9c63da allow %{source} dict in no_empty
ci/woodpecker/push/release Pipeline was successful Details
ci/woodpecker/tag/lint Pipeline was successful Details
ci/woodpecker/push/lint Pipeline failed Details
ci/woodpecker/push/test unknown status Details
ci/woodpecker/tag/test Pipeline was successful Details
ci/woodpecker/tag/release Pipeline was successful Details
2022-06-14 17:41:25 +01:00
Haelwenn (lanodan) Monnier a17910a6c6
CI: Bump lint stage to elixir-1.12
Elixir 1.12 changed formatting rules, this allows to avoid having to rollback to run `mix format`
2021-10-06 08:11:05 +02:00
Sam Therapy b901b73057
Add Admin-FE menu for StealEmojiPolicy 2021-08-14 11:08:39 -05:00
Haelwenn (lanodan) Monnier c64eae40a2
ObjectAgePolicy: Fix pattern matching on published 2021-08-10 07:41:06 +02:00
Egor Kislitsyn ad09bdb376
Improve readability 2021-08-06 07:59:54 +02:00
Ilja b0926a71b2
Make transparency_exclusions use tuples in admin-fe
* Make it use tuples
* I also changed the keys for key_placeholder and value_placeholder to use snake_case instead of camelCase
2021-08-06 07:59:53 +02:00
Ilja f4028c908c
Add key- and valuePlaceholders for quarantined_instances and mrf_simple
* I also added for keywordpolicy as well now. It was done in the admin-fe, but is better to be done here
* I also added comments to explain why we did the _info keys (backwards compatibility)
2021-08-06 07:59:53 +02:00
Ilja 47fc57bbcc
Change what nodeinfo returns without breaking backwards compatibility
* Only for SimplePolicy for now
* I added an extra mrf_simple_info key that has an object as value. The object contains only relevant extra info
2021-08-06 07:59:53 +02:00
Ilja 7fdc3cde06
Return maps in node_info
It's easiest (and imo most proper) to use tuples {"instance, "reason"} in BE,
but for FE maps like %{"instance": "instance", "reason", "reason"} are better.
I changed it so that node_info returns maps now for simple_policy and quarantined instances.
2021-08-06 07:59:53 +02:00
Ilja dfeb3862da
config :mrf, :transparency_exclusions works with tumples now 2021-08-06 07:59:52 +02:00
Ilja 27fe7b0274
Make quarentine work with list of tuples instead of strings 2021-08-06 07:59:52 +02:00
Ilja 4ba0beb60c
Make mrfSimple work with tuples
* Changed SimplePolicy
* I also grepped in test/ for ':mrf_simple' to see what other things could be affected
2021-08-06 07:58:58 +02:00
Alex Gleason fe4c4a7178
MRF: create MRF.Policy behaviour separate from MRF module
Speeds up recompilation by reducing compile-time deps
2021-06-07 14:22:08 -05:00
Alex Gleason f2134e605b
Merge remote-tracking branch 'pleroma/develop' into cycles-base-url 2021-05-31 16:49:46 -05:00
Alex Gleason 51a9f97e87
Deprecate Pleroma.Web.base_url/0
Use Pleroma.Web.Endpoint.url/0 directly instead. Reduces compiler cycles.
2021-05-31 16:48:03 -05:00
Alex Gleason 926a233cc4
Merge remote-tracking branch 'upstream/develop' into simplepolicy-announce-leak 2021-04-30 14:21:17 -05:00
Alex Gleason c16c7fdb87
SimplePolicy: filter string Objects 2021-04-30 14:20:54 -05:00
Alex Gleason 3d742c3c1a
SimplePolicy: filter nested objects 2021-04-30 14:20:37 -05:00
Mark Felder 03f38ac4eb Prefer FollowBot naming convention vs Followbot 2021-03-30 11:10:44 -05:00
Mark Felder 4796df0bc3 Remove Task.async as it is broken here and probably a premature optimization anyway 2021-03-30 11:10:44 -05:00
Mark Felder 778010ef8e Do not try to follow local users. Their posts are already available locally on the instance. 2021-03-30 11:10:44 -05:00
Mark Felder 86182ef8e4 Change module name to FollowbotPolicy 2021-03-30 11:10:44 -05:00
Mark Felder f0dcc1ca69 Lint 2021-03-30 11:10:44 -05:00
Mark Felder a176914c73 Better checking of previous follow request attempts 2021-03-30 11:10:44 -05:00
Mark Felder 3989ec508c Prevent duplicates from being processed 2021-03-30 11:10:44 -05:00
Mark Felder 3949cfdc24 Make the followbot only dispatch follow requests once per 30 day period 2021-03-30 11:10:43 -05:00
Mark Felder e78738173a Enforce that the followbot must be marked as a bot. 2021-03-30 11:10:43 -05:00
Mark Felder fba770b3ea Try to handle misconfiguration scenarios gracefully 2021-03-30 11:10:03 -05:00
Mark Felder 8b81d62227 Upstream original followbot implementation 2021-03-30 11:10:03 -05:00
Haelwenn (lanodan) Monnier 3bc7d12271
Remove sensitive-property setting #nsfw, create HashtagPolicy 2021-02-27 21:26:17 +01:00
Ivan Tashkinov 5992382cf8 Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework
# Conflicts:
#	CHANGELOG.md
#	lib/mix/tasks/pleroma/database.ex
#	lib/pleroma/web/templates/feed/feed/_activity.rss.eex
2021-02-11 19:31:57 +03:00
Mark Felder 55a13fc360 MRF NoEmptyPolicy: Deny posts from local users if there is no content or only mentions.
Helps prevent accidental button mashes from submitting incomplete posts
2021-02-08 15:32:47 -06:00
Ivan Tashkinov 2634a16b4c Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework
# Conflicts:
#	CHANGELOG.md
2021-01-21 20:20:35 +03:00
Alexander Strizhakov 6d48144a9d
use proper naming
for MediaProxyWarmingPolicy in ConcurrentLimiter
2021-01-21 09:50:18 +03:00