Joplin: WebDAV driver

Created on 30 Nov 2017  ·  25Comments  ·  Source: laurent22/joplin

Hey, just another suggestion for a syncing method.

Here's an example of WebDAV being implemented in another (JS) project:
https://github.com/keeweb/keeweb/blob/master/app/scripts/storage/storage-webdav.js

bug

Most helpful comment

WebDAV sync is now available under the Nextcloud option. Since I've only tested with Nextcloud I've named it like this but in theory it should work with any other WebDAV service.

If you try it with something other than Nextcloud and it works please let me know. Eventually there will be a separate WebDAV sync option once it's confirmed that the driver works with any compatible service. (reopening this issue for now)

All 25 comments

Fyi, Nextcloud and Tagspaces (another Electron App) are currently connected in a thread about Webdav connectivity that is possibly very relevant to this request. Keeweb, mentioned above by @half-cambodian-hacker-man, is a project that has already integrated with Nextcloud + I see you have Nextcloud sync listed at the top of your roadmap. Webdav support for this project could also affect Issue #4

Agree with both @sunjam and @half-cambodian-hacker-man that WebDav is also implemented by Nextcloud and would be a work around to direct support of laurent22/joplin#4, while also providing for "naked" webdav on apache nginx lighthttpd with basic auth.

:+1:

Adding WebDav would basically add support for Seafile and Box automatically. I would be nice to see this.

Perhaps @rullzer and @schiessle from Nextcloud for WebDAV can offer some insight, or maybe @shoeper from Seafile.

webdav will actually be supported as of the next version. It will be named Nextcloud but it's really a WebDAV driver so can be used with any other compatible service

WebDAV sync is now available under the Nextcloud option. Since I've only tested with Nextcloud I've named it like this but in theory it should work with any other WebDAV service.

If you try it with something other than Nextcloud and it works please let me know. Eventually there will be a separate WebDAV sync option once it's confirmed that the driver works with any compatible service. (reopening this issue for now)

Currently trying with Zimbra as webdav server.
Joplin client on my Mac (High Sierra) and on an Android phone.

Initial sync seems to have happened (.resource and .sync folders are created on the webdav server).

The one notebook was created on the Mac, one note in the notebook.

Clicking on "Synchronise" button in the Mac client says "Complete".
However, the synchronisation status item in the menu shows "Notes 0/1", "Folders 0/1" but "Conflicted 0". The debug report is empty (beside the initial row with fields names).

Server side, I have this:

2018-02-05 15:30:18,142 INFO  FileUploadServlet - saveUpload(): received Upload: { accountId=xxx-xxx-xxx-xxx, time=Mon Feb 05 15:30:18 CET 2018, size=0, uploadId=51a1a192-c013-4a90-9ccc-d11aa515c839:1411b813-3b15-4ede-988f-587de8b9f884, name=.sync, path=null }
2018-02-05 15:30:18,142 INFO  dav - sending http error 409 because: item already exists
2018-02-05 15:30:18,142 INFO  dav - DavServlet operation MKCOL to /home/[email protected]/Briefcase/Joplin/.sync (depth: zero) finished in 2ms

If I delete the .sync and .resource folders on the server, the sync correctly happens (folder and note created on server).

However (again), sync of a new note from the desktop client can not happen (same error in log).

In both cases, the android client is not able to sync anything (same "409 error" on the log, server side).

409 is "conflict" (and that's true, server side, the file already exists).
It seem client side the error is not properly handled?

Looks like I have the same issue with Pydio as webdav server.
127.0.0.1 - username [05/Feb/2018:16:20:58 +0100] "MKCOL /dav/my-files/Joplin/.sync HTTP/1.1" 409 268 "-"

It does work with NextCloud (I had to replace my Pydio with NextCloud, this is now done).

WebDAV implementation in NextCloud more "permissive" and/or different ?

A WebDAV driver is available in the latest version. If you try it and it works (or not) please post here as it would be good to get some idea of what services are compatible.

@KlugFR, currently the Nextcloud and WebDAV driver are actually the same, but I've kept them separate so that it's possible to implement Nextcloud-specific optimisations later on.

I'm using Joplin 0.10.54 on my Mac.
Its WebDAV driver doesn't work with Pydio 7 nor Zimbra 8.6.

@KlugFR, the 409 error is now handled properly. Technically 409 shouldn't be used for this (it should be 405) but some non-spec compliant implementations indeed use this code.

@KlugFR, please try with 0.10.59 as it has many WebDAV improvements and fixes.

Just tried it, ran into another issue: https://github.com/laurent22/joplin/issues/196

0.10.60 on MacOS is syncing (read and write) with Zimbra 8.6.0 using webdav.
It works both way (saving to server and getting new items from server).

0.10.59 on Android doesn't work fully (or maybe I should reset it?).
I can sync to/from server a local notebook.
But it doesn't sync a notebook created on the Mac computer

@KlugFR, maybe there's an error during sync on Android. Could you check in the log to see if there's any message related to it?

Fixed, the issue was on my side. Thanks a lot.

With Zimbra the webdav URL is https://server.domain.tld/dav/[email protected]/Briefcase/Joplin.
Instead of "@" I used the its encoded version "%40" and that breaks the sync.

Thanks @KlugFR, I've added Zimbra to the list of compatible WebDAV services. By the way, the latest version includes a "Test WebDAV config" button which can be used to test a URL, username, etc. before using it for sync (more user friendly that digging in logs). The WebDAV driver will be officially released in coming v1.0.x version.

Bonjour Laurent,

j'ai testé avec Zimbra 8.6 (pas la dernière version mais considérée comme "LTS").

Dans la dernière version (8.8.x) il y a des changements au niveau de leur driver webdav (les changements correspondent au soucis que j'ai rencontré sous Android avec l'encodage du "@").
https://forums.zimbra.org/viewtopic.php?f=15&t=63520

Donc peut-être à vérifier/intégrer de votre côté ?

David

De: "Laurent Cozic" notifications@github.com
À: "laurent22/joplin" joplin@noreply.github.com
Cc: "David Touitou" david@network-studio.com, "Mention"
mention@noreply.github.com
Envoyé: Dimanche 11 Février 2018 21:39:56
Objet: Re: [laurent22/joplin] WebDAV driver (#39)

Thanks @KlugFR , I've added Zimbra to the list of compatible WebDAV services. By
the way, the latest version includes a "Test WebDAV config" button which can be
used to test a URL, username, etc. before using it for sync (more user friendly
that digging in logs). The WebDAV will be officially released in coming v1.0.x
version.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub , or mute the thread .

I get this with Seafile

Error. Please check that URL, username, password, etc. are correct and that the sync target is accessible. The reported error was:
Could not get lastModified date: {"d:href":["/dav/Personal/Notas/"],"d:propstat":[{"d:prop":[{"d:getlastmodified":[""],"d:getcontentlength":[""]}],"d:status":["HTTP/1.1 404 Not Found"]},{"d:prop":[{"d:resourcetype":[{"d:collection":[""]}]}],"d:status":["HTTP/1.1 200 OK"]}]}

@fmrtn, does the directory /dav/Personal/Notas/ exist? As the application will not create it.

@laurent22 of course.

I can access trough web browser or files aplication. Imgur

If you like I can create an account on our Seafile server for troubleshooting/develop purposes.

@fmrtn, yes if you could create an account that would help. I guess it's something that Seafile is doing which is not quite standard (like maybe not sending the "last modified" timestamp in some cases).

Solved on:

  • Android 1.0.97
  • iOS 1.0.12
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cybernemo picture Cybernemo  ·  3Comments

kopfuss picture kopfuss  ·  3Comments

GingerPapa picture GingerPapa  ·  3Comments

yschutz picture yschutz  ·  3Comments

jmcastagnetto picture jmcastagnetto  ·  3Comments