1CGITRC(5)                            cgit                            CGITRC(5)
2
3
4

NAME

6       cgitrc - runtime configuration for cgit
7

SYNOPSIS

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

LOCATION

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

GLOBAL SETTINGS

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

REPOSITORY SETTINGS

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-blame
488           A flag which can be used to disable the global setting
489           ‘enable-blame’. Default value: none.
490
491       repo.enable-commit-graph
492           A flag which can be used to disable the global setting
493           ‘enable-commit-graph’. Default value: none.
494
495       repo.enable-html-serving
496           A flag which can be used to override the global setting
497           enable-html-serving. Default value: none.
498
499       repo.enable-log-filecount
500           A flag which can be used to disable the global setting
501           ‘enable-log-filecount’. Default value: none.
502
503       repo.enable-log-linecount
504           A flag which can be used to disable the global setting
505           ‘enable-log-linecount’. Default value: none.
506
507       repo.enable-remote-branches
508           Flag which, when set to "1", will make cgit display remote branches
509           in the summary and refs views. Default value:
510           <enable-remote-branches>.
511
512       repo.enable-subject-links
513           A flag which can be used to override the global setting
514           ‘enable-subject-links’. Default value: none.
515
516       repo.extra-head-content
517           This value will be added verbatim to the head section of each page
518           displayed for this repo. Default value: none.
519
520       repo.hide
521           Flag which, when set to "1", hides the repository from the
522           repository index. The repository can still be accessed by providing
523           a direct path. Default value: "0". See also: "repo.ignore".
524
525       repo.homepage
526           The value to show as repository homepage. Default value: none.
527
528       repo.ignore
529           Flag which, when set to "1", ignores the repository. The repository
530           is not shown in the index and cannot be accessed by providing a
531           direct path. Default value: "0". See also: "repo.hide".
532
533       repo.logo
534           Url which specifies the source of an image which will be used as a
535           logo on this repo’s pages. Default value: global logo.
536
537       repo.logo-link
538           Url loaded when clicking on the cgit logo image. If unspecified the
539           calculated url of the repository index page will be used. Default
540           value: global logo-link.
541
542       repo.module-link
543           Text which will be used as the formatstring for a hyperlink when a
544           submodule is printed in a directory listing. The arguments for the
545           formatstring are the path and SHA1 of the submodule commit. Default
546           value: <module-link>
547
548       repo.module-link.<path>
549           Text which will be used as the formatstring for a hyperlink when a
550           submodule with the specified subdirectory path is printed in a
551           directory listing. The only argument for the formatstring is the
552           SHA1 of the submodule commit. Default value: none.
553
554       repo.max-stats
555           Override the default maximum statistics period. Valid values are
556           equal to the values specified for the global "max-stats" setting.
557           Default value: none.
558
559       repo.name
560           The value to show as repository name. Default value: <repo.url>.
561
562       repo.owner
563           A value used to identify the owner of the repository. Default
564           value: none.
565
566       repo.owner-filter
567           Override the default owner-filter. Default value: none. See also:
568           "enable-filter-overrides". See also: "FILTER API".
569
570       repo.path
571           An absolute path to the repository directory. For non-bare
572           repositories this is the .git-directory. Default value: none.
573
574       repo.readme
575           A path (relative to <repo.path>) which specifies a file to include
576           verbatim as the "About" page for this repo. You may also specify a
577           git refspec by head or by hash by prepending the refspec followed
578           by a colon. For example, "master:docs/readme.mkd". If the value
579           begins with a colon, i.e. ":docs/readme.rst", the default branch of
580           the repository will be used. Sharing any file will expose that
581           entire directory tree to the "/about/PATH" endpoints, so be sure
582           that there are no non-public files located in the same directory as
583           the readme file. Default value: <readme>.
584
585       repo.section
586           Override the current section name for this repository. Default
587           value: none.
588
589       repo.snapshots
590           A mask of snapshot formats for this repo that cgit generates links
591           for, restricted by the global "snapshots" setting. Default value:
592           <snapshots>.
593
594       repo.snapshot-prefix
595           Prefix to use for snapshot links instead of the repository
596           basename. For example, the "linux-stable" repository may wish to
597           set this to "linux" so that snapshots are in the format
598           "linux-3.15.4" instead of "linux-stable-3.15.4". Default value:
599           <empty> meaning to use the repository basename.
600
601       repo.source-filter
602           Override the default source-filter. Default value: none. See also:
603           "enable-filter-overrides". See also: "FILTER API".
604
605       repo.url
606           The relative url used to access the repository. This must be the
607           first setting specified for each repo. Default value: none.
608

REPOSITORY-SPECIFIC CGITRC FILE

610       When the option "scan-path" is used to auto-discover git repositories,
611       cgit will try to parse the file "cgitrc" within any found repository.
612       Such a repo-specific config file may contain any of the repo-specific
613       options described above, except "repo.url" and "repo.path".
614       Additionally, the "filter" options are only acknowledged in
615       repo-specific config files when "enable-filter-overrides" is set to
616       "1".
617
618       Note: the "repo." prefix is dropped from the option names in
619       repo-specific config files, e.g. "repo.desc" becomes "desc".
620

FILTER API

622       By default, filters are separate processes that are executed each time
623       they are needed. Alternative technologies may be used by prefixing the
624       filter specification with the relevant string; available values are:
625
626       exec:
627           The default "one process per filter" mode.
628
629       lua:
630           Executes the script using a built-in Lua interpreter. The script is
631           loaded once per execution of cgit, and may be called multiple times
632           during cgit’s lifetime, making it a good choice for repeated
633           filters such as the email filter. It responds to three functions:
634
635       filter_open(argument1, argument2, argument3, ...)
636           This is called upon activation of the filter for a particular set
637           of data.
638
639       filter_write(buffer)
640           This is called whenever cgit writes data to the webpage.
641
642       filter_close()
643           This is called when the current filtering operation is completed.
644           It must return an integer value. Usually 0 indicates success.
645
646               Additionally, cgit exposes to the Lua the following built-in functions:
647
648       html(str)
649           Writes str to the webpage.
650
651       html_txt(str)
652           HTML escapes and writes str to the webpage.
653
654       html_attr(str)
655           HTML escapes for an attribute and writes "str' to the webpage.
656
657       html_url_path(str)
658           URL escapes for a path and writes str to the webpage.
659
660       html_url_arg(str)
661           URL escapes for an argument and writes str to the webpage.
662
663       html_include(file)
664           Includes file in webpage.
665
666       Parameters are provided to filters as follows.
667
668       about filter
669           This filter is given a single parameter: the filename of the source
670           file to filter. The filter can use the filename to determine (for
671           example) the type of syntax to follow when formatting the readme
672           file. The about text that is to be filtered is available on
673           standard input and the filtered text is expected on standard
674           output.
675
676       auth filter
677           The authentication filter receives 12 parameters:
678
679           ·   filter action, explained below, which specifies which action
680               the filter is called for
681
682           ·   http cookie
683
684           ·   http method
685
686           ·   http referer
687
688           ·   http path
689
690           ·   http https flag
691
692           ·   cgit repo
693
694           ·   cgit page
695
696           ·   cgit url
697
698           ·   cgit login url When the filter action is "body", this filter
699               must write to output the HTML for displaying the login form,
700               which POSTs to the login url. When the filter action is
701               "authenticate-cookie", this filter must validate the http
702               cookie and return a 0 if it is invalid or 1 if it is invalid,
703               in the exit code / close function. If the filter action is
704               "authenticate-post", this filter receives POST’d parameters on
705               standard input, and should write a complete CGI response,
706               preferably with a 302 redirect, and write to output one or more
707               "Set-Cookie" HTTP headers, each followed by a newline.
708
709                   Please see `filters/simple-authentication.lua` for a clear example
710                   script that may be modified.
711
712       commit filter
713           This filter is given no arguments. The commit message text that is
714           to be filtered is available on standard input and the filtered text
715           is expected on standard output.
716
717       email filter
718           This filter is given two parameters: the email address of the
719           relevant author and a string indicating the originating page. The
720           filter will then receive the text string to format on standard
721           input and is expected to write to standard output the formatted
722           text to be included in the page.
723
724       owner filter
725           This filter is given no arguments. The owner text is available on
726           standard input and the filter is expected to write to standard
727           output. The output is included in the Owner column.
728
729       source filter
730           This filter is given a single parameter: the filename of the source
731           file to filter. The filter can use the filename to determine (for
732           example) the syntax highlighting mode. The contents of the source
733           file that is to be filtered is available on standard input and the
734           filtered contents is expected on standard output.
735
736       All filters are handed the following environment variables:
737
738       ·   CGIT_REPO_URL (from repo.url)
739
740       ·   CGIT_REPO_NAME (from repo.name)
741
742       ·   CGIT_REPO_PATH (from repo.path)
743
744       ·   CGIT_REPO_OWNER (from repo.owner)
745
746       ·   CGIT_REPO_DEFBRANCH (from repo.defbranch)
747
748       ·   CGIT_REPO_SECTION (from repo.section)
749
750       ·   CGIT_REPO_CLONE_URL (from repo.clone-url)
751
752       If a setting is not defined for a repository and the corresponding
753       global setting is also not defined (if applicable), then the
754       corresponding environment variable will be unset.
755

MACRO EXPANSION

757       The following cgitrc options support a simple macro expansion feature,
758       where tokens prefixed with "$" are replaced with the value of a
759       similarly named environment variable:
760
761       ·   cache-root
762
763       ·   include
764
765       ·   project-list
766
767       ·   scan-path
768
769       Macro expansion will also happen on the content of $CGIT_CONFIG, if
770       defined.
771
772       One usage of this feature is virtual hosting, which in its simplest
773       form can be accomplished by adding the following line to /etc/cgitrc:
774
775           include=/etc/cgitrc.d/$HTTP_HOST
776
777       The following options are expanded during request processing, and
778       support the environment variables defined in "FILTER API":
779
780       ·   clone-url
781
782       ·   repo.clone-url
783

CACHE

785       All cache ttl values are in minutes. Negative ttl values indicate that
786       a page type will never expire, and thus the first time a URL is
787       accessed, the result will be cached indefinitely, even if the
788       underlying git repository changes. Conversely, when a ttl value is
789       zero, the cache is disabled for that particular page type, and the page
790       type is never cached.
791

SIGNATURES

793       Cgit can host .asc signatures corresponding to various snapshot
794       formats, through use of git notes. For example, the following command
795       may be used to add a signature to a .tar.xz archive:
796
797           git notes --ref=refs/notes/signatures/tar.xz add -C "$(
798               gpg --output - --armor --detach-sign cgit-1.1.tar.xz |
799               git hash-object -w --stdin
800           )" v1.1
801
802       If it is instead desirable to attach a signature of the underlying
803       .tar, this will be linked, as a special case, beside a .tar.* link that
804       does not have its own signature. For example, a signature of a tarball
805       of the latest tag might be added with a similar command:
806
807           tag="$(git describe --abbrev=0)"
808           git notes --ref=refs/notes/signatures/tar add -C "$(
809               git archive --format tar --prefix "cgit-${tag#v}/" "$tag" |
810               gpg --output - --armor --detach-sign |
811               git hash-object -w --stdin
812           )" "$tag"
813
814       Since git-archive(1) is expected to produce stable output between
815       versions, this allows one to generate a long-term signature of the
816       contents of a given tag.
817

EXAMPLE CGITRC FILE

