Make Gitweb behave like Apache mod_userdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I contact you because I spent quite some time to make something pretty
basic with gitweb.
I made gitweb behave a bit like UserDir module will in apache.
In fact it's only configuration but I think it could be useful to others.

Basicly it allows users of your server who use git to be able to use
gitweb to browse their own root project. E.G. :

Alice's private repos :

/home/alice/git/product_a.git (cloned from /var/git/product_a.git)
/home/alice/git/product_b.git (cloned from /var/git/product_b.git)
/home/alice/git/product_c.git (cloned from /var/git/product_c.git)

Alice's links to her repos which she wants to be able to browse with gitweb :

/home/alice/gitweb/product_a -> /home/alice/git/product_a.git/.git
/home/alice/gitweb/product_c -> /home/alice/git/product_c.git/.git

Bare repos :

/var/git/product_a.git
/var/git/product_b.git
/var/git/product_c.git
/var/git/product_d.git

/etc/gitweb.conf :

$projectroot = $ENV{'GITWEB_PROJECTROOT'} || "/var/git/";

Apache configuration :

RewriteRule ^/~([^\/]+)/?$  /cgi-bin/gitweb.cgi
[QSA,E=GITWEB_PROJECTROOT:/home/$1/gitweb/,L,PT]

So now all users with a gitweb folder in their home will be able to
browse all git repos in it through http://<host>/~<user>.

You will find a patch enclosed which try to describe best what I did
and why in the gitweb/README.

Regards.

Attachment: userdirstyle.patch
Description: Binary data


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]