aboutsummaryrefslogtreecommitdiffstats
path: root/cgitrc.5.txt
diff options
context:
space:
mode:
Diffstat (limited to 'cgitrc.5.txt')
-rw-r--r--cgitrc.5.txt67
1 files changed, 59 insertions, 8 deletions
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 26c4bfc..a22423b 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -31,7 +31,7 @@ about-filter::
31 about pages (both top-level and for each repository). The command will 31 about pages (both top-level and for each repository). The command will
32 get the content of the about-file on its STDIN, and the STDOUT from the 32 get the content of the about-file on its STDIN, and the STDOUT from the
33 command will be included verbatim on the about page. Default value: 33 command will be included verbatim on the about page. Default value:
34 none. 34 none. See also: "FILTER API".
35 35
36agefile:: 36agefile::
37 Specifies a path, relative to each repository path, which can be used 37 Specifies a path, relative to each repository path, which can be used
@@ -76,11 +76,17 @@ clone-prefix::
76 setting is only used if `repo.clone-url` is unspecified. Default value: 76 setting is only used if `repo.clone-url` is unspecified. Default value:
77 none. 77 none.
78 78
79clone-url::
80 Space-separated list of clone-url templates. This setting is only
81 used if `repo.clone-url` is unspecified. Default value: none. See
82 also: "MACRO EXPANSION", "FILTER API".
83
79commit-filter:: 84commit-filter::
80 Specifies a command which will be invoked to format commit messages. 85 Specifies a command which will be invoked to format commit messages.
81 The command will get the message on its STDIN, and the STDOUT from the 86 The command will get the message on its STDIN, and the STDOUT from the
82 command will be included verbatim as the commit message, i.e. this can 87 command will be included verbatim as the commit message, i.e. this can
83 be used to implement bugtracker integration. Default value: none. 88 be used to implement bugtracker integration. Default value: none.
89 See also: "FILTER API".
84 90
85css:: 91css::
86 Url which specifies the css document to include in all cgit pages. 92 Url which specifies the css document to include in all cgit pages.
@@ -105,6 +111,11 @@ enable-gitweb-owner::
105 for the git config value "gitweb.owner" to determine the owner. 111 for the git config value "gitweb.owner" to determine the owner.
106 Default value: "1". See also: scan-path. 112 Default value: "1". See also: scan-path.
107 113
114enable-http-clone::
115 If set to "1", cgit will act as an dumb HTTP endpoint for git clones.
116 If you use an alternate way of serving git repositories, you may wish
117 to disable this. Default value: "1".
118
108enable-index-links:: 119enable-index-links::
109 Flag which, when set to "1", will make cgit generate extra links for 120 Flag which, when set to "1", will make cgit generate extra links for
110 each repo in the repository index (specifically, to the "summary", 121 each repo in the repository index (specifically, to the "summary",
@@ -320,7 +331,7 @@ source-filter::
320 and the name of the blob as its only command line argument. The STDOUT 331 and the name of the blob as its only command line argument. The STDOUT
321 from the command will be included verbatim as the blob contents, i.e. 332 from the command will be included verbatim as the blob contents, i.e.
322 this can be used to implement e.g. syntax highlighting. Default value: 333 this can be used to implement e.g. syntax highlighting. Default value:
323 none. 334 none. See also: "FILTER API".
324 335
325summary-branches:: 336summary-branches::
326 Specifies the number of branches to display in the repository "summary" 337 Specifies the number of branches to display in the repository "summary"
@@ -353,15 +364,15 @@ REPOSITORY SETTINGS
353------------------- 364-------------------
354repo.about-filter:: 365repo.about-filter::
355 Override the default about-filter. Default value: none. See also: 366 Override the default about-filter. Default value: none. See also:
356 "enable-filter-overrides". 367 "enable-filter-overrides". See also: "FILTER API".
357 368
358repo.clone-url:: 369repo.clone-url::
359 A list of space-separated urls which can be used to clone this repo. 370 A list of space-separated urls which can be used to clone this repo.
360 Default value: none. 371 Default value: none. See also: "MACRO EXPANSION".
361 372
362repo.commit-filter:: 373repo.commit-filter::
363 Override the default commit-filter. Default value: none. See also: 374 Override the default commit-filter. Default value: none. See also:
364 "enable-filter-overrides". 375 "enable-filter-overrides". See also: "FILTER API".
365 376
366repo.defbranch:: 377repo.defbranch::
367 The name of the default branch for this repository. If no such branch 378 The name of the default branch for this repository. If no such branch
@@ -438,7 +449,7 @@ repo.section::
438 449
439repo.source-filter:: 450repo.source-filter::
440 Override the default source-filter. Default value: none. See also: 451 Override the default source-filter. Default value: none. See also:
441 "enable-filter-overrides". 452 "enable-filter-overrides". See also: "FILTER API".
442 453
443repo.url:: 454repo.url::
444 The relative url used to access the repository. This must be the first 455 The relative url used to access the repository. This must be the first
@@ -458,6 +469,40 @@ Note: the "repo." prefix is dropped from the option names in repo-specific
458config files, e.g. "repo.desc" becomes "desc". 469config files, e.g. "repo.desc" becomes "desc".
459 470
460 471
472FILTER API
473----------
474about filter::
475 This filter is given no arguments. The about text that is to be
476 filtered is available on standard input and the filtered text is
477 expected on standard output.
478
479commit filter::
480 This filter is given no arguments. The commit message text that is to
481 be filtered is available on standard input and the filtered text is
482 expected on standard output.
483
484source filter::
485 This filter is given a single parameter: the filename of the source
486 file to filter. The filter can use the filename to determine (for
487 example) the syntax highlighting mode. The contents of the source
488 file that is to be filtered is available on standard input and the
489 filtered contents is expected on standard output.
490
491Also, all filters are handed the following environment variables:
492
493- CGIT_REPO_URL (from repo.url)
494- CGIT_REPO_NAME (from repo.name)
495- CGIT_REPO_PATH (from repo.path)
496- CGIT_REPO_OWNER (from repo.owner)
497- CGIT_REPO_DEFBRANCH (from repo.defbranch)
498- CGIT_REPO_SECTION (from repo.section)
499- CGIT_REPO_CLONE_URL (from repo.clone-url)
500
501If a setting is not defined for a repository and the corresponding global
502setting is also not defined (if applicable), then the corresponding
503environment variable will be unset.
504
505
461MACRO EXPANSION 506MACRO EXPANSION
462--------------- 507---------------
463The following cgitrc options supports a simple macro expansion feature, 508The following cgitrc options supports a simple macro expansion feature,
@@ -477,6 +522,12 @@ can be accomplished by adding the following line to /etc/cgitrc:
477 522
478 include=/etc/cgitrc.d/$HTTP_HOST 523 include=/etc/cgitrc.d/$HTTP_HOST
479 524
525The following options are expanded during request processing, and support
526the environment variables defined in "FILTER API":
527
528- clone-url
529- repo.clone-url
530
480 531
481EXAMPLE CGITRC FILE 532EXAMPLE CGITRC FILE
482------------------- 533-------------------
@@ -486,8 +537,8 @@ EXAMPLE CGITRC FILE
486cache-size=1000 537cache-size=1000
487 538
488 539
489# Specify some default clone prefixes 540# Specify some default clone urls using macro expansion
490clone-prefix=git://example.com ssh://example.com/pub/git http://example.com/git 541clone-url=git://foo.org/$CGIT_REPO_URL git@foo.org:$CGIT_REPO_URL
491 542
492# Specify the css url 543# Specify the css url
493css=/css/cgit.css 544css=/css/cgit.css