Annotation of cvsweb/cvsweb.conf, Revision 4.13
4.2 schwarze 1: # -*- perl -*-
4.13 ! schwarze 2: # $Id: cvsweb.conf,v 4.12 2019/11/26 11:28:43 schwarze Exp $
4.2 schwarze 3: # $doc: cvsweb.conf,v 1.38 2006/01/19 19:53:38 ceri
4: # $knu: cvsweb.conf,v 1.97 2005/06/19 09:13:50 scop
5: #
3.76 scop 6: # Configuration of cvsweb.cgi, a web interface to CVS repositories.
3.1 knu 7: #
8: # (c) 1998-1999 H. Zeller <zeller@think.de>
9: # 1999 H. Nordstrom <hno@hem.passagen.se>
3.30 knu 10: # 2000-2002 A. MUSHA <knu@FreeBSD.org>
3.95 scop 11: # 2002-2005 V. Skyttä <scop@FreeBSD.org>
3.1 knu 12: # based on work by Bill Fenner <fenner@FreeBSD.org>
13:
3.92 scop 14: #
15: # Unless otherwise noted, all boolean parameters here default to off
16: # when no value for them has been explicitly set.
17: #
18:
3.19 knu 19: # Set the path for the following commands:
3.47 scop 20: # cvs, rlog, rcsdiff
3.19 knu 21: # gzip (if you enable $allow_compress)
4.13 ! schwarze 22: # (g)tar (if you enable $allow_tar)
3.58 scop 23: #
3.73 scop 24: @command_path = qw(/bin /usr/bin /usr/local/bin);
3.19 knu 25:
3.47 scop 26: # Search the above directories for each command (prefer gtar over tar).
3.58 scop 27: #
4.13 ! schwarze 28: for (qw(cvs rlog rcsdiff gzip gtar)) {
3.26 knu 29: $CMD{$_} = search_path($_);
3.19 knu 30: }
3.47 scop 31: $CMD{tar} = delete($CMD{gtar}) if $CMD{gtar};
32: $CMD{tar} ||= search_path('tar');
3.19 knu 33:
3.53 scop 34: # CVS roots
35: #
36: # CVSweb can handle several CVS repositories at once. Enter short (internal)
37: # symbolic repository names, their names in the UI and the actual locations
38: # here. The repositories will be listed in the order they're specified here.
39: #
3.93 scop 40: # Obviously, CVSweb will need read access to these repository dirs. If you
41: # receive an error that no valid CVS roots were found, double-check the file
42: # permissions and any other attributes your system may have for the repository
43: # directories, such as SELinux file contexts.
44: #
3.76 scop 45: # CVSweb will also load per-cvsroot configuration files if they exist.
46: # The symbolic_name (see below) of the CVS root will be concatenated into the
47: # name of the main (this) configuration file along with a hyphen, and that
48: # file will be loaded for that particular CVS root. For examples, see
49: # cvsweb.conf-* in the CVSweb distribution.
50: #
3.53 scop 51: # Note that only local repositories are currently supported. Things like
52: # :pserver:someone@xyz.com:/data/cvsroot won't work.
53: #
54: # 'symbolic_name' => ['Name to display', '/path/to/cvsroot']
55: #
3.17 knu 56: @CVSrepositories = (
4.4 schwarze 57: 'local' => ['Local Repository', '/cvs'],
3.26 knu 58: );
3.1 knu 59:
3.53 scop 60: # The default CVS root. Note that @CVSrepositories is list, not a hash,
61: # so you'll want to use 2 * 0-based-index-number here; or set this directly
62: # to the default's symbolic name. Unless specified, the first valid one in
63: # @CVSrepositories is used as the default.
64: #
65: # For example:
66: #
67: #$cvstreedefault = $CVSrepositories[2 * 0];
68: #$cvstreedefault = 'local';
3.1 knu 69:
3.88 scop 70: # Mirror sites. The keys will be used as link texts, and the values are
71: # URLs pointing to the corresponding mirrors.
72: #
73: #%MIRRORS = (
74: # 'Other location' => 'http://192.168.0.1/cgi-bin/cvsweb.cgi/',
75: # 'Yet another one' => 'http://192.168.0.2/cgi-bin/cvsweb.cgi/',
76: #);
77:
3.92 scop 78: # Manual gateway linking. This will be done only for views for which
79: # $allow_*_extra below is true.
3.76 scop 80: #
3.26 knu 81: $mancgi =
3.98 ceri 82: "http://www.FreeBSD.org/cgi/man.cgi?apropos=0&sektion=%s&query=%s&manpath=FreeBSD+7.0-current&format=html";
3.1 knu 83:
3.90 scop 84: # Defaults for user definable options.
3.76 scop 85: #
3.1 knu 86: %DEFAULTVALUE = (
3.26 knu 87:
3.76 scop 88: # sortby: File sort order
89: # file Sort by filename
90: # rev Sort by revision number
91: # date Sort by commit date
92: # author Sort by author
93: # log Sort by log message
94: "sortby" => "file",
95:
96: # ignorecase: Ignore case in sorts (filenames, authors, log messages)
97: # 0 Honor case
98: # 1 Ignore case
99: "ignorecase" => "0",
100:
101: # hideattic: Hide or show files in Attic
102: # 1 Hide files in Attic
103: # 0 Show files in Attic
104: "hideattic" => "1",
105:
106: # logsort: Sort order for CVS logs
107: # date Sort revisions by date
108: # rev Sort revision by revision number
109: # cvs Don't sort them. Same order as CVS/RCS shows them.
110: "logsort" => "date",
111:
112: # f: Default diff format
113: # h Human readable
114: # u Unified diff
115: # c Context diff
116: "f" => "u",
117:
3.90 scop 118: # hidecvsroot: Don't show the CVSROOT directory. Note that this is
119: # just the default for a user settable option (like others in this
120: # %DEFAULTVALUE hash); it won't really prevent access to CVSROOT.
121: # See @ForbiddenFiles for that.
122: # 1 Do not include the top-level CVSROOT directory in dir listings
123: # 0 Treat the top-level CVSROOT directory just like all other dirs
3.76 scop 124: "hidecvsroot" => "0",
125:
3.90 scop 126: # hidenonreadable: Don't show files and directories that cannot be read
127: # in directory listings.
3.76 scop 128: # 1 Hide non-readable entries
129: # 0 Show non-readable entries
130: "hidenonreadable" => "1",
131:
132: # ln: Show line numbers in HTMLized views
133: # 1 Show line numbers
134: # 0 Don't show line numbers
135: "ln" => "0",
3.1 knu 136: );
137:
3.76 scop 138: #
139: # Layout options (see also the included CSS file)
140: #
3.1 knu 141:
142: # Wanna have a logo on the page ?
3.58 scop 143: #
3.79 scop 144: #$logo = '<p><img src="/icons/apache_pb.gif" alt="Powered by Apache" /></p>';
3.1 knu 145:
3.79 scop 146: # The title of the Page on startup. This will be put inside <h1> and <title>
147: # tags, and HTML escaped.
3.58 scop 148: #
3.1 knu 149: $defaulttitle = "CVS Repository";
150:
3.34 scop 151: # The address is shown on the footer. This will be put inside a <address> tag.
3.58 scop 152: #
4.5 schwarze 153: $address = '<span style="font-size: smaller">CVSweb</span>';
3.1 knu 154:
155: $long_intro = <<EOT;
156: <p>
3.81 scop 157: This is a WWW interface for CVS repositories.
3.67 scop 158: You can browse the file hierarchy by following directory links (which
159: have slashes after them, e.g. <code>src/</code>).
160: If you follow a link to a file, you will see its revision history.
161: Following a link labeled with a revision number will display that
162: revision of the file. In the revision history view, there is a link
163: near each revision to display diffs between that revision and the
164: previous one, and a form at the bottom of the page that allows you to
3.1 knu 165: display diffs between arbitrary revisions.
3.67 scop 166: </p><p>
3.33 scop 167: This script has been written by Bill Fenner and improved by Henner Zeller,
168: Henrik Nordström, and Ken Coar, then Akinori MUSHA brought it
3.22 knu 169: back to FreeBSD community and made further improvements; it is covered
3.33 scop 170: by <a
3.97 scop 171: href="http://www.opensource.org/licenses/bsd-license.html">The BSD License</a>.
3.67 scop 172: </p><p>
3.1 knu 173: If you would like to use this CGI script on your own web server and
4.5 schwarze 174: CVS tree, download the latest version from
175: <<a href="http://cvsweb.bsd.lv/">http://cvsweb.bsd.lv/</a>>.
3.1 knu 176: </p>
177: EOT
178:
179: $short_instruction = <<EOT;
180: <p>
181: Click on a directory to enter that directory. Click on a file to display
3.32 scop 182: its revision history and to get a chance to display diffs between revisions.
3.1 knu 183: </p>
184: EOT
185:
3.42 scop 186: # Icons for the web UI. If ICON-URL is empty, the TEXT representation is
187: # used. If you do not want to have a tool tip for an icon, set TEXT empty.
188: # The width and height of the icon allow the browser to correctly display
189: # the table while still loading the icons. If these icons are too large,
190: # check out the "mini" versions in the icons/ directory; they have a
191: # width/height of 16/16.
3.58 scop 192: #
3.42 scop 193: my $iconsdir = '/icons';
194:
3.51 scop 195: # format: TEXT ICON-URL width height
3.26 knu 196: %ICONS = (
3.51 scop 197: back => [('[BACK]', "$iconsdir/back.gif", 20, 22)],
198: dir => [('[DIR]', "$iconsdir/dir.gif", 20, 22)],
199: file => [('[TXT]', "$iconsdir/text.gif", 20, 22)],
3.87 scop 200: binfile => [('[BIN]', "$iconsdir/binary.gif", 20, 22)],
3.26 knu 201: );
3.15 knu 202: undef $iconsdir;
3.1 knu 203:
3.43 scop 204: # An URL where to find the CSS.
3.58 scop 205: #
3.43 scop 206: $cssurl = '/css/cvsweb.css';
207:
3.76 scop 208: # The length to which the last log entry should be truncated when shown
209: # in the directory view.
3.58 scop 210: #
3.1 knu 211: $shortLogLen = 80;
212:
3.76 scop 213: # Show author of last change?
3.58 scop 214: #
3.1 knu 215: $show_author = 1;
216:
3.76 scop 217: # Cell padding for directory table.
3.58 scop 218: #
3.1 knu 219: $tablepadding = 2;
220:
3.91 scop 221: # Regular expressions for files and directories which should be hidden.
3.75 scop 222: # Each regexp is compared against a path relative to a CVS root, after
223: # stripping the trailing ",v" if present. Matching files and directories
224: # are not displayed.
3.58 scop 225: #
3.27 knu 226: @ForbiddenFiles = (
3.74 scop 227: qr|^CVSROOT/+passwd$|o, # CVSROOT/passwd should not be 'cvs add'ed though.
228: qr|/\.cvspass$|o, # Ditto. Just in case.
3.75 scop 229: #qr|^my/+secret/+dir|o,
3.27 knu 230: );
3.1 knu 231:
3.77 scop 232: # Use CVSROOT/descriptions for describing the directories/modules?
3.69 scop 233: # See INSTALL, section 9.
3.1 knu 234: #
235: $use_descriptions = 0;
236:
3.76 scop 237: #
238: # Human readable diff.
239: #
3.1 knu 240: # (c) 1998 H. Zeller <zeller@think.de>
241: #
3.76 scop 242: # Generates two columns of color encoded diff; much like xdiff or GNU Emacs'
243: # ediff-mode.
3.1 knu 244: #
3.76 scop 245: # The diff-stuff is a piece of code I once made for cvs2html which is under
246: # GPL, see http://www.sslug.dk/cvs2html
3.1 knu 247: # (c) 1997/98 Peter Toft <pto@sslug.imm.dtu.dk>
248:
3.76 scop 249: # Make lines breakable so that the columns do not exceed the width of the
250: # browser?
3.58 scop 251: #
3.1 knu 252: $hr_breakable = 1;
253:
3.80 scop 254: # Print function names in diffs (unified and context only).
255: # See the -p option in the diff(1) man page.
3.58 scop 256: #
3.4 knu 257: $showfunc = 1;
3.1 knu 258:
3.76 scop 259: # Ignore whitespace in human readable diffs? ('-w' option to diff)
3.58 scop 260: #
3.7 knu 261: $hr_ignwhite = 0;
3.1 knu 262:
3.76 scop 263: # Ignore diffs which are caused by keyword substitution, $Id and friends?
264: # ('-kk' option to rcsdiff)
3.58 scop 265: #
3.1 knu 266: $hr_ignkeysubst = 1;
267:
3.76 scop 268: # The width of the textinput of the "request diff" form.
3.58 scop 269: #
3.1 knu 270: $inputTextSize = 12;
3.70 scop 271:
272: # Custom per MIME type diff tools, used for comparing binary files such as
273: # spreadsheets, images etc. Each key is a MIME type in lowercase.
274: # Each value is an array ref of available diff tools for that type, each of
275: # which is a hash ref with values (mandatory where default not listed):
276: # name: the name to show in the UI for this diff type
277: # cmd: full path to executable
278: # args: arguments as an array ref (not string!, defaults to no arguments)
279: # type: output MIME type (defaults to text/plain)
280: #
281: %DIFF_COMMANDS = (
282: #'text/xml' => [
283: # { name => 'XMLdiff',
284: # cmd => $CMD{xmldiff},
285: # },
286: # { name => 'XMLdiff (XUpdate)',
287: # cmd => $CMD{xmldiff},
288: # args => [ qw(-x) ],
289: # type => 'text/xml',
290: # },
291: #],
292: );
3.1 knu 293:
3.76 scop 294: #
295: # Mime types
296: #
3.1 knu 297:
3.52 scop 298: # The MIME type lookup works like this:
299: # 1) Look up from %MTYPES below with the file name extension (suffix).
300: # 2) If not found, use the MIME::Types(3) module if it's available.
301: # 3) If not found, lookup from the $mime_types file (see below).
302: # 4) If not found, try %MTYPES{'*'}.
303: # 5) If not found, use 'application/octet-stream' if the file's keyword
304: # substitution mode is b (ie. the file was checked in as binary to CVS),
305: # 'text/plain' otherwise.
3.1 knu 306:
3.52 scop 307: # Quick MIME type lookup; maps filename extensions to MIME types.
308: # Add common mappings here for fast lookup. You can also use this
309: # to override MIME::Types(3) or the $mime_types file (see below).
3.58 scop 310: #
3.1 knu 311: %MTYPES = (
3.26 knu 312: "html" => "text/html",
313: "shtml" => "text/html",
314: "gif" => "image/gif",
315: "jpeg" => "image/jpeg",
316: "jpg" => "image/jpeg",
317: "png" => "image/png",
318: "xpm" => "image/xpm",
3.52 scop 319: # "*" => "text/plain",
3.26 knu 320: );
3.52 scop 321:
322: # The traditional mime.types file, eg. the one from Apache is fine.
323: # See above where this gets used.
3.58 scop 324: #
4.3 schwarze 325: $mime_types = '/conf/mime.types';
3.11 knu 326:
3.56 scop 327: # Charset appended to the Content-Type HTTP header for text/* MIME types.
328: # Note that the web server may default to some charset which may take effect
329: # if you leave this parameter empty or unset.
3.69 scop 330: # For Apache, see also the AddDefaultCharset directive.
3.56 scop 331: #
3.13 knu 332: $charset = '';
3.26 knu 333:
3.13 knu 334: # e.g.
335: #$charset = $where =~ m,/ru[/_-], ? 'koi8-r'
336: # : $where =~ m,/zh[/_-], ? 'big5'
337: # : $where =~ m,/ja[/_-], ? 'x-euc-jp'
338: # : $where =~ m,/ko[/_-], ? 'x-euc-kr'
339: # : 'iso-8859-1';
3.29 knu 340:
341: # Output filter
3.58 scop 342: #
3.29 knu 343: $output_filter = '';
344:
345: # e.g.
346: ## unify/convert Japanese code into EUC-JP
347: #$output_filter= '/usr/local/bin/nkf -e';
3.1 knu 348:
349: ##############
350: # Misc
351: ##############
3.58 scop 352:
3.76 scop 353: # Allow annotation of files? See also @annotate_options below.
3.58 scop 354: #
3.1 knu 355: $allow_annotate = 1;
356:
3.96 scop 357: # Allow HTMLized versions of files?
3.58 scop 358: #
3.1 knu 359: $allow_markup = 1;
360:
3.96 scop 361: # Allow CVSweb to create mailto: links from email addresses in various
362: # HTMLized views? Default: yes.
363: #
364: #$allow_mailtos = 0;
365:
4.8 schwarze 366: ## Extra hyperlinking means hyperlinks to manual page
367: ## gateways, see $mancgi above.
3.92 scop 368:
3.76 scop 369: # Allow extra hyperlinking (such as PR cross-references) in logs?
3.92 scop 370: # Default: yes.
3.58 scop 371: #
3.92 scop 372: #$allow_log_extra = 0;
3.31 knu 373:
3.92 scop 374: # Allow extra hyperlinking in directory views?
3.58 scop 375: #
3.31 knu 376: $allow_dir_extra = 1;
377:
3.76 scop 378: # Allow extra hyperlinking in source code/formatted diff views?
3.58 scop 379: #
3.31 knu 380: $allow_source_extra = 1;
381:
3.76 scop 382: # Allow compression with gzip in general? Note that this also requires
383: # that the browser supports it, and will be disabled on the fly when necessary.
3.58 scop 384: #
3.92 scop 385: #$allow_compress = 1;
3.1 knu 386:
3.76 scop 387: # Show a form for setting options in the directory view?
3.58 scop 388: #
389: $edit_option_form = 1;
3.1 knu 390:
3.77 scop 391: # Show last changelog message for subdirectories?
3.1 knu 392: # The current implementation makes many assumptions and may show the
393: # incorrect file at some times. The main assumption is that the last
394: # modified file has the newest filedate. But some CVS operations
3.97 scop 395: # touch the file even when a new version isn't checked in, and TAG
396: # based browsing essentially puts this out of order unless the last
397: # checkin was on the same tag as you are viewing.
3.1 knu 398: # Enable this if you like the feature, but don't rely on correct results.
3.58 scop 399: #
3.92 scop 400: #$show_subdir_lastmod = 1;
3.1 knu 401:
3.76 scop 402: # Show CVS log when viewing file contents?
3.58 scop 403: #
3.1 knu 404: $show_log_in_markup = 1;
405:
3.77 scop 406: # Preformat when viewing file contents? This should be turned off
3.13 knu 407: # when you have files in the repository that are in a multibyte
408: # encoding which uses HTML special characters ([<>&"]) as part of a
3.97 scop 409: # multibyte character. (such as iso-2022-jp, ShiftJIS, etc.)
3.13 knu 410: # Otherwise those files will get screwed up in markup.
3.58 scop 411: #
3.92 scop 412: #$preformat_in_markup = 1;
3.13 knu 413:
3.92 scop 414: # Default tab width used to expand tabs to spaces in various HTMLized views.
415: # Note that CVSweb scans the first few lines of sources for some common editor
416: # directives controlling the tab width. It uses the value from them if found,
417: # falling back to the value of $tabstop if not. Default: 8.
3.58 scop 418: #
3.92 scop 419: #$tabstop = 4;
3.1 knu 420:
3.82 scop 421: # CVSweb is friendly to caches by sending the HTTP Last-Modified
422: # header corresponding to the sent content. In the case of a
423: # checkout, this may require running rcslog on the file solely for the
424: # purpose of retrieving the timestamp to be sent. If you have a slow
3.92 scop 425: # server, you may want to turn this off for a small performance gain.
3.58 scop 426: #
3.1 knu 427: $use_moddate = 1;
428:
3.45 scop 429: # Maximum number of filenames to pass to rlog(1) in one command.
430: # If you see "Failed to spawn GNU rlog" errors with directories containing
431: # lots of files, experiment by setting this to different values and see if
432: # the error still occurs. A good value to start from would be eg. 200.
433: # Just comment this out if you're not bitten by the problem.
3.57 scop 434: #
3.45 scop 435: #$file_list_len = 200;
3.86 scop 436:
4.13 ! schwarze 437: # Whether to allow downloading a tarball of the current directory.
3.57 scop 438: # While downloading of the entire repository is disallowed, depending on
439: # the directory this may take a lot of time and disk space. For some CVS
3.69 scop 440: # versions, the user account running CVSweb needs write access to
4.13 ! schwarze 441: # CVSROOT/val-tags. See also the tar and gzip options below.
3.57 scop 442: #
4.13 ! schwarze 443: #$allow_tar = ($CMD{tar} && $CMD{gzip}) ? 1 : 0;
3.57 scop 444:
3.13 knu 445: # Options to pass to tar(1).
3.57 scop 446: # For example: @tar_options = qw(--ignore-failed-read);
447: # GNU tar has some useful options against unexpected errors.
448: # Other useful options include "--owner=0" and "--group=0", see
449: # the tar(1) (or gtar(1)) manpage for details.
450: #
3.15 knu 451: @tar_options = qw();
3.26 knu 452:
3.19 knu 453: # Options to pass to gzip(1) when compressing a tarball to download.
3.57 scop 454: # For example: @gzip_options = qw(-3);
455: # Try lower compression level than 6 (default) if you want faster
456: # compression, or higher for better compression.
457: #
3.19 knu 458: @gzip_options = qw();
3.26 knu 459:
3.13 knu 460: # Options to pass to cvs(1).
3.63 scop 461: # For cvs versions 1.11 to 1.11.6 (broken in < 1.11, removed in 1.11.7), you
462: # can use the '-l' option to prevent cvs from writing to the history file.
463: # For other cvs versions, either suppress history logging by using the
3.69 scop 464: # LogHistory parameter in CVSROOT/config or make sure that the CVSweb user
3.63 scop 465: # can read and write to CVSROOT/history.
3.61 scop 466: # FreeBSD's and OpenBSD's cvs(1) has long since supported -R (read only access
467: # mode) option, which considerably speeds up checkouts over NFS. For other
3.62 scop 468: # platforms, the -R option and the CVSREADONLYFS environment variable are
469: # available in cvs >= 1.12.1. A similar effect is provided by -u on NetBSD.
3.57 scop 470: #
3.85 scop 471: @cvs_options = qw(-f);
3.47 scop 472: push @cvs_options, '-R' if ($^O eq 'freebsd' || $^O eq 'openbsd');
473: push @cvs_options, '-u' if ($^O eq 'netbsd');
3.62 scop 474: # Only affects cvs >= 1.12.1, but doesn't hurt older ones.
475: $ENV{CVSREADONLYFS} = 1 unless exists($ENV{CVSREADONLYFS});
3.26 knu 476:
3.39 scop 477: # Options to pass to the 'cvs annotate' command, usually the normal
478: # @cvs_options are good enough here.
3.57 scop 479: # To make annotate work against a read only repository, add -n, ie.:
480: # @annotate_options = (@cvs_options, '-n');
481: #
3.39 scop 482: @annotate_options = @cvs_options;
483:
3.54 scop 484: # Options to pass to rcsdiff(1).
485: # Probably the only useful one here is -q (suppress diagnostic output).
3.57 scop 486: #
3.54 scop 487: @rcsdiff_options = qw(-q);
3.39 scop 488:
3.89 scop 489: # Troubleshooting: in case of problems, setting this to 1 will cause more
490: # error output into your web server error log. Under normal operation,
491: # this should be set to 0 or commented out.
492: #
493: #$DEBUG = 1;
3.94 scop 494:
3.12 knu 495: 1;
3.26 knu 496:
3.57 scop 497: # EOF
CVSweb