From 57269a32a9acbeb5be3830a979c9bbae5b350e4c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 13 Feb 2024 09:31:27 +0000 Subject: www: cgit: support non-standard cgitrc locations If publicinbox.cgitrc is set in the config file, we'll ensure cgit sees it as CGIT_CONFIG since the configured publicinbox.cgitrc knob may not be the default path the cgit.cgi binary was configured to use. Furthermore, we'll respect CGIT_CONFIG in the environment if publicinbox.cgitrc is unset in the config file at -httpd/-netd startup. --- lib/PublicInbox/Config.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Config.pm') diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm index b8d3c485..607197f6 100644 --- a/lib/PublicInbox/Config.pm +++ b/lib/PublicInbox/Config.pm @@ -305,7 +305,8 @@ sub apply_cgit_scan_path { sub parse_cgitrc { my ($self, $cgitrc, $nesting) = @_; - $cgitrc //= $self->{'publicinbox.cgitrc'} // return; + $cgitrc //= $self->{'publicinbox.cgitrc'} // + $ENV{CGIT_CONFIG} // return; if ($nesting == 0) { # defaults: my %s = map { $_ => 1 } qw(/cgit.css /cgit.png -- cgit v1.2.3-24-ge0c7