Skip to content

Moderation additions for Federails; reporting, server blocking, etc

License

Notifications You must be signed in to change notification settings

manyfold3d/federails-moderation

Repository files navigation

Federails::Moderation

A gem that provides moderation capabilities for Federails. It adds the following features:

  • Handle incoming Flag activities, normally used for reporting content to moderators
  • Block federation with particular servers

Requirements

Installation

Add the gem to your Rails application:

> bundle add "federails-moderation"

Then install the database migrations:

> bin/rails federails_moderation:install:migrations
> bin/rails db:migrate

Usage

Reports

When your application receives a Flag activitypub message, it will create a Federails::Moderation::Report record with the details.

# Find all unresolved reports
reports = Federails::Moderation::Report.where(resolution: nil)
r = reports.first

# Reports can have a comment that was sent with them:
puts r.content
# "This message is spam"

# It will be associated with the actor that sent it:
puts r.actor.at_address
# "@[email protected]"

# Deal with the report in your app, then either:
r.resolve!
# or, you can ignore it
r.ignore!

Domain Blocks

You can block domains that are abusive like so:

Federails::Moderation::DomainBlock.create(domain: "spammer.com")

Once the block is created, incoming messages from that domain, or from any actor on that domain, will be ignored. Also, outgoing messages to that domain will be dropped before being delivered.

Actors from the blocked domain aren't currently auto-removed; this may be added in the future, but for now that's left up to your application.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/manyfold3d/federails-moderation. This project is intended to be a safe, welcoming space for collaboration; everyone interacting in the project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

Support & Community

For help, join the main Federails matrix chat room.

Acknowledgements

This gem builds on top of Federails, by Manuel Tancoigne.

This gem was created as part of Manyfold, with funding from NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program.

NLnet foundation logo NGI Zero Logo

About

Moderation additions for Federails; reporting, server blocking, etc

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published