update-all-config.pl: switch from qx to pipe
[girocco.git] / gitweb / gitweb_config.perl
blobfed9d883e288f357d9a68749da31d7ca20ea3564
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
36 $feature{'ctags'}{'default'}=["@{[url_path($Girocco::Config::webadmurl)]}/tagproj.cgi"];
38 $feature{'blame'}{'default'}=[1];
39 $feature{'blame_incremental'}{'default'}=[1];
41 $feature{'snapshot'}{'default'} = ['tgz', 'zip'];
43 # Enable override to turn off snapshots on a per-repository basis with config gitweb.snapshot=none
44 #$feature{'snapshot'}{'override'} = 1;
46 # Change this from 1 to 0 to disable all searching
47 # (it's enabled by default so commenting this out will still leave it enabled)
48 # Note that project-specific override is NOT supported for this option!
49 $feature{'search'}{'default'}=[1];
51 # Change this from 0 to 1 to enable git regular expression searches
52 # (they can be CPU/memory intensive when malicious regular expressions are used)
53 # (they're enabled by default so commenting this out will leave them enabled)
54 $feature{'regexp'}{'default'}=[0];
56 # Enable override to control regexp on a per-repository basis with config gitweb.regexp=<bool>
57 #$feature{'regexp'}{'override'} = 1;
59 # Change this from 0 to 1 to enable grep searches (they can be CPU intensive)
60 # (it's enabled by default so commenting this out will leave it enabled)
61 # Note that it will be automatically disabled if 'search' is disabled.
62 $feature{'grep'}{'default'}=[0];
64 # Enable override to control grep on a per-repository basis with config gitweb.grep=<bool>
65 #$feature{'grep'}{'override'} = 1;
67 # Change this from 0 to 1 to enable pickaxe searches (they can be CPU intensive)
68 # (it's enabled by default so commenting this out will leave it enabled)
69 # Note that it will be automatically disabled if 'search' is disabled.
70 $feature{'pickaxe'}{'default'}=[0];
72 # Enable override to control pickaxe on a per-repository basis with config gitweb.pickaxe=<bool>
73 #$feature{'pickaxe'}{'override'} = 1;
75 # Enable this to highlight sources if highlight is available
76 #$feature{'highlight'}{'default'} = [1];
78 # Set this if highlight is enabled and not available as 'highlight' in $PATH
79 # You should set this to the full absolute path to highlight whenever highlight
80 # cannot be found in any of the `getconf PATH` directories.
81 #our $highlight_bin = "highlight";
83 # the width (in characters) of the projects list "Description" column
84 # (the default is only 25 if this is not set)
85 our $projects_list_description_width = 40;
87 ###
88 ### You probably don't really want to tweak anything below.
89 ###
91 # Base web full url
92 our $my_url = $Girocco::Config::gitweburl;
94 # Base web path absolute url except "/" should be ""
95 our $my_uri = url_path($Girocco::Config::gitweburl);
97 # Base web path absolute url
98 our $base_url = url_path($Girocco::Config::gitweburl,1);
100 ## git base URL used for URL to fetch bundle information page
101 ## i.e. full URL is "$git_base_bundles_url/$project/bundles"
102 our $git_base_bundles_url = url_path($Girocco::Config::bundlesurl);
104 # https hint html inserted right after any https push URL (undef for none)
105 # e.g. "<a href="https_push_instructions.html">https push instructions</a>"
106 our $https_hint_html = undef;
107 $https_hint_html = substr(<<HINT,0,-1) if $Girocco::Config::httpspushurl;
108 <sup class="sup"><span><a href="@{[url_path($Girocco::Config::htmlurl)]}/httpspush.html">(learn&#160;more)</a></span></sup>
109 HINT
111 # owner link hook given owner name (full and NOT obfuscated)
112 # should return full URL-escaped link to attach to owner, for example:
113 # sub { return "/showowner.cgi?owner=".CGI::Util::escape($_[0]); }
114 our $owner_link_hook = undef;
115 $owner_link_hook = sub { url_path($Girocco::Config::webadmurl)."/projlist.cgi?name=".md5_hex(lc($_[0])); };
117 # Path to a POSIX shell. Needed to run $highlight_bin and a snapshot compressor.
118 # Only used when highlight is enabled or snapshots with compressors are enabled.
119 our $posix_shell_bin;
120 $posix_shell_bin = $Girocco::Config::posix_sh_bin if $Girocco::Config::posix_sh_bin;
122 ## core git executable to use
123 ## this can just be "git" if your webserver has a sensible PATH
124 our $GIT = $Girocco::Config::git_bin;
126 ## path to automatic README.html utility
127 our $git_automatic_readme_html = $Girocco::Config::basedir . '/bin/run-format-readme.sh';
129 ## absolute fs-path which will be prepended to the project path
130 our $projectroot = $Girocco::Config::reporoot;
132 # source of projects list
133 our $projects_list = $Girocco::Config::projlist_cache_dir."/gitweb.list";
135 ## target of the home link on top of all pages (absolute url)
136 our $home_link = url_path($Girocco::Config::gitweburl,1);
138 ## string of the home link on top of all pages
139 our $home_link_str = $Girocco::Config::name;
141 ## name of your site or organization to appear in page titles
142 ## replace this with something more descriptive for clearer bookmarks
143 our $site_name = $Girocco::Config::title;
145 ## html text to include at home page
146 our $home_text = "$Girocco::Config::basedir/gitweb/indextext.html";
148 ## URI of stylesheets
149 our @stylesheets = ("@{[url_path($Girocco::Config::gitwebfiles)]}/gitweb.css");
151 ## URI of GIT logo (72x27 size)
152 our $logo = "@{[url_path($Girocco::Config::gitwebfiles)]}/git-logo.png";
154 ## URI of GIT favicon, assumed to be image/png type
155 our $favicon = "@{[url_path($Girocco::Config::gitwebfiles)]}/git-favicon.png";
157 ## URI of gitweb.js
158 our $javascript = "@{[url_path($Girocco::Config::gitwebfiles)]}/gitweb.js";
160 ## URL Hints
162 ## Any of the urls in @git_base_url_list, @git_base_mirror_urls or
163 ## @git_base_push_urls may be an array ref instead of a scalar in which
164 ## case ${}[0] is the url and ${}[1] is an html fragment "hint" to display
165 ## right after the URL.
167 ## list of git base URLs used for URL for where to fetch project from,
168 ## i.e. full URL is "$git_base_url/$project"
169 our @git_base_url_list = ();
170 $Girocco::Config::gitpullurl and push @git_base_url_list, $Girocco::Config::gitpullurl;
171 $Girocco::Config::httppullurl and push @git_base_url_list, $Girocco::Config::httppullurl;
173 ## For push projects (a .nofetch file exists OR gitweb.showpush is true)
174 ## @git_base_url_list entries are shown as "mirror URL" and @git_base_push_urls
175 ## are shown as "push URL" and @git_base_mirror_urls are ignored.
176 ## For non-push projects, @git_base_url_list and @git_base_mirror_urls are shown
177 ## as "mirror URL" and @git_base_push_urls are ignored.
179 ## list of extra git base URLs used for mirrors for where to fetch project from,
180 ## i.e. full URL is "$git_base_mirror_url/$project"
181 our @git_base_mirror_urls = ();
182 $Girocco::Config::httpspushurl && $Girocco::Config::httpspushurl ne ($Girocco::Config::httppullurl||'') and
183 push @git_base_mirror_urls, [$Girocco::Config::httpspushurl,
184 "<sup class=\"sup\"><span><a href=\"@{[url_path($Girocco::Config::htmlurl)]}/rootcert.html\">(learn&#160;more)</a></span></sup>"];
185 $Girocco::Config::pushurl && $Girocco::Config::pushurl =~ m|^ssh://|i and
186 push @git_base_mirror_urls, substr($Girocco::Config::pushurl, 0, 6) .
187 'git@' . substr($Girocco::Config::pushurl, 6);
189 ## list of git base URLs used for URL to push project to,
190 ## i.e. full URL is "$git_base_push_url/$project"
191 our @git_base_push_urls = ();
192 $Girocco::Config::pushurl and push @git_base_push_urls, $Girocco::Config::pushurl;
193 $Girocco::Config::httpspushurl and push @git_base_push_urls, $Girocco::Config::httpspushurl;
195 our $cache_grpshared = 1;
196 our $cache_dir = $Girocco::Config::projlist_cache_dir;
198 our $lastactivity_file = "info/lastactivity";
200 $html_cache_actions{'summary'} = 1;
202 our $per_request_config = 0;
204 our $auto_fcgi = 1;
206 $feature{'pathinfo'}{'default'}=[1];
208 $feature{'forks'}{'default'}=[1];
210 $feature{'actions'}{'default'}=[
211 ('graphiclog', "@{[url_path($Girocco::Config::gitwebfiles)]}/git-browser/by-commit.html?r=%n", 'log'),
212 ('edit', "@{[url_path($Girocco::Config::webadmurl)]}/editproj.cgi?name=%e", 'refs'),
213 ('fork', "@{[url_path($Girocco::Config::webadmurl)]}/regproj.cgi?fork=%e", 'edit')
216 # Prevent any fast CGI instance from holding on to a possibly now-invalid
217 # current working directory. The "root" directory will always be valid (or you
218 # have bigger problems) even if it's the "root" of a chroot or other kind of
219 # jail. gitweb.cgi does not need or require any particular cwd to function and
220 # as all "use"s and "require"s that depend on the 'use lib "."' have already
221 # been completed by now it's safe to "cd /" at this point.
222 chdir "/";