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