cgi¶
vb cgi FILE
Description¶
Generate a reply to a CGI request.
The FILE argument is the name of a control file that provides VisionByte with important information such as where to find its repository. In a typical CGI deployment, FILE is the name of the CGI script and will typically look something like this:
#!/usr/bin/vb
repository: /home/somebody/project.db
The command name, cgi, may be omitted if the GATEWAY_INTERFACE
environment variable is set to CGI, which should always be the
case for CGI scripts run by a webserver. VisionByte ignores any lines
that begin with #.
Most CGI files contain only a repository: line. It is uncommon to
use any other option.
The lines are processed in the order they are read, which is most
significant for errorlog:, which should be set before repository:
so that any warnings from the database when opening the repository
go to that log file.
The following control lines are recognized:
repository: PATH Name of the VisionByte repository
directory: PATH Name of a directory containing many VisionByte
repositories whose names all end with ".vbyte".
There should only be one of "repository:"
or "directory:"
notfound: URL When in "directory:" mode, redirect to
URL if no suitable repository is found.
repolist When in "directory:" mode, display a page
showing a list of available repositories if
the URL is "/". Some control over the display
is accomplished using environment variables.
FOSSIL_REPOLIST_TITLE is the tital of the page.
FOSSIL_REPOLIST_SHOW cause the "Description"
column to display if it contains "description" as
as a substring, and causes the Login-Group column
to display if it contains the "login-group"
substring.
localauth Grant administrator privileges to connections
from 127.0.0.1 or ::1.
nossl Signal that no SSL connections are available.
nocompress Do not compress HTTP replies.
skin: LABEL Use the built-in skin called LABEL rather than
the default, or the default if LABEL is empty.
If there are no skins called LABEL then this
line is a no-op.
files: GLOBLIST GLOBLIST is a comma-separated list of GLOB
patterns that specify files that can be
returned verbatim. This feature allows VisionByte
to act as a web server returning static
content.
setenv: NAME VALUE Set environment variable NAME to VALUE. Or
if VALUE is omitted, unset NAME.
HOME: PATH Shorthand for "setenv: HOME PATH"
cgi-debug: FILE Causing debugging information to be written
into FILE.
errorlog: FILE Warnings, errors, and panics written to FILE.
timeout: SECONDS Do not run for longer than SECONDS. The default
timeout is FOSSIL_DEFAULT_TIMEOUT (600) seconds.
extroot: DIR Directory that is the root of the sub-CGI tree
on the /ext page.
redirect: REPO URL Extract the "name" query parameter and search
REPO for a check-in or ticket that matches the
value of "name", then redirect to URL. There
can be multiple "redirect:" lines that are
processed in order. If the REPO is "*", then
an unconditional redirect to URL is taken.
When "*" is used a 301 permanent redirect is
issued and the tail and query string from the
original query are appeneded onto URL.
jsmode: VALUE Specifies the delivery mode for JavaScript
files. See the help text for the --jsmode
flag of the http command.
mainmenu: FILE Override the mainmenu config setting with the
contents of the given file.