DanielDe / org-web

org-mode on the web, built with React, optimized for mobile, synced with Dropbox and Google Drive
https://org-web.org
The Unlicense
1.39k stars 83 forks source link

Add support for other sync backends #5

Open DanielDe opened 7 years ago

DanielDe commented 7 years ago

Suggestions:

wiredone commented 5 years ago

nextcloud

DanielDe commented 5 years ago

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.

washort commented 5 years ago

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.

DanielDe commented 5 years ago

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.

washort commented 5 years ago

Would you be interested in support for remotestorage.js?

DanielDe commented 5 years ago

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.

dleslie commented 5 years ago

What about OneDrive?

mtekman commented 5 years ago

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

hanslovsky commented 5 years ago

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

bastibe commented 5 years ago

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?

DanielDe commented 5 years ago

@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.

bastibe commented 5 years ago

@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?

DanielDe commented 5 years ago

@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.

bastibe commented 5 years ago

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

pcraciunoiu commented 5 years ago

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 :)

johnhamelink commented 4 years ago

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

DanielDe commented 4 years ago

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.