Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
P
pleroma
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 102
    • Issues 102
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 34
    • Merge Requests 34
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Pleroma
  • pleroma
  • Wiki
  • Message rewrite facility configuration (how to block instances)

Message rewrite facility configuration (how to block instances)

Last edited by Artik Banana Jun 12, 2018
Page history

The Message Rewrite Facility (MRF) is a subsystem that is implemented as a series of hooks that allows the administrator to rewrite or discard messages.

Possible uses include:

  • marking incoming messages with media from a given account or instance as sensitive
  • rejecting messages from a specific instance
  • removing/unlisting messages from the public timelines
  • removing media from messages
  • sending only public messages to a specific instance

The MRF provides user-configurable policies. The default policy is NoOpPolicy, which disables the MRF functionality. Pleroma also includes an easy to use policy called SimplePolicy which maps messages matching certain pre-defined criterion to actions built into the policy module.
It is possible to use multiple, active MRF policies at the same time.

Quarantine Instances

You have the ability to prevent from private / followers-only messages from federating with specific instances. Which means they will only get the public or unlisted messages from your instance.

If, for example, you're using MIX_ENV=prod aka using production mode, you would open your configuration file located in config/prod.secret.exs and edit or add the option under your :instance config object. Then you would specify the instance within quotes.

config :pleroma, :instance,
  [...]
  quarantined_instances: ["instance.example", "other.example"]

Using SimplePolicy

SimplePolicy is capable of handling most common admin tasks.

To use SimplePolicy, you must enable it. Do so by adding the following to your :instance config object, so that it looks like this:

config :pleroma, :instance
  [...]
  rewrite_policy: Pleroma.Web.ActivityPub.MRF.SimplePolicy

Once SimplePolicy is enabled, you can configure various groups in the :mrf_simple config object. These groups are:

  • media_removal: Servers in this group will have media stripped from incoming messages.
  • media_nsfw: Servers in this group will have the #nsfw tag and sensitive setting injected into incoming messages which contain media.
  • reject: Servers in this group will have their messages rejected.
  • federated_timeline_removal: Servers in this group will have their messages unlisted from the public timelines by flipping the to and cc fields.

Servers should be configured as lists.

Example

This example will enable SimplePolicy, block media from illegalporn.biz, mark media as NSFW from porn.biz and porn.business, reject messages from spam.com and remove messages from spam.university from the federated timeline:

config :pleroma, :instance
  rewrite_policy: Pleroma.Web.ActivityPub.MRF.SimplePolicy

config :pleroma, :mrf_simple
  media_removal: ["illegalporn.biz"],
  media_nsfw: ["porn.biz", "porn.business"],
  reject: ["spam.com"],
  federated_timeline_removal: ["spam.university"]

Use with Care

The effects of MRF policies can be very drastic. It is important to use this functionality carefully. Always try to talk to an admin before writing an MRF policy concerning their instance.

Clone repository
  • Admin tasks
  • Easy onion federation (tor)
  • Hacking pleroma: elixir, phoenix and a bit of activitypub
  • How to activate mediaproxy
  • How to add custom emoji
  • How to change the port or ip pleroma listens to
  • How to configure upstream proxy for federation
  • How to contribute
  • I2p federation
  • Installing on centos 7
  • Installing on centos or other rpm based linux distro
  • Installing on debian based distributions
  • Introduction to pleroma
  • Message rewrite facility configuration (how to block instances)
  • Pleroma only api endpoints
More Pages
×

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.