git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Add Git-aware CGI for Git-aware smart HTTP transport
  2008-08-05  2:02                     ` H. Peter Anvin
@ 2008-08-13  1:56                       ` H. Peter Anvin
  2008-08-13  2:37                         ` Shawn O. Pearce
  0 siblings, 1 reply; 4+ messages in thread
From: H. Peter Anvin @ 2008-08-13  1:56 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Rogan Dawes, Junio C Hamano, git

Anything we can do to keep this moving forward?  I was extremely 
encouraged with the fast progress on this; this would be great to get to 
the point where we (kernel.org) can deploy it at least for testing.

	-hpa

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Add Git-aware CGI for Git-aware smart HTTP transport
  2008-08-13  1:56                       ` H. Peter Anvin
@ 2008-08-13  2:37                         ` Shawn O. Pearce
  0 siblings, 0 replies; 4+ messages in thread
From: Shawn O. Pearce @ 2008-08-13  2:37 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Rogan Dawes, Junio C Hamano, git

"H. Peter Anvin" <hpa@zytor.com> wrote:
> Anything we can do to keep this moving forward?  I was extremely  
> encouraged with the fast progress on this; this would be great to get to  
> the point where we (kernel.org) can deploy it at least for testing.

Sorry, I dropped it with my egit work.  I'll pick it up again and
try to continue it further.  I left off trying to implement the
push client and saying "damn, jgit is better structured to make this
sort of change than C git" and decided it was too late at night to
continue it more.  That was like a week ago.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Add Git-aware CGI for Git-aware smart HTTP transport
       [not found]   ` <48A262B9.8020608@zytor.com>
@ 2008-08-13 14:53     ` Shawn O. Pearce
  2008-08-13 15:41       ` H. Peter Anvin
  0 siblings, 1 reply; 4+ messages in thread
From: Shawn O. Pearce @ 2008-08-13 14:53 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: git

[...added git ML back to thread...]

"H. Peter Anvin" <hpa@zytor.com> wrote:
> Shawn O. Pearce wrote:
>> The plan I've proposed requires wedging the CGI in between the HTTP
>> server and the repository files.  Which means older dumb clients
>> get data by forking off the CGI, rather than letting the HTTP server
>> stream the file itself.
>
> Yeah, that's quite a bit unfortunate, because it means some potentially  
> very expensive buffering in Apache.  That's one reason to do some kind  
> of redirection.

Hmm.  So what if the "smart" protocol used a redirect to the CGI
and the dumb protocol didn't use any redirects at all?  I say this
because I think the dumb protocol won't handle redirects well.
It will do them, but it would incur a redirect on every request
it makes.

So if we have the "smart" protocol perform detection by trying:

	C: HEAD /path/to/repository.git/git-http-backend HTTP/1.0

	S: HTTP/1.0 302 Found
	S: Location: /git-http/path/to/repository.git

Under Apache this server configuration can be easily handled by a
mod_rewrite regex:

	RewriteRule ^(/pub/scm/.*)/git-http-backend$ /git/$1 [R,L]
	ScriptAlias /git/ /path/to/git-http-backend/

Individual users could also install the git-http-backend CGI
right into their repository, in which case the CGI if invoked with
no PATH_INFO can do a redirect back to itself to indicate where
GIT_DIR is:

	C: HEAD /path/to/repository.git/git-http-backend HTTP/1.0

	S: HTTP/1.0 302 Found
	S: Location: /path/to/repository.git/git-http-backend/.

Individual operations can be selected by appending on the operation
name, so <Location ~ > style rules can be used to apply access
controls, such as:

	# Disallow push to any smart repository via ScriptAlias
	#
	<Location ~ ^/git/.*/receive-pack$>
		Order Deny,Allow
		Deny from all
	</Location>

	# Disallow push to any smart repository with CGI in tree.
	#
	<Location ~ .*/git-http-backend/./receive-pack$>
		Order Deny,Allow
		Deny from all
	</Location>

Setting this up on a server which doesn't have the power of mod_regex
available would be tricky, as you need to link the CGI into every
single repository you are serving.  I don't know (or use) many other
HTTP servers beyond Apache so I'm not sure if they can do this.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Add Git-aware CGI for Git-aware smart HTTP transport
  2008-08-13 14:53     ` Add Git-aware CGI for Git-aware smart HTTP transport Shawn O. Pearce
@ 2008-08-13 15:41       ` H. Peter Anvin
  0 siblings, 0 replies; 4+ messages in thread
From: H. Peter Anvin @ 2008-08-13 15:41 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git

Shawn O. Pearce wrote:
> 
> Hmm.  So what if the "smart" protocol used a redirect to the CGI
> and the dumb protocol didn't use any redirects at all?  I say this
> because I think the dumb protocol won't handle redirects well.
> It will do them, but it would incur a redirect on every request
> it makes.
> 

That's preferrable anyway, in my opinion.

> Setting this up on a server which doesn't have the power of mod_regex
> available would be tricky, as you need to link the CGI into every
> single repository you are serving.  I don't know (or use) many other
> HTTP servers beyond Apache so I'm not sure if they can do this.

Many can, and even more can if we instead of git-http-backend had 
something which looked vaguely like a unique extension, like 
"backend.git-http"

	-hpa

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-13 15:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200808130326.m7D3Pr2V000918@terminus.zytor.com>
     [not found] ` <20080813032812.GD5855@spearce.org>
     [not found]   ` <48A262B9.8020608@zytor.com>
2008-08-13 14:53     ` Add Git-aware CGI for Git-aware smart HTTP transport Shawn O. Pearce
2008-08-13 15:41       ` H. Peter Anvin
2008-08-03  2:56 More on git over HTTP POST Shawn O. Pearce
2008-08-03  7:25 ` [RFC 1/2] Add backdoor options to receive-pack for use in Git-aware CGI Shawn O. Pearce
2008-08-03  7:25   ` [RFC 2/2] Add Git-aware CGI for Git-aware smart HTTP transport Shawn O. Pearce
2008-08-03 22:16     ` Junio C Hamano
2008-08-04  3:59       ` Shawn O. Pearce
2008-08-04  9:53         ` Rogan Dawes
2008-08-04 14:48           ` Shawn O. Pearce
2008-08-05  1:03             ` H. Peter Anvin
2008-08-05  1:24               ` Shawn O. Pearce
2008-08-05  1:35                 ` H. Peter Anvin
2008-08-05  1:57                   ` Shawn O. Pearce
2008-08-05  2:02                     ` H. Peter Anvin
2008-08-13  1:56                       ` H. Peter Anvin
2008-08-13  2:37                         ` Shawn O. Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).