Merge from knu-cvsweb 1.112.1.82.

2001-08-01  Akinori MUSHA  <knu@iDaemons.org>

	* cvsweb.cgi: perltidy -i=8 -t -pt=2 -bt=2 -sbt=2 -ci=4 -noll -sfs
	-nasc -ce

	* cvsweb.conf, cvsweb.conf-freebsd, cvsweb.conf-netbsd,
	cvsweb.conf-openbsd, cvsweb.conf-ruby: perltidy -i=8 -t -pt=2 -bt=2
	-sbt=2 -ci=4 -noll -sfs -nasc -ce

	* cvsweb.cgi, cvsweb.conf: MFZ 1.111, but introduce @ForbiddenFiles
	instead of @DissallowRead to forbid user to cvs
	checkout/diff/annotate specified files.

	* cvsweb.cgi: MFZ 1.112: A couple of trivial fixes.

2001-07-26  Akinori MUSHA  <knu@iDaemons.org>

	* cvsweb.cgi: Chdir to TMPDIR so it works even when the cgi-bin
	directory is unreadable.
	[Submitted by: Dmitry Morozovsky <marck@rinet.ru>]

	* cvsweb.cgi: Let the module/path box appear and work properly
	when there is only one repository.
	[Submitted by: Dmitry Morozovsky <marck@rinet.ru>]
This commit is contained in:
Akinori MUSHA 2001-08-01 10:41:47 +00:00
parent 4f95a0576a
commit 500c71f667
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=10118
5 changed files with 2654 additions and 2313 deletions

File diff suppressed because it is too large Load diff

View file

@ -6,9 +6,9 @@
# 1999 H. Nordstrom <hno@hem.passagen.se> # 1999 H. Nordstrom <hno@hem.passagen.se>
# 2000-2001 A. MUSHA <knu@FreeBSD.org> # 2000-2001 A. MUSHA <knu@FreeBSD.org>
# based on work by Bill Fenner <fenner@FreeBSD.org> # based on work by Bill Fenner <fenner@FreeBSD.org>
# $Id: cvsweb.conf,v 1.21 2001-07-06 09:58:17 knu Exp $ # $Id: cvsweb.conf,v 1.22 2001-08-01 10:41:47 knu Exp $
# $Idaemons: /home/cvs/cvsweb/cvsweb.conf,v 1.25 2001/07/06 09:44:28 knu Exp $ # $Idaemons: /home/cvs/cvsweb/cvsweb.conf,v 1.27 2001/08/01 09:48:39 knu Exp $
# $FreeBSD: www/en/cgi/cvsweb.conf,v 1.20 2001/06/18 22:27:55 peter Exp $ # $FreeBSD: www/en/cgi/cvsweb.conf,v 1.21 2001/07/06 09:58:17 knu Exp $
# #
### ###
@ -20,7 +20,7 @@ $command_path = '/bin:/usr/bin:/usr/local/bin';
# Search the above directories for each command # Search the above directories for each command
for (qw(uname cvs rlog rcsdiff gzip tar rm zip)) { for (qw(uname cvs rlog rcsdiff gzip tar rm zip)) {
$CMD{$_} = search_path($_); $CMD{$_} = search_path($_);
} }
# The name of the operating system implementation # The name of the operating system implementation
@ -41,16 +41,16 @@ chomp($uname = `$CMD{uname}`);
# 'symbolic_name' => ['name_to_display', 'path_to_the_actual_repository'] # 'symbolic_name' => ['name_to_display', 'path_to_the_actual_repository']
# Listed in the order specified: # Listed in the order specified:
@CVSrepositories = ( @CVSrepositories = (
'freebsd' => ['FreeBSD', '/c/ncvs'], 'freebsd' => ['FreeBSD', '/c/ncvs'],
'openbsd' => ['OpenBSD', '/usr/local/www/cvsroot/OpenBSD'], 'openbsd' => ['OpenBSD', '/usr/local/www/cvsroot/OpenBSD'],
'netbsd' => ['NetBSD', '/usr/local/www/cvsroot/NetBSD'], 'netbsd' => ['NetBSD', '/usr/local/www/cvsroot/NetBSD'],
'44bsdlite' => ['4.4BSD-Lite', '/e/4.4BSD-Lite/4.4BSD-Lite-CVS'], '44bsdlite' => ['4.4BSD-Lite', '/e/4.4BSD-Lite/4.4BSD-Lite-CVS'],
'learn' => ['Learn', '/c/learncvs'], 'learn' => ['Learn', '/c/learncvs'],
); );
# This tree is enabled by default when # This tree is enabled by default when
# you enter the page # you enter the page
$cvstreedefault = $CVSrepositories[2 * 0]; # The first one $cvstreedefault = $CVSrepositories[2 * 0]; # The first one
############## ##############
# Mirror Sites # Mirror Sites
@ -69,19 +69,20 @@ $cvstreedefault = $CVSrepositories[2 * 0]; # The first one
# ("PR" means Problem Report, as in GNATS) # ("PR" means Problem Report, as in GNATS)
############## ##############
#@prcategories = qw( #@prcategories = qw(
# advocacy # advocacy
# alpha # alpha
# bin # bin
# conf # conf
# docs # docs
# gnu # gnu
# i386 # i386
# kern # kern
# misc # misc
# pending # pending
# ports # ports
# sparc # sparc
# ); #);
# #
#$prcgi = "http://www.FreeBSD.org/cgi/query-pr.cgi?pr=%s"; #$prcgi = "http://www.FreeBSD.org/cgi/query-pr.cgi?pr=%s";
# #
@ -90,50 +91,52 @@ $cvstreedefault = $CVSrepositories[2 * 0]; # The first one
############## ##############
# Manual gateway # Manual gateway
############## ##############
$mancgi = "http://www.FreeBSD.org/cgi/man.cgi?apropos=0&sektion=%s&query=%s&manpath=FreeBSD+5.0-current&format=html"; $mancgi =
"http://www.FreeBSD.org/cgi/man.cgi?apropos=0&sektion=%s&query=%s&manpath=FreeBSD+5.0-current&format=html";
############## ##############
# Defaults for UserSettings # Defaults for UserSettings
############## ##############
%DEFAULTVALUE = ( %DEFAULTVALUE = (
# sortby: File sort order
# file Sort by filename
# rev Sort by revision number
# date Sort by commit date
# author Sort by author
# log Sort by log message
"sortby" => "file", # sortby: File sort order
# file Sort by filename
# rev Sort by revision number
# date Sort by commit date
# author Sort by author
# log Sort by log message
# hideattic: Hide or show files in Attic "sortby" => "file",
# 1 Hide files in Attic
# 0 Show files in Attic
"hideattic" => "1", # hideattic: Hide or show files in Attic
# 1 Hide files in Attic
# 0 Show files in Attic
# logsort: Sort order for CVS logs "hideattic" => "1",
# date Sort revisions by date
# rev Sort revision by revision number
# cvs Don't sort them. Same order as CVS/RCS shows them.
"logsort" => "date", # logsort: Sort order for CVS logs
# date Sort revisions by date
# rev Sort revision by revision number
# cvs Don't sort them. Same order as CVS/RCS shows them.
# f: Default diff format "logsort" => "date",
# h Human readable
# u Unified diff
# c Context diff
# s Side by side
"f" => "u",
# hidecvsroot: Don't show the CVSROOT directory # f: Default diff format
# 1 Hide CVSROOT directory # h Human readable
# 0 Show CVSROOT directory # u Unified diff
"hidecvsroot" => "0", # c Context diff
# s Side by side
"f" => "u",
# hidenonreadable: Don't show entries which cannot be read # hidecvsroot: Don't show the CVSROOT directory
# 1 Hide non-readable entries # 1 Hide CVSROOT directory
# 0 Show non-readable entries # 0 Show CVSROOT directory
"hidenonreadable" => "1", "hidecvsroot" => "0",
# hidenonreadable: Don't show entries which cannot be read
# 1 Hide non-readable entries
# 0 Show non-readable entries
"hidenonreadable" => "1",
); );
############## ##############
@ -223,12 +226,13 @@ EOT
# If these icons are too large, check out the miniicons in the # If these icons are too large, check out the miniicons in the
# icons/ directory; they have a width/height of 16/16 # icons/ directory; they have a width/height of 16/16
my $iconsdir = "/icons"; my $iconsdir = "/icons";
# format: TEXT ICON-URL width height # format: TEXT ICON-URL width height
%ICONS = ( %ICONS = (
back => [ ("[BACK]", "$iconsdir/back.gif", 20, 22) ], back => [("[BACK]", "$iconsdir/back.gif", 20, 22)],
dir => [ ("[DIR]", "$iconsdir/dir.gif", 20, 22) ], dir => [("[DIR]", "$iconsdir/dir.gif", 20, 22)],
file => [ ("[TXT]", "$iconsdir/text.gif", 20, 22) ], file => [("[TXT]", "$iconsdir/text.gif", 20, 22)],
); );
undef $iconsdir; undef $iconsdir;
# the length to which the last logentry should # the length to which the last logentry should
@ -268,7 +272,20 @@ $tableBorderColor = '#cccccc';
# nor by explicit path specification. # nor by explicit path specification.
# #
@HideModules = ( @HideModules = (
); # "^my/secret/module",
);
#
# Files matching these pathnames shouldn't be checked out with cvsweb,
# since they may contain sensitive information. Simple file name based
# filter. Often, the CVSROOT/passwd is exposed and some people tend
# to check in their .cvspass, though this is a bad idea. These files
# shouldn't be readable by default. Thanks to Damian Gryski to point
# this out.
@ForbiddenFiles = (
"^CVSROOT/passwd\$", # CVSROOT/passwd should not be cvs add'ed, though
"/\\.cvspass\$", # Ditto. Just in case.
);
# #
# Use CVSROOT/CVSROOT/descriptions for describing the directories/modules # Use CVSROOT/CVSROOT/descriptions for describing the directories/modules
@ -306,9 +323,9 @@ $showfunc = 1;
# For each pair of regexps, files that match the first regexp will be diff'ed # For each pair of regexps, files that match the first regexp will be diff'ed
# with an '-F' option with the second regexp. # with an '-F' option with the second regexp.
%funcline_regexp = ( %funcline_regexp = (
"\\.(4th|fr)\$" => "\\(^\\|[ \t]\\): ", "\\.(4th|fr)\$" => "\\(^\\|[ \t]\\): ",
"\\.rb\$" => "^[\t ]*\\(class\\|module\\|def\\) ", "\\.rb\$" => "^[\t ]*\\(class\\|module\\|def\\) ",
); );
# ignore whitespaces for human readable diffs # ignore whitespaces for human readable diffs
# (indendation and stuff ..) # (indendation and stuff ..)
@ -321,14 +338,14 @@ $hr_ignwhite = 0;
$hr_ignkeysubst = 1; $hr_ignkeysubst = 1;
# Colors and font to show the diff type of code changes # Colors and font to show the diff type of code changes
$diffcolorHeading = '#99cccc'; # color of 'Line'-head of each diffed file $diffcolorHeading = '#99cccc'; # color of 'Line'-head of each diffed file
$diffcolorEmpty = '#cccccc'; # color of 'empty' lines $diffcolorEmpty = '#cccccc'; # color of 'empty' lines
$diffcolorRemove = '#ff9999'; # Removed line(s) (left) ( - ) $diffcolorRemove = '#ff9999'; # Removed line(s) (left) ( - )
$diffcolorChange = '#99ff99'; # Changed line(s) ( both ) $diffcolorChange = '#99ff99'; # Changed line(s) ( both )
$diffcolorAdd = '#ccccff'; # Added line(s) ( - ) (right) $diffcolorAdd = '#ccccff'; # Added line(s) ( - ) (right)
$diffcolorDarkChange = '#99cc99'; # lines, which are empty in change $diffcolorDarkChange = '#99cc99'; # lines, which are empty in change
$difffontface = "Helvetica,Arial"; $difffontface = "Helvetica,Arial";
$difffontsize = "-1"; $difffontsize = "-1";
# the width of the textinput of the # the width of the textinput of the
# request-diff-form # request-diff-form
@ -350,18 +367,19 @@ $mime_types = '/usr/local/etc/apache/mime.types';
# file $mime_types (apache style mime.types - file) # file $mime_types (apache style mime.types - file)
# - add common mappings here for faster lookup # - add common mappings here for faster lookup
%MTYPES = ( %MTYPES = (
"html" => "text/html", "html" => "text/html",
"shtml" => "text/html", "shtml" => "text/html",
"gif" => "image/gif", "gif" => "image/gif",
"jpeg" => "image/jpeg", "jpeg" => "image/jpeg",
"jpg" => "image/jpeg", "jpg" => "image/jpeg",
"png" => "image/png", "png" => "image/png",
"xpm" => "image/xpm", "xpm" => "image/xpm",
"*" => "text/plain", "*" => "text/plain",
); );
# Charset for HTML output # Charset for HTML output
$charset = ''; $charset = '';
# e.g. # e.g.
#$charset = $where =~ m,/ru[/_-], ? 'koi8-r' #$charset = $where =~ m,/ru[/_-], ? 'koi8-r'
# : $where =~ m,/zh[/_-], ? 'big5' # : $where =~ m,/zh[/_-], ? 'big5'
@ -463,17 +481,20 @@ $allow_tar = '';
# Options to pass to tar(1). # Options to pass to tar(1).
@tar_options = qw(--ignore-failed-read); @tar_options = qw(--ignore-failed-read);
# e.g. @tar_options = qw(--ignore-failed-read); # e.g. @tar_options = qw(--ignore-failed-read);
# GNU tar has some useful options against unexpected errors. # GNU tar has some useful options against unexpected errors.
# Options to pass to gzip(1) when compressing a tarball to download. # Options to pass to gzip(1) when compressing a tarball to download.
@gzip_options = qw(); @gzip_options = qw();
# e.g. @gzip_options = qw(-3); # e.g. @gzip_options = qw(-3);
# Try lower compression level than 6 (default) if you want faster # Try lower compression level than 6 (default) if you want faster
# compression, or higher, for better compression. # compression, or higher, for better compression.
# Options to pass to zip(1) when compressing a zip archive to download. # Options to pass to zip(1) when compressing a zip archive to download.
@zip_options = qw(); @zip_options = qw();
# e.g. @zip_options = qw(-3); # e.g. @zip_options = qw(-3);
# Try lower compression level than 6 (default) if you want faster # Try lower compression level than 6 (default) if you want faster
# compression, or higher, for better compression. # compression, or higher, for better compression.
@ -482,8 +503,10 @@ $allow_tar = '';
@cvs_options = qw(-l); @cvs_options = qw(-l);
push @cvs_options, '-R' if ($uname eq 'FreeBSD' || $uname eq 'OpenBSD'); push @cvs_options, '-R' if ($uname eq 'FreeBSD' || $uname eq 'OpenBSD');
# Only FreeBSD's and OpenBSD's cvs(1) supports -R (read only access # Only FreeBSD's and OpenBSD's cvs(1) supports -R (read only access
# mode) option, which considerably speeds up checkouts over NFS. # mode) option, which considerably speeds up checkouts over NFS.
1; 1;
#EOF #EOF