819           # Enable caching of up to 1000 output entries
820           cache-size=1000
821
822
823           # Specify some default clone urls using macro expansion
824           clone-url=git://foo.org/$CGIT_REPO_URL git@foo.org:$CGIT_REPO_URL
825
826           # Specify the css url
827           css=/css/cgit.css
828
829
830           # Show owner on index page
831           enable-index-owner=1
832
833
834           # Allow http transport git clone
835           enable-http-clone=1
836
837
838           # Show extra links for each repository on the index page
839           enable-index-links=1
840
841
842           # Enable blame page and create links to it from tree page
843           enable-blame=1
844
845
846           # Enable ASCII art commit history graph on the log pages
847           enable-commit-graph=1
848
849
850           # Show number of affected files per commit on the log pages
851           enable-log-filecount=1
852
853
854           # Show number of added/removed lines per commit on the log pages
855           enable-log-linecount=1
856
857
858           # Sort branches by date
859           branch-sort=age
860
861
862           # Add a cgit favicon
863           favicon=/favicon.ico
864
865
866           # Use a custom logo
867           logo=/img/mylogo.png
868
869
870           # Enable statistics per week, month and quarter
871           max-stats=quarter
872
873
874           # Set the title and heading of the repository index page
875           root-title=example.com git repositories
876
877
878           # Set a subheading for the repository index page
879           root-desc=tracking the foobar development
880
881
882           # Include some more info about example.com on the index page
883           root-readme=/var/www/htdocs/about.html
884
885
886           # Allow download of tar.gz, tar.bz2 and zip-files
887           snapshots=tar.gz tar.bz2 zip
888
889
890           ##
891           ## List of common mimetypes
892           ##
893
894           mimetype.gif=image/gif
895           mimetype.html=text/html
896           mimetype.jpg=image/jpeg
897           mimetype.jpeg=image/jpeg
898           mimetype.pdf=application/pdf
899           mimetype.png=image/png
900           mimetype.svg=image/svg+xml
901
902
903           # Highlight source code with python pygments-based highlighter
904           source-filter=/var/www/cgit/filters/syntax-highlighting.py
905
906           # Format markdown, restructuredtext, manpages, text files, and html files
907           # through the right converters
908           about-filter=/var/www/cgit/filters/about-formatting.sh
909
910           ##
911           ## Search for these files in the root of the default branch of repositories
912           ## for coming up with the about page:
913           ##
914           readme=:README.md
915           readme=:readme.md
916           readme=:README.mkd
917           readme=:readme.mkd
918           readme=:README.rst
919           readme=:readme.rst
920           readme=:README.html
921           readme=:readme.html
922           readme=:README.htm
923           readme=:readme.htm
924           readme=:README.txt
925           readme=:readme.txt
926           readme=:README
927           readme=:readme
928           readme=:INSTALL.md
929           readme=:install.md
930           readme=:INSTALL.mkd
931           readme=:install.mkd
932           readme=:INSTALL.rst
933           readme=:install.rst
934           readme=:INSTALL.html
935           readme=:install.html
936           readme=:INSTALL.htm
937           readme=:install.htm
938           readme=:INSTALL.txt
939           readme=:install.txt
940           readme=:INSTALL
941           readme=:install
942
943
944           ##
945           ## List of repositories.
946           ## PS: Any repositories listed when section is unset will not be
947           ##     displayed under a section heading
948           ## PPS: This list could be kept in a different file (e.g. '/etc/cgitrepos')
949           ##      and included like this:
950           ##        include=/etc/cgitrepos
951           ##
952
953
954           repo.url=foo
955           repo.path=/pub/git/foo.git
956           repo.desc=the master foo repository
957           repo.owner=fooman@example.com
958           repo.readme=info/web/about.html
959
960
961           repo.url=bar
962           repo.path=/pub/git/bar.git
963           repo.desc=the bars for your foo
964           repo.owner=barman@example.com
965           repo.readme=info/web/about.html
966
967
968           # The next repositories will be displayed under the 'extras' heading
969           section=extras
970
971
972           repo.url=baz
973           repo.path=/pub/git/baz.git
974           repo.desc=a set of extensions for bar users
975
976           repo.url=wiz
977           repo.path=/pub/git/wiz.git
978           repo.desc=the wizard of foo
979
980
981           # Add some mirrored repositories
982           section=mirrors
983
984
985           repo.url=git
986           repo.path=/pub/git/git.git
987           repo.desc=the dscm
988
989
990           repo.url=linux
991           repo.path=/pub/git/linux.git
992           repo.desc=the kernel
993
994           # Disable adhoc downloads of this repo
995           repo.snapshots=0
996
997           # Disable line-counts for this repo
998           repo.enable-log-linecount=0
999
1000           # Restrict the max statistics period for this repo
1001           repo.max-stats=month
1002

BUGS

1004       Comments currently cannot appear on the same line as a setting; the
1005       comment will be included as part of the value. E.g. this line:
1006
1007           robots=index  # allow indexing
1008
1009       will generate the following html element:
1010
1011           <meta name='robots' content='index  # allow indexing'/>
1012

AUTHOR

1014       Lars Hjemli <hjemli@gmail.com> Jason A. Donenfeld <Jason@zx2c4.com>
1015
1016
1017
1018cgit                              01/28/2020                         CGITRC(5)
Impressum