-rw-r--r-- | cgitrc.5.txt | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 65b210f..10b86f3 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt @@ -13,65 +13,65 @@ cgitrc - runtime configuration for cgit SYNOPSIS -------- Cgitrc contains all runtime settings for cgit, including the list of git repositories, formatted as a line-separated list of NAME=VALUE pairs. Blank lines, and lines starting with '#', are ignored. LOCATION -------- The default location of cgitrc, defined at compile time, is /etc/cgitrc. At runtime, cgit will consult the environment variable CGIT_CONFIG and, if defined, use its value instead. GLOBAL SETTINGS --------------- about-filter:: Specifies a command which will be invoked to format the content of about pages (both top-level and for each repository). The command will get the content of the about-file on its STDIN, and the STDOUT from the command will be included verbatim on the about page. Default value: none. agefile:: Specifies a path, relative to each repository path, which can be used to specify the date and time of the youngest commit in the repository. The first line in the file is used as input to the "parse_date" function in libgit. Recommended timestamp-format is "yyyy-mm-dd hh:mm:ss". Default value: "info/web/last-modified". cache-root:: Path used to store the cgit cache entries. Default value: - "/var/cache/cgit". + "/var/cache/cgit". See also: "MACRO EXPANSION". cache-dynamic-ttl:: Number which specifies the time-to-live, in minutes, for the cached version of repository pages accessed without a fixed SHA1. Default value: "5". cache-repo-ttl:: Number which specifies the time-to-live, in minutes, for the cached version of the repository summary page. Default value: "5". cache-root-ttl:: Number which specifies the time-to-live, in minutes, for the cached version of the repository index page. Default value: "5". cache-scanrc-ttl:: Number which specifies the time-to-live, in minutes, for the result of scanning a path for git repositories. Default value: "15". cache-size:: The maximum number of entries in the cgit cache. Default value: "0" (i.e. caching is disabled). cache-static-ttl:: Number which specifies the time-to-live, in minutes, for the cached version of repository pages accessed with a fixed SHA1. Default value: "5". clone-prefix:: Space-separated list of common prefixes which, when combined with a repository url, generates valid clone urls for the repository. This setting is only used if `repo.clone-url` is unspecified. Default value: none. @@ -126,65 +126,65 @@ enable-remote-branches:: "repo.enable-remote-branches". enable-subject-links:: Flag which, when set to "1", will make cgit use the subject of the parent commit as link text when generating links to parent commits in commit view. Default value: "0". See also: "repo.enable-subject-links". enable-tree-linenumbers:: Flag which, when set to "1", will make cgit generate linenumber links for plaintext blobs printed in the tree view. Default value: "1". favicon:: Url used as link to a shortcut icon for cgit. If specified, it is suggested to use the value "/favicon.ico" since certain browsers will ignore other values. Default value: none. footer:: The content of the file specified with this option will be included verbatim at the bottom of all pages (i.e. it replaces the standard "generated by..." message. Default value: none. head-include:: The content of the file specified with this option will be included verbatim in the html HEAD section on all pages. Default value: none. header:: The content of the file specified with this option will be included verbatim at the top of all pages. Default value: none. include:: Name of a configfile to include before the rest of the current config- - file is parsed. Default value: none. + file is parsed. Default value: none. See also: "MACRO EXPANSION". index-header:: The content of the file specified with this option will be included verbatim above the repository index. This setting is deprecated, and will not be supported by cgit-1.0 (use root-readme instead). Default value: none. index-info:: The content of the file specified with this option will be included verbatim below the heading on the repository index page. This setting is deprecated, and will not be supported by cgit-1.0 (use root-desc instead). Default value: none. local-time:: Flag which, if set to "1", makes cgit print commit and tag times in the servers timezone. Default value: "0". logo:: Url which specifies the source of an image which will be used as a logo on all cgit pages. Default value: "/cgit.png". logo-link:: Url loaded when clicking on the cgit logo image. If unspecified the calculated url of the repository index page will be used. Default value: none. max-atom-items:: Specifies the number of items to display in atom feeds view. Default value: "10". max-commit-count:: Specifies the number of entries to list per page in "log" view. Default @@ -208,117 +208,119 @@ max-blob-size:: max-stats:: Set the default maximum statistics period. Valid values are "week", "month", "quarter" and "year". If unspecified, statistics are disabled. Default value: none. See also: "repo.max-stats". mimetype.<ext>:: Set the mimetype for the specified filename extension. This is used by the `plain` command when returning blob content. module-link:: Text which will be used as the formatstring for a hyperlink when a submodule is printed in a directory listing. The arguments for the formatstring are the path and SHA1 of the submodule commit. Default value: "./?repo=%s&page=commit&id=%s" nocache:: If set to the value "1" caching will be disabled. This settings is deprecated, and will not be honored starting with cgit-1.0. Default value: "0". noplainemail:: If set to "1" showing full author email adresses will be disabled. Default value: "0". noheader:: Flag which, when set to "1", will make cgit omit the standard header on all pages. Default value: none. See also: "embedded". project-list:: A list of subdirectories inside of scan-path, relative to it, that should loaded as git repositories. This must be defined prior to - scan-path. Default value: none. See also: scan-path. + scan-path. Default value: none. See also: scan-path, "MACRO + EXPANSION". readme:: Text which will be used as default value for "repo.readme". Default value: none. remove-suffix:: If set to "1" and scan-path is enabled, if any repositories are found with a suffix of ".git", this suffix will be removed for the url and name. Default value: "0". See also: scan-path. renamelimit:: Maximum number of files to consider when detecting renames. The value "-1" uses the compiletime value in git (for further info, look at `man git-diff`). Default value: "-1". repo.group:: Legacy alias for "section". This option is deprecated and will not be supported in cgit-1.0. robots:: Text used as content for the "robots" meta-tag. Default value: "index, nofollow". root-desc:: Text printed below the heading on the repository index page. Default value: "a fast webinterface for the git dscm". root-readme:: The content of the file specified with this option will be included verbatim below the "about" link on the repository index page. Default value: none. root-title:: Text printed as heading on the repository index page. Default value: "Git Repository Browser". scan-hidden-path:: If set to "1" and scan-path is enabled, scan-path will recurse into directories whose name starts with a period ('.'). Otherwise, scan-path will stay away from such directories (considered as "hidden"). Note that this does not apply to the ".git" directory in non-bare repos. This must be defined prior to scan-path. Default value: 0. See also: scan-path. scan-path:: A path which will be scanned for repositories. If caching is enabled, the result will be cached as a cgitrc include-file in the cache directory. If project-list has been defined prior to scan-path, scan-path loads only the directories listed in the file pointed to by project-list. Be advised that only the global settings taken before the scan-path directive will be applied to each repository. - Default value: none. See also: cache-scanrc-ttl, project-list. + Default value: none. See also: cache-scanrc-ttl, project-list, + "MACRO EXPANSION". section:: The name of the current repository section - all repositories defined after this option will inherit the current section name. Default value: none. section-from-path:: A number which, if specified before scan-path, specifies how many path elements from each repo path to use as a default section name. If negative, cgit will discard the specified number of path elements above the repo directory. Default value: 0. side-by-side-diffs:: If set to "1" shows side-by-side diffs instead of unidiffs per default. Default value: "0". snapshots:: Text which specifies the default set of snapshot formats generated by cgit. The value is a space-separated list of zero or more of the values "tar", "tar.gz", "tar.bz2", "tar.xz" and "zip". Default value: none. source-filter:: Specifies a command which will be invoked to format plaintext blobs in the tree view. The command will get the blob content on its STDIN and the name of the blob as its only command line argument. The STDOUT from the command will be included verbatim as the blob contents, i.e. this can be used to implement e.g. syntax highlighting. Default value: none. summary-branches:: Specifies the number of branches to display in the repository "summary" @@ -421,64 +423,84 @@ repo.readme:: a colon. For example, "master:docs/readme.mkd" Default value: <readme>. repo.snapshots:: A mask of allowed snapshot-formats for this repo, restricted by the "snapshots" global setting. Default value: <snapshots>. repo.section:: Override the current section name for this repository. Default value: none. repo.source-filter:: Override the default source-filter. Default value: none. See also: "enable-filter-overrides". repo.url:: The relative url used to access the repository. This must be the first setting specified for each repo. Default value: none. REPOSITORY-SPECIFIC CGITRC FILE ------------------------------- When the option "scan-path" is used to auto-discover git repositories, cgit will try to parse the file "cgitrc" within any found repository. Such a repo-specific config file may contain any of the repo-specific options described above, except "repo.url" and "repo.path". Additionally, the "filter" options are only acknowledged in repo-specific config files when "enable-filter-overrides" is set to "1". Note: the "repo." prefix is dropped from the option names in repo-specific config files, e.g. "repo.desc" becomes "desc". +MACRO EXPANSION +--------------- +The following cgitrc options supports a simple macro expansion feature, +where tokens prefixed with "$" are replaced with the value of a similary +named environment variable: + +- cache-root +- include +- project-list +- scan-path + +Macro expansion will also happen on the content of $CGIT_CONFIG, if +defined. + +One usage of this feature is virtual hosting, which in its simplest form +can be accomplished by adding the following line to /etc/cgitrc: + + include=/etc/cgitrc.d/$HTTP_HOST + + EXAMPLE CGITRC FILE ------------------- .... # Enable caching of up to 1000 output entriess cache-size=1000 # Specify some default clone prefixes clone-prefix=git://example.com ssh://example.com/pub/git http://example.com/git # Specify the css url css=/css/cgit.css # Show extra links for each repository on the index page enable-index-links=1 # Enable ASCII art commit history graph on the log pages enable-commit-graph=1 # Show number of affected files per commit on the log pages enable-log-filecount=1 # Show number of added/removed lines per commit on the log pages enable-log-linecount=1 # Add a cgit favicon |