Difference between revisions of "Cgit"

From ArchWiki
Jump to: navigation, search
(Gitosis Integration)
Line 56: Line 56:
 
  repo.path=/srv/git/MyOtherRepo.git
 
  repo.path=/srv/git/MyOtherRepo.git
 
  repo.desc=That's my other git repository
 
  repo.desc=That's my other git repository
 +
 +
If you prefer not having to manually specify each repository it's also possible to configure cgit to search for them:
 +
 +
scan-path=/srv/git/
  
 
For detailed documentation about the available settings in this configuration file, please see the manage (`man cgitrc`).
 
For detailed documentation about the available settings in this configuration file, please see the manage (`man cgitrc`).

Revision as of 11:03, 27 January 2012

Cgit is an attempt to create a fast web interface for the git scm, using a builtin cache to decrease server io-pressure.

Installation

Installing cgit is rather simple as it's available in the Community repository:

# pacman -S cgit

In order to actually use cgit you will of course also need to have some webserver installed on your system, like for example Apache.

Configuration

Apache

You may add the following either to the end of your /etc/httpd/conf/httpd.conf file or place it in a separate file inside the /etc/httpd/conf/extra/ directory.

#
# cgit configuration for apache
#

ScriptAlias /cgit/ "/usr/lib/cgit/cgit.cgi/"
Alias /cgit-css "/usr/share/webapps/cgit/"
<Directory "/usr/share/webapps/cgit/">
   AllowOverride None
   Options None
   Order allow,deny
   Allow from all
</Directory>
<Directory "/usr/lib/cgit/">
   AllowOverride None
   Options ExecCGI FollowSymlinks
   Order allow,deny
   Allow from all
</Directory>

Adding repositories

Before you can start adding repositories you will first have to create the basic cgit configuration file at /etc/cgitrc. You should at least specify the Stylesheet:

#
# cgit config
#

css=/cgit-css/cgit.css

Now you can add your repos:

#
# List of repositories.
# This list could be kept in a different file (e.g. '/etc/cgitrepos')
# and included like this:
#   include=/etc/cgitrepos
#

repo.url=MyRepo
repo.path=/srv/git/MyRepo.git
repo.desc=This is my git repository

repo.url=MyOtherRepo
repo.path=/srv/git/MyOtherRepo.git
repo.desc=That's my other git repository

If you prefer not having to manually specify each repository it's also possible to configure cgit to search for them:

scan-path=/srv/git/

For detailed documentation about the available settings in this configuration file, please see the manage (`man cgitrc`).

Gitosis Integration

If you want to integrate with gitosis you will have to run two commands to give apache permission to look though the folder.

# chgrp http /srv/gitosis
# chmod a+rx /srv/gitosis

References