Mod webdav » History » Revision 19
Revision 18 (Shtirlic, 2012-08-11 10:42) → Revision 19/36 (gstrauss, 2016-07-13 04:36)
h1. WebDAV *Module: mod_webdav* {{>toc}} h2. Description The WebDAV module is a very minimalistic implementation of RFC 2518. Minimalistic means that not all operations are implemented yet. So far we have: * PROPFIND * PROPPATCH * OPTIONS * MKCOL * COPY * MOVE * DELETE * PUT * LOCK * UNLOCK (experimental) and the usual GET, POST, HEAD from HTTP/1.1. If you want to setup a WebDAV repository with authentication, make sure you are loading mod_webdav `before` mod_auth. So far, mounting an open-access WebDAV resource into Windows XP (Network Places), Mac OS X (Finder) and Linux (Konqueror) works. Mounting an authenticated WebDAV resource works in Mac OS X and Linux. The basic litmus tests are passed. h2. Installation mod_webdav is part of the 1.4.x distribution. h3. PUT, DELETE If you are only looking for PUT and DELETE support, the basic mod_webdav works for you. No special compile-time options or libraries are required. PUT and DELETE are already part of the HTTP/1.1 spec, but are mostly used in combination with WebDAV. h3. PROPFIND, PROPPATCH PROPFIND and PROPPATCH are used to do a directory-listing and to attach properties to a file-object. As this involves parsing of XML-data we need libxml2. To make PROPPATCH work you need sqlite3 to store the properties in a separate location: * libxml2 FC4: libxml2 libxml2-devel * sqlite3 FC4: sqlite sqlite-devel To compile mod_webdav with property-support you have to specify: :: @$ configure --with-webdav-props@ h3. LOCK, UNLOCK LOCK and UNLOCK are necessary to get mounting of file-systems working. This involves generate unique lock-tokens. We use libuuid for this job. * libuuid FC4: e2fsprogs e2fsprogs-devel LOCK with includes parsing XML again, so have to provide the dependencies of the previous section and libuuid: :: @$ ./configure --with-webdav-props --with-webdav-locks@ h2. Options webdav.activate If you load the webdav module, the WebDAV functionality has to be enabled for the directories you want to provide to the user. Default: disable webdav.is-readonly Only allow reading methods (GET, PROPFIND, OPTIONS) on WebDAV resources. Default: writable webdav.sqlite-db-name The full path to the file you would like to use as your db file. This is required for webdav props and locks. Default: <empty> h2. Examples To enable WebDAV for the /dav directory, you wrap your webdav options in a conditional. You have to use the regex like below as you want to match the directory /dav and everything below it, but not e.g. /davos. :: <pre> $HTTP["url"] =~ "^/dav($|/)" { webdav.activate = "enable" webdav.is-readonly = "enable" webdav.sqlite-db-name = "/var/run/lighttpd/lighttpd.webdav_lock.db" } </pre> If you would like LOCK support :: <pre> $HTTP["url"] =~ "^/dav($|/)" { webdav.activate = "enable" webdav.is-readonly = "disable" webdav.sqlite-db-name = "/var/run/lighttpd/lighttpd.webdav_lock.db" } </pre> note : The WebDAV directory should be a child of the document root. So if you want to add a server.document-root option to the /dav configuration, the path should be a child of the server.document-root (Otherwise move and copy function will not work correctly). (Take a look in mod_webdav.c line 1830) h2. litmus tests We use http://webdav.org/neon/litmus/ (version 0.13) 0.10.5) to verify that we support at least the basic of the WebDAV spec. Limitations (incomplete list) For now we are far away from 100%. * we don't handle If: ... headers (LOCK/UNLOCK requests are always accepted; locking is not enforced and is not functional) * we handle shared locks as exclusive locks * the failing basic.9 basic.8 is new in 1.4.13 as we stripped off the fragments for clean URLs Handle the If: header requires a parser as it contains logical expressions. To give you an overview what works and what isn't: :: <pre> -> running 'basic': 9. 8. delete_fragment....... WARNING: DELETE removed collection resource with Request-URI including fragment; unsafe ...................... pass (with 1 warning) <- summary for `basic': of 16 15 tests run: 16 15 passed, 0 failed. 100.0% -> 1 warning was issued. -> running `copymove': 4. copy_overwrite........ WARNING: COPY to existing resource should didn't give 204 (RFC2518:S8.8.5), got 201 Created ...................... pass (with 1 warning) 9. 8. move.................. WARNING: MOVE to existing collection resource didn't give 204 WARNING: Could not clean up `/litmus/movecoll' ...................... pass (with 2 warnings) 1 warning <- summary for `copymove': of 13 12 tests run: 13 12 passed, 0 failed. 100.0% -> 3 2 warnings were issued. -> running `props': 3. propfind_invalid2..... FAIL (PROPFIND with invalid namespace declaration in body (see FAQ) got 207 response not 400) <- summary for `props': of 30 26 tests run: 29 26 passed, 1 0 failed. 96.7% 100.0% -> running `locks': 16. fail_cond_put......... FAIL (conditional PUT with invalid lock-token should fail: 200 OK) 18. cond_put_corrupt_token FAIL (conditional PUT with invalid lock-token should fail: 200 OK) 20. fail_complex_cond_put. FAIL (PUT with complex bogus conditional should fail with 412: 200 OK) 22. fail_cond_put_unlocked FAIL (conditional PUT with invalid lock-token should fail: 200 OK) 27. double_sharedlock..... FAIL (shared LOCK on locked resource: 423 Locked) 32. lock_collection....... 34. notowner_modify....... FAIL (LOCK on `/litmus/lockcoll/': 409 Conflict) (DELETE of locked resource should fail) -> 9 tests were skipped. <- summary for `locks': of 32 39 tests run: 28 33 passed, 4 6 failed. 87.5% 84.6% </pre> See also #1818 feature request to add RFC-compliant LOCK support to mod_webdav