[Lxr-commits] CVS: lxr/templates datastorage.conf.part, 1.2, 1.3 lxr.conf, 1.58, 1.59 lxrkernel.con
Brought to you by:
ajlittoz
From: Andre-Littoz <ajl...@us...> - 2013-11-07 17:45:44
|
Update of /cvsroot/lxr/lxr/templates In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14308/templates Modified Files: datastorage.conf.part lxr.conf lxrkernel.conf tree-server1.conf.part tree-server2.conf.part Log Message: Various templates/*.conf[.part]: add validation filter in user answers Index: datastorage.conf.part =================================================================== RCS file: /cvsroot/lxr/lxr/templates/datastorage.conf.part,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- datastorage.conf.part 3 Sep 2013 08:45:11 -0000 1.2 +++ datastorage.conf.part 7 Nov 2013 17:45:41 -0000 1.3 @@ -24,7 +24,7 @@ #- ----- MySQL ----- #@m: #@ IF !%_globaldb% -#@ ASK,DB_name --- Database name?; -2 +#@ ASK,DB_name --- Database name?; -2; ^\w+$,invalid characters in name #@ ENDIF , 'dbname' => 'dbi:mysql:dbname=%DB_name%' #- @@ -35,14 +35,17 @@ #- ----- PostgreSQL ----- #@p: #@ IF !%_globaldb% -#@ ASK,DB_name --- Database name?; -2 +#@ ASK,DB_name --- Database name?; -2; ^\w+$,invalid characters in name #@ ENDIF , 'dbname' => 'dbi:Pg:dbname=%DB_name%;host=localhost' #- #- ----- SQLite ----- #@s: #@ IF !%_globaldb% -#@ ASK,DB_name --- Database file? (e.g. /home/myself/storage.db); -2 +#@ ASK,DB_name --- Database file? (e.g. /home/myself/storage.db); -2\ + #@ ; ^/,absolute file path required + #@ , [^/]$,must be a file +#@ CANONR,DB_name ',\' #@ ENDIF , 'dbname' => 'dbi:SQLite:dbname=%DB_name%' #@ENDC %_dbengine% @@ -50,8 +53,9 @@ #- #@IF %_dbengine% ne "s" #@ IF !%_dbuser% -#@ ASK,DB_tree_user --- DB user name?; -1; ; lxr +#@ ASK,DB_tree_user --- DB user name?; -1; ^\w+$,invalid characters in name; lxr #@ ASK,DB_tree_password --- DB password?; -1; ; lxrpw +#@ CANONR,DB_tree_password ',\' , 'dbuser' => '%DB_tree_user%' , 'dbpass' => '%DB_tree_password%' @@ -59,8 +63,9 @@ #@ ELSEIF !%_globaldb% #@ ASK,C Do you want to override the global '%DB_user%' user name?; 2; yes,no; Y,N #@ IF %C% eq "Y" -#@ ASK,DB_tree_user --- DB user name?; -1; ; lxr +#@ ASK,DB_tree_user --- DB user name?; -1; ^\w+$,invalid characters in name; lxr #@ ASK,DB_tree_password --- DB password?; -1; ; lxrpw +#@ CANONR,DB_tree_password ',\' , 'dbuser' => '%DB_tree_user%' , 'dbpass' => '%DB_tree_password%' @@ -75,7 +80,7 @@ #- #- #@IF !%_dbprefix% -#@ ASK,DB_tbl_prefix --- DB table prefix?; -1; ; lxr_ +#@ ASK,DB_tbl_prefix --- DB table prefix?; -1; ^\w+$,invalid characters in name; lxr_ , 'dbprefix' => '%DB_tbl_prefix%' #- @@ -83,7 +88,7 @@ #@ ASK,C Do you want to override the global '%DB_global_prefix%' table prefix?; 2; yes,no; Y,N #@ IF %C% eq "Y" -#@ ASK,DB_tbl_prefix --- DB table prefix?; -1; ; lxr_ +#@ ASK,DB_tbl_prefix --- DB table prefix?; -1; ^\w+$,invalid characters in name; lxr_ , 'dbprefix' => '%DB_tbl_prefix%' #@ ELSE # If you need multiple lxr configurations in one database, set different table Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/lxr.conf,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- lxr.conf 3 Sep 2013 08:45:12 -0000 1.58 +++ lxr.conf 7 Nov 2013 17:45:41 -0000 1.59 @@ -20,6 +20,8 @@ #- updated for web server config. -- ajl 2013/01/20 #- updated for change in LCL statements-- ajl 2013/04/28 #- updated for more common factoring -- ajl 2013/05/13 +#- updated for new parameters -- ajl 2013/09/28 +#- added answer validition criteria -- ajl 2013/11/06 ( ################################ @@ -46,6 +48,7 @@ #- Title for this tree to display in page header area #- if you aren't satisfied with the default #@ASK --- Caption in page header? (e.g. Project XYZZY displayed by LXR); -2 +#@CANONR ',\' 'caption' => '%A%' #@ADD tree-server2.conf.part @@ -68,7 +71,10 @@ #- The names of the version directories must match the values for the Version #- variable (see the version selection subsection). #@ MSG A source directory contains one sub-directory for every version. -#@ ASK --- Source directory? (e.g. /home/myself/project-tree); -2 +#@ ASK --- Source directory? (e.g. /home/myself/project-tree); -2\ + #@ ; ^/,absolute file path required +#@ CANON /+$,,^/+,/ +#@ CANONR ',\' , 'sourceroot' => '%A%' #- #- - Case No. 2: CVS repository @@ -77,7 +83,10 @@ #- followed by the path to the repository. Note this must be file accessible - remote #- server access does NOT work. #@ MSG A CVS repository is a directory containing ,v files -#@ ASK --- CVS repository? (e.g. /home/myself/project-CVS); -2 +#@ ASK --- CVS repository? (e.g. /home/myself/project-CVS); -2\ + #@ ; ^/,absolute file path required +#@ CANON /+$,,^/+,/ +#@ CANONR ',\' , 'sourceroot' => 'cvs:%A%' #- #- - Case No. 3: GIT repository @@ -87,7 +96,10 @@ #- directories. #@ MSG A Git repository is a directory containing objects, refs, index, ... subdirectories. #@ MSG It is usually named .git in some user directory and is thus not visible. -#@ ASK,GITrepo --- Git repository? (e.g. /home/myself/project-git/.git); -2 +#@ ASK,GITrepo --- Git repository? (e.g. /home/myself/project-git/.git); -2\ + #@ ; ^/,absolute file path required +#@ CANON /+$,,^/+,/ +#@ CANONR ',\' , 'sourceroot' => 'git:%GITrepo%' #- #- Any parameters to the source access method should be specified below. @@ -113,7 +125,10 @@ #@ MSG A Subversion repository is a directory containing a database for #@ MSG the source-tree. The present backend implementation in LXR limits #@ MSG access to local repositories. -#@ ASK --- Subversion repository? (e.g. /home/myself/project-svn); -2 +#@ ASK --- Subversion repository? (e.g. /home/myself/project-svn); -2\ + #@ ; ^/,absolute file path required +#@ CANON /+$,,^/+,/ +#@ CANONR ',\' , 'sourceroot' => 'svn:%A%' #- #- Any parameters to the source access method should be specified below. @@ -139,7 +154,10 @@ #@ MSG A Mercurial repository is a directory containing a database for #@ MSG the source-tree. The present backend implementation in LXR limits #@ MSG access to local repositories. -#@ ASK --- Mercurial repository? (e.g. /home/myself/project-hg); -2 +#@ ASK --- Mercurial repository? (e.g. /home/myself/project-hg); -2\ + #@ ; ^/,absolute file path required +#@ CANON /+$,,^/+,/ +#@ CANONR ',\' , 'sourceroot' => 'hg:%A%' #- #- Any parameters to the source access method should be specified below. @@ -166,14 +184,19 @@ #@ MSG BitKeeper is proprietary software. The BK management routines are more or less #@ MSG in their 2005 state. This interface has not been tested for many years. #@ MSG There is absolutely no guarantee on BK operation. -#@ ASK --- BK repository? (e.g. /home/myself/project-BK); -2 +#@ ASK --- BK repository? (e.g. /home/myself/project-BK); -2\ + #@ ; ^/,absolute file path required +#@ CANON /+$,,^/+,/ +#@ CANONR ',\' , 'sourceroot' => 'bk:%A%' #- #- Any parameters to the source access method should be specified below. #- , 'sourceparams' => #@ MSG BK needs a read/write temporary directory. -#@ ASK --- BK temporary directory? (e.g. /home/myself/BKtemp); -2 +#@ ASK --- BK temporary directory? (e.g. /home/myself/BKtemp); -2\ + #@ ; ^/,absolute file path required +#@ CANONR ',\' { 'cachepath' => '%A%' } #@ENDC #- - End of tree storage - - @@ -183,6 +206,7 @@ #- # Or if you want automatic version insertion #- , 'sourcerootname' => '$v' #@ASK Name to display for the path root? (e.g. Project or $v for version); -1; ; $v +#@CANONR ',\' , 'sourcerootname' => '%A%' # Version selection subsection # @@ -194,6 +218,7 @@ # Define typed variable "v". { 'v' => #@ASK Label for version selection menu? ; -1; ; Version +#@CANONR ',\' { 'name' => '%A%' # This is the list of versions to index. #- @@ -207,12 +232,16 @@ #- #- - Case No. 1: versions stored in a file #@R: -#@ ASK --- Version file? (absolute path or relative to LXR root dir.); -2 +#@ ASK --- Version file? (absolute path or relative to LXR root dir.); -2\ + #@ ; [^/]$,file required +#@ CANONR ',\' , 'range' => [ readfile('%A%') ] #- #- - Case No. 2: versions given explicitly in a list #@L: , 'range' => [qw( +#@ ASK --- Version name? ; -2 + %A% #@ KEEPON --- Version name? (hit return to stop) %A% #@ ENDK @@ -240,7 +269,7 @@ #- , 'range' => sub { opendir (my $dh, $LXR::Common::config->{'sourceroot'}) - || die "can't open source root directory: $!"; + or die "can\'t open source root directory: $!"; my @dirs = grep { m/^[^.]/ # Discard invisible items && -d "$LXR::Common::config->{'sourceroot'}/$_" @@ -263,7 +292,7 @@ ##### The following #U lines may be uncommented if you prefer ##### the static list gathered by ./genxref --allversions #U my $vfn = $LXR::Common::config->{'virtroot'}; - #U $vfn =~ s|([^-a-zA-Z0-9.\@_])|sprintf("%%%02X", ord($1))|ge; + #U $vfn =~ s|([^-a-zA-Z0-9.\@_])|sprintf('%%%02X', ord($1))|ge; #U $vfn = 'custom.d/CVS' . $vfn; #U if (-f $vfn) { #U return readfile($vfn); @@ -287,17 +316,17 @@ { my $some_dir; ##### You can comment out one of the following blocks ##### if you want to limit the set of versions - $some_dir = "%GITrepo%/refs/tags"; - opendir (DIR, $some_dir) || die "cannot opendir $some_dir: $!"; + $some_dir = '%GITrepo%/refs/tags'; + opendir (DIR, $some_dir) or die "can\'t opendir $some_dir: $!"; my @files = grep { -f "$some_dir/$_" } readdir (DIR); closedir DIR; ##### Add more $some_dir = "%GITrepo%/refs/heads"; - opendir (DIR, $some_dir) || die "cannot opendir $some_dir: $!"; + opendir (DIR, $some_dir) or die "can\'t opendir $some_dir: $!"; my @files = grep { -f "$some_dir/$_" } readdir (DIR); closedir DIR; ##### End of enumeration - unshift (@files, "HEAD"); + unshift (@files, 'HEAD'); return sort @files; } # @@ -309,7 +338,7 @@ # my $kernel = new Linux::KernelSort; # # my $some_dir = "/path/to/linux-2.6/.git/refs/tags"; - # opendir (DIR, $some_dir) || die "cannot opendir $some_dir: $!"; + # opendir (DIR, $some_dir) or die "cannot opendir $some_dir: $!"; # my @files = grep { -f "$some_dir/$_" } readdir (DIR); # closedir DIR; # # Linus's tags all have a leading "v" @@ -362,7 +391,7 @@ ##### You may comment some of the following lines to limit the ##### number of displayed revisions, provided at least one is ##### left active. If you keep only allbranches, uncomment the - ##### 'tip' line to guarantee at least one revision is + ##### \'tip\' line to guarantee at least one revision is ##### reachable. ( $files->allbranches() , $files->alltags () @@ -393,6 +422,7 @@ #@ ASK --- Default displayed version is first in 'range'?; 1; yes,no; Y,N #@ IF "%A%" eq 'N' #@ ASK,N --- Default version name?; -2 +#@ CANONR ',\' , 'default' => '%N%' #@ ELSE # The default version to display @@ -441,6 +471,8 @@ #@ ON first , 'incprefix' => [qw( #@ ENDON +#@ CANONR /+ , , /*, / +#@ CANON /+$,,^/*,/ %A% #@ ON epilog )] Index: lxrkernel.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/lxrkernel.conf,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- lxrkernel.conf 3 Sep 2013 08:45:12 -0000 1.10 +++ lxrkernel.conf 7 Nov 2013 17:45:41 -0000 1.11 @@ -60,6 +60,7 @@ #- updated to use LCL statements -- ajl 2012/11/30 #- updated for web server config. -- ajl 2013/01/20 #- updated for more common factoring -- ajl 2013/05/13 +#- added answer validition criteria -- ajl 2013/11/06 ( ################################ @@ -89,7 +90,8 @@ #- Title for this tree to display in page header area #- if you aren't satisfied with the default #@ASK --- Caption in page header?; -1; ; Linux kernel cross-references - , 'caption' => '%A%' +#@CANONR ',\' + 'caption' => '%A%' #@ADD tree-server2.conf.part # Tree location subsection # @@ -108,7 +110,10 @@ #- The names of the version directories must match the values for the Version #- variable (see the version selection subsection). #@ MSG A source directory contains one sub-directory for every version. -#@ ASK --- Source directory? (e.g. /home/myself/project-tree); -2 +#@ ASK --- Source directory? (e.g. /home/myself/project-tree); -2\ + #@ ; ^/,absolute file path required +#@ CANON /+$,,^/+,/ +#@ CANONR ',\' , 'sourceroot' => '%A%' #- #@Y: @@ -145,6 +150,7 @@ { 'v' => #@ASK Label for version selection menu? ; -1; ; Version +#@CANONR ',\' { 'name' => '%A%' #@MSG Versions are retrieved from file %LXRconfdir%/version_list.txt #@MSG They are collected into this file by script kernel-vars-grab.sh @@ -156,6 +162,7 @@ #@ ASK --- Default displayed version is first in 'range'?; 1; yes,no; Y,N #@ IF "%A%" eq 'N' #@ ASK,N --- Default version name?; -2 +#@ CANONR ',\' , 'default' => '%N%' #@ ELSE # The default version to display @@ -165,6 +172,7 @@ } , 'a' => #@ASK Label for architecture selection menu? ; -1; ; Architecture +#@CANONR ',\' { 'name' => '%A%' , 'range' => [ readfile('%LXRconfdir%/arch_list.txt') ] , 'default' => 'x86' Index: tree-server1.conf.part =================================================================== RCS file: /cvsroot/lxr/lxr/templates/tree-server1.conf.part,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tree-server1.conf.part 3 Sep 2013 08:45:12 -0000 1.1 +++ tree-server1.conf.part 7 Nov 2013 17:45:41 -0000 1.2 @@ -49,15 +49,28 @@ #@IF 'H' eq "%_routing%" #@ LOG Configuring individual host name or IP (as http://...) #@ MSG Remember: they must be unique! -#@ ASK,hostname --- Host name?; -2 +#@ ASK,hostname --- Host name?\ + #@ ; ^(?i:https?:)?//,not an HTTP URL; -2\ + #@ , //[\w-]+(?:\.[\w-]+)*(?::\d+)?/?$,invalid characters in URL +#- The trailing comma below is not an error, it defines an empty string +# CANON,hostname /$, , 'host_names' => [ '%hostname%' -#@ KEEPON --- Alias name ? (hit return to stop) +#@ KEEPON --- Alias name ? (hit return to stop):; -3\ + #@ ; ^(?i:https??:)?//,not an HTTP URL\ + #@ , //[\w-]+(?:\.[\w-]+)*(?::\d+)?/?$,invalid characters in URL +#@ ON none + # Put here aliases for host name, such as + # , '//%treeid%.localhost' + # , 'http://%treeid%.mycomputer.outside.domain:12345' +#@ ENDON +# @CANON /$, , '%A%' #@ ENDK ] , #@ELSEIF 'P' eq "%_routing%" -#@ ASK,treeid --- Prefix for host name?; -2 +#@ ASK,treeid --- Prefix for host name?; -2\ + #@ ; ^[\w-]+(?:\.[\w-]+)*$,invalid characters in name 'host_names' => [ '%scheme%//%treeid%.%hostname%' #@ ARRAY schemealiases,S hostaliases,A portaliases,P #@ ON none @@ -92,19 +105,24 @@ #- - a) Routing through section path #@ELSEIF 'S' eq "%_routing%" #@ MSG All section paths must be unique! -#@ ASK,virtroot --- Full virtual root? (e.g. /section/project/title); -2 +#@ ASK,virtroot --- Full virtual root? (e.g. /section/project/title)\ + #@ ; -2; ^[^']+$,quotes not allowed +#@ CANON,virtroot /+$,,^/*,/ #- - b) Routing through extraction from section path #@ELSEIF 'E' eq "%_routing%" #@ IF 'b' eq "%_virtrootpolicy%" #@ MSG The tree needs to be uniquely identified as e.g. %virtrootbase%/the_tree -#@ ASK,treeid --- Tree designation for URL? (e.g. the_tree); -2 +#@ ASK,treeid --- Tree designation for URL? (e.g. the_tree); -2\ + #@ ; ^[\w-.$*]+$,invalid characters in name #@ DEFINE virtroot="%virtrootbase%/%treeid%" #@ ELSEIF 'c' eq "%_virtrootpolicy%" #@ REMIND The custom multiple trees management method must contain #@ REMIND at least the server section name %virtrootbase% and a unique #@ REMIND tree designation (in an order compatible with the URL magic #@ REMIND in the server configuration files). -#@ ASK,virtroot --- Full virtual root? (e.g. %virtrootbase%/something); -2 +#@ ASK,virtroot --- Full virtual root? (e.g. %virtrootbase%/something); -2\ +#@ CANON,virtroot /+$,,^/*,/ + #@ ; ^[^']+$,quotes not allowed #@ ELSE #@ ERROR Unknown multiple trees management choice! #@ ERROR If you did not tamper with context file, @@ -118,7 +136,10 @@ #@ DEFINE virtroot="%virtrootbase%" #@ MSG You previously defined the virtual root as %virtroot% #@ ELSE -#@ ASK,virtroot --- Virtual root? (i.e. URL part after host); -1; ; %virtrootbase% +#@ ASK,virtroot --- Virtual root? (i.e. URL part after host); -1\ + #@ ; ^[^']+$,quotes not allowed\ + #@ ; %virtrootbase% +#@ CANON,virtroot /+$,,^/*,/ #@ ENDIF #@ ELSE #@ DEFINE virtroot='' Index: tree-server2.conf.part =================================================================== RCS file: /cvsroot/lxr/lxr/templates/tree-server2.conf.part,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tree-server2.conf.part 3 Sep 2013 08:45:12 -0000 1.1 +++ tree-server2.conf.part 7 Nov 2013 17:45:41 -0000 1.2 @@ -24,17 +24,24 @@ # trees are managed by LXR # , 'shortcaption' => 'Tree' #@ELSE -#@ ASK Do you want a speed switch button for this tree ?; 1; yes, no; Y, N +#@ ASK Do you want a speed switch button for this tree ?\ + #@ ; 1; yes, no; Y, N #@ IF "%A%" eq 'Y' #@ IF %treeid% -#@ ASK --- Short title for button? (e.g. XYZZY); -1; ; %treeid% +#@ ASK --- Short title for button? (e.g. XYZZY); -1\ + #@ ; ^[^']+$,quotes not allowed\ + #@ ; %treeid% #@ ELSE -#@ ASK --- Short title for button? (e.g. XYZZY); -2 +#@ ASK --- Short title for button? (e.g. XYZZY); -2\ + #@ ; ^[^']+$,quotes not allowed +#- Prevent possible XSS attacks +#@ CANONR <,<,>,> #@ ENDIF , 'shortcaption' => '%A%' #@ ENDIF #@ IF 'A' eq "%_routing%" -#@ ASK,treeid --- Tree identification in URL? (e.g. the-tree); -2 +#@ ASK,treeid --- Tree identification in URL? (e.g. the-tree)\ + #@ ; -2; ^[\w-]+(?:\.[\w-]+)*$,invalid characters in name , 'treename' => '%treeid%' #@ ENDIF @@ -43,7 +50,8 @@ #@ASK Do you need a specific encoding for this tree ?; 2; yes, no; Y, N #@IF "%A%" eq 'Y' -#@ ASK --- Encoding name? (e.g. iso-8859-1); -2 +#@ ASK --- Encoding name? (e.g. iso-8859-1)\ + #@ ; -2; ^[\w-]+$,invalid characters in name # Character encoding (overrides default) , 'encoding' => '%A%' #@ENDIF |