From: Andres Salomon <dilinger@athenacr.com>
To: git@vger.kernel.org, Kay Sievers <kay.sievers@vrfy.org>
Subject: add conf file support to gitweb
Date: Fri, 20 May 2005 15:29:45 -0400 [thread overview]
Message-ID: <1116617385.15157.19.camel@jack.dev.in.athenacr.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 405 bytes --]
Hi,
The attached patch makes gitweb read and eval variables from
an /etc/gitweb.conf file. This is useful for distributions; I'm
packaging gitweb for debian, and want to have a separate config file
that users can edit that won't get overwritten when they upgrade gitweb.
Even if you don't take this patch, please consider some other method
that decouples the configuration from the gitweb.cgi script.
[-- Attachment #2: gitweb.conf.patch --]
[-- Type: text/x-patch, Size: 687 bytes --]
Index: gitweb.cgi
===================================================================
--- 8b7a4b08ba4892970a2531d4c1584e3881a13586/gitweb.cgi (mode:100644)
+++ fe8329b147103e115e2ad727bfca34c2ecfa901d/gitweb.cgi (mode:100755)
@@ -40,6 +40,16 @@
#my $projects_list = $projectroot;
my $projects_list = "index/index.aux";
+# allow config file to override settings above
+if (-r '/etc/gitweb.conf') {
+ open(CONF, '/etc/gitweb.conf') || die_error(undef, "Cannot open /etc/gitweb.conf.");
+ while (<CONF>) {
+ chomp;
+ eval($_) if ($_ =~ /^\s*(\$[\w]+)\s*=\s*(.*)\s*$/);
+ }
+ close(CONF);
+}
+
# input validation and dispatch
my $action = $cgi->param('a');
if (defined $action) {
reply other threads:[~2005-05-20 19:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1116617385.15157.19.camel@jack.dev.in.athenacr.com \
--to=dilinger@athenacr.com \
--cc=git@vger.kernel.org \
--cc=kay.sievers@vrfy.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox