cabal-club / cabal-client

interface for writing peer-to-peer chat clients
GNU General Public License v3.0
95 stars 14 forks source link

network blocking #61

Open ghost opened 4 years ago

ghost commented 4 years ago

This patch uses the swarm opts.verify hook and cabal.removeConnection() to implement network-level blocking of peers. This is only part of what we'll need for a full implementation of blocking since you can still get the content from blocked peers via other peers. I also had to make some room in the command-handling to support blocks as well as other arbitrary flags. Before these changes any flags that weren't hide/unhide wouldn't show up correctly.

depends on https://github.com/cabal-club/cabal-core/pull/96

cblgh commented 4 years ago

this is really dope :3

looks like it is missing logic to show messages on clients when e.g. someone i trust (mod/admin) has blocked someone, see the existing logic for (un)hide/mod/admin https://github.com/cabal-club/cabal-client/blob/ee626cd2bc667ef191e94044b6021465d36bac17/src/cabal-details.js#L717-L764

garbados commented 4 years ago

Woo! Network-level blocking!

Does this also undownload the blocked peer's feed? Such as in the case of an illegal number attack, spamming, etc.

ghost commented 4 years ago

This patch doesn't yet delete the remote feed and refuse to replicate it again. That is the second part of implementing this feature fully which will require some changes upstream in multifeed.

garbados commented 4 years ago

Noted, thanks :+1: