2 # Configuration of cvsweb.cgi, a web interface to CVS repositories.
4 # (c) 1998-1999 H. Zeller <zeller@think.de>
5 # 1999 H. Nordstrom <hno@hem.passagen.se>
6 # 2000-2002 A. MUSHA <knu@FreeBSD.org>
7 # 2002-2004 V. Skytt� <scop@FreeBSD.org>
8 # based on work by Bill Fenner <fenner@FreeBSD.org>
10 # $FreeBSD: projects/cvsweb/cvsweb.conf,v 1.88 2004/08/10 20:13:40 scop Exp $
11 # $Idaemons: /home/cvs/cvsweb/cvsweb.conf,v 1.27 2001/08/01 09:48:39 knu Exp $
14 # Set the path for the following commands:
16 # gzip (if you enable $allow_compress)
17 # (g)tar, zip (if you enable $allow_tar)
18 # cvsgraph (if you enable $allow_graph)
19 # enscript (if you enable $allow_enscript)
21 @command_path = qw(/bin /usr/bin /usr/local/bin);
23 # Search the above directories for each command (prefer gtar over tar).
25 for (qw(cvs rlog rcsdiff gzip gtar zip cvsgraph enscript)) {
26 $CMD{$_} = search_path($_);
28 $CMD{tar} = delete($CMD{gtar}) if $CMD{gtar};
29 $CMD{tar} ||= search_path('tar');
33 # CVSweb can handle several CVS repositories at once. Enter short (internal)
34 # symbolic repository names, their names in the UI and the actual locations
35 # here. The repositories will be listed in the order they're specified here.
37 # CVSweb will also load per-cvsroot configuration files if they exist.
38 # The symbolic_name (see below) of the CVS root will be concatenated into the
39 # name of the main (this) configuration file along with a hyphen, and that
40 # file will be loaded for that particular CVS root. For examples, see
41 # cvsweb.conf-* in the CVSweb distribution.
43 # Note that only local repositories are currently supported. Things like
44 # :pserver:someone@xyz.com:/data/cvsroot won't work.
46 # 'symbolic_name' => ['Name to display', '/path/to/cvsroot']
49 'gforge' => ['GForge-CVS', '/var/lib/gforge/chroot/scmrepos/cvs'],
50 # 'freebsd' => ['FreeBSD', '/var/ncvs'],
51 # 'openbsd' => ['OpenBSD', '/var/ncvs'],
52 # 'netbsd' => ['NetBSD', '/var/ncvs'],
53 # 'ruby' => ['Ruby', '/var/anoncvs/ruby'],
56 # The default CVS root. Note that @CVSrepositories is list, not a hash,
57 # so you'll want to use 2 * 0-based-index-number here; or set this directly
58 # to the default's symbolic name. Unless specified, the first valid one in
59 # @CVSrepositories is used as the default.
63 #$cvstreedefault = $CVSrepositories[2 * 0];
64 #$cvstreedefault = 'local';
66 # Mirror sites. The keys will be used as link texts, and the values are
67 # URLs pointing to the corresponding mirrors.
70 # 'Other location' => 'http://192.168.0.1/cgi-bin/cvsweb.cgi/',
71 # 'Yet another one' => 'http://192.168.0.2/cgi-bin/cvsweb.cgi/',
74 # Bug tracking system linking options ("PR" means Problem Report, as in GNATS)
90 #$prcgi = "http://www.FreeBSD.org/cgi/query-pr.cgi?pr=%s";
93 # Manual gateway linking.
96 "http://www.FreeBSD.org/cgi/man.cgi?apropos=0&sektion=%s&query=%s&manpath=FreeBSD+5.0-current&format=html";
98 # Defaults for user options.
102 # sortby: File sort order
103 # file Sort by filename
104 # rev Sort by revision number
105 # date Sort by commit date
106 # author Sort by author
107 # log Sort by log message
110 # ignorecase: Ignore case in sorts (filenames, authors, log messages)
115 # hideattic: Hide or show files in Attic
116 # 1 Hide files in Attic
117 # 0 Show files in Attic
120 # logsort: Sort order for CVS logs
121 # date Sort revisions by date
122 # rev Sort revision by revision number
123 # cvs Don't sort them. Same order as CVS/RCS shows them.
126 # f: Default diff format
131 # uc Unified diff, enscript colored (falls back to "u" w/o enscript)
132 # cc Context diff, enscript colored (falls back to "c" w/o enscript)
133 # sc Side by side, enscript colored (falls back to "s" w/o enscript)
136 # hidecvsroot: Don't show the CVSROOT directory
137 # 1 Hide CVSROOT directory
138 # 0 Show CVSROOT directory
139 "hidecvsroot" => "0",
141 # hidenonreadable: Don't show entries which cannot be read
142 # 1 Hide non-readable entries
143 # 0 Show non-readable entries
144 "hidenonreadable" => "1",
146 # ln: Show line numbers in HTMLized views
147 # 1 Show line numbers
148 # 0 Don't show line numbers
153 # Layout options (see also the included CSS file)
156 # Wanna have a logo on the page ?
158 #$logo = '<p><img src="/icons/apache_pb.gif" alt="Powered by Apache" /></p>';
160 # The title of the Page on startup. This will be put inside <h1> and <title>
161 # tags, and HTML escaped.
163 $defaulttitle = "CVS Repository";
165 # The address is shown on the footer. This will be put inside a <address> tag.
167 $address = '<span style="font-size: smaller">FreeBSD-CVSweb <<a href="mailto:freebsd-cvsweb@FreeBSD.org">freebsd-cvsweb@FreeBSD.org</a>></span>';
171 This is a WWW interface for CVS repositories.
172 You can browse the file hierarchy by following directory links (which
173 have slashes after them, e.g. <code>src/</code>).
174 If you follow a link to a file, you will see its revision history.
175 Following a link labeled with a revision number will display that
176 revision of the file. In the revision history view, there is a link
177 near each revision to display diffs between that revision and the
178 previous one, and a form at the bottom of the page that allows you to
179 display diffs between arbitrary revisions.
181 This script has been written by Bill Fenner and improved by Henner Zeller,
182 Henrik Nordström, and Ken Coar, then Akinori MUSHA brought it
183 back to FreeBSD community and made further improvements; it is covered
185 href="http://www.opensource.org/licenses/bsd-license.html">The BSD Licence</a>.
187 If you would like to use this CGI script on your own web server and
188 CVS tree, download the latest version from <<a
189 href="http://www.FreeBSD.org/projects/cvsweb.html">http://www.FreeBSD.org/projects/cvsweb.html</a>>.
191 Feel free to send any patches, suggestions and comments to the FreeBSD-CVSweb
194 href="mailto:freebsd-cvsweb\@FreeBSD.org">freebsd-cvsweb\@FreeBSD.org</a>>.
198 $short_instruction = <<EOT;
200 Click on a directory to enter that directory. Click on a file to display
201 its revision history and to get a chance to display diffs between revisions.
205 # Icons for the web UI. If ICON-URL is empty, the TEXT representation is
206 # used. If you do not want to have a tool tip for an icon, set TEXT empty.
207 # The width and height of the icon allow the browser to correctly display
208 # the table while still loading the icons. If these icons are too large,
209 # check out the "mini" versions in the icons/ directory; they have a
210 # width/height of 16/16.
212 my $iconsdir = '/plugins/scmcvs/cvsweb/icons';
214 # format: TEXT ICON-URL width height
216 back => [('[BACK]', "$iconsdir/back.gif", 20, 22)],
217 dir => [('[DIR]', "$iconsdir/dir.gif", 20, 22)],
218 file => [('[TXT]', "$iconsdir/text.gif", 20, 22)],
219 binfile => [('[BIN]', "$iconsdir/binary.gif", 20, 22)],
220 graph => [('[GRAPH]', "$iconsdir/minigraph.png", 16, 16)],
224 # An URL where to find the CSS.
226 $cssurl = '/plugins/scmcvs/cvsweb/css/cvsweb.css';
228 # The length to which the last log entry should be truncated when shown
229 # in the directory view.
233 # Show author of last change?
236 $authorurl_pattern = '<a href="/users/:AUTHOR:">:AUTHOR:</a>';
238 # Cell padding for directory table.
242 # Regular expresions for files and directories which should be hidden.
243 # Each regexp is compared against a path relative to a CVS root, after
244 # stripping the trailing ",v" if present. Matching files and directories
248 qr|^CVSROOT/+passwd$|o, # CVSROOT/passwd should not be 'cvs add'ed though.
249 qr|/\.cvspass$|o, # Ditto. Just in case.
250 #qr|^my/+secret/+dir|o,
253 # Use CVSROOT/descriptions for describing the directories/modules?
254 # See INSTALL, section 9.
256 $use_descriptions = 0;
259 # Human readable diff.
261 # (c) 1998 H. Zeller <zeller@think.de>
263 # Generates two columns of color encoded diff; much like xdiff or GNU Emacs'
266 # The diff-stuff is a piece of code I once made for cvs2html which is under
267 # GPL, see http://www.sslug.dk/cvs2html
268 # (c) 1997/98 Peter Toft <pto@sslug.imm.dtu.dk>
270 # Make lines breakable so that the columns do not exceed the width of the
275 # Print function names in diffs (unified and context only).
276 # See the -p option in the diff(1) man page.
280 # For each pair of regexps, files that match the first regexp will be diff'ed
281 # with an -F option using the second regexp (unified and context only).
282 # See the -F option in the diff(1) man page.
285 qr/\.(?:4th|fr)$/o => "\\(^\\|[ \t]\\): ",
286 qr/\.rb$/o => "^[\t ]*\\(class\\|module\\|def\\) ",
289 # Ignore whitespace in human readable diffs? ('-w' option to diff)
293 # Ignore diffs which are caused by keyword substitution, $Id and friends?
294 # ('-kk' option to rcsdiff)
298 # The width of the textinput of the "request diff" form.
302 # Custom per MIME type diff tools, used for comparing binary files such as
303 # spreadsheets, images etc. Each key is a MIME type in lowercase.
304 # Each value is an array ref of available diff tools for that type, each of
305 # which is a hash ref with values (mandatory where default not listed):
306 # name: the name to show in the UI for this diff type
307 # cmd: full path to executable
308 # args: arguments as an array ref (not string!, defaults to no arguments)
309 # type: output MIME type (defaults to text/plain)
313 # { name => 'XMLdiff',
314 # cmd => $CMD{xmldiff},
316 # { name => 'XMLdiff (XUpdate)',
317 # cmd => $CMD{xmldiff},
318 # args => [ qw(-x) ],
319 # type => 'text/xml',
328 # The MIME type lookup works like this:
329 # 1) Look up from %MTYPES below with the file name extension (suffix).
330 # 2) If not found, use the MIME::Types(3) module if it's available.
331 # 3) If not found, lookup from the $mime_types file (see below).
332 # 4) If not found, try %MTYPES{'*'}.
333 # 5) If not found, use 'application/octet-stream' if the file's keyword
334 # substitution mode is b (ie. the file was checked in as binary to CVS),
335 # 'text/plain' otherwise.
337 # Quick MIME type lookup; maps filename extensions to MIME types.
338 # Add common mappings here for fast lookup. You can also use this
339 # to override MIME::Types(3) or the $mime_types file (see below).
342 "html" => "text/html",
343 "shtml" => "text/html",
344 "gif" => "image/gif",
345 "jpeg" => "image/jpeg",
346 "jpg" => "image/jpeg",
347 "png" => "image/png",
348 "xpm" => "image/xpm",
349 # "*" => "text/plain",
352 # The traditional mime.types file, eg. the one from Apache is fine.
353 # See above where this gets used.
355 $mime_types = '/usr/local/etc/apache/mime.types';
357 # Charset appended to the Content-Type HTTP header for text/* MIME types.
358 # Note that the web server may default to some charset which may take effect
359 # if you leave this parameter empty or unset.
360 # For Apache, see also the AddDefaultCharset directive.
365 #$charset = $where =~ m,/ru[/_-], ? 'koi8-r'
366 # : $where =~ m,/zh[/_-], ? 'big5'
367 # : $where =~ m,/ja[/_-], ? 'x-euc-jp'
368 # : $where =~ m,/ko[/_-], ? 'x-euc-kr'
376 ## unify/convert Japanese code into EUC-JP
377 #$output_filter= '/usr/local/bin/nkf -e';
383 # Allow annotation of files? See also @annotate_options below.
387 # Allow HTMLized version of files?
391 # Allow extra hyperlinking (such as PR cross-references) in logs?
393 $allow_log_extra = 1; # default: enabled
395 # Allow extra hyperlinking in directories?
397 $allow_dir_extra = 1;
399 # Allow extra hyperlinking in source code/formatted diff views?
401 $allow_source_extra = 1;
403 # Allow compression with gzip in general? Note that this also requires
404 # that the browser supports it, and will be disabled on the fly when necessary.
408 # Use JavaScript in the UI?
410 $use_java_script = 1;
412 # Show a form for setting options in the directory view?
414 $edit_option_form = 1;
416 # Show last changelog message for subdirectories?
417 # The current implementation makes many assumptions and may show the
418 # incorrect file at some times. The main assumption is that the last
419 # modified file has the newest filedate. But some CVS operations
420 # touches the file without even when a new version is't checked in,
421 # and TAG based browsing essientially puts this out of order, unless
422 # the last checkin was on the same tag as you are viewing.
423 # Enable this if you like the feature, but don't rely on correct results.
425 $show_subdir_lastmod = 0;
427 # Show CVS log when viewing file contents?
429 $show_log_in_markup = 1;
431 # Preformat when viewing file contents? This should be turned off
432 # when you have files in the repository that are in a multibyte
433 # encoding which uses HTML special characters ([<>&"]) as part of a
434 # multi-byte character. (such as iso-2022-jp, ShiftJIS, etc.)
435 # Otherwise those files will get screwed up in markup.
437 # Note: enscript(1) highlighting is preferred over the built-in preformatting,
438 # ie. this has no effect if $allow_enscript is true and enscript can highlight
441 $preformat_in_markup = 0;
443 # Tabstop used to expand tabs in colored diffs. If undefined then
444 # tabs are always expanded to 8 spaces.
448 # If you wish to display absolute times in your local timezone,
449 # then define @mytz and fill in the strings for your standard and
450 # daylight time. Note that you must also make sure the system
451 # timezone is correctly set.
453 #@mytz=("EST", "EDT");
455 # CVSweb is friendly to caches by sending the HTTP Last-Modified
456 # header corresponding to the sent content. In the case of a
457 # checkout, this may require running rcslog on the file solely for the
458 # purpose of retrieving the timestamp to be sent. If you have a slow
459 # server, you may turn this off for a small performance gain.
463 # Maximum number of filenames to pass to rlog(1) in one command.
464 # If you see "Failed to spawn GNU rlog" errors with directories containing
465 # lots of files, experiment by setting this to different values and see if
466 # the error still occurs. A good value to start from would be eg. 200.
467 # Just comment this out if you're not bitten by the problem.
469 #$file_list_len = 200;
471 # Allow graphical representations of file revisions and branches with CvsGraph?
473 $allow_cvsgraph = $CMD{cvsgraph} ? 1 : 0;
475 # Path to the CvsGraph configuration file. Only used if $allow_cvsgraph
476 # is true. Leave this empty or comment it out to make cvsgraph(1) use its
477 # default configuration file. Note that CVSweb will override some of the
478 # settings in the configuration file with command line options, see
479 # doGraph() and doGraphView() in cvsweb.cgi for details.
481 #$cvsgraph_config = "/etc/cvsgraph.conf";
483 # URL to the CVSHistory script. This should be absolute (but does not need
484 # to include the host and port if the script is on the same server as
486 #$cvshistory_url = "/cgi-bin/cvshistory.cgi";
488 # Whether to allow downloading a tarball or a zip of the current directory.
489 # While downloading of the entire repository is disallowed, depending on
490 # the directory this may take a lot of time and disk space. For some CVS
491 # versions, the user account running CVSweb needs write access to
492 # CVSROOT/val-tags. See also the tar, gzip and zip options below.
494 #$allow_tar = (($CMD{tar} && $CMD{gzip}) || $CMD{zip}) ? 1 : 0;
496 # Options to pass to tar(1).
497 # For example: @tar_options = qw(--ignore-failed-read);
498 # GNU tar has some useful options against unexpected errors.
499 # Other useful options include "--owner=0" and "--group=0", see
500 # the tar(1) (or gtar(1)) manpage for details.
504 # Options to pass to gzip(1) when compressing a tarball to download.
505 # For example: @gzip_options = qw(-3);
506 # Try lower compression level than 6 (default) if you want faster
507 # compression, or higher for better compression.
509 @gzip_options = qw();
511 # Options to pass to zip(1) when compressing a zip archive to download.
512 # For example: @zip_options = qw(-3);
513 # Try lower compression level than 6 (default) if you want faster
514 # compression, or higher for better compression.
516 @zip_options = qw(-q);
518 # Options to pass to cvs(1).
519 # For cvs versions 1.11 to 1.11.6 (broken in < 1.11, removed in 1.11.7), you
520 # can use the '-l' option to prevent cvs from writing to the history file.
521 # For other cvs versions, either suppress history logging by using the
522 # LogHistory parameter in CVSROOT/config or make sure that the CVSweb user
523 # can read and write to CVSROOT/history.
524 # FreeBSD's and OpenBSD's cvs(1) has long since supported -R (read only access
525 # mode) option, which considerably speeds up checkouts over NFS. For other
526 # platforms, the -R option and the CVSREADONLYFS environment variable are
527 # available in cvs >= 1.12.1. A similar effect is provided by -u on NetBSD.
529 @cvs_options = qw(-f);
530 push @cvs_options, '-R' if ($^O eq 'freebsd' || $^O eq 'openbsd');
531 push @cvs_options, '-u' if ($^O eq 'netbsd');
532 # Only affects cvs >= 1.12.1, but doesn't hurt older ones.
533 $ENV{CVSREADONLYFS} = 1 unless exists($ENV{CVSREADONLYFS});
535 # Options to pass to the 'cvs annotate' command, usually the normal
536 # @cvs_options are good enough here.
537 # To make annotate work against a read only repository, add -n, ie.:
538 # @annotate_options = (@cvs_options, '-n');
540 @annotate_options = @cvs_options;
542 # Options to pass to rcsdiff(1).
543 # Probably the only useful one here is -q (suppress diagnostic output).
545 @rcsdiff_options = qw(-q);
547 # Enables syntax highlighting using GNU Enscript if set.
548 # You will need GNU Enscript version 1.6.3 or newer for this to work.
550 #$allow_enscript = $CMD{enscript} ? 1 : 0;
552 # Options to pass to enscript(1).
553 # Do not set the -q, --language, -o or --highlight options here.
554 # Most useful styles are probably emacs, emacs_verbose and msvc.
556 @enscript_options = qw(--style=emacs --color=1);
558 # Enscript highlight rule to filename regex mappings. The set of useful
559 # mappings depends on what highlight rules the system has installed.
563 'ada' => qr/\.ad(s|b|a)$/o,
564 'asm' => qr/\.[Ss]$/o,
565 'awk' => qr/\.awk$/o,
566 'bash' => qr/\.(bash(_profile|rc)|inputrc)$/o,
567 'c' => qr/\.(c|h)$/o,
568 'changelog' => qr/^changelog$/io,
569 'cpp' => qr/\.(c\+\+|C|H|cpp|cc|cxx)$/o,
570 'csh' => qr/\.(csh(rc)?|log(in|out)|history)$/o,
571 'elisp' => qr/\.e(l|macs)$/o,
572 'fortran' => qr/\.[fF]$/o,
573 'haskell' => qr/\.(l?h|l?g)s$/o,
574 'html' => qr/\.x?html?$/o,
575 'idl' => qr/\.idl$/o,
576 'inf' => qr/\.inf$/io,
577 'java' => qr/\.java$/o,
578 'javascript' => qr/\.(js|pac)$/o,
579 'ksh' => qr/\.ksh$/o,
581 'makefile' => qr/(GNU)?[Mm]akefile(?!\.PL\b)|\.(ma?ke?|am)$/o,
582 'matlab' => qr/\.m$/o,
583 'nroff' => qr/\.man$/o,
584 'pascal' => qr/\.p(as|p)?$/io,
585 'perl' => qr/\.p(m|(er)?l)$/io,
586 'postscript' => qr/\.e?ps$/io,
587 'python' => qr/\.py$/o,
588 'rfc' => qr/\b((rfc|draft)\..*\.txt)$/o,
589 'scheme' => qr/\.(scm|scheme)$/o,
591 'skill' => qr/\.il$/o,
592 'sql' => qr/\.sql$/o,
593 'states' => qr/\.st$/o,
594 'synopsys' => qr/\.s(cr|yn(th)?)$/o,
595 'tcl' => qr/\.tcl$/o,
596 'tcsh' => qr/\.tcshrc$/o,
597 'tex' => qr/\.tex$/o,
598 'vba' => qr/\.vba$/o,
599 'verilog' => qr/\.(v|vh)$/o,
600 'vhdl' => qr/\.vhdl?$/o,
601 'vrml' => qr/\.wrl$/o,
602 'wmlscript' => qr/\.wmls(cript)?$/o,
603 'zsh' => qr/\.(zsh(env|rc)|z(profile|log(in|out)))$/o,