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