Project

General

Profile

Feature #1953

Improve DAV support to be able to handle git as a client

Added by mstorsjo over 8 years ago. Updated 8 months ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
mod_webdav
Target version:
Start date:
2009-04-03
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:
No

Description

After some fiddling, I was able to set up a DAV storage on lighttpd which git is able to write to. These are the steps necessary:

(0. The http requests will include "Expect: 100-continue", therefore lighttpd >= 1.4.21 with server.reject-expect-100-with-417 = "disable" is needed. Compile the server with --with-webdav-props --with-webdav-locks.)

1. Apply lighttpd-git-allprop.patch. This makes lighttpd reply with all known live properties on allprop PROPFIND requests.

2. Apply lighttpd-git-infinite-locks-regular-files.patch. Initially, lighttpd doesn't support LOCK requests with an infinite depth, but git only does this for existing regular files (or for new regular files) - this patch makes lighty allow this kind of locking requests and handles them like any other lock requests with a supported depth.

3. Apply lighttpd-git-append-slashes-on-directories.patch. When doing a PROPFIND with depth 1 (used for listing the content of a directory in git), git recurses doubly if subdirectories are listed without a slash at the end. Didn't find anything in the webdav RFC saying if this actually was mandated by the spec, but e.g. Apache does listings in this way. (This could of course also be fixed within git instead, by changing a string comparison to ignore the last slash.)

4. Apply lighttpd-git-supportedlock-property.patch. This makes lighttpd respond to the supportedlock property query.

Do these patches look ok to be merged into the official lighttpd branch? Patches 1, 2, 4 are quite straightforward improvements making it work slightly more like the spec. Patch 3 isn't as obviously a definitive step towards better spec compliance though, but shouldn't break anything either.

lighttpd-git-allprop.patch (1.15 KB) lighttpd-git-allprop.patch Interpret a PROPFIND with allprop as a request for all known live properties mstorsjo, 2009-04-03 12:41
lighttpd-git-infinite-locks-regular-files.patch (681 Bytes) lighttpd-git-infinite-locks-regular-files.patch Allow locks of infinite depth on anything else than directories mstorsjo, 2009-04-03 12:41
lighttpd-git-append-slashes-on-directories.patch (757 Bytes) lighttpd-git-append-slashes-on-directories.patch Append slashes on directories mstorsjo, 2009-04-03 12:41
lighttpd-git-supportedlock-property.patch (1.2 KB) lighttpd-git-supportedlock-property.patch Properly reply to queries on the supportedlock property mstorsjo, 2009-04-03 12:41

Related issues

Related to Bug #2296: Saving file to webdav mapped drive failsFixed2011-02-11

Related to Bug #2001: webdav: Allow propfind requests for specific propertiesFixed2009-06-08

Associated revisions

Revision 3133 (diff)
Added by stbuehler over 1 year ago

