about summary refs log tree commit homepage
path: root/lib/PublicInbox/Config.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2024-02-13 09:31:27 +0000
committerEric Wong <e@80x24.org>2024-02-14 07:25:48 +0000
commit57269a32a9acbeb5be3830a979c9bbae5b350e4c (patch)
tree7ba844fac013c9855a8f2adbc27257508ec894d2 /lib/PublicInbox/Config.pm
parentc22d8d2b3fa6403882dfe9c4e63d0aae86620f58 (diff)
downloadpublic-inbox-57269a32a9acbeb5be3830a979c9bbae5b350e4c.tar.gz
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.
Diffstat (limited to 'lib/PublicInbox/Config.pm')
-rw-r--r--lib/PublicInbox/Config.pm3
1 files changed, 2 insertions, 1 deletions
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