View file

@ -2,36 +2,37 @@
# #
# Set up for FreeBSD repo options. # Set up for FreeBSD repo options.
# #
# $Idaemons: /home/cvs/cvsweb/cvsweb.conf-freebsd,v 1.4 2001/01/13 07:48:09 knu Exp $ # $Idaemons: /home/cvs/cvsweb/cvsweb.conf-freebsd,v 1.5 2001/08/01 09:32:22 knu Exp $
# $FreeBSD: www/en/cgi/cvsweb.conf-freebsd,v 1.6 2001/01/12 04:26:10 knu Exp $ # $FreeBSD: www/en/cgi/cvsweb.conf-freebsd,v 1.7 2001/01/14 08:59:59 knu Exp $
if ($uname eq 'FreeBSD') { if ($uname eq 'FreeBSD') {
$ENV{'RCSLOCALID'} = 'FreeBSD=CVSHeader'; $ENV{'RCSLOCALID'} = 'FreeBSD=CVSHeader';
$ENV{'RCSINCEXC'} = 'iFreeBSD'; $ENV{'RCSINCEXC'} = 'iFreeBSD';
} else { } else {
$ENV{'RCSLOCALID'} = 'FreeBSD'; $ENV{'RCSLOCALID'} = 'FreeBSD';
} }
@prcategories = qw( @prcategories = qw(
advocacy advocacy
alpha alpha
bin bin
conf conf
docs docs
gnu gnu
i386 i386
kern kern
misc misc
pending pending
ports ports
sparc sparc
); );
$prcgi = "http://www.FreeBSD.org/cgi/query-pr.cgi?pr=%s"; $prcgi = "http://www.FreeBSD.org/cgi/query-pr.cgi?pr=%s";
$prkeyword = "PR"; $prkeyword = "PR";
$mancgi = "http://www.FreeBSD.org/cgi/man.cgi?apropos=0&sektion=%s&query=%s&manpath=FreeBSD+5.0-current&format=html"; $mancgi =
"http://www.FreeBSD.org/cgi/man.cgi?apropos=0&sektion=%s&query=%s&manpath=FreeBSD+5.0-current&format=html";
# Allow downloading a tarball of a port # Allow downloading a tarball of a port
$allow_tar = ($where =~ m,^ports/[^/]+/[^/]+/,); $allow_tar = ($where =~ m,^ports/[^/]+/[^/]+/,);

