-
Notifications
You must be signed in to change notification settings - Fork 5
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
unexpected connection of unstaged peer #8
Comments
Thanks @mixmix for the careful explanation, I wanted to be sure what's going on, and I know what you're talking about. TL;DR: this is not ssb-conn's fault, this is actually how secret-stack works, but I agree it shouldn't work like this and we need to fix it, somewhere in the stack. This just "looks" unexpected or undesired now because of staging. Essentially, in secret-stack and muxrpc, once you start a connection with another peer, that peer by default always accepts connections. This already happened between two (e.g.) patchbay or patchwork users using ssb-incoming-guard is supposed to fix that for us, but I tried using that with ssb-conn and ssb-lan, and it didn't do anything. I still need to look into this carefully, because I think it's also possible that ssb-incoming-guard is bugged or needs to consider a new corner case. Once ssb-incoming-guard is fixed (or we learn something entirely new about this situation), then that's still not the ideal situation. Suppose Alice and Bob are in the same LAN, and both of them have ssb-incoming-guard installed. Alice sees Bob in staging, and vice-versa. Alice is interested in connecting with Bob, so she clicks "connect", and Bob's muxrpc would reject that (because of ssb-incoming-guard), but more importantly Bob as a user would need some kind of visual indication that Alice was/is interesting in connecting. Essentially, connection should happen as a handshake, Alice should get some kind of notification "Bob wants to connect with you, do you allow?" and only after allowing would the connection occur. That's not the goal of ssb-incoming-guard though. All that said, I think secret-stack already provides us good tools to build that. Essentially it should be some This issue affects not only LAN connections, but also Bluetooth and Room peers (whenever there is staging). I actually hinted about this exact same issue in the blog post announcing rooms:
UPDATE: What happened in your example, and how it would have behaved under ssb-gossip So, what happened in your example is that patchbay followed the android app, and this caused a connection between patchbay and the android app, allowing patchbay to fetch data from mobile. Before, with ssb-gossip, mobile would not necessarily see patchbay as a connected peer, (here's the very important bit:) even though the connection actually existed. So in a sense ssb-gossip wasn't honest about all the connections. The gossip table only contained peers you approved or added or something like that, but it sort of ignores peers that connect to you. Specifically, these lines. In other words, with ssb-gossip installed on both sides, Alice can connect with Bob, get Bob's feed, but Bob would not even see Alice in |
About this, I just tried ssb-incoming-guard in manyverse and I figured why it wasn't working: you have to So I'm interested in building ssb-consensual-connection-guard (or whatever other name that makes sense) which stalls the incoming connection until the user explicitly approves this. Building the approval process in the UI will be an interesting challenge... |
@staltz great to hear you found the problem. In my browser thingy where I have tunnel chat working, I acually have an explicit accept protocol where:
This is all manual, would love to have this into a specific module. I have a feeling we need to untangle ssb-tunnel first, but I don't want to pile on any more stuff. |
@arj03 Good to hear about your browser thingy! I don't think we need to untangle ssb-tunnel first (we may, but not for this issue), I think it's just the matter of building a module that looks like ssb-incoming-guard, because it would be useful not just for tunnel, but also LAN and bluetooth. |
Yeah they should be orthogonal. Do you want this module to be both use hops and if outside then manual, or only manual? If it should use hops, then maybe it would be best to add the manual functionality to ssb-incoming-guard. |
Interesting, yes, I think we could add the manual functionality to ssb-incoming-guard. |
Great. Maybe something with a handler and a list of ids with state, such as accepted, blocked and functionality to manipulate this list. |
ssb-conn
is connecting to a peer I’ve not followed yet!How to reproduce:
ssb-conn
+ssb-lan
ssb-local
peers()
stream, even though I don't follow them, and didn't move them up from staged peer status.cc @luandro who I think saw the same problem between 2 android phones both running
ssb-conn
+ssb-lan
- when one peer follows the other, a connection instantly happens... and they might even start replicating both ways (Please add detail Luandro)The text was updated successfully, but these errors were encountered: