Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for instance banlist #161

Merged
merged 5 commits into from
Sep 2, 2024
Merged

Conversation

bentasker
Copy link
Contributor

There are a lot of potentially undesirable instances in the fediverse, including some known for

  • carrying content that's illegal
  • running harassment campaigns against those who catch their attention

Users probably aren't going to want to show up in the logs of these instances or receive copies of their content.

This PR allows the user to specify a list of instances which FF should never connect to

find_posts.py \
--instance-blocklist "bad.example.com, verybad.example.com , badness.example"  \
--home-timeline-length 10

The list can also be exposed via env var instead:

export FF_INSTANCE_BLOCKLIST="bad.example.com,verybad.example.com,badness.example"

(it doesn't matter whether there are spaces around commas, excess whitespace will be stripped)

Or in the config file

{
    "instance-blocklist":"jsond-list,foo.bar"
    "home-timeline-length": 200,
}

When a URL matches the blocklist, the following exception will be thrown/logged

Connecting to {parsed_uri.netloc} is prohibited by the configured blocklist

@bentasker
Copy link
Contributor Author

Note: although not implemented here you could probably expand this to support fetching a centralised blocklist and merging that in.

That would open up two possibilities:

  • You could host an in-repo list of instances that have asked you to opt them out
  • Admin co-operatives could build and host a shared list of blocked instances (much like already happens with fediblocks)

(not that either are without their own issues)

@nanos
Copy link
Owner

nanos commented Aug 18, 2024

This is pretty cool. Thanks!

I’ll merge it after my holiday.

The test needed the new attribute adding
@bentasker
Copy link
Contributor Author

No hurry, enjoy your break :)

@nanos nanos merged commit fe6ce1a into nanos:main Sep 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants