t/lib-httpd: recognize */smart/* repos as smart-http

We do not currently test authentication for smart-http repos at all. Part of the infrastructure to do this is recognizing that auth/smart is indeed a smart-http repo. The current apache config recognizes only "^/smart/*" as smart-http. Let's instead treat anything with /smart/ in the URL as smart-http. This is obviously a stupid thing to do for a real production site, but for our test suite we know that our repositories will not have this magic string in the name. Note that we will route /foo/smart/bar.git directly to git-http-backend/bar.git; in other words, everything before the "/smart/" is irrelevant to finding the repo on disk (but may impact apache config, for example by triggering auth checks). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Aug 27, 2012 at 09:25 UTC 666aae9aed5a29019d2cd696d4258750c0dc96c7
1 file changed +7 -9
t/lib-httpd/apache.conf
+7 -9
@@ -45,22 +45,20 @@ ErrorLog error.log
45 Alias /dumb/ www/
46 Alias /auth/dumb/ www/auth/dumb/
47
48 -<Location /smart/>
48 +<LocationMatch /smart/>
49 SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
50 SetEnv GIT_HTTP_EXPORT_ALL
51 -</Location>
52 -<Location /smart_noexport/>
51 +</LocationMatch>
52 +<LocationMatch /smart_noexport/>
53 SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
54 -</Location>
55 -<Location /smart_custom_env/>
54 +</LocationMatch>
55 +<LocationMatch /smart_custom_env/>
56 SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
57 SetEnv GIT_HTTP_EXPORT_ALL
58 SetEnv GIT_COMMITTER_NAME "Custom User"
59 SetEnv GIT_COMMITTER_EMAIL custom@example.com
60 -</Location>
61 -ScriptAlias /smart/ ${GIT_EXEC_PATH}/git-http-backend/
62 -ScriptAlias /smart_noexport/ ${GIT_EXEC_PATH}/git-http-backend/
63 -ScriptAlias /smart_custom_env/ ${GIT_EXEC_PATH}/git-http-backend/
60 +</LocationMatch>
61 +ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1
62 <Directory ${GIT_EXEC_PATH}>
63 Options None
64 </Directory>