config: we're so precious
[girocco/readme.git] / gitweb / gitweb_config.perl
blob584abb6858b80dcc5af692c006537c465df97ab6
1 # Pull Girocco config
2 use lib "__BASEDIR__";
3 use Girocco::Config;
4 use Girocco::Util qw(url_path);
5 use Digest::MD5 qw(md5_hex);
6 BEGIN {
7 eval { require HTML::Email::Obfuscate; 1 } or
8 eval {
9 require Girocco::Email::Obfuscate;
10 $INC{'HTML/Email/Obfuscate.pm'} = $INC{'Girocco/Email/Obfuscate.pm'}; # mwahaha
14 ## For the complete overview of available configuration options,
15 ## see git.git/gitweb/gitweb.perl file beginning (git.git/gitweb/README
16 ## may miss some custom patches, in theory).
18 # rename detection options for git-diff and git-diff-tree (default is '-M')
19 our @diff_opts = ('-B', '-C');
21 # Whether to include project list on the gitweb front page; 0 means yes,
22 # 1 means no list but show tag cloud if enabled (all projects still need
23 # to be scanned, unless the info is cached), 2 means no list and no tag cloud
24 # (very fast)
25 our $frontpage_no_project_list = 1;
27 ## projects list cache for busy sites with many projects;
28 ## if you set this to non-zero, it will be used as the cached
29 ## index lifetime in minutes
30 our $projlist_cache_lifetime = 10;
32 ## default charset for text/plain blob
33 our $default_text_plain_charset = 'utf-8';
35 # Comment out to disable ctags or set to 1 for display only
36 $feature{'ctags'}{'default'}=["@{[url_path($Girocco::Config::webadmurl)]}/tagproj.cgi"];
37 #$feature{'ctags'}{'default'}=[1]; # display-only setting (no add tag box on summary page)
39 $feature{'blame'}{'default'}=[1];
40 $feature{'blame_incremental'}{'default'}=[1];
42 $feature{'snapshot'}{'default'} = ['tgz', 'zip'];
44 # Enable override to turn off snapshots on a per-repository basis with config gitweb.snapshot=none
45 #$feature{'snapshot'}{'override'} = 1;
47 # Change this from 1 to 0 to disable all searching
48 # (it's enabled by default so commenting this out will still leave it enabled)
49 # Note that project-specific override is NOT supported for this option!
50 $feature{'search'}{'default'}=[1];
52 # Change this from 0 to 1 to enable git regular expression searches
53 # (they can be CPU/memory intensive when malicious regular expressions are used)
54 # (they're enabled by default so commenting this out will leave them enabled)
55 $feature{'regexp'}{'default'}=[0];
57 # Enable override to control regexp on a per-repository basis with config gitweb.regexp=<bool>
58 #$feature{'regexp'}{'override'} = 1;
60 # Change this from 0 to 1 to enable grep searches (they can be CPU intensive)
61 # (it's enabled by default so commenting this out will leave it enabled)
62 # Note that it will be automatically disabled if 'search' is disabled.
63 $feature{'grep'}{'default'}=[0];
65 # Enable override to control grep on a per-repository basis with config gitweb.grep=<bool>
66 #$feature{'grep'}{'override'} = 1;
68 # Change this from 0 to 1 to enable pickaxe searches (they can be CPU intensive)
69 # (it's enabled by default so commenting this out will leave it enabled)
70 # Note that it will be automatically disabled if 'search' is disabled.
71 $feature{'pickaxe'}{'default'}=[0];
73 # Enable override to control pickaxe on a per-repository basis with config gitweb.pickaxe=<bool>
74 #$feature{'pickaxe'}{'override'} = 1;
76 # Enable this to highlight sources if highlight is available
77 #$feature{'highlight'}{'default'} = [1];
79 # Set this if highlight is enabled and not available as 'highlight' in $PATH
80 # You should set this to the full absolute path to highlight whenever highlight
81 # cannot be found in any of the `getconf PATH` directories.
82 #our $highlight_bin = "highlight";
84 # the width (in characters) of the projects list "Description" column
85 # (the default is only 25 if this is not set)
86 our $projects_list_description_width = 40;
88 ###
89 ### You probably don't really want to tweak anything below.
90 ###
92 # Base web full url
93 our $my_url = $Girocco::Config::gitweburl;
95 # Base web path absolute url except "/" should be ""
96 our $my_uri = url_path($Girocco::Config::gitweburl);
98 # Base web path absolute url
99 our $base_url = url_path($Girocco::Config::gitweburl,1);
101 ## git base URL used for URL to fetch bundle information page
102 ## i.e. full URL is "$git_base_bundles_url/$project/bundles"
103 our $git_base_bundles_url = url_path($Girocco::Config::bundlesurl);
105 # https hint html inserted right after any https push URL (undef for none)
106 # e.g. "<a href="https_push_instructions.html">https push instructions</a>"
107 our $https_hint_html = undef;
108 $https_hint_html = substr(<<HINT,0,-1) if $Girocco::Config::httpspushurl;
109 <sup class="sup"><span><a href="@{[url_path($Girocco::Config::htmlurl)]}/httpspush.html">(learn&#160;more)</a></span></sup>
110 HINT
112 # owner link hook given owner name (full and NOT obfuscated)
113 # should return full URL-escaped link to attach to owner, for example:
114 # sub { return "/showowner.cgi?owner=".CGI::Util::escape($_[0]); }
115 our $owner_link_hook = undef;
116 $owner_link_hook = sub { url_path($Girocco::Config::webadmurl)."/projlist.cgi?name=".md5_hex(lc($_[0])); };
118 # Path to a POSIX shell. Needed to run $highlight_bin and a snapshot compressor.
119 # Only used when highlight is enabled or snapshots with compressors are enabled.
120 our $posix_shell_bin;
121 $posix_shell_bin = $Girocco::Config::posix_sh_bin if $Girocco::Config::posix_sh_bin;
123 ## core git executable to use
124 ## this can just be "git" if your webserver has a sensible PATH
125 our $GIT = $Girocco::Config::git_bin;
127 ## path to automatic README.html utility
128 our $git_automatic_readme_html = $Girocco::Config::basedir . '/bin/run-format-readme.sh';
130 ## absolute fs-path which will be prepended to the project path
131 our $projectroot = $Girocco::Config::reporoot;
133 # source of projects list
134 our $projects_list = $Girocco::Config::projlist_cache_dir."/gitweb.list";
136 ## target of the home link on top of all pages (absolute url)
137 our $home_link = url_path($Girocco::Config::gitweburl,1);
139 ## string of the home link on top of all pages
140 our $home_link_str = $Girocco::Config::name;
142 ## name of your site or organization to appear in page titles
143 ## replace this with something more descriptive for clearer bookmarks
144 our $site_name = $Girocco::Config::title;
146 ## html text to include at home page
147 our $home_text = "$Girocco::Config::basedir/gitweb/indextext.html";
149 ## URI of stylesheets
150 our @stylesheets = ("@{[url_path($Girocco::Config::gitwebfiles)]}/gitweb.css");
152 ## URI of GIT logo (72x27 size)
153 our $logo = "@{[url_path($Girocco::Config::gitwebfiles)]}/git-logo.png";
155 ## URI of GIT favicon, assumed to be image/png type
156 our $favicon = "@{[url_path($Girocco::Config::gitwebfiles)]}/git-favicon.png";
158 ## URI of gitweb.js
159 our $javascript = "@{[url_path($Girocco::Config::gitwebfiles)]}/gitweb.js";
161 ## URL Hints
163 ## Any of the urls in @git_base_url_list, @git_base_mirror_urls or
164 ## @git_base_push_urls may be an array ref instead of a scalar in which
165 ## case ${}[0] is the url and ${}[1] is an html fragment "hint" to display
166 ## right after the URL.
168 ## list of git base URLs used for URL for where to fetch project from,
169 ## i.e. full URL is "$git_base_url/$project"
170 our @git_base_url_list = ();
171 $Girocco::Config::gitpullurl and push @git_base_url_list, $Girocco::Config::gitpullurl;
172 $Girocco::Config::httppullurl and push @git_base_url_list, $Girocco::Config::httppullurl;
174 ## For push projects (a .nofetch file exists OR gitweb.showpush is true)
175 ## @git_base_url_list entries are shown as "mirror URL" and @git_base_push_urls
176 ## are shown as "push URL" and @git_base_mirror_urls are ignored.
177 ## For non-push projects, @git_base_url_list and @git_base_mirror_urls are shown
178 ## as "mirror URL" and @git_base_push_urls are ignored.
180 ## list of extra git base URLs used for mirrors for where to fetch project from,
181 ## i.e. full URL is "$git_base_mirror_url/$project"
182 our @git_base_mirror_urls = ();
183 $Girocco::Config::httpspushurl && $Girocco::Config::httpspushurl ne ($Girocco::Config::httppullurl||'') and
184 push @git_base_mirror_urls, [$Girocco::Config::httpspushurl,
185 "<sup class=\"sup\"><span><a href=\"@{[url_path($Girocco::Config::htmlurl)]}/rootcert.html\">(learn&#160;more)</a></span></sup>"];
186 $Girocco::Config::pushurl && $Girocco::Config::pushurl =~ m|^ssh://|i and
187 push @git_base_mirror_urls, substr($Girocco::Config::pushurl, 0, 6) .
188 'git@' . substr($Girocco::Config::pushurl, 6);
190 ## list of git base URLs used for URL to push project to,
191 ## i.e. full URL is "$git_base_push_url/$project"
192 our @git_base_push_urls = ();
193 $Girocco::Config::pushurl and push @git_base_push_urls, $Girocco::Config::pushurl;
194 $Girocco::Config::httpspushurl and push @git_base_push_urls, $Girocco::Config::httpspushurl;
196 our $cache_grpshared = 1;
197 our $cache_dir = $Girocco::Config::projlist_cache_dir;
199 our $lastactivity_file = "info/lastactivity";
201 $html_cache_actions{'summary'} = 1;
203 our $per_request_config = 0;
205 our $auto_fcgi = 1;
207 $feature{'pathinfo'}{'default'}=[1];
209 $feature{'forks'}{'default'}=[1];
211 $feature{'actions'}{'default'}=[
212 ('graphiclog', "@{[url_path($Girocco::Config::gitwebfiles)]}/git-browser/by-commit.html?r=%n", 'log'),
213 ('edit', "@{[url_path($Girocco::Config::webadmurl)]}/editproj.cgi?name=%e", 'refs'),
214 ('fork', "@{[url_path($Girocco::Config::webadmurl)]}/regproj.cgi?fork=%e", 'edit')
217 # Prevent any fast CGI instance from holding on to a possibly now-invalid
218 # current working directory. The "root" directory will always be valid (or you
219 # have bigger problems) even if it's the "root" of a chroot or other kind of
220 # jail. gitweb.cgi does not need or require any particular cwd to function and
221 # as all "use"s and "require"s that depend on the 'use lib "."' have already
222 # been completed by now it's safe to "cd /" at this point.
223 chdir "/";