git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFD] Gitweb: Source configuration from file separate from the CGI script

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 17, 2011, 10:21 UTC
Message-ID
<m3lj0e59ps.fsf@localhost.localdomain>
In-Reply-To
<1300286650.28805.29.camel@drew-northup.unet.maine.edu>
Drew Northup <drew.northup@maine.edu> writes:
Show 6 quoted lines
> On Wed, 2011-03-16 at 09:34 -0500, Jonathan Nieder wrote:
> > Drew Northup wrote:
> > 
> > > I just upgraded my Gitweb package (I'm testing the EPEL RHEL5 latest;
> > > I'm not too happy with them tweaking the paths) and as I should have
> > > expected all of my Gitweb configuration is now gone.

We discourage configuring gitweb by editing generated gitweb.cgi file for a long, long time, at least since v1.4.2-rc2-102-gc8d138a (gitweb: optionally read config from GITWEB_CONFIG, 2006-08-02). It is described in gitweb/README since v1.4.3-rc1-7-g45a3b12 (gitweb: Document features better, 2006-10-07).

> > 
> > In gitweb/README, I see:

Not only gitweb/README; in gitweb.cgi that you are, I suppose, editing, you have $GITWEB_CONFIG mentioned 25 times as a place to override default configuration.

Show 7 quoted lines
> > 
> > | You can adjust gitweb behaviour using the file specified in `GITWEB_CONFIG`
> > | (defaults to 'gitweb_config.perl' in the same directory as the CGI), and
> > | as a fallback `GITWEB_CONFIG_SYSTEM` (defaults to /etc/gitweb.conf).
> 
> I apparently missed that. Alas, I didn't see it in the code when I was
> setting my values so I assumed that it wasn't available.
$GITWEB_CONFIG is mentioned 25 times in gitweb source; is it not enough?
> Perhaps we can make this a little more obvious?

How can we make it more obvious? gitweb/INSTALL has "Build time configuration" just below instruction on how to build it, and it mentions "How to configure gitweb for your local system" section in gitweb/README in very first line of this section.

> I'll go try that out and see if I can make it break--putting it in
> the same directory definitely wouldn't have helped this time.

First, as Jonathan cited, you can by default beside 'gitweb_config.perl' in the same directory as the CGI use ' /etc/gitweb.conf' file.

Second, you can configure where GITWEB_CONFIG and GITWEB_CONFIG_SYSTEM are to be found dusing build time, e.g.

  $ make GITWEB_CONFIG_SYSTEM=/etc/gitweb/gitweb_config.perl \
         install-gitweb

Third, you can override where gitweb searches for its config files using GITWEB_CONFIG and/or GITWEB_CONFIG_SYSTEM configuration variables; quite useful for debugging gitweb, and for gitweb tests in git.git repository.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Drew NorthupNext: Matt Ryan
Message 4 of 12 in “[RFD] Gitweb: Source configuration from file separate from the CGI script”
  1. Drew NorthupMar 16, 2011
  2. Jonathan NiederMar 16, 2011
  3. Drew NorthupMar 16, 2011
  4. Jakub NarebskiMar 17, 2011
  5. Matt RyanMar 22, 2011
  6. Jakub NarebskiMar 22, 2011
  7. Jakub NarebskiMar 17, 2011
  8. Drew NorthupMar 18, 2011
  9. Todd ZullingerMar 18, 2011
  10. Drew NorthupMar 18, 2011
  11. Todd ZullingerMar 18, 2011
  12. Jonathan NiederMar 18, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.