файл конфигурации Gitweb (веб-интерфейс Git) (Gitweb (Git web interface) configuration file)
Обсуждение (Discussion)
Gitweb reads configuration data from the following sources in the
following order:
• built-in values (some set during build stage),
• common system-wide configuration file (defaults to
/etc/gitweb-common.conf
),
• either per-instance configuration file (defaults to
gitweb_config.perl in the same directory as the installed
gitweb), or if it does not exists then fallback system-wide
configuration file (defaults to /etc/gitweb.conf
).
Values obtained in later configuration files override values
obtained earlier in the above sequence.
Locations of the common system-wide configuration file, the
fallback system-wide configuration file and the per-instance
configuration file are defined at compile time using build-time
Makefile configuration variables, respectively
GITWEB_CONFIG_COMMON
, GITWEB_CONFIG_SYSTEM
and GITWEB_CONFIG
.
You can also override locations of gitweb configuration files
during runtime by setting the following environment variables:
GITWEB_CONFIG_COMMON
, GITWEB_CONFIG_SYSTEM
and GITWEB_CONFIG
to a
non-empty value.
The syntax of the configuration files is that of Perl, since
these files are handled by sourcing them as fragments of Perl
code (the language that gitweb itself is written in). Variables
are typically set using the our
qualifier (as in "our $variable =
<value>;
") to avoid syntax errors if a new version of gitweb no
longer uses a variable and therefore stops declaring it.
You can include other configuration file using read_config_file()
subroutine. For example, one might want to put gitweb
configuration related to access control for viewing repositories
via Gitolite (one of Git repository management tools) in a
separate file, e.g. in /etc/gitweb-gitolite.conf
. To include it,
put
read_config_file("/etc/gitweb-gitolite.conf");
somewhere in gitweb configuration file used, e.g. in
per-installation gitweb configuration file. Note that
read_config_file() checks itself that the file it reads exists,
and does nothing if it is not found. It also handles errors in
included file.
The default configuration with no configuration file at all may
work perfectly well for some installations. Still, a
configuration file is useful for customizing or tweaking the
behavior of gitweb in many ways, and some optional features will
not be present unless explicitly enabled using the configurable
%features
variable (see also "Configuring gitweb features"
section below).