Project

General

Profile

Mod webdav » History » Revision 20

Revision 19 (gstrauss, 2016-07-13 04:36) → Revision 20/36 (gstrauss, 2019-05-27 20:05)

h1. WebDAV 


 *Module: mod_webdav* 

 {{>toc}} 

 h2. Description 

 The WebDAV module is an a minimalistic implementation of RFC 4918.    (since 1.4.54) 2518. Minimalistic means that not all operations are implemented yet.  

 So far we have: 

 Supported methods: 

 * PROPFIND 
 * PROPPATCH 
 * OPTIONS 
 * MKCOL 
 * COPY 
 * MOVE 
 * DELETE 
 * PUT 
 * LOCK 
 * UNLOCK 

 and the usual GET, POST, HEAD from HTTP/1.1.  

 Mounting 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.    All @litmus@ The basic litmus tests pass since lighttpd 1.5.54. 



 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) 

 webdav.opts    (since 1.4.54) 
   List of additional options to configure mod_webdav.    Versions of mod_webdav earlier than 1.4.54 were not RFC compliant and permitted partial PUT, which is unsafe.    In lighttpd 1.4.54, this is disabled by default, and    the unsafe behavior can be enabled with the following option, provided for backwards compatibilty. 

   @webdav.opts = ( "deprecated-unsafe-partial-put" => "enable" )@ 

   Default: (empty) 




 <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/db/lighttpd/webdav.db" "/var/run/lighttpd/lighttpd.webdav_lock.db" 
   } 
 </pre> 

 If you would like LOCK support: support :: 

 <pre> 
   $HTTP["url"] =~ "^/dav($|/)" { 
     webdav.activate = "enable" 
     #webdav.is-readonly webdav.is-readonly = "disable" # (default) 
     webdav.sqlite-db-name = "/var/db/lighttpd/webdav.db" "/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) to verify that we support at least the basic of the WebDAV spec.    (#1818) 


 h2.  

 Limitations 

 (incomplete list) 

 * incomplete "shared" lock support 

 h2. Installation 

 h3. PUT, DELETE, COPY, MOVE, MKCOL 

 mod_webdav we don't handle If: ... headers (LOCK/UNLOCK requests are always accepted; locking is part of not enforced and is not functional) 
 * we handle shared locks as exclusive locks 
 * the 1.4.x distribution and supports GET, HEAD, OPTIONS, PUT, DELETE, COPY, MOVE, MKCOL without any additional libraries. failing basic.9 is new in 1.4.13 as we stripped off the fragments for clean URLs 

 h3. PROPFIND, PROPPATCH 

 PROPFIND and PROPPATCH are used to do Handle the If: header requires a directory-listing and to attach properties to a file-object.    This involves parsing XML-data and storing the properties.    parser as it contains logical expressions. To compile mod_webdav with property-support libxml2, libxml2-devel, sqlite, sqlite-devel packages are required give you an overview what works and you have to build with: 

   @$ configure --with-webdav-props@ what isn't: :: 

 h3. LOCK, UNLOCK 
 
 LOCK and UNLOCK are necessary <pre> 
   -> running 'basic': 
    9. delete_fragment....... WARNING: DELETE removed collection resource with Request-URI including fragment; unsafe 
       ...................... pass (with 1 warning) 
   <- summary for `basic': of 16 tests run: 16 passed, 0 failed. 100.0% 
   -> 1 warning was issued. 
   -> running `copymove': 
    4. copy_overwrite........ WARNING: COPY to get mounting existing resource should give 204 (RFC2518:S8.8.5), got 201 Created 
       ...................... pass (with 1 warning) 
    9. move.................. WARNING: MOVE to existing collection resource didn't give 204 
                              WARNING: Could not clean up `/litmus/movecoll' 
     ...................... pass (with 2 warnings) 
   <- summary for `copymove': of file-systems working. This involves generate unique lock-tokens. We use libuuid 13 tests run: 13 passed, 0 failed. 100.0% 
   -> 3 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 this job from packages e2fsprogs, e2fsprogs-devel.    `props': of 30 tests run: 29 passed, 1 failed. 96.7% 
   -> running `locks': 
   18. cond_put_corrupt_token FAIL (conditional PUT with invalid lock-token should fail: 200 OK) 
   22. fail_cond_put_unlocked FAIL (conditional PUT with invalid lock-token should fail: 200 OK) 
   27. double_sharedlock..... FAIL (shared LOCK with includes parsing XML again, so have on locked resource: 423 Locked) 
   32. lock_collection....... FAIL (LOCK on `/litmus/lockcoll/': 409 Conflict) 
   -> 9 tests were skipped. 
   <- summary for `locks': of 32 tests run: 28 passed, 4 failed. 87.5% 
 </pre> 

 See also #1818 feature request to provide the dependencies of the previous section and libuuid: 

   @$ ./configure --with-webdav-props --with-webdav-locks@ add RFC-compliant LOCK support to mod_webdav