Next: , Previous: , Up: Configuration   [Contents][Index]


2.4 The .checkoutrc file

A special feature is provided to use vcsync as a deployment engine for web pages. After synchronizing destination directory with the repository, it scans each updated directory for the presence of a special access file and file named .checkoutrc.

Access file is a directory-level configuration file for the httpd server. By default it is named .htaccess. During postprocessing in each directory, vcsync removes the existing access file and recreates it as directed by the statements in the .checkoutrc file.

Config: access-file-name name

Declares the name of access file to use instead of the default .htaccess.

Config: access-file-text text

Adds text to the beginning of each created access file. It is common to use the here-document syntax (see here-document) for text, e.g.:

access-file-text <<EOF
Options All -Indexes
Require all granted
EOF;

If the .checkoutrc file is present in the directory, it is read and processed line by line. In each line, a ‘#’ character introduces a comment. The character and anything after it up to the nearest newline is removed. Empty lines are ignored. Non-empty lines declare modifications to the destination directory, that should be applied after successful synchronization:

Create a symbolic link from src to dst. Neither argument can be an absolute pathname or contain references to the parent directory.

Unlink the file. The argument must refer to a file in the current directory or one of its subdirectories, that is either a symbolic link to another file or the access file.

checkoutrc: chmod mode file [file...]

Change mode of the listed files to mode, which must be an octal number. Shell wildcards are allowed in file arguments. After expanding, each file argument must refer to a file in the current directory or one of its subdirectories.

The administrator can also define additional keywords that, if encountered in the .checkoutrc file, will cause addition of certain text to the .htaccess file. Such keywords are case-insensitive. They are defined using the following configuration file statements.

Config: define keyword text

Define keyword and its replacement text. text is the material which will be appended to .htaccess when this keyword is encountered.

It is common to use the here-document syntax (see here-document) to define multi-line texts, e.g.:

define xbithack <<EOT
Options +IncludesNOEXEC
XBitHack On
EOT;
Config: define keyword

Defines a keyword that will be reproduced in the .htaccess file verbatim. This is a shortcut for

define keyword keyword;

The following example illustrates the use of the define configuration statement. It is taken from the default vcsync.conf file:

define xbithack <<EOT
Options +IncludesNOEXEC
XBitHack On
EOT;

define ssi <<EOT
AddHandler server-parsed .html
EOT;

define redirect;
define rewritebase;
define rewritecond;
define rewriteengine;
define rewritemap;
define rewriteoptions;
define rewriterule;

Next: , Previous: , Up: Configuration   [Contents][Index]