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

Built-in block list ? #173

Open
Coriou opened this issue Nov 4, 2019 · 4 comments
Open

Built-in block list ? #173

Coriou opened this issue Nov 4, 2019 · 4 comments

Comments

@Coriou
Copy link
Contributor

Coriou commented Nov 4, 2019

I think it'd be great to have sensible block list defaults. I've looked at the block list implementation in torrent-stream which is kinda meh.

I think it'd make sense to implement the block list at this application's level. I've prototyped an implementation using blocklist-ipsets which works nicely. It introduces no external dependencies and uses torrent-stream's "block" feature.

What I'm not sure about though is should we pull the IP list at each engine load (potentially overkill really) or do we have a script loading the IPs periodically to block and saving them to a file locally ?

Thoughts ?

Here's a demo implementation

@asapach
Copy link
Owner

asapach commented Nov 5, 2019

I'd rather keep it simple and let the users provide their own blocklist file. This could be done by convention: e.g. on start we look for the file called ~/.config/peerflix-server/blocklist; if it exists we parse it and pass to torrent-stream. Optionally we could watch for the file changes and update as necessary, if there is an external process which updates the file.

@Coriou
Copy link
Contributor Author

Coriou commented Nov 5, 2019

Sounds good to me ! I'll work on it, maybe tomorrow, should be easy enough.

Should we ship a default blocklist ?

@asapach
Copy link
Owner

asapach commented Nov 5, 2019

Should we ship a default blocklist ?

Only if there is one which is relatively static and small.

@Coriou
Copy link
Contributor Author

Coriou commented Nov 5, 2019

Thought about a way of doing this, and all are really bad:

  • Most blocklists don't come as a list of IPs, but usually as ranges so the users would first need to parse those lists into an array of unique IPs

  • The IPs would need to be loaded one by one, potentially loading millions of IPs for each torrent-stream engine

I think a better way would be to implement it at the torrent-stream level actually ... I've mentioned it there, let's see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants