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

import/exports/sync user data (dat/git/...) #83

Closed
1 task
serapath opened this issue Jan 13, 2019 · 9 comments
Closed
1 task

import/exports/sync user data (dat/git/...) #83

serapath opened this issue Jan 13, 2019 · 9 comments
Assignees
Labels
#files/bookmarks specification category
Milestone

Comments

@serapath
Copy link
Contributor

serapath commented Jan 13, 2019

@todo

  • implement a filesystem.html to use with play-bookmarks

message format { from, path, type, body }

  1. from = [<string> key1, <number> id1]
    • where key1 is the address or path of the sender
    • and id1 is unique message identifier for all the messages that sender sends
  2. path = [<string> key2, <number> id2]
    • where key2 is the address or path of the receipient (e.g. "foo/bar/baz")
    • and id2 is like a reference to an earlier message if there was one
  3. type = <string> (e.g. "get", "set", "list", ....)
    • to indicate what kind of event or command or request, etc... the message is all about
  4. body = <any>
    • is any kind of content appropriate for the given "type"

Use Cases:

  1. Users create all kinds of data while going through the workshops lessons & exercises in the skilltree.
    For example:
  • Writing a smart contract
  • Deploying a smart contract to a network at a specific address
  1. Users switch devices and might open the workshop app on their phone and on different computers or use different browsers or even clear browser caches or re-install their systems, but they don't want to lose their data and they want to continue smoothly when switching devices.
    For example:
  • A user starts a workshop at home on their laptop and wants to continue later using a tablet

Data:

  1. Users work create and change files and folders during workshops
  2. Users generate many actions or activities that go into some kind of journal

Idea:
Maybe we could try to use git or dat in mainstream browsers like (firefox/chrome/...) to enable users to store their Data and sove the two Use Cases listed above.


about iframes

localStorage has a data limit. If we store a lot we will need to switch later to indexeddb :-)

  1. all localStorage data is stored in the browser on the laptop of user 1
  2. all localStorage data is stored in the browser on the laptop of user 2
@serapath serapath self-assigned this Jan 13, 2019
@serapath
Copy link
Contributor Author

@ookangzheng

@serapath serapath mentioned this issue Jan 13, 2019
9 tasks
@zoonderkins
Copy link

zoonderkins commented Jan 28, 2019

I think there are some ideas

  1. https://github.com/RangerMauve/dat-gateway
  2. Do a reverse proxy or Proxy PAC
  3. Node forward datDNS and TCP request to the upper gateway

Scenario

  1. User -> xxx proxy on Chrome
  2. Proxy open a new Tab
  3. User handle everything inside
  4. That tab bg activity handler data send and receive via PAC.

Useful lib

  1. https://www.npmjs.com/package/simple-peer
    2.http://y-js.org/
    3.https://github.com/nikolaiwarner/cabal-desktop-mini

@serapath
Copy link
Contributor Author

@ookangzheng fantastic.
I am very busy until the end of January (a few more days) here in San Francisco.
Once we leave I hope I have some time to check your links and think about it.

Just from those "bullet points" I am not sure I entirely understand what and how you want to build it, but I'm happy to see progress.

I can tell you my "dream scenario" for now given that we need to support browsers like "google chrome" urgently:

1. user comes to static page **our app** (=static website)
2. user interacts with app and any data is cached locally
3. user decides he likes the app and wants to keep his data
4. user clicks button: e.g. "backup your data" => This starts the process

5. user selects one of the freemium gateway deployment options
    * e.g.: heroku, zeit.co, aws, google cloud, azure, ..., hashbase?
    * (custom), e.g. rasberry pi, etc..
    * (local) download desktop, comandline client, beaker browser, ...
6. user remote controls/configures "their" gateway through
    * **our app** (=static website)
    * or a "browser extension" or other **app** we program specifically to manage the gateway
7. user can now use many other app's using their "dat data" by just connecting their dat address

questions:

  1. Does that make any sense to you?
  2. Do you have questions about it?
  3. Do you have suggestions or ideas about how you would do it (maybe differently)?
  4. Do you see some challenges or problems with what I describe?

@todo

  • let's try to discuss to come to a common/shared understanding of what is the use case we want to solve :-)

@serapath serapath added the #files/bookmarks specification category label Feb 20, 2019
This was referenced Feb 21, 2019
@zoonderkins
Copy link

zoonderkins commented Feb 21, 2019

Some quick note here

  • Research how DAT works
  • Deploy dat-gateway and gonna research on hyperdrive
  • Try to push a file and save on DAT

@serapath
Copy link
Contributor Author

cool :-)

I just mentioned on gitter, that a first goal to work towards probably should be a collaboration between you and @alincode to solve the #56 make skilltree/curriculum module issue.

I just mentioned it in the gitter chat here:

@serapath
Copy link
Contributor Author

serapath commented Feb 22, 2019

@ookangzheng

just read through https://ar.al/2019/01/22/hypha-spike-multiwriter-1/
looks very very interesting.
Do I understand it correctly?

  1. You run dat in the browser (or in two browsers)
  2. The private dat key is stored locally in each browser
  3. you connect both browsers through a generic signalhub
  4. you make one browser talk to the other via webRTC to (e.g. authorize each other to write to those other dats)

...but essentially this kind of dat network and all the dat data stays in browsers - even though they might possibly sync to a dat client running on my desktop (outside the browser) if i run some kind of bridge ...

Is that how it works?
and also - can dats be used on static websites hosted on different domains?


answer

Heya (sorry, I don’t check DMs often). Yes, in a nutshell. Although you don’t have to store the secret key if you use deterministic keys (e.g., derived from a high-entropy passphrase) and also you can bridge to native clients that replicate over TCP by using the always-on node as a relay via WebSocket.

DATs can be used with static sites. It’s what I’m doing my blog currently (dat://ar.al – open that using Beaker Browser) :) But Hypha is the opposite of that. Everything is client-side and the always-on node (“server” in centralised parlance) is an untrusted/unprivileged node.

@serapath serapath mentioned this issue Feb 26, 2019
5 tasks
@zoonderkins
Copy link

This was referenced Mar 20, 2019
@serapath
Copy link
Contributor Author

Could you publish an empty repository with a github page, which we could start adding code to on your github account and link it here? :-)

It can be an empty git repository - I can then use it to "mount" it in the github page for play-bookmarks and we can slowly add code to your repository, so that it works as a mountable "hard disk" for play-bookmarks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#files/bookmarks specification category
Projects
None yet
Development

No branches or pull requests

2 participants