[mod_webdav] allow Depth: Infinity lock on file (fixes #2296)

(still not supporting Depth: Infinity on directories)

patch by mstorsjo submitted as part of feature request #1953

From: Glenn Strauss <>

Revision ab829cee (diff)
Added by gstrauss over 1 year ago

[mod_webdav] allow Depth: Infinity lock on file (fixes #2296)

(still not supporting Depth: Infinity on directories)

patch by mstorsjo submitted as part of feature request #1953

From: Glenn Strauss <>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3133 152afb58-edef-0310-8abb-c4023f1b3aa9

Revision 80bb4226 (diff)
Added by gstrauss over 1 year ago

[mod_webdav] improve PROPFIND,PROPPATCH (#1818, #1953)

fix "allprop" propfind request to report all 'live' properties
add "supportedlock" 'live' property, if ./configure --with-webdav-locks
report collections (directory) paths with trailing slash ('/') on path
redirect operations on collections without trailing slash ('/') to URI
with trailing slash ('/')

fix PROPPATCH to work properly and eliminate PROPPATCH memory leak
fix property update after MOVE
move CREATE TABLE statements *before* any prepare statements to avoid
invalidating the prepare statements when the tables are first created
**thx Uranus Zhou for the explanation:
https://zohead.com/archives/lighty-sqlite-err/?lang=en

x-ref:
"Improve DAV support to be able to handle git as a client"
https://redmine.lighttpd.net/issues/1953
"add RFC-compliant LOCK support to mod_webdav" (still not compliant)
https://redmine.lighttpd.net/issues/1818

Note: this has not been tested whether or not mod_webdav works with git
The (highly) recommended method to support git via HTTP is to use
git-http-backend via CGI. gitolite and gitosis provide other good
alternative ways to access git.

This patch does result in more WebDAV 'Litmus' tests passing, even
though mod_webdav still pretends to implement "If" conditional locking,
granting locks to all requestors and not strictly enforcing locks.

Revision 37dac9a2 (diff)
Added by gstrauss 7 months ago

[core] support Expect: 100-continue with HTTP/1.1 (fixes #377, #1017, #1953, #2438)

support Expect: 100-continue with HTTP/1.1 requests

Ignore config option server.reject-expect-100-with-417;
server.reject-expect-100-with-417 will be removed in a future release.

x-ref:
"Incorrect handling of the 100 (Continue) Status"
https://redmine.lighttpd.net/issues/377
"'Expect' header gives HTTP error 417"
https://redmine.lighttpd.net/issues/1017
"Improve DAV support to be able to handle git as a client"
https://redmine.lighttpd.net/issues/1953
"Change server.reject-expect-100-with-417 from flag to regular expression matching the URL"
https://redmine.lighttpd.net/issues/2438

History

#1 Updated by mstorsjo over 8 years ago

I forgot to mention, even though this works, the operation is quite slow since most requests contain a "Expect: 100-continue" header, and libcurl has a one second timeout while waiting for a reply to that.

#2 Updated by mstorsjo almost 8 years ago

  • Status changed from New to Patch Pending

#3 Updated by skelkingur over 7 years ago

Is that patch going to be integrated / backported to 1.4.x? I'm having trouble with 1.4.25 and git http-push. After setting server.reject-expect-100-with-417 = "disable" the PROPFIND works. git http-push keeps aborting as the WebDAV locking mechanism isn't fully supported.

error: no DAV locking support on http://git.example.com/test.git/
fatal: git-http-push failed

I'd really appreciate to see that in the next release.

I just patched the current mod_webdav.c from lighttpd 1.4.25 and compiled it. This patch does not seem to work with the current version as the same error as mentioned above still occurs.

#4 Updated by Tuxist almost 6 years ago

please insert patches. i need this too for git.

#5 Updated by stbuehler almost 6 years ago

  • Missing in 1.5.x set to No

you really should use git over ssh. search for gitosis / gitolite, probably solves all problems you have.

#6 Updated by stbuehler over 1 year ago

  • Related to Bug #2296: Saving file to webdav mapped drive fails added

#7 Updated by gstrauss over 1 year ago

  • Status changed from Patch Pending to Wontfix

The recommended solution is to run git-http-backend via CGI.

Instructions for how to configure lighttpd to run git-http-backend are included in the git-http-backend man page.

If there is a real need to get git working with lighttpd via mod_webdav, then please reopen this ticket. However, #1818 feature request for proper LOCK support in lighttpd mod_webdav is a prerequisite.

#8 Updated by gstrauss over 1 year ago

Even though I marked this ticket as 'wontfix' because the superior solution is to run git-http-backend via CGI, I do plan to incorporate some of the patches since they do aim to improve things.

#9 Updated by gstrauss over 1 year ago

  • Target version set to 1.4.40

#10 Updated by stbuehler about 1 year ago

  • Related to Bug #2001: webdav: Allow propfind requests for specific properties added

#11 Updated by gstrauss 8 months ago

  • Status changed from Wontfix to Fixed

Marking this Fixed, as all the patches have been applied to address the issues raised here.

lighttpd 1.4.45 will support Expect: 100-continue in a more client-friendly way, so server.reject-expect-100-with-417 = "disable" will not longer be necessary (and that directive will be a no-op).

Also available in: Atom