[GH-ISSUE #173] Built-in block list ? #140

Open
opened 2026-02-25 20:32:33 +03:00 by kerem · 4 comments
Owner

Originally created by @Coriou on GitHub (Nov 4, 2019).
Original GitHub issue: https://github.com/asapach/peerflix-server/issues/173

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

Originally created by @Coriou on GitHub (Nov 4, 2019). Original GitHub issue: https://github.com/asapach/peerflix-server/issues/173 I think it'd be great to have sensible block list defaults. I've looked at the block list implementation in [torrent-stream](https://github.com/mafintosh/torrent-stream/blob/master/index.js#L118) 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](https://github.com/firehol/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](https://github.com/Coriou/peerflix-server/commit/452bc3ab95cd4ad47fc72ad2bd4a631b74a1649c)
Author
Owner

@asapach commented on GitHub (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.

<!-- gh-comment-id:549896692 --> @asapach commented on GitHub (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.
Author
Owner

@Coriou commented on GitHub (Nov 5, 2019):

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

Should we ship a default blocklist ?

<!-- gh-comment-id:549949643 --> @Coriou commented on GitHub (Nov 5, 2019): Sounds good to me ! I'll work on it, maybe tomorrow, should be easy enough. Should we ship a default blocklist ?
Author
Owner

@asapach commented on GitHub (Nov 5, 2019):

Should we ship a default blocklist ?

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

<!-- gh-comment-id:550002739 --> @asapach commented on GitHub (Nov 5, 2019): > Should we ship a default blocklist ? Only if there is one which is relatively static and small.
Author
Owner

@Coriou commented on GitHub (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

<!-- gh-comment-id:550060327 --> @Coriou commented on GitHub (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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/peerflix-server#140
No description provided.