1CGITRC(5) cgit CGITRC(5)
2
3
4
6 cgitrc - runtime configuration for cgit
7
9 Cgitrc contains all runtime settings for cgit, including the list of
10 git repositories, formatted as a line-separated list of NAME=VALUE
11 pairs. Blank lines, and lines starting with #, are ignored.
12
14 The default location of cgitrc, defined at compile time, is
15 /etc/cgitrc. At runtime, cgit will consult the environment variable
16 CGIT_CONFIG and, if defined, use its value instead.
17
19 about-filter
20 Specifies a command which will be invoked to format the content of
21 about pages (both top-level and for each repository). The command
22 will get the content of the about-file on its STDIN, the name of
23 the file as the first argument, and the STDOUT from the command
24 will be included verbatim on the about page. Default value: none.
25 See also: "FILTER API".
26
27 agefile
28 Specifies a path, relative to each repository path, which can be
29 used to specify the date and time of the youngest commit in the
30 repository. The first line in the file is used as input to the
31 "parse_date" function in libgit. Recommended timestamp-format is
32 "yyyy-mm-dd hh:mm:ss". You may want to generate this file from a
33 post-receive hook. Default value: "info/web/last-modified".
34
35 auth-filter
36 Specifies a command that will be invoked for authenticating
37 repository access. Receives quite a few arguments, and data on both
38 stdin and stdout for authentication processing. Details follow
39 later in this document. If no auth-filter is specified, no
40 authentication is performed. Default value: none. See also: "FILTER
41 API".
42
43 branch-sort
44 Flag which, when set to "age", enables date ordering in the branch
45 ref list, and when set to "name" enables ordering by branch name.
46 Default value: "name".
47
48 cache-about-ttl
49 Number which specifies the time-to-live, in minutes, for the cached
50 version of the repository about page. See also: "CACHE". Default
51 value: "15".
52
53 cache-dynamic-ttl
54 Number which specifies the time-to-live, in minutes, for the cached
55 version of repository pages accessed without a fixed SHA1. See
56 also: "CACHE". Default value: "5".
57
58 cache-repo-ttl
59 Number which specifies the time-to-live, in minutes, for the cached
60 version of the repository summary page. See also: "CACHE". Default
61 value: "5".
62
63 cache-root
64 Path used to store the cgit cache entries. Default value:
65 "/var/cache/cgit". See also: "MACRO EXPANSION".
66
67 cache-root-ttl
68 Number which specifies the time-to-live, in minutes, for the cached
69 version of the repository index page. See also: "CACHE". Default
70 value: "5".
71
72 cache-scanrc-ttl
73 Number which specifies the time-to-live, in minutes, for the result
74 of scanning a path for git repositories. See also: "CACHE". Default
75 value: "15".
76
77 case-sensitive-sort
78 Sort items in the repo list case sensitively. Default value: "1".
79 See also: repository-sort, section-sort.
80
81 cache-size
82 The maximum number of entries in the cgit cache. When set to "0",
83 caching is disabled. See also: "CACHE". Default value: "0"
84
85 cache-snapshot-ttl
86 Number which specifies the time-to-live, in minutes, for the cached
87 version of snapshots. See also: "CACHE". Default value: "5".
88
89 cache-static-ttl
90 Number which specifies the time-to-live, in minutes, for the cached
91 version of repository pages accessed with a fixed SHA1. See also:
92 "CACHE". Default value: -1".
93
94 clone-prefix
95 Space-separated list of common prefixes which, when combined with a
96 repository url, generates valid clone urls for the repository. This
97 setting is only used if repo.clone-url is unspecified. Default
98 value: none.
99
100 clone-url
101 Space-separated list of clone-url templates. This setting is only
102 used if repo.clone-url is unspecified. Default value: none. See
103 also: "MACRO EXPANSION", "FILTER API".
104
105 commit-filter
106 Specifies a command which will be invoked to format commit
107 messages. The command will get the message on its STDIN, and the
108 STDOUT from the command will be included verbatim as the commit
109 message, i.e. this can be used to implement bugtracker integration.
110 Default value: none. See also: "FILTER API".
111
112 commit-sort
113 Flag which, when set to "date", enables strict date ordering in the
114 commit log, and when set to "topo" enables strict topological
115 ordering. If unset, the default ordering of "git log" is used.
116 Default value: unset.
117
118 css
119 Url which specifies the css document to include in all cgit pages.
120 Default value: "/cgit.css".
121
122 email-filter
123 Specifies a command which will be invoked to format names and email
124 address of committers, authors, and taggers, as represented in
125 various places throughout the cgit interface. This command will
126 receive an email address and an origin page string as its command
127 line arguments, and the text to format on STDIN. It is to write the
128 formatted text back out onto STDOUT. Default value: none. See also:
129 "FILTER API".
130
131 embedded
132 Flag which, when set to "1", will make cgit generate a html
133 fragment suitable for embedding in other html pages. Default value:
134 none. See also: "noheader".
135
136 enable-blame
137 Flag which, when set to "1", will allow cgit to provide a "blame"
138 page for files, and will make it generate links to that page in
139 appropriate places. Default value: "0".
140
141 enable-commit-graph
142 Flag which, when set to "1", will make cgit print an ASCII-art
143 commit history graph to the left of the commit messages in the
144 repository log page. Default value: "0".
145
146 enable-filter-overrides
147 Flag which, when set to "1", allows all filter settings to be
148 overridden in repository-specific cgitrc files. Default value:
149 none.
150
151 enable-follow-links
152 Flag which, when set to "1", allows users to follow a file in the
153 log view. Default value: "0".
154
155 enable-git-config
156 Flag which, when set to "1", will allow cgit to use git config to
157 set any repo specific settings. This option is used in conjunction
158 with "scan-path", and must be defined prior, to augment
159 repo-specific settings. The keys gitweb.owner, gitweb.category,
160 gitweb.description, and gitweb.homepage will map to the cgit keys
161 repo.owner, repo.section, repo.desc, and repo.homepage
162 respectively. All git config keys that begin with "cgit." will be
163 mapped to the corresponding "repo." key in cgit. Default value:
164 "0". See also: scan-path, section-from-path.
165
166 enable-http-clone
167 If set to "1", cgit will act as a dumb HTTP endpoint for git
168 clones. You can add "http://$HTTP_HOST$SCRIPT_NAME/$CGIT_REPO_URL"
169 to clone-url to expose this feature. If you use an alternate way of
170 serving git repositories, you may wish to disable this. Default
171 value: "1".
172
173 enable-html-serving
174 Flag which, when set to "1", will allow the /plain handler to serve
175 mimetype headers that result in the file being treated as HTML by
176 the browser. When set to "0", such file types are returned instead
177 as text/plain or application/octet-stream. Default value: "0". See
178 also: "repo.enable-html-serving".
179
180 enable-index-links
181 Flag which, when set to "1", will make cgit generate extra links
182 for each repo in the repository index (specifically, to the
183 "summary", "commit" and "tree" pages). Default value: "0".
184
185 enable-index-owner
186 Flag which, when set to "1", will make cgit display the owner of
187 each repo in the repository index. Default value: "1".
188
189 enable-log-filecount
190 Flag which, when set to "1", will make cgit print the number of
191 modified files for each commit on the repository log page. Default
192 value: "0".
193
194 enable-log-linecount
195 Flag which, when set to "1", will make cgit print the number of
196 added and removed lines for each commit on the repository log page.
197 Default value: "0".
198
199 enable-remote-branches
200 Flag which, when set to "1", will make cgit display remote branches
201 in the summary and refs views. Default value: "0". See also:
202 "repo.enable-remote-branches".
203
204 enable-subject-links
205 Flag which, when set to "1", will make cgit use the subject of the
206 parent commit as link text when generating links to parent commits
207 in commit view. Default value: "0". See also:
208 "repo.enable-subject-links".
209
210 enable-tree-linenumbers
211 Flag which, when set to "1", will make cgit generate linenumber
212 links for plaintext blobs printed in the tree view. Default value:
213 "1".
214
215 favicon
216 Url used as link to a shortcut icon for cgit. It is suggested to
217 use the value "/favicon.ico" since certain browsers will ignore
218 other values. Default value: "/favicon.ico".
219
220 footer
221 The content of the file specified with this option will be included
222 verbatim at the bottom of all pages (i.e. it replaces the standard
223 "generated by..." message. Default value: none.
224
225 head-include
226 The content of the file specified with this option will be included
227 verbatim in the html HEAD section on all pages. Default value:
228 none.
229
230 header
231 The content of the file specified with this option will be included
232 verbatim at the top of all pages. Default value: none.
233
234 include
235 Name of a configfile to include before the rest of the current
236 config- file is parsed. Default value: none. See also: "MACRO
237 EXPANSION".
238
239 local-time
240 Flag which, if set to "1", makes cgit print commit and tag times in
241 the servers timezone. Default value: "0".
242
243 logo
244 Url which specifies the source of an image which will be used as a
245 logo on all cgit pages. Default value: "/cgit.png".
246
247 logo-link
248 Url loaded when clicking on the cgit logo image. If unspecified the
249 calculated url of the repository index page will be used. Default
250 value: none.
251
252 max-atom-items
253 Specifies the number of items to display in atom feeds view.
254 Default value: "10".
255
256 max-blob-size
257 Specifies the maximum size of a blob to display HTML for in KBytes.
258 Default value: "0" (limit disabled).
259
260 max-commit-count
261 Specifies the number of entries to list per page in "log" view.
262 Default value: "50".
263
264 max-message-length
265 Specifies the maximum number of commit message characters to
266 display in "log" view. Default value: "80".
267
268 max-repo-count
269 Specifies the number of entries to list per page on the repository
270 index page. Default value: "50".
271
272 max-repodesc-length
273 Specifies the maximum number of repo description characters to
274 display on the repository index page. Default value: "80".
275
276 max-stats
277 Set the default maximum statistics period. Valid values are "week",
278 "month", "quarter" and "year". If unspecified, statistics are
279 disabled. Default value: none. See also: "repo.max-stats".
280
281 mimetype.<ext>
282 Set the mimetype for the specified filename extension. This is used
283 by the plain command when returning blob content.
284
285 mimetype-file
286 Specifies the file to use for automatic mimetype lookup. If
287 specified then this field is used as a fallback when no
288 "mimetype.<ext>" match is found. If unspecified then no such lookup
289 is performed. The typical file to use on a Linux system is
290 /etc/mime.types. The format of the file must comply to:
291
292 · a comment line is an empty line or a line starting with a hash
293 (#), optionally preceded by whitespace
294
295 · a non-comment line starts with the mimetype (like image/png),
296 followed by one or more file extensions (like jpg), all
297 separated by whitespace Default value: none. See also:
298 "mimetype.<ext>".
299
300 module-link
301 Text which will be used as the formatstring for a hyperlink when a
302 submodule is printed in a directory listing. The arguments for the
303 formatstring are the path and SHA1 of the submodule commit. Default
304 value: none.
305
306 noplainemail
307 If set to "1" showing full author email addresses will be disabled.
308 Default value: "0".
309
310 noheader
311 Flag which, when set to "1", will make cgit omit the standard
312 header on all pages. Default value: none. See also: "embedded".
313
314 owner-filter
315 Specifies a command which will be invoked to format the Owner
316 column of the main page. The command will get the owner on STDIN,
317 and the STDOUT from the command will be included verbatim in the
318 table. This can be used to link to additional context such as an
319 owners home page. When active this filter is used instead of the
320 default owner query url. Default value: none. See also: "FILTER
321 API".
322
323 project-list
324 A list of subdirectories inside of scan-path, relative to it, that
325 should loaded as git repositories. This must be defined prior to
326 scan-path. Default value: none. See also: scan-path, "MACRO
327 EXPANSION".
328
329 readme
330 Text which will be used as default value for "repo.readme".
331 Multiple config keys may be specified, and cgit will use the first
332 found file in this list. This is useful in conjunction with
333 scan-path. Default value: none. See also: scan-path, repo.readme.
334
335 remove-suffix
336 If set to "1" and scan-path is enabled, if any repositories are
337 found with a suffix of ".git", this suffix will be removed for the
338 url and name. This must be defined prior to scan-path. Default
339 value: "0". See also: scan-path.
340
341 renamelimit
342 Maximum number of files to consider when detecting renames. The
343 value "-1" uses the compiletime value in git (for further info,
344 look at man git-diff). Default value: "-1".
345
346 repository-sort
347 The way in which repositories in each section are sorted. Valid
348 values are "name" for sorting by the repo name or "age" for sorting
349 by the most recently updated repository. Default value: "name". See
350 also: section, case-sensitive-sort, section-sort.
351
352 robots
353 Text used as content for the "robots" meta-tag. Default value:
354 "index, nofollow".
355
356 root-desc
357 Text printed below the heading on the repository index page.
358 Default value: "a fast webinterface for the git dscm".
359
360 root-readme
361 The content of the file specified with this option will be included
362 verbatim below the "about" link on the repository index page.
363 Default value: none.
364
365 root-title
366 Text printed as heading on the repository index page. Default
367 value: "Git Repository Browser".
368
369 scan-hidden-path
370 If set to "1" and scan-path is enabled, scan-path will recurse into
371 directories whose name starts with a period (.). Otherwise,
372 scan-path will stay away from such directories (considered as
373 "hidden"). Note that this does not apply to the ".git" directory in
374 non-bare repos. This must be defined prior to scan-path. Default
375 value: 0. See also: scan-path.
376
377 scan-path
378 A path which will be scanned for repositories. If caching is
379 enabled, the result will be cached as a cgitrc include-file in the
380 cache directory. If project-list has been defined prior to
381 scan-path, scan-path loads only the directories listed in the file
382 pointed to by project-list. Be advised that only the global
383 settings taken before the scan-path directive will be applied to
384 each repository. Default value: none. See also: cache-scanrc-ttl,
385 project-list, "MACRO EXPANSION".
386
387 section
388 The name of the current repository section - all repositories
389 defined after this option will inherit the current section name.
390 Default value: none.
391
392 section-sort
393 Flag which, when set to "1", will sort the sections on the
394 repository listing by name. Set this flag to "0" if the order in
395 the cgitrc file should be preserved. Default value: "1". See also:
396 section, case-sensitive-sort, repository-sort.
397
398 section-from-path
399 A number which, if defined prior to scan-path, specifies how many
400 path elements from each repo path to use as a default section name.
401 If negative, cgit will discard the specified number of path
402 elements above the repo directory. Default value: "0".
403
404 side-by-side-diffs
405 If set to "1" shows side-by-side diffs instead of unidiffs per
406 default. Default value: "0".
407
408 snapshots
409 Text which specifies the default set of snapshot formats that cgit
410 generates links for. The value is a space-separated list of zero or
411 more of the values "tar", "tar.gz", "tar.bz2", "tar.xz" and "zip".
412 The special value "all" enables all snapshot formats. Default
413 value: none.
414
415 source-filter
416 Specifies a command which will be invoked to format plaintext blobs
417 in the tree view. The command will get the blob content on its
418 STDIN and the name of the blob as its only command line argument.
419 The STDOUT from the command will be included verbatim as the blob
420 contents, i.e. this can be used to implement e.g. syntax
421 highlighting. Default value: none. See also: "FILTER API".
422
423 summary-branches
424 Specifies the number of branches to display in the repository
425 "summary" view. Default value: "10".
426
427 summary-log
428 Specifies the number of log entries to display in the repository
429 "summary" view. Default value: "10".
430
431 summary-tags
432 Specifies the number of tags to display in the repository "summary"
433 view. Default value: "10".
434
435 strict-export
436 Filename which, if specified, needs to be present within the
437 repository for cgit to allow access to that repository. This can be
438 used to emulate gitweb’s EXPORT_OK and STRICT_EXPORT functionality
439 and limit cgit’s repositories to match those exported by
440 git-daemon. This option must be defined prior to scan-path.
441
442 virtual-root
443 Url which, if specified, will be used as root for all cgit links.
444 It will also cause cgit to generate virtual urls, i.e. urls like
445 /cgit/tree/README as opposed to ?r=cgit&p=tree&path=README. Default
446 value: none. NOTE: cgit has recently learned how to use PATH_INFO
447 to achieve the same kind of virtual urls, so this option will
448 probably be deprecated.
449
451 repo.about-filter
452 Override the default about-filter. Default value: none. See also:
453 "enable-filter-overrides". See also: "FILTER API".
454
455 repo.branch-sort
456 Flag which, when set to "age", enables date ordering in the branch
457 ref list, and when set to "name" enables ordering by branch name.
458 Default value: "name".
459
460 repo.clone-url
461 A list of space-separated urls which can be used to clone this
462 repo. Default value: none. See also: "MACRO EXPANSION".
463
464 repo.commit-filter
465 Override the default commit-filter. Default value: none. See also:
466 "enable-filter-overrides". See also: "FILTER API".
467
468 repo.commit-sort
469 Flag which, when set to "date", enables strict date ordering in the
470 commit log, and when set to "topo" enables strict topological
471 ordering. If unset, the default ordering of "git log" is used.
472 Default value: unset.
473
474 repo.defbranch
475 The name of the default branch for this repository. If no such
476 branch exists in the repository, the first branch name (when
477 sorted) is used as default instead. Default value: branch pointed
478 to by HEAD, or "master" if there is no suitable HEAD.
479
480 repo.desc
481 The value to show as repository description. Default value: none.
482
483 repo.email-filter
484 Override the default email-filter. Default value: none. See also:
485 "enable-filter-overrides". See also: "FILTER API".
486
487 repo.enable-commit-graph
488 A flag which can be used to disable the global setting
489 ‘enable-commit-graph’. Default value: none.
490
491 repo.enable-html-serving
492 A flag which can be used to override the global setting
493 enable-html-serving. Default value: none.
494
495 repo.enable-log-filecount
496 A flag which can be used to disable the global setting
497 ‘enable-log-filecount’. Default value: none.
498
499 repo.enable-log-linecount
500 A flag which can be used to disable the global setting
501 ‘enable-log-linecount’. Default value: none.
502
503 repo.enable-remote-branches
504 Flag which, when set to "1", will make cgit display remote branches
505 in the summary and refs views. Default value:
506 <enable-remote-branches>.
507
508 repo.enable-subject-links
509 A flag which can be used to override the global setting
510 ‘enable-subject-links’. Default value: none.
511
512 repo.extra-head-content
513 This value will be added verbatim to the head section of each page
514 displayed for this repo. Default value: none.
515
516 repo.hide
517 Flag which, when set to "1", hides the repository from the
518 repository index. The repository can still be accessed by providing
519 a direct path. Default value: "0". See also: "repo.ignore".
520
521 repo.homepage
522 The value to show as repository homepage. Default value: none.
523
524 repo.ignore
525 Flag which, when set to "1", ignores the repository. The repository
526 is not shown in the index and cannot be accessed by providing a
527 direct path. Default value: "0". See also: "repo.hide".
528
529 repo.logo
530 Url which specifies the source of an image which will be used as a
531 logo on this repo’s pages. Default value: global logo.
532
533 repo.logo-link
534 Url loaded when clicking on the cgit logo image. If unspecified the
535 calculated url of the repository index page will be used. Default
536 value: global logo-link.
537
538 repo.module-link
539 Text which will be used as the formatstring for a hyperlink when a
540 submodule is printed in a directory listing. The arguments for the
541 formatstring are the path and SHA1 of the submodule commit. Default
542 value: <module-link>
543
544 repo.module-link.<path>
545 Text which will be used as the formatstring for a hyperlink when a
546 submodule with the specified subdirectory path is printed in a
547 directory listing. The only argument for the formatstring is the
548 SHA1 of the submodule commit. Default value: none.
549
550 repo.max-stats
551 Override the default maximum statistics period. Valid values are
552 equal to the values specified for the global "max-stats" setting.
553 Default value: none.
554
555 repo.name
556 The value to show as repository name. Default value: <repo.url>.
557
558 repo.owner
559 A value used to identify the owner of the repository. Default
560 value: none.
561
562 repo.owner-filter
563 Override the default owner-filter. Default value: none. See also:
564 "enable-filter-overrides". See also: "FILTER API".
565
566 repo.path
567 An absolute path to the repository directory. For non-bare
568 repositories this is the .git-directory. Default value: none.
569
570 repo.readme
571 A path (relative to <repo.path>) which specifies a file to include
572 verbatim as the "About" page for this repo. You may also specify a
573 git refspec by head or by hash by prepending the refspec followed
574 by a colon. For example, "master:docs/readme.mkd". If the value
575 begins with a colon, i.e. ":docs/readme.rst", the default branch of
576 the repository will be used. Sharing any file will expose that
577 entire directory tree to the "/about/PATH" endpoints, so be sure
578 that there are no non-public files located in the same directory as
579 the readme file. Default value: <readme>.
580
581 repo.section
582 Override the current section name for this repository. Default
583 value: none.
584
585 repo.snapshots
586 A mask of snapshot formats for this repo that cgit generates links
587 for, restricted by the global "snapshots" setting. Default value:
588 <snapshots>.
589
590 repo.snapshot-prefix
591 Prefix to use for snapshot links instead of the repository
592 basename. For example, the "linux-stable" repository may wish to
593 set this to "linux" so that snapshots are in the format
594 "linux-3.15.4" instead of "linux-stable-3.15.4". Default value:
595 <empty> meaning to use the repository basename.
596
597 repo.source-filter
598 Override the default source-filter. Default value: none. See also:
599 "enable-filter-overrides". See also: "FILTER API".
600
601 repo.url
602 The relative url used to access the repository. This must be the
603 first setting specified for each repo. Default value: none.
604
606 When the option "scan-path" is used to auto-discover git repositories,
607 cgit will try to parse the file "cgitrc" within any found repository.
608 Such a repo-specific config file may contain any of the repo-specific
609 options described above, except "repo.url" and "repo.path".
610 Additionally, the "filter" options are only acknowledged in
611 repo-specific config files when "enable-filter-overrides" is set to
612 "1".
613
614 Note: the "repo." prefix is dropped from the option names in
615 repo-specific config files, e.g. "repo.desc" becomes "desc".
616
618 By default, filters are separate processes that are executed each time
619 they are needed. Alternative technologies may be used by prefixing the
620 filter specification with the relevant string; available values are:
621
622 exec:
623 The default "one process per filter" mode.
624
625 lua:
626 Executes the script using a built-in Lua interpreter. The script is
627 loaded once per execution of cgit, and may be called multiple times
628 during cgit’s lifetime, making it a good choice for repeated
629 filters such as the email filter. It responds to three functions:
630
631 filter_open(argument1, argument2, argument3, ...)
632 This is called upon activation of the filter for a particular set
633 of data.
634
635 filter_write(buffer)
636 This is called whenever cgit writes data to the webpage.
637
638 filter_close()
639 This is called when the current filtering operation is completed.
640 It must return an integer value. Usually 0 indicates success.
641
642 Additionally, cgit exposes to the Lua the following built-in functions:
643
644 html(str)
645 Writes str to the webpage.
646
647 html_txt(str)
648 HTML escapes and writes str to the webpage.
649
650 html_attr(str)
651 HTML escapes for an attribute and writes "str' to the webpage.
652
653 html_url_path(str)
654 URL escapes for a path and writes str to the webpage.
655
656 html_url_arg(str)
657 URL escapes for an argument and writes str to the webpage.
658
659 html_include(file)
660 Includes file in webpage.
661
662 Parameters are provided to filters as follows.
663
664 about filter
665 This filter is given a single parameter: the filename of the source
666 file to filter. The filter can use the filename to determine (for
667 example) the type of syntax to follow when formatting the readme
668 file. The about text that is to be filtered is available on
669 standard input and the filtered text is expected on standard
670 output.
671
672 auth filter
673 The authentication filter receives 12 parameters:
674
675 · filter action, explained below, which specifies which action
676 the filter is called for
677
678 · http cookie
679
680 · http method
681
682 · http referer
683
684 · http path
685
686 · http https flag
687
688 · cgit repo
689
690 · cgit page
691
692 · cgit url
693
694 · cgit login url When the filter action is "body", this filter
695 must write to output the HTML for displaying the login form,
696 which POSTs to the login url. When the filter action is
697 "authenticate-cookie", this filter must validate the http
698 cookie and return a 0 if it is invalid or 1 if it is invalid,
699 in the exit code / close function. If the filter action is
700 "authenticate-post", this filter receives POST’d parameters on
701 standard input, and should write a complete CGI response,
702 preferably with a 302 redirect, and write to output one or more
703 "Set-Cookie" HTTP headers, each followed by a newline.
704
705 Please see `filters/simple-authentication.lua` for a clear example
706 script that may be modified.
707
708 commit filter
709 This filter is given no arguments. The commit message text that is
710 to be filtered is available on standard input and the filtered text
711 is expected on standard output.
712
713 email filter
714 This filter is given two parameters: the email address of the
715 relevant author and a string indicating the originating page. The
716 filter will then receive the text string to format on standard
717 input and is expected to write to standard output the formatted
718 text to be included in the page.
719
720 owner filter
721 This filter is given no arguments. The owner text is available on
722 standard input and the filter is expected to write to standard
723 output. The output is included in the Owner column.
724
725 source filter
726 This filter is given a single parameter: the filename of the source
727 file to filter. The filter can use the filename to determine (for
728 example) the syntax highlighting mode. The contents of the source
729 file that is to be filtered is available on standard input and the
730 filtered contents is expected on standard output.
731
732 All filters are handed the following environment variables:
733
734 · CGIT_REPO_URL (from repo.url)
735
736 · CGIT_REPO_NAME (from repo.name)
737
738 · CGIT_REPO_PATH (from repo.path)
739
740 · CGIT_REPO_OWNER (from repo.owner)
741
742 · CGIT_REPO_DEFBRANCH (from repo.defbranch)
743
744 · CGIT_REPO_SECTION (from repo.section)
745
746 · CGIT_REPO_CLONE_URL (from repo.clone-url)
747
748 If a setting is not defined for a repository and the corresponding
749 global setting is also not defined (if applicable), then the
750 corresponding environment variable will be unset.
751
753 The following cgitrc options support a simple macro expansion feature,
754 where tokens prefixed with "$" are replaced with the value of a
755 similarly named environment variable:
756
757 · cache-root
758
759 · include
760
761 · project-list
762
763 · scan-path
764
765 Macro expansion will also happen on the content of $CGIT_CONFIG, if
766 defined.
767
768 One usage of this feature is virtual hosting, which in its simplest
769 form can be accomplished by adding the following line to /etc/cgitrc:
770
771 include=/etc/cgitrc.d/$HTTP_HOST
772
773 The following options are expanded during request processing, and
774 support the environment variables defined in "FILTER API":
775
776 · clone-url
777
778 · repo.clone-url
779
781 All cache ttl values are in minutes. Negative ttl values indicate that
782 a page type will never expire, and thus the first time a URL is
783 accessed, the result will be cached indefinitely, even if the
784 underlying git repository changes. Conversely, when a ttl value is
785 zero, the cache is disabled for that particular page type, and the page
786 type is never cached.
787
789 Cgit can host .asc signatures corresponding to various snapshot
790 formats, through use of git notes. For example, the following command
791 may be used to add a signature to a .tar.xz archive:
792
793 git notes --ref=refs/notes/signatures/tar.xz add -C "$(
794 gpg --output - --armor --detach-sign cgit-1.1.tar.xz |
795 git hash-object -w --stdin
796 )" v1.1
797
798 If it is instead desirable to attach a signature of the underlying
799 .tar, this will be linked, as a special case, beside a .tar.* link that
800 does not have its own signature. For example, a signature of a tarball
801 of the latest tag might be added with a similar command:
802
803 tag="$(git describe --abbrev=0)"
804 git notes --ref=refs/notes/signatures/tar add -C "$(
805 git archive --format tar --prefix "cgit-${tag#v}/" "$tag" |
806 gpg --output - --armor --detach-sign |
807 git hash-object -w --stdin
808 )" "$tag"
809
810 Since git-archive(1) is expected to produce stable output between
811 versions, this allows one to generate a long-term signature of the
812 contents of a given tag.
813
815 # Enable caching of up to 1000 output entries
816 cache-size=1000
817
818
819 # Specify some default clone urls using macro expansion
820 clone-url=git://foo.org/$CGIT_REPO_URL git@foo.org:$CGIT_REPO_URL
821
822 # Specify the css url
823 css=/css/cgit.css
824
825
826 # Show owner on index page
827 enable-index-owner=1
828
829
830 # Allow http transport git clone
831 enable-http-clone=1
832
833
834 # Show extra links for each repository on the index page
835 enable-index-links=1
836
837
838 # Enable blame page and create links to it from tree page
839 enable-blame=1
840
841
842 # Enable ASCII art commit history graph on the log pages
843 enable-commit-graph=1
844
845
846 # Show number of affected files per commit on the log pages
847 enable-log-filecount=1
848
849
850 # Show number of added/removed lines per commit on the log pages
851 enable-log-linecount=1
852
853
854 # Sort branches by date
855 branch-sort=age
856
857
858 # Add a cgit favicon
859 favicon=/favicon.ico
860
861
862 # Use a custom logo
863 logo=/img/mylogo.png
864
865
866 # Enable statistics per week, month and quarter
867 max-stats=quarter
868
869
870 # Set the title and heading of the repository index page
871 root-title=example.com git repositories
872
873
874 # Set a subheading for the repository index page
875 root-desc=tracking the foobar development
876
877
878 # Include some more info about example.com on the index page
879 root-readme=/var/www/htdocs/about.html
880
881
882 # Allow download of tar.gz, tar.bz2 and zip-files
883 snapshots=tar.gz tar.bz2 zip
884
885
886 ##
887 ## List of common mimetypes
888 ##
889
890 mimetype.gif=image/gif
891 mimetype.html=text/html
892 mimetype.jpg=image/jpeg
893 mimetype.jpeg=image/jpeg
894 mimetype.pdf=application/pdf
895 mimetype.png=image/png
896 mimetype.svg=image/svg+xml
897
898
899 # Highlight source code with python pygments-based highlighter
900 source-filter=/var/www/cgit/filters/syntax-highlighting.py
901
902 # Format markdown, restructuredtext, manpages, text files, and html files
903 # through the right converters
904 about-filter=/var/www/cgit/filters/about-formatting.sh
905
906 ##
907 ## Search for these files in the root of the default branch of repositories
908 ## for coming up with the about page:
909 ##
910 readme=:README.md
911 readme=:readme.md
912 readme=:README.mkd
913 readme=:readme.mkd
914 readme=:README.rst
915 readme=:readme.rst
916 readme=:README.html
917 readme=:readme.html
918 readme=:README.htm
919 readme=:readme.htm
920 readme=:README.txt
921 readme=:readme.txt
922 readme=:README
923 readme=:readme
924 readme=:INSTALL.md
925 readme=:install.md
926 readme=:INSTALL.mkd
927 readme=:install.mkd
928 readme=:INSTALL.rst
929 readme=:install.rst
930 readme=:INSTALL.html
931 readme=:install.html
932 readme=:INSTALL.htm
933 readme=:install.htm
934 readme=:INSTALL.txt
935 readme=:install.txt
936 readme=:INSTALL
937 readme=:install
938
939
940 ##
941 ## List of repositories.
942 ## PS: Any repositories listed when section is unset will not be
943 ## displayed under a section heading
944 ## PPS: This list could be kept in a different file (e.g. '/etc/cgitrepos')
945 ## and included like this:
946 ## include=/etc/cgitrepos
947 ##
948
949
950 repo.url=foo
951 repo.path=/pub/git/foo.git
952 repo.desc=the master foo repository
953 repo.owner=fooman@example.com
954 repo.readme=info/web/about.html
955
956
957 repo.url=bar
958 repo.path=/pub/git/bar.git
959 repo.desc=the bars for your foo
960 repo.owner=barman@example.com
961 repo.readme=info/web/about.html
962
963
964 # The next repositories will be displayed under the 'extras' heading
965 section=extras
966
967
968 repo.url=baz
969 repo.path=/pub/git/baz.git
970 repo.desc=a set of extensions for bar users
971
972 repo.url=wiz
973 repo.path=/pub/git/wiz.git
974 repo.desc=the wizard of foo
975
976
977 # Add some mirrored repositories
978 section=mirrors
979
980
981 repo.url=git
982 repo.path=/pub/git/git.git
983 repo.desc=the dscm
984
985
986 repo.url=linux
987 repo.path=/pub/git/linux.git
988 repo.desc=the kernel
989
990 # Disable adhoc downloads of this repo
991 repo.snapshots=0
992
993 # Disable line-counts for this repo
994 repo.enable-log-linecount=0
995
996 # Restrict the max statistics period for this repo
997 repo.max-stats=month
998
1000 Comments currently cannot appear on the same line as a setting; the
1001 comment will be included as part of the value. E.g. this line:
1002
1003 robots=index # allow indexing
1004
1005 will generate the following html element:
1006
1007 <meta name='robots' content='index # allow indexing'/>
1008
1010 Lars Hjemli <hjemli@gmail.com> Jason A. Donenfeld <Jason@zx2c4.com>
1011
1012
1013
1014cgit 01/31/2019 CGITRC(5)