View file

@ -2,64 +2,64 @@
# #
# Set up for NetBSD repo options. # Set up for NetBSD repo options.
# #
# $Idaemons: /home/cvs/cvsweb/cvsweb.conf-netbsd,v 1.4 2001/01/13 07:48:09 knu Exp $ # $Idaemons: /home/cvs/cvsweb/cvsweb.conf-netbsd,v 1.5 2001/08/01 09:32:22 knu Exp $
# $FreeBSD: www/en/cgi/cvsweb.conf-netbsd,v 1.7 2001/01/12 04:26:10 knu Exp $ # $FreeBSD: www/en/cgi/cvsweb.conf-netbsd,v 1.8 2001/01/14 08:59:59 knu Exp $
if ($uname eq 'FreeBSD') { if ($uname eq 'FreeBSD') {
$ENV{'RCSLOCALID'} = 'NetBSD=CVSHeader'; $ENV{'RCSLOCALID'} = 'NetBSD=CVSHeader';
$ENV{'RCSINCEXC'} = 'iNetBSD'; $ENV{'RCSINCEXC'} = 'iNetBSD';
} else { } else {
$ENV{'RCSLOCALID'} = 'NetBSD'; $ENV{'RCSLOCALID'} = 'NetBSD';
} }
@prcategories = qw( @prcategories = qw(
admin admin
bin bin
install install
kern kern
lib lib
misc misc
pending pending
pkg pkg
port-alpha port-alpha
port-amiga port-amiga
port-arc port-arc
port-arm26 port-arm26
port-arm32 port-arm32
port-atari port-atari
port-bebox port-bebox
port-cobalt port-cobalt
port-dreamcast port-dreamcast
port-hp300 port-hp300
port-hpcmips port-hpcmips
port-i386 port-i386
port-luna68k port-luna68k
port-m68k port-m68k
port-mac68k port-mac68k
port-macppc port-macppc
port-mips port-mips
port-mvme68k port-mvme68k
port-newsmips port-newsmips
port-news68k port-news68k
port-next68k port-next68k
port-ofppc port-ofppc
port-pc532 port-pc532
port-pmax port-pmax
port-powerpc port-powerpc
port-prep port-prep
port-sgimips port-sgimips
port-sh3 port-sh3
port-sparc port-sparc
port-sparc64 port-sparc64
port-sun3 port-sun3
port-vax port-vax
port-x68k port-x68k
security security
standards standards
test test
xsrc xsrc
y2k y2k
); );
$prcgi = "http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=%s"; $prcgi = "http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=%s";

View file

@ -2,40 +2,41 @@
# #
# Set up for OpenBSD repo options. # Set up for OpenBSD repo options.
# #
# $Idaemons: /home/cvs/cvsweb/cvsweb.conf-openbsd,v 1.4 2001/01/13 07:48:09 knu Exp $ # $Idaemons: /home/cvs/cvsweb/cvsweb.conf-openbsd,v 1.5 2001/08/01 09:32:22 knu Exp $
# $FreeBSD: www/en/cgi/cvsweb.conf-openbsd,v 1.5 2001/01/12 04:26:10 knu Exp $ # $FreeBSD: www/en/cgi/cvsweb.conf-openbsd,v 1.6 2001/01/14 08:59:59 knu Exp $
if ($uname eq 'FreeBSD') { if ($uname eq 'FreeBSD') {
$ENV{'RCSLOCALID'} = 'OpenBSD=CVSHeader'; $ENV{'RCSLOCALID'} = 'OpenBSD=CVSHeader';
$ENV{'RCSINCEXC'} = 'iOpenBSD'; $ENV{'RCSINCEXC'} = 'iOpenBSD';
} else { } else {
$ENV{'RCSLOCALID'} = 'OpenBSD'; $ENV{'RCSLOCALID'} = 'OpenBSD';
} }
@prcategories = qw( @prcategories = qw(
alpha alpha
arm arm
documentation documentation
i386 i386
kernel kernel
library library
m68k m68k
mips mips
ns32k ns32k
pending pending
ports ports
ppc ppc
sparc sparc
system system
user user
vax vax
); );
$prcgi = "http://cvs.openbsd.org/cgi-bin/wwwgnats.pl/full?pr=%s"; $prcgi = "http://cvs.openbsd.org/cgi-bin/wwwgnats.pl/full?pr=%s";
$prkeyword = "PR"; $prkeyword = "PR";
$mancgi = "http://www.openbsd.org/cgi-bin/man.cgi?apropos=0&sektion=%s&query=%s&manpath=OpenBSD+Current&arch=i386&format=html"; $mancgi =
"http://www.openbsd.org/cgi-bin/man.cgi?apropos=0&sektion=%s&query=%s&manpath=OpenBSD+Current&arch=i386&format=html";
# Allow downloading a tarball of a port # Allow downloading a tarball of a port
$allow_tar = ($where =~ m,^ports/[^/]+/[^/]+/,); $allow_tar = ($where =~ m,^ports/[^/]+/[^/]+/,);