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

Test peer to peer synchronization #778

Open
wwebfor opened this issue Jun 30, 2017 · 1 comment
Open

Test peer to peer synchronization #778

wwebfor opened this issue Jun 30, 2017 · 1 comment
Labels

Comments

@wwebfor
Copy link
Member

wwebfor commented Jun 30, 2017

Hi all,

I have just pushed code which implements peer to peer differential synchronization. Before implementing this, I tried several solutions but liked this because:

  1. Server keeps a minimum amount of data e.g. only credentials
  2. In order to authenticate on the server, you need to know only one password thanks to OpenPGP's signatures (read more about it here)
  3. The server is needed only to exchange the signaling information between peers and deliver invites

If you want to review the implementation check these:

  1. https://github.com/Laverna/laverna-server
  2. https://github.com/Laverna/laverna/blob/dev/app/scripts/models/Signal.js
  3. https://github.com/Laverna/laverna/blob/dev/app/scripts/models/Peer.js
  4. https://github.com/Laverna/laverna/tree/dev/app/scripts/models/diffsync

For now it's not ready for production usage.

How to use

If you want to check the synchronization, you need to:

  1. Start the signaling server
  2. Start the app

After you open the client, it will greet you with the page where you can choose a username:

screen shot 2017-06-30 at 15 48 16-fullpage

Then, you can either upload your existing OpenPGP key or generate a new one:

screen shot 2017-06-30 at 15 49 37-fullpage

After completing the registration process, you can start creating and then sharing your notes with others:

screen shot 2017-06-30 at 15 51 10-fullpage

If you start using the app on other devices, all your data will be automatically synchronized between them. Other users will see only the notes you have shared with them.

Sometimes you can also choose to synchronize only a particular amount of notes with your other devices. To do that, just create another account (for example, wwebfor@android, wwebfor@desktop)

Several thoughts

So why did I implement this instead of fixing Dropbox, RemoteStorage synchronization. It's because I wanted to have collaboration support in the app.

Also the fact that the server-side still doesn't store sensitive information even in encrypted format is a bonus too (your data is stored only on your devices and on the devices of people with whom you shared it).

Your ideas

So what do you think about this? If you think the idea or implementation is terrible or insecure, write it here.

I tried to make all steps as easy as possible but I think the UX still needs some improvement. If you have some UX suggestions, please let me know too.

@talklittle
Copy link
Contributor

talklittle commented Aug 16, 2017

This is awesome! Is the idea to have a public signaling server, e.g. on laverna.cc, or do you encourage people to self-host?

I guess my only complaint for now is the hard Mongo dependency. Would be fantastic to be able to use Postgres instead. (Laverna/laverna-server#1)

After some testing I hit a couple bugs. I could get the 2 users to see each other, 2 separate browser instances on same machine, but sharing a note did not seem to work. I was able to send and accept the invite but not share the note.

Also I saw a weird list of profiles when logged in with 1 of the users, maybe a parsing bug: https://user-images.githubusercontent.com/87961/29346464-501f6bb0-81fa-11e7-887d-34b312d16f9c.png EDIT: Cleared DB using indexedDB.deleteDatabase('notes-db') and the profiles problem went away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants