All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Git with http and no Dav?
@ 2010-09-09  9:47 Jeremiah Foster
  0 siblings, 0 replies; 2+ messages in thread
From: Jeremiah Foster @ 2010-09-09  9:47 UTC (permalink / raw)
  To: git


> Hi all!
> 
> I am starting to make some public repositories available, although I am struggling with the HTTP backend! 

There is an elegant solution called the http smart backend. Here's some info from Scott Chacon who wrote the Pro Git book: http://progit.org/2010/03/04/smart-http.html

That is a great link to get started, but it is a little terse. Here is some more info on the http backend:
http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html

> 
> My setup is currently this: authorized users make use of ssh in order to clone/push, and this works like a charm. A public view (only view!) of repositories can be obtained by gitweb, and this also works flawlessly. 
> 
> On my debian server though, I don't know how to enable public cloning via http, since I don't really want to use WebDAV, as explained on the "setup-git-server-over-http.txt" howto. 
> 
> As suggested, I issued the "git update-server-info" command in the repository location, however, this has no effect on the repository:

If you want to use the http backend, you'll need to reconfigure your apache configuration. Specifically what you'll need to do is re-map the calls to git so that they go instead to the http backend which will do all the heavy lifting. 

Here's an example; 

    SetEnv GIT_PROJECT_ROOT /srv/git
    AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$          /srv/git/$1
    AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /srv/git/$1
    ScriptAlias /srv/git/ /usr/lib/git-core/git-http-backend/

    ScriptAliasMatch \
    "(?x)^/git/(.*/(HEAD | \                                                                                                                                                                                  
    info/refs | \                                                                                                                                                                                             
    objects/(info/[^/]+ | \                                                                                                                                                                                   
    [0-9a-f]{2}/[0-9a-f]{38} | \                                                                                                                                                                              
    pack/pack-[0-9a-f]{40}\.(pack|idx)) | \                                                                                                                                                                   
    git-(upload|receive)-pack))$" \
    /usr/libexec/git-core/git-http-backend/$1

You can see from above that what is happening is that calls to the git objects are getting caught and then passed, via script alias, to the git-http-backend program.

Also note that this particular snippet says nothing about authentication or authorization - those are things you'll need to configure as well, perhaps with but also possibly without ssh. The http backend gives you great flexibility and allows you to replace ssh key management with a more centralized authentication mechanism.

If you read those two URLs I presented, that should give you a good start on your way. 

Regards,

Jeremiah

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

* Git with http and no Dav?
@ 2010-09-09  8:59 Sensei
  0 siblings, 0 replies; 2+ messages in thread
From: Sensei @ 2010-09-09  8:59 UTC (permalink / raw)
  To: git

Hi all!

I am starting to make some public repositories available, although I am struggling with the HTTP backend! 

My setup is currently this: authorized users make use of ssh in order to clone/push, and this works like a charm. A public view (only view!) of repositories can be obtained by gitweb, and this also works flawlessly. 

On my debian server though, I don't know how to enable public cloning via http, since I don't really want to use WebDAV, as explained on the "setup-git-server-over-http.txt" howto. 

As suggested, I issued the "git update-server-info" command in the repository location, however, this has no effect on the repository:

# git update-server-info

# ls refs/
heads  tags

My apache configuration regarding git is this:

(...)
	<Directory /var/www/site/git>
		Allow from all
		AllowOverride all
		Order allow,deny
		Options ExecCGI
		<Files gitweb.cgi>
			SetHandler cgi-script
		</Files>
		DirectoryIndex gitweb.cgi
	</Directory>
	SetEnv  GITWEB_CONFIG  /etc/gitweb.conf

	<Directory /home/git>
		Order allow,deny
		Allow from all
	</Directory>
(...)


Anyway, I keep having the very same error (I tried also with different paths with no luck and the same error):

$ git clone http://my.site/home/git/repo
Cloning into repo...
fatal: http://my.site/home/git/repo/info/refs not found: did you run git update-server-info on the server?


There's something terribly naive that I'm missing here, I know!

Can you give me a hint?

Thanks & Cheers!

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

end of thread, other threads:[~2010-09-09  9:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-09  9:47 Git with http and no Dav? Jeremiah Foster
  -- strict thread matches above, loose matches on Subject: below --
2010-09-09  8:59 Sensei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.