blob: c5ef758ee014e1db3fec746b3997f35b0bdc0b8c [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.
Chulho Yangb72ff8f2013-07-04 02:35:53 -0400122Optionally, certificate revocation list file can be used
123at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200124+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700125* `LDAP`
126+
127Gerrit prompts the user to enter a username and a password, which
128it then verifies by performing a simple bind against the configured
129<<ldap.server,ldap.server>>. In this configuration the web server
130is not involved in the user authentication process.
131+
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800132The actual username used in the LDAP simple bind request is the
133account's full DN, which is discovered by first querying the
134directory using either an anonymous request, or the configured
Robin Rosenberga3baed02012-10-14 14:09:32 +0200135<<ldap.username,ldap.username>> identity. Gerrit can also use kerberos if
136<<ldap.authentication,ldap.authentication>> is set to `GSSAPI`.
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800137
138* `LDAP_BIND`
139+
140Gerrit prompts the user to enter a username and a password, which
141it then verifies by performing a simple bind against the configured
142<<ldap.server,ldap.server>>. In this configuration the web server
143is not involved in the user authentication process.
144+
David Pursehouse42f42042013-08-01 14:02:25 +0900145Unlike `LDAP` above, the username used to perform the LDAP simple bind
David Pursehouse1344f5b2013-08-09 17:35:47 +0900146request is the exact string supplied in the dialog by the user.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200147The configured <<ldap.username,ldap.username>> identity is not used to obtain
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800148account information.
149+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700150* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
151+
152*DO NOT USE*. Only for use in a development environment.
153+
154When this is the configured authentication method a hyperlink titled
155`Become` appears in the top right corner of the page, taking the
156user to a form where they can enter the username of any existing
157user account, and immediately login as that account, without any
158authentication taking place. This form of authentication is only
159useful for the GWT hosted mode shell, where OpenID authentication
160redirects might be risky to the developer's host computer, and HTTP
161authentication is not possible.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700162
163+
164By default, OpenID.
165
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700166[[auth.allowedOpenID]]auth.allowedOpenID::
167+
168List of permitted OpenID providers. A user may only authenticate
169with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse42f42042013-08-01 14:02:25 +0900170is set to `OpenID` (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700171+
Magnus Bäcke5611832011-02-02 08:57:15 +0100172Patterns may be either a
173link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
174Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700175end with `$`) or be a simple prefix (any other string).
176+
177By default, the list contains two values, `http://` and `https://`,
178allowing users to authenticate with any OpenID provider.
179
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700180[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700181+
David Pursehouse221d4f62012-06-08 17:38:08 +0900182List of trusted OpenID providers. Only used if `auth.type` is
David Pursehouse42f42042013-08-01 14:02:25 +0900183set to `OpenID` (the default).
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700184+
185In order for a user to take advantage of permissions beyond those
186granted to the `Anonymous Users` and `Registered Users` groups,
187the user account must only have OpenIDs which match at least one
188pattern from this list.
189+
Magnus Bäcke5611832011-02-02 08:57:15 +0100190Patterns may be either a
191link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
192Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700193end with `$`) or be a simple prefix (any other string).
194+
195By default, the list contains two values, `http://` and `https://`,
196allowing Gerrit to trust any OpenID it receives.
197
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100198[[auth.openIdDomain]]auth.openIdDomain::
199+
200List of allowed OpenID email address domains. Only used if
David Pursehouse42f42042013-08-01 14:02:25 +0900201`auth.type` is set to `OPENID` or `OPENID_SSO`.
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100202+
203Domain is case insensitive and must be in the same form as it
204appears in the email address, for example, "example.com".
205+
206By default, any domain is accepted.
207
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700208[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
209+
210Time in seconds before an OpenID provider must force the user
211to authenticate themselves again before authentication to this
212Gerrit server. Currently this is only a polite request, and users
213coming from providers that don't support the PAPE extension will
214be accepted anyway. In the future it may be enforced, rejecting
215users coming from providers that don't honor the max session age.
216+
217If set to 0, the provider will always force the user to authenticate
218(e.g. supply their password). Values should use common unit suffixes
219to express their setting:
220+
221* s, sec, second, seconds
222* m, min, minute, minutes
223* h, hr, hour, hours
224* d, day, days
225* w, week, weeks (`1 week` is treated as `7 days`)
226* mon, month, months (`1 month` is treated as `30 days`)
227* y, year, years (`1 year` is treated as `365 days`)
228
229+
230Default is -1, permitting infinite time between authentications.
231
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700232[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
233+
234Time in seconds before an email verification token sent to a user in
235order to validate their email address expires.
236+
237* s, sec, second, seconds
238* m, min, minute, minutes
239* h, hr, hour, hours
240* d, day, days
241* w, week, weeks (`1 week` is treated as `7 days`)
242* mon, month, months (`1 month` is treated as `30 days`)
243* y, year, years (`1 year` is treated as `365 days`)
244
245+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800246Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700247
James E. Blairca8bc3b2011-12-21 18:12:26 +0000248[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
249+
David Pursehouse42f42042013-08-01 14:02:25 +0900250The SSO entry point URL. Only used if `auth.type` is set to
251`OpenID_SSO`.
James E. Blairca8bc3b2011-12-21 18:12:26 +0000252+
253The "Sign In" link will send users directly to this URL.
254
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700255[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700256+
257HTTP header to trust the username from, or unset to select HTTP basic
David Pursehouse42f42042013-08-01 14:02:25 +0900258or digest authentication. Only used if `auth.type` is set to `HTTP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700259
Luca Milanesio384ed6c2013-07-30 09:10:07 +0100260[[auth.httpDisplaynameHeader]]auth.httpDisplaynameHeader::
261+
262HTTP header to retrieve the user's display name from. Only used if `auth.type`
263is set to `HTTP`.
264+
265If set, Gerrit trusts and enforces the user's full name using the HTTP header
266and disables the ability to manually modify the user's full name
267from the contact information page.
268
269[[auth.httpEmailHeader]]auth.httpEmailHeader::
270+
271HTTP header to retrieve the user's e-mail from. Only used if `auth.type`
272is set to `HTTP`.
273+
274If set, Gerrit trusts and enforces the user's e-mail using the HTTP header
275and disables the ability to manually modify or register other e-mails
276from the contact information page.
277
Luca Milanesio5185b042013-07-27 22:03:06 +0100278[[auth.loginUrl]]auth.loginUrl::
279+
280URL to redirect a browser to after the end-user has clicked on the
David Pursehouse42f42042013-08-01 14:02:25 +0900281login link in the upper right corner. Only used if `auth.type` is set
282to `HTTP` or `HTTP_LDAP`.
Luca Milanesio5185b042013-07-27 22:03:06 +0100283Organizations using an enterprise single-sign-on solution may want to
284redirect the browser to the SSO product's sign-in page for completing the
285login process and validate their credentials.
286+
David Pursehouse42f42042013-08-01 14:02:25 +0900287If set, Gerrit allows anonymous access until the end-user performs the login
288and provides a trusted identity through the HTTP header.
Luca Milanesio5185b042013-07-27 22:03:06 +0100289If not set, Gerrit requires the HTTP header with a trusted identity
David Pursehouse42f42042013-08-01 14:02:25 +0900290and returns the error page 'LoginRedirect.html' if such a header is not
291present.
Luca Milanesio5185b042013-07-27 22:03:06 +0100292
293[[auth.loginText]]auth.loginText::
294+
David Pursehouse42f42042013-08-01 14:02:25 +0900295Text displayed in the loginUrl link. Only used if `auth.loginUrl` is set.
Luca Milanesio5185b042013-07-27 22:03:06 +0100296+
David Pursehouse42f42042013-08-01 14:02:25 +0900297If not set, the "Sign In" text is used.
Luca Milanesio5185b042013-07-27 22:03:06 +0100298
Luca Milanesio111e0b72013-08-15 18:56:42 +0100299[[auth.registerPageUrl]]auth.registerPageUrl::
300+
David Pursehouse268744b2013-08-17 15:32:11 +0900301URL of the registration page to use when a new user logs in to Gerrit for
302the first time. Used only when `auth.type` is set to `HTTP`.
Luca Milanesio111e0b72013-08-15 18:56:42 +0100303+
304If not set, the standard Gerrit registration page `/#/register/` is displayed.
305
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700306[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700307+
308URL to redirect a browser to after the end-user has clicked on the
309"Sign Out" link in the upper right corner. Organizations using an
310enterprise single-sign-on solution may want to redirect the browser
311to the SSO product's sign-out page.
312+
313If not set, the redirect returns to the list of all open changes.
314
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800315[[auth.registerUrl]]auth.registerUrl::
316+
317Target for the "Register" link in the upper right corner. Used only
David Pursehouse42f42042013-08-01 14:02:25 +0900318when `auth.type` is `LDAP`.
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800319+
320If not set, no "Register" link is displayed.
321
Chad Horohoe65897082012-11-10 10:26:25 -0800322[[auth.registerText]]auth.registerText::
323+
324Text for the "Register" link in the upper right corner. Used only
David Pursehouse42f42042013-08-01 14:02:25 +0900325when `auth.type` is `LDAP`.
Chad Horohoe65897082012-11-10 10:26:25 -0800326+
327If not set, defaults to "Register".
328
David Pursehouse3d604492013-01-25 17:41:53 +0900329[[auth.editFullNameUrl]]auth.editFullNameUrl::
330+
331Target for the "Edit" button when the user is allowed to edit their
332full name.
333
334[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
335+
David Pursehouse42f42042013-08-01 14:02:25 +0900336Target for the "Obtain Password" link. Used only when `auth.type` is
David Pursehouse3d604492013-01-25 17:41:53 +0900337`LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700338
339[[auth.switchAccountUrl]]auth.switchAccountUrl::
David Pursehouse3d604492013-01-25 17:41:53 +0900340+
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700341URL to switch user identities and login as a different account than
342the currently active account. This is disabled by default except when
343`auth.type` is `OPENID` and `DEVELOPMENT_BECOME_ANY_ACCOUNT`. If set
344the "Switch Account" link is displayed next to "Sign Out".
345+
346When `auth.type` does not normally enable this URL administrators may
347set this to `login/` or `$canonicalWebUrl/login`, allowing users to
348begin a new web session.
David Pursehouse3d604492013-01-25 17:41:53 +0900349
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000350[[auth.cookiePath]]auth.cookiePath::
351+
352Sets "path" attribute of the authentication cookie.
353+
354If not set, HTTP request's path is used.
355
356[[auth.cookieSecure]]auth.cookieSecure::
357+
358Sets "secure" flag of the authentication cookie. If true, cookies
359will be transmitted only over HTTPS protocol.
360+
361By default, false.
362
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700363[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700364+
365Optional format string to construct user email addresses out of
David Pursehouse42f42042013-08-01 14:02:25 +0900366user login names. Only used if `auth.type` is `HTTP`, `HTTP_LDAP`
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700367or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700368+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700369This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700370with the login name. E.g. "\{0\}+gerrit@example.com" with a user
371login name of "foo" will produce "foo+gerrit@example.com" during
372the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700373+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700374If the site is using `HTTP_LDAP` or `LDAP`, using this option is
375discouraged. Setting `ldap.accountEmailAddress` and importing the
376email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700377
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700378[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700379+
380Controls whether or not the contributor agreement features are
381enabled for the Gerrit site. If enabled a user must complete a
382contributor agreement before they can upload changes.
383+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800384If enabled, the admin must also add one or more
385link:config-cla.html[contributor-agreement sections]
386in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700387`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700388more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700389+
390By default this is false (no agreements are used).
Fredrik Luthandera3cf3542012-07-04 16:55:35 -0700391+
392To enable the actual usage of contributor agreement the project
393specific config option in the `project.config` must be set:
394link:config-project-config.html[receive.requireContributorAgreement].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700395
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700396auth.allowGoogleAccountUpgrade::
397+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700398Allows Google Account users to automatically update their Gerrit
399account when/if their Google Account OpenID identity token changes.
400Identity tokens can change if the server changes hostnames, or
401for other reasons known only to Google. The upgrade path works
402by matching users by email address if the identity is not present,
403and then changing the identity.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700404+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700405This setting also permits old Gerrit 1.x users to seamlessly upgrade
406from Google Accounts on Google App Engine to OpenID authentication.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700407+
Shawn O. Pearce48eea072009-08-31 10:53:12 -0700408Having this enabled incurs an extra database query when Google
Shawn O. Pearcee31d02c2009-12-08 12:21:37 -0800409Account users register with the Gerrit server.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700410+
411By default, unset/false.
412
Christian Halstricka3d88a52011-08-31 09:21:41 +0200413[[auth.trustContainerAuth]]auth.trustContainerAuth::
414+
415If true then it is the responsibility of the container hosting
416Gerrit to authenticate users. In this case Gerrit will blindly trust
417the container.
418+
419This parameter only affects git over http traffic. If set to false
420then Gerrit will do the authentication (using DIGEST authentication).
421+
422By default this is set to false.
423
Luca Milanesio42058842012-01-05 21:25:38 +0000424[[auth.gitBasicAuth]]auth.gitBasicAuth::
425+
426If true then Git over HTTP and HTTP/S traffic is authenticated using
427standard BasicAuth and credentials validated using the same auth
428method configured for Gerrit Web UI.
429+
430This parameter only affects git over http traffic. If set to false
431then Gerrit will authenticate through DIGEST authentication and
432the randomly generated HTTP password in Gerrit DB.
433+
434By default this is set to false.
435
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200436[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
437+
438If set the username that is received to authenticate a git operation
439is converted to lower case for looking up the user account in Gerrit.
440+
441By setting this parameter a case insensitive authentication for the
442git operations can be achieved, if it is ensured that the usernames in
443Gerrit (scheme `username`) are stored in lower case (e.g. if the
444parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
445set to `${sAMAccountName.toLowerCase}`). It is important that for all
446existing accounts this username is already in lower case. It is not
447possible to convert the usernames of the existing accounts to lower
448case because this would break the access to existing per-user
449branches.
450+
451This parameter only affects git over http and git over SSH traffic.
452+
453By default this is set to false.
454
Shawn Pearcea931fe12013-06-11 12:29:17 -0700455[[auth.enableRunAs]]auth.enableRunAs::
456+
457If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
458header from any users granted the link:access-control.html#capability_runAs[Run As]
459capability. The header and capability permit the authenticated user
460to impersonate another account.
461+
462If false the feature is disabled and cannot be re-enabled without
463editing gerrit.config and restarting the server.
464+
465Default is true.
466
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700467[[cache]]Section cache
468~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700469
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700470[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700471+
472Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700473future lookup. This local disk cache is used to retain potentially
474expensive to compute information across restarts. If the location
475does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700476+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700477If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700478+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700479Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700480
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700481[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700482+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700483Maximum age to keep an entry in the cache. Entries are removed from
484the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700485Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700486+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700487* s, sec, second, seconds
488* m, min, minute, minutes
489* h, hr, hour, hours
490* d, day, days
491* w, week, weeks (`1 week` is treated as `7 days`)
492* mon, month, months (`1 month` is treated as `30 days`)
493* y, year, years (`1 year` is treated as `365 days`)
494
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700495+
Edwin Kempinabcd5042013-03-12 16:04:37 +0100496If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700497supplied, the maximum age is infinite and items are never purged
498except when the cache is full.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700499+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700500Default is `0`, meaning store forever with no expire, except:
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700501+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400502* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700503* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700504* `"web_sessions"`: default is `12 hours`
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700505
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700506[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700507+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700508The total cost of entries to retain in memory. The cost computation
509varies by the cache. For most caches where the in-memory size of each
510entry is relatively the same, memoryLimit is currently defined to be
511the number of entries held by the cache (each entry costs 1).
512+
513For caches where the size of an entry can vary significantly between
514individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
515is an approximation of the total number of bytes stored by the cache.
516Larger entries that represent bigger patch sets or longer source files
517will consume a bigger portion of the memoryLimit. For these caches the
518memoryLimit should be set to roughly the amount of RAM (in bytes) the
519administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700520+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700521Default is 1024 for most caches, except:
522+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400523* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700524* `"diff"`: default is `10m` (10 MiB of memory)
525* `"diff_intraline"`: default is `10m` (10 MiB of memory)
526* `"plugin_resources"`: default is 2m (2 MiB of memory)
527
528+
529If set to 0 the cache is disabled. Entries are removed immediately
530after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700531
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700532[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700533+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700534Total size in bytes of the keys and values stored on disk. Caches that
535have grown bigger than this size are scanned daily at 1 AM local
536server time to trim the cache. Entries are removed in least recently
537accessed order until the cache fits within this limit. Caches may
538grow larger than this during the day, as the size check is only
539performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700540+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700541Default is 128 MiB per cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700542+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700543If 0, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700544
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700545[[cache_names]]Standard Caches
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700546^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700547
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700548cache `"accounts"`::
549+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700550Cache entries contain important details of an active user, including
551their display name, preferences, known email addresses, and group
552memberships. Entry information is obtained from the following
553database tables:
554+
555* `accounts`
556+
557* `account_group_members`
558+
559* `account_external_ids`
560
561+
562If direct updates are made to any of these database tables, this
563cache should be flushed.
564
565cache `"accounts_byemail"`::
566+
567Caches account identities keyed by email address, which is scanned
568from the `account_external_ids` database table. If updates are
569made to this table, this cache should be flushed.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700570
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400571cache `"adv_bases"`::
572+
573Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900574are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400575for the client to use as potential delta bases. Push over smart HTTP
576requires two HTTP requests, and this cache tries to carry state from
577the first request into the second to ensure it can complete.
578
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200579cache `"changes"`::
580+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200581The size of `memoryLimit` determines the number of projects for which
582all changes will be cached. If the cache is set to 1024, this means all
583changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800584+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200585Default value is 0 (disabled). It is disabled by default due to the fact
586that change updates are not communicated between Gerrit servers. Hence
587this cache should be disabled in an multi-master/multi-slave setup.
Gustaf Lundh53493772012-11-18 18:41:15 -0800588+
589The cache should be flushed whenever the database changes table is modified
Matt Baker8ce12fc2013-11-26 21:43:12 -0700590outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200591
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700592cache `"diff"`::
593+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700594Each item caches the differences between two commits, at both the
595directory and file levels. Gerrit uses this cache to accelerate
596the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700597+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700598Entries in this cache are relatively large, so memoryLimit is an
599estimate in bytes of memory used. Administrators should try to target
600cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
601day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700602
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400603cache `"diff_intraline"`::
604+
605Each item caches the intraline difference of one file, when compared
606between two commits. Gerrit uses this cache to accelerate display of
607intraline differences when viewing a file.
608+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700609Entries in this cache are relatively large, so memoryLimit is an
610estimate in bytes of memory used. Administrators should try to target
611cache.diff.memoryLimit to fit all files users will view in a 1 or 2
612day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400613
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700614cache `"git_tags"`::
615+
616If branch or reference level READ access controls are used, this
617cache tracks which tags are reachable from the branch tips of a
618repository. Gerrit uses this information to determine the set
619of tags that a client may access, derived from which tags are
620part of the history of a visible branch.
621+
622The cache is persisted to disk across server restarts as it can
623be expensive to compute (60 or more seconds for a large history
624like the Linux kernel repository).
625
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700626cache `"groups"`::
627+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700628Caches the basic group information from the `account_groups` table,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700629including the group owner, name, and description.
630+
631Gerrit group membership obtained from the `account_group_members`
632table is cached under the `"accounts"` cache, above. External group
633membership obtained from LDAP is cached under `"ldap_groups"`.
634
Matt Fischer620255a2011-03-22 14:28:23 -0500635cache `"groups_byinclude"`::
636+
637Caches group inclusions in other groups. If direct updates are made
638to the `account_group_includes` table, this cache should be flushed.
639
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700640cache `"ldap_groups"`::
641+
642Caches the LDAP groups that a user belongs to, if LDAP has been
643configured on this server. This cache should be configured with a
644low maxAge setting, to ensure LDAP modifications are picked up in
645a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700646
Gustaf Lundh0919a492012-10-19 15:29:23 +0200647cache `"ldap_groups_byinclude"`::
648+
649Caches the hierarchical structure of LDAP groups.
650
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -0700651cache `"ldap_usernames"`::
652+
653Caches a mapping of LDAP username to Gerrit account identity. The
654cache automatically updates when a user first creates their account
655within Gerrit, so the cache expire time is largely irrelevant.
656
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700657cache `"permission_sort"`::
658+
David Pursehouse221d4f62012-06-08 17:38:08 +0900659Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700660reference. Sorting the sections can be expensive when regular
661expressions are used, so this cache remembers the ordering for
662each branch.
663
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700664cache `"plugin_resources"`::
665+
666Caches formatted plugin resources, such as plugin documentation that
667has been converted from Markdown to HTML. The memoryLimit refers to
668the bytes of memory dedicated to storing the documentation.
669
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700670cache `"projects"`::
671+
672Caches the project description records, from the `projects` table
673in the database. If a project record is updated or deleted, this
674cache should be flushed. Newly inserted projects do not require
675a cache flush, as they will be read upon first reference.
676
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700677cache `"sshkeys"`::
678+
679Caches unpacked versions of user SSH keys, so the internal SSH daemon
680can match against them during authentication. The unit of storage
681is per-user, so 1024 items translates to 1024 unique user accounts.
682As each individual user account may configure multiple SSH keys,
683the total number of keys may be larger than the item count.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700684+
685This cache is based off the `account_ssh_keys` table and the
686`accounts.ssh_user_name` column in the database. If either is
687modified directly, this cache should be flushed.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700688
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700689cache `"web_sessions"`::
690+
691Tracks the live user sessions coming in over HTTP. Flushing this
692cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -0700693them to sign-in again. To avoid breaking active users, this cache
694is not flushed automatically by `gerrit flush-caches --all`, but
695instead must be explicitly requested.
696+
697If no disk cache is configured (or `cache.web_sessions.diskLimit`
698is set to 0) a server restart will force all users to sign-out,
699and need to sign-in again after the restart, as the cache was
700unable to persist the session information. Enabling a disk cache
701is strongly recommended.
702+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700703Session storage is relatively inexpensive. The average entry in
704this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700705
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700706See also link:cmd-flush-caches.html[gerrit flush-caches].
707
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800708[[cache_options]]Cache Options
709^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
710
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800711cache.diff_intraline.maxIdleWorkers::
712+
713Number of idle worker threads to maintain for the intraline difference
714computations. There is no upper bound on how many concurrent requests
715can occur at once, if additional threads are started to handle a peak
David Pursehouse221d4f62012-06-08 17:38:08 +0900716load, only this many will remain idle afterwards.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800717+
718Default is 1.5x number of available CPUs.
719
720cache.diff_intraline.timeout::
721+
722Maximum number of milliseconds to wait for intraline difference data
723before giving up and disabling it for a particular file pair. This is
724a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +0900725implementation.
726+
727If computation takes longer than the timeout, the worker thread is
728terminated, an error message is shown, and no intraline difference is
729displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800730+
731Values should use common unit suffixes to express their setting:
732+
733* ms, milliseconds
734* s, sec, second, seconds
735* m, min, minute, minutes
736* h, hr, hour, hours
737
738+
739If a unit suffix is not specified, `milliseconds` is assumed.
740+
741Default is 5 seconds.
742
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800743cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800744+
745Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800746when populating a diff cache entry. This flag is provided primarily
747as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +0900748necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800749this setting will fallback to `cache.diff.intraline` if not set in the
750configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800751+
752Default is true, enabled.
753
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700754cache.projects.checkFrequency::
755+
756How often project configuration should be checked for update from Git.
757Gerrit Code Review caches project access rules and configuration in
758memory, checking the refs/meta/config branch every checkFrequency
759minutes to see if a new revision should be loaded and used for future
760access. Values can be specified using standard time unit abbreviations
761('ms', 'sec', 'min', etc.).
762+
763If set to 0, checks occur every time, which may slow down operations.
Shawn Pearcec825ef12013-02-20 11:29:46 -0800764If set to 'disabled' or 'off', no check will ever be done.
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700765Administrators may force the cache to flush with
766link:cmd-flush-caches.html[gerrit flush-caches].
767+
768Default is 5 minutes.
769
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700770[[change]]Section change
771~~~~~~~~~~~~~~~~~~~~~~~~
772
773[[change.updateDelay]]change.updateDelay::
774+
775How often in seconds the web interface should poll for updates to the
776currently open change. The poller relies on the client's browser
777cache to use If-Modified-Since and respect `304 Not Modified` HTTP
Matt Baker8ce12fc2013-11-26 21:43:12 -0700778responses. This allows for fast polls, often under 8 milliseconds.
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700779+
780With a configured 30 second delay a server with 4900 active users will
781typically need to dedicate 1 CPU to the update check. 4900 users
782divided by an average delay of 30 seconds is 163 requests arriving per
783second. If requests are served at ~6 ms response time, 1 CPU is
784necessary to keep up with the update request traffic. On a smaller
785user base of 500 active users, the default 30 second delay is only 17
786requests per second and requires ~10% CPU.
787+
788If 0 the update polling is disabled.
789+
790Default is 30 seconds.
791
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300792[[changeMerge]]Section changeMerge
Remy Bohmer203eea32012-02-19 21:21:36 +0100793~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300794
Dave Borowitz204669c22012-10-11 11:06:08 -0700795changeMerge.checkFrequency::
796+
797How often the database should be rescanned for changes that have been
798submitted but not merged due to transient errors. Values can be
799specified using standard time unit abbreviations ('ms', 'sec', 'min',
800etc.). Set to 0 to disable periodic rescanning, only scanning once on
801master node startup.
802+
803Default is 300 seconds (5 minutes).
804
805changeMerge.test::
806+
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300807Controls whether or not the mergeability test of changes is
808enabled. If enabled, when the change page is loaded, the test is
809triggered. The submit button will be enabled or disabled according to
810the result.
Dave Borowitz204669c22012-10-11 11:06:08 -0700811+
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300812By default this is false (test is not enabled).
813
Brad Larson991a31b2009-11-03 14:30:26 -0600814[[commentlink]]Section commentlink
Remy Bohmer203eea32012-02-19 21:21:36 +0100815~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Brad Larson991a31b2009-11-03 14:30:26 -0600816Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -0500817patch comments, in-line code comments and approval category value descriptions
818to turn set strings into hyperlinks. One common use is for linking to
819bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -0600820
821In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800822will match typical Gerrit Change-Id values and create a hyperlink
823to changes which reference it. The second configuration 'bugzilla'
824will hyperlink terms such as 'bug 42' to an external bug tracker,
825supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +0900826configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800827how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -0600828
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800829----
830[commentlink "changeid"]
831 match = (I[0-9a-f]{8,40})
832 link = "#q,$1,n,z"
Brad Larson991a31b2009-11-03 14:30:26 -0600833
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800834[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -0800835 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800836 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -0600837
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800838[commentlink "tracker"]
839 match = ([Bb]ug:\\s+)(\\d+)
840 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
841----
842
Dave Borowitz13b38002013-04-08 12:03:29 -0700843Comment links can also be specified in `project.config` and sections in
844children override those in parents. The only restriction is that to
845avoid injecting arbitrary user-supplied HTML in the page, comment links
846defined in `project.config` may only supply `link`, not `html`.
847
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800848[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -0600849+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800850A JavaScript regular expression to match positions to be replaced
851with a hyperlink. Subexpressions of the matched string can be
852stored using groups and accessed with `$'n'` syntax, where 'n'
853is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -0600854+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -0800855The configuration file parser eats one level of backslashes, so the
856character class `\s` requires `\\s` in the configuration file. The
857parser also terminates the line at the first `#`, so a match
858expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800859+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -0800860To match case insensitive strings, a character class with both the
861upper and lower case character for each position must be used. For
862example, to match the string `bug` in a case insensitive way the match
863pattern `[bB][uU][gG]` needs to be used.
864+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800865A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -0600866
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800867[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -0600868+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800869The URL to direct the user to whenever the regular expression is
870matched. Groups in the match expression may be accessed as `$'n'`.
871+
872The link property is used only when the html property is not present.
873
874[[commentlink.name.html]]commentlink.<name>.html::
875+
876HTML to replace the entire matched string with. If present,
877this property overrides the link property above. Groups in the
878match expression may be accessed as `$'n'`.
879+
880The configuration file eats double quotes, so escaping them as
881`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -0600882
Dave Borowitz82d79c02013-04-08 15:45:12 -0700883[[commentlink.name.enabled]]commentlink.<name>.enabled::
884+
885Whether the comment link is enabled. A child project may override a
886section in a parent or the site-wide config that is disabled by
887specifying `enabled = true`.
888+
889Disabling sections in `gerrit.config` can be used by site administrators
890to create a library of comment links with `html` set that are not
891user-supplied and thus can be verified to be XSS-free, but are only
892enabled for a subset of projects.
893+
894Note that the names and contents of disabled sections are visible even
895to anonymous users via the
896link:rest-api-projects.html#get-config[REST API].
897
Brad Larson991a31b2009-11-03 14:30:26 -0600898
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700899[[contactstore]]Section contactstore
900~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700901
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700902[[contactstore.url]]contactstore.url::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700903+
904URL of the web based contact store Gerrit will send any offline
905contact information to when it collects the data from users as part
906of a contributor agreement.
907+
908See link:config-contact.html[Contact Information].
909
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700910[[contactstore.appsec]]contactstore.appsec::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700911+
912Shared secret of the web based contact store.
913
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -0800914
915[[container]]Section container
916~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
917
918These settings are applied only if Gerrit is started as the container
919process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
920
921[[container.heapLimit]]container.heapLimit::
922+
923Maximum heap size of the Java process running Gerrit, in bytes.
924This property is translated into the '-Xmx' flag for the JVM.
925+
926Default is platform and JVM specific.
927+
928Common unit suffixes of 'k', 'm', or 'g' are supported.
929
930[[container.javaHome]]container.javaHome::
931+
932Path of the JRE/JDK installation to run Gerrit with. If not set, the
933Gerrit startup script will attempt to search your system and guess
934a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
935
936[[container.javaOptions]]container.javaOptions::
937+
938Additional options to pass along to the Java runtime. If multiple
939values are configured, they are passed in order on the command line,
940separated by spaces. These options are appended onto 'JAVA_OPTIONS'.
941
David Ostrovskyc772bd82013-10-03 10:37:51 +0200942For example, it is possible to overwrite Gerrit's default log4j
943configuration:
944
945----
946 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
947----
948
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +0200949[[container.slave]]container.slave::
950+
951Used on Gerrit slave installations. If set to true the Gerrit JVM is
952called with the '--slave' switch, enabling slave mode. If no value is
Matt Baker8ce12fc2013-11-26 21:43:12 -0700953set (or any other value), Gerrit defaults to master mode.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +0200954
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -0800955[[container.user]]container.user::
956+
957Login name (or UID) of the operating system user the Gerrit JVM
958will execute as. If not set, defaults to the user who launched
959the 'gerrit.sh' wrapper script.
960
961[[container.war]]container.war::
962+
963Path of the JAR file to start daemon execution with. This should
964be the path of the local 'gerrit.war' archive. Overrides the
965environment variable 'GERRIT_WAR'.
966+
967If not set, defaults to '$site_path/bin/gerrit.war', or to
968'$HOME/gerrit.war'.
969
970
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -0700971[[core]]Section core
972~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700973
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700974[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700975+
976Number of bytes of a pack file to load into memory in a single
977read operation. This is the "page size" of the JGit buffer cache,
978used for all pack access operations. All disk IO occurs as single
979window reads. Setting this too large may cause the process to load
980more data than is required; setting this too small may increase
981the frequency of `read()` system calls.
982+
983Default on JGit is 8 KiB on all platforms.
984+
985Common unit suffixes of 'k', 'm', or 'g' are supported.
986
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700987[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700988+
989Maximum number of bytes to load and cache in memory from pack files.
990If JGit needs to access more than this many bytes it will unload less
991frequently used windows to reclaim memory space within the process.
992As this buffer must be shared with the rest of the JVM heap, it
993should be a fraction of the total memory available.
994+
995Default on JGit is 10 MiB on all platforms.
996+
997Common unit suffixes of 'k', 'm', or 'g' are supported.
998
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700999[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001000+
1001Maximum number of bytes to reserve for caching base objects
1002that multiple deltafied objects reference. By storing the entire
1003decompressed base object in a cache Git is able to avoid unpacking
1004and decompressing frequently used base objects multiple times.
1005+
1006Default on JGit is 10 MiB on all platforms. You probably do not
1007need to adjust this value.
1008+
1009Common unit suffixes of 'k', 'm', or 'g' are supported.
1010
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001011[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001012+
1013Maximum number of pack files to have open at once. A pack file
1014must be opened in order for any of its data to be available in
1015a cached window.
1016+
1017If you increase this to a larger setting you may need to also adjust
1018the ulimit on file descriptors for the host JVM, as Gerrit needs
1019additional file descriptors available for network sockets and other
1020repository data manipulation.
1021+
1022Default on JGit is 128 file descriptors on all platforms.
1023
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001024[[core.streamFileThreshold]]core.streamFileThreshold::
1025+
1026Largest object size, in bytes, that JGit will allocate as a
1027contiguous byte array. Any file revision larger than this threshold
1028will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001029files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001030during delta decompression.
1031+
1032Servers with very high traffic should set this to be larger than
1033the size of their common big files. For example a server managing
1034the Android platform typically has to deal with ~10-12 MiB XML
1035files, so `15 m` would be a reasonable setting in that environment.
1036Setting this too high may cause the JVM to run out of heap space
1037when handling very big binary files, such as device firmware or
1038CD-ROM ISO images.
1039+
Shawn O. Pearcee3febd92010-10-13 21:17:53 -07001040Default is 50 MiB on all platforms. Prior to Gerrit 2.1.6,
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001041this value was effectively 2047 MiB.
1042+
1043Common unit suffixes of 'k', 'm', or 'g' are supported.
1044
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001045[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001046+
1047When true, JGit will use `mmap()` rather than `malloc()+read()`
1048to load data from pack files. The use of mmap can be problematic
1049on some JVMs as the garbage collector must deduce that a memory
1050mapped segment is no longer in use before a call to `munmap()`
1051can be made by the JVM native code.
1052+
1053In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001054pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001055of virtual address space, as the garbage collector cannot reclaim
1056unused mapped spaces fast enough.
1057+
1058Default on JGit is false. Although potentially slower, it yields
1059much more predictable behavior.
1060
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001061[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1062+
1063Size of the buffer to store logging events for asynchronous logging.
1064Putting a larger value can protect threads from stalling when the
1065AsyncAppender threads are not fast enough to consume the logging events
1066from the buffer. It also protects from loosing log entries in this case.
1067+
1068Default is 64 entries.
1069
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001070[[core.useRecursiveMerge]]core.useRecursiveMerge::
1071+
1072Use JGit's new, experimental recursive merger for three-way merges.
1073This only affects projects configured to automatically resolve
1074conflicts.
1075+
1076Default is false, but in a future release may default to true.
1077
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001078[[database]]Section database
1079~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1080
1081The database section configures where Gerrit stores its metadata
1082records about user accounts and change reviews.
1083
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001084----
1085[database]
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001086 type = POSTGRESQL
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001087 hostname = localhost
1088 database = reviewdb
1089 username = gerrit2
1090 password = s3kr3t
1091----
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001092
1093[[database.type]]database.type::
1094+
1095Type of database server to connect to. If set this value will be
1096used to automatically create correct database.driver and database.url
1097values to open the connection.
1098+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001099* `POSTGRESQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001100+
1101Connect to a PostgreSQL database server.
1102+
1103* `H2`
1104+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001105Connect to a local embedded H2 database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001106+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001107* `MYSQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001108+
1109Connect to a MySQL database server.
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001110+
1111* `JDBC`
1112+
1113Connect using a JDBC driver class name and URL.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001114
1115+
1116If not specified, database.driver and database.url are used as-is,
1117and if they are also not specified, defaults to H2.
1118
1119[[database.hostname]]database.hostname::
1120+
1121Hostname of the database server. Defaults to 'localhost'.
1122
1123[[database.port]]database.port::
1124+
1125Port number of the database server. Defaults to the default port
1126of the server named by database.type.
1127
1128[[database.database]]database.database::
1129+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001130For POSTGRESQL or MYSQL, the name of the database on the server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001131+
1132For H2, this is the path to the database, and if not absolute is
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001133relative to `'$site_path'`.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001134
1135[[database.username]]database.username::
1136+
1137Username to connect to the database server as.
1138
1139[[database.password]]database.password::
1140+
1141Password to authenticate to the database server with.
1142
1143[[database.driver]]database.driver::
1144+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001145Name of the JDBC driver class to connect to the database with.
1146Setting this usually isn't necessary as it can be derived from
1147database.type or database.url for any supported database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001148
1149[[database.url]]database.url::
1150+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001151'jdbc:' URL for the database. Setting this variable usually
1152isn't necessary as it can be constructed from the all of the
1153above properties.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001154
Christian Aistleitner851072a2013-05-05 15:04:09 +02001155[[database.connectionPool]]database.connectionPool::
1156+
1157If true, use connection pooling for database connections. Otherwise, a
1158new database connection is opened for each request.
1159+
1160Default is false for MySQL, and true for other database backends.
1161
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001162[[database.poolLimit]]database.poolLimit::
1163+
1164Maximum number of open database connections. If the server needs
1165more than this number, request processing threads will wait up
1166to <<database.poolMaxWait, poolMaxWait>> seconds for a
1167connection to be released before they abort with an exception.
1168This limit must be several units higher than the total number of
1169httpd and sshd threads as some request processing code paths may
1170need multiple connections.
1171+
1172Default is 8.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001173+
1174This setting only applies if
1175<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001176
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001177[[database.poolMinIdle]]database.poolMinIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001178+
1179Minimum number of connections to keep idle in the pool.
1180Default is 4.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001181+
1182This setting only applies if
1183<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001184
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001185[[database.poolMaxIdle]]database.poolMaxIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001186+
1187Maximum number of connections to keep idle in the pool. If there
1188are more idle connections, connections will be closed instead of
1189being returned back to the pool.
1190Default is 4.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001191+
1192This setting only applies if
1193<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001194
1195[[database.poolMaxWait]]database.poolMaxWait::
1196+
1197Maximum amount of time a request processing thread will wait to
1198acquire a database connection from the pool. If no connection is
1199released within this time period, the processing thread will abort
1200its current operations and return an error to the client.
1201Values should use common unit suffixes to express their setting:
1202+
1203* ms, milliseconds
1204* s, sec, second, seconds
1205* m, min, minute, minutes
1206* h, hr, hour, hours
1207
1208+
1209If a unit suffix is not specified, `milliseconds` is assumed.
1210+
1211Default is `30 seconds`.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001212+
1213This setting only applies if
1214<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001215
monica.dionisio3f630442010-06-29 15:42:57 -03001216[[download]]Section download
Nasser Grainawib9a50372010-08-10 07:57:47 -06001217~~~~~~~~~~~~~~~~~~~~~~~~~~~~
monica.dionisio3f630442010-06-29 15:42:57 -03001218
1219----
1220[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001221 command = checkout
1222 command = cherry_pick
1223 command = pull
1224 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001225 scheme = ssh
1226 scheme = http
1227 scheme = anon_http
1228 scheme = anon_git
1229 scheme = repo_download
1230----
1231
1232The download section configures the allowed download methods.
1233
Edwin Kempin08b03a22012-09-14 16:32:57 +02001234[[download.command]]download.command::
1235+
1236Commands that should be offered to download changes.
1237+
1238Multiple commands are supported:
1239+
1240* `checkout`
1241+
1242Command to fetch and checkout the patch set.
1243+
1244* `cherry_pick`
1245+
1246Command to fetch the patch set and to cherry-pick it onto the current
1247commit.
1248+
1249* `pull`
1250+
1251Command to pull the patch set.
1252+
1253* `format_patch`
1254+
1255Command to fetch the patch set and to feed it into the `format-patch`
1256command.
1257
1258+
1259If `download.command` is not specified, all download commands are
1260offered.
1261
monica.dionisio3f630442010-06-29 15:42:57 -03001262[[download.scheme]]download.scheme::
1263+
1264Schemes that should be used to download changes.
1265+
1266Multiple schemes are supported:
1267+
1268* `http`
1269+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001270Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001271+
1272* `ssh`
1273+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001274Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001275+
1276* `anon_http`
1277+
1278Anonymous HTTP download is allowed.
1279+
1280* `anon_git`
1281+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001282Anonymous Git download is allowed. This is not default, it is also
1283necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1284variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001285+
1286* `repo_download`
1287+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001288Gerrit advertises patch set downloads with the `repo download`
1289command, assuming that all projects managed by this instance are
1290generally worked on with the repo multi-repository tool. This is
1291not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001292
1293+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001294If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001295downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001296
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07001297[[gerrit]]Section gerrit
1298~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001299
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001300[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001301+
1302Local filesystem directory holding all Git repositories that
1303Gerrit knows about and can process changes for. A project
1304entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02001305the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001306+
1307If relative, the path is resolved relative to `'$site_path'`.
1308
Shawn O. Pearce897d9212011-06-16 16:59:59 -07001309[[gerrit.allProjects]]gerrit.allProjects::
1310+
1311Name of the permissions-only project defining global server
1312access controls and settings. These are inherited into every
1313other project managed by the running server. The name is
1314relative to `gerrit.basePath`.
1315+
1316Defaults to `All-Projects` if not set.
1317
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001318[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001319+
1320The default URL for Gerrit to be accessed through.
1321+
1322Typically this would be set to "http://review.example.com/" or
1323"http://example.com/gerrit/" so Gerrit can output links that point
1324back to itself.
1325+
1326Setting this is highly recommended, as its necessary for the upload
1327code invoked by "git push" or "repo upload" to output hyperlinks
1328to the newly uploaded changes.
1329
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001330[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001331+
1332Optional base URL for repositories available over the anonymous git
1333protocol. For example, set this to `git://mirror.example.com/base/`
1334to have Gerrit display patch set download URLs in the UI. Gerrit
1335automatically appends the project name onto the end of the URL.
1336+
1337By default unset, as the git daemon must be configured externally
1338by the system administrator, and might not even be running on the
1339same host as Gerrit.
1340
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001341[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
1342+
1343Optional command to install the `commit-msg` hook. Typically of the
1344form:
1345----
1346fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
1347----
Shawn Pearce6d731f52013-09-24 12:13:50 -07001348
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001349+
1350By default unset; falls back to using scp from the canonical SSH host,
1351or curl from the canonical HTTP URL for the server. Only necessary if a
1352proxy or other server/network configuration prevents clients from
1353fetching from the default location.
1354
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07001355[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
1356+
1357Optional base URL for repositories available over the HTTP
1358protocol. For example, set this to `http://mirror.example.com/base/`
1359to have Gerrit display URLs from this server, rather than itself.
1360+
1361By default unset, as the HTTP daemon must be configured externally
1362by the system administrator, and might not even be running on the
1363same host as Gerrit.
1364
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07001365[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
1366+
1367URL to direct users to when they need to report a bug about the
1368Gerrit service. By default this links to the upstream Gerrit
1369Code Review's own bug tracker but could be directed to the system
1370administrator's ticket queue.
1371
Shawn Pearce6d731f52013-09-24 12:13:50 -07001372[[gerrit.changeScreen]]gerrit.changeScreen::
1373+
1374Default change screen UI to direct users to. Valid values are
1375`OLD_UI` and `CHANGE_SCREEN2`. Default is `OLD_UI`.
1376
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07001377[[gitweb]]Section gitweb
1378~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001379
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001380Gerrit can forward requests to either an internally managed gitweb
1381(which allows Gerrit to enforce some access controls), or to an
1382externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001383See also link:config-gitweb.html[Gitweb Integration].
1384
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001385[[gitweb.cgi]]gitweb.cgi::
1386+
1387Path to the locally installed `gitweb.cgi` executable. This CGI will
1388be called by Gerrit Code Review when the URL `/gitweb` is accessed.
1389Project level access controls are enforced prior to calling the CGI.
1390+
1391Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if gitweb.url is not set.
1392
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001393[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001394+
1395Optional URL of an affiliated gitweb service. Defines the
1396web location where a `gitweb.cgi` is installed to browse
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001397gerrit.basePath and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001398+
1399Gerrit appends any necessary query arguments onto the end of this URL.
1400For example, "?p=$project.git;h=$commit".
1401
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001402[[gitweb.type]]gitweb.type::
1403+
1404Optional type of affiliated gitweb service. This allows using
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001405alternatives to gitweb, such as cgit. If set to disabled there
1406is no gitweb hyperlinking support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001407+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001408Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001409
Edwin Kempind86909c2012-03-26 10:36:29 +02001410[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001411+
1412Optional pattern to use for constructing the gitweb URL when pointing
1413at a specific commit when `custom` is used above.
1414+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001415Valid replacements are `${project}` for the project name in Gerrit
1416and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001417
Edwin Kempind86909c2012-03-26 10:36:29 +02001418[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001419+
1420Optional pattern to use for constructing the gitweb URL when pointing
1421at a specific project when `custom` is used above.
1422+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001423Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001424
Edwin Kempind86909c2012-03-26 10:36:29 +02001425[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001426+
1427Optional pattern to use for constructing the gitweb URL when pointing
1428at a specific branch when `custom` is used above.
1429+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001430Valid replacements are `${project}` for the project name in Gerrit
1431and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001432
Edwin Kempin64011562012-03-26 10:50:12 +02001433[[gitweb.filehistory]]gitweb.filehistory::
1434+
1435Optional pattern to use for constructing the gitweb URL when pointing
1436at the history of a file in a specific branch when `custom` is used
1437above.
1438+
1439Valid replacements are `${project}` for the project name in Gerrit,
1440`${file}` for the file name and `${branch}` for the name of the
1441branch.
1442
Gustaf Lundha07d2e72011-10-27 15:26:35 -07001443[[gitweb.linkname]]gitweb.linkname::
1444+
1445Optional setting for modifying the link name presented to the user
1446in the Gerrit web-UI.
1447+
1448Default linkname for custom type is "gitweb".
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001449
Adrian Goerlerf2007072011-11-10 08:39:55 +01001450[[gitweb.pathSeparator]]gitweb.pathSeparator::
1451+
1452Optional character to substitute the standard path separator (slash) in
1453project names and branch names.
1454+
1455By default, Gerrit will use hexadecimal encoding for slashes in project and
1456branch names. Some web servers, such as Tomcat, reject this hexadecimal
1457encoding in the URL.
1458+
1459Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
1460allow using an alternative path separator character. In Gitblit, this can be
1461configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
1462In Gerrit, the alternative path separator can be configured correspondingly
1463using the property 'gitweb.pathSeparator'.
1464+
1465Valid values are the characters '*', '(' and ')'.
1466
Luca Milanesio25312032013-10-11 11:34:39 +01001467[[gitweb.linkDrafts]]gitweb.urlEncode::
1468+
1469Whether or not Gerrit should encode the generated viewer URL.
1470+
1471Gerrit composes the viewer URL using information about the project, branch, file
1472or commit of the target object to be displayed. Typically viewers such as CGit
1473and GitWeb do need those parts to be encoded, including the '/' in project's name,
1474for being correctly parsed.
1475However other viewers could instead require an unencoded URL (e.g. GitHub web
1476based viewer)
1477+
1478Valid values are "true" and "false," default is "true."
1479
Chad Horohoe1dfe36c2013-04-12 14:52:56 -04001480[[gitweb.linkDrafts]]gitweb.linkDrafts::
1481+
1482Whether or not Gerrit should provide links to gitweb on draft patch sets.
1483+
1484By default, Gerrit will show links to gitweb on all patch sets. If gitweb
1485only allows publicly viewable references, set this to false to remove
1486the links to draft patch sets from the change review screen.
1487+
Luca Milanesio25312032013-10-11 11:34:39 +01001488Valid values are "true" and "false," default is "true".
Chad Horohoe1dfe36c2013-04-12 14:52:56 -04001489
Edwin Kempin4bbff702013-01-11 09:59:53 +01001490[[groups]]Section groups
1491~~~~~~~~~~~~~~~~~~~~~~~~
1492
1493[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
1494+
1495Controls whether newly created groups should be by default visible to
1496all registered users.
1497+
1498By default, false.
1499
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001500[[hooks]]Section hooks
Remy Bohmer203eea32012-02-19 21:21:36 +01001501~~~~~~~~~~~~~~~~~~~~~~
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001502
1503See also link:config-hooks.html[Hooks].
1504
1505[[hooks.path]]hooks.path::
1506+
1507Optional path to hooks, if not specified then `'$site_path'/hooks` will be used.
1508
1509[[hooks.patchsetCreatedHook]]hooks.patchsetCreatedHook::
1510+
1511Optional filename for the patchset created hook, if not specified then
1512`patchset-created` will be used.
1513
David Pursehoused556c192012-06-12 18:34:37 +09001514[[hooks.draftPublishedHook]]hooks.draftPublishedHook::
1515+
1516Optional filename for the draft published hook, if not specified then
1517`draft-published` will be used.
1518
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001519[[hooks.commentAddedHook]]hooks.commentAddedHook::
1520+
1521Optional filename for the comment added hook, if not specified then
1522`comment-added` will be used.
1523
1524[[hooks.changeMergedHook]]hooks.changeMergedHook::
1525+
1526Optional filename for the change merged hook, if not specified then
1527`change-merged` will be used.
1528
David Pursehousef9f3b272012-09-28 19:58:59 +09001529[[hooks.mergeFailedHook]]hooks.mergeFailedHook::
1530+
1531Optional filename for the merge failed hook, if not specified then
1532`merge-failed` will be used.
1533
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001534[[hooks.changeAbandonedHook]]hooks.changeAbandonedHook::
1535+
1536Optional filename for the change abandoned hook, if not specified then
1537`change-abandoned` will be used.
1538
David Pursehousea93c9302012-06-15 16:29:26 +09001539[[hooks.changeRestoredHook]]hooks.changeRestoredHook::
1540+
1541Optional filename for the change restored hook, if not specified then
1542`change-restored` will be used.
1543
1544[[hooks.refUpdatedHook]]hooks.refUpdatedHook::
1545+
1546Optional filename for the ref updated hook, if not specified then
1547`ref-updated` will be used.
1548
David Pursehouse2336bd82012-09-21 12:50:19 +09001549[[hooks.reviewerAddedHook]]hooks.reviewerAddedHook::
1550+
1551Optional filename for the reviewer added hook, if not specified then
1552`reviewer-added` will be used.
1553
David Pursehouseba3e28d2013-07-12 14:48:51 +09001554[[hooks.topicChangedHook]]hooks.topicChangedHook::
1555+
1556Optional filename for the topic changed hook, if not specified then
1557`topic-changed` will be used.
1558
David Pursehousea93c9302012-06-15 16:29:26 +09001559[[hooks.claSignedHook]]hooks.claSignedHook::
1560+
1561Optional filename for the CLA signed hook, if not specified then
1562`cla-signed` will be used.
1563
Chris Harrisf736d6c2012-11-21 09:35:56 -05001564[[hooks.refUpdateHook]]hooks.refUpdateHook::
1565+
1566Optional filename for the ref update hook, if not specified then
1567`ref-update` will be used.
1568
1569[[hooks.syncHookTimeout]]hooks.syncHookTimeout::
David Pursehouse6fdc8d92012-11-28 12:34:18 +09001570+
1571Optional timeout value in seconds for synchronous hooks, if not specified
Chris Harrisf736d6c2012-11-21 09:35:56 -05001572then 30 seconds will be used.
1573
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001574[[http]]Section http
1575~~~~~~~~~~~~~~~~~~~~
1576
1577[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001578+
1579URL of the proxy server when making outgoing HTTP
1580connections for OpenID login transactions. Syntax
1581should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001582
1583[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001584+
1585Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02001586This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001587appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001588
1589[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001590+
1591Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02001592This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001593appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001594
1595
1596[[httpd]]Section httpd
1597~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001598
1599The httpd section configures the embedded servlet container.
1600
1601[[httpd.listenUrl]]httpd.listenUrl::
1602+
1603Specifies the URLs the internal HTTP daemon should listen for
Edwin Kempincdb0e002011-09-08 14:23:30 +02001604connections on. The special hostname '*' may be used to listen
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001605on all local addresses. A context path may optionally be included,
1606placing Gerrit Code Review's web address within a subdirectory of
1607the server.
1608+
1609Multiple protocol schemes are supported:
1610+
1611* `http://`'hostname'`:`'port'
1612+
1613Plain-text HTTP protocol. If port is not supplied, defaults to 80,
1614the standard HTTP port.
1615+
1616* `https://`'hostname'`:`'port'
1617+
1618SSL encrypted HTTP protocol. If port is not supplied, defaults to
1619443, the standard HTTPS port.
1620+
1621Externally facing production sites are encouraged to use a reverse
1622proxy configuration and `proxy-https://` (below), rather than using
1623the embedded servlet container to implement the SSL processing.
1624The proxy server with SSL support is probably easier to configure,
1625provides more configuration options to control cipher usage, and
1626is likely using natively compiled encryption algorithms, resulting
1627in higher throughput.
1628+
1629* `proxy-http://`'hostname'`:`'port'
1630+
1631Plain-text HTTP relayed from a reverse proxy. If port is not
1632supplied, defaults to 8080.
1633+
1634Like http, but additional header parsing features are
1635enabled to honor X-Forwarded-For, X-Forwarded-Host and
1636X-Forwarded-Server. These headers are typically set by Apache's
1637link:http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers[mod_proxy].
1638+
1639* `proxy-https://`'hostname'`:`'port'
1640+
1641Plain text HTTP relayed from a reverse proxy that has already
1642handled the SSL encryption/decryption. If port is not supplied,
1643defaults to 8080.
1644+
1645Behaves exactly like proxy-http, but also sets the scheme to assume
1646'https://' is the proper URL back to the server.
1647
1648+
1649If multiple values are supplied, the daemon will listen on all
1650of them.
1651+
1652By default, http://*:8080.
1653
1654[[httpd.reuseAddress]]httpd.reuseAddress::
1655+
1656If true, permits the daemon to bind to the port even if the port
1657is already in use. If false, the daemon ensures the port is not
1658in use before starting. Busy sites may need to set this to true
1659to permit fast restarts.
1660+
1661By default, true.
1662
1663[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
1664+
1665Size, in bytes, of the buffer used to parse the HTTP headers of an
1666incoming HTTP request. The entire request headers, including any
1667cookies sent by the browser, must fit within this buffer, otherwise
1668the server aborts with the response '413 Request Entity Too Large'.
1669+
1670One buffer of this size is allocated per active connection.
1671Allocating a buffer that is too large wastes memory that cannot be
1672reclaimed, allocating a buffer that is too small may cause unexpected
1673errors caused by very long Referer URLs or large cookie values.
1674+
1675By default, 16384 (16 K), which is sufficient for most OpenID and
1676other web-based single-sign-on integrations.
1677
Chulho Yangb72ff8f2013-07-04 02:35:53 -04001678[[httpd.sslCrl]]httpd.sslCrl::
1679+
1680Path of the certificate revocation list file in PEM format. This
1681crl file is optional, and available for CLIENT_SSL_CERT_LDAP
1682authentication.
1683+
1684To create and view a crl using openssl:
1685+
1686----
1687openssl ca -gencrl -out crl.pem
1688openssl crl -in crl.pem -text
1689----
1690+
1691If not absolute, the path is resolved relative to `$site_path`.
1692+
1693By default, `$site_path/etc/crl.pem`.
1694
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001695[[httpd.sslKeyStore]]httpd.sslKeyStore::
1696+
1697Path of the Java keystore containing the server's SSL certificate
1698and private key. This keystore is required for `https://` in URL.
1699+
1700To create a self-signed certificate for simple internal usage:
1701+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001702----
1703keytool -keystore keystore -alias jetty -genkey -keyalg RSA
1704chmod 600 keystore
1705----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001706+
1707If not absolute, the path is resolved relative to `$site_path`.
1708+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08001709By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001710
1711[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
1712+
1713Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09001714Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001715doesn't want to enable one.
1716+
1717If set to the empty string the embedded server will prompt for the
1718password during startup.
1719+
1720By default, `gerrit`.
1721
Shawn O. Pearce1766f502010-01-15 10:49:46 -08001722[[httpd.requestLog]]httpd.requestLog::
1723+
1724Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
1725If enabled, an NCSA combined log format request log file is written
1726out by the internal HTTP daemon.
1727+
1728By default, true if httpd.listenUrl uses http:// or https://,
1729and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
1730
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001731[[httpd.acceptorThreads]]httpd.acceptorThreads::
1732+
1733Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09001734connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001735+
1736By default, 2, which should be suitable for most high-traffic sites.
1737
1738[[httpd.minThreads]]httpd.minThreads::
1739+
1740Minimum number of spare threads to keep in the worker thread pool.
1741This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09001742multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001743+
1744By default, 5, suitable for most lower-volume traffic sites.
1745
1746[[httpd.maxThreads]]httpd.maxThreads::
1747+
1748Maximum number of threads to permit in the worker thread pool.
1749+
1750By default 25, suitable for most lower-volume traffic sites.
1751
1752[[httpd.maxQueued]]httpd.maxQueued::
1753+
1754Maximum number of client connections which can enter the worker
1755thread pool waiting for a worker thread to become available.
17560 disables the queue and permits infinite number of connections.
1757+
1758By default 50.
1759
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08001760[[httpd.maxWait]]httpd.maxWait::
1761+
David Pursehouse221d4f62012-06-08 17:38:08 +09001762Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08001763thread to handle a project clone, fetch or push request over the
1764smart HTTP transport.
1765+
1766Values should use common unit suffixes to express their setting:
1767+
1768* s, sec, second, seconds
1769* m, min, minute, minutes
1770* h, hr, hour, hours
1771* d, day, days
1772* w, week, weeks (`1 week` is treated as `7 days`)
1773* mon, month, months (`1 month` is treated as `30 days`)
1774* y, year, years (`1 year` is treated as `365 days`)
1775
1776+
1777If a unit suffix is not specified, `minutes` is assumed. If 0
1778is supplied, the maximum age is infinite and connections will not
1779abort until the client disconnects.
1780+
1781By default, 5 minutes.
1782
Luca Milanesioce7b7452013-06-18 11:40:49 +01001783[[httpd.filterClass]]httpd.filterClass::
1784+
1785Class that implements the javax.servlet.Filter interface
1786for filtering any HTTP related traffic going through the Gerrit
1787HTTP protocol.
1788Class is loaded and configured in the Gerrit Jetty container
1789and run in front of all Gerrit URL handlers, allowing the filter
1790to inspect, modify, allow or reject each request.
1791It needs to be provided as JAR library
1792under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
1793loader and cannot be dynamically loaded by a plugin.
1794+
1795Failing to load the Filter class would result in a Gerrit start-up
1796failure, as this class is supposed to provide mandatory filtering
1797in front of Gerrit HTTP protocol.
1798+
David Pursehouse42f42042013-08-01 14:02:25 +09001799Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01001800of an Apache HTTP proxy layer as security enforcement on top of Gerrit
1801by returning a trusted username as HTTP Header.
1802+
1803Example of using a security library secure.jar under $GERRIT_SITE/lib
1804that provides a org.anyorg.MySecureFilter Servlet Filter that enforces
1805a trusted username in the `TRUSTED_USER` HTTP Header:
1806
1807----
1808[auth]
1809type = HTTP
1810httpHeader = TRUSTED_USER
1811
1812[http]
1813filterClass = org.anyorg.MySecureFilter
1814----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001815
Juan Hernandezec512562013-08-06 16:30:50 +02001816[[httpd.robotsFile]]httpd.robotsFile::
1817+
1818Location of an external robots.txt file to be used instead of the one
1819bundled with the .war of the application.
1820+
1821If not absolute, the path is resolved relative to `$site_path`.
1822+
1823If the file doesn't exist or can't be read the default robots.txt file
1824bundled with the .war will be used instead.
1825
David Pursehouse6d458432013-08-23 16:17:18 +09001826[[index]]Section index
1827~~~~~~~~~~~~~~~~~~~~~~
1828
1829The index section configures the secondary index.
1830
David Pursehouse3fc5ee32014-03-17 18:35:32 +09001831Note that after enabling the secondary index, the index must be built
1832using the link:pgm-reindex.html[reindex program] before restarting the
1833Gerrit server.
1834
1835Open and closed changes are indexed in separate indexes named
1836'changes_open' and 'changes_closed' respectively.
1837
David Pursehouse6d458432013-08-23 16:17:18 +09001838[[index.type]]index.type::
1839+
1840Type of secondary indexing employed by Gerrit. The supported
1841values are:
1842+
1843* `LUCENE`
1844+
1845A link:http://lucene.apache.org/[Lucene] index is used.
1846+
1847* `SOLR`
1848+
1849A link:http://lucene.apache.org/solr/[Solr] index is used.
1850+
1851* `SQL`
1852+
1853No secondary index. Not all query operators are supported. Other
1854query operators are routed through the standard SQL query engine.
1855
1856+
1857By default, `SQL`.
David Pursehouse15c43282013-12-04 13:32:59 +09001858
David Pursehouse904db302014-03-17 18:55:38 +09001859[[index.threads]]index.threads::
1860+
1861Determines the number of threads to use for indexing.
1862+
1863Defaults to 1 if not set, or set to a negative value.
1864
David Pursehouse00c82142014-01-22 17:41:09 +09001865[[index.name.ramBufferSize]]index.name.ramBufferSize::
1866+
1867Only used when the type is `LUCENE`.
1868+
1869Determines the amount of RAM that may be used for buffering added documents
1870and deletions before they are flushed to the index. See the
1871link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
1872Lucene documentation] for further details.
1873+
1874Defaults to 16M.
1875
1876[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
1877+
1878Only used when the type is `LUCENE`.
1879+
1880Determines the minimal number of documents required before the buffered
1881in-memory documents are flushed to the index. Large values generally
1882give faster indexing. See the
1883link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
1884Lucene documentation] for further details.
1885+
1886Defaults to -1, meaning no maximum is set and the writer will flush
1887according to RAM usage.
1888
Dave Borowitzd08b0452014-02-13 11:56:03 -08001889[[index.name.commitWithin]]index.name.commitWithin::
1890+
1891Only used when the type is `LUCENE`.
1892+
1893Determines the period at which changes are automatically committed to
1894stable store on disk. This is a costly operation and may block
1895additional index writes, so lower with caution.
1896+
Bruce Zuaf058e62014-03-21 10:03:05 +08001897If zero, changes are committed after every write. This is very costly
1898but may be useful if offline reindexing is infeasible, or for development
1899servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08001900+
Bruce Zuaf058e62014-03-21 10:03:05 +08001901Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1902`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07001903+
Bruce Zuaf058e62014-03-21 10:03:05 +08001904If negative, `commitWithin` is disabled. Changes are flushed to disk when
1905the in-memory buffer fills, but only committed and guaranteed to be synced
1906to disk when the process finishes.
David Pursehouse3cd6de02014-03-14 16:13:56 +09001907
Dave Borowitzd08b0452014-02-13 11:56:03 -08001908Defaults to 300000 ms (5 minutes).
1909
David Pursehouse00c82142014-01-22 17:41:09 +09001910Sample index configuration:
1911----
1912[index]
1913 type = LUCENE
1914
1915[index "changes_open"]
1916 ramBufferSize = 60 m
1917 maxBufferedDocs = 3000
1918
1919[index "changes_closed"]
1920 ramBufferSize = 20 m
1921 maxBufferedDocs = 500
1922----
1923
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07001924[[ldap]]Section ldap
1925~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001926
David Pursehouse221d4f62012-06-08 17:38:08 +09001927LDAP integration is only enabled if `auth.type` is set to
Sasa Zivkoveabc8972010-10-04 15:47:08 +02001928`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
David Pursehouse42f42042013-08-01 14:02:25 +09001929detailed description of the `auth.type` settings and their
Sasa Zivkoveabc8972010-10-04 15:47:08 +02001930implications.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001931
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001932An example LDAP configuration follows, and then discussion of
1933the parameters introduced here. Suitable defaults for most
1934parameters are automatically guessed based on the type of server
1935detected during startup. The guessed defaults support both
1936link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307] and Active
1937Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001938
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001939----
1940[ldap]
1941 server = ldap://ldap.example.com
1942
1943 accountBase = ou=people,dc=example,dc=com
1944 accountPattern = (&(objectClass=person)(uid=${username}))
1945 accountFullName = displayName
1946 accountEmailAddress = mail
1947
1948 groupBase = ou=groups,dc=example,dc=com
1949 groupMemberPattern = (&(objectClass=group)(member=${dn}))
1950----
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001951
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001952[[ldap.server]]ldap.server::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001953+
1954URL of the organization's LDAP server to query for user information
1955and group membership from. Must be of the form `ldap://host` or
1956`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07001957+
David Pursehouse42f42042013-08-01 14:02:25 +09001958If `auth.type` is `LDAP` this setting should use `ldaps://` to
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07001959ensure the end user's plaintext password is transmitted only over
1960an encrypted connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001961
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07001962[[ldap.sslVerify]]ldap.sslVerify::
1963+
1964If false and ldap.server is an `ldaps://` style URL, Gerrit
1965will not verify the server certificate when it connects to
1966perform a query.
1967+
1968By default, true, requiring the certificate to be verified.
1969
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001970[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001971+
1972_(Optional)_ Username to bind to the LDAP server with. If not set,
1973an anonymous connection to the LDAP server is attempted.
1974
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001975[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001976+
1977_(Optional)_ Password for the user identified by `ldap.username`.
1978If not set, an anonymous (or passwordless) connection to the LDAP
1979server is attempted.
1980
Ben Wu0410a152010-06-04 16:17:24 +08001981[[ldap.referral]]ldap.referral::
1982+
1983_(Optional)_ How an LDAP referral should be handled if it is
1984encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05001985automatically follow any referrals, or `ignore` to ignore the
1986referrals.
Ben Wu0410a152010-06-04 16:17:24 +08001987+
1988By default, `ignore`.
1989
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01001990[[ldap.readTimeout]]ldap.readTimeout::
1991+
1992_(Optional)_ The read timeout for an LDAP operation. The value is
1993in the usual time-unit format like "1 s", "100 ms", etc...
1994A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09001995threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01001996+
1997By default there is no timeout and Gerrit will wait for the LDAP
1998server to respond until the TCP connection times out.
1999
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002000[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002001+
2002Root of the tree containing all user accounts. This is typically
2003of the form `ou=people,dc=example,dc=com`.
2004
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002005[[ldap.accountScope]]ldap.accountScope::
2006+
2007Scope of the search performed for accounts. Must be one of:
2008+
2009* `one`: Search only one level below accountBase, but not recursive
2010* `sub` or `subtree`: Search recursively below accountBase
2011* `base` or `object`: Search exactly accountBase; probably not desired
2012
2013+
2014Default is `subtree` as many directories have several levels.
2015
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002016[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002017+
2018Query pattern to use when searching for a user account. This may be
2019any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09002020`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002021`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09002022that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02002023the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002024the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002025+
2026This pattern is used to search the objects contained directly under
2027the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02002028is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002029setting depends on the LDAP schema used by the directory server.
2030+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002031Default is `(uid=${username})` for RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002032and `(&(objectClass=user)(sAMAccountName=${username}))`
2033for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002034
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07002035[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002036+
2037_(Optional)_ Name of an attribute on the user account object which
2038contains the initial value for the user's full name field in Gerrit.
2039Typically this is the `displayName` property in LDAP, but could
2040also be `legalName` or `cn`.
2041+
David Pursehouse221d4f62012-06-08 17:38:08 +09002042Attribute values may be concatenated with literal strings. For
2043example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02002044`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002045+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002046If set, users will be unable to modify their full name field, as
2047Gerrit will populate it only from the LDAP data.
2048+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002049Default is `displayName` for RFC 2307 servers,
2050and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002051
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002052[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002053+
2054_(Optional)_ Name of an attribute on the user account object which
2055contains the user's Internet email address, as defined by this
2056LDAP server.
2057+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002058Attribute values may be concatenated with literal strings,
2059for example to set the email address to the lowercase form
2060of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02002061`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002062+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002063If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09002064but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002065and select a different preferred email address.
2066+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002067Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002068
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002069[[ldap.accountSshUserName]]ldap.accountSshUserName::
2070+
2071_(Optional)_ Name of an attribute on the user account object which
2072contains the initial value for the user's SSH username field in
2073Gerrit. Typically this is the `uid` property in LDAP, but could
2074also be `cn`. Administrators should prefer to match the attribute
2075corresponding to the user's workstation username, as this is what
2076SSH clients will default to.
2077+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002078Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02002079an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002080force the value of sAMAccountName, if defined, to be all lowercase.
2081The suffix `.toUpperCase` can be used for the other direction.
2082The suffix `.localPart` can be used to split attribute values of
2083the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02002084example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002085+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002086If set, users will be unable to modify their SSH username field, as
2087Gerrit will populate it only from the LDAP data.
2088+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002089Default is `uid` for RFC 2307 servers,
2090and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002091
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002092[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04002093+
2094_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002095contains the groups the user is part of. Typically used for Active
2096Directory servers.
Anthony93de7db2009-10-03 10:01:50 -04002097+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002098Default is unset for RFC 2307 servers (disabled)
2099and `memberOf` for Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04002100
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002101[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002102+
2103Root of the tree containing all group objects. This is typically
2104of the form `ou=groups,dc=example,dc=com`.
2105
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002106[[ldap.groupScope]]ldap.groupScope::
2107+
2108Scope of the search performed for group objects. Must be one of:
2109+
2110* `one`: Search only one level below groupBase, but not recursive
2111* `sub` or `subtree`: Search recursively below groupBase
2112* `base` or `object`: Search exactly groupBase; probably not desired
2113
2114+
2115Default is `subtree` as many directories have several levels.
2116
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002117[[ldap.groupPattern]]ldap.groupPattern::
2118+
2119Query pattern used when searching for an LDAP group to connect
2120to a Gerrit group. This may be any valid LDAP query expression,
2121including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002122`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002123group owner.
2124+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002125Default is `(cn=${groupname})` for RFC 2307,
2126and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002127
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002128[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002129+
2130Query pattern to use when searching for the groups that a user
2131account is currently a member of. This may be any valid LDAP query
2132expression, including the standard `(&...)` and `(|...)` operators.
2133+
David Pursehouse42f42042013-08-01 14:02:25 +09002134If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002135replaced with a parameter set to the username that was supplied
2136by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02002137such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002138corresponding attribute (in this case, `fooBarAttribute`) as read
2139from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002140Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002141+
Scott Dial50457502013-08-11 16:52:51 -04002142Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
2143RFC 2307, and unset (disabled) for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002144
Auke Schrijnen57809132012-09-26 21:05:39 +02002145[[ldap.groupName]]ldap.groupName::
2146+
David Pursehouse39489ae2012-10-12 13:50:04 +09002147_(Optional)_ Name of the attribute on the group object which contains
2148the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02002149+
David Pursehouse39489ae2012-10-12 13:50:04 +09002150Typically the attribute name is `cn` for RFC 2307 and Active Directory
2151servers. For other servers the attribute name may differ, for example
2152`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02002153+
David Pursehouse39489ae2012-10-12 13:50:04 +09002154It is also possible to specify a literal string containing a pattern of
2155attribute values. For example to create a Gerrit group name consisting of
2156LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
2157+
2158Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02002159
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002160[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
2161+
2162Converts the local username, that is used to login into the Gerrit
2163WebUI, to lower case before doing the LDAP authentication. By setting
2164this parameter to true, a case insensitive login to the Gerrit WebUI
2165can be achieved.
2166+
2167If set, it must be ensured that the local usernames for all existing
2168accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09002169local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002170anymore. The local usernames for the existing accounts can be
2171converted to lower case by running the server program
2172link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
2173Please be aware that the conversion of the local usernames to lower
2174case can't be undone. For newly created accounts the local username
2175will be directly stored in lower case.
2176+
2177By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002178
Robin Rosenberga3baed02012-10-14 14:09:32 +02002179[[ldap.authentication]]ldap.authentication::
2180+
2181Defines how Gerrit authenticates with the server. When set to `GSSAPI`
2182Gerrit will use Kerberos. To use kerberos the
2183`java.security.auth.login.config` system property must point to a
2184login to a JAAS configuration file and, if Java 6 is used, the system
2185property `java.security.krb5.conf` must point to the appropriate
2186krb5.ini file with references to the KDC.
2187
2188Typical jaas.conf.
2189
2190----
2191KerberosLogin {
2192 com.sun.security.auth.module.Krb5LoginModule
2193 required
2194 useTicketCache=true
2195 doNotPrompt=true
2196 renewTGT=true;
2197};
2198----
2199
2200See Java documentation on how to create the krb5.ini file.
2201
2202Note the `renewTGT` property to make sure the TGT does not expire,
2203and `useTicketCache` to use the TGT supplied by the operating system. As
2204the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09002205to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02002206
2207On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
2208must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
2209have local administrator privileges.
2210
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07002211[[mimetype]]Section mimetype
2212~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002213
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002214[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002215+
2216If set to true, files with the MIME type `<name>` will be sent as
2217direct downloads to the user's browser, rather than being wrapped up
2218inside of zipped archives. The type name may be a complete type
Edwin Kempincdb0e002011-09-08 14:23:30 +02002219name, e.g. `image/gif`, a generic media type, e.g. `image/*`,
2220or the wildcard `*/*` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002221+
2222By default, false for all MIME types.
2223
2224Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002225----
2226[mimetype "image/*"]
2227 safe = true
2228
2229[mimetype "application/pdf"]
2230 safe = true
2231
2232[mimetype "application/msword"]
2233 safe = true
2234
2235[mimetype "application/vnd.ms-excel"]
2236 safe = true
2237----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002238
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07002239
2240[[pack]]Section pack
2241~~~~~~~~~~~~~~~~~~~~
2242Global settings controlling how Gerrit Code Review creates pack
2243streams for Git clients running clone, fetch, or pull. Most of these
2244variables are per-client request, and thus should be carefully set
2245given the expected concurrent request load and available CPU and
2246memory resources.
2247
2248[[pack.deltacompression]]pack.deltacompression::
2249+
2250If true, delta compression between objects is enabled. This may
2251result in a smaller overall transfer for the client, but requires
2252more server memory and CPU time.
2253+
2254False (off) by default, matching Gerrit Code Review 2.1.4.
2255
2256[[pack.threads]]pack.threads::
2257+
2258Maximum number of threads to use for delta compression (if enabled).
2259This is per-client request. If set to 0 then the number of CPUs is
2260auto-detected and one thread per CPU is used, per client request.
2261+
2262By default, 1.
2263
2264
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07002265[[plugins]]Section plugins
2266~~~~~~~~~~~~~~~~~~~~~~~~~~
2267
2268[[plugins.checkFrequency]]plugins.checkFrequency::
2269+
2270How often plugins should be examined for new plugins to load, removed
2271plugins to be unloaded, or updated plugins to be reloaded. Values can
2272be specified using standard time unit abbreviations ('ms', 'sec',
2273'min', etc.).
2274+
2275If set to 0, automatic plugin reloading is disabled. Administrators
2276may force reloading with link:cmd-plugin.html[gerrit plugin reload].
2277+
2278Default is 1 minute.
2279
2280
lincoln2be11602010-07-05 10:53:25 -03002281[[receive]]Section receive
2282~~~~~~~~~~~~~~~~~~~~~~~~~~
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002283This section is used to set who can execute the 'receive-pack' and
2284to limit the maximum Git object size that 'receive-pack' will accept.
2285'receive-pack' is what runs on the server during a user's push or
Dave Borowitz234734a2012-03-01 14:22:29 -08002286repo upload command. It also contains some advanced options for tuning the
2287behavior of Gerrit's 'receive-pack' mechanism.
lincoln2be11602010-07-05 10:53:25 -03002288
2289----
2290[receive]
2291 allowGroup = GROUP_ALLOWED_TO_EXECUTE
2292 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002293 maxObjectSizeLimit = 40 m
lincoln2be11602010-07-05 10:53:25 -03002294----
2295
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08002296[[receive.checkMagicRefs]]receive.checkMagicRefs::
2297+
2298If true, Gerrit will verify the destination repository has
2299no references under the magic 'refs/drafts', 'refs/for', or
2300'refs/publish' branch namespaces. Names under these locations
2301confuse clients when trying to upload code reviews so Gerrit
2302requires them to be empty.
2303+
2304If false Gerrit skips the sanity check and assumes administrators
2305have ensured the repository does not contain any magic references.
2306Setting to false to skip the check can decrease latency during push.
2307+
2308Default is true.
2309
Gustaf Lundh9062fd62013-02-14 17:23:11 +01002310[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
2311+
2312If set to true, Gerrit will validate that all referenced objects that
2313are not included in the received pack are reachable by the user.
2314+
2315Carrying out this check on gits with many refs and commits can be a
2316very CPU-heavy operation. For non public Gerrit-servers this check may
2317be overkill.
2318+
2319Only disable this check if you trust the clients not to forge SHA1
2320references to access commits intended to be hidden from the user.
2321+
2322Default is true.
2323
lincoln2be11602010-07-05 10:53:25 -03002324[[receive.allowGroup]]receive.allowGroup::
2325+
2326Name of the groups of users that are allowed to execute
2327'receive-pack' on the server. One or more groups can be set.
2328+
2329If no groups are added, any user will be allowed to execute
2330'receive-pack' on the server.
2331
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002332[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
2333+
2334Maximum allowed Git object size that 'receive-pack' will accept.
2335If an object is larger than the given size the pack-parsing will abort
2336and the push operation will fail. If set to zero then there is no
2337limit.
2338+
David Pursehouse221d4f62012-06-08 17:38:08 +09002339Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002340from pushing objects which are too large to Gerrit.
2341+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07002342This setting can also be set in the `project.config`
2343link:config-project-config.html[receive.maxObjectSizeLimit] in order
2344to further reduce the global setting. The project specific setting is
2345only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02002346+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002347Default is zero.
2348+
2349Common unit suffixes of 'k', 'm', or 'g' are supported.
2350
Dave Borowitz234734a2012-03-01 14:22:29 -08002351[[receive.threadPoolSize]]receive.threadPoolSize::
2352+
2353Maximum size of the thread pool in which the change data in received packs is
2354processed.
2355+
2356Defaults to the number of available CPUs according to the Java runtime.
2357
Shawn O. Pearcec545c092012-07-27 16:38:55 -07002358[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
2359+
2360Number of threads to perform change creation or patch set updates
2361concurrently. Each thread uses its own database connection from
2362the database connection pool, and if all threads are busy then
2363main receive thread will also perform a change creation or patch
2364set update.
2365+
2366Defaults to 1, using only the main receive thread. This feature is for
David Pursehouse92463562013-06-24 10:16:28 +09002367databases with very high latency that can benefit from concurrent
Shawn O. Pearcec545c092012-07-27 16:38:55 -07002368operations when multiple changes are impacted at once.
2369
Dave Borowitz1c401362012-03-02 17:39:17 -08002370[[receive.timeout]]receive.timeout::
2371+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07002372Overall timeout on the time taken to process the change data in
2373received packs. Only includes the time processing Gerrit changes
2374and updating references, not the time to index the pack. Values can
2375be specified using standard time unit abbreviations ('ms', 'sec',
2376'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08002377+
David Pursehouse92463562013-06-24 10:16:28 +09002378Default is 2 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07002379is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08002380
lincoln2be11602010-07-05 10:53:25 -03002381
Hugo Josefson072b4702010-04-21 19:27:11 +02002382[[repository]]Section repository
2383~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2384Repositories in this sense are the same as projects.
2385
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002386In the following example configuration `Registered Users` is set
2387to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02002388
2389----
2390[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02002391 ownerGroup = Registered Users
2392----
2393
2394[NOTE]
2395Currently only the repository name `*` is supported.
2396This is a wildcard designating all repositories.
2397
Hugo Josefson072b4702010-04-21 19:27:11 +02002398[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
2399+
2400A name of a group which exists in the database. Zero, one or many
2401groups are allowed. Each on its own line. Groups which don't exist
2402in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02002403
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07002404[[rules]]Section rules
2405~~~~~~~~~~~~~~~~~~~~~~
2406
2407[[rules.enable]]rules.enable::
2408+
Matt Baker8ce12fc2013-11-26 21:43:12 -07002409If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07002410project's refs/meta/config branch, if present. When set to false,
2411only the default internal rules will be used.
2412+
2413Default is true, to execute project specific rules.
2414
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07002415[[sendemail]]Section sendemail
2416~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002417
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002418[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07002419+
2420If false Gerrit will not send email messages, for any reason,
2421and all other properties of section sendemail are ignored.
2422+
2423By default, true, allowing notifications to be sent.
2424
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002425[[sendemail.from]]sendemail.from::
2426+
2427Designates what name and address Gerrit will place in the From
2428field of any generated email messages. The supported values are:
2429+
2430* `USER`
2431+
2432Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09002433Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002434classified as spam if the user's domain has SPF or DKIM enabled
2435and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
2436relay for that domain.
2437+
2438* `MIXED`
2439+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002440Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002441`review@example.com` is the same as <<user.email,user.email>>.
2442See below for a description of how the replacement is handled.
2443+
2444* `SERVER`
2445+
2446Gerrit will set the From header to the same name and address
2447it records in any commits Gerrit creates. This is set by
2448<<user.name,user.name>> and <<user.email,user.email>>, or guessed
2449from the local operating system.
2450+
2451* 'Code Review' `<`'review'`@`'example.com'`>`
2452+
2453If set to a name and email address in brackets, Gerrit will use
2454this name and email address for any messages, overriding the name
2455that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002456Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002457which is replaced by the Full Name of the current user.
2458
2459+
2460By default, MIXED.
2461
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002462[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002463+
2464Hostname (or IP address) of a SMTP server that will relay
2465messages generated by Gerrit to end users.
2466+
2467By default, 127.0.0.1 (aka localhost).
2468
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002469[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002470+
2471Port number of the SMTP server in sendemail.smtpserver.
2472+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08002473By default, 25, or 465 if smtpEncryption is 'ssl'.
2474
2475[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
2476+
2477Specify the encryption to use, either 'ssl' or 'tls'.
2478+
2479By default, 'none', indicating no encryption is used.
2480
2481[[sendemail.sslVerify]]sendemail.sslVerify::
2482+
2483If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
2484will not verify the server certificate when it connects to send
2485an email message.
2486+
2487By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002488
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002489[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002490+
2491User name to authenticate with, if required for relay.
2492
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002493[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002494+
2495Password for the account named by sendemail.smtpUser.
2496
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002497[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07002498+
2499If present, each value adds one entry to the whitelist of email
2500addresses that Gerrit can send email to. If set to a complete
2501email address, that one address is added to the white list.
2502If set to a domain name, any address at that domain can receive
2503email from Gerrit.
2504+
2505By default, unset, permitting delivery to any email address.
2506
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07002507[[sendemail.includeDiff]]sendemail.includeDiff::
2508+
Bruce Zueb00ff32012-11-27 17:38:10 +08002509If true, new change emails and merged change emails from Gerrit
2510will include the complete unified diff of the change.
2511Variable maxmimumDiffSize places an upper limit on how large the
2512email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07002513+
2514By default, false.
2515
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07002516[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
2517+
2518Largest size of unified diff output to include in an email. When
2519the diff exceeds this size the file paths will be listed instead.
2520Standard byte unit suffixes are supported.
2521+
2522By default, 256 KiB.
2523
Alex Blewitt9cca7402011-02-11 01:39:30 +00002524[[sendemail.importance]]sendemail.importance::
2525+
2526If present, emails sent from Gerrit will have the given level
2527of importance. Valid values include 'high' and 'low', which
2528email clients will render in different ways.
2529+
2530By default, unset, so no Importance header is generated.
2531
2532[[sendemail.expiryDays]]sendemail.expiryDays::
2533+
2534If present, emails sent from Gerrit will expire after the given
2535number of days. This will add the Expiry-Date header and
2536email clients may expire or expunge mails whose Expiry-Date
2537header is in the past. This should be a positive non-zero
2538number indicating how many days in the future the mails
2539should expire.
2540+
2541By default, unset, so no Expiry-Date header is generated.
2542
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002543
2544[[site]]Section site
2545~~~~~~~~~~~~~~~~~~~~
2546
2547[[site.checkUserAgent]]site.checkUserAgent::
2548+
2549If true the server checks the User-Agent HTTP header and sends the
2550correct JavaScript to the client as part of the initial page load.
2551This usually reduces a round-trip for the client, allowing the UI to
2552start more quickly. If false, a tiny JavaScript loader is sent to the
2553client instead to determine the correct code to use. Default is true.
2554
2555[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
2556+
2557If true the server checks the site header, footer and CSS files for
2558updated versions. If false, a server restart is required to change
2559any of these resources. Default is true, allowing automatic reloads.
2560
Shawn O. Pearce6bd04fd2012-04-05 14:39:22 -07002561[[site.enableDeprecatedQuery]]site.enableDeprecatedQuery::
2562+
2563If true the deprecated `/query` URL is available to return JSON
2564and text results for changes. If false, the URL is disabled and
2565returns 404 to clients. Default is true, enabling `/query`.
2566
Shawn O. Pearce521380a2012-05-11 14:57:56 -07002567[[ssh-alias]] Section ssh-alias
2568~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2569
2570Variables in section ssh-alias permit the site administrator to alias
2571another command from Gerrit or a plugin into the `gerrit` command
2572namespace. To alias `replication start` to `gerrit replicate`:
2573
2574----
2575[ssh-alias]
2576 replicate = replication start
2577----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002578
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07002579[[sshd]] Section sshd
Shawn O. Pearcea758fef2009-08-19 08:29:32 -07002580~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07002581
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002582[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002583+
2584Specifies the local addresses the internal SSHD should listen
2585for connections on. The following forms may be used to specify
2586an address. In any form, `:'port'` may be omitted to use the
2587default of 29418.
2588+
2589* 'hostname':'port' (for example `review.example.com:29418`)
2590* 'IPv4':'port' (for example `10.0.0.1:29418`)
2591* ['IPv6']:'port' (for example `[ff02::1]:29418`)
Edwin Kempincdb0e002011-09-08 14:23:30 +02002592* *:'port' (for example `*:29418`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002593
2594+
2595If multiple values are supplied, the daemon will listen on all
2596of them.
2597+
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07002598To disable the internal SSHD, set listenAddress to `off`.
2599+
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002600By default, *:29418.
2601
James Y Knight910bd862011-01-11 20:05:56 -05002602[[sshd.advertisedAddress]]sshd.advertisedAddress::
2603+
2604Specifies the addresses clients should be told to connect to.
2605This may differ from sshd.listenAddress if a firewall based port
2606redirector is being used, making Gerrit appear to answer on port
260722. The following forms may be used to specify an address. In any
2608form, `:'port'` may be omitted to use the default SSH port of 22.
2609+
2610* 'hostname':'port' (for example `review.example.com:22`)
2611* 'IPv4':'port' (for example `10.0.0.1:29418`)
2612* ['IPv6']:'port' (for example `[ff02::1]:29418`)
2613
2614+
2615If multiple values are supplied, the daemon will advertise all
2616of them.
2617+
2618By default, sshd.listenAddress.
2619
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002620[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07002621+
2622If true, enables TCP keepalive messages to the other side, so
2623the daemon can terminate connections if the peer disappears.
2624+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02002625Only effective when `sshd.backend` is set to `MINA`.
2626+
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07002627By default, true.
2628
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08002629[[sshd.threads]]sshd.threads::
2630+
2631Number of threads to use when executing SSH command requests.
2632If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09002633are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08002634+
2635By default, 1.5x the number of CPUs available to the JVM.
2636
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002637[[sshd.batchThreads]]sshd.batchThreads::
2638+
2639Number of threads to allocate for SSH command requests from
Fredrik Luthander46843022012-03-13 16:11:02 +01002640link:access-control.html#non-interactive_users[non-interactive users].
2641If equals to 0, then all non-interactive requests are executed in the same
2642queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002643+
2644Any other value will remove the number of threads from the queue
2645allocated to interactive users, and create a separate thread pool
2646of the requested size, which will be used to run commands from
2647non-interactive users.
2648+
2649If the number of threads requested for non-interactive users is larger
2650than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09002651value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07002652+
2653By default, 0.
2654
Kenny Root15ac1b82010-02-24 00:29:20 -08002655[[sshd.streamThreads]]sshd.streamThreads::
2656+
2657Number of threads to use when formatting events to asynchronous
2658streaming clients. Event formatting is multiplexed onto this thread
2659pool by a simple FIFO scheduling system.
2660+
2661By default, 1 plus the number of CPUs available to the JVM.
2662
Edwin Kempinb5df3b82011-10-10 11:31:14 +02002663[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07002664+
2665Number of threads used to parse a command line submitted by a client
2666over SSH for execution, create the internal data structures used by
2667that command, and schedule it for execution on another thread.
2668+
2669By default, 2.
2670
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002671[[sshd.maxAuthTries]]sshd.maxAuthTries::
2672+
2673Maximum number of authentication attempts before the server
2674disconnects the client. Each public key that a client has loaded
2675into its local agent counts as one auth request. Users can work
2676around the server's limit by loading less keys into their agent,
2677or selecting a specific key in their `~/.ssh/config` file with
2678the `IdentityFile` option.
2679+
2680By default, 6.
2681
2682[[sshd.loginGraceTime]]sshd.loginGraceTime::
2683+
2684Time in seconds that a client has to authenticate before the server
2685automatically terminates their connection. Values should use common
2686unit suffixes to express their setting:
2687+
2688* s, sec, second, seconds
2689* m, min, minute, minutes
2690* h, hr, hour, hours
2691* d, day, days
2692
2693+
2694By default, 2 minutes.
2695
Christian Aistleitner3d794592013-04-08 00:19:40 +02002696[[sshd.idleTimeout]]sshd.idleTimeout::
2697+
2698Time in seconds after which the server automatically terminates idle
2699connections (or 0 to disable closing of idle connections). Values
2700should use common unit suffixes to express their setting:
2701+
2702* s, sec, second, seconds
2703* m, min, minute, minutes
2704* h, hr, hour, hours
2705* d, day, days
2706
2707+
2708By default, 0.
2709
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002710[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
2711+
2712Maximum number of concurrent SSH sessions that a user account
2713may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09002714that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07002715the number of commands a user may issue over a single connection.
2716If set to 0, there is no limit.
2717+
2718By default, 64.
2719
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002720[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07002721+
2722Available ciphers. To permit multiple ciphers, specify multiple
2723`sshd.cipher` keys in the configuration file, one cipher name
2724per key. Cipher names starting with `+` are enabled in addition
2725to the default ciphers, cipher names starting with `-` are removed
2726from the default cipher set.
2727+
2728Supported ciphers: aes128-cbc, aes128-cbc, aes256-cbc, blowfish-cbc,
27293des-cbc, none.
2730+
2731By default, all supported ciphers except `none` are available.
2732
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002733[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07002734+
2735Available MAC (message authentication code) algorithms. To permit
2736multiple algorithms, specify multiple `sshd.mac` keys in the
2737configuration file, one MAC per key. MAC names starting with `+`
2738are enabled in addition to the default MACs, MAC names starting with
2739`-` are removed from the default MACs.
2740+
2741Supported MACs: hmac-md5, hmac-md5-96, hmac-sha1, hmac-sha1-96.
2742+
2743By default, all supported MACs are available.
2744
Alex Blewitt7efb06f2013-04-01 12:46:48 -04002745[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
2746+
2747Enable kerberos authentication for SSH connections. To permit
2748kerberos authentication, the server must have a host principal
2749(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
2750This must be provisioned by the kerberos administrators, and is
2751typically installed into `/etc/krb5.keytab` on host machines.
2752+
2753The keytab must contain at least one `host/` principal, typically
2754using the host's canonical name. If it does not use the
2755canonical name, the `sshd.kerberosPrincipal` should be configured
2756with the correct name.
2757+
2758By default, not set and so kerberos authentication is not enabled.
2759
2760[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
2761+
2762If kerberos authentication is enabled with `sshd.kerberosKeytab`,
2763instead use the given principal name instead of the default.
2764If the principal does not begin with `host/` a warning message is
2765printed and may prevent successful authentication.
2766+
2767This may be useful if the host is behind an IP load balancer or
2768other SSH forwarding systems, since the principal name is constructed
2769by the client and must match for kerberos authentication to work.
2770+
2771By default, `host/canonical.host.name`
2772
Shawn Pearce35e97c22013-10-17 22:15:38 -07002773[[sshd.requestLog]]sshd.requestLog::
2774+
2775Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
2776If enabled, a request log file is written out by the SSH daemon.
2777+
2778By default, true.
2779
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002780[[suggest]] Section suggest
2781~~~~~~~~~~~~~~~~~~~~~~~~~~~
2782
Dave Borowitz1ae8c532012-03-09 18:39:40 -08002783[[suggest.accounts]]suggest.accounts::
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002784+
Dave Borowitz45baa892012-02-23 16:43:05 -08002785If `true`, visible user accounts (according to the value of
2786`accounts.visibility`) will be offered as completion suggestions
2787when adding a reviewer to a change, or a user to a group.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002788+
Dave Borowitz45baa892012-02-23 16:43:05 -08002789If `false`, account suggestion is disabled.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002790+
Dave Borowitz45baa892012-02-23 16:43:05 -08002791Older configurations may also have one of the `accounts.visibility`
2792values for this field, including `OFF` as a synonym for `NONE`. If
2793`accounts.visibility` is also set, that value overrides this one;
2794otherwise, this value applies to both `suggest.accounts` and
2795`accounts.visibility`.
Edwin Kempin42488812011-05-20 03:11:43 +02002796+
Dave Borowitz45baa892012-02-23 16:43:05 -08002797New configurations should prefer the boolean value for this field
2798and an enum value for `accounts.visibility`.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07002799
Edwin Kempinf957dc22012-10-19 20:41:18 +02002800[[suggest.from]]suggest.from::
2801+
2802The number of characters that a user must have typed before suggestions
2803are provided. If set to 0, suggestions are always provided.
2804+
2805By default 0.
2806
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002807[[theme]] Section theme
2808~~~~~~~~~~~~~~~~~~~~~~~
2809
2810[[theme.backgroundColor]]theme.backgroundColor::
2811+
2812Background color for the page, and major data tables like the all
2813open changes table or the account dashboard. The value must be a
2814valid HTML hex color code, or standard color name.
2815+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002816By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002817
2818[[theme.topMenuColor]]theme.topMenuColor::
2819+
2820This is the color of the main menu bar at the top of the page.
2821The value must be a valid HTML hex color code, or standard color
Chad Horohoebbdf7482012-11-13 18:23:15 -08002822name.
2823+
2824By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002825
2826[[theme.textColor]]theme.textColor::
2827+
2828Text color for the page, and major data tables like the all
2829open changes table or the account dashboard. The value must be a
2830valid HTML hex color code, or standard color name.
2831+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002832By default dark grey, `353535`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002833
2834[[theme.trimColor]]theme.trimColor::
2835+
2836Primary color used as a background color behind text. This is
2837the color of the main menu bar at the top, of table headers,
2838and of major UI areas that we want to offset from other portions
2839of the page. The value must be a valid HTML hex color code, or
2840standard color name.
2841+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002842By default a light grey, `EEEEEE`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002843
2844[[theme.selectionColor]]theme.selectionColor::
2845+
2846Background color used within a trimColor area to denote the currently
2847selected tab, or the background color used in a table to denote the
2848currently selected row. The value must be a valid HTML hex color
2849code, or standard color name.
2850+
Chad Horohoebbdf7482012-11-13 18:23:15 -08002851By default a pale blue, `D8EDF9`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08002852
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01002853[[theme.changeTableOutdatedColor]]theme.changeTableOutdatedColor::
2854+
2855Background color used for patch outdated messages. The value must be
2856a valid HTML hex color code, or standard color name.
2857+
Edwin Kempinb0347332012-07-17 10:14:32 +02002858By default a shade of red, `F08080`.
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01002859
2860[[theme.tableOddRowColor]]theme.tableOddRowColor::
2861+
2862Background color for tables such as lists of open reviews for odd
2863rows. This is so you can have a different color for odd and even
2864rows of the table. The value must be a valid HTML hex color code,
2865or standard color name.
2866+
2867By default transparent.
2868
2869[[theme.tableEvenRowColor]]theme.tableEvenRowColor::
2870+
2871Background color for tables such as lists of open reviews for even
2872rows. This is so you can have a different color for odd and even
2873rows of the table. The value must be a valid HTML hex color code,
2874or standard color name.
2875+
2876By default transparent.
2877
Shawn O. Pearcea83bb1c2011-05-20 08:46:48 -07002878A different theme may be used for signed-in vs. signed-out user status
2879by using the "signed-in" and "signed-out" theme sections. Variables
2880not specified in a section are inherited from the default theme.
2881
2882----
2883[theme]
2884 backgroundColor = FFFFFF
2885[theme "signed-in"]
2886 backgroundColor = C0C0C0
2887[theme "signed-out"]
2888 backgroundColor = 00FFFF
2889----
2890
David Ostrovsky117c6032013-08-09 00:44:56 +02002891As example, here is the theme configuration to have the old green look:
2892
2893----
2894[theme]
2895 backgroundColor = FCFEEF
2896 textColor = 000000
2897 trimColor = D4E9A9
2898 selectionColor = FFFFCC
2899 topMenuColor = D4E9A9
2900 changeTableOutdatedColor = F08080
2901[theme "signed-in"]
2902 backgroundColor = FFFFFF
2903----
2904
Goran Lungberg04132a12010-06-15 17:20:37 -07002905[[trackingid]] Section trackingid
Shawn O. Pearce91763a02010-06-16 15:39:33 -07002906~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Goran Lungberg04132a12010-06-15 17:20:37 -07002907
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07002908Tagged footer lines containing references to external
2909tracking systems, parsed out of the commit message and
Shawn Pearceff61c8a2013-10-07 19:35:53 -07002910saved in Gerrit's database.
2911
2912After making changes to this section, existing changes
2913must be reindexed with link:pgm-reindex.html[reindex]
2914if index.type is `LUCENE` or `SOLR`; or with
2915link:pgm-ScanTrackingIds.html[ScanTrackingIds] if index.type
2916is unset or `SQL`.
Goran Lungberg04132a12010-06-15 17:20:37 -07002917
Edwin Kempinbb421f12011-08-25 11:19:00 +02002918The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07002919bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07002920
2921----
2922[trackingid "jira-bug"]
2923 footer = Bugfix:
2924 match = JRA\\d{2,8}
2925 system = JIRA
2926
2927[trackingid "jira-feature"]
2928 footer = Feature
2929 match = JRA(\\d{2,8})
2930 system = JIRA
2931----
2932
2933[[trackingid.name.footer]]trackingid.<name>.footer::
2934+
2935A prefix tag that identify the footer line to parse for tracking ids.
Kevin Degi9af42ea2011-08-01 15:54:42 -06002936Several trackingid entries can have the same footer tag. A single
2937trackingid entry can have multiple footer tags. If multiple footer
2938tags are specified, each tag will be parsed separately.
Goran Lungberg04132a12010-06-15 17:20:37 -07002939(the trailing ":" is optional)
2940
2941[[trackingid.name.match]]trackingid.<name>.match::
2942+
Magnus Bäcke5611832011-02-02 08:57:15 +01002943A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
2944Java regular expression (java.util.regex)] used to match the
2945external tracking id part of the footer line. The match can
2946result in several entries in the DB. If grouping is used in the
2947regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01002948Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07002949+
2950The configuration file parser eats one level of backslashes, so the
2951character class `\s` requires `\\s` in the configuration file. The
2952parser also terminates the line at the first `#`, so a match
2953expression containing # must be wrapped in double quotes.
2954
2955[[trackingid.name.system]]trackingid.<name>.system::
2956+
David Pursehouse221d4f62012-06-08 17:38:08 +09002957The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07002958It is possible to have several trackingid entries for the same
2959tracking system.
2960
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07002961[[transfer]] Section transfer
2962~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2963
2964[[transfer.timeout]]transfer.timeout::
2965+
2966Number of seconds to wait for a single network read or write
2967to complete before giving up and declaring the remote side is
2968not responding. If 0, there is no timeout, and this server will
2969wait indefinitely for a transfer to finish.
2970+
2971A timeout should be large enough to mostly transfer the objects to
2972the other side. 1 second may be too small for larger projects,
2973especially over a WAN link, while 10-30 seconds is a much more
2974reasonable timeout value.
2975+
2976Defaults to 0 seconds, wait indefinitely.
2977
lincoln2be11602010-07-05 10:53:25 -03002978
2979[[upload]]Section upload
Remy Bohmer203eea32012-02-19 21:21:36 +01002980~~~~~~~~~~~~~~~~~~~~~~~~
lincoln2be11602010-07-05 10:53:25 -03002981Sets the group of users allowed to execute 'upload-pack' on the
2982server, 'upload-pack' is what runs on the server during a user's
2983fetch, clone or repo sync command.
2984
2985----
2986[upload]
2987 allowGroup = GROUP_ALLOWED_TO_EXECUTE
2988 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
2989----
2990
2991[[upload.allowGroup]]upload.allowGroup::
2992+
2993Name of the groups of users that are allowed to execute 'upload-pack'
2994on the server. One or more groups can be set.
2995+
2996If no groups are added, any user will be allowed to execute
2997'upload-pack' on the server.
2998
2999
Shawn O. Pearce8efb2a72009-08-18 19:45:33 -07003000[[user]] Section user
Shawn O. Pearcea758fef2009-08-19 08:29:32 -07003001~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003002
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003003[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003004+
3005Name that Gerrit calls itself in Git when it creates a new Git
3006commit, such as a merge during change submission.
3007+
3008By default this is "Gerrit Code Review".
3009
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003010[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003011+
3012Email address that Gerrit refers to itself as when it creates a
3013new Git commit, such as a merge commit during change submission.
3014+
3015If not set, Gerrit generates this as "gerrit@`hostname`", where
3016`hostname` is the hostname of the system Gerrit is running on.
3017+
3018By default, not set, generating the value at startup.
3019
Edwin Kempin0e02ded2011-09-16 15:10:14 +02003020[[user.anonymousCoward]]user.anonymousCoward::
3021+
David Pursehouse13b21902013-10-16 12:59:18 +09003022Username that is displayed in the Gerrit WebUI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02003023notifications if the full name of the user is not set.
3024+
3025By default "Anonymous Coward" is used.
3026
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003027
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003028File `etc/secure.config`
Remy Bohmer203eea32012-02-19 21:21:36 +01003029------------------------
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003030The optional file `'$site_path'/etc/secure.config` overrides (or
3031supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003032The file should be readable only by the daemon process and can be
3033used to contain private configuration entries that wouldn't normally
3034be exposed to everyone.
3035
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003036Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003037----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07003038[auth]
3039 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
Brad Larson3a6f0772012-07-25 11:41:22 -05003040 restTokenPrivateKey = 7e40PzCjlUKOnXATvcBNXH6oyiu+r0dFk2c=
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07003041
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003042[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003043 username = webuser
3044 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003045
3046[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003047 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003048
3049[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003050 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003051
3052[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003053 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07003054
3055[remote "bar"]
3056 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003057----
3058
Johan Bjork3e5ee302012-01-27 17:59:54 +01003059File `etc/peer_keys`
3060--------------------
3061
3062The optional file `'$site_path'/etc/peer_keys` controls who can
3063login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
3064command.
3065
3066The format is one Base-64 encoded public key per line.
3067
3068
Shawn O. Pearce7b405712009-05-08 18:27:53 -07003069Database system_config
3070----------------------
3071
3072Several columns in the `system_config` table within the metadata
3073database may be set to control how Gerrit behaves.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003074
3075[NOTE]
3076The contents of the `system_config` table are cached at startup
3077by Gerrit. If you modify any columns in this table, Gerrit needs
3078to be restarted before it will use the new values.
3079
Shawn O. Pearce7b405712009-05-08 18:27:53 -07003080Configurable Parameters
3081~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003082
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003083site_path::
3084+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003085Local filesystem directory holding the site customization assets.
3086Placing this directory under version control and/or backup is a
3087good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003088+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003089Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003090+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003091Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003092+
Dave Borowitz1e49e142013-04-09 12:14:57 -07003093* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003094
Shawn O. Pearce5500e692009-05-28 15:55:01 -07003095GERRIT
3096------
3097Part of link:index.html[Gerrit Code Review]