From: Junio C Hamano Date: Mon, 22 Apr 2013 01:40:09 +0000 (-0700) Subject: Merge branch 'jk/doc-http-backend' X-Git-Tag: v1.8.3-rc0~36 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c6c4d616739b531b5689b78fbcb2c89d14e70a4f?ds=inline;hp=-c Merge branch 'jk/doc-http-backend' Improve documentation to illustrate "push authenticated, fetch anonymous" configuration for smart HTTP servers. * jk/doc-http-backend: doc/http-backend: match query-string in apache half-auth example doc/http-backend: give some lighttpd config examples doc/http-backend: clarify "half-auth" repo configuration --- c6c4d616739b531b5689b78fbcb2c89d14e70a4f diff --combined t/lib-httpd/apache.conf index ad8553719a,542241b229..b5bce459b6 --- a/t/lib-httpd/apache.conf +++ b/t/lib-httpd/apache.conf @@@ -40,6 -40,9 +40,9 @@@ ErrorLog error.lo LoadModule authz_user_module modules/mod_authz_user.so + + LoadModule authz_host_module modules/mod_authz_host.so + PassEnv GIT_VALGRIND @@@ -61,11 -64,6 +64,11 @@@ Alias /auth/dumb/ www/auth/dumb SetEnv GIT_COMMITTER_NAME "Custom User" SetEnv GIT_COMMITTER_EMAIL custom@example.com + + SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} + SetEnv GIT_HTTP_EXPORT_ALL + SetEnv GIT_NAMESPACE ns + ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1 ScriptAlias /broken_smart/ broken-smart-http.sh/ @@@ -115,6 -113,21 +118,21 @@@ SSLEngine O Require valid-user + RewriteCond %{QUERY_STRING} service=git-receive-pack [OR] + RewriteCond %{REQUEST_URI} /git-receive-pack$ + RewriteRule ^/half-auth-complete/ - [E=AUTHREQUIRED:yes] + + + Order Deny,Allow + Deny from env=AUTHREQUIRED + + AuthType Basic + AuthName "Git Access" + AuthUserFile passwd + Require valid-user + Satisfy Any + + LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so diff --combined t/t5541-http-push.sh index 4086f02bc1,8a9dc85931..beb00be4b1 --- a/t/t5541-http-push.sh +++ b/t/t5541-http-push.sh @@@ -181,7 -181,8 +181,7 @@@ test_expect_success 'push (chunked)' git checkout master && test_commit commit path3 && HEAD=$(git rev-parse --verify HEAD) && - git config http.postbuffer 4 && - test_when_finished "git config --unset http.postbuffer" && + test_config http.postbuffer 4 && git push -v -v origin $BRANCH 2>err && grep "POST git-receive-pack (chunked)" err && (cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git && @@@ -294,5 -295,35 +294,35 @@@ test_expect_success 'push to auth-only- test_cmp expect actual ' + test_expect_success 'create repo without http.receivepack set' ' + cd "$ROOT_PATH" && + git init half-auth && + ( + cd half-auth && + test_commit one + ) && + git clone --bare half-auth "$HTTPD_DOCUMENT_ROOT_PATH/half-auth.git" + ' + + test_expect_success 'clone via half-auth-complete does not need password' ' + cd "$ROOT_PATH" && + set_askpass wrong && + git clone "$HTTPD_URL"/half-auth-complete/smart/half-auth.git \ + half-auth-clone && + expect_askpass none + ' + + test_expect_success 'push into half-auth-complete requires password' ' + cd "$ROOT_PATH/half-auth-clone" && + echo two >expect && + test_commit two && + set_askpass user@host && + git push "$HTTPD_URL/half-auth-complete/smart/half-auth.git" && + git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/half-auth.git" \ + log -1 --format=%s >actual && + expect_askpass both user@host && + test_cmp expect actual + ' + stop_httpd test_done