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, and the STDOUT
23           from the command will be included verbatim on the about page.
24           Default value: none.
25
26       agefile
27           Specifies a path, relative to each repository path, which can be
28           used to specify the date and time of the youngest commit in the
29           repository. The first line in the file is used as input to the
30           "parse_date" function in libgit. Recommended timestamp-format is
31           "yyyy-mm-dd hh:mm:ss". Default value: "info/web/last-modified".
32
33       cache-root
34           Path used to store the cgit cache entries. Default value:
35           "/var/cache/cgit". See also: "MACRO EXPANSION".
36
37       cache-dynamic-ttl
38           Number which specifies the time-to-live, in minutes, for the cached
39           version of repository pages accessed without a fixed SHA1. Default
40           value: "5".
41
42       cache-repo-ttl
43           Number which specifies the time-to-live, in minutes, for the cached
44           version of the repository summary page. Default value: "5".
45
46       cache-root-ttl
47           Number which specifies the time-to-live, in minutes, for the cached
48           version of the repository index page. Default value: "5".
49
50       cache-scanrc-ttl
51           Number which specifies the time-to-live, in minutes, for the result
52           of scanning a path for git repositories. Default value: "15".
53
54       cache-size
55           The maximum number of entries in the cgit cache. Default value: "0"
56           (i.e. caching is disabled).
57
58       cache-static-ttl
59           Number which specifies the time-to-live, in minutes, for the cached
60           version of repository pages accessed with a fixed SHA1. Default
61           value: "5".
62
63       clone-prefix
64           Space-separated list of common prefixes which, when combined with a
65           repository url, generates valid clone urls for the repository. This
66           setting is only used if repo.clone-url is unspecified. Default
67           value: none.
68
69       commit-filter
70           Specifies a command which will be invoked to format commit
71           messages. The command will get the message on its STDIN, and the
72           STDOUT from the command will be included verbatim as the commit
73           message, i.e. this can be used to implement bugtracker integration.
74           Default value: none.
75
76       css
77           Url which specifies the css document to include in all cgit pages.
78           Default value: "/cgit.css".
79
80       embedded
81           Flag which, when set to "1", will make cgit generate a html
82           fragment suitable for embedding in other html pages. Default value:
83           none. See also: "noheader".
84
85       enable-commit-graph
86           Flag which, when set to "1", will make cgit print an ASCII-art
87           commit history graph to the left of the commit messages in the
88           repository log page. Default value: "0".
89
90       enable-filter-overrides
91           Flag which, when set to "1", allows all filter settings to be
92           overridden in repository-specific cgitrc files. Default value:
93           none.
94
95       enable-gitweb-owner
96           If set to "1" and scan-path is enabled, we first check each
97           repository for the git config value "gitweb.owner" to determine the
98           owner. Default value: "1". See also: scan-path.
99
100       enable-index-links
101           Flag which, when set to "1", will make cgit generate extra links
102           for each repo in the repository index (specifically, to the
103           "summary", "commit" and "tree" pages). Default value: "0".
104
105       enable-log-filecount
106           Flag which, when set to "1", will make cgit print the number of
107           modified files for each commit on the repository log page. Default
108           value: "0".
109
110       enable-log-linecount
111           Flag which, when set to "1", will make cgit print the number of
112           added and removed lines for each commit on the repository log page.
113           Default value: "0".
114
115       enable-remote-branches
116           Flag which, when set to "1", will make cgit display remote branches
117           in the summary and refs views. Default value: "0". See also:
118           "repo.enable-remote-branches".
119
120       enable-subject-links
121           Flag which, when set to "1", will make cgit use the subject of the
122           parent commit as link text when generating links to parent commits
123           in commit view. Default value: "0". See also:
124           "repo.enable-subject-links".
125
126       enable-tree-linenumbers
127           Flag which, when set to "1", will make cgit generate linenumber
128           links for plaintext blobs printed in the tree view. Default value:
129           "1".
130
131       favicon
132           Url used as link to a shortcut icon for cgit. If specified, it is
133           suggested to use the value "/favicon.ico" since certain browsers
134           will ignore other values. Default value: none.
135
136       footer
137           The content of the file specified with this option will be included
138           verbatim at the bottom of all pages (i.e. it replaces the standard
139           "generated by..." message. Default value: none.
140
141       head-include
142           The content of the file specified with this option will be included
143           verbatim in the html HEAD section on all pages. Default value:
144           none.
145
146       header
147           The content of the file specified with this option will be included
148           verbatim at the top of all pages. Default value: none.
149
150       include
151           Name of a configfile to include before the rest of the current
152           config- file is parsed. Default value: none. See also: "MACRO
153           EXPANSION".
154
155       index-header
156           The content of the file specified with this option will be included
157           verbatim above the repository index. This setting is deprecated,
158           and will not be supported by cgit-1.0 (use root-readme instead).
159           Default value: none.
160
161       index-info
162           The content of the file specified with this option will be included
163           verbatim below the heading on the repository index page. This
164           setting is deprecated, and will not be supported by cgit-1.0 (use
165           root-desc instead). Default value: none.
166
167       local-time
168           Flag which, if set to "1", makes cgit print commit and tag times in
169           the servers timezone. Default value: "0".
170
171       logo
172           Url which specifies the source of an image which will be used as a
173           logo on all cgit pages. Default value: "/cgit.png".
174
175       logo-link
176           Url loaded when clicking on the cgit logo image. If unspecified the
177           calculated url of the repository index page will be used. Default
178           value: none.
179
180       max-atom-items
181           Specifies the number of items to display in atom feeds view.
182           Default value: "10".
183
184       max-commit-count
185           Specifies the number of entries to list per page in "log" view.
186           Default value: "50".
187
188       max-message-length
189           Specifies the maximum number of commit message characters to
190           display in "log" view. Default value: "80".
191
192       max-repo-count
193           Specifies the number of entries to list per page on the repository
194           index page. Default value: "50".
195
196       max-repodesc-length
197           Specifies the maximum number of repo description characters to
198           display on the repository index page. Default value: "80".
199
200       max-blob-size
201           Specifies the maximum size of a blob to display HTML for in KBytes.
202           Default value: "0" (limit disabled).
203
204       max-stats
205           Set the default maximum statistics period. Valid values are "week",
206           "month", "quarter" and "year". If unspecified, statistics are
207           disabled. Default value: none. See also: "repo.max-stats".
208
209       mimetype.<ext>
210           Set the mimetype for the specified filename extension. This is used
211           by the plain command when returning blob content.
212
213       module-link
214           Text which will be used as the formatstring for a hyperlink when a
215           submodule is printed in a directory listing. The arguments for the
216           formatstring are the path and SHA1 of the submodule commit. Default
217           value: "./?repo=%s&page=commit&id=%s"
218
219       nocache
220           If set to the value "1" caching will be disabled. This settings is
221           deprecated, and will not be honored starting with cgit-1.0. Default
222           value: "0".
223
224       noplainemail
225           If set to "1" showing full author email adresses will be disabled.
226           Default value: "0".
227
228       noheader
229           Flag which, when set to "1", will make cgit omit the standard
230           header on all pages. Default value: none. See also: "embedded".
231
232       project-list
233           A list of subdirectories inside of scan-path, relative to it, that
234           should loaded as git repositories. This must be defined prior to
235           scan-path. Default value: none. See also: scan-path, "MACRO
236           EXPANSION".
237
238       readme
239           Text which will be used as default value for "repo.readme". Default
240           value: none.
241
242       remove-suffix
243           If set to "1" and scan-path is enabled, if any repositories are
244           found with a suffix of ".git", this suffix will be removed for the
245           url and name. Default value: "0". See also: scan-path.
246
247       renamelimit
248           Maximum number of files to consider when detecting renames. The
249           value "-1" uses the compiletime value in git (for further info,
250           look at man git-diff). Default value: "-1".
251
252       repo.group
253           Legacy alias for "section". This option is deprecated and will not
254           be supported in cgit-1.0.
255
256       robots
257           Text used as content for the "robots" meta-tag. Default value:
258           "index, nofollow".
259
260       root-desc
261           Text printed below the heading on the repository index page.
262           Default value: "a fast webinterface for the git dscm".
263
264       root-readme
265           The content of the file specified with this option will be included
266           verbatim below the "about" link on the repository index page.
267           Default value: none.
268
269       root-title
270           Text printed as heading on the repository index page. Default
271           value: "Git Repository Browser".
272
273       scan-hidden-path
274           If set to "1" and scan-path is enabled, scan-path will recurse into
275           directories whose name starts with a period (.). Otherwise,
276           scan-path will stay away from such directories (considered as
277           "hidden"). Note that this does not apply to the ".git" directory in
278           non-bare repos. This must be defined prior to scan-path. Default
279           value: 0. See also: scan-path.
280
281       scan-path
282           A path which will be scanned for repositories. If caching is
283           enabled, the result will be cached as a cgitrc include-file in the
284           cache directory. If project-list has been defined prior to
285           scan-path, scan-path loads only the directories listed in the file
286           pointed to by project-list. Be advised that only the global
287           settings taken before the scan-path directive will be applied to
288           each repository. Default value: none. See also: cache-scanrc-ttl,
289           project-list, "MACRO EXPANSION".
290
291       section
292           The name of the current repository section - all repositories
293           defined after this option will inherit the current section name.
294           Default value: none.
295
296       section-from-path
297           A number which, if specified before scan-path, specifies how many
298           path elements from each repo path to use as a default section name.
299           If negative, cgit will discard the specified number of path
300           elements above the repo directory. Default value: 0.
301
302       side-by-side-diffs
303           If set to "1" shows side-by-side diffs instead of unidiffs per
304           default. Default value: "0".
305
306       snapshots
307           Text which specifies the default set of snapshot formats generated
308           by cgit. The value is a space-separated list of zero or more of the
309           values "tar", "tar.gz", "tar.bz2", "tar.xz" and "zip". Default
310           value: none.
311
312       source-filter
313           Specifies a command which will be invoked to format plaintext blobs
314           in the tree view. The command will get the blob content on its
315           STDIN and the name of the blob as its only command line argument.
316           The STDOUT from the command will be included verbatim as the blob
317           contents, i.e. this can be used to implement e.g. syntax
318           highlighting. Default value: none.
319
320       summary-branches
321           Specifies the number of branches to display in the repository
322           "summary" view. Default value: "10".
323
324       summary-log
325           Specifies the number of log entries to display in the repository
326           "summary" view. Default value: "10".
327
328       summary-tags
329           Specifies the number of tags to display in the repository "summary"
330           view. Default value: "10".
331
332       strict-export
333           Filename which, if specified, needs to be present within the
334           repository for cgit to allow access to that repository. This can be
335           used to emulate gitweb’s EXPORT_OK and STRICT_EXPORT functionality
336           and limit cgit’s repositories to match those exported by
337           git-daemon. This option MUST come before scan-path.
338
339       virtual-root
340           Url which, if specified, will be used as root for all cgit links.
341           It will also cause cgit to generate virtual urls, i.e. urls like
342           /cgit/tree/README as opposed to ?r=cgit&p=tree&path=README. Default
343           value: none. NOTE: cgit has recently learned how to use PATH_INFO
344           to achieve the same kind of virtual urls, so this option will
345           probably be deprecated.
346

REPOSITORY SETTINGS

348       repo.about-filter
349           Override the default about-filter. Default value: none. See also:
350           "enable-filter-overrides".
351
352       repo.clone-url
353           A list of space-separated urls which can be used to clone this
354           repo. Default value: none.
355
356       repo.commit-filter
357           Override the default commit-filter. Default value: none. See also:
358           "enable-filter-overrides".
359
360       repo.defbranch
361           The name of the default branch for this repository. If no such
362           branch exists in the repository, the first branch name (when
363           sorted) is used as default instead. Default value: "master".
364
365       repo.desc
366           The value to show as repository description. Default value: none.
367
368       repo.enable-commit-graph
369           A flag which can be used to disable the global setting
370           ‘enable-commit-graph’. Default value: none.
371
372       repo.enable-log-filecount
373           A flag which can be used to disable the global setting
374           ‘enable-log-filecount’. Default value: none.
375
376       repo.enable-log-linecount
377           A flag which can be used to disable the global setting
378           ‘enable-log-linecount’. Default value: none.
379
380       repo.enable-remote-branches
381           Flag which, when set to "1", will make cgit display remote branches
382           in the summary and refs views. Default value:
383           <enable-remote-branches>.
384
385       repo.enable-subject-links
386           A flag which can be used to override the global setting
387           ‘enable-subject-links’. Default value: none.
388
389       repo.logo
390           Url which specifies the source of an image which will be used as a
391           logo on this repo’s pages. Default value: global logo.
392
393       repo.logo-link
394           Url loaded when clicking on the cgit logo image. If unspecified the
395           calculated url of the repository index page will be used. Default
396           value: global logo-link.
397
398       repo.module-link
399           Text which will be used as the formatstring for a hyperlink when a
400           submodule is printed in a directory listing. The arguments for the
401           formatstring are the path and SHA1 of the submodule commit. Default
402           value: <module-link>
403
404       repo.max-stats
405           Override the default maximum statistics period. Valid values are
406           equal to the values specified for the global "max-stats" setting.
407           Default value: none.
408
409       repo.name
410           The value to show as repository name. Default value: <repo.url>.
411
412       repo.owner
413           A value used to identify the owner of the repository. Default
414           value: none.
415
416       repo.path
417           An absolute path to the repository directory. For non-bare
418           repositories this is the .git-directory. Default value: none.
419
420       repo.readme
421           A path (relative to <repo.path>) which specifies a file to include
422           verbatim as the "About" page for this repo. You may also specify a
423           git refspec by head or by hash by prepending the refspec followed
424           by a colon. For example, "master:docs/readme.mkd" Default value:
425           <readme>.
426
427       repo.snapshots
428           A mask of allowed snapshot-formats for this repo, restricted by the
429           "snapshots" global setting. Default value: <snapshots>.
430
431       repo.section
432           Override the current section name for this repository. Default
433           value: none.
434
435       repo.source-filter
436           Override the default source-filter. Default value: none. See also:
437           "enable-filter-overrides".
438
439       repo.url
440           The relative url used to access the repository. This must be the
441           first setting specified for each repo. Default value: none.
442

REPOSITORY-SPECIFIC CGITRC FILE

444       When the option "scan-path" is used to auto-discover git repositories,
445       cgit will try to parse the file "cgitrc" within any found repository.
446       Such a repo-specific config file may contain any of the repo-specific
447       options described above, except "repo.url" and "repo.path".
448       Additionally, the "filter" options are only acknowledged in
449       repo-specific config files when "enable-filter-overrides" is set to
450       "1".
451
452       Note: the "repo." prefix is dropped from the option names in
453       repo-specific config files, e.g. "repo.desc" becomes "desc".
454

MACRO EXPANSION

456       The following cgitrc options supports a simple macro expansion feature,
457       where tokens prefixed with "$" are replaced with the value of a
458       similary named environment variable:
459
460       ·   cache-root
461
462       ·   include
463
464       ·   project-list
465
466       ·   scan-path
467
468       Macro expansion will also happen on the content of $CGIT_CONFIG, if
469       defined.
470
471       One usage of this feature is virtual hosting, which in its simplest
472       form can be accomplished by adding the following line to /etc/cgitrc:
473
474           include=/etc/cgitrc.d/$HTTP_HOST
475

EXAMPLE CGITRC FILE

477           # Enable caching of up to 1000 output entriess
478           cache-size=1000
479
480
481           # Specify some default clone prefixes
482           clone-prefix=git://example.com ssh://example.com/pub/git http://example.com/git
483
484           # Specify the css url
485           css=/css/cgit.css
486
487
488           # Show extra links for each repository on the index page
489           enable-index-links=1
490
491
492           # Enable ASCII art commit history graph on the log pages
493           enable-commit-graph=1
494
495
496           # Show number of affected files per commit on the log pages
497           enable-log-filecount=1
498
499
500           # Show number of added/removed lines per commit on the log pages
501           enable-log-linecount=1
502
503
504           # Add a cgit favicon
505           favicon=/favicon.ico
506
507
508           # Use a custom logo
509           logo=/img/mylogo.png
510
511
512           # Enable statistics per week, month and quarter
513           max-stats=quarter
514
515
516           # Set the title and heading of the repository index page
517           root-title=example.com git repositories
518
519
520           # Set a subheading for the repository index page
521           root-desc=tracking the foobar development
522
523
524           # Include some more info about example.com on the index page
525           root-readme=/var/www/htdocs/about.html
526
527
528           # Allow download of tar.gz, tar.bz2 and zip-files
529           snapshots=tar.gz tar.bz2 zip
530
531
532           ##
533           ## List of common mimetypes
534           ##
535
536           mimetype.gif=image/gif
537           mimetype.html=text/html
538           mimetype.jpg=image/jpeg
539           mimetype.jpeg=image/jpeg
540           mimetype.pdf=application/pdf
541           mimetype.png=image/png
542           mimetype.svg=image/svg+xml
543
544
545           ##
546           ## List of repositories.
547           ## PS: Any repositories listed when section is unset will not be
548           ##     displayed under a section heading
549           ## PPS: This list could be kept in a different file (e.g. '/etc/cgitrepos')
550           ##      and included like this:
551           ##        include=/etc/cgitrepos
552           ##
553
554
555           repo.url=foo
556           repo.path=/pub/git/foo.git
557           repo.desc=the master foo repository
558           repo.owner=fooman@example.com
559           repo.readme=info/web/about.html
560
561
562           repo.url=bar
563           repo.path=/pub/git/bar.git
564           repo.desc=the bars for your foo
565           repo.owner=barman@example.com
566           repo.readme=info/web/about.html
567
568
569           # The next repositories will be displayed under the 'extras' heading
570           section=extras
571
572
573           repo.url=baz
574           repo.path=/pub/git/baz.git
575           repo.desc=a set of extensions for bar users
576
577           repo.url=wiz
578           repo.path=/pub/git/wiz.git
579           repo.desc=the wizard of foo
580
581
582           # Add some mirrored repositories
583           section=mirrors
584
585
586           repo.url=git
587           repo.path=/pub/git/git.git
588           repo.desc=the dscm
589
590
591           repo.url=linux
592           repo.path=/pub/git/linux.git
593           repo.desc=the kernel
594
595           # Disable adhoc downloads of this repo
596           repo.snapshots=0
597
598           # Disable line-counts for this repo
599           repo.enable-log-linecount=0
600
601           # Restrict the max statistics period for this repo
602           repo.max-stats=month
603

BUGS

605       Comments currently cannot appear on the same line as a setting; the
606       comment will be included as part of the value. E.g. this line:
607
608           robots=index  # allow indexing
609
610       will generate the following html element:
611
612           <meta name='robots' content='index  # allow indexing'/>
613

AUTHOR

615       Lars Hjemli <hjemli@gmail.com> Jason A. Donenfeld <Jason@zx2c4.com>
616
617
618
619cgit                              07/22/2011                         CGITRC(5)
Impressum