Merge branch 'gitmaster'
[git/gitweb-warthdog9.git] / gitweb / gitweb_defaults.perl
blobf5c075ca89187740b49420454d83e7926e9858ec
1 # gitweb - simple web interface to track changes in git repositories
3 # (C) 2005-2006, Kay Sievers <kay.sievers@vrfy.org>
4 # (C) 2005, Christian Gierke
6 # This program is licensed under the GPLv2
8 # Base URL for relative URLs in gitweb ($logo, $favicon, ...),
9 # needed and used only for URLs with nonempty PATH_INFO
10 $base_url = $my_url;
12 # When the script is used as DirectoryIndex, the URL does not contain the name
13 # of the script file itself, and $cgi->url() fails to strip PATH_INFO, so we
14 # have to do it ourselves. We make $path_info global because it's also used
15 # later on.
17 # Another issue with the script being the DirectoryIndex is that the resulting
18 # $my_url data is not the full script URL: this is good, because we want
19 # generated links to keep implying the script name if it wasn't explicitly
20 # indicated in the URL we're handling, but it means that $my_url cannot be used
21 # as base URL.
22 # Therefore, if we needed to strip PATH_INFO, then we know that we have
23 # to build the base URL ourselves:
24 $path_info = $ENV{"PATH_INFO"};
25 if ($path_info) {
26 if ($my_url =~ s,\Q$path_info\E$,, &&
27 $my_uri =~ s,\Q$path_info\E$,, &&
28 defined $ENV{'SCRIPT_NAME'}) {
29 $base_url = $cgi->url(-base => 1) . $ENV{'SCRIPT_NAME'};
33 # core git executable to use
34 # this can just be "git" if your webserver has a sensible PATH
35 $GIT = "++GIT_BINDIR++/git";
37 # absolute fs-path which will be prepended to the project path
38 #our $projectroot = "/pub/scm";
39 $projectroot = "++GITWEB_PROJECTROOT++";
41 # fs traversing limit for getting project list
42 # the number is relative to the projectroot
43 $project_maxdepth = "++GITWEB_PROJECT_MAXDEPTH++";
45 # target of the home link on top of all pages
46 $home_link = $my_uri || "/";
48 # string of the home link on top of all pages
49 $home_link_str = "++GITWEB_HOME_LINK_STR++";
51 # name of your site or organization to appear in page titles
52 # replace this with something more descriptive for clearer bookmarks
53 $site_name = "++GITWEB_SITENAME++"
54 || ($ENV{'SERVER_NAME'} || "Untitled") . " Git";
56 # filename of html text to include at top of each page
57 $site_header = "++GITWEB_SITE_HEADER++";
58 # html text to include at home page
59 $home_text = "++GITWEB_HOMETEXT++";
60 # filename of html text to include at bottom of each page
61 $site_footer = "++GITWEB_SITE_FOOTER++";
63 # URI of stylesheets
64 @stylesheets = ("++GITWEB_CSS++");
65 # URI of a single stylesheet, which can be overridden in GITWEB_CONFIG.
66 $stylesheet = undef;
67 # URI of GIT logo (72x27 size)
68 $logo = "++GITWEB_LOGO++";
69 # URI of GIT favicon, assumed to be image/png type
70 $favicon = "++GITWEB_FAVICON++";
71 # URI of gitweb.js (JavaScript code for gitweb)
72 $javascript = "++GITWEB_JS++";
74 # URI and label (title) of GIT logo link
75 #our $logo_url = "http://www.kernel.org/pub/software/scm/git/docs/";
76 #our $logo_label = "git documentation";
77 $logo_url = "http://git-scm.com/";
78 $logo_label = "git homepage";
80 # source of projects list
81 $projects_list = "++GITWEB_LIST++";
83 # the width (in characters) of the projects list "Description" column
84 $projects_list_description_width = 25;
86 # default order of projects list
87 # valid values are none, project, descr, owner, and age
88 $default_projects_order = "project";
90 # show repository only if this file exists
91 # (only effective if this variable evaluates to true)
92 $export_ok = "++GITWEB_EXPORT_OK++";
94 # show repository only if this subroutine returns true
95 # when given the path to the project, for example:
96 # sub { return -e "$_[0]/git-daemon-export-ok"; }
97 $export_auth_hook = undef;
99 # only allow viewing of repositories also shown on the overview page
100 $strict_export = "++GITWEB_STRICT_EXPORT++";
102 # list of git base URLs used for URL to where fetch project from,
103 # i.e. full URL is "$git_base_url/$project"
104 @git_base_url_list = grep { $_ ne '' } ("++GITWEB_BASE_URL++");
106 # default blob_plain mimetype and default charset for text/plain blob
107 $default_blob_plain_mimetype = 'text/plain';
108 $default_text_plain_charset = undef;
110 # file to use for guessing MIME types before trying /etc/mime.types
111 # (relative to the current git repository)
112 $mimetypes_file = undef;
114 # assume this charset if line contains non-UTF-8 characters;
115 # it should be valid encoding (see Encoding::Supported(3pm) for list),
116 # for which encoding all byte sequences are valid, for example
117 # 'iso-8859-1' aka 'latin1' (it is decoded without checking, so it
118 # could be even 'utf-8' for the old behavior)
119 $fallback_encoding = 'latin1';
121 # rename detection options for git-diff and git-diff-tree
122 # - default is '-M', with the cost proportional to
123 # (number of removed files) * (number of new files).
124 # - more costly is '-C' (which implies '-M'), with the cost proportional to
125 # (number of changed files + number of removed files) * (number of new files)
126 # - even more costly is '-C', '--find-copies-harder' with cost
127 # (number of files in the original tree) * (number of new files)
128 # - one might want to include '-B' option, e.g. '-B', '-M'
129 @diff_opts = ('-M'); # taken from git_commit
131 # Disables features that would allow repository owners to inject script into
132 # the gitweb domain.
133 $prevent_xss = 0;
135 # information about snapshot formats that gitweb is capable of serving
136 %known_snapshot_formats = (
137 # name => {
138 # 'display' => display name,
139 # 'type' => mime type,
140 # 'suffix' => filename suffix,
141 # 'format' => --format for git-archive,
142 # 'compressor' => [compressor command and arguments]
143 # (array reference, optional)
144 # 'disabled' => boolean (optional)}
146 'tgz' => {
147 'display' => 'tar.gz',
148 'type' => 'application/x-gzip',
149 'suffix' => '.tar.gz',
150 'format' => 'tar',
151 'compressor' => ['gzip']},
153 'tbz2' => {
154 'display' => 'tar.bz2',
155 'type' => 'application/x-bzip2',
156 'suffix' => '.tar.bz2',
157 'format' => 'tar',
158 'compressor' => ['bzip2']},
160 'txz' => {
161 'display' => 'tar.xz',
162 'type' => 'application/x-xz',
163 'suffix' => '.tar.xz',
164 'format' => 'tar',
165 'compressor' => ['xz'],
166 'disabled' => 1},
168 'zip' => {
169 'display' => 'zip',
170 'type' => 'application/x-zip',
171 'suffix' => '.zip',
172 'format' => 'zip'},
175 # Aliases so we understand old gitweb.snapshot values in repository
176 # configuration.
177 %known_snapshot_format_aliases = (
178 'gzip' => 'tgz',
179 'bzip2' => 'tbz2',
180 'xz' => 'txz',
182 # backward compatibility: legacy gitweb config support
183 'x-gzip' => undef, 'gz' => undef,
184 'x-bzip2' => undef, 'bz2' => undef,
185 'x-zip' => undef, '' => undef,
188 # Pixel sizes for icons and avatars. If the default font sizes or lineheights
189 # are changed, it may be appropriate to change these values too via
190 # $GITWEB_CONFIG.
191 %avatar_size = (
192 'default' => 16,
193 'double' => 32
196 # This is here to allow for missmatch git & gitweb versions
197 $missmatch_git = '';
199 #This is here to deal with an extra link on the summary pages - if it's left blank
200 # this link will not be shwon. If it's set, this will be prepended to the repo and used
201 $gitlinkurl = '';
203 # Used to set the maximum load that we will still respond to gitweb queries.
204 # If server load exceed this value then return "503 server busy" error.
205 # If gitweb cannot determined server load, it is taken to be 0.
206 # Leave it undefined (or set to 'undef') to turn off load checking.
207 $maxload = 300;
209 # This enables/disables the caching layer in gitweb. This currently only supports the
210 # 'dumb' file based caching layer, primarily used on git.kernel.org. this is reasonably
211 # effective but it has the downside of requiring a huge amount of disk space if there
212 # are a number of repositories involved. It is not uncommon for git.kernel.org to have
213 # on the order of 80G - 120G accumulate over the course of a few months. It is recommended
214 # that the cache directory be periodically completely deleted, and this is safe to perform.
215 # Suggested mechanism
216 # mv $cacheidr $cachedir.flush;mkdir $cachedir;rm -rf $cachedir.flush
217 # Value is binary. 0 = disabled (default), 1 = enabled.
218 $cache_enable = 0;
220 # Used to set the minimum cache timeout for the dynamic caching algorithm. Basically
221 # if we calculate the cache to be under this number of seconds we set the cache timeout
222 # to this minimum.
223 # Value is in seconds. 1 = 1 seconds, 60 = 1 minute, 600 = 10 minutes, 3600 = 1 hour
224 $minCacheTime = 20;
226 # Used to set the maximum cache timeout for the dynamic caching algorithm. Basically
227 # if we calculate the cache to exceed this number of seconds we set the cache timeout
228 # to this maximum.
229 # Value is in seconds. 1 = 1 seconds, 60 = 1 minute, 600 = 10 minutes, 3600 = 1 hour
230 $maxCacheTime = 1200;
232 # If you need to change the location of the caching directory, override this
233 # otherwise this will probably do fine for you
234 $cachedir = 'cache';
236 # If this is set (to 1) cache will do it's best to always display something instead
237 # of making someone wait for the cache to update. This will launch the cacheUpdate
238 # into the background and it will lock a <file>.bg file and will only lock the
239 # actual cache file when it needs to write into it. In theory this will make
240 # gitweb seem more responsive at the price of possibly stale data.
241 $backgroundCache = 1;
243 # Used to set the maximum cache file life. If a cache files last modify time exceeds
244 # this value, it will assume that the data is just too old, and HAS to be regenerated
245 # instead of trying to display the existing cache data.
246 # Value is in seconds. 1 = 1 seconds, 60 = 1 minute, 600 = 10 minutes, 3600 = 1 hour
247 # 18000 = 5 hours
248 $maxCacheLife = 18000;
250 # You define site-wide feature defaults here; override them with
251 # $GITWEB_CONFIG as necessary.
252 %feature = (
253 # feature => {
254 # 'sub' => feature-sub (subroutine),
255 # 'override' => allow-override (boolean),
256 # 'default' => [ default options...] (array reference)}
258 # if feature is overridable (it means that allow-override has true value),
259 # then feature-sub will be called with default options as parameters;
260 # return value of feature-sub indicates if to enable specified feature
262 # if there is no 'sub' key (no feature-sub), then feature cannot be
263 # overriden
265 # use gitweb_get_feature(<feature>) to retrieve the <feature> value
266 # (an array) or gitweb_check_feature(<feature>) to check if <feature>
267 # is enabled
269 # Enable the 'blame' blob view, showing the last commit that modified
270 # each line in the file. This can be very CPU-intensive.
272 # To enable system wide have in $GITWEB_CONFIG
273 # $feature{'blame'}{'default'} = [1];
274 # To have project specific config enable override in $GITWEB_CONFIG
275 # $feature{'blame'}{'override'} = 1;
276 # and in project config gitweb.blame = 0|1;
277 'blame' => {
278 'sub' => sub { feature_bool('blame', @_) },
279 'override' => 0,
280 'default' => [0]},
282 # Enable the 'snapshot' link, providing a compressed archive of any
283 # tree. This can potentially generate high traffic if you have large
284 # project.
286 # Value is a list of formats defined in %known_snapshot_formats that
287 # you wish to offer.
288 # To disable system wide have in $GITWEB_CONFIG
289 # $feature{'snapshot'}{'default'} = [];
290 # To have project specific config enable override in $GITWEB_CONFIG
291 # $feature{'snapshot'}{'override'} = 1;
292 # and in project config, a comma-separated list of formats or "none"
293 # to disable. Example: gitweb.snapshot = tbz2,zip;
294 'snapshot' => {
295 'sub' => \&feature_snapshot,
296 'override' => 0,
297 'default' => ['tgz']},
299 # Enable text search, which will list the commits which match author,
300 # committer or commit text to a given string. Enabled by default.
301 # Project specific override is not supported.
302 'search' => {
303 'override' => 0,
304 'default' => [1]},
306 # Enable grep search, which will list the files in currently selected
307 # tree containing the given string. Enabled by default. This can be
308 # potentially CPU-intensive, of course.
310 # To enable system wide have in $GITWEB_CONFIG
311 # $feature{'grep'}{'default'} = [1];
312 # To have project specific config enable override in $GITWEB_CONFIG
313 # $feature{'grep'}{'override'} = 1;
314 # and in project config gitweb.grep = 0|1;
315 'grep' => {
316 'sub' => sub { feature_bool('grep', @_) },
317 'override' => 0,
318 'default' => [1]},
320 # Enable the pickaxe search, which will list the commits that modified
321 # a given string in a file. This can be practical and quite faster
322 # alternative to 'blame', but still potentially CPU-intensive.
324 # To enable system wide have in $GITWEB_CONFIG
325 # $feature{'pickaxe'}{'default'} = [1];
326 # To have project specific config enable override in $GITWEB_CONFIG
327 # $feature{'pickaxe'}{'override'} = 1;
328 # and in project config gitweb.pickaxe = 0|1;
329 'pickaxe' => {
330 'sub' => sub { feature_bool('pickaxe', @_) },
331 'override' => 0,
332 'default' => [1]},
334 # Enable showing size of blobs in a 'tree' view, in a separate
335 # column, similar to what 'ls -l' does. This cost a bit of IO.
337 # To disable system wide have in $GITWEB_CONFIG
338 # $feature{'show-sizes'}{'default'} = [0];
339 # To have project specific config enable override in $GITWEB_CONFIG
340 # $feature{'show-sizes'}{'override'} = 1;
341 # and in project config gitweb.showsizes = 0|1;
342 'show-sizes' => {
343 'sub' => sub { feature_bool('showsizes', @_) },
344 'override' => 0,
345 'default' => [1]},
347 # Make gitweb use an alternative format of the URLs which can be
348 # more readable and natural-looking: project name is embedded
349 # directly in the path and the query string contains other
350 # auxiliary information. All gitweb installations recognize
351 # URL in either format; this configures in which formats gitweb
352 # generates links.
354 # To enable system wide have in $GITWEB_CONFIG
355 # $feature{'pathinfo'}{'default'} = [1];
356 # Project specific override is not supported.
358 # Note that you will need to change the default location of CSS,
359 # favicon, logo and possibly other files to an absolute URL. Also,
360 # if gitweb.cgi serves as your indexfile, you will need to force
361 # $my_uri to contain the script name in your $GITWEB_CONFIG.
362 'pathinfo' => {
363 'override' => 0,
364 'default' => [0]},
366 # Make gitweb consider projects in project root subdirectories
367 # to be forks of existing projects. Given project $projname.git,
368 # projects matching $projname/*.git will not be shown in the main
369 # projects list, instead a '+' mark will be added to $projname
370 # there and a 'forks' view will be enabled for the project, listing
371 # all the forks. If project list is taken from a file, forks have
372 # to be listed after the main project.
374 # To enable system wide have in $GITWEB_CONFIG
375 # $feature{'forks'}{'default'} = [1];
376 # Project specific override is not supported.
377 'forks' => {
378 'override' => 0,
379 'default' => [0]},
381 # Insert custom links to the action bar of all project pages.
382 # This enables you mainly to link to third-party scripts integrating
383 # into gitweb; e.g. git-browser for graphical history representation
384 # or custom web-based repository administration interface.
386 # The 'default' value consists of a list of triplets in the form
387 # (label, link, position) where position is the label after which
388 # to insert the link and link is a format string where %n expands
389 # to the project name, %f to the project path within the filesystem,
390 # %h to the current hash (h gitweb parameter) and %b to the current
391 # hash base (hb gitweb parameter); %% expands to %.
393 # To enable system wide have in $GITWEB_CONFIG e.g.
394 # $feature{'actions'}{'default'} = [('graphiclog',
395 # '/git-browser/by-commit.html?r=%n', 'summary')];
396 # Project specific override is not supported.
397 'actions' => {
398 'override' => 0,
399 'default' => []},
401 # Allow gitweb scan project content tags described in ctags/
402 # of project repository, and display the popular Web 2.0-ish
403 # "tag cloud" near the project list. Note that this is something
404 # COMPLETELY different from the normal Git tags.
406 # gitweb by itself can show existing tags, but it does not handle
407 # tagging itself; you need an external application for that.
408 # For an example script, check Girocco's cgi/tagproj.cgi.
409 # You may want to install the HTML::TagCloud Perl module to get
410 # a pretty tag cloud instead of just a list of tags.
412 # To enable system wide have in $GITWEB_CONFIG
413 # $feature{'ctags'}{'default'} = ['path_to_tag_script'];
414 # Project specific override is not supported.
415 'ctags' => {
416 'override' => 0,
417 'default' => [0]},
419 # The maximum number of patches in a patchset generated in patch
420 # view. Set this to 0 or undef to disable patch view, or to a
421 # negative number to remove any limit.
423 # To disable system wide have in $GITWEB_CONFIG
424 # $feature{'patches'}{'default'} = [0];
425 # To have project specific config enable override in $GITWEB_CONFIG
426 # $feature{'patches'}{'override'} = 1;
427 # and in project config gitweb.patches = 0|n;
428 # where n is the maximum number of patches allowed in a patchset.
429 'patches' => {
430 'sub' => \&feature_patches,
431 'override' => 0,
432 'default' => [16]},
434 # Avatar support. When this feature is enabled, views such as
435 # shortlog or commit will display an avatar associated with
436 # the email of the committer(s) and/or author(s).
438 # Currently available providers are gravatar and picon.
439 # If an unknown provider is specified, the feature is disabled.
441 # Gravatar depends on Digest::MD5.
442 # Picon currently relies on the indiana.edu database.
444 # To enable system wide have in $GITWEB_CONFIG
445 # $feature{'avatar'}{'default'} = ['<provider>'];
446 # where <provider> is either gravatar or picon.
447 # To have project specific config enable override in $GITWEB_CONFIG
448 # $feature{'avatar'}{'override'} = 1;
449 # and in project config gitweb.avatar = <provider>;
450 'avatar' => {
451 'sub' => \&feature_avatar,
452 'override' => 0,
453 'default' => ['']},
455 # Enable displaying how much time and how many git commands
456 # it took to generate and display page. Disabled by default.
457 # Project specific override is not supported.
458 'timed' => {
459 'override' => 0,
460 'default' => [0]},
462 # Enable turning some links into links to actions which require
463 # JavaScript to run (like 'blame_incremental'). Not enabled by
464 # default. Project specific override is currently not supported.
465 'javascript-actions' => {
466 'override' => 0,
467 'default' => [0]},