blob: 98ac07ade65919fb4c45b0474f35f0c33f52c4d0 [file] [log] [blame]
Shawn O. Pearcee31d02c2009-12-08 12:21:37 -08001Gerrit Code Review - Configuration
2==================================
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08004File `etc/gerrit.config`
5------------------------
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07006
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08007The optional file `'$site_path'/etc/gerrit.config` is a Git-style
8config file that controls many host specific settings for Gerrit.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07009
10[NOTE]
Shawn O. Pearcec5fed822009-11-17 16:10:10 -080011The contents of the `etc/gerrit.config` file are cached at startup
Brandon Casey4a21add2011-07-05 13:14:18 -050012by Gerrit. If you modify any properties in this file, Gerrit needs
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070013to be restarted before it will use the new values.
14
Shawn O. Pearcec5fed822009-11-17 16:10:10 -080015Sample `etc/gerrit.config`:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070016----
17[core]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080018 packedGitLimit = 200 m
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070019
20[cache]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080021 directory = /var/cache/gerrit2
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070022----
23
Dave Borowitz45baa892012-02-23 16:43:05 -080024[[accounts]]Section accounts
25~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
Matthias Sohnf3360662012-04-05 15:42:52 +020027[[accounts.visibility]]accounts.visibility::
Dave Borowitz45baa892012-02-23 16:43:05 -080028+
29Controls visibility of other users' dashboard pages and
30completion suggestions to web users.
31+
32If `ALL`, all users are visible to all other users, even
33anonymous users.
34+
35If `SAME_GROUP`, only users who are also members of a group the
36current user is a member of are visible.
37+
38If `VISIBLE_GROUP`, only users who are members of at least one group
39that is visible to the current user are visible.
40+
41If `NONE`, no users other than the current user are visible.
42+
43Default is `ALL`.
44
Edwin Kempin49cb3e12011-06-29 14:35:14 +020045[[addreviewer]]Section addreviewer
46~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47
48[[addreviewer.maxWithoutConfirmation]]addreviewer.maxWithoutConfirmation::
49+
50The maximum number of reviewers a user can add at once by adding a
51group as reviewer without being asked to confirm the operation.
52+
53If set to 0, the user will never be asked to confirm adding a group
54as reviewer.
55+
56Default is 10.
Edwin Kempin5e65d9b2011-07-08 07:35:48 +020057+
58This setting only applies for adding reviewers in the Gerrit WebUI,
59but is ignored when adding reviewers with the
Edwin Kempin33e92d02011-07-11 22:00:57 +020060link:cmd-set-reviewers.html[set-reviewers] command.
Edwin Kempin49cb3e12011-06-29 14:35:14 +020061
62[[addreviewer.maxAllowed]]addreviewer.maxAllowed::
63+
64The maximum number of reviewers a user can add at once by adding a
65group as reviewer.
66+
67If set to 0, there is no limit for the number of reviewers that can
68be added at once by adding a group as reviewer.
69+
70Default is 20.
71
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -070072[[auth]]Section auth
73~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070074
75See also link:config-sso.html[SSO configuration].
76
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -070077[[auth.type]]auth.type::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070078+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070079Type of user authentication employed by Gerrit. The supported
80values are:
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070081+
82* `OpenID`
83+
84The default setting. Gerrit uses any valid OpenID
85provider chosen by the end-user. For more information see
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070086http://openid.net/[openid.net].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070087+
James E. Blairca8bc3b2011-12-21 18:12:26 +000088* `OpenID_SSO`
89+
90Supports OpenID from a single provider. There is no registration
91link, and the "Sign In" link sends the user directly to the provider's
92SSO entry point.
93+
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070094* `HTTP`
95+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070096Gerrit relies upon data presented in the HTTP request. This includes
Edwin Kempinf1acbb82011-09-15 12:49:42 +020097HTTP basic authentication, or some types of commercial single-sign-on
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070098solutions. With this setting enabled the authentication must
99take place in the web server or servlet container, and not from
100within Gerrit.
101+
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700102* `HTTP_LDAP`
103+
104Exactly like `HTTP` (above), but additionally Gerrit pre-populates
105a user's full name and email address based on information obtained
106from the user's account object in LDAP. The user's group membership
107is also pulled from LDAP, making any LDAP groups that a user is a
108member of available as groups in Gerrit.
109+
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200110* `CLIENT_SSL_CERT_LDAP`
111+
112This authentication type is actually kind of SSO. Gerrit will configure
David Pursehouse221d4f62012-06-08 17:38:08 +0900113Jetty's SSL channel to request the client's SSL certificate. For this
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200114authentication to work a Gerrit administrator has to import the root
115certificate of the trust chain used to issue the client's certificate
116into the <review-site>/etc/keystore.
117After the authentication is done Gerrit will obtain basic user
118registration (name and email) from LDAP, and some group memberships.
119Therefore, the "_LDAP" suffix in the name of this authentication type.
120This authentication type can only be used under hosted daemon mode, and
121the httpd.listenUrl must use https:// as the protocol.
122+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700123* `LDAP`
124+
125Gerrit prompts the user to enter a username and a password, which
126it then verifies by performing a simple bind against the configured
127<<ldap.server,ldap.server>>. In this configuration the web server
128is not involved in the user authentication process.
129+
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800130The actual username used in the LDAP simple bind request is the
131account's full DN, which is discovered by first querying the
132directory using either an anonymous request, or the configured
Robin Rosenberga3baed02012-10-14 14:09:32 +0200133<<ldap.username,ldap.username>> identity. Gerrit can also use kerberos if
134<<ldap.authentication,ldap.authentication>> is set to `GSSAPI`.
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800135
136* `LDAP_BIND`
137+
138Gerrit prompts the user to enter a username and a password, which
139it then verifies by performing a simple bind against the configured
140<<ldap.server,ldap.server>>. In this configuration the web server
141is not involved in the user authentication process.
142+
143Unlike LDAP above, the username used to perform the LDAP simple bind
144request is the exact string supplied by in the dialog by the user.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200145The configured <<ldap.username,ldap.username>> identity is not used to obtain
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800146account information.
147+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700148* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
149+
150*DO NOT USE*. Only for use in a development environment.
151+
152When this is the configured authentication method a hyperlink titled
153`Become` appears in the top right corner of the page, taking the
154user to a form where they can enter the username of any existing
155user account, and immediately login as that account, without any
156authentication taking place. This form of authentication is only
157useful for the GWT hosted mode shell, where OpenID authentication
158redirects might be risky to the developer's host computer, and HTTP
159authentication is not possible.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700160
161+
162By default, OpenID.
163
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700164[[auth.allowedOpenID]]auth.allowedOpenID::
165+
166List of permitted OpenID providers. A user may only authenticate
167with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse221d4f62012-06-08 17:38:08 +0900168is set to OpenID (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700169+
Magnus Bäcke5611832011-02-02 08:57:15 +0100170Patterns may be either a
171link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
172Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700173end with `$`) or be a simple prefix (any other string).
174+
175By default, the list contains two values, `http://` and `https://`,
176allowing users to authenticate with any OpenID provider.
177
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700178[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700179+
David Pursehouse221d4f62012-06-08 17:38:08 +0900180List of trusted OpenID providers. Only used if `auth.type` is
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700181set to OpenID (the default).
182+
183In order for a user to take advantage of permissions beyond those
184granted to the `Anonymous Users` and `Registered Users` groups,
185the user account must only have OpenIDs which match at least one
186pattern from this list.
187+
Magnus Bäcke5611832011-02-02 08:57:15 +0100188Patterns may be either a
189link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
190Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700191end with `$`) or be a simple prefix (any other string).
192+
193By default, the list contains two values, `http://` and `https://`,
194allowing Gerrit to trust any OpenID it receives.
195
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100196[[auth.openIdDomain]]auth.openIdDomain::
197+
198List of allowed OpenID email address domains. Only used if
199`auth.type` is set to "OPENID" or "OPENID_SSO".
200+
201Domain is case insensitive and must be in the same form as it
202appears in the email address, for example, "example.com".
203+
204By default, any domain is accepted.
205
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700206[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
207+
208Time in seconds before an OpenID provider must force the user
209to authenticate themselves again before authentication to this
210Gerrit server. Currently this is only a polite request, and users
211coming from providers that don't support the PAPE extension will
212be accepted anyway. In the future it may be enforced, rejecting
213users coming from providers that don't honor the max session age.
214+
215If set to 0, the provider will always force the user to authenticate
216(e.g. supply their password). Values should use common unit suffixes
217to express their setting:
218+
219* s, sec, second, seconds
220* m, min, minute, minutes
221* h, hr, hour, hours
222* d, day, days
223* w, week, weeks (`1 week` is treated as `7 days`)
224* mon, month, months (`1 month` is treated as `30 days`)
225* y, year, years (`1 year` is treated as `365 days`)
226
227+
228Default is -1, permitting infinite time between authentications.
229
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700230[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
231+
232Time in seconds before an email verification token sent to a user in
233order to validate their email address expires.
234+
235* s, sec, second, seconds
236* m, min, minute, minutes
237* h, hr, hour, hours
238* d, day, days
239* w, week, weeks (`1 week` is treated as `7 days`)
240* mon, month, months (`1 month` is treated as `30 days`)
241* y, year, years (`1 year` is treated as `365 days`)
242
243+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800244Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700245
James E. Blairca8bc3b2011-12-21 18:12:26 +0000246[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
247+
248The SSO entry point URL. Only used if `auth.type` was set to
249OpenID_SSO.
250+
251The "Sign In" link will send users directly to this URL.
252
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700253[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700254+
255HTTP header to trust the username from, or unset to select HTTP basic
David Pursehouse221d4f62012-06-08 17:38:08 +0900256or digest authentication. Only used if `auth.type` is set to HTTP.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700257
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700258[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700259+
260URL to redirect a browser to after the end-user has clicked on the
261"Sign Out" link in the upper right corner. Organizations using an
262enterprise single-sign-on solution may want to redirect the browser
263to the SSO product's sign-out page.
264+
265If not set, the redirect returns to the list of all open changes.
266
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800267[[auth.registerUrl]]auth.registerUrl::
268+
269Target for the "Register" link in the upper right corner. Used only
270when auth.type is `LDAP`.
271+
272If not set, no "Register" link is displayed.
273
Chad Horohoe65897082012-11-10 10:26:25 -0800274[[auth.registerText]]auth.registerText::
275+
276Text for the "Register" link in the upper right corner. Used only
277when auth.type is `LDAP`.
278+
279If not set, defaults to "Register".
280
David Pursehouse3d604492013-01-25 17:41:53 +0900281[[auth.editFullNameUrl]]auth.editFullNameUrl::
282+
283Target for the "Edit" button when the user is allowed to edit their
284full name.
285
286[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
287+
288Target for the "Obtain Password" link. Used only when auth.type is
289`LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
290+
291
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000292[[auth.cookiePath]]auth.cookiePath::
293+
294Sets "path" attribute of the authentication cookie.
295+
296If not set, HTTP request's path is used.
297
298[[auth.cookieSecure]]auth.cookieSecure::
299+
300Sets "secure" flag of the authentication cookie. If true, cookies
301will be transmitted only over HTTPS protocol.
302+
303By default, false.
304
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700305[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700306+
307Optional format string to construct user email addresses out of
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700308user login names. Only used if auth.type is `HTTP`, `HTTP_LDAP`
309or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700310+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700311This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700312with the login name. E.g. "\{0\}+gerrit@example.com" with a user
313login name of "foo" will produce "foo+gerrit@example.com" during
314the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700315+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700316If the site is using `HTTP_LDAP` or `LDAP`, using this option is
317discouraged. Setting `ldap.accountEmailAddress` and importing the
318email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700319
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700320[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700321+
322Controls whether or not the contributor agreement features are
323enabled for the Gerrit site. If enabled a user must complete a
324contributor agreement before they can upload changes.
325+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800326If enabled, the admin must also add one or more
327link:config-cla.html[contributor-agreement sections]
328in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700329`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700330more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700331+
332By default this is false (no agreements are used).
333
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700334auth.allowGoogleAccountUpgrade::
335+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700336Allows Google Account users to automatically update their Gerrit
337account when/if their Google Account OpenID identity token changes.
338Identity tokens can change if the server changes hostnames, or
339for other reasons known only to Google. The upgrade path works
340by matching users by email address if the identity is not present,
341and then changing the identity.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700342+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700343This setting also permits old Gerrit 1.x users to seamlessly upgrade
344from Google Accounts on Google App Engine to OpenID authentication.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700345+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700346Having this enabled incurs an extra database query when Google
Shawn O. Pearcee31d02c2009-12-08 12:21:37 -0800347Account users register with the Gerrit server.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700348+
349By default, unset/false.
350
Christian Halstricka3d88a52011-08-31 09:21:41 +0200351[[auth.trustContainerAuth]]auth.trustContainerAuth::
352+
353If true then it is the responsibility of the container hosting
354Gerrit to authenticate users. In this case Gerrit will blindly trust
355the container.
356+
357This parameter only affects git over http traffic. If set to false
358then Gerrit will do the authentication (using DIGEST authentication).
359+
360By default this is set to false.
361
Luca Milanesio42058842012-01-05 21:25:38 +0000362[[auth.gitBasicAuth]]auth.gitBasicAuth::
363+
364If true then Git over HTTP and HTTP/S traffic is authenticated using
365standard BasicAuth and credentials validated using the same auth
366method configured for Gerrit Web UI.
367+
368This parameter only affects git over http traffic. If set to false
369then Gerrit will authenticate through DIGEST authentication and
370the randomly generated HTTP password in Gerrit DB.
371+
372By default this is set to false.
373
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200374[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
375+
376If set the username that is received to authenticate a git operation
377is converted to lower case for looking up the user account in Gerrit.
378+
379By setting this parameter a case insensitive authentication for the
380git operations can be achieved, if it is ensured that the usernames in
381Gerrit (scheme `username`) are stored in lower case (e.g. if the
382parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
383set to `${sAMAccountName.toLowerCase}`). It is important that for all
384existing accounts this username is already in lower case. It is not
385possible to convert the usernames of the existing accounts to lower
386case because this would break the access to existing per-user
387branches.
388+
389This parameter only affects git over http and git over SSH traffic.
390+
391By default this is set to false.
392
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700393[[cache]]Section cache
394~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700395
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700396[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700397+
398Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700399future lookup. This local disk cache is used to retain potentially
400expensive to compute information across restarts. If the location
401does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700402+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700403If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700404+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700405Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700406
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700407[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700408+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700409Maximum age to keep an entry in the cache. Entries are removed from
410the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700411Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700412+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700413* s, sec, second, seconds
414* m, min, minute, minutes
415* h, hr, hour, hours
416* d, day, days
417* w, week, weeks (`1 week` is treated as `7 days`)
418* mon, month, months (`1 month` is treated as `30 days`)
419* y, year, years (`1 year` is treated as `365 days`)
420
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700421+
Edwin Kempinabcd5042013-03-12 16:04:37 +0100422If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700423supplied, the maximum age is infinite and items are never purged
424except when the cache is full.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700425+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700426Default is `0`, meaning store forever with no expire, except:
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700427+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400428* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700429* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700430* `"web_sessions"`: default is `12 hours`
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700431
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700432[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700433+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700434The total cost of entries to retain in memory. The cost computation
435varies by the cache. For most caches where the in-memory size of each
436entry is relatively the same, memoryLimit is currently defined to be
437the number of entries held by the cache (each entry costs 1).
438+
439For caches where the size of an entry can vary significantly between
440individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
441is an approximation of the total number of bytes stored by the cache.
442Larger entries that represent bigger patch sets or longer source files
443will consume a bigger portion of the memoryLimit. For these caches the
444memoryLimit should be set to roughly the amount of RAM (in bytes) the
445administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700446+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700447Default is 1024 for most caches, except:
448+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400449* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700450* `"diff"`: default is `10m` (10 MiB of memory)
451* `"diff_intraline"`: default is `10m` (10 MiB of memory)
452* `"plugin_resources"`: default is 2m (2 MiB of memory)
453
454+
455If set to 0 the cache is disabled. Entries are removed immediately
456after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700457
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700458[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700459+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700460Total size in bytes of the keys and values stored on disk. Caches that
461have grown bigger than this size are scanned daily at 1 AM local
462server time to trim the cache. Entries are removed in least recently
463accessed order until the cache fits within this limit. Caches may
464grow larger than this during the day, as the size check is only
465performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700466+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700467Default is 128 MiB per cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700468+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700469If 0, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700470
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700471[[cache_names]]Standard Caches
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700472^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700473
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700474cache `"accounts"`::
475+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700476Cache entries contain important details of an active user, including
477their display name, preferences, known email addresses, and group
478memberships. Entry information is obtained from the following
479database tables:
480+
481* `accounts`
482+
483* `account_group_members`
484+
485* `account_external_ids`
486
487+
488If direct updates are made to any of these database tables, this
489cache should be flushed.
490
491cache `"accounts_byemail"`::
492+
493Caches account identities keyed by email address, which is scanned
494from the `account_external_ids` database table. If updates are
495made to this table, this cache should be flushed.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700496
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400497cache `"adv_bases"`::
498+
499Used only for push over smart HTTP when branch level access controls
500are enabled. The cache entry contains all commits that are avaliable
501for the client to use as potential delta bases. Push over smart HTTP
502requires two HTTP requests, and this cache tries to carry state from
503the first request into the second to ensure it can complete.
504
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200505cache `"changes"`::
506+
Gustaf Lundh53493772012-11-18 18:41:15 -0800507The size determines the number of projects that will have all its changes
508cached. If the cache is set to 1024, this means all changes for up to
5091024 projects can be held in the cache.
510+
511Default size is 0 (disabled). It is disabled by default due to the fact
512that change updates are not communicated between Gerrit servers.
513Hence this cache should be disabled in an multi-master/multi-slave setup.
514+
515The cache should be flushed whenever the database changes table is modified
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200516outside of gerrit.
517
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700518cache `"diff"`::
519+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700520Each item caches the differences between two commits, at both the
521directory and file levels. Gerrit uses this cache to accelerate
522the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700523+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700524Entries in this cache are relatively large, so memoryLimit is an
525estimate in bytes of memory used. Administrators should try to target
526cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
527day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700528
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400529cache `"diff_intraline"`::
530+
531Each item caches the intraline difference of one file, when compared
532between two commits. Gerrit uses this cache to accelerate display of
533intraline differences when viewing a file.
534+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700535Entries in this cache are relatively large, so memoryLimit is an
536estimate in bytes of memory used. Administrators should try to target
537cache.diff.memoryLimit to fit all files users will view in a 1 or 2
538day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400539
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700540cache `"git_tags"`::
541+
542If branch or reference level READ access controls are used, this
543cache tracks which tags are reachable from the branch tips of a
544repository. Gerrit uses this information to determine the set
545of tags that a client may access, derived from which tags are
546part of the history of a visible branch.
547+
548The cache is persisted to disk across server restarts as it can
549be expensive to compute (60 or more seconds for a large history
550like the Linux kernel repository).
551
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700552cache `"groups"`::
553+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700554Caches the basic group information from the `account_groups` table,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700555including the group owner, name, and description.
556+
557Gerrit group membership obtained from the `account_group_members`
558table is cached under the `"accounts"` cache, above. External group
559membership obtained from LDAP is cached under `"ldap_groups"`.
560
Matt Fischer620255a2011-03-22 14:28:23 -0500561cache `"groups_byinclude"`::
562+
563Caches group inclusions in other groups. If direct updates are made
564to the `account_group_includes` table, this cache should be flushed.
565
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700566cache `"ldap_groups"`::
567+
568Caches the LDAP groups that a user belongs to, if LDAP has been
569configured on this server. This cache should be configured with a
570low maxAge setting, to ensure LDAP modifications are picked up in
571a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700572
Gustaf Lundh0919a492012-10-19 15:29:23 +0200573cache `"ldap_groups_byinclude"`::
574+
575Caches the hierarchical structure of LDAP groups.
576
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -0700577cache `"ldap_usernames"`::
578+
579Caches a mapping of LDAP username to Gerrit account identity. The
580cache automatically updates when a user first creates their account
581within Gerrit, so the cache expire time is largely irrelevant.
582
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700583cache `"permission_sort"`::
584+
David Pursehouse221d4f62012-06-08 17:38:08 +0900585Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700586reference. Sorting the sections can be expensive when regular
587expressions are used, so this cache remembers the ordering for
588each branch.
589
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700590cache `"plugin_resources"`::
591+
592Caches formatted plugin resources, such as plugin documentation that
593has been converted from Markdown to HTML. The memoryLimit refers to
594the bytes of memory dedicated to storing the documentation.
595
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700596cache `"projects"`::
597+
598Caches the project description records, from the `projects` table
599in the database. If a project record is updated or deleted, this
600cache should be flushed. Newly inserted projects do not require
601a cache flush, as they will be read upon first reference.
602
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700603cache `"sshkeys"`::
604+
605Caches unpacked versions of user SSH keys, so the internal SSH daemon
606can match against them during authentication. The unit of storage
607is per-user, so 1024 items translates to 1024 unique user accounts.
608As each individual user account may configure multiple SSH keys,
609the total number of keys may be larger than the item count.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700610+
611This cache is based off the `account_ssh_keys` table and the
612`accounts.ssh_user_name` column in the database. If either is
613modified directly, this cache should be flushed.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700614
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700615cache `"web_sessions"`::
616+
617Tracks the live user sessions coming in over HTTP. Flushing this
618cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -0700619them to sign-in again. To avoid breaking active users, this cache
620is not flushed automatically by `gerrit flush-caches --all`, but
621instead must be explicitly requested.
622+
623If no disk cache is configured (or `cache.web_sessions.diskLimit`
624is set to 0) a server restart will force all users to sign-out,
625and need to sign-in again after the restart, as the cache was
626unable to persist the session information. Enabling a disk cache
627is strongly recommended.
628+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700629Session storage is relatively inexpensive. The average entry in
630this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700631
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700632See also link:cmd-flush-caches.html[gerrit flush-caches].
633
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800634[[cache_options]]Cache Options
635^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
636
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800637cache.diff_intraline.maxIdleWorkers::
638+
639Number of idle worker threads to maintain for the intraline difference
640computations. There is no upper bound on how many concurrent requests
641can occur at once, if additional threads are started to handle a peak
David Pursehouse221d4f62012-06-08 17:38:08 +0900642load, only this many will remain idle afterwards.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800643+
644Default is 1.5x number of available CPUs.
645
646cache.diff_intraline.timeout::
647+
648Maximum number of milliseconds to wait for intraline difference data
649before giving up and disabling it for a particular file pair. This is
650a work around for an infinite loop bug in the intraline difference
651implementation. If computation takes longer than the timeout the
652worker thread is terminated and no intraline difference is displayed.
653+
654Values should use common unit suffixes to express their setting:
655+
656* ms, milliseconds
657* s, sec, second, seconds
658* m, min, minute, minutes
659* h, hr, hour, hours
660
661+
662If a unit suffix is not specified, `milliseconds` is assumed.
663+
664Default is 5 seconds.
665
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800666cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800667+
668Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800669when populating a diff cache entry. This flag is provided primarily
670as a backdoor to disable the intraline difference feature if
671necessary. To maintain backwards compatability with prior versions,
672this setting will fallback to `cache.diff.intraline` if not set in the
673configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800674+
675Default is true, enabled.
676
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700677cache.projects.checkFrequency::
678+
679How often project configuration should be checked for update from Git.
680Gerrit Code Review caches project access rules and configuration in
681memory, checking the refs/meta/config branch every checkFrequency
682minutes to see if a new revision should be loaded and used for future
683access. Values can be specified using standard time unit abbreviations
684('ms', 'sec', 'min', etc.).
685+
686If set to 0, checks occur every time, which may slow down operations.
Shawn Pearcec825ef12013-02-20 11:29:46 -0800687If set to 'disabled' or 'off', no check will ever be done.
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700688Administrators may force the cache to flush with
689link:cmd-flush-caches.html[gerrit flush-caches].
690+
691Default is 5 minutes.
692
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300693[[changeMerge]]Section changeMerge
Remy Bohmer203eea32012-02-19 21:21:36 +0100694~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300695
Dave Borowitz204669c22012-10-11 11:06:08 -0700696changeMerge.checkFrequency::
697+
698How often the database should be rescanned for changes that have been
699submitted but not merged due to transient errors. Values can be
700specified using standard time unit abbreviations ('ms', 'sec', 'min',
701etc.). Set to 0 to disable periodic rescanning, only scanning once on
702master node startup.
703+
704Default is 300 seconds (5 minutes).
705
706changeMerge.test::
707+
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300708Controls whether or not the mergeability test of changes is
709enabled. If enabled, when the change page is loaded, the test is
710triggered. The submit button will be enabled or disabled according to
711the result.
Dave Borowitz204669c22012-10-11 11:06:08 -0700712+
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300713By default this is false (test is not enabled).
714
Brad Larson991a31b2009-11-03 14:30:26 -0600715[[commentlink]]Section commentlink
Remy Bohmer203eea32012-02-19 21:21:36 +0100716~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Brad Larson991a31b2009-11-03 14:30:26 -0600717Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -0500718patch comments, in-line code comments and approval category value descriptions
719to turn set strings into hyperlinks. One common use is for linking to
720bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -0600721
722In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800723will match typical Gerrit Change-Id values and create a hyperlink
724to changes which reference it. The second configuration 'bugzilla'
725will hyperlink terms such as 'bug 42' to an external bug tracker,
726supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +0900727configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800728how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -0600729
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800730----
731[commentlink "changeid"]
732 match = (I[0-9a-f]{8,40})
733 link = "#q,$1,n,z"
Brad Larson991a31b2009-11-03 14:30:26 -0600734
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800735[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -0800736 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800737 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -0600738
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800739[commentlink "tracker"]
740 match = ([Bb]ug:\\s+)(\\d+)
741 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
742----
743
Dave Borowitz13b38002013-04-08 12:03:29 -0700744Comment links can also be specified in `project.config` and sections in
745children override those in parents. The only restriction is that to
746avoid injecting arbitrary user-supplied HTML in the page, comment links
747defined in `project.config` may only supply `link`, not `html`.
748
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800749[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -0600750+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800751A JavaScript regular expression to match positions to be replaced
752with a hyperlink. Subexpressions of the matched string can be
753stored using groups and accessed with `$'n'` syntax, where 'n'
754is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -0600755+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -0800756The configuration file parser eats one level of backslashes, so the
757character class `\s` requires `\\s` in the configuration file. The
758parser also terminates the line at the first `#`, so a match
759expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800760+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -0800761To match case insensitive strings, a character class with both the
762upper and lower case character for each position must be used. For
763example, to match the string `bug` in a case insensitive way the match
764pattern `[bB][uU][gG]` needs to be used.
765+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800766A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -0600767
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800768[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -0600769+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800770The URL to direct the user to whenever the regular expression is
771matched. Groups in the match expression may be accessed as `$'n'`.
772+
773The link property is used only when the html property is not present.
774
775[[commentlink.name.html]]commentlink.<name>.html::
776+
777HTML to replace the entire matched string with. If present,
778this property overrides the link property above. Groups in the
779match expression may be accessed as `$'n'`.
780+
781The configuration file eats double quotes, so escaping them as
782`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -0600783
784
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700785[[contactstore]]Section contactstore
786~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700787
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700788[[contactstore.url]]contactstore.url::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700789+
790URL of the web based contact store Gerrit will send any offline
791contact information to when it collects the data from users as part
792of a contributor agreement.
793+
794See link:config-contact.html[Contact Information].
795
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700796[[contactstore.appsec]]contactstore.appsec::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700797+
798Shared secret of the web based contact store.
799
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -0800800
801[[container]]Section container
802~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
803
804These settings are applied only if Gerrit is started as the container
805process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
806
807[[container.heapLimit]]container.heapLimit::
808+
809Maximum heap size of the Java process running Gerrit, in bytes.
810This property is translated into the '-Xmx' flag for the JVM.
811+
812Default is platform and JVM specific.
813+
814Common unit suffixes of 'k', 'm', or 'g' are supported.
815
816[[container.javaHome]]container.javaHome::
817+
818Path of the JRE/JDK installation to run Gerrit with. If not set, the
819Gerrit startup script will attempt to search your system and guess
820a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
821
822[[container.javaOptions]]container.javaOptions::
823+
824Additional options to pass along to the Java runtime. If multiple
825values are configured, they are passed in order on the command line,
826separated by spaces. These options are appended onto 'JAVA_OPTIONS'.
827
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +0200828[[container.slave]]container.slave::
829+
830Used on Gerrit slave installations. If set to true the Gerrit JVM is
831called with the '--slave' switch, enabling slave mode. If no value is
832set (or any other value), gerrit defaults to master mode.
833
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -0800834[[container.user]]container.user::
835+
836Login name (or UID) of the operating system user the Gerrit JVM
837will execute as. If not set, defaults to the user who launched
838the 'gerrit.sh' wrapper script.
839
840[[container.war]]container.war::
841+
842Path of the JAR file to start daemon execution with. This should
843be the path of the local 'gerrit.war' archive. Overrides the
844environment variable 'GERRIT_WAR'.
845+
846If not set, defaults to '$site_path/bin/gerrit.war', or to
847'$HOME/gerrit.war'.
848
849
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700850[[core]]Section core
851~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700852
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700853[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700854+
855Number of bytes of a pack file to load into memory in a single
856read operation. This is the "page size" of the JGit buffer cache,
857used for all pack access operations. All disk IO occurs as single
858window reads. Setting this too large may cause the process to load
859more data than is required; setting this too small may increase
860the frequency of `read()` system calls.
861+
862Default on JGit is 8 KiB on all platforms.
863+
864Common unit suffixes of 'k', 'm', or 'g' are supported.
865
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700866[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700867+
868Maximum number of bytes to load and cache in memory from pack files.
869If JGit needs to access more than this many bytes it will unload less
870frequently used windows to reclaim memory space within the process.
871As this buffer must be shared with the rest of the JVM heap, it
872should be a fraction of the total memory available.
873+
874Default on JGit is 10 MiB on all platforms.
875+
876Common unit suffixes of 'k', 'm', or 'g' are supported.
877
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700878[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700879+
880Maximum number of bytes to reserve for caching base objects
881that multiple deltafied objects reference. By storing the entire
882decompressed base object in a cache Git is able to avoid unpacking
883and decompressing frequently used base objects multiple times.
884+
885Default on JGit is 10 MiB on all platforms. You probably do not
886need to adjust this value.
887+
888Common unit suffixes of 'k', 'm', or 'g' are supported.
889
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700890[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700891+
892Maximum number of pack files to have open at once. A pack file
893must be opened in order for any of its data to be available in
894a cached window.
895+
896If you increase this to a larger setting you may need to also adjust
897the ulimit on file descriptors for the host JVM, as Gerrit needs
898additional file descriptors available for network sockets and other
899repository data manipulation.
900+
901Default on JGit is 128 file descriptors on all platforms.
902
Shawn O. Pearce329fe792010-09-03 15:44:23 -0700903[[core.streamFileThreshold]]core.streamFileThreshold::
904+
905Largest object size, in bytes, that JGit will allocate as a
906contiguous byte array. Any file revision larger than this threshold
907will have to be streamed, typically requiring the use of temporary
908files under '$GIT_DIR/objects' to implement psuedo-random access
909during delta decompression.
910+
911Servers with very high traffic should set this to be larger than
912the size of their common big files. For example a server managing
913the Android platform typically has to deal with ~10-12 MiB XML
914files, so `15 m` would be a reasonable setting in that environment.
915Setting this too high may cause the JVM to run out of heap space
916when handling very big binary files, such as device firmware or
917CD-ROM ISO images.
918+
Shawn O. Pearcee3febd92010-10-13 21:17:53 -0700919Default is 50 MiB on all platforms. Prior to Gerrit 2.1.6,
Shawn O. Pearce329fe792010-09-03 15:44:23 -0700920this value was effectively 2047 MiB.
921+
922Common unit suffixes of 'k', 'm', or 'g' are supported.
923
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700924[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700925+
926When true, JGit will use `mmap()` rather than `malloc()+read()`
927to load data from pack files. The use of mmap can be problematic
928on some JVMs as the garbage collector must deduce that a memory
929mapped segment is no longer in use before a call to `munmap()`
930can be made by the JVM native code.
931+
932In server applications (such as Gerrit) that need to access many
933pack files, setting this to true risks artifically running out
934of virtual address space, as the garbage collector cannot reclaim
935unused mapped spaces fast enough.
936+
937Default on JGit is false. Although potentially slower, it yields
938much more predictable behavior.
939
Sasa Zivkovf69aeb12012-06-11 14:05:14 +0200940[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
941+
942Size of the buffer to store logging events for asynchronous logging.
943Putting a larger value can protect threads from stalling when the
944AsyncAppender threads are not fast enough to consume the logging events
945from the buffer. It also protects from loosing log entries in this case.
946+
947Default is 64 entries.
948
Dave Borowitz1bec65a2013-03-13 10:59:01 -0700949[[core.useRecursiveMerge]]core.useRecursiveMerge::
950+
951Use JGit's new, experimental recursive merger for three-way merges.
952This only affects projects configured to automatically resolve
953conflicts.
954+
955Default is false, but in a future release may default to true.
956
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -0800957[[database]]Section database
958~~~~~~~~~~~~~~~~~~~~~~~~~~~~
959
960The database section configures where Gerrit stores its metadata
961records about user accounts and change reviews.
962
Shawn O. Pearce9d342a42009-12-16 15:49:05 -0800963----
964[database]
Shawn O. Pearce1be39062009-12-19 14:11:52 -0800965 type = POSTGRESQL
Shawn O. Pearce9d342a42009-12-16 15:49:05 -0800966 hostname = localhost
967 database = reviewdb
968 username = gerrit2
969 password = s3kr3t
970----
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -0800971
972[[database.type]]database.type::
973+
974Type of database server to connect to. If set this value will be
975used to automatically create correct database.driver and database.url
976values to open the connection.
977+
Shawn O. Pearce1be39062009-12-19 14:11:52 -0800978* `POSTGRESQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -0800979+
980Connect to a PostgreSQL database server.
981+
982* `H2`
983+
Shawn O. Pearce1be39062009-12-19 14:11:52 -0800984Connect to a local embedded H2 database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -0800985+
Shawn O. Pearce1be39062009-12-19 14:11:52 -0800986* `MYSQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -0800987+
988Connect to a MySQL database server.
Shawn O. Pearce1be39062009-12-19 14:11:52 -0800989+
990* `JDBC`
991+
992Connect using a JDBC driver class name and URL.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -0800993
994+
995If not specified, database.driver and database.url are used as-is,
996and if they are also not specified, defaults to H2.
997
998[[database.hostname]]database.hostname::
999+
1000Hostname of the database server. Defaults to 'localhost'.
1001
1002[[database.port]]database.port::
1003+
1004Port number of the database server. Defaults to the default port
1005of the server named by database.type.
1006
1007[[database.database]]database.database::
1008+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001009For POSTGRESQL or MYSQL, the name of the database on the server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001010+
1011For H2, this is the path to the database, and if not absolute is
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001012relative to `'$site_path'`.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001013
1014[[database.username]]database.username::
1015+
1016Username to connect to the database server as.
1017
1018[[database.password]]database.password::
1019+
1020Password to authenticate to the database server with.
1021
1022[[database.driver]]database.driver::
1023+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001024Name of the JDBC driver class to connect to the database with.
1025Setting this usually isn't necessary as it can be derived from
1026database.type or database.url for any supported database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001027
1028[[database.url]]database.url::
1029+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001030'jdbc:' URL for the database. Setting this variable usually
1031isn't necessary as it can be constructed from the all of the
1032above properties.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001033
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001034[[database.poolLimit]]database.poolLimit::
1035+
1036Maximum number of open database connections. If the server needs
1037more than this number, request processing threads will wait up
1038to <<database.poolMaxWait, poolMaxWait>> seconds for a
1039connection to be released before they abort with an exception.
1040This limit must be several units higher than the total number of
1041httpd and sshd threads as some request processing code paths may
1042need multiple connections.
1043+
1044Default is 8.
1045
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001046[[database.poolMinIdle]]database.poolMinIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001047+
1048Minimum number of connections to keep idle in the pool.
1049Default is 4.
1050
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001051[[database.poolMaxIdle]]database.poolMaxIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001052+
1053Maximum number of connections to keep idle in the pool. If there
1054are more idle connections, connections will be closed instead of
1055being returned back to the pool.
1056Default is 4.
1057
1058[[database.poolMaxWait]]database.poolMaxWait::
1059+
1060Maximum amount of time a request processing thread will wait to
1061acquire a database connection from the pool. If no connection is
1062released within this time period, the processing thread will abort
1063its current operations and return an error to the client.
1064Values should use common unit suffixes to express their setting:
1065+
1066* ms, milliseconds
1067* s, sec, second, seconds
1068* m, min, minute, minutes
1069* h, hr, hour, hours
1070
1071+
1072If a unit suffix is not specified, `milliseconds` is assumed.
1073+
1074Default is `30 seconds`.
1075
monica.dionisio3f630442010-06-29 15:42:57 -03001076[[download]]Section download
Nasser Grainawib9a50372010-08-10 07:57:47 -06001077~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monica.dionisio3f630442010-06-29 15:42:57 -03001078
1079----
1080[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001081 command = checkout
1082 command = cherry_pick
1083 command = pull
1084 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001085 scheme = ssh
1086 scheme = http
1087 scheme = anon_http
1088 scheme = anon_git
1089 scheme = repo_download
1090----
1091
1092The download section configures the allowed download methods.
1093
Edwin Kempin08b03a22012-09-14 16:32:57 +02001094[[download.command]]download.command::
1095+
1096Commands that should be offered to download changes.
1097+
1098Multiple commands are supported:
1099+
1100* `checkout`
1101+
1102Command to fetch and checkout the patch set.
1103+
1104* `cherry_pick`
1105+
1106Command to fetch the patch set and to cherry-pick it onto the current
1107commit.
1108+
1109* `pull`
1110+
1111Command to pull the patch set.
1112+
1113* `format_patch`
1114+
1115Command to fetch the patch set and to feed it into the `format-patch`
1116command.
1117
1118+
1119If `download.command` is not specified, all download commands are
1120offered.
1121
monica.dionisio3f630442010-06-29 15:42:57 -03001122[[download.scheme]]download.scheme::
1123+
1124Schemes that should be used to download changes.
1125+
1126Multiple schemes are supported:
1127+
1128* `http`
1129+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001130Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001131+
1132* `ssh`
1133+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001134Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001135+
1136* `anon_http`
1137+
1138Anonymous HTTP download is allowed.
1139+
1140* `anon_git`
1141+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001142Anonymous Git download is allowed. This is not default, it is also
1143necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1144variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001145+
1146* `repo_download`
1147+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001148Gerrit advertises patch set downloads with the `repo download`
1149command, assuming that all projects managed by this instance are
1150generally worked on with the repo multi-repository tool. This is
1151not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001152
1153+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001154If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001155downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001156
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07001157[[gerrit]]Section gerrit
1158~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001159
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001160[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001161+
1162Local filesystem directory holding all Git repositories that
1163Gerrit knows about and can process changes for. A project
1164entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02001165the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001166+
1167If relative, the path is resolved relative to `'$site_path'`.
1168
Shawn O. Pearce897d9212011-06-16 16:59:59 -07001169[[gerrit.allProjects]]gerrit.allProjects::
1170+
1171Name of the permissions-only project defining global server
1172access controls and settings. These are inherited into every
1173other project managed by the running server. The name is
1174relative to `gerrit.basePath`.
1175+
1176Defaults to `All-Projects` if not set.
1177
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001178[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001179+
1180The default URL for Gerrit to be accessed through.
1181+
1182Typically this would be set to "http://review.example.com/" or
1183"http://example.com/gerrit/" so Gerrit can output links that point
1184back to itself.
1185+
1186Setting this is highly recommended, as its necessary for the upload
1187code invoked by "git push" or "repo upload" to output hyperlinks
1188to the newly uploaded changes.
1189
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001190[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001191+
1192Optional base URL for repositories available over the anonymous git
1193protocol. For example, set this to `git://mirror.example.com/base/`
1194to have Gerrit display patch set download URLs in the UI. Gerrit
1195automatically appends the project name onto the end of the URL.
1196+
1197By default unset, as the git daemon must be configured externally
1198by the system administrator, and might not even be running on the
1199same host as Gerrit.
1200
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07001201[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
1202+
1203Optional base URL for repositories available over the HTTP
1204protocol. For example, set this to `http://mirror.example.com/base/`
1205to have Gerrit display URLs from this server, rather than itself.
1206+
1207By default unset, as the HTTP daemon must be configured externally
1208by the system administrator, and might not even be running on the
1209same host as Gerrit.
1210
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07001211[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
1212+
1213URL to direct users to when they need to report a bug about the
1214Gerrit service. By default this links to the upstream Gerrit
1215Code Review's own bug tracker but could be directed to the system
1216administrator's ticket queue.
1217
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07001218[[gitweb]]Section gitweb
1219~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001220
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001221Gerrit can forward requests to either an internally managed gitweb
1222(which allows Gerrit to enforce some access controls), or to an
1223externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001224See also link:config-gitweb.html[Gitweb Integration].
1225
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001226[[gitweb.cgi]]gitweb.cgi::
1227+
1228Path to the locally installed `gitweb.cgi` executable. This CGI will
1229be called by Gerrit Code Review when the URL `/gitweb` is accessed.
1230Project level access controls are enforced prior to calling the CGI.
1231+
1232Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if gitweb.url is not set.
1233
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001234[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001235+
1236Optional URL of an affiliated gitweb service. Defines the
1237web location where a `gitweb.cgi` is installed to browse
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001238gerrit.basePath and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001239+
1240Gerrit appends any necessary query arguments onto the end of this URL.
1241For example, "?p=$project.git;h=$commit".
1242
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001243[[gitweb.type]]gitweb.type::
1244+
1245Optional type of affiliated gitweb service. This allows using
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001246alternatives to gitweb, such as cgit. If set to disabled there
1247is no gitweb hyperlinking support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001248+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001249Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001250
Edwin Kempind86909c2012-03-26 10:36:29 +02001251[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001252+
1253Optional pattern to use for constructing the gitweb URL when pointing
1254at a specific commit when `custom` is used above.
1255+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001256Valid replacements are `${project}` for the project name in Gerrit
1257and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001258
Edwin Kempind86909c2012-03-26 10:36:29 +02001259[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001260+
1261Optional pattern to use for constructing the gitweb URL when pointing
1262at a specific project when `custom` is used above.
1263+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001264Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001265
Edwin Kempind86909c2012-03-26 10:36:29 +02001266[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001267+
1268Optional pattern to use for constructing the gitweb URL when pointing
1269at a specific branch when `custom` is used above.
1270+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001271Valid replacements are `${project}` for the project name in Gerrit
1272and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001273
Edwin Kempin64011562012-03-26 10:50:12 +02001274[[gitweb.filehistory]]gitweb.filehistory::
1275+
1276Optional pattern to use for constructing the gitweb URL when pointing
1277at the history of a file in a specific branch when `custom` is used
1278above.
1279+
1280Valid replacements are `${project}` for the project name in Gerrit,
1281`${file}` for the file name and `${branch}` for the name of the
1282branch.
1283
Gustaf Lundha07d2e72011-10-27 15:26:35 -07001284[[gitweb.linkname]]gitweb.linkname::
1285+
1286Optional setting for modifying the link name presented to the user
1287in the Gerrit web-UI.
1288+
1289Default linkname for custom type is "gitweb".
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001290
Adrian Goerlerf2007072011-11-10 08:39:55 +01001291[[gitweb.pathSeparator]]gitweb.pathSeparator::
1292+
1293Optional character to substitute the standard path separator (slash) in
1294project names and branch names.
1295+
1296By default, Gerrit will use hexadecimal encoding for slashes in project and
1297branch names. Some web servers, such as Tomcat, reject this hexadecimal
1298encoding in the URL.
1299+
1300Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
1301allow using an alternative path separator character. In Gitblit, this can be
1302configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
1303In Gerrit, the alternative path separator can be configured correspondingly
1304using the property 'gitweb.pathSeparator'.
1305+
1306Valid values are the characters '*', '(' and ')'.
1307
Edwin Kempin4bbff702013-01-11 09:59:53 +01001308[[groups]]Section groups
1309~~~~~~~~~~~~~~~~~~~~~~~~
1310
1311[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
1312+
1313Controls whether newly created groups should be by default visible to
1314all registered users.
1315+
1316By default, false.
1317
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001318[[hooks]]Section hooks
Remy Bohmer203eea32012-02-19 21:21:36 +01001319~~~~~~~~~~~~~~~~~~~~~~
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001320
1321See also link:config-hooks.html[Hooks].
1322
1323[[hooks.path]]hooks.path::
1324+
1325Optional path to hooks, if not specified then `'$site_path'/hooks` will be used.
1326
1327[[hooks.patchsetCreatedHook]]hooks.patchsetCreatedHook::
1328+
1329Optional filename for the patchset created hook, if not specified then
1330`patchset-created` will be used.
1331
David Pursehoused556c192012-06-12 18:34:37 +09001332[[hooks.draftPublishedHook]]hooks.draftPublishedHook::
1333+
1334Optional filename for the draft published hook, if not specified then
1335`draft-published` will be used.
1336
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001337[[hooks.commentAddedHook]]hooks.commentAddedHook::
1338+
1339Optional filename for the comment added hook, if not specified then
1340`comment-added` will be used.
1341
1342[[hooks.changeMergedHook]]hooks.changeMergedHook::
1343+
1344Optional filename for the change merged hook, if not specified then
1345`change-merged` will be used.
1346
David Pursehousef9f3b272012-09-28 19:58:59 +09001347[[hooks.mergeFailedHook]]hooks.mergeFailedHook::
1348+
1349Optional filename for the merge failed hook, if not specified then
1350`merge-failed` will be used.
1351
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001352[[hooks.changeAbandonedHook]]hooks.changeAbandonedHook::
1353+
1354Optional filename for the change abandoned hook, if not specified then
1355`change-abandoned` will be used.
1356
David Pursehousea93c9302012-06-15 16:29:26 +09001357[[hooks.changeRestoredHook]]hooks.changeRestoredHook::
1358+
1359Optional filename for the change restored hook, if not specified then
1360`change-restored` will be used.
1361
1362[[hooks.refUpdatedHook]]hooks.refUpdatedHook::
1363+
1364Optional filename for the ref updated hook, if not specified then
1365`ref-updated` will be used.
1366
David Pursehouse2336bd82012-09-21 12:50:19 +09001367[[hooks.reviewerAddedHook]]hooks.reviewerAddedHook::
1368+
1369Optional filename for the reviewer added hook, if not specified then
1370`reviewer-added` will be used.
1371
David Pursehousea93c9302012-06-15 16:29:26 +09001372[[hooks.claSignedHook]]hooks.claSignedHook::
1373+
1374Optional filename for the CLA signed hook, if not specified then
1375`cla-signed` will be used.
1376
Chris Harrisf736d6c2012-11-21 09:35:56 -05001377[[hooks.refUpdateHook]]hooks.refUpdateHook::
1378+
1379Optional filename for the ref update hook, if not specified then
1380`ref-update` will be used.
1381
1382[[hooks.syncHookTimeout]]hooks.syncHookTimeout::
David Pursehouse6fdc8d92012-11-28 12:34:18 +09001383+
1384Optional timeout value in seconds for synchronous hooks, if not specified
Chris Harrisf736d6c2012-11-21 09:35:56 -05001385then 30 seconds will be used.
1386
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001387[[http]]Section http
1388~~~~~~~~~~~~~~~~~~~~
1389
1390[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001391+
1392URL of the proxy server when making outgoing HTTP
1393connections for OpenID login transactions. Syntax
1394should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001395
1396[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001397+
1398Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02001399This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001400appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001401
1402[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001403+
1404Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02001405This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001406appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001407
1408
1409[[httpd]]Section httpd
1410~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001411
1412The httpd section configures the embedded servlet container.
1413
1414[[httpd.listenUrl]]httpd.listenUrl::
1415+
1416Specifies the URLs the internal HTTP daemon should listen for
Edwin Kempincdb0e002011-09-08 14:23:30 +02001417connections on. The special hostname '*' may be used to listen
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001418on all local addresses. A context path may optionally be included,
1419placing Gerrit Code Review's web address within a subdirectory of
1420the server.
1421+
1422Multiple protocol schemes are supported:
1423+
1424* `http://`'hostname'`:`'port'
1425+
1426Plain-text HTTP protocol. If port is not supplied, defaults to 80,
1427the standard HTTP port.
1428+
1429* `https://`'hostname'`:`'port'
1430+
1431SSL encrypted HTTP protocol. If port is not supplied, defaults to
1432443, the standard HTTPS port.
1433+
1434Externally facing production sites are encouraged to use a reverse
1435proxy configuration and `proxy-https://` (below), rather than using
1436the embedded servlet container to implement the SSL processing.
1437The proxy server with SSL support is probably easier to configure,
1438provides more configuration options to control cipher usage, and
1439is likely using natively compiled encryption algorithms, resulting
1440in higher throughput.
1441+
1442* `proxy-http://`'hostname'`:`'port'
1443+
1444Plain-text HTTP relayed from a reverse proxy. If port is not
1445supplied, defaults to 8080.
1446+
1447Like http, but additional header parsing features are
1448enabled to honor X-Forwarded-For, X-Forwarded-Host and
1449X-Forwarded-Server. These headers are typically set by Apache's
1450link:http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers[mod_proxy].
1451+
1452* `proxy-https://`'hostname'`:`'port'
1453+
1454Plain text HTTP relayed from a reverse proxy that has already
1455handled the SSL encryption/decryption. If port is not supplied,
1456defaults to 8080.
1457+
1458Behaves exactly like proxy-http, but also sets the scheme to assume
1459'https://' is the proper URL back to the server.
1460
1461+
1462If multiple values are supplied, the daemon will listen on all
1463of them.
1464+
1465By default, http://*:8080.
1466
1467[[httpd.reuseAddress]]httpd.reuseAddress::
1468+
1469If true, permits the daemon to bind to the port even if the port
1470is already in use. If false, the daemon ensures the port is not
1471in use before starting. Busy sites may need to set this to true
1472to permit fast restarts.
1473+
1474By default, true.
1475
1476[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
1477+
1478Size, in bytes, of the buffer used to parse the HTTP headers of an
1479incoming HTTP request. The entire request headers, including any
1480cookies sent by the browser, must fit within this buffer, otherwise
1481the server aborts with the response '413 Request Entity Too Large'.
1482+
1483One buffer of this size is allocated per active connection.
1484Allocating a buffer that is too large wastes memory that cannot be
1485reclaimed, allocating a buffer that is too small may cause unexpected
1486errors caused by very long Referer URLs or large cookie values.
1487+
1488By default, 16384 (16 K), which is sufficient for most OpenID and
1489other web-based single-sign-on integrations.
1490
1491[[httpd.sslKeyStore]]httpd.sslKeyStore::
1492+
1493Path of the Java keystore containing the server's SSL certificate
1494and private key. This keystore is required for `https://` in URL.
1495+
1496To create a self-signed certificate for simple internal usage:
1497+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001498----
1499keytool -keystore keystore -alias jetty -genkey -keyalg RSA
1500chmod 600 keystore
1501----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001502+
1503If not absolute, the path is resolved relative to `$site_path`.
1504+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08001505By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001506
1507[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
1508+
1509Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09001510Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001511doesn't want to enable one.
1512+
1513If set to the empty string the embedded server will prompt for the
1514password during startup.
1515+
1516By default, `gerrit`.
1517
Shawn O. Pearce1766f502010-01-15 10:49:46 -08001518[[httpd.requestLog]]httpd.requestLog::
1519+
1520Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
1521If enabled, an NCSA combined log format request log file is written
1522out by the internal HTTP daemon.
1523+
1524By default, true if httpd.listenUrl uses http:// or https://,
1525and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
1526
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001527[[httpd.acceptorThreads]]httpd.acceptorThreads::
1528+
1529Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09001530connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001531+
1532By default, 2, which should be suitable for most high-traffic sites.
1533
1534[[httpd.minThreads]]httpd.minThreads::
1535+
1536Minimum number of spare threads to keep in the worker thread pool.
1537This number must be at least 1 larger than httpd.acceptorThreads
1538multipled by the number of httpd.listenUrls configured.
1539+
1540By default, 5, suitable for most lower-volume traffic sites.
1541
1542[[httpd.maxThreads]]httpd.maxThreads::
1543+
1544Maximum number of threads to permit in the worker thread pool.
1545+
1546By default 25, suitable for most lower-volume traffic sites.
1547
1548[[httpd.maxQueued]]httpd.maxQueued::
1549+
1550Maximum number of client connections which can enter the worker
1551thread pool waiting for a worker thread to become available.
15520 disables the queue and permits infinite number of connections.
1553+
1554By default 50.
1555
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08001556[[httpd.maxWait]]httpd.maxWait::
1557+
David Pursehouse221d4f62012-06-08 17:38:08 +09001558Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08001559thread to handle a project clone, fetch or push request over the
1560smart HTTP transport.
1561+
1562Values should use common unit suffixes to express their setting:
1563+
1564* s, sec, second, seconds
1565* m, min, minute, minutes
1566* h, hr, hour, hours
1567* d, day, days
1568* w, week, weeks (`1 week` is treated as `7 days`)
1569* mon, month, months (`1 month` is treated as `30 days`)
1570* y, year, years (`1 year` is treated as `365 days`)
1571
1572+
1573If a unit suffix is not specified, `minutes` is assumed. If 0
1574is supplied, the maximum age is infinite and connections will not
1575abort until the client disconnects.
1576+
1577By default, 5 minutes.
1578
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001579
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07001580[[ldap]]Section ldap
1581~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001582
David Pursehouse221d4f62012-06-08 17:38:08 +09001583LDAP integration is only enabled if `auth.type` is set to
Sasa Zivkoveabc8972010-10-04 15:47:08 +02001584`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
1585detailed description of the auth.type settings and their
1586implications.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001587
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001588An example LDAP configuration follows, and then discussion of
1589the parameters introduced here. Suitable defaults for most
1590parameters are automatically guessed based on the type of server
1591detected during startup. The guessed defaults support both
1592link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307] and Active
1593Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001594
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001595----
1596[ldap]
1597 server = ldap://ldap.example.com
1598
1599 accountBase = ou=people,dc=example,dc=com
1600 accountPattern = (&(objectClass=person)(uid=${username}))
1601 accountFullName = displayName
1602 accountEmailAddress = mail
1603
1604 groupBase = ou=groups,dc=example,dc=com
1605 groupMemberPattern = (&(objectClass=group)(member=${dn}))
1606----
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001607
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001608[[ldap.server]]ldap.server::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001609+
1610URL of the organization's LDAP server to query for user information
1611and group membership from. Must be of the form `ldap://host` or
1612`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07001613+
1614If auth.type is `LDAP` this setting should use `ldaps://` to
1615ensure the end user's plaintext password is transmitted only over
1616an encrypted connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001617
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001618[[ldap.sslVerify]]ldap.sslVerify::
1619+
1620If false and ldap.server is an `ldaps://` style URL, Gerrit
1621will not verify the server certificate when it connects to
1622perform a query.
1623+
1624By default, true, requiring the certificate to be verified.
1625
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001626[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001627+
1628_(Optional)_ Username to bind to the LDAP server with. If not set,
1629an anonymous connection to the LDAP server is attempted.
1630
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001631[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001632+
1633_(Optional)_ Password for the user identified by `ldap.username`.
1634If not set, an anonymous (or passwordless) connection to the LDAP
1635server is attempted.
1636
Ben Wu0410a152010-06-04 16:17:24 +08001637[[ldap.referral]]ldap.referral::
1638+
1639_(Optional)_ How an LDAP referral should be handled if it is
1640encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05001641automatically follow any referrals, or `ignore` to ignore the
1642referrals.
Ben Wu0410a152010-06-04 16:17:24 +08001643+
1644By default, `ignore`.
1645
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01001646[[ldap.readTimeout]]ldap.readTimeout::
1647+
1648_(Optional)_ The read timeout for an LDAP operation. The value is
1649in the usual time-unit format like "1 s", "100 ms", etc...
1650A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09001651threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01001652+
1653By default there is no timeout and Gerrit will wait for the LDAP
1654server to respond until the TCP connection times out.
1655
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001656[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001657+
1658Root of the tree containing all user accounts. This is typically
1659of the form `ou=people,dc=example,dc=com`.
1660
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07001661[[ldap.accountScope]]ldap.accountScope::
1662+
1663Scope of the search performed for accounts. Must be one of:
1664+
1665* `one`: Search only one level below accountBase, but not recursive
1666* `sub` or `subtree`: Search recursively below accountBase
1667* `base` or `object`: Search exactly accountBase; probably not desired
1668
1669+
1670Default is `subtree` as many directories have several levels.
1671
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001672[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001673+
1674Query pattern to use when searching for a user account. This may be
1675any valid LDAP query expression, including the standard `(&...)` and
1676`(|...)` operators. If auth.type is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02001677`${username}` is replaced with a parameter set to the username
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07001678that was supplied by the HTTP server. If auth.type is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02001679the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07001680the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001681+
1682This pattern is used to search the objects contained directly under
1683the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02001684is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001685setting depends on the LDAP schema used by the directory server.
1686+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001687Default is `(uid=${username})` for RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001688and `(&(objectClass=user)(sAMAccountName=${username}))`
1689for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001690
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07001691[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001692+
1693_(Optional)_ Name of an attribute on the user account object which
1694contains the initial value for the user's full name field in Gerrit.
1695Typically this is the `displayName` property in LDAP, but could
1696also be `legalName` or `cn`.
1697+
David Pursehouse221d4f62012-06-08 17:38:08 +09001698Attribute values may be concatenated with literal strings. For
1699example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02001700`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07001701+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07001702If set, users will be unable to modify their full name field, as
1703Gerrit will populate it only from the LDAP data.
1704+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001705Default is `displayName` for RFC 2307 servers,
1706and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001707
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001708[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001709+
1710_(Optional)_ Name of an attribute on the user account object which
1711contains the user's Internet email address, as defined by this
1712LDAP server.
1713+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07001714Attribute values may be concatenated with literal strings,
1715for example to set the email address to the lowercase form
1716of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02001717`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07001718+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07001719If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09001720but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07001721and select a different preferred email address.
1722+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001723Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001724
Shawn O. Pearce59e09222009-08-19 09:04:49 -07001725[[ldap.accountSshUserName]]ldap.accountSshUserName::
1726+
1727_(Optional)_ Name of an attribute on the user account object which
1728contains the initial value for the user's SSH username field in
1729Gerrit. Typically this is the `uid` property in LDAP, but could
1730also be `cn`. Administrators should prefer to match the attribute
1731corresponding to the user's workstation username, as this is what
1732SSH clients will default to.
1733+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07001734Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02001735an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07001736force the value of sAMAccountName, if defined, to be all lowercase.
1737The suffix `.toUpperCase` can be used for the other direction.
1738The suffix `.localPart` can be used to split attribute values of
1739the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02001740example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07001741+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07001742If set, users will be unable to modify their SSH username field, as
1743Gerrit will populate it only from the LDAP data.
1744+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001745Default is `uid` for RFC 2307 servers,
1746and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07001747
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07001748[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04001749+
1750_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07001751contains the groups the user is part of. Typically used for Active
1752Directory servers.
Anthony93de7db2009-10-03 10:01:50 -04001753+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001754Default is unset for RFC 2307 servers (disabled)
1755and `memberOf` for Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04001756
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001757[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001758+
1759Root of the tree containing all group objects. This is typically
1760of the form `ou=groups,dc=example,dc=com`.
1761
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07001762[[ldap.groupScope]]ldap.groupScope::
1763+
1764Scope of the search performed for group objects. Must be one of:
1765+
1766* `one`: Search only one level below groupBase, but not recursive
1767* `sub` or `subtree`: Search recursively below groupBase
1768* `base` or `object`: Search exactly groupBase; probably not desired
1769
1770+
1771Default is `subtree` as many directories have several levels.
1772
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07001773[[ldap.groupPattern]]ldap.groupPattern::
1774+
1775Query pattern used when searching for an LDAP group to connect
1776to a Gerrit group. This may be any valid LDAP query expression,
1777including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02001778`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07001779group owner.
1780+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001781Default is `(cn=${groupname})` for RFC 2307,
1782and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07001783
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001784[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001785+
1786Query pattern to use when searching for the groups that a user
1787account is currently a member of. This may be any valid LDAP query
1788expression, including the standard `(&...)` and `(|...)` operators.
1789+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001790If auth.type is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001791replaced with a parameter set to the username that was supplied
1792by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02001793such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001794corresponding attribute (in this case, `fooBarAttribute`) as read
1795from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02001796Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001797+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001798Default is `(memberUid=${username})` for RFC 2307,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001799and unset (disabled) for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001800
Auke Schrijnen57809132012-09-26 21:05:39 +02001801[[ldap.groupName]]ldap.groupName::
1802+
David Pursehouse39489ae2012-10-12 13:50:04 +09001803_(Optional)_ Name of the attribute on the group object which contains
1804the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02001805+
David Pursehouse39489ae2012-10-12 13:50:04 +09001806Typically the attribute name is `cn` for RFC 2307 and Active Directory
1807servers. For other servers the attribute name may differ, for example
1808`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02001809+
David Pursehouse39489ae2012-10-12 13:50:04 +09001810It is also possible to specify a literal string containing a pattern of
1811attribute values. For example to create a Gerrit group name consisting of
1812LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
1813+
1814Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02001815
Edwin Kempinb3b0d292011-09-14 14:17:34 +02001816[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
1817+
1818Converts the local username, that is used to login into the Gerrit
1819WebUI, to lower case before doing the LDAP authentication. By setting
1820this parameter to true, a case insensitive login to the Gerrit WebUI
1821can be achieved.
1822+
1823If set, it must be ensured that the local usernames for all existing
1824accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09001825local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02001826anymore. The local usernames for the existing accounts can be
1827converted to lower case by running the server program
1828link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
1829Please be aware that the conversion of the local usernames to lower
1830case can't be undone. For newly created accounts the local username
1831will be directly stored in lower case.
1832+
1833By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001834
Robin Rosenberga3baed02012-10-14 14:09:32 +02001835[[ldap.authentication]]ldap.authentication::
1836+
1837Defines how Gerrit authenticates with the server. When set to `GSSAPI`
1838Gerrit will use Kerberos. To use kerberos the
1839`java.security.auth.login.config` system property must point to a
1840login to a JAAS configuration file and, if Java 6 is used, the system
1841property `java.security.krb5.conf` must point to the appropriate
1842krb5.ini file with references to the KDC.
1843
1844Typical jaas.conf.
1845
1846----
1847KerberosLogin {
1848 com.sun.security.auth.module.Krb5LoginModule
1849 required
1850 useTicketCache=true
1851 doNotPrompt=true
1852 renewTGT=true;
1853};
1854----
1855
1856See Java documentation on how to create the krb5.ini file.
1857
1858Note the `renewTGT` property to make sure the TGT does not expire,
1859and `useTicketCache` to use the TGT supplied by the operating system. As
1860the whole point of using GSSAPI is to have passwordless authentication
1861to the LDAP service, this option does not aquire a new TGT on its own.
1862
1863On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
1864must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
1865have local administrator privileges.
1866
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07001867[[mimetype]]Section mimetype
1868~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07001869
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001870[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07001871+
1872If set to true, files with the MIME type `<name>` will be sent as
1873direct downloads to the user's browser, rather than being wrapped up
1874inside of zipped archives. The type name may be a complete type
Edwin Kempincdb0e002011-09-08 14:23:30 +02001875name, e.g. `image/gif`, a generic media type, e.g. `image/*`,
1876or the wildcard `*/*` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07001877+
1878By default, false for all MIME types.
1879
1880Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001881----
1882[mimetype "image/*"]
1883 safe = true
1884
1885[mimetype "application/pdf"]
1886 safe = true
1887
1888[mimetype "application/msword"]
1889 safe = true
1890
1891[mimetype "application/vnd.ms-excel"]
1892 safe = true
1893----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07001894
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07001895
1896[[pack]]Section pack
1897~~~~~~~~~~~~~~~~~~~~
1898Global settings controlling how Gerrit Code Review creates pack
1899streams for Git clients running clone, fetch, or pull. Most of these
1900variables are per-client request, and thus should be carefully set
1901given the expected concurrent request load and available CPU and
1902memory resources.
1903
1904[[pack.deltacompression]]pack.deltacompression::
1905+
1906If true, delta compression between objects is enabled. This may
1907result in a smaller overall transfer for the client, but requires
1908more server memory and CPU time.
1909+
1910False (off) by default, matching Gerrit Code Review 2.1.4.
1911
1912[[pack.threads]]pack.threads::
1913+
1914Maximum number of threads to use for delta compression (if enabled).
1915This is per-client request. If set to 0 then the number of CPUs is
1916auto-detected and one thread per CPU is used, per client request.
1917+
1918By default, 1.
1919
1920
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07001921[[plugins]]Section plugins
1922~~~~~~~~~~~~~~~~~~~~~~~~~~
1923
1924[[plugins.checkFrequency]]plugins.checkFrequency::
1925+
1926How often plugins should be examined for new plugins to load, removed
1927plugins to be unloaded, or updated plugins to be reloaded. Values can
1928be specified using standard time unit abbreviations ('ms', 'sec',
1929'min', etc.).
1930+
1931If set to 0, automatic plugin reloading is disabled. Administrators
1932may force reloading with link:cmd-plugin.html[gerrit plugin reload].
1933+
1934Default is 1 minute.
1935
1936
lincoln2be11602010-07-05 10:53:25 -03001937[[receive]]Section receive
1938~~~~~~~~~~~~~~~~~~~~~~~~~~
Sasa Zivkov59d89c32011-11-18 15:32:35 +01001939This section is used to set who can execute the 'receive-pack' and
1940to limit the maximum Git object size that 'receive-pack' will accept.
1941'receive-pack' is what runs on the server during a user's push or
Dave Borowitz234734a2012-03-01 14:22:29 -08001942repo upload command. It also contains some advanced options for tuning the
1943behavior of Gerrit's 'receive-pack' mechanism.
lincoln2be11602010-07-05 10:53:25 -03001944
1945----
1946[receive]
1947 allowGroup = GROUP_ALLOWED_TO_EXECUTE
1948 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
Sasa Zivkov59d89c32011-11-18 15:32:35 +01001949 maxObjectSizeLimit = 40 m
lincoln2be11602010-07-05 10:53:25 -03001950----
1951
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08001952[[receive.checkMagicRefs]]receive.checkMagicRefs::
1953+
1954If true, Gerrit will verify the destination repository has
1955no references under the magic 'refs/drafts', 'refs/for', or
1956'refs/publish' branch namespaces. Names under these locations
1957confuse clients when trying to upload code reviews so Gerrit
1958requires them to be empty.
1959+
1960If false Gerrit skips the sanity check and assumes administrators
1961have ensured the repository does not contain any magic references.
1962Setting to false to skip the check can decrease latency during push.
1963+
1964Default is true.
1965
Gustaf Lundh9062fd62013-02-14 17:23:11 +01001966[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
1967+
1968If set to true, Gerrit will validate that all referenced objects that
1969are not included in the received pack are reachable by the user.
1970+
1971Carrying out this check on gits with many refs and commits can be a
1972very CPU-heavy operation. For non public Gerrit-servers this check may
1973be overkill.
1974+
1975Only disable this check if you trust the clients not to forge SHA1
1976references to access commits intended to be hidden from the user.
1977+
1978Default is true.
1979
lincoln2be11602010-07-05 10:53:25 -03001980[[receive.allowGroup]]receive.allowGroup::
1981+
1982Name of the groups of users that are allowed to execute
1983'receive-pack' on the server. One or more groups can be set.
1984+
1985If no groups are added, any user will be allowed to execute
1986'receive-pack' on the server.
1987
Sasa Zivkov59d89c32011-11-18 15:32:35 +01001988[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
1989+
1990Maximum allowed Git object size that 'receive-pack' will accept.
1991If an object is larger than the given size the pack-parsing will abort
1992and the push operation will fail. If set to zero then there is no
1993limit.
1994+
David Pursehouse221d4f62012-06-08 17:38:08 +09001995Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01001996from pushing objects which are too large to Gerrit.
1997+
1998Default is zero.
1999+
2000Common unit suffixes of 'k', 'm', or 'g' are supported.
2001
Dave Borowitz234734a2012-03-01 14:22:29 -08002002[[receive.threadPoolSize]]receive.threadPoolSize::
2003+
2004Maximum size of the thread pool in which the change data in received packs is
2005processed.
2006+
2007Defaults to the number of available CPUs according to the Java runtime.
2008
Shawn O. Pearcec545c092012-07-27 16:38:55 -07002009[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
2010+
2011Number of threads to perform change creation or patch set updates
2012concurrently. Each thread uses its own database connection from
2013the database connection pool, and if all threads are busy then
2014main receive thread will also perform a change creation or patch
2015set update.
2016+
2017Defaults to 1, using only the main receive thread. This feature is for
2018databases with very high latency that can benfit from concurrent
2019operations when multiple changes are impacted at once.
2020
Dave Borowitz1c401362012-03-02 17:39:17 -08002021[[receive.timeout]]receive.timeout::
2022+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07002023Overall timeout on the time taken to process the change data in
2024received packs. Only includes the time processing Gerrit changes
2025and updating references, not the time to index the pack. Values can
2026be specified using standard time unit abbreviations ('ms', 'sec',
2027'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08002028+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07002029Default is 2 minutes. If no unit is specified, millisconds
2030is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08002031
lincoln2be11602010-07-05 10:53:25 -03002032
Hugo Josefson072b4702010-04-21 19:27:11 +02002033[[repository]]Section repository
2034~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2035Repositories in this sense are the same as projects.
2036
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002037In the following example configuration `Registered Users` is set
2038to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02002039
2040----
2041[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02002042 ownerGroup = Registered Users
2043----
2044
2045[NOTE]
2046Currently only the repository name `*` is supported.
2047This is a wildcard designating all repositories.
2048
Hugo Josefson072b4702010-04-21 19:27:11 +02002049[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
2050+
2051A name of a group which exists in the database. Zero, one or many
2052groups are allowed. Each on its own line. Groups which don't exist
2053in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02002054
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07002055[[rules]]Section rules
2056~~~~~~~~~~~~~~~~~~~~~~
2057
2058[[rules.enable]]rules.enable::
2059+
2060If true, Gerrit will load and excute 'rules.pl' files in each
2061project's refs/meta/config branch, if present. When set to false,
2062only the default internal rules will be used.
2063+
2064Default is true, to execute project specific rules.
2065
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07002066[[sendemail]]Section sendemail
2067~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002068
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002069[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07002070+
2071If false Gerrit will not send email messages, for any reason,
2072and all other properties of section sendemail are ignored.
2073+
2074By default, true, allowing notifications to be sent.
2075
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002076[[sendemail.from]]sendemail.from::
2077+
2078Designates what name and address Gerrit will place in the From
2079field of any generated email messages. The supported values are:
2080+
2081* `USER`
2082+
2083Gerrit will set the From header to use the current user's
2084Full Name and Preferred Email. This may cause messsages to be
2085classified as spam if the user's domain has SPF or DKIM enabled
2086and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
2087relay for that domain.
2088+
2089* `MIXED`
2090+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002091Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002092`review@example.com` is the same as <<user.email,user.email>>.
2093See below for a description of how the replacement is handled.
2094+
2095* `SERVER`
2096+
2097Gerrit will set the From header to the same name and address
2098it records in any commits Gerrit creates. This is set by
2099<<user.name,user.name>> and <<user.email,user.email>>, or guessed
2100from the local operating system.
2101+
2102* 'Code Review' `<`'review'`@`'example.com'`>`
2103+
2104If set to a name and email address in brackets, Gerrit will use
2105this name and email address for any messages, overriding the name
2106that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002107Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002108which is replaced by the Full Name of the current user.
2109
2110+
2111By default, MIXED.
2112
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002113[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002114+
2115Hostname (or IP address) of a SMTP server that will relay
2116messages generated by Gerrit to end users.
2117+
2118By default, 127.0.0.1 (aka localhost).
2119
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002120[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002121+
2122Port number of the SMTP server in sendemail.smtpserver.
2123+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08002124By default, 25, or 465 if smtpEncryption is 'ssl'.
2125
2126[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
2127+
2128Specify the encryption to use, either 'ssl' or 'tls'.
2129+
2130By default, 'none', indicating no encryption is used.
2131
2132[[sendemail.sslVerify]]sendemail.sslVerify::
2133+
2134If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
2135will not verify the server certificate when it connects to send
2136an email message.
2137+
2138By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002139
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002140[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002141+
2142User name to authenticate with, if required for relay.
2143
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002144[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002145+
2146Password for the account named by sendemail.smtpUser.
2147
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002148[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07002149+
2150If present, each value adds one entry to the whitelist of email
2151addresses that Gerrit can send email to. If set to a complete
2152email address, that one address is added to the white list.
2153If set to a domain name, any address at that domain can receive
2154email from Gerrit.
2155+
2156By default, unset, permitting delivery to any email address.
2157
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07002158[[sendemail.includeDiff]]sendemail.includeDiff::
2159+
Bruce Zueb00ff32012-11-27 17:38:10 +08002160If true, new change emails and merged change emails from Gerrit
2161will include the complete unified diff of the change.
2162Variable maxmimumDiffSize places an upper limit on how large the
2163email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07002164+
2165By default, false.
2166
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07002167[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
2168+
2169Largest size of unified diff output to include in an email. When
2170the diff exceeds this size the file paths will be listed instead.
2171Standard byte unit suffixes are supported.
2172+
2173By default, 256 KiB.
2174
Alex Blewitt9cca7402011-02-11 01:39:30 +00002175[[sendemail.importance]]sendemail.importance::
2176+
2177If present, emails sent from Gerrit will have the given level
2178of importance. Valid values include 'high' and 'low', which
2179email clients will render in different ways.
2180+
2181By default, unset, so no Importance header is generated.
2182
2183[[sendemail.expiryDays]]sendemail.expiryDays::
2184+
2185If present, emails sent from Gerrit will expire after the given
2186number of days. This will add the Expiry-Date header and
2187email clients may expire or expunge mails whose Expiry-Date
2188header is in the past. This should be a positive non-zero
2189number indicating how many days in the future the mails
2190should expire.
2191+
2192By default, unset, so no Expiry-Date header is generated.
2193
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002194
2195[[site]]Section site
2196~~~~~~~~~~~~~~~~~~~~
2197
2198[[site.checkUserAgent]]site.checkUserAgent::
2199+
2200If true the server checks the User-Agent HTTP header and sends the
2201correct JavaScript to the client as part of the initial page load.
2202This usually reduces a round-trip for the client, allowing the UI to
2203start more quickly. If false, a tiny JavaScript loader is sent to the
2204client instead to determine the correct code to use. Default is true.
2205
2206[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
2207+
2208If true the server checks the site header, footer and CSS files for
2209updated versions. If false, a server restart is required to change
2210any of these resources. Default is true, allowing automatic reloads.
2211
Shawn O. Pearce6bd04fd2012-04-05 14:39:22 -07002212[[site.enableDeprecatedQuery]]site.enableDeprecatedQuery::
2213+
2214If true the deprecated `/query` URL is available to return JSON
2215and text results for changes. If false, the URL is disabled and
2216returns 404 to clients. Default is true, enabling `/query`.
2217
Sasa Zivkovde980a42012-06-14 14:57:53 +02002218[[site.upgradeSchemaOnStartup]]site.upgradeSchemaOnStartup::
2219+
2220Control whether schema upgrade should be done on Gerrit startup. The following
2221values are supported:
2222+
2223* `OFF`
2224+
2225No automatic schema upgrade on startup.
2226+
2227* `AUTO`
2228+
2229Perform schema migration on startup, if necessary. If, as a result of
2230schema migration, there would be any unused database objects they will
2231be dropped automatically.
2232+
2233* `AUTO_NO_PRUNE`
2234+
2235Like `AUTO` but unused database objects will not be pruned.
2236
2237+
2238The default is `OFF`.
2239
Shawn O. Pearce521380a2012-05-11 14:57:56 -07002240[[ssh-alias]] Section ssh-alias
2241~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2242
2243Variables in section ssh-alias permit the site administrator to alias
2244another command from Gerrit or a plugin into the `gerrit` command
2245namespace. To alias `replication start` to `gerrit replicate`:
2246
2247----
2248[ssh-alias]
2249 replicate = replication start
2250----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002251
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07002252[[sshd]] Section sshd
Shawn O. Pearcea758fef2009-08-19 08:29:32 -07002253~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07002254
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002255[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002256+
2257Specifies the local addresses the internal SSHD should listen
2258for connections on. The following forms may be used to specify
2259an address. In any form, `:'port'` may be omitted to use the
2260default of 29418.
2261+
2262* 'hostname':'port' (for example `review.example.com:29418`)
2263* 'IPv4':'port' (for example `10.0.0.1:29418`)
2264* ['IPv6']:'port' (for example `[ff02::1]:29418`)
Edwin Kempincdb0e002011-09-08 14:23:30 +02002265* *:'port' (for example `*:29418`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002266
2267+
2268If multiple values are supplied, the daemon will listen on all
2269of them.
2270+
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07002271To disable the internal SSHD, set listenAddress to `off`.
2272+
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002273By default, *:29418.
2274
James Y Knight910bd862011-01-11 20:05:56 -05002275[[sshd.advertisedAddress]]sshd.advertisedAddress::
2276+
2277Specifies the addresses clients should be told to connect to.
2278This may differ from sshd.listenAddress if a firewall based port
2279redirector is being used, making Gerrit appear to answer on port
228022. The following forms may be used to specify an address. In any
2281form, `:'port'` may be omitted to use the default SSH port of 22.
2282+
2283* 'hostname':'port' (for example `review.example.com:22`)
2284* 'IPv4':'port' (for example `10.0.0.1:29418`)
2285* ['IPv6']:'port' (for example `[ff02::1]:29418`)
2286
2287+
2288If multiple values are supplied, the daemon will advertise all
2289of them.
2290+
2291By default, sshd.listenAddress.
2292
Shawn O. Pearce149238a2009-09-10 12:25:20 -07002293[[sshd.reuseAddress]]sshd.reuseAddress::
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07002294+
2295If true, permits the daemon to bind to the port even if the port
2296is already in use. If false, the daemon ensures the port is not
2297in use before starting. Busy sites may need to set this to true
2298to permit fast restarts.
2299+
2300By default, true.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07002301
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002302[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07002303+
2304If true, enables TCP keepalive messages to the other side, so
2305the daemon can terminate connections if the peer disappears.
2306+
2307By default, true.
2308
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08002309[[sshd.threads]]sshd.threads::
2310+
2311Number of threads to use when executing SSH command requests.
2312If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09002313are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08002314+
2315By default, 1.5x the number of CPUs available to the JVM.
2316
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002317[[sshd.batchThreads]]sshd.batchThreads::
2318+
2319Number of threads to allocate for SSH command requests from
Fredrik Luthander46843022012-03-13 16:11:02 +01002320link:access-control.html#non-interactive_users[non-interactive users].
2321If equals to 0, then all non-interactive requests are executed in the same
2322queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002323+
2324Any other value will remove the number of threads from the queue
2325allocated to interactive users, and create a separate thread pool
2326of the requested size, which will be used to run commands from
2327non-interactive users.
2328+
2329If the number of threads requested for non-interactive users is larger
2330than the total number of threads allocated in sshd.threads, then the
2331value of sshd.threads is increased to accomodate the requested value.
2332+
2333By default, 0.
2334
Kenny Root15ac1b82010-02-24 00:29:20 -08002335[[sshd.streamThreads]]sshd.streamThreads::
2336+
2337Number of threads to use when formatting events to asynchronous
2338streaming clients. Event formatting is multiplexed onto this thread
2339pool by a simple FIFO scheduling system.
2340+
2341By default, 1 plus the number of CPUs available to the JVM.
2342
Edwin Kempinb5df3b82011-10-10 11:31:14 +02002343[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07002344+
2345Number of threads used to parse a command line submitted by a client
2346over SSH for execution, create the internal data structures used by
2347that command, and schedule it for execution on another thread.
2348+
2349By default, 2.
2350
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002351[[sshd.maxAuthTries]]sshd.maxAuthTries::
2352+
2353Maximum number of authentication attempts before the server
2354disconnects the client. Each public key that a client has loaded
2355into its local agent counts as one auth request. Users can work
2356around the server's limit by loading less keys into their agent,
2357or selecting a specific key in their `~/.ssh/config` file with
2358the `IdentityFile` option.
2359+
2360By default, 6.
2361
2362[[sshd.loginGraceTime]]sshd.loginGraceTime::
2363+
2364Time in seconds that a client has to authenticate before the server
2365automatically terminates their connection. Values should use common
2366unit suffixes to express their setting:
2367+
2368* s, sec, second, seconds
2369* m, min, minute, minutes
2370* h, hr, hour, hours
2371* d, day, days
2372
2373+
2374By default, 2 minutes.
2375
Christian Aistleitner3d794592013-04-08 00:19:40 +02002376[[sshd.idleTimeout]]sshd.idleTimeout::
2377+
2378Time in seconds after which the server automatically terminates idle
2379connections (or 0 to disable closing of idle connections). Values
2380should use common unit suffixes to express their setting:
2381+
2382* s, sec, second, seconds
2383* m, min, minute, minutes
2384* h, hr, hour, hours
2385* d, day, days
2386
2387+
2388By default, 0.
2389
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002390[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
2391+
2392Maximum number of concurrent SSH sessions that a user account
2393may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09002394that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002395the number of commands a user may issue over a single connection.
2396If set to 0, there is no limit.
2397+
2398By default, 64.
2399
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002400[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07002401+
2402Available ciphers. To permit multiple ciphers, specify multiple
2403`sshd.cipher` keys in the configuration file, one cipher name
2404per key. Cipher names starting with `+` are enabled in addition
2405to the default ciphers, cipher names starting with `-` are removed
2406from the default cipher set.
2407+
2408Supported ciphers: aes128-cbc, aes128-cbc, aes256-cbc, blowfish-cbc,
24093des-cbc, none.
2410+
2411By default, all supported ciphers except `none` are available.
2412
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002413[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07002414+
2415Available MAC (message authentication code) algorithms. To permit
2416multiple algorithms, specify multiple `sshd.mac` keys in the
2417configuration file, one MAC per key. MAC names starting with `+`
2418are enabled in addition to the default MACs, MAC names starting with
2419`-` are removed from the default MACs.
2420+
2421Supported MACs: hmac-md5, hmac-md5-96, hmac-sha1, hmac-sha1-96.
2422+
2423By default, all supported MACs are available.
2424
Alex Blewitt7efb06f2013-04-01 12:46:48 -04002425[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
2426+
2427Enable kerberos authentication for SSH connections. To permit
2428kerberos authentication, the server must have a host principal
2429(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
2430This must be provisioned by the kerberos administrators, and is
2431typically installed into `/etc/krb5.keytab` on host machines.
2432+
2433The keytab must contain at least one `host/` principal, typically
2434using the host's canonical name. If it does not use the
2435canonical name, the `sshd.kerberosPrincipal` should be configured
2436with the correct name.
2437+
2438By default, not set and so kerberos authentication is not enabled.
2439
2440[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
2441+
2442If kerberos authentication is enabled with `sshd.kerberosKeytab`,
2443instead use the given principal name instead of the default.
2444If the principal does not begin with `host/` a warning message is
2445printed and may prevent successful authentication.
2446+
2447This may be useful if the host is behind an IP load balancer or
2448other SSH forwarding systems, since the principal name is constructed
2449by the client and must match for kerberos authentication to work.
2450+
2451By default, `host/canonical.host.name`
2452
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002453[[suggest]] Section suggest
2454~~~~~~~~~~~~~~~~~~~~~~~~~~~
2455
Dave Borowitz1ae8c532012-03-09 18:39:40 -08002456[[suggest.accounts]]suggest.accounts::
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002457+
Dave Borowitz45baa892012-02-23 16:43:05 -08002458If `true`, visible user accounts (according to the value of
2459`accounts.visibility`) will be offered as completion suggestions
2460when adding a reviewer to a change, or a user to a group.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002461+
Dave Borowitz45baa892012-02-23 16:43:05 -08002462If `false`, account suggestion is disabled.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002463+
Dave Borowitz45baa892012-02-23 16:43:05 -08002464Older configurations may also have one of the `accounts.visibility`
2465values for this field, including `OFF` as a synonym for `NONE`. If
2466`accounts.visibility` is also set, that value overrides this one;
2467otherwise, this value applies to both `suggest.accounts` and
2468`accounts.visibility`.
Edwin Kempin42488812011-05-20 03:11:43 +02002469+
Dave Borowitz45baa892012-02-23 16:43:05 -08002470New configurations should prefer the boolean value for this field
2471and an enum value for `accounts.visibility`.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002472
Edwin Kempinf957dc22012-10-19 20:41:18 +02002473[[suggest.from]]suggest.from::
2474+
2475The number of characters that a user must have typed before suggestions
2476are provided. If set to 0, suggestions are always provided.
2477+
2478By default 0.
2479
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002480[[theme]] Section theme
2481~~~~~~~~~~~~~~~~~~~~~~~
2482
2483[[theme.backgroundColor]]theme.backgroundColor::
2484+
2485Background color for the page, and major data tables like the all
2486open changes table or the account dashboard. The value must be a
2487valid HTML hex color code, or standard color name.
2488+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002489By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002490
2491[[theme.topMenuColor]]theme.topMenuColor::
2492+
2493This is the color of the main menu bar at the top of the page.
2494The value must be a valid HTML hex color code, or standard color
Chad Horohoebbdf7482012-11-13 18:23:15 -08002495name.
2496+
2497By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002498
2499[[theme.textColor]]theme.textColor::
2500+
2501Text color for the page, and major data tables like the all
2502open changes table or the account dashboard. The value must be a
2503valid HTML hex color code, or standard color name.
2504+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002505By default dark grey, `353535`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002506
2507[[theme.trimColor]]theme.trimColor::
2508+
2509Primary color used as a background color behind text. This is
2510the color of the main menu bar at the top, of table headers,
2511and of major UI areas that we want to offset from other portions
2512of the page. The value must be a valid HTML hex color code, or
2513standard color name.
2514+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002515By default a light grey, `EEEEEE`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002516
2517[[theme.selectionColor]]theme.selectionColor::
2518+
2519Background color used within a trimColor area to denote the currently
2520selected tab, or the background color used in a table to denote the
2521currently selected row. The value must be a valid HTML hex color
2522code, or standard color name.
2523+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002524By default a pale blue, `D8EDF9`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002525
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01002526[[theme.changeTableOutdatedColor]]theme.changeTableOutdatedColor::
2527+
2528Background color used for patch outdated messages. The value must be
2529a valid HTML hex color code, or standard color name.
2530+
Edwin Kempinb0347332012-07-17 10:14:32 +02002531By default a shade of red, `F08080`.
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01002532
2533[[theme.tableOddRowColor]]theme.tableOddRowColor::
2534+
2535Background color for tables such as lists of open reviews for odd
2536rows. This is so you can have a different color for odd and even
2537rows of the table. The value must be a valid HTML hex color code,
2538or standard color name.
2539+
2540By default transparent.
2541
2542[[theme.tableEvenRowColor]]theme.tableEvenRowColor::
2543+
2544Background color for tables such as lists of open reviews for even
2545rows. This is so you can have a different color for odd and even
2546rows of the table. The value must be a valid HTML hex color code,
2547or standard color name.
2548+
2549By default transparent.
2550
Shawn O. Pearcea83bb1c2011-05-20 08:46:48 -07002551A different theme may be used for signed-in vs. signed-out user status
2552by using the "signed-in" and "signed-out" theme sections. Variables
2553not specified in a section are inherited from the default theme.
2554
2555----
2556[theme]
2557 backgroundColor = FFFFFF
2558[theme "signed-in"]
2559 backgroundColor = C0C0C0
2560[theme "signed-out"]
2561 backgroundColor = 00FFFF
2562----
2563
Goran Lungberg04132a12010-06-15 17:20:37 -07002564[[trackingid]] Section trackingid
Shawn O. Pearce91763a02010-06-16 15:39:33 -07002565~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Goran Lungberg04132a12010-06-15 17:20:37 -07002566
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07002567Tagged footer lines containing references to external
2568tracking systems, parsed out of the commit message and
2569saved in Gerrit's database. After making changes to
2570this section, existing changes must be reindexed with the
2571link:pgm-ScanTrackingIds.html[ScanTrackingIds] program.
Goran Lungberg04132a12010-06-15 17:20:37 -07002572
Edwin Kempinbb421f12011-08-25 11:19:00 +02002573The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07002574bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07002575
2576----
2577[trackingid "jira-bug"]
2578 footer = Bugfix:
2579 match = JRA\\d{2,8}
2580 system = JIRA
2581
2582[trackingid "jira-feature"]
2583 footer = Feature
2584 match = JRA(\\d{2,8})
2585 system = JIRA
2586----
2587
2588[[trackingid.name.footer]]trackingid.<name>.footer::
2589+
2590A prefix tag that identify the footer line to parse for tracking ids.
Kevin Degi9af42ea2011-08-01 15:54:42 -06002591Several trackingid entries can have the same footer tag. A single
2592trackingid entry can have multiple footer tags. If multiple footer
2593tags are specified, each tag will be parsed separately.
Goran Lungberg04132a12010-06-15 17:20:37 -07002594(the trailing ":" is optional)
2595
2596[[trackingid.name.match]]trackingid.<name>.match::
2597+
Magnus Bäcke5611832011-02-02 08:57:15 +01002598A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
2599Java regular expression (java.util.regex)] used to match the
2600external tracking id part of the footer line. The match can
2601result in several entries in the DB. If grouping is used in the
2602regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01002603Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07002604+
2605The configuration file parser eats one level of backslashes, so the
2606character class `\s` requires `\\s` in the configuration file. The
2607parser also terminates the line at the first `#`, so a match
2608expression containing # must be wrapped in double quotes.
2609
2610[[trackingid.name.system]]trackingid.<name>.system::
2611+
David Pursehouse221d4f62012-06-08 17:38:08 +09002612The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07002613It is possible to have several trackingid entries for the same
2614tracking system.
2615
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07002616[[transfer]] Section transfer
2617~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2618
2619[[transfer.timeout]]transfer.timeout::
2620+
2621Number of seconds to wait for a single network read or write
2622to complete before giving up and declaring the remote side is
2623not responding. If 0, there is no timeout, and this server will
2624wait indefinitely for a transfer to finish.
2625+
2626A timeout should be large enough to mostly transfer the objects to
2627the other side. 1 second may be too small for larger projects,
2628especially over a WAN link, while 10-30 seconds is a much more
2629reasonable timeout value.
2630+
2631Defaults to 0 seconds, wait indefinitely.
2632
lincoln2be11602010-07-05 10:53:25 -03002633
2634[[upload]]Section upload
Remy Bohmer203eea32012-02-19 21:21:36 +01002635~~~~~~~~~~~~~~~~~~~~~~~~
lincoln2be11602010-07-05 10:53:25 -03002636Sets the group of users allowed to execute 'upload-pack' on the
2637server, 'upload-pack' is what runs on the server during a user's
2638fetch, clone or repo sync command.
2639
2640----
2641[upload]
2642 allowGroup = GROUP_ALLOWED_TO_EXECUTE
2643 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
2644----
2645
2646[[upload.allowGroup]]upload.allowGroup::
2647+
2648Name of the groups of users that are allowed to execute 'upload-pack'
2649on the server. One or more groups can be set.
2650+
2651If no groups are added, any user will be allowed to execute
2652'upload-pack' on the server.
2653
2654
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07002655[[user]] Section user
Shawn O. Pearcea758fef2009-08-19 08:29:32 -07002656~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce0a351912009-06-01 08:14:46 -07002657
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002658[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07002659+
2660Name that Gerrit calls itself in Git when it creates a new Git
2661commit, such as a merge during change submission.
2662+
2663By default this is "Gerrit Code Review".
2664
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002665[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07002666+
2667Email address that Gerrit refers to itself as when it creates a
2668new Git commit, such as a merge commit during change submission.
2669+
2670If not set, Gerrit generates this as "gerrit@`hostname`", where
2671`hostname` is the hostname of the system Gerrit is running on.
2672+
2673By default, not set, generating the value at startup.
2674
Edwin Kempin0e02ded2011-09-16 15:10:14 +02002675[[user.anonymousCoward]]user.anonymousCoward::
2676+
2677Username that this displayed in the Gerrit WebUI and in e-mail
2678notifications if the full name of the user is not set.
2679+
2680By default "Anonymous Coward" is used.
2681
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07002682
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002683File `etc/secure.config`
Remy Bohmer203eea32012-02-19 21:21:36 +01002684------------------------
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002685The optional file `'$site_path'/etc/secure.config` overrides (or
2686supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08002687The file should be readable only by the daemon process and can be
2688used to contain private configuration entries that wouldn't normally
2689be exposed to everyone.
2690
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002691Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08002692----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07002693[auth]
2694 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
Brad Larson3a6f0772012-07-25 11:41:22 -05002695 restTokenPrivateKey = 7e40PzCjlUKOnXATvcBNXH6oyiu+r0dFk2c=
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07002696
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08002697[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002698 username = webuser
2699 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08002700
2701[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002702 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08002703
2704[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002705 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08002706
2707[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002708 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07002709
2710[remote "bar"]
2711 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08002712----
2713
Johan Bjork3e5ee302012-01-27 17:59:54 +01002714File `etc/peer_keys`
2715--------------------
2716
2717The optional file `'$site_path'/etc/peer_keys` controls who can
2718login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
2719command.
2720
2721The format is one Base-64 encoded public key per line.
2722
2723
Shawn O. Pearce7b405712009-05-08 18:27:53 -07002724Database system_config
2725----------------------
2726
2727Several columns in the `system_config` table within the metadata
2728database may be set to control how Gerrit behaves.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08002729
2730[NOTE]
2731The contents of the `system_config` table are cached at startup
2732by Gerrit. If you modify any columns in this table, Gerrit needs
2733to be restarted before it will use the new values.
2734
Shawn O. Pearce7b405712009-05-08 18:27:53 -07002735Configurable Parameters
2736~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08002737
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07002738site_path::
2739+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08002740Local filesystem directory holding the site customization assets.
2741Placing this directory under version control and/or backup is a
2742good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07002743+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002744Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07002745+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08002746Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07002747+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08002748* link:config-headerfooter.html[Site Header/Footer]
2749
Shawn O. Pearce5500e692009-05-28 15:55:01 -07002750GERRIT
2751------
2752Part of link:index.html[Gerrit Code Review]