org-web icon indicating copy to clipboard operation
org-web copied to clipboard

Add support for other sync backends

Open DanielDe opened this issue 8 years ago • 17 comments

Suggestions:

  • [x] Gdrive
  • [ ] SyncThing
  • [ ] GitHub
  • [ ] Nextcloud
  • [ ] WebDAV

DanielDe avatar Apr 28 '17 02:04 DanielDe

nextcloud

wiredone avatar Nov 04 '18 15:11 wiredone

Updated @wiredone! I believe Nextcloud has support for WebDAV, which is a nice general solution for many of these sync backends. Unfortunately, in my recent experiments with WebDAV, a lot of services don't support accessing it from a browser, so it might require that I implement a proxy server of some sort. So it might be a while before I can get around to it.

DanielDe avatar Nov 05 '18 16:11 DanielDe

I had a look at Nextcloud/WebDAV support. The problem I see is that Nextcloud does not yet support PKCE and they've rejected support for OAuth implicit grant. As far as I can tell, this means that auth either requires a separate server backend (to store the OAuth secrets) or would have to be done using basic auth. Other than that I suspect it shouldn't be too hard to incorporate.

washort avatar Feb 12 '19 04:02 washort

Hey @washort, I appreciate the research!

Unfortunately there’s also another issue (or at least there was when I last checked about 3 months ago): none of the WebDAV services I found, including Nextcloud, added the CORS headers necessary to make cross origin requests from a web browser. So even if they support the necessary authentication mechanisms, all requests are rejected by the browser.

A proxy servercould solve this issue by forwarding all requests and also setting the proper CORS header.

DanielDe avatar Feb 12 '19 05:02 DanielDe

Would you be interested in support for remotestorage.js?

washort avatar Feb 13 '19 17:02 washort

Ah that’s pretty neat! Definitely interested, but it looks like it would require a back end component to be useful. I’m not entirely against a back end, but it opens up a whole bunch of concerns that I don’t have now with just a front end app.

DanielDe avatar Feb 14 '19 07:02 DanielDe

What about OneDrive?

dleslie avatar Jul 19 '19 16:07 dleslie

Github is definitely a big one for me. It's the reason I never truly adopted orgzly or other alternatives.

mtekman avatar Jul 19 '19 18:07 mtekman

FWIW pcloud has webdav at https://webdav.pcloud.com I just tested browser support on my phone and was able to log in.

hanslovsky avatar Jul 20 '19 03:07 hanslovsky

Would it be possible to support a manually synced directory? I like to sync my files using syncthing or rsync/cron, both of which simply dump all files in a directory. Could org-web read a simple directory?

bastibe avatar Jul 22 '19 07:07 bastibe

@bastibe org-web currently only supports Dropbox and Google Drive. But in the future that's certainly feasible if some API exists to access that folder, like WebDAV or a git remote.

DanielDe avatar Jul 22 '19 16:07 DanielDe

@DanielDe maybe I don't understand this quite right: I was under the impression that I could host org-web on my own server, and simply point it to an externally-synced directory. Is that possible, or could that be made possible?

bastibe avatar Jul 23 '19 16:07 bastibe

@bastibe no, not quite. You can host org-web on your own server, but that simply means hosting the static HTML, CSS, and JS files, since org-web runs completely client side (there's no backend/server component). But to actually read an org file org-web requires a sync backend, two of which are currently supported: Dropbox and Google Drive.

DanielDe avatar Jul 23 '19 16:07 DanielDe

@DanielDe I see. That is actually amazing technology! Thank you for clearing this up.

bastibe avatar Jul 23 '19 16:07 bastibe

If we're voting on which of the checkboxes, I'm on pCloud as well and should be fine with WebDav support. Haven't worked with WebDav, but with some pointers might be able to help. (PS. Would love to see TypeScript used :)

pcraciunoiu avatar Jul 27 '19 07:07 pcraciunoiu

I'm using Fastmail and would like to use WebDAV also.

I had a look at Nextcloud/WebDAV support. The problem I see is that Nextcloud does not yet support PKCE and they've rejected support for OAuth implicit grant. As far as I can tell, this means that auth either requires a separate server backend (to store the OAuth secrets) or would have to be done using basic auth. Other than that I suspect it shouldn't be too hard to incorporate.

Fastmail doesn't support OAuth at all: they use app passwords instead.

Perhaps it might be worth building a proxy that can take basic auth and provide OAuth with PKCE enabled?

These NPM packages look promising:

This would still of course require org-web to support WebDAV

johnhamelink avatar Jun 18 '20 20:06 johnhamelink

Perhaps it might be worth building a proxy that can take basic auth and provide OAuth with PKCE enabled?

Yeah, I think this is a great idea and could solve other problems as well, like the problem with many WebDAV services not sending the CORS headers required to make requests from the browser. Unfortunately, even a simple proxy like this ups the complexity required to run org-web pretty substantially, since org-web is currently a pure front-end app.

Any interest in building this @johnhamelink? I'd be happy to provide some support.

DanielDe avatar Jun 19 '20 01:06 DanielDe