Merge branch 'jn/gitweb-system-config'
* jn/gitweb-system-config: gitweb: Introduce common system-wide settings for convenience
This commit is contained in:
@ -665,13 +665,25 @@ sub read_config_file {
|
||||
return;
|
||||
}
|
||||
|
||||
our ($GITWEB_CONFIG, $GITWEB_CONFIG_SYSTEM);
|
||||
our ($GITWEB_CONFIG, $GITWEB_CONFIG_SYSTEM, $GITWEB_CONFIG_COMMON);
|
||||
sub evaluate_gitweb_config {
|
||||
our $GITWEB_CONFIG = $ENV{'GITWEB_CONFIG'} || "++GITWEB_CONFIG++";
|
||||
our $GITWEB_CONFIG_SYSTEM = $ENV{'GITWEB_CONFIG_SYSTEM'} || "++GITWEB_CONFIG_SYSTEM++";
|
||||
our $GITWEB_CONFIG_COMMON = $ENV{'GITWEB_CONFIG_COMMON'} || "++GITWEB_CONFIG_COMMON++";
|
||||
|
||||
# use first config file that exists
|
||||
read_config_file($GITWEB_CONFIG) or
|
||||
# Protect agains duplications of file names, to not read config twice.
|
||||
# Only one of $GITWEB_CONFIG and $GITWEB_CONFIG_SYSTEM is used, so
|
||||
# there possibility of duplication of filename there doesn't matter.
|
||||
$GITWEB_CONFIG = "" if ($GITWEB_CONFIG eq $GITWEB_CONFIG_COMMON);
|
||||
$GITWEB_CONFIG_SYSTEM = "" if ($GITWEB_CONFIG_SYSTEM eq $GITWEB_CONFIG_COMMON);
|
||||
|
||||
# Common system-wide settings for convenience.
|
||||
# Those settings can be ovverriden by GITWEB_CONFIG or GITWEB_CONFIG_SYSTEM.
|
||||
read_config_file($GITWEB_CONFIG_COMMON);
|
||||
|
||||
# Use first config file that exists. This means use the per-instance
|
||||
# GITWEB_CONFIG if exists, otherwise use GITWEB_SYSTEM_CONFIG.
|
||||
read_config_file($GITWEB_CONFIG) and return;
|
||||
read_config_file($GITWEB_CONFIG_SYSTEM);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user