MRF_keyword replace should not change usernames or domains.
Environment
- Installation type OTP on Yunohost:
- Pleroma version 2.5.5:
- Operating system: Debian
- PostgreSQL version: 13.14
Bug description
The current mrf_keyword, replace:
policy causes federation issues because it rewrites usernames and domains.
This forbids local users from interacting with remote users or instances that contain words which would match in this policy. It does not stop the remote users from being able to post to these local users. So, it basically shadowbans local users from certain remote instances. This would almost never be desired. If domains and/or usernames want to be rejected, that should be left to other policies.
One solution might be to superimpose an additional regex over the admin-provided regex in the mrf policy.
/((.*)(@)(.*))?dog((.*)(@)(.*))?/
dog
would be replaced with whatever regex is given in the policy. Then some additional logic would need to check whether groups 3 or 7 contained @
.
Here is the obligatory regex101 for testing
Notice that my suggestion would continue to overwrite URL's. I think this would be wise. Admins may want to use this policy to redirect certain url's to other sites. For example redirecting youtube or twitter to other more private front-ends like invidious or nitter.
Consider the following
I think this deserves a priority because content moderation is one of pleroma's greatest strengths. By moderating content over users/instances we help keep the fediverse healthy while enabling admins to control the content that is pulled into their instance. No other project that I know of is prioritizing this currently.
As always, TIA and long live pleroma-tan.