ssbc / go-ssb-room

Room server implemented in Go
MIT License
185 stars 36 forks source link

compatibility with legacy invites #244

Open ahdinosaur opened 3 years ago

ahdinosaur commented 3 years ago

hi! :smiley_cat:

first of all, thanks for all your hard work with rooms 2.0, it's really awesome to see and get amongst with. :seedling:

i notice on hermies.club, there's a section in the landing:

Joining with any SSB app

There is a simple hack that lets most SSB apps work with Hermies Club already today.

  1. Send your SSB ID to andrestaltz or cryptix and they'll manually add you in the room's admin dashboard
  2. Wait for them to confirm that you were added
  3. Paste the following invite code into your SSB app (assuming your app already supports old-style rooms):
net:hermies.club:8008~shs:uMYDVPuEKftL4SzpRGVyQxLdyPkOiX7njit7+qT/7IQ=:SSB+Room+PSK3TLYC2T86EHQCUHBUHASCASE18JBV24=

does this approach work by default in any room running this software?

if so, how does one derive the necessary invite code?

i understand uMYDVPuEKftL4SzpRGVyQxLdyPkOiX7njit7+qT/7IQ= corresponds to the room's pub key ( @uMYDVPuEKftL4SzpRGVyQxLdyPkOiX7njit7+qT/7IQ=.ed25519 ), but i have no idea where SSB+Room+PSK3TLYC2T86EHQCUHBUHASCASE18JBV24= comes from.

cheers, thanks again!

cryptix commented 3 years ago

Hey @ahdinosaur! Thanks for the kind works. For me this was very rewarding work, finally moving away from pubs after all this time.. :)

To your question: this "invite" is not a real followback ssb-invite. It is using the same trick that staltz used in ssb-room v1, and it needs special handling in the clients. Like in patchwork here. What's usually used as a seed for the guest keypair is hard-coded and matched on to sidestep the whole invite.use process and just add the mutliserver address to the clients scheduler.

Also a caveat, this only works with this server if it's privacy mode is set to open or community. Or in restricted if the member was already addded to the room.

HTH and I invite you (zing) to read the http-invite spec we made and implemented, which is using ssb-URIs to kickstart the process between web-pages and apps that support it.

ahdinosaur commented 3 years ago

To your question: this "invite" is not a real followback ssb-invite. It is using the same trick that staltz used in ssb-room v1, and it needs special handling in the clients. Like in patchwork here. What's usually used as a seed for the guest keypair is hard-coded and matched on to sidestep the whole invite.use process and just add the mutliserver address to the clients scheduler.

ah cool, so then ssb-room/utils is where SSB+Room+PSK3TLYC2T86EHQCUHBUHASCASE18JBV24= comes from, that makes sense, so i can just use that!

HTH and I invite you (zing) to read the http-invite spec we made and implemented, which is using ssb-URIs to kickstart the process between web-pages and apps that support it.

yes i did try to give that a read, i really do appreciate that y'all have put in the time and care to write actual specs, what a refreshing thing to do for Scuttlebutt as a project!