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

Support multiple server and identities connections #109

Open
3 of 5 tasks
soapdog opened this issue May 27, 2021 · 12 comments
Open
3 of 5 tasks

Support multiple server and identities connections #109

soapdog opened this issue May 27, 2021 · 12 comments
Labels
meta aggregates other issues under a common topic tier-2 secondary priority
Projects

Comments

@soapdog
Copy link
Owner

soapdog commented May 27, 2021

This has been outlined originally in the new funding proposal of 2021: %Y2iyBckEhcWvxX6a1+9ELeP6wFYD80QNdhvR50V1C7E=.sha256.

Multiple identity support

There I said it, let’s make it bold MULTIPLE IDENTITIES. Now, the developers reading this, please get your heads back into their natural position, all of you turned them to the side while reading this.

How will this work: Patchfox is a client-only client, and it will remain so. What I’ll implement is: if you run multiple servers on the same machine, such as running js sbot on a port and golang sbot on a different port, Patchfox will leverage the browser multiple tabs to connect to both of them.

Already in Patchfox, each tab opens its own connection to the running ssb server. It uses the saved identity. By saving multiple identities, the user would be able to open new tabs using some specific saved identity, thus connecting to a different local server.

SSB support is already contained in /core/platforms/ssb. To support go-ssb, I’d make a core/platforms/go-ssb that exposed the same high-level API as the other one. When connecting to a server, Patchfox would decide which identity and platform should be used, and all the rest would remain the same (after some refactoring for packages that access sbot directly).

THIS CAN WORK. This will help go-ssb development. This will help any kind of new server development.

For this feature to be completed, the following issues need to be closed:

@soapdog soapdog added meta aggregates other issues under a common topic tier-2 secondary priority labels May 27, 2021
@soapdog soapdog added this to To do in Patchfox May 27, 2021
soapdog added a commit that referenced this issue Jul 22, 2021
This touches all of patchfox, so it was easier to group them.

IT WORKS! If you have multiple identities running under `nodejs-ssb` it should just work. for `go-ssb` there is still work to be done.

closes #107 #108 #109
@soapdog
Copy link
Owner Author

soapdog commented Jul 22, 2021

omg, this actually works.

@soapdog
Copy link
Owner Author

soapdog commented Jul 22, 2021

There is more info at %Xt+Ywb5QMLD5Wz1JGNY2aKzZrdyfZo0kPJCXtcX1jlI=.sha256 or you can simply watch the video at https://www.youtube.com/watch?v=aNIXQH1fX_A

@rmdes
Copy link

rmdes commented Feb 23, 2022

Added my local npm ssb-server ID, it seems to be working
now I want to add my previous .ssb/secrets that was originally a go-ssb server that was detected by manyverse desktop and migrated to manyverse, do you know anything about adding such ID to Patchfox, or is this going to create conflict ?

edit : ok, for anyone else looking for this, manyverse ID is located (on linux) ~/.config/manyverse/ssb/secrets

Multi identity works !

image

So I have these two ID's, first one is the one running npm ssb-server
second one is from Manyverse

I can use the localhost one, but the moment I switch to the manyverse ID, Patchfox freaks out with errors, such as :
image
basically, most of the patchfox navmenu is gone and on the PatchFox main menu, each menu item, when clicked does not react in any way.

If I go back to the first identity, Patchfox is fine :)

image

@soapdog
Copy link
Owner Author

soapdog commented Feb 23, 2022

Patchfox can't connect to Manyverse because Manyverse is not listening on WebSockets. Most of the other SSB apps listen on WebSockets and TCP. Unfortunately web apps (and add-ons) don't have access to raw TCP connections, thus making it impossible to connect to Manyverse.

Be aware that the support for multiple servers and identities is on-going. At the moment, Patchfox only supports NodeJS-based SSB Servers. I'm adding support for go-ssb and browser-ssb, but those are not ready. Patchfox can connect to servers from Patchwork, Scuttle Shell, Patchfoo, Oasis, Patchbay, or running your own server manually from the command-line.

@soapdog
Copy link
Owner Author

soapdog commented Feb 23, 2022

oh, I see you created a browser-ssb identity. That is not really working (at the moment it is just a copy of nodejs-ssb, so there is no point in selecting it)

@rmdes
Copy link

rmdes commented Feb 23, 2022

Hmmm, about the identity I created

  • npm ssb-server start (very new identity just to have a local one for Patchfox) @uYjfw6MrLmFF7SmMZuNwf/TWOjrswWURucWUbeQaOdM=.ed25519
  • what I set in Patchfox to be a "browser-ssb" identity is in fact my one year old SSB identity, initially created using ssb-server or oasis I can't remember, this is the identity that got migrated when I installed Manyverse desktop. @55rUB+qPLeXp8JBxHM0pOB7iOgVgetWHGYWdEQXG3fw=.ed25519

Based on your input I removed it from patchfox.

Now I'm wondering how to connect from patchfox to an ssb-go-room server : ssb.armada.digital (you can create your own invites) but they don't work with patchfox, I already tried to edit it and make it look like public Pub invites but it's not working, I'm probably missing something...

@rmdes
Copy link

rmdes commented Feb 23, 2022

Damn...now I can't remove the Manyverse ID without the server crashing :/

@soapdog
Copy link
Owner Author

soapdog commented Feb 23, 2022

@rmdes

image

ssb.armada.digital is failing CORS requests, that is why it is not working.

As for removing identities, I'll check here it appears the button is broken. At least here the button appears not to be wired up.

@rmdes
Copy link

rmdes commented Feb 23, 2022

Hmmm that's gonna be a mess to fix..
How did you find out?
I mean how did you used the generated invite with Patchfox to see the CORS errors?

In my stack, on the container that runs ssb-go-room I can fine-tune CORS for each container, but I'm not sure what should I add there..

Going to investigate.

@rmdes
Copy link

rmdes commented Feb 23, 2022

Hmm can you try again now ?
image

@rmdes
Copy link

rmdes commented Feb 23, 2022

Tried several ways (including wildcard) to allow same-origin, also tried with the domain itself, but I can't join..
Going to ask advice on another forum :)

@soapdog
Copy link
Owner Author

soapdog commented Feb 23, 2022

@rmdes just letting you know that I'm about to go on a mini vacation here and will be back only on Monday. I won't be able to look into this until I get back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta aggregates other issues under a common topic tier-2 secondary priority
Projects
Patchfox
  
To do
Development

No branches or pull requests

2 participants