Debian Codegraph @

tools/hook-scripts/validate-files.conf.example

raw
1 # DEFAULT section can be used to place options that can be referenced in
2 # other section values with the %(option)s syntax. Note that the svnlook
3 # value below is required as it is used by the script to determine the path
4 # to the svnlook command in order to determine the changes. Feel free
5 # to create additional values here that you can reuse in other options,
6 # especially the command options to make it easier to maintain.
7 [DEFAULT]
8 svnlook = /usr/local/bin/svnlook
9 #svnauthz = /usr/local/bin/svn-tools/svnauthz
10 #xmllint = /usr/bin/xmllint
11
12 # The repositories section has key value pairs where the key is a pattern
13 # to match on the repository path and the value is a space separated list of
14 # rules to apply to that repository. Multiple patterns can match and all
15 # unique rules will be applied. The pattern is a Unix shell-style wildcard.
16 # As seen below all repositories will have the svnauthz-validate and xmllint
17 # rules applied and repositories in /repos or below will have admin-rw-authz
18 # applied.
19 [repositories]
20 #* = svnauthz-validate xmllint
21 #/repos/* = admin-rw-authz
22
23 # Rules allow you define a pattern to match against which files in the
24 # repository to run a command against. Rules are defined by creating a
25 # section name starting with 'rule:' as seen below.
26 #
27 # The pattern option is a Unix shell-style wildcard match against the
28 # files in the repo that the rule will be run for. A leading / in your
29 # pattern will be ignored. Paths segments are / separated regardless of
30 # platform.
31 #
32 # The command option is the command to run, this command will be run via
33 # the shell of your platform. The following environment variables will
34 # be defined for you:
35 # REPO = the path of the repository for the commit.
36 # TXN = the transaction id of the commit.
37 # FILE = the name of the file that matched the pattern.
38 #
39 # IMPORTANT: AS A CONSEQUENCE OF THE USE OF THE SHELL IT IS IMPORTANT TO
40 # QUOTE THE ARGUMENTS OF YOUR COMMANDS. THE FILE VARIABLE DOES CONTAIN
41 # USER GENERATED DATA AND SHELL METACHARACTERS ARE NOT ESCAPED FOR YOU!
42 #
43 # The following examples assume a POSIX shell, if your platform has a
44 # different shell you may need to adjust them. For example on Windows
45 # cmd.exe uses %VARIABLENAME% instead of $VARIABLENAME to expand environment
46 # variables.
47 #
48 # The following rule runs the svnauthz command's validate subcommand
49 # for file named authz in the conf subdir if it is present in the commit.
50 # This is a simple way to ensure that invalid authz files are not allowed
51 # to be committed.
52 #[rule:svnauthz-validate]
53 #pattern = conf/authz
54 #command = '%(svnauthz)s' validate -t "$TXN" "$REPO" "$FILE"
55
56 # The following rule runs the svnauthz command's accessof subcommand
57 # for any file ending in .authz for the conf subdir and checks that the admin
58 # user has rw rights to the same file. This can be used to prevent an
59 # authz file being committed that would remove access for the admin user.
60 # Note that accessof also validates the validity of the file as well as
61 # checking the permissions, so it's unecessary to run validate and accessof.
62 #[rule:admin-rw-authz]
63 #pattern = /conf/*.authz
64 #command = '%(svnauthz)s' accessof --username admin --path "$FILE" --is rw -t "$TXN" "$REPO" "$FILE"
65
66 # Use the xmllint command to validate all files ending in .xml
67 #[rule:xmllint]
68 #pattern = *.xml
69 #command = '%(svnlook)s' cat -t "$TXN" "$REPO" "$FILE" | '%(xmllint)s' --noout -