feat: add support for configuring MRF

This commit adds support for allowing instances
owners/admins to configure the simple
Message Rewrite Facility (MRF) policy with their
ansible-playbook configuration. With this they can
reject/restrict messages from a list of specified
instances.

Further documentation:
https://docs.pleroma.social/mrf.html#content

This resolves dananglin/pleroma-ansible-playbook#4
This commit is contained in:
Dan Anglin 2020-02-25 19:32:42 +00:00
parent e7ec293e75
commit 4749bf323e
Signed by: dananglin
GPG key ID: 0C1D44CFBEE68638
2 changed files with 36 additions and 1 deletions

View file

@ -14,6 +14,13 @@ pleroma_defaults:
remotePostRetentionDays: 90
logLevel: info
federating: "true"
mrf:
simplePolicy:
reject: []
federatedTimelineRemoval: []
mediaRemoval: []
mediaNsfw: []
reportRemoval: []
frontend:
background: ""
themes:

View file

@ -24,7 +24,8 @@ config :pleroma, :instance,
healthcheck: {{ pleroma.config.healthCheck }},
remote_post_retention_days: {{ pleroma.config.remotePostRetentionDays }},
dynamic_configuration: {{ pleroma.config.dynamicConfiguration }},
federating: {{ pleroma.config.federating }}
federating: {{ pleroma.config.federating }},
rewrite_policy: [Pleroma.Web.ActivityPub.MRF.SimplePolicy]
config :pleroma, :media_proxy,
enabled: false,
@ -82,3 +83,30 @@ config :pleroma, :frontend_configurations,
{% endif %}
theme: "{{ pleroma.config.frontend.themes.default }}"
}
config :pleroma, :mrf_simple,
reject: [
{% for item in pleroma.config.mrf.simplePolicy.reject %}
"{{ item }}"{{ "," if not loop.last else "" }}
{% endfor %}
],
federated_timeline_removal: [
{% for item in pleroma.config.mrf.simplePolicy.federatedTimelineRemoval %}
"{{ item }}"{{ "," if not loop.last else "" }}
{% endfor %}
],
media_removal: [
{% for item in pleroma.config.mrf.simplePolicy.mediaRemoval %}
"{{ item }}"{{ "," if not loop.last else "" }}
{% endfor %}
],
media_nsfw: [
{% for item in pleroma.config.mrf.simplePolicy.mediaNsfw %}
"{{ item }}"{{ "," if not loop.last else "" }}
{% endfor %}
],
report_removal: [
{% for item in pleroma.config.mrf.simplePolicy.reportRemoval %}
"{{ item }}"{{ "," if not loop.last else "" }}
{% endfor %}
]