1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-01 14:57:52 +01:00
git/gitweb/README

71 lines
2.3 KiB
Text
Raw Normal View History

GIT web Interface
=================
From the git version 1.4.0 gitweb is bundled with git.
Build time gitweb configuration
-------------------------------
There are many configuration variables which affect building gitweb (among
others creating gitweb.cgi out of gitweb.perl by replacing placeholders such
as `++GIT_BINDIR++` by their build-time values).
Building and installing gitweb is described in gitweb's INSTALL file
(in 'gitweb/INSTALL').
Runtime gitweb configuration
----------------------------
gitweb: Introduce common system-wide settings for convenience Because of backward compatibility we cannot change gitweb to always use /etc/gitweb.conf (i.e. even if gitweb_config.perl exists). For common system-wide settings we therefore need separate configuration file: /etc/gitweb-common.conf. Long description: gitweb currently obtains configuration from the following sources: 1. per-instance configuration file (default: gitweb_conf.perl) 2. system-wide configuration file (default: /etc/gitweb.conf) If per-instance configuration file exists, then system-wide configuration is _not used at all_. This is quite untypical and suprising behavior. Moreover it is different from way git itself treats /etc/git.conf. It reads in stuff from /etc/git.conf and then local repos can change or override things as needed. In fact this is quite beneficial, because it gives site admins a simple and easy way to give an automatic hint to a repo about things the admin would like. On the other hand changing current behavior may lead to the situation, where something in /etc/gitweb.conf may interfere with unintended interaction in the local repository. One solution would be to _require_ to do explicit include; with read_config_file() it is now easy, as described in gitweb/README (description introduced in this commit). But as J.H. noticed we cannot ask people to modify their per-instance gitweb config file to include system-wide settings, nor we can require them to do this. Therefore, as proposed by Junio, for gitweb to have centralized config elements while retaining backwards compatibility, introduce separate common system-wide configuration file, by default /etc/gitweb-common.conf Noticed-by: Drew Northup <drew.northup@maine.edu> Helped-by: John 'Warthog9' Hawley <warthog9@kernel.org> Inspired-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-07-25 00:29:18 +02:00
Gitweb obtains configuration data from the following sources in the
following order:
1. built-in values (some set during build stage),
2. common system-wide configuration file (`GITWEB_CONFIG_COMMON`,
defaults to '/etc/gitweb-common.conf'),
3. either per-instance configuration file (`GITWEB_CONFIG`, defaults to
'gitweb_config.perl' in the same directory as the installed gitweb),
or if it does not exists then system-wide configuration file
(`GITWEB_CONFIG_SYSTEM`, defaults to '/etc/gitweb.conf').
Values obtained in later configuration files override values obtained earlier
in above sequence.
You can read defaults in system-wide GITWEB_CONFIG_SYSTEM from GITWEB_CONFIG
by adding
read_config_file($GITWEB_CONFIG_SYSTEM);
at very beginning of per-instance GITWEB_CONFIG file. In this case
settings in said per-instance file will override settings from
system-wide configuration file. Note that read_config_file checks
itself that the $GITWEB_CONFIG_SYSTEM file exists.
The most notable thing that is not configurable at compile time are the
optional features, stored in the '%features' variable.
Ultimate description on how to reconfigure the default features setting
in your `GITWEB_CONFIG` or per-project in `project.git/config` can be found
as comments inside 'gitweb.cgi'.
See also gitweb.conf(5) manpage.
Web server configuration
------------------------
Gitweb can be run as CGI script, as legacy mod_perl application (using
ModPerl::Registry), and as FastCGI script. You can find some simple examples
in "Example web server configuration" section in INSTALL file for gitweb (in
gitweb/INSTALL).
See "Webserver configuration" and "Advanced web server setup" sections in
gitweb(1) manpage.
AUTHORS
-------
Originally written by:
Kay Sievers <kay.sievers@vrfy.org>
Any comment/question/concern to:
Git mailing list <git@vger.kernel.org>