blob: ca567d15fc1e13d29129c8af9553e5949ceeb6e0 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - Configuration
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== File `etc/gerrit.config`
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07004
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005The optional file `'$site_path'/etc/gerrit.config` is a Git-style
6config file that controls many host specific settings for Gerrit.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07007
8[NOTE]
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08009The contents of the `etc/gerrit.config` file are cached at startup
Brandon Casey4a21add2011-07-05 13:14:18 -050010by Gerrit. If you modify any properties in this file, Gerrit needs
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070011to be restarted before it will use the new values.
12
Shawn O. Pearcec5fed822009-11-17 16:10:10 -080013Sample `etc/gerrit.config`:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070014----
15[core]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080016 packedGitLimit = 200 m
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070017
18[cache]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080019 directory = /var/cache/gerrit2
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070020----
21
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -080022[[accounts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080023=== Section accounts
Dave Borowitz45baa892012-02-23 16:43:05 -080024
Matthias Sohnf3360662012-04-05 15:42:52 +020025[[accounts.visibility]]accounts.visibility::
Dave Borowitz45baa892012-02-23 16:43:05 -080026+
27Controls visibility of other users' dashboard pages and
28completion suggestions to web users.
29+
30If `ALL`, all users are visible to all other users, even
31anonymous users.
32+
33If `SAME_GROUP`, only users who are also members of a group the
34current user is a member of are visible.
35+
36If `VISIBLE_GROUP`, only users who are members of at least one group
37that is visible to the current user are visible.
38+
39If `NONE`, no users other than the current user are visible.
40+
41Default is `ALL`.
42
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -080043[[addreviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080044=== Section addreviewer
Edwin Kempin49cb3e12011-06-29 14:35:14 +020045
46[[addreviewer.maxWithoutConfirmation]]addreviewer.maxWithoutConfirmation::
47+
48The maximum number of reviewers a user can add at once by adding a
49group as reviewer without being asked to confirm the operation.
50+
51If set to 0, the user will never be asked to confirm adding a group
52as reviewer.
53+
54Default is 10.
Edwin Kempin5e65d9b2011-07-08 07:35:48 +020055+
David Pursehousea1d633b2014-05-02 17:21:02 +090056This setting only applies for adding reviewers in the Gerrit Web UI,
Edwin Kempin5e65d9b2011-07-08 07:35:48 +020057but is ignored when adding reviewers with the
Edwin Kempin33e92d02011-07-11 22:00:57 +020058link:cmd-set-reviewers.html[set-reviewers] command.
Edwin Kempin49cb3e12011-06-29 14:35:14 +020059
60[[addreviewer.maxAllowed]]addreviewer.maxAllowed::
61+
62The maximum number of reviewers a user can add at once by adding a
63group as reviewer.
64+
65If set to 0, there is no limit for the number of reviewers that can
66be added at once by adding a group as reviewer.
67+
68Default is 20.
69
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -080070[[auth]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080071=== Section auth
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070072
73See also link:config-sso.html[SSO configuration].
74
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -070075[[auth.type]]auth.type::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070076+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070077Type of user authentication employed by Gerrit. The supported
78values are:
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070079+
80* `OpenID`
81+
82The default setting. Gerrit uses any valid OpenID
83provider chosen by the end-user. For more information see
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070084http://openid.net/[openid.net].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070085+
James E. Blairca8bc3b2011-12-21 18:12:26 +000086* `OpenID_SSO`
87+
88Supports OpenID from a single provider. There is no registration
89link, and the "Sign In" link sends the user directly to the provider's
90SSO entry point.
91+
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070092* `HTTP`
93+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070094Gerrit relies upon data presented in the HTTP request. This includes
Edwin Kempinf1acbb82011-09-15 12:49:42 +020095HTTP basic authentication, or some types of commercial single-sign-on
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070096solutions. With this setting enabled the authentication must
97take place in the web server or servlet container, and not from
98within Gerrit.
99+
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700100* `HTTP_LDAP`
101+
102Exactly like `HTTP` (above), but additionally Gerrit pre-populates
103a user's full name and email address based on information obtained
104from the user's account object in LDAP. The user's group membership
105is also pulled from LDAP, making any LDAP groups that a user is a
106member of available as groups in Gerrit.
107+
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200108* `CLIENT_SSL_CERT_LDAP`
109+
110This authentication type is actually kind of SSO. Gerrit will configure
David Pursehouse221d4f62012-06-08 17:38:08 +0900111Jetty's SSL channel to request the client's SSL certificate. For this
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200112authentication to work a Gerrit administrator has to import the root
113certificate of the trust chain used to issue the client's certificate
114into the <review-site>/etc/keystore.
115After the authentication is done Gerrit will obtain basic user
116registration (name and email) from LDAP, and some group memberships.
117Therefore, the "_LDAP" suffix in the name of this authentication type.
118This authentication type can only be used under hosted daemon mode, and
119the httpd.listenUrl must use https:// as the protocol.
Chulho Yangb72ff8f2013-07-04 02:35:53 -0400120Optionally, certificate revocation list file can be used
121at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200122+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700123* `LDAP`
124+
125Gerrit prompts the user to enter a username and a password, which
126it then verifies by performing a simple bind against the configured
127<<ldap.server,ldap.server>>. In this configuration the web server
128is not involved in the user authentication process.
129+
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800130The actual username used in the LDAP simple bind request is the
131account's full DN, which is discovered by first querying the
132directory using either an anonymous request, or the configured
Robin Rosenberga3baed02012-10-14 14:09:32 +0200133<<ldap.username,ldap.username>> identity. Gerrit can also use kerberos if
134<<ldap.authentication,ldap.authentication>> is set to `GSSAPI`.
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800135
136* `LDAP_BIND`
137+
138Gerrit prompts the user to enter a username and a password, which
139it then verifies by performing a simple bind against the configured
140<<ldap.server,ldap.server>>. In this configuration the web server
141is not involved in the user authentication process.
142+
David Pursehouse42f42042013-08-01 14:02:25 +0900143Unlike `LDAP` above, the username used to perform the LDAP simple bind
David Pursehouse1344f5b2013-08-09 17:35:47 +0900144request is the exact string supplied in the dialog by the user.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200145The configured <<ldap.username,ldap.username>> identity is not used to obtain
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800146account information.
147+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700148* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
149+
150*DO NOT USE*. Only for use in a development environment.
151+
152When this is the configured authentication method a hyperlink titled
153`Become` appears in the top right corner of the page, taking the
154user to a form where they can enter the username of any existing
155user account, and immediately login as that account, without any
156authentication taking place. This form of authentication is only
157useful for the GWT hosted mode shell, where OpenID authentication
158redirects might be risky to the developer's host computer, and HTTP
159authentication is not possible.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700160
161+
162By default, OpenID.
163
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700164[[auth.allowedOpenID]]auth.allowedOpenID::
165+
166List of permitted OpenID providers. A user may only authenticate
167with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse42f42042013-08-01 14:02:25 +0900168is set to `OpenID` (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700169+
Magnus Bäcke5611832011-02-02 08:57:15 +0100170Patterns may be either a
171link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
172Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700173end with `$`) or be a simple prefix (any other string).
174+
175By default, the list contains two values, `http://` and `https://`,
176allowing users to authenticate with any OpenID provider.
177
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700178[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700179+
David Pursehouse221d4f62012-06-08 17:38:08 +0900180List of trusted OpenID providers. Only used if `auth.type` is
David Pursehouse42f42042013-08-01 14:02:25 +0900181set to `OpenID` (the default).
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700182+
183In order for a user to take advantage of permissions beyond those
184granted to the `Anonymous Users` and `Registered Users` groups,
185the user account must only have OpenIDs which match at least one
186pattern from this list.
187+
Magnus Bäcke5611832011-02-02 08:57:15 +0100188Patterns may be either a
189link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
190Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700191end with `$`) or be a simple prefix (any other string).
192+
193By default, the list contains two values, `http://` and `https://`,
194allowing Gerrit to trust any OpenID it receives.
195
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100196[[auth.openIdDomain]]auth.openIdDomain::
197+
198List of allowed OpenID email address domains. Only used if
David Pursehouse42f42042013-08-01 14:02:25 +0900199`auth.type` is set to `OPENID` or `OPENID_SSO`.
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100200+
201Domain is case insensitive and must be in the same form as it
202appears in the email address, for example, "example.com".
203+
204By default, any domain is accepted.
205
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700206[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
207+
208Time in seconds before an OpenID provider must force the user
209to authenticate themselves again before authentication to this
210Gerrit server. Currently this is only a polite request, and users
211coming from providers that don't support the PAPE extension will
212be accepted anyway. In the future it may be enforced, rejecting
213users coming from providers that don't honor the max session age.
214+
215If set to 0, the provider will always force the user to authenticate
216(e.g. supply their password). Values should use common unit suffixes
217to express their setting:
218+
219* s, sec, second, seconds
220* m, min, minute, minutes
221* h, hr, hour, hours
222* d, day, days
223* w, week, weeks (`1 week` is treated as `7 days`)
224* mon, month, months (`1 month` is treated as `30 days`)
225* y, year, years (`1 year` is treated as `365 days`)
226
227+
228Default is -1, permitting infinite time between authentications.
229
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700230[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
231+
232Time in seconds before an email verification token sent to a user in
233order to validate their email address expires.
234+
235* s, sec, second, seconds
236* m, min, minute, minutes
237* h, hr, hour, hours
238* d, day, days
239* w, week, weeks (`1 week` is treated as `7 days`)
240* mon, month, months (`1 month` is treated as `30 days`)
241* y, year, years (`1 year` is treated as `365 days`)
242
243+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800244Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700245
James E. Blairca8bc3b2011-12-21 18:12:26 +0000246[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
247+
David Pursehouse42f42042013-08-01 14:02:25 +0900248The SSO entry point URL. Only used if `auth.type` is set to
249`OpenID_SSO`.
James E. Blairca8bc3b2011-12-21 18:12:26 +0000250+
251The "Sign In" link will send users directly to this URL.
252
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700253[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700254+
255HTTP header to trust the username from, or unset to select HTTP basic
David Pursehouse42f42042013-08-01 14:02:25 +0900256or digest authentication. Only used if `auth.type` is set to `HTTP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700257
Luca Milanesio384ed6c2013-07-30 09:10:07 +0100258[[auth.httpDisplaynameHeader]]auth.httpDisplaynameHeader::
259+
260HTTP header to retrieve the user's display name from. Only used if `auth.type`
261is set to `HTTP`.
262+
263If set, Gerrit trusts and enforces the user's full name using the HTTP header
264and disables the ability to manually modify the user's full name
265from the contact information page.
266
267[[auth.httpEmailHeader]]auth.httpEmailHeader::
268+
269HTTP header to retrieve the user's e-mail from. Only used if `auth.type`
270is set to `HTTP`.
271+
272If set, Gerrit trusts and enforces the user's e-mail using the HTTP header
273and disables the ability to manually modify or register other e-mails
274from the contact information page.
275
Luca Milanesio5185b042013-07-27 22:03:06 +0100276[[auth.loginUrl]]auth.loginUrl::
277+
278URL to redirect a browser to after the end-user has clicked on the
David Pursehouse42f42042013-08-01 14:02:25 +0900279login link in the upper right corner. Only used if `auth.type` is set
280to `HTTP` or `HTTP_LDAP`.
Luca Milanesio5185b042013-07-27 22:03:06 +0100281Organizations using an enterprise single-sign-on solution may want to
282redirect the browser to the SSO product's sign-in page for completing the
283login process and validate their credentials.
284+
David Pursehouse42f42042013-08-01 14:02:25 +0900285If set, Gerrit allows anonymous access until the end-user performs the login
286and provides a trusted identity through the HTTP header.
Luca Milanesio5185b042013-07-27 22:03:06 +0100287If not set, Gerrit requires the HTTP header with a trusted identity
David Pursehouse42f42042013-08-01 14:02:25 +0900288and returns the error page 'LoginRedirect.html' if such a header is not
289present.
Luca Milanesio5185b042013-07-27 22:03:06 +0100290
291[[auth.loginText]]auth.loginText::
292+
David Pursehouse42f42042013-08-01 14:02:25 +0900293Text displayed in the loginUrl link. Only used if `auth.loginUrl` is set.
Luca Milanesio5185b042013-07-27 22:03:06 +0100294+
David Pursehouse42f42042013-08-01 14:02:25 +0900295If not set, the "Sign In" text is used.
Luca Milanesio5185b042013-07-27 22:03:06 +0100296
Luca Milanesio111e0b72013-08-15 18:56:42 +0100297[[auth.registerPageUrl]]auth.registerPageUrl::
298+
David Pursehouse268744b2013-08-17 15:32:11 +0900299URL of the registration page to use when a new user logs in to Gerrit for
300the first time. Used only when `auth.type` is set to `HTTP`.
Luca Milanesio111e0b72013-08-15 18:56:42 +0100301+
302If not set, the standard Gerrit registration page `/#/register/` is displayed.
303
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700304[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700305+
306URL to redirect a browser to after the end-user has clicked on the
307"Sign Out" link in the upper right corner. Organizations using an
308enterprise single-sign-on solution may want to redirect the browser
309to the SSO product's sign-out page.
310+
311If not set, the redirect returns to the list of all open changes.
312
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800313[[auth.registerUrl]]auth.registerUrl::
314+
315Target for the "Register" link in the upper right corner. Used only
David Pursehouse42f42042013-08-01 14:02:25 +0900316when `auth.type` is `LDAP`.
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800317+
318If not set, no "Register" link is displayed.
319
Chad Horohoe65897082012-11-10 10:26:25 -0800320[[auth.registerText]]auth.registerText::
321+
322Text for the "Register" link in the upper right corner. Used only
David Pursehouse42f42042013-08-01 14:02:25 +0900323when `auth.type` is `LDAP`.
Chad Horohoe65897082012-11-10 10:26:25 -0800324+
325If not set, defaults to "Register".
326
David Pursehouse3d604492013-01-25 17:41:53 +0900327[[auth.editFullNameUrl]]auth.editFullNameUrl::
328+
329Target for the "Edit" button when the user is allowed to edit their
330full name.
331
332[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
333+
David Pursehouse42f42042013-08-01 14:02:25 +0900334Target for the "Obtain Password" link. Used only when `auth.type` is
David Pursehouse3d604492013-01-25 17:41:53 +0900335`LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700336
337[[auth.switchAccountUrl]]auth.switchAccountUrl::
David Pursehouse3d604492013-01-25 17:41:53 +0900338+
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700339URL to switch user identities and login as a different account than
340the currently active account. This is disabled by default except when
341`auth.type` is `OPENID` and `DEVELOPMENT_BECOME_ANY_ACCOUNT`. If set
342the "Switch Account" link is displayed next to "Sign Out".
343+
344When `auth.type` does not normally enable this URL administrators may
345set this to `login/` or `$canonicalWebUrl/login`, allowing users to
346begin a new web session.
David Pursehouse3d604492013-01-25 17:41:53 +0900347
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000348[[auth.cookiePath]]auth.cookiePath::
349+
350Sets "path" attribute of the authentication cookie.
351+
352If not set, HTTP request's path is used.
353
354[[auth.cookieSecure]]auth.cookieSecure::
355+
356Sets "secure" flag of the authentication cookie. If true, cookies
357will be transmitted only over HTTPS protocol.
358+
359By default, false.
360
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700361[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700362+
363Optional format string to construct user email addresses out of
David Pursehouse42f42042013-08-01 14:02:25 +0900364user login names. Only used if `auth.type` is `HTTP`, `HTTP_LDAP`
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700365or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700366+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700367This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700368with the login name. E.g. "\{0\}+gerrit@example.com" with a user
369login name of "foo" will produce "foo+gerrit@example.com" during
370the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700371+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700372If the site is using `HTTP_LDAP` or `LDAP`, using this option is
373discouraged. Setting `ldap.accountEmailAddress` and importing the
374email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700375
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700376[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700377+
378Controls whether or not the contributor agreement features are
379enabled for the Gerrit site. If enabled a user must complete a
380contributor agreement before they can upload changes.
381+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800382If enabled, the admin must also add one or more
383link:config-cla.html[contributor-agreement sections]
384in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700385`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700386more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700387+
388By default this is false (no agreements are used).
Fredrik Luthandera3cf3542012-07-04 16:55:35 -0700389+
390To enable the actual usage of contributor agreement the project
391specific config option in the `project.config` must be set:
392link:config-project-config.html[receive.requireContributorAgreement].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700393
Christian Halstricka3d88a52011-08-31 09:21:41 +0200394[[auth.trustContainerAuth]]auth.trustContainerAuth::
395+
396If true then it is the responsibility of the container hosting
397Gerrit to authenticate users. In this case Gerrit will blindly trust
398the container.
399+
400This parameter only affects git over http traffic. If set to false
401then Gerrit will do the authentication (using DIGEST authentication).
402+
403By default this is set to false.
404
Luca Milanesio42058842012-01-05 21:25:38 +0000405[[auth.gitBasicAuth]]auth.gitBasicAuth::
406+
407If true then Git over HTTP and HTTP/S traffic is authenticated using
Edwin Kempin4b9d9982014-04-16 11:27:46 +0200408standard BasicAuth and the credentials are validated using the same
409auth method as configured for the Gerrit Web UI.
Luca Milanesio42058842012-01-05 21:25:38 +0000410+
Edwin Kempin4b9d9982014-04-16 11:27:46 +0200411This parameter affects git over HTTP traffic and access to the REST
412API. If set to false then Gerrit will authenticate through DIGEST
413authentication and the randomly generated HTTP password in the Gerrit
414database.
Luca Milanesio42058842012-01-05 21:25:38 +0000415+
Edwin Kempinc5eb0032014-04-16 11:09:58 +0200416When `auth.type` is `LDAP`, service users that only exist in the Gerrit
417database are still authenticated by their HTTP passwords.
Luca Milanesio42058842012-01-05 21:25:38 +0000418+
419By default this is set to false.
420
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200421[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
422+
423If set the username that is received to authenticate a git operation
424is converted to lower case for looking up the user account in Gerrit.
425+
426By setting this parameter a case insensitive authentication for the
427git operations can be achieved, if it is ensured that the usernames in
428Gerrit (scheme `username`) are stored in lower case (e.g. if the
429parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
430set to `${sAMAccountName.toLowerCase}`). It is important that for all
431existing accounts this username is already in lower case. It is not
432possible to convert the usernames of the existing accounts to lower
433case because this would break the access to existing per-user
434branches.
435+
436This parameter only affects git over http and git over SSH traffic.
437+
438By default this is set to false.
439
Shawn Pearcea931fe12013-06-11 12:29:17 -0700440[[auth.enableRunAs]]auth.enableRunAs::
441+
442If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
443header from any users granted the link:access-control.html#capability_runAs[Run As]
444capability. The header and capability permit the authenticated user
445to impersonate another account.
446+
447If false the feature is disabled and cannot be re-enabled without
448editing gerrit.config and restarting the server.
449+
450Default is true.
451
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800452[[cache]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800453=== Section cache
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700454
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700455[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700456+
457Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700458future lookup. This local disk cache is used to retain potentially
459expensive to compute information across restarts. If the location
460does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700461+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700462If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700463+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700464Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700465
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700466[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700467+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700468Maximum age to keep an entry in the cache. Entries are removed from
469the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700470Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700471+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700472* s, sec, second, seconds
473* m, min, minute, minutes
474* h, hr, hour, hours
475* d, day, days
476* w, week, weeks (`1 week` is treated as `7 days`)
477* mon, month, months (`1 month` is treated as `30 days`)
478* y, year, years (`1 year` is treated as `365 days`)
479
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700480+
Edwin Kempinabcd5042013-03-12 16:04:37 +0100481If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700482supplied, the maximum age is infinite and items are never purged
483except when the cache is full.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700484+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700485Default is `0`, meaning store forever with no expire, except:
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700486+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400487* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700488* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700489* `"web_sessions"`: default is `12 hours`
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700490
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700491[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700492+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700493The total cost of entries to retain in memory. The cost computation
494varies by the cache. For most caches where the in-memory size of each
495entry is relatively the same, memoryLimit is currently defined to be
496the number of entries held by the cache (each entry costs 1).
497+
498For caches where the size of an entry can vary significantly between
499individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
500is an approximation of the total number of bytes stored by the cache.
501Larger entries that represent bigger patch sets or longer source files
502will consume a bigger portion of the memoryLimit. For these caches the
503memoryLimit should be set to roughly the amount of RAM (in bytes) the
504administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700505+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700506Default is 1024 for most caches, except:
507+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400508* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700509* `"diff"`: default is `10m` (10 MiB of memory)
510* `"diff_intraline"`: default is `10m` (10 MiB of memory)
511* `"plugin_resources"`: default is 2m (2 MiB of memory)
512
513+
514If set to 0 the cache is disabled. Entries are removed immediately
515after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700516
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700517[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700518+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700519Total size in bytes of the keys and values stored on disk. Caches that
520have grown bigger than this size are scanned daily at 1 AM local
521server time to trim the cache. Entries are removed in least recently
522accessed order until the cache fits within this limit. Caches may
523grow larger than this during the day, as the size check is only
524performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700525+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700526Default is 128 MiB per cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700527+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700528If 0, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700529
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800530==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700531
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700532cache `"accounts"`::
533+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700534Cache entries contain important details of an active user, including
535their display name, preferences, known email addresses, and group
536memberships. Entry information is obtained from the following
537database tables:
538+
539* `accounts`
540+
541* `account_group_members`
542+
543* `account_external_ids`
544
545+
546If direct updates are made to any of these database tables, this
547cache should be flushed.
548
549cache `"accounts_byemail"`::
550+
551Caches account identities keyed by email address, which is scanned
552from the `account_external_ids` database table. If updates are
553made to this table, this cache should be flushed.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700554
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400555cache `"adv_bases"`::
556+
557Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900558are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400559for the client to use as potential delta bases. Push over smart HTTP
560requires two HTTP requests, and this cache tries to carry state from
561the first request into the second to ensure it can complete.
562
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200563cache `"changes"`::
564+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200565The size of `memoryLimit` determines the number of projects for which
566all changes will be cached. If the cache is set to 1024, this means all
567changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800568+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200569Default value is 0 (disabled). It is disabled by default due to the fact
570that change updates are not communicated between Gerrit servers. Hence
571this cache should be disabled in an multi-master/multi-slave setup.
Gustaf Lundh53493772012-11-18 18:41:15 -0800572+
573The cache should be flushed whenever the database changes table is modified
Matt Baker8ce12fc2013-11-26 21:43:12 -0700574outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200575
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700576cache `"diff"`::
577+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700578Each item caches the differences between two commits, at both the
579directory and file levels. Gerrit uses this cache to accelerate
580the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700581+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700582Entries in this cache are relatively large, so memoryLimit is an
583estimate in bytes of memory used. Administrators should try to target
584cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
585day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700586
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400587cache `"diff_intraline"`::
588+
589Each item caches the intraline difference of one file, when compared
590between two commits. Gerrit uses this cache to accelerate display of
591intraline differences when viewing a file.
592+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700593Entries in this cache are relatively large, so memoryLimit is an
594estimate in bytes of memory used. Administrators should try to target
595cache.diff.memoryLimit to fit all files users will view in a 1 or 2
596day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400597
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700598cache `"git_tags"`::
599+
600If branch or reference level READ access controls are used, this
601cache tracks which tags are reachable from the branch tips of a
602repository. Gerrit uses this information to determine the set
603of tags that a client may access, derived from which tags are
604part of the history of a visible branch.
605+
606The cache is persisted to disk across server restarts as it can
607be expensive to compute (60 or more seconds for a large history
608like the Linux kernel repository).
609
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700610cache `"groups"`::
611+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700612Caches the basic group information from the `account_groups` table,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700613including the group owner, name, and description.
614+
615Gerrit group membership obtained from the `account_group_members`
616table is cached under the `"accounts"` cache, above. External group
617membership obtained from LDAP is cached under `"ldap_groups"`.
618
Matt Fischer620255a2011-03-22 14:28:23 -0500619cache `"groups_byinclude"`::
620+
621Caches group inclusions in other groups. If direct updates are made
622to the `account_group_includes` table, this cache should be flushed.
623
Bruce Zu825125a2014-11-19 17:01:42 +0900624cache `"groups_members"`::
625+
626Caches subgroups. If direct updates are made to the
627`account_group_includes` table, this cache should be flushed.
628
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700629cache `"ldap_groups"`::
630+
631Caches the LDAP groups that a user belongs to, if LDAP has been
632configured on this server. This cache should be configured with a
633low maxAge setting, to ensure LDAP modifications are picked up in
634a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700635
Gustaf Lundh0919a492012-10-19 15:29:23 +0200636cache `"ldap_groups_byinclude"`::
637+
638Caches the hierarchical structure of LDAP groups.
639
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -0700640cache `"ldap_usernames"`::
641+
642Caches a mapping of LDAP username to Gerrit account identity. The
643cache automatically updates when a user first creates their account
644within Gerrit, so the cache expire time is largely irrelevant.
645
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700646cache `"permission_sort"`::
647+
David Pursehouse221d4f62012-06-08 17:38:08 +0900648Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700649reference. Sorting the sections can be expensive when regular
650expressions are used, so this cache remembers the ordering for
651each branch.
652
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700653cache `"plugin_resources"`::
654+
655Caches formatted plugin resources, such as plugin documentation that
656has been converted from Markdown to HTML. The memoryLimit refers to
657the bytes of memory dedicated to storing the documentation.
658
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700659cache `"projects"`::
660+
661Caches the project description records, from the `projects` table
662in the database. If a project record is updated or deleted, this
663cache should be flushed. Newly inserted projects do not require
664a cache flush, as they will be read upon first reference.
665
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700666cache `"sshkeys"`::
667+
668Caches unpacked versions of user SSH keys, so the internal SSH daemon
669can match against them during authentication. The unit of storage
670is per-user, so 1024 items translates to 1024 unique user accounts.
671As each individual user account may configure multiple SSH keys,
672the total number of keys may be larger than the item count.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700673+
674This cache is based off the `account_ssh_keys` table and the
675`accounts.ssh_user_name` column in the database. If either is
676modified directly, this cache should be flushed.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700677
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700678cache `"web_sessions"`::
679+
680Tracks the live user sessions coming in over HTTP. Flushing this
681cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -0700682them to sign-in again. To avoid breaking active users, this cache
683is not flushed automatically by `gerrit flush-caches --all`, but
684instead must be explicitly requested.
685+
686If no disk cache is configured (or `cache.web_sessions.diskLimit`
687is set to 0) a server restart will force all users to sign-out,
688and need to sign-in again after the restart, as the cache was
689unable to persist the session information. Enabling a disk cache
690is strongly recommended.
691+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700692Session storage is relatively inexpensive. The average entry in
693this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700694
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700695See also link:cmd-flush-caches.html[gerrit flush-caches].
696
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800697==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800698
Edwin Kempin42d27432013-11-24 17:06:24 +0100699[[cache.diff_intraline.maxIdleWorkers]]cache.diff_intraline.maxIdleWorkers::
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800700+
701Number of idle worker threads to maintain for the intraline difference
702computations. There is no upper bound on how many concurrent requests
703can occur at once, if additional threads are started to handle a peak
David Pursehouse221d4f62012-06-08 17:38:08 +0900704load, only this many will remain idle afterwards.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800705+
706Default is 1.5x number of available CPUs.
707
Edwin Kempin42d27432013-11-24 17:06:24 +0100708[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800709+
710Maximum number of milliseconds to wait for intraline difference data
711before giving up and disabling it for a particular file pair. This is
712a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +0900713implementation.
714+
715If computation takes longer than the timeout, the worker thread is
716terminated, an error message is shown, and no intraline difference is
717displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800718+
719Values should use common unit suffixes to express their setting:
720+
721* ms, milliseconds
722* s, sec, second, seconds
723* m, min, minute, minutes
724* h, hr, hour, hours
725
726+
727If a unit suffix is not specified, `milliseconds` is assumed.
728+
729Default is 5 seconds.
730
Edwin Kempin42d27432013-11-24 17:06:24 +0100731[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800732+
733Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800734when populating a diff cache entry. This flag is provided primarily
735as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +0900736necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800737this setting will fallback to `cache.diff.intraline` if not set in the
738configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800739+
740Default is true, enabled.
741
Edwin Kempin42d27432013-11-24 17:06:24 +0100742[[cache.projects.checkFrequency]]cache.projects.checkFrequency::
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700743+
744How often project configuration should be checked for update from Git.
745Gerrit Code Review caches project access rules and configuration in
746memory, checking the refs/meta/config branch every checkFrequency
747minutes to see if a new revision should be loaded and used for future
748access. Values can be specified using standard time unit abbreviations
749('ms', 'sec', 'min', etc.).
750+
751If set to 0, checks occur every time, which may slow down operations.
Shawn Pearcec825ef12013-02-20 11:29:46 -0800752If set to 'disabled' or 'off', no check will ever be done.
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700753Administrators may force the cache to flush with
754link:cmd-flush-caches.html[gerrit flush-caches].
755+
756Default is 5 minutes.
757
Simon Leifc19ff12014-10-02 13:36:00 -0400758[[cache.projects.loadOnStartup]]cache.projects.loadOnStartup::
759+
760If the project cache should be loaded during server startup.
761+
762The cache is loaded concurrently. Admins should ensure that the cache
763size set under <<cache.name.memoryLimit,cache.projects.memoryLimit>>
764is not smaller than the number of repos.
765+
766Default is false, disabled.
767
768[[cache.projects.loadThreads]]cache.projects.loadThreads::
769+
770Only relevant if <<cache.projects.loadOnStartup,cache.projects.loadOnStartup>>
771is true.
772+
773The number of threads to allocate for loading the cache at startup. These
774threads will die out after the cache is loaded.
775+
776Default is the number of CPUs.
777
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800778[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800779=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700780
Edwin Kempin662e55f2013-11-23 12:50:29 +0100781[[change.largeChange]]change.largeChange::
782+
783Number of changed lines from which on a change is considered as a large
784change. The number of changed lines of a change is the sum of the lines
785that were inserted and deleted in the change.
786+
David Pursehousea1d633b2014-05-02 17:21:02 +0900787The specified value is used to visualize the change sizes in the Web UI
Edwin Kempin662e55f2013-11-23 12:50:29 +0100788in change tables and user dashboards.
789+
790By default 500.
791
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700792[[change.updateDelay]]change.updateDelay::
793+
794How often in seconds the web interface should poll for updates to the
795currently open change. The poller relies on the client's browser
796cache to use If-Modified-Since and respect `304 Not Modified` HTTP
Matt Baker8ce12fc2013-11-26 21:43:12 -0700797responses. This allows for fast polls, often under 8 milliseconds.
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700798+
799With a configured 30 second delay a server with 4900 active users will
800typically need to dedicate 1 CPU to the update check. 4900 users
801divided by an average delay of 30 seconds is 163 requests arriving per
Edwin Kempin720eebe2014-07-16 13:44:04 +0200802second. If requests are served at \~6 ms response time, 1 CPU is
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700803necessary to keep up with the update request traffic. On a smaller
804user base of 500 active users, the default 30 second delay is only 17
805requests per second and requires ~10% CPU.
806+
807If 0 the update polling is disabled.
808+
809Default is 30 seconds.
810
David Ostrovsky1b61dc72014-01-28 18:40:48 +0100811[[change.allowDrafts]]change.allowDrafts::
812+
813Allow drafts workflow. If set to false, drafts cannot be created,
814deleted or published.
815+
816Default is true.
817
David Ostrovsky9933eb32014-05-20 16:08:20 +0200818[[change.submitLabel]]change.submitLabel::
819+
820Label name for the submit button.
821+
822Default is "Submit".
823
824[[change.submitTooltip]]change.submitTooltip::
825+
826Tooltip for the submit button. Variables available for replacement
827include `${patchSet}` for the current patch set number (1, 2, 3),
828`${branch}` for the branch name ("master") and `${commit}` for the
829abbreviated commit SHA-1 (`c9c0edb`).
830+
831Default is "Submit patch set ${patchSet} into ${branch}".
832
Stefan Bellera038cf72015-01-13 16:25:10 -0800833[[change.submitWholeTopic]]change.submitWholeTopic::
834+
835Determines if the submit button submits the whole topic instead of
836just the current change.
837+
838Default is false.
839
840[[change.submitTopicLabel]]change.submitTopicLabel::
841+
842If `change.submitWholeTopic` is set and a change has a topic,
843the label name for the submit button is given here instead of
844the configuration `change.submitLabel`.
845+
846Defaults to "Submit whole topic"
847
848[[change.submitTopicTooltip]]change.submitTopicTooltip::
849+
850If `change.submitWholeTopic` is configuerd to true and a change has a
851topic, this configuration determines the tooltip for the submit button
852instead of `change.submitTooltip`. The variable `${topicSize}` is available
853for the number of changes to be submitted.
854+
855Defaults to "Submit all ${topicSize} changes within the topic".
856
Richard Möhne4abe9a2014-11-13 20:05:13 +0100857[[change.replyLabel]]change.replyLabel::
858+
859Label name for the reply button. In the user interface an ellipsis (…)
860is appended.
861+
862Default is "Reply". In the user interface it becomes "Reply…".
863
864[[change.replyTooltip]]change.replyTooltip::
865+
866Tooltip for the reply button. In the user interface a note about the
867keyboard shortcut is appended.
868+
869Default is "Reply and score". In the user interface it becomes "Reply
870and score (Shortcut: a)".
871
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800872[[changeMerge]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800873=== Section changeMerge
carloseduardo.baldacin14246de2011-07-14 17:52:22 -0300874
Edwin Kempin42d27432013-11-24 17:06:24 +0100875[[changeMerge.checkFrequency]]changeMerge.checkFrequency::
Dave Borowitz204669c22012-10-11 11:06:08 -0700876+
877How often the database should be rescanned for changes that have been
878submitted but not merged due to transient errors. Values can be
879specified using standard time unit abbreviations ('ms', 'sec', 'min',
880etc.). Set to 0 to disable periodic rescanning, only scanning once on
881master node startup.
882+
883Default is 300 seconds (5 minutes).
884
Edwin Kempinf8be8fd2013-11-18 14:12:20 +0100885[[changeMerge.threadPoolSize]]changeMerge.threadPoolSize::
886+
Dave Borowitz0916cc32014-10-23 10:24:01 -0700887_Deprecated:_ Formerly used to control thread pool size for background
888mergeability checks. These checks were moved to the indexing threadpool,
889so this value is now used for
890link:#index.batchThreads[index.batchThreads], only if that value is not
891provided.
Edwin Kempinf8be8fd2013-11-18 14:12:20 +0100892+
Dave Borowitz0916cc32014-10-23 10:24:01 -0700893This option may be removed in a future version.
Edwin Kempinf8be8fd2013-11-18 14:12:20 +0100894
Dave Borowitz6ea964a2014-03-26 16:49:45 -0700895[[changeMerge.interactiveThreadPoolSize]]changeMerge.interactiveThreadPoolSize::
896+
Dave Borowitz0916cc32014-10-23 10:24:01 -0700897_Deprecated:_ Formerly used to control thread pool size for interactive
898mergeability checks. These checks were moved to the indexing threadpool,
899so this value is now used for link:#index.threads[index.threads], only
900if that value is not provided.
Dave Borowitz6ea964a2014-03-26 16:49:45 -0700901+
Dave Borowitz0916cc32014-10-23 10:24:01 -0700902This option may be removed in a future version.
Dave Borowitz6ea964a2014-03-26 16:49:45 -0700903
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800904[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800905=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800906
Brad Larson991a31b2009-11-03 14:30:26 -0600907Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -0500908patch comments, in-line code comments and approval category value descriptions
909to turn set strings into hyperlinks. One common use is for linking to
910bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -0600911
912In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800913will match typical Gerrit Change-Id values and create a hyperlink
914to changes which reference it. The second configuration 'bugzilla'
915will hyperlink terms such as 'bug 42' to an external bug tracker,
916supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +0900917configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800918how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -0600919
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800920----
921[commentlink "changeid"]
922 match = (I[0-9a-f]{8,40})
Dave Borowitz86caf9e2014-02-10 15:58:20 -0800923 link = "#q,$1"
Brad Larson991a31b2009-11-03 14:30:26 -0600924
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800925[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -0800926 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800927 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -0600928
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800929[commentlink "tracker"]
930 match = ([Bb]ug:\\s+)(\\d+)
931 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
932----
933
Dave Borowitz13b38002013-04-08 12:03:29 -0700934Comment links can also be specified in `project.config` and sections in
935children override those in parents. The only restriction is that to
936avoid injecting arbitrary user-supplied HTML in the page, comment links
937defined in `project.config` may only supply `link`, not `html`.
938
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800939[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -0600940+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800941A JavaScript regular expression to match positions to be replaced
942with a hyperlink. Subexpressions of the matched string can be
943stored using groups and accessed with `$'n'` syntax, where 'n'
944is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -0600945+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -0800946The configuration file parser eats one level of backslashes, so the
947character class `\s` requires `\\s` in the configuration file. The
948parser also terminates the line at the first `#`, so a match
949expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800950+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -0800951To match case insensitive strings, a character class with both the
952upper and lower case character for each position must be used. For
953example, to match the string `bug` in a case insensitive way the match
954pattern `[bB][uU][gG]` needs to be used.
955+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800956A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -0600957
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800958[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -0600959+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -0800960The URL to direct the user to whenever the regular expression is
961matched. Groups in the match expression may be accessed as `$'n'`.
962+
963The link property is used only when the html property is not present.
964
965[[commentlink.name.html]]commentlink.<name>.html::
966+
967HTML to replace the entire matched string with. If present,
968this property overrides the link property above. Groups in the
969match expression may be accessed as `$'n'`.
970+
971The configuration file eats double quotes, so escaping them as
972`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -0600973
Dave Borowitz82d79c02013-04-08 15:45:12 -0700974[[commentlink.name.enabled]]commentlink.<name>.enabled::
975+
976Whether the comment link is enabled. A child project may override a
977section in a parent or the site-wide config that is disabled by
978specifying `enabled = true`.
979+
980Disabling sections in `gerrit.config` can be used by site administrators
981to create a library of comment links with `html` set that are not
982user-supplied and thus can be verified to be XSS-free, but are only
983enabled for a subset of projects.
984+
David Pursehouse6f1af472013-12-11 19:23:33 +0900985By default, true.
986+
Dave Borowitz82d79c02013-04-08 15:45:12 -0700987Note that the names and contents of disabled sections are visible even
988to anonymous users via the
989link:rest-api-projects.html#get-config[REST API].
990
Brad Larson991a31b2009-11-03 14:30:26 -0600991
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800992[[contactstore]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800993=== Section contactstore
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700994
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700995[[contactstore.url]]contactstore.url::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700996+
997URL of the web based contact store Gerrit will send any offline
998contact information to when it collects the data from users as part
999of a contributor agreement.
1000+
1001See link:config-contact.html[Contact Information].
1002
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001003[[contactstore.appsec]]contactstore.appsec::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001004+
1005Shared secret of the web based contact store.
1006
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001007
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001008[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001009=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001010
1011These settings are applied only if Gerrit is started as the container
1012process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
1013
1014[[container.heapLimit]]container.heapLimit::
1015+
1016Maximum heap size of the Java process running Gerrit, in bytes.
1017This property is translated into the '-Xmx' flag for the JVM.
1018+
1019Default is platform and JVM specific.
1020+
1021Common unit suffixes of 'k', 'm', or 'g' are supported.
1022
1023[[container.javaHome]]container.javaHome::
1024+
1025Path of the JRE/JDK installation to run Gerrit with. If not set, the
1026Gerrit startup script will attempt to search your system and guess
1027a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
1028
1029[[container.javaOptions]]container.javaOptions::
1030+
1031Additional options to pass along to the Java runtime. If multiple
1032values are configured, they are passed in order on the command line,
1033separated by spaces. These options are appended onto 'JAVA_OPTIONS'.
1034
David Ostrovskyc772bd82013-10-03 10:37:51 +02001035For example, it is possible to overwrite Gerrit's default log4j
1036configuration:
1037
1038----
1039 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
1040----
1041
Hugo Arès6710f0a2014-11-04 10:28:42 -05001042[[container.daemonOpt]]container.daemonOpt::
1043+
1044Additional options to pass to the daemon (e.g. '--enable-httpd'). If
1045multiple values are configured, they are passed in that order to the command
1046line, separated by spaces.
1047+
1048Execute `java -jar gerrit.war daemon --help` to see all possible
1049options.
1050
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001051[[container.slave]]container.slave::
1052+
1053Used on Gerrit slave installations. If set to true the Gerrit JVM is
1054called with the '--slave' switch, enabling slave mode. If no value is
Matt Baker8ce12fc2013-11-26 21:43:12 -07001055set (or any other value), Gerrit defaults to master mode.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001056
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001057[[container.user]]container.user::
1058+
1059Login name (or UID) of the operating system user the Gerrit JVM
1060will execute as. If not set, defaults to the user who launched
1061the 'gerrit.sh' wrapper script.
1062
1063[[container.war]]container.war::
1064+
1065Path of the JAR file to start daemon execution with. This should
1066be the path of the local 'gerrit.war' archive. Overrides the
1067environment variable 'GERRIT_WAR'.
1068+
1069If not set, defaults to '$site_path/bin/gerrit.war', or to
1070'$HOME/gerrit.war'.
1071
1072
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001073[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001074=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001075
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001076[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001077+
1078Number of bytes of a pack file to load into memory in a single
1079read operation. This is the "page size" of the JGit buffer cache,
1080used for all pack access operations. All disk IO occurs as single
1081window reads. Setting this too large may cause the process to load
1082more data than is required; setting this too small may increase
1083the frequency of `read()` system calls.
1084+
1085Default on JGit is 8 KiB on all platforms.
1086+
1087Common unit suffixes of 'k', 'm', or 'g' are supported.
1088
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001089[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001090+
1091Maximum number of bytes to load and cache in memory from pack files.
1092If JGit needs to access more than this many bytes it will unload less
1093frequently used windows to reclaim memory space within the process.
1094As this buffer must be shared with the rest of the JVM heap, it
1095should be a fraction of the total memory available.
1096+
1097Default on JGit is 10 MiB on all platforms.
1098+
1099Common unit suffixes of 'k', 'm', or 'g' are supported.
1100
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001101[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001102+
1103Maximum number of bytes to reserve for caching base objects
1104that multiple deltafied objects reference. By storing the entire
1105decompressed base object in a cache Git is able to avoid unpacking
1106and decompressing frequently used base objects multiple times.
1107+
1108Default on JGit is 10 MiB on all platforms. You probably do not
1109need to adjust this value.
1110+
1111Common unit suffixes of 'k', 'm', or 'g' are supported.
1112
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001113[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001114+
1115Maximum number of pack files to have open at once. A pack file
1116must be opened in order for any of its data to be available in
1117a cached window.
1118+
1119If you increase this to a larger setting you may need to also adjust
1120the ulimit on file descriptors for the host JVM, as Gerrit needs
1121additional file descriptors available for network sockets and other
1122repository data manipulation.
1123+
1124Default on JGit is 128 file descriptors on all platforms.
1125
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001126[[core.streamFileThreshold]]core.streamFileThreshold::
1127+
1128Largest object size, in bytes, that JGit will allocate as a
1129contiguous byte array. Any file revision larger than this threshold
1130will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001131files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001132during delta decompression.
1133+
1134Servers with very high traffic should set this to be larger than
1135the size of their common big files. For example a server managing
1136the Android platform typically has to deal with ~10-12 MiB XML
1137files, so `15 m` would be a reasonable setting in that environment.
1138Setting this too high may cause the JVM to run out of heap space
1139when handling very big binary files, such as device firmware or
1140CD-ROM ISO images.
1141+
Edwin Kempin7f5a4af2014-11-12 10:05:03 +01001142Defaults to 25% of the available JVM heap, limited to 2048m.
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001143+
1144Common unit suffixes of 'k', 'm', or 'g' are supported.
1145
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001146[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001147+
1148When true, JGit will use `mmap()` rather than `malloc()+read()`
1149to load data from pack files. The use of mmap can be problematic
1150on some JVMs as the garbage collector must deduce that a memory
1151mapped segment is no longer in use before a call to `munmap()`
1152can be made by the JVM native code.
1153+
1154In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001155pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001156of virtual address space, as the garbage collector cannot reclaim
1157unused mapped spaces fast enough.
1158+
1159Default on JGit is false. Although potentially slower, it yields
1160much more predictable behavior.
1161
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001162[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1163+
1164Size of the buffer to store logging events for asynchronous logging.
1165Putting a larger value can protect threads from stalling when the
1166AsyncAppender threads are not fast enough to consume the logging events
1167from the buffer. It also protects from loosing log entries in this case.
1168+
1169Default is 64 entries.
1170
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001171[[core.useRecursiveMerge]]core.useRecursiveMerge::
1172+
Edwin Kempin71831d22014-07-15 08:54:29 +02001173Use JGit's recursive merger for three-way merges. This only affects
1174projects configured to automatically resolve conflicts.
1175+
1176As explained in this
1177link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[
1178blog], the recursive merge produces better results if the two commits
1179that are merged have more than one common predecessor.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001180+
Edwin Kempin7853c5b2014-07-15 08:57:17 +02001181Default is true.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001182
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001183[[database]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001184=== Section database
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001185
1186The database section configures where Gerrit stores its metadata
1187records about user accounts and change reviews.
1188
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001189----
1190[database]
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001191 type = POSTGRESQL
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001192 hostname = localhost
1193 database = reviewdb
1194 username = gerrit2
1195 password = s3kr3t
1196----
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001197
1198[[database.type]]database.type::
1199+
1200Type of database server to connect to. If set this value will be
1201used to automatically create correct database.driver and database.url
1202values to open the connection.
1203+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001204* `POSTGRESQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001205+
1206Connect to a PostgreSQL database server.
1207+
1208* `H2`
1209+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001210Connect to a local embedded H2 database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001211+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001212* `MYSQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001213+
1214Connect to a MySQL database server.
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001215+
1216* `JDBC`
1217+
1218Connect using a JDBC driver class name and URL.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001219
1220+
1221If not specified, database.driver and database.url are used as-is,
1222and if they are also not specified, defaults to H2.
1223
1224[[database.hostname]]database.hostname::
1225+
1226Hostname of the database server. Defaults to 'localhost'.
1227
1228[[database.port]]database.port::
1229+
1230Port number of the database server. Defaults to the default port
1231of the server named by database.type.
1232
1233[[database.database]]database.database::
1234+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001235For POSTGRESQL or MYSQL, the name of the database on the server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001236+
1237For H2, this is the path to the database, and if not absolute is
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001238relative to `'$site_path'`.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001239
1240[[database.username]]database.username::
1241+
1242Username to connect to the database server as.
1243
1244[[database.password]]database.password::
1245+
1246Password to authenticate to the database server with.
1247
1248[[database.driver]]database.driver::
1249+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001250Name of the JDBC driver class to connect to the database with.
1251Setting this usually isn't necessary as it can be derived from
1252database.type or database.url for any supported database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001253
1254[[database.url]]database.url::
1255+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001256'jdbc:' URL for the database. Setting this variable usually
1257isn't necessary as it can be constructed from the all of the
1258above properties.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001259
Christian Aistleitner851072a2013-05-05 15:04:09 +02001260[[database.connectionPool]]database.connectionPool::
1261+
1262If true, use connection pooling for database connections. Otherwise, a
1263new database connection is opened for each request.
1264+
1265Default is false for MySQL, and true for other database backends.
1266
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001267[[database.poolLimit]]database.poolLimit::
1268+
1269Maximum number of open database connections. If the server needs
1270more than this number, request processing threads will wait up
1271to <<database.poolMaxWait, poolMaxWait>> seconds for a
1272connection to be released before they abort with an exception.
1273This limit must be several units higher than the total number of
1274httpd and sshd threads as some request processing code paths may
1275need multiple connections.
1276+
1277Default is 8.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001278+
1279This setting only applies if
1280<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001281
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001282[[database.poolMinIdle]]database.poolMinIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001283+
1284Minimum number of connections to keep idle in the pool.
1285Default is 4.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001286+
1287This setting only applies if
1288<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001289
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001290[[database.poolMaxIdle]]database.poolMaxIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001291+
1292Maximum number of connections to keep idle in the pool. If there
1293are more idle connections, connections will be closed instead of
1294being returned back to the pool.
1295Default is 4.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001296+
1297This setting only applies if
1298<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001299
1300[[database.poolMaxWait]]database.poolMaxWait::
1301+
1302Maximum amount of time a request processing thread will wait to
1303acquire a database connection from the pool. If no connection is
1304released within this time period, the processing thread will abort
1305its current operations and return an error to the client.
1306Values should use common unit suffixes to express their setting:
1307+
1308* ms, milliseconds
1309* s, sec, second, seconds
1310* m, min, minute, minutes
1311* h, hr, hour, hours
1312
1313+
1314If a unit suffix is not specified, `milliseconds` is assumed.
1315+
1316Default is `30 seconds`.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001317+
1318This setting only applies if
1319<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001320
David Ostrovsky38a6f6c2014-01-11 13:56:09 +01001321[[database.dataSourceInterceptorClass]]database.dataSourceInterceptorClass::
1322
1323Class that implements DataSourceInterceptor interface to monitor SQL activity.
1324This class must have default constructor and be available on Gerrit's bootstrap
1325classpath, e. g. in `$gerrit_site/lib` directory. Example implementation of
1326SQL monitoring can be found in javamelody-plugin.
1327
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001328[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001329=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03001330
1331----
1332[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001333 command = checkout
1334 command = cherry_pick
1335 command = pull
1336 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001337 scheme = ssh
1338 scheme = http
1339 scheme = anon_http
1340 scheme = anon_git
1341 scheme = repo_download
1342----
1343
1344The download section configures the allowed download methods.
1345
Edwin Kempin08b03a22012-09-14 16:32:57 +02001346[[download.command]]download.command::
1347+
1348Commands that should be offered to download changes.
1349+
1350Multiple commands are supported:
1351+
1352* `checkout`
1353+
1354Command to fetch and checkout the patch set.
1355+
1356* `cherry_pick`
1357+
1358Command to fetch the patch set and to cherry-pick it onto the current
1359commit.
1360+
1361* `pull`
1362+
1363Command to pull the patch set.
1364+
1365* `format_patch`
1366+
1367Command to fetch the patch set and to feed it into the `format-patch`
1368command.
1369
1370+
1371If `download.command` is not specified, all download commands are
1372offered.
1373
monica.dionisio3f630442010-06-29 15:42:57 -03001374[[download.scheme]]download.scheme::
1375+
1376Schemes that should be used to download changes.
1377+
1378Multiple schemes are supported:
1379+
1380* `http`
1381+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001382Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001383+
1384* `ssh`
1385+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001386Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001387+
1388* `anon_http`
1389+
1390Anonymous HTTP download is allowed.
1391+
1392* `anon_git`
1393+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001394Anonymous Git download is allowed. This is not default, it is also
1395necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1396variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001397+
1398* `repo_download`
1399+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001400Gerrit advertises patch set downloads with the `repo download`
1401command, assuming that all projects managed by this instance are
1402generally worked on with the repo multi-repository tool. This is
1403not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001404
1405+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001406If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001407downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001408
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001409[[download.archive]]download.archive::
1410+
1411Specifies which archive formats, if any, should be offered on the change
1412screen:
1413+
1414----
1415[download]
1416 archive = tar
1417 archive = tbz2
1418 archive = tgz
1419 archive = txz
1420----
1421
Shawn Pearce6edde312014-03-26 22:00:26 -07001422If `download.archive` is not specified defaults to all archive
1423commands. Set to `off` or empty string to disable.
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001424
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001425[[gc]]
1426=== Section gc
1427
1428This section allows to configure the git garbage collection and schedules it
1429to run periodically. It will be triggered and executed sequentially for all
1430projects.
1431
1432[[gc.startTime]]gc.startTime::
1433+
1434Start time to define the first execution of the git garbage collection.
1435If the configured `'gc.interval'` is shorter than `'gc.startTime - now'`
1436the start time will be preponed by the maximum integral multiple of
1437`'gc.interval'` so that the start time is still in the future.
1438+
1439----
1440<day of week> <hours>:<minutes>
1441or
1442<hours>:<minutes>
1443
1444<day of week> : Mon, Tue, Wed, Thu, Fri, Sat, Sun
1445<hours> : 00-23
1446<minutes> : 0-59
1447----
1448
1449
1450[[gc.interval]]gc.interval::
1451+
1452Interval for periodic repetition of triggering the git garbage collection.
1453The interval must be larger than zero. The following suffixes are supported
1454to define the time unit for the interval:
1455+
1456* `s, sec, second, seconds`
1457* `m, min, minute, minutes`
1458* `h, hr, hour, hours`
1459* `d, day, days`
1460* `w, week, weeks` (`1 week` is treated as `7 days`)
1461* `mon, month, months` (`1 month` is treated as `30 days`)
1462* `y, year, years` (`1 year` is treated as `365 days`)
1463
1464Examples::
1465+
1466----
1467gc.startTime = Fri 10:30
1468gc.interval = 2 day
1469----
1470+
1471Assuming the server is started on Mon 7:00 -> `'startTime - now = 4 days 3:30 hours'`.
1472This is larger than the interval hence prepone the start time
1473by the maximum integral multiple of the interval so that start
1474time is still in the future, i.e. prepone by 4 days. This yields
1475a start time of Mon 10:30, next executions are Wed 10:30, Fri 10:30
1476etc.
1477+
1478----
1479gc.startTime = 6:00
1480gc.interval = 1 day
1481----
1482+
1483Assuming the server is started on Mon 7:00 this yields the first run on next Tuesday
1484at 6:00 and a repetition interval of 1 day.
1485
1486
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001487[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001488=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001489
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001490[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001491+
1492Local filesystem directory holding all Git repositories that
1493Gerrit knows about and can process changes for. A project
1494entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02001495the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001496+
1497If relative, the path is resolved relative to `'$site_path'`.
1498
Shawn O. Pearce897d9212011-06-16 16:59:59 -07001499[[gerrit.allProjects]]gerrit.allProjects::
1500+
1501Name of the permissions-only project defining global server
1502access controls and settings. These are inherited into every
1503other project managed by the running server. The name is
1504relative to `gerrit.basePath`.
1505+
1506Defaults to `All-Projects` if not set.
1507
Edwin Kempin2bf5edd2014-03-25 22:21:23 +01001508[[gerrit.allUsers]]gerrit.allUsers::
1509+
1510Name of the project in which meta data of all users is stored.
1511The name is relative to `gerrit.basePath`.
1512+
1513Defaults to `All-Users` if not set.
1514
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001515[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001516+
1517The default URL for Gerrit to be accessed through.
1518+
1519Typically this would be set to "http://review.example.com/" or
1520"http://example.com/gerrit/" so Gerrit can output links that point
1521back to itself.
1522+
1523Setting this is highly recommended, as its necessary for the upload
1524code invoked by "git push" or "repo upload" to output hyperlinks
1525to the newly uploaded changes.
1526
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001527[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001528+
1529Optional base URL for repositories available over the anonymous git
1530protocol. For example, set this to `git://mirror.example.com/base/`
1531to have Gerrit display patch set download URLs in the UI. Gerrit
1532automatically appends the project name onto the end of the URL.
1533+
1534By default unset, as the git daemon must be configured externally
1535by the system administrator, and might not even be running on the
1536same host as Gerrit.
1537
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001538[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
1539+
1540Optional command to install the `commit-msg` hook. Typically of the
1541form:
David Pursehouse05588e52015-01-07 14:25:11 +09001542+
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001543----
1544fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
1545----
1546+
1547By default unset; falls back to using scp from the canonical SSH host,
1548or curl from the canonical HTTP URL for the server. Only necessary if a
1549proxy or other server/network configuration prevents clients from
1550fetching from the default location.
1551
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07001552[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
1553+
1554Optional base URL for repositories available over the HTTP
1555protocol. For example, set this to `http://mirror.example.com/base/`
1556to have Gerrit display URLs from this server, rather than itself.
1557+
1558By default unset, as the HTTP daemon must be configured externally
1559by the system administrator, and might not even be running on the
1560same host as Gerrit.
1561
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07001562[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
1563+
David Pursehouse214ab862014-12-01 11:48:26 +09001564URL to direct users to when they need to report a bug.
1565+
1566By default unset, meaning no bug report URL will be displayed. Administrators
1567should set this to the URL of their issue tracker, if necessary.
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07001568
David Pursehouse753ca332013-12-10 15:36:29 +09001569[[gerrit.reportBugText]]gerrit.reportBugText::
1570+
1571Text to be displayed in the link to the bug report URL.
1572+
David Pursehouse214ab862014-12-01 11:48:26 +09001573Only used when `gerrit.reportBugUrl` is set.
1574+
David Pursehouse753ca332013-12-10 15:36:29 +09001575Defaults to "Report Bug".
1576
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02001577[[gerrit.disableReverseDnsLookup]]gerrit.disableReverseDnsLookup::
1578+
1579Disables reverse DNS lookup during computing ref log entry for identified user.
1580+
1581Defaults to false.
1582
David Pursehouse962e1182014-12-03 17:17:52 +09001583[[gerrit.secureStoreClass]]gerrit.secureStoreClass::
1584+
1585Use the secure store implementation from a specified class.
1586+
1587If specified, must be the fully qualified class name of a class that implements
1588the `com.google.gerrit.server.securestore.SecureStore` interface, and the jar
1589file containing the class must be placed in the `$site_path/lib` folder.
1590+
1591If not specified, the default no-op implementation is used.
1592
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001593[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001594=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001595
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001596Gerrit can forward requests to either an internally managed gitweb
1597(which allows Gerrit to enforce some access controls), or to an
1598externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001599See also link:config-gitweb.html[Gitweb Integration].
1600
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001601[[gitweb.cgi]]gitweb.cgi::
1602+
1603Path to the locally installed `gitweb.cgi` executable. This CGI will
1604be called by Gerrit Code Review when the URL `/gitweb` is accessed.
1605Project level access controls are enforced prior to calling the CGI.
1606+
1607Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if gitweb.url is not set.
1608
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001609[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001610+
1611Optional URL of an affiliated gitweb service. Defines the
1612web location where a `gitweb.cgi` is installed to browse
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001613gerrit.basePath and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001614+
1615Gerrit appends any necessary query arguments onto the end of this URL.
1616For example, "?p=$project.git;h=$commit".
1617
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001618[[gitweb.type]]gitweb.type::
1619+
1620Optional type of affiliated gitweb service. This allows using
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001621alternatives to gitweb, such as cgit. If set to disabled there
1622is no gitweb hyperlinking support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001623+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001624Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001625
Edwin Kempind86909c2012-03-26 10:36:29 +02001626[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001627+
1628Optional pattern to use for constructing the gitweb URL when pointing
1629at a specific commit when `custom` is used above.
1630+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001631Valid replacements are `${project}` for the project name in Gerrit
1632and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001633
Edwin Kempind86909c2012-03-26 10:36:29 +02001634[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001635+
1636Optional pattern to use for constructing the gitweb URL when pointing
1637at a specific project when `custom` is used above.
1638+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001639Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001640
Edwin Kempind86909c2012-03-26 10:36:29 +02001641[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001642+
1643Optional pattern to use for constructing the gitweb URL when pointing
1644at a specific branch when `custom` is used above.
1645+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001646Valid replacements are `${project}` for the project name in Gerrit
1647and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001648
Colby Ranger79d4ebe2013-12-16 14:19:18 -08001649[[gitweb.roottree]]gitweb.roottree::
1650+
1651Optional pattern to use for constructing the gitweb URL when pointing
1652at the contents of the root tree in a specific commit when `custom` is
1653used above.
1654+
1655Valid replacements are `${project}` for the project name in Gerrit
1656and `${commit}` for the SHA1 hash for the commit.
1657
1658[[gitweb.file]]gitweb.file::
1659+
1660Optional pattern to use for constructing the gitweb URL when pointing
1661at the contents of a file in a specific commit when `custom` is used
1662above.
1663+
1664Valid replacements are `${project}` for the project name in Gerrit,
1665`${file}` for the file name and `${commit}` for the SHA1 hash for
1666the commit.
1667
Edwin Kempin64011562012-03-26 10:50:12 +02001668[[gitweb.filehistory]]gitweb.filehistory::
1669+
1670Optional pattern to use for constructing the gitweb URL when pointing
1671at the history of a file in a specific branch when `custom` is used
1672above.
1673+
1674Valid replacements are `${project}` for the project name in Gerrit,
1675`${file}` for the file name and `${branch}` for the name of the
1676branch.
1677
Gustaf Lundha07d2e72011-10-27 15:26:35 -07001678[[gitweb.linkname]]gitweb.linkname::
1679+
1680Optional setting for modifying the link name presented to the user
1681in the Gerrit web-UI.
1682+
1683Default linkname for custom type is "gitweb".
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001684
Adrian Goerlerf2007072011-11-10 08:39:55 +01001685[[gitweb.pathSeparator]]gitweb.pathSeparator::
1686+
1687Optional character to substitute the standard path separator (slash) in
1688project names and branch names.
1689+
1690By default, Gerrit will use hexadecimal encoding for slashes in project and
1691branch names. Some web servers, such as Tomcat, reject this hexadecimal
1692encoding in the URL.
1693+
1694Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
1695allow using an alternative path separator character. In Gitblit, this can be
1696configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
1697In Gerrit, the alternative path separator can be configured correspondingly
1698using the property 'gitweb.pathSeparator'.
1699+
1700Valid values are the characters '*', '(' and ')'.
1701
Luca Milanesio25312032013-10-11 11:34:39 +01001702[[gitweb.linkDrafts]]gitweb.urlEncode::
1703+
1704Whether or not Gerrit should encode the generated viewer URL.
1705+
1706Gerrit composes the viewer URL using information about the project, branch, file
1707or commit of the target object to be displayed. Typically viewers such as CGit
1708and GitWeb do need those parts to be encoded, including the '/' in project's name,
1709for being correctly parsed.
1710However other viewers could instead require an unencoded URL (e.g. GitHub web
1711based viewer)
1712+
1713Valid values are "true" and "false," default is "true."
1714
Chad Horohoe1dfe36c2013-04-12 14:52:56 -04001715[[gitweb.linkDrafts]]gitweb.linkDrafts::
1716+
1717Whether or not Gerrit should provide links to gitweb on draft patch sets.
1718+
1719By default, Gerrit will show links to gitweb on all patch sets. If gitweb
1720only allows publicly viewable references, set this to false to remove
1721the links to draft patch sets from the change review screen.
1722+
Luca Milanesio25312032013-10-11 11:34:39 +01001723Valid values are "true" and "false," default is "true".
Chad Horohoe1dfe36c2013-04-12 14:52:56 -04001724
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001725[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001726=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01001727
1728[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
1729+
1730Controls whether newly created groups should be by default visible to
1731all registered users.
1732+
1733By default, false.
1734
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001735[[hooks]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001736=== Section hooks
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001737
1738See also link:config-hooks.html[Hooks].
1739
1740[[hooks.path]]hooks.path::
1741+
1742Optional path to hooks, if not specified then `'$site_path'/hooks` will be used.
1743
David Pursehouse6f884c72015-01-07 14:28:41 +09001744[[hooks.syncHookTimeout]]hooks.syncHookTimeout::
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001745+
David Pursehouse6f884c72015-01-07 14:28:41 +09001746Optional timeout value in seconds for synchronous hooks, if not specified
1747then 30 seconds will be used.
David Pursehousef9f3b272012-09-28 19:58:59 +09001748
Shane Mc Cormack6c2b6772010-01-12 21:56:44 +00001749[[hooks.changeAbandonedHook]]hooks.changeAbandonedHook::
1750+
1751Optional filename for the change abandoned hook, if not specified then
1752`change-abandoned` will be used.
1753
David Pursehouse6f884c72015-01-07 14:28:41 +09001754[[hooks.changeMergedHook]]hooks.changeMergedHook::
1755+
1756Optional filename for the change merged hook, if not specified then
1757`change-merged` will be used.
1758
David Pursehousea93c9302012-06-15 16:29:26 +09001759[[hooks.changeRestoredHook]]hooks.changeRestoredHook::
1760+
1761Optional filename for the change restored hook, if not specified then
1762`change-restored` will be used.
1763
David Pursehouse6f884c72015-01-07 14:28:41 +09001764[[hooks.claSignedHook]]hooks.claSignedHook::
1765+
1766Optional filename for the CLA signed hook, if not specified then
1767`cla-signed` will be used.
1768
1769[[hooks.commentAddedHook]]hooks.commentAddedHook::
1770+
1771Optional filename for the comment added hook, if not specified then
1772`comment-added` will be used.
1773
1774[[hooks.draftPublishedHook]]hooks.draftPublishedHook::
1775+
1776Optional filename for the draft published hook, if not specified then
1777`draft-published` will be used.
1778
1779[[hooks.hashtagsChangedHook]]hooks.hashtagsChangedHook::
1780+
1781Optional filename for the hashtags changed hook, if not specified then
1782`hashtags-changed` will be used.
1783
1784[[hooks.mergeFailedHook]]hooks.mergeFailedHook::
1785+
1786Optional filename for the merge failed hook, if not specified then
1787`merge-failed` will be used.
1788
1789[[hooks.patchsetCreatedHook]]hooks.patchsetCreatedHook::
1790+
1791Optional filename for the patchset created hook, if not specified then
1792`patchset-created` will be used.
1793
1794[[hooks.refUpdateHook]]hooks.refUpdateHook::
1795+
1796Optional filename for the ref update hook, if not specified then
1797`ref-update` will be used.
1798
David Pursehousea93c9302012-06-15 16:29:26 +09001799[[hooks.refUpdatedHook]]hooks.refUpdatedHook::
1800+
1801Optional filename for the ref updated hook, if not specified then
1802`ref-updated` will be used.
1803
David Pursehouse2336bd82012-09-21 12:50:19 +09001804[[hooks.reviewerAddedHook]]hooks.reviewerAddedHook::
1805+
1806Optional filename for the reviewer added hook, if not specified then
1807`reviewer-added` will be used.
1808
David Pursehouseba3e28d2013-07-12 14:48:51 +09001809[[hooks.topicChangedHook]]hooks.topicChangedHook::
1810+
1811Optional filename for the topic changed hook, if not specified then
1812`topic-changed` will be used.
1813
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001814[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001815=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001816
1817[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001818+
1819URL of the proxy server when making outgoing HTTP
1820connections for OpenID login transactions. Syntax
1821should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001822
1823[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001824+
1825Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02001826This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001827appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001828
1829[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001830+
1831Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02001832This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001833appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001834
Hugo Arès88e33ac2014-03-03 13:52:45 -05001835[[http.addUserAsRequestAttribute]]http.addUserAsRequestAttribute::
1836+
1837If true, 'User' attribute will be added to the request attributes so it
1838can be accessed outside the request scope (will be set to username or id
1839if username not configured).
1840+
1841This attribute can be used by the servlet container to log user in the
1842http access log.
1843+
1844When running the embedded servlet container, this attribute is used to
1845print user in the httpd_log.
1846+
1847* `%{User}r`
1848+
1849Pattern to print user in Tomcat AccessLog.
1850
1851+
1852Default value is true.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08001853
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001854[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001855=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001856
1857The httpd section configures the embedded servlet container.
1858
1859[[httpd.listenUrl]]httpd.listenUrl::
1860+
1861Specifies the URLs the internal HTTP daemon should listen for
Edwin Kempincdb0e002011-09-08 14:23:30 +02001862connections on. The special hostname '*' may be used to listen
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001863on all local addresses. A context path may optionally be included,
1864placing Gerrit Code Review's web address within a subdirectory of
1865the server.
1866+
1867Multiple protocol schemes are supported:
1868+
1869* `http://`'hostname'`:`'port'
1870+
1871Plain-text HTTP protocol. If port is not supplied, defaults to 80,
1872the standard HTTP port.
1873+
1874* `https://`'hostname'`:`'port'
1875+
1876SSL encrypted HTTP protocol. If port is not supplied, defaults to
1877443, the standard HTTPS port.
1878+
1879Externally facing production sites are encouraged to use a reverse
1880proxy configuration and `proxy-https://` (below), rather than using
1881the embedded servlet container to implement the SSL processing.
1882The proxy server with SSL support is probably easier to configure,
1883provides more configuration options to control cipher usage, and
1884is likely using natively compiled encryption algorithms, resulting
1885in higher throughput.
1886+
1887* `proxy-http://`'hostname'`:`'port'
1888+
1889Plain-text HTTP relayed from a reverse proxy. If port is not
1890supplied, defaults to 8080.
1891+
1892Like http, but additional header parsing features are
1893enabled to honor X-Forwarded-For, X-Forwarded-Host and
1894X-Forwarded-Server. These headers are typically set by Apache's
1895link:http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers[mod_proxy].
1896+
1897* `proxy-https://`'hostname'`:`'port'
1898+
1899Plain text HTTP relayed from a reverse proxy that has already
1900handled the SSL encryption/decryption. If port is not supplied,
1901defaults to 8080.
1902+
1903Behaves exactly like proxy-http, but also sets the scheme to assume
1904'https://' is the proper URL back to the server.
1905
1906+
1907If multiple values are supplied, the daemon will listen on all
1908of them.
1909+
1910By default, http://*:8080.
1911
1912[[httpd.reuseAddress]]httpd.reuseAddress::
1913+
1914If true, permits the daemon to bind to the port even if the port
1915is already in use. If false, the daemon ensures the port is not
1916in use before starting. Busy sites may need to set this to true
1917to permit fast restarts.
1918+
1919By default, true.
1920
1921[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
1922+
1923Size, in bytes, of the buffer used to parse the HTTP headers of an
1924incoming HTTP request. The entire request headers, including any
1925cookies sent by the browser, must fit within this buffer, otherwise
1926the server aborts with the response '413 Request Entity Too Large'.
1927+
1928One buffer of this size is allocated per active connection.
1929Allocating a buffer that is too large wastes memory that cannot be
1930reclaimed, allocating a buffer that is too small may cause unexpected
1931errors caused by very long Referer URLs or large cookie values.
1932+
1933By default, 16384 (16 K), which is sufficient for most OpenID and
1934other web-based single-sign-on integrations.
1935
Chulho Yangb72ff8f2013-07-04 02:35:53 -04001936[[httpd.sslCrl]]httpd.sslCrl::
1937+
1938Path of the certificate revocation list file in PEM format. This
1939crl file is optional, and available for CLIENT_SSL_CERT_LDAP
1940authentication.
1941+
1942To create and view a crl using openssl:
1943+
1944----
1945openssl ca -gencrl -out crl.pem
1946openssl crl -in crl.pem -text
1947----
1948+
1949If not absolute, the path is resolved relative to `$site_path`.
1950+
1951By default, `$site_path/etc/crl.pem`.
1952
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001953[[httpd.sslKeyStore]]httpd.sslKeyStore::
1954+
1955Path of the Java keystore containing the server's SSL certificate
1956and private key. This keystore is required for `https://` in URL.
1957+
1958To create a self-signed certificate for simple internal usage:
1959+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001960----
1961keytool -keystore keystore -alias jetty -genkey -keyalg RSA
1962chmod 600 keystore
1963----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001964+
1965If not absolute, the path is resolved relative to `$site_path`.
1966+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08001967By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001968
1969[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
1970+
1971Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09001972Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001973doesn't want to enable one.
1974+
1975If set to the empty string the embedded server will prompt for the
1976password during startup.
1977+
1978By default, `gerrit`.
1979
Shawn O. Pearce1766f502010-01-15 10:49:46 -08001980[[httpd.requestLog]]httpd.requestLog::
1981+
1982Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
1983If enabled, an NCSA combined log format request log file is written
1984out by the internal HTTP daemon.
1985+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01001986`log4j.appender` with the name `httpd_log` can be configured to overwrite
1987programmatic configuration.
1988+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08001989By default, true if httpd.listenUrl uses http:// or https://,
1990and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
1991
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001992[[httpd.acceptorThreads]]httpd.acceptorThreads::
1993+
1994Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09001995connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08001996+
1997By default, 2, which should be suitable for most high-traffic sites.
1998
1999[[httpd.minThreads]]httpd.minThreads::
2000+
2001Minimum number of spare threads to keep in the worker thread pool.
2002This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09002003multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002004+
2005By default, 5, suitable for most lower-volume traffic sites.
2006
2007[[httpd.maxThreads]]httpd.maxThreads::
2008+
2009Maximum number of threads to permit in the worker thread pool.
2010+
2011By default 25, suitable for most lower-volume traffic sites.
2012
2013[[httpd.maxQueued]]httpd.maxQueued::
2014+
2015Maximum number of client connections which can enter the worker
2016thread pool waiting for a worker thread to become available.
David Ostrovsky14fe8bc2014-03-26 06:03:44 -070020170 sets the queue size to the Integer.MAX_VALUE.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002018+
2019By default 50.
2020
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002021[[httpd.maxWait]]httpd.maxWait::
2022+
David Pursehouse221d4f62012-06-08 17:38:08 +09002023Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002024thread to handle a project clone, fetch or push request over the
2025smart HTTP transport.
2026+
2027Values should use common unit suffixes to express their setting:
2028+
2029* s, sec, second, seconds
2030* m, min, minute, minutes
2031* h, hr, hour, hours
2032* d, day, days
2033* w, week, weeks (`1 week` is treated as `7 days`)
2034* mon, month, months (`1 month` is treated as `30 days`)
2035* y, year, years (`1 year` is treated as `365 days`)
2036
2037+
2038If a unit suffix is not specified, `minutes` is assumed. If 0
2039is supplied, the maximum age is infinite and connections will not
2040abort until the client disconnects.
2041+
2042By default, 5 minutes.
2043
Luca Milanesioce7b7452013-06-18 11:40:49 +01002044[[httpd.filterClass]]httpd.filterClass::
2045+
2046Class that implements the javax.servlet.Filter interface
2047for filtering any HTTP related traffic going through the Gerrit
2048HTTP protocol.
2049Class is loaded and configured in the Gerrit Jetty container
2050and run in front of all Gerrit URL handlers, allowing the filter
2051to inspect, modify, allow or reject each request.
2052It needs to be provided as JAR library
2053under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
2054loader and cannot be dynamically loaded by a plugin.
2055+
2056Failing to load the Filter class would result in a Gerrit start-up
2057failure, as this class is supposed to provide mandatory filtering
2058in front of Gerrit HTTP protocol.
2059+
David Pursehouse42f42042013-08-01 14:02:25 +09002060Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01002061of an Apache HTTP proxy layer as security enforcement on top of Gerrit
2062by returning a trusted username as HTTP Header.
2063+
2064Example of using a security library secure.jar under $GERRIT_SITE/lib
2065that provides a org.anyorg.MySecureFilter Servlet Filter that enforces
2066a trusted username in the `TRUSTED_USER` HTTP Header:
2067
2068----
2069[auth]
2070type = HTTP
2071httpHeader = TRUSTED_USER
2072
Dariusz Lukszaaac01132015-02-11 12:13:07 +01002073[httpd]
Luca Milanesioce7b7452013-06-18 11:40:49 +01002074filterClass = org.anyorg.MySecureFilter
2075----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002076
Juan Hernandezec512562013-08-06 16:30:50 +02002077[[httpd.robotsFile]]httpd.robotsFile::
2078+
2079Location of an external robots.txt file to be used instead of the one
2080bundled with the .war of the application.
2081+
2082If not absolute, the path is resolved relative to `$site_path`.
2083+
2084If the file doesn't exist or can't be read the default robots.txt file
2085bundled with the .war will be used instead.
2086
Dariusz Luksza011cfed2014-04-03 10:23:35 +02002087[[httpd.registerMBeans]]httpd.registerMBeans::
2088+
2089Enable (or disable) registration of Jetty MBeans for Java JMX.
2090+
2091By default, false.
2092
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002093[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002094=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09002095
2096The index section configures the secondary index.
2097
David Pursehouse3fc5ee32014-03-17 18:35:32 +09002098Note that after enabling the secondary index, the index must be built
2099using the link:pgm-reindex.html[reindex program] before restarting the
2100Gerrit server.
2101
David Pursehouse6d458432013-08-23 16:17:18 +09002102[[index.type]]index.type::
2103+
2104Type of secondary indexing employed by Gerrit. The supported
2105values are:
2106+
2107* `LUCENE`
2108+
2109A link:http://lucene.apache.org/[Lucene] index is used.
2110+
2111* `SOLR`
2112+
David Pursehouse396e09d2014-02-06 15:39:59 +09002113A link:https://cwiki.apache.org/confluence/display/solr/SolrCloud[
2114SolrCloud] index is used.
David Pursehouse6d458432013-08-23 16:17:18 +09002115
2116+
Shawn Pearced4ae3a162013-11-24 17:00:31 -08002117By default, `LUCENE`.
David Pursehouse6d458432013-08-23 16:17:18 +09002118
David Pursehouse904db302014-03-17 18:55:38 +09002119[[index.threads]]index.threads::
2120+
Dave Borowitz787af5f2014-10-22 16:26:00 -07002121Number of threads to use for indexing in normal interactive operations.
David Pursehouse904db302014-03-17 18:55:38 +09002122+
Dave Borowitz0916cc32014-10-23 10:24:01 -07002123Defaults to 1 if not set, or set to a negative value (unless
2124link:#changeMerge.interactiveThreadPoolSize[changeMerge.interactiveThreadPoolSize]
2125is iset).
David Pursehouse00c82142014-01-22 17:41:09 +09002126
Dave Borowitz787af5f2014-10-22 16:26:00 -07002127[[index.batchThreads]]index.batchThreads::
2128+
2129Number of threads to use for indexing in background operations, such as
2130online schema upgrades.
2131+
2132If not set or set to a negative value, defaults to using the same
Dave Borowitz0916cc32014-10-23 10:24:01 -07002133thread pool as interactive operations (unless
2134link:#changeMerge.threadPoolSize[changeMerge.threadPoolSize] is set).
Dave Borowitz787af5f2014-10-22 16:26:00 -07002135
David Pursehouse902b3ee2014-07-09 16:17:49 +09002136==== Lucene configuration
2137
2138Open and closed changes are indexed in separate indexes named
2139'open' and 'closed' respectively.
2140
2141The following settings are only used when the index type is `LUCENE`.
David Pursehouseac88c362014-02-06 12:01:34 +09002142
Olga Grinberg74ccc232014-10-15 08:37:23 -04002143[[index.defaultMaxClauseCount]]index.defaultMaxClauseCount::
2144+
2145Only used when the type is `LUCENE`.
2146+
2147Sets the maximum number of clauses permitted per BooleanQuery.
2148+
2149Defaults to 1024.
2150
David Pursehouse00c82142014-01-22 17:41:09 +09002151[[index.name.ramBufferSize]]index.name.ramBufferSize::
2152+
David Pursehouse00c82142014-01-22 17:41:09 +09002153Determines the amount of RAM that may be used for buffering added documents
2154and deletions before they are flushed to the index. See the
2155link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
2156Lucene documentation] for further details.
2157+
2158Defaults to 16M.
2159
2160[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
2161+
David Pursehouse00c82142014-01-22 17:41:09 +09002162Determines the minimal number of documents required before the buffered
2163in-memory documents are flushed to the index. Large values generally
2164give faster indexing. See the
2165link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
2166Lucene documentation] for further details.
2167+
2168Defaults to -1, meaning no maximum is set and the writer will flush
2169according to RAM usage.
2170
Dave Borowitzd08b0452014-02-13 11:56:03 -08002171[[index.name.commitWithin]]index.name.commitWithin::
2172+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002173Determines the period at which changes are automatically committed to
2174stable store on disk. This is a costly operation and may block
2175additional index writes, so lower with caution.
2176+
Bruce Zuaf058e62014-03-21 10:03:05 +08002177If zero, changes are committed after every write. This is very costly
2178but may be useful if offline reindexing is infeasible, or for development
2179servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08002180+
Bruce Zuaf058e62014-03-21 10:03:05 +08002181Values can be specified using standard time unit abbreviations (`ms`, `sec`,
2182`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07002183+
Bruce Zuaf058e62014-03-21 10:03:05 +08002184If negative, `commitWithin` is disabled. Changes are flushed to disk when
2185the in-memory buffer fills, but only committed and guaranteed to be synced
2186to disk when the process finishes.
David Pursehouse902b3ee2014-07-09 16:17:49 +09002187+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002188Defaults to 300000 ms (5 minutes).
2189
David Pursehouse902b3ee2014-07-09 16:17:49 +09002190Sample Lucene index configuration:
David Pursehouse00c82142014-01-22 17:41:09 +09002191----
2192[index]
2193 type = LUCENE
Olga Grinberg74ccc232014-10-15 08:37:23 -04002194 defaultMaxClauseCount = 2048
David Pursehouse00c82142014-01-22 17:41:09 +09002195
2196[index "changes_open"]
2197 ramBufferSize = 60 m
2198 maxBufferedDocs = 3000
2199
2200[index "changes_closed"]
2201 ramBufferSize = 20 m
2202 maxBufferedDocs = 500
2203----
2204
David Pursehouse902b3ee2014-07-09 16:17:49 +09002205==== Solr configuration
2206
2207Open and closed changes are indexed in separate indexes named
2208'changes_open' and 'changes_closed' respectively.
2209
2210The following settings are only used when the index type is `SOLR`.
2211
2212[[index.url]]index.url::
2213+
2214URL of the index server.
2215
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002216[[ldap]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002217=== Section ldap
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002218
David Pursehouse221d4f62012-06-08 17:38:08 +09002219LDAP integration is only enabled if `auth.type` is set to
Sasa Zivkoveabc8972010-10-04 15:47:08 +02002220`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
David Pursehouse42f42042013-08-01 14:02:25 +09002221detailed description of the `auth.type` settings and their
Sasa Zivkoveabc8972010-10-04 15:47:08 +02002222implications.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002223
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002224An example LDAP configuration follows, and then discussion of
2225the parameters introduced here. Suitable defaults for most
2226parameters are automatically guessed based on the type of server
2227detected during startup. The guessed defaults support both
2228link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307] and Active
2229Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002230
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002231----
2232[ldap]
2233 server = ldap://ldap.example.com
2234
2235 accountBase = ou=people,dc=example,dc=com
2236 accountPattern = (&(objectClass=person)(uid=${username}))
2237 accountFullName = displayName
2238 accountEmailAddress = mail
2239
2240 groupBase = ou=groups,dc=example,dc=com
2241 groupMemberPattern = (&(objectClass=group)(member=${dn}))
2242----
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002243
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002244[[ldap.server]]ldap.server::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002245+
2246URL of the organization's LDAP server to query for user information
2247and group membership from. Must be of the form `ldap://host` or
2248`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002249+
David Pursehouse42f42042013-08-01 14:02:25 +09002250If `auth.type` is `LDAP` this setting should use `ldaps://` to
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002251ensure the end user's plaintext password is transmitted only over
2252an encrypted connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002253
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002254[[ldap.sslVerify]]ldap.sslVerify::
2255+
2256If false and ldap.server is an `ldaps://` style URL, Gerrit
2257will not verify the server certificate when it connects to
2258perform a query.
2259+
2260By default, true, requiring the certificate to be verified.
2261
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002262[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002263+
2264_(Optional)_ Username to bind to the LDAP server with. If not set,
2265an anonymous connection to the LDAP server is attempted.
2266
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002267[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002268+
2269_(Optional)_ Password for the user identified by `ldap.username`.
2270If not set, an anonymous (or passwordless) connection to the LDAP
2271server is attempted.
2272
Ben Wu0410a152010-06-04 16:17:24 +08002273[[ldap.referral]]ldap.referral::
2274+
2275_(Optional)_ How an LDAP referral should be handled if it is
2276encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05002277automatically follow any referrals, or `ignore` to ignore the
2278referrals.
Ben Wu0410a152010-06-04 16:17:24 +08002279+
2280By default, `ignore`.
2281
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01002282[[ldap.readTimeout]]ldap.readTimeout::
2283+
2284_(Optional)_ The read timeout for an LDAP operation. The value is
2285in the usual time-unit format like "1 s", "100 ms", etc...
2286A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09002287threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01002288+
2289By default there is no timeout and Gerrit will wait for the LDAP
2290server to respond until the TCP connection times out.
2291
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002292[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002293+
2294Root of the tree containing all user accounts. This is typically
2295of the form `ou=people,dc=example,dc=com`.
2296
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002297[[ldap.accountScope]]ldap.accountScope::
2298+
2299Scope of the search performed for accounts. Must be one of:
2300+
2301* `one`: Search only one level below accountBase, but not recursive
2302* `sub` or `subtree`: Search recursively below accountBase
2303* `base` or `object`: Search exactly accountBase; probably not desired
2304
2305+
2306Default is `subtree` as many directories have several levels.
2307
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002308[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002309+
2310Query pattern to use when searching for a user account. This may be
2311any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09002312`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002313`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09002314that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02002315the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002316the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002317+
2318This pattern is used to search the objects contained directly under
2319the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02002320is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002321setting depends on the LDAP schema used by the directory server.
2322+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002323Default is `(uid=${username})` for RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002324and `(&(objectClass=user)(sAMAccountName=${username}))`
2325for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002326
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07002327[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002328+
2329_(Optional)_ Name of an attribute on the user account object which
2330contains the initial value for the user's full name field in Gerrit.
2331Typically this is the `displayName` property in LDAP, but could
2332also be `legalName` or `cn`.
2333+
David Pursehouse221d4f62012-06-08 17:38:08 +09002334Attribute values may be concatenated with literal strings. For
2335example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02002336`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002337+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002338If set, users will be unable to modify their full name field, as
2339Gerrit will populate it only from the LDAP data.
2340+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002341Default is `displayName` for RFC 2307 servers,
2342and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002343
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002344[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002345+
2346_(Optional)_ Name of an attribute on the user account object which
2347contains the user's Internet email address, as defined by this
2348LDAP server.
2349+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002350Attribute values may be concatenated with literal strings,
2351for example to set the email address to the lowercase form
2352of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02002353`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002354+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002355If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09002356but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002357and select a different preferred email address.
2358+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002359Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002360
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002361[[ldap.accountSshUserName]]ldap.accountSshUserName::
2362+
2363_(Optional)_ Name of an attribute on the user account object which
2364contains the initial value for the user's SSH username field in
2365Gerrit. Typically this is the `uid` property in LDAP, but could
2366also be `cn`. Administrators should prefer to match the attribute
2367corresponding to the user's workstation username, as this is what
2368SSH clients will default to.
2369+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002370Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02002371an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002372force the value of sAMAccountName, if defined, to be all lowercase.
2373The suffix `.toUpperCase` can be used for the other direction.
2374The suffix `.localPart` can be used to split attribute values of
2375the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02002376example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002377+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002378If set, users will be unable to modify their SSH username field, as
2379Gerrit will populate it only from the LDAP data.
2380+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002381Default is `uid` for RFC 2307 servers,
2382and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002383
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002384[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04002385+
2386_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002387contains the groups the user is part of. Typically used for Active
2388Directory servers.
Anthony93de7db2009-10-03 10:01:50 -04002389+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002390Default is unset for RFC 2307 servers (disabled)
2391and `memberOf` for Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04002392
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002393[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002394+
2395Root of the tree containing all group objects. This is typically
2396of the form `ou=groups,dc=example,dc=com`.
2397
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002398[[ldap.groupScope]]ldap.groupScope::
2399+
2400Scope of the search performed for group objects. Must be one of:
2401+
2402* `one`: Search only one level below groupBase, but not recursive
2403* `sub` or `subtree`: Search recursively below groupBase
2404* `base` or `object`: Search exactly groupBase; probably not desired
2405
2406+
2407Default is `subtree` as many directories have several levels.
2408
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002409[[ldap.groupPattern]]ldap.groupPattern::
2410+
2411Query pattern used when searching for an LDAP group to connect
2412to a Gerrit group. This may be any valid LDAP query expression,
2413including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002414`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002415group owner.
2416+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002417Default is `(cn=${groupname})` for RFC 2307,
2418and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002419
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002420[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002421+
2422Query pattern to use when searching for the groups that a user
2423account is currently a member of. This may be any valid LDAP query
2424expression, including the standard `(&...)` and `(|...)` operators.
2425+
David Pursehouse42f42042013-08-01 14:02:25 +09002426If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002427replaced with a parameter set to the username that was supplied
2428by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02002429such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002430corresponding attribute (in this case, `fooBarAttribute`) as read
2431from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002432Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002433+
Scott Dial50457502013-08-11 16:52:51 -04002434Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
2435RFC 2307, and unset (disabled) for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002436
Auke Schrijnen57809132012-09-26 21:05:39 +02002437[[ldap.groupName]]ldap.groupName::
2438+
David Pursehouse39489ae2012-10-12 13:50:04 +09002439_(Optional)_ Name of the attribute on the group object which contains
2440the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02002441+
David Pursehouse39489ae2012-10-12 13:50:04 +09002442Typically the attribute name is `cn` for RFC 2307 and Active Directory
2443servers. For other servers the attribute name may differ, for example
2444`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02002445+
David Pursehouse39489ae2012-10-12 13:50:04 +09002446It is also possible to specify a literal string containing a pattern of
2447attribute values. For example to create a Gerrit group name consisting of
2448LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
2449+
2450Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02002451
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002452[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
2453+
2454Converts the local username, that is used to login into the Gerrit
David Pursehousea1d633b2014-05-02 17:21:02 +09002455Web UI, to lower case before doing the LDAP authentication. By setting
2456this parameter to true, a case insensitive login to the Gerrit Web UI
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002457can be achieved.
2458+
2459If set, it must be ensured that the local usernames for all existing
2460accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09002461local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002462anymore. The local usernames for the existing accounts can be
2463converted to lower case by running the server program
2464link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
2465Please be aware that the conversion of the local usernames to lower
2466case can't be undone. For newly created accounts the local username
2467will be directly stored in lower case.
2468+
2469By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002470
Robin Rosenberga3baed02012-10-14 14:09:32 +02002471[[ldap.authentication]]ldap.authentication::
2472+
2473Defines how Gerrit authenticates with the server. When set to `GSSAPI`
2474Gerrit will use Kerberos. To use kerberos the
2475`java.security.auth.login.config` system property must point to a
2476login to a JAAS configuration file and, if Java 6 is used, the system
2477property `java.security.krb5.conf` must point to the appropriate
2478krb5.ini file with references to the KDC.
2479
2480Typical jaas.conf.
2481
2482----
2483KerberosLogin {
2484 com.sun.security.auth.module.Krb5LoginModule
2485 required
2486 useTicketCache=true
2487 doNotPrompt=true
2488 renewTGT=true;
2489};
2490----
2491
2492See Java documentation on how to create the krb5.ini file.
2493
2494Note the `renewTGT` property to make sure the TGT does not expire,
2495and `useTicketCache` to use the TGT supplied by the operating system. As
2496the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09002497to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02002498
2499On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
2500must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
2501have local administrator privileges.
2502
Bruce Zucd04bbc2014-07-25 15:48:09 +08002503[[ldap.useConnectionPooling]]ldap.useConnectionPooling::
2504+
2505_(Optional)_ Enable the LDAP connection pooling or not.
2506+
2507If it is true, the LDAP service provider maintains a pool of (possibly)
2508previously used connections and assigns them to a Context instance as
2509needed. When a Context instance is done with a connection (closed or
2510garbage collected), the connection is returned to the pool for future use.
2511+
2512For details, see link:http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html[
2513LDAP connection management (Pool)] and link:http://docs.oracle.com/javase/tutorial/jndi/ldap/config.html[
2514LDAP connection management (Configuration)]
2515+
2516By default, false.
2517
2518[[ldap.connectTimeout]]ldap.connectTimeout::
2519+
Saša Živkov303701a2015-01-19 16:24:44 +01002520_(Optional)_ Timeout period for establishment of an LDAP connection.
Bruce Zucd04bbc2014-07-25 15:48:09 +08002521+
2522The value is in the usual time-unit format like "1 s", "100 ms",
2523etc...
2524+
2525By default there is no timeout and Gerrit will wait indefinitely.
2526
Saša Živkov5049f512015-01-19 17:04:43 +01002527[[ldap-connection-pooling]]
2528==== LDAP Connection Pooling
2529Once LDAP connection pooling is enabled by setting the link:#ldap.useConnectionPooling[
2530ldap.useConnectionPooling] configuration property to `true`, the connection pool
2531can be configured using JVM system properties as explained in the
2532link:http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-ldap.html#POOL[
2533Java SE Documentation].
Bruce Zucd04bbc2014-07-25 15:48:09 +08002534
Saša Živkov5049f512015-01-19 17:04:43 +01002535For standalone Gerrit (running with the embedded Jetty), JVM system properties
2536are specified in the link:#container[container section]:
Bruce Zucd04bbc2014-07-25 15:48:09 +08002537
Saša Živkov5049f512015-01-19 17:04:43 +01002538----
2539 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.maxsize=20
2540 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.prefsize=10
2541 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.timeout=300000
2542----
Bruce Zucd04bbc2014-07-25 15:48:09 +08002543
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002544[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002545=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002546
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002547[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002548+
2549If set to true, files with the MIME type `<name>` will be sent as
2550direct downloads to the user's browser, rather than being wrapped up
2551inside of zipped archives. The type name may be a complete type
Edwin Kempincdb0e002011-09-08 14:23:30 +02002552name, e.g. `image/gif`, a generic media type, e.g. `image/*`,
2553or the wildcard `*/*` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002554+
2555By default, false for all MIME types.
2556
2557Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002558----
2559[mimetype "image/*"]
2560 safe = true
2561
2562[mimetype "application/pdf"]
2563 safe = true
2564
2565[mimetype "application/msword"]
2566 safe = true
2567
2568[mimetype "application/vnd.ms-excel"]
2569 safe = true
2570----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002571
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07002572
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002573[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002574=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002575
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07002576Global settings controlling how Gerrit Code Review creates pack
2577streams for Git clients running clone, fetch, or pull. Most of these
2578variables are per-client request, and thus should be carefully set
2579given the expected concurrent request load and available CPU and
2580memory resources.
2581
2582[[pack.deltacompression]]pack.deltacompression::
2583+
2584If true, delta compression between objects is enabled. This may
2585result in a smaller overall transfer for the client, but requires
2586more server memory and CPU time.
2587+
2588False (off) by default, matching Gerrit Code Review 2.1.4.
2589
2590[[pack.threads]]pack.threads::
2591+
2592Maximum number of threads to use for delta compression (if enabled).
2593This is per-client request. If set to 0 then the number of CPUs is
2594auto-detected and one thread per CPU is used, per client request.
2595+
2596By default, 1.
2597
2598
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002599[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002600=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07002601
2602[[plugins.checkFrequency]]plugins.checkFrequency::
2603+
2604How often plugins should be examined for new plugins to load, removed
2605plugins to be unloaded, or updated plugins to be reloaded. Values can
2606be specified using standard time unit abbreviations ('ms', 'sec',
2607'min', etc.).
2608+
2609If set to 0, automatic plugin reloading is disabled. Administrators
2610may force reloading with link:cmd-plugin.html[gerrit plugin reload].
2611+
2612Default is 1 minute.
2613
Shawn Pearcefd033502014-02-14 16:42:35 -08002614[[plugins.allowRemoteAdmin]]plugins.allowRemoteAdmin::
2615+
2616Enable remote installation, enable and disable of plugins over HTTP
2617and SSH. If set to true Administrators can install new plugins
2618remotely, or disable existing plugins. Defaults to false.
2619
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07002620
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002621[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002622=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002623
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002624This section is used to set who can execute the 'receive-pack' and
2625to limit the maximum Git object size that 'receive-pack' will accept.
2626'receive-pack' is what runs on the server during a user's push or
Dave Borowitz234734a2012-03-01 14:22:29 -08002627repo upload command. It also contains some advanced options for tuning the
2628behavior of Gerrit's 'receive-pack' mechanism.
lincoln2be11602010-07-05 10:53:25 -03002629
2630----
2631[receive]
2632 allowGroup = GROUP_ALLOWED_TO_EXECUTE
2633 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002634 maxObjectSizeLimit = 40 m
lincoln2be11602010-07-05 10:53:25 -03002635----
2636
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08002637[[receive.checkMagicRefs]]receive.checkMagicRefs::
2638+
2639If true, Gerrit will verify the destination repository has
2640no references under the magic 'refs/drafts', 'refs/for', or
2641'refs/publish' branch namespaces. Names under these locations
2642confuse clients when trying to upload code reviews so Gerrit
2643requires them to be empty.
2644+
2645If false Gerrit skips the sanity check and assumes administrators
2646have ensured the repository does not contain any magic references.
2647Setting to false to skip the check can decrease latency during push.
2648+
2649Default is true.
2650
Gustaf Lundh9062fd62013-02-14 17:23:11 +01002651[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
2652+
2653If set to true, Gerrit will validate that all referenced objects that
2654are not included in the received pack are reachable by the user.
2655+
2656Carrying out this check on gits with many refs and commits can be a
2657very CPU-heavy operation. For non public Gerrit-servers this check may
2658be overkill.
2659+
2660Only disable this check if you trust the clients not to forge SHA1
2661references to access commits intended to be hidden from the user.
2662+
2663Default is true.
2664
lincoln2be11602010-07-05 10:53:25 -03002665[[receive.allowGroup]]receive.allowGroup::
2666+
2667Name of the groups of users that are allowed to execute
2668'receive-pack' on the server. One or more groups can be set.
2669+
2670If no groups are added, any user will be allowed to execute
2671'receive-pack' on the server.
2672
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002673[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
2674+
2675Maximum allowed Git object size that 'receive-pack' will accept.
2676If an object is larger than the given size the pack-parsing will abort
2677and the push operation will fail. If set to zero then there is no
2678limit.
2679+
David Pursehouse221d4f62012-06-08 17:38:08 +09002680Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002681from pushing objects which are too large to Gerrit.
2682+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07002683This setting can also be set in the `project.config`
2684link:config-project-config.html[receive.maxObjectSizeLimit] in order
2685to further reduce the global setting. The project specific setting is
2686only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02002687+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01002688Default is zero.
2689+
2690Common unit suffixes of 'k', 'm', or 'g' are supported.
2691
Bruce Zue13b65d2014-07-30 14:50:01 +08002692[[receive.maxBatchChanges]]receive.maxBatchChanges::
2693+
2694The maximum number of changes that Gerrit allows to be pushed
2695in a batch for review. When this number is exceeded Gerrit rejects
2696the push with an error message.
Bruce Zu4512fe62014-11-18 17:39:41 +08002697+
2698May be overridden for certain groups by specifying a limit in the
2699link:access-control.html#capability_batchChangesLimit['Batch Changes Limit']
2700global capability.
2701+
Bruce Zue13b65d2014-07-30 14:50:01 +08002702This setting can be used to prevent users from uploading large
2703number of changes for review by mistake.
Bruce Zu4512fe62014-11-18 17:39:41 +08002704+
Bruce Zue13b65d2014-07-30 14:50:01 +08002705Default is zero, no limit.
2706
Dave Borowitz234734a2012-03-01 14:22:29 -08002707[[receive.threadPoolSize]]receive.threadPoolSize::
2708+
2709Maximum size of the thread pool in which the change data in received packs is
2710processed.
2711+
2712Defaults to the number of available CPUs according to the Java runtime.
2713
Shawn O. Pearcec545c092012-07-27 16:38:55 -07002714[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
2715+
2716Number of threads to perform change creation or patch set updates
2717concurrently. Each thread uses its own database connection from
2718the database connection pool, and if all threads are busy then
2719main receive thread will also perform a change creation or patch
2720set update.
2721+
2722Defaults to 1, using only the main receive thread. This feature is for
David Pursehouse92463562013-06-24 10:16:28 +09002723databases with very high latency that can benefit from concurrent
Shawn O. Pearcec545c092012-07-27 16:38:55 -07002724operations when multiple changes are impacted at once.
2725
Dave Borowitz1c401362012-03-02 17:39:17 -08002726[[receive.timeout]]receive.timeout::
2727+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07002728Overall timeout on the time taken to process the change data in
2729received packs. Only includes the time processing Gerrit changes
2730and updating references, not the time to index the pack. Values can
2731be specified using standard time unit abbreviations ('ms', 'sec',
2732'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08002733+
David Pursehouse92463562013-06-24 10:16:28 +09002734Default is 2 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07002735is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08002736
lincoln2be11602010-07-05 10:53:25 -03002737
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002738[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002739=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002740
Hugo Josefson072b4702010-04-21 19:27:11 +02002741Repositories in this sense are the same as projects.
2742
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002743In the following example configuration `Registered Users` is set
2744to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02002745
2746----
2747[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02002748 ownerGroup = Registered Users
2749----
2750
2751[NOTE]
2752Currently only the repository name `*` is supported.
2753This is a wildcard designating all repositories.
2754
Edwin Kempina79ea552013-11-19 11:24:37 +01002755[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
2756+
2757The default submit type for newly created projects. Supported values
2758are `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
2759`MERGE_ALWAYS` and `CHERRY_PICK`.
2760+
2761By default, `MERGE_IF_NECESSARY`.
2762
Hugo Josefson072b4702010-04-21 19:27:11 +02002763[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
2764+
2765A name of a group which exists in the database. Zero, one or many
2766groups are allowed. Each on its own line. Groups which don't exist
2767in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02002768
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002769[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002770=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07002771
2772[[rules.enable]]rules.enable::
2773+
Matt Baker8ce12fc2013-11-26 21:43:12 -07002774If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07002775project's refs/meta/config branch, if present. When set to false,
2776only the default internal rules will be used.
2777+
2778Default is true, to execute project specific rules.
2779
Shawn Pearceed001d72014-12-17 14:25:55 -08002780[[rules.reductionLimit]]rules.reductionLimit::
2781+
2782Maximum number of Prolog reductions that can be performed when
2783evaluating rules for a single change. Each function call made
2784in user rule code, internal Gerrit Prolog code, or the Prolog
2785interpreter counts against this limit.
2786+
2787Sites using very complex rules that need many reductions should
2788compile Prolog to Java bytecode with link:pgm-rulec.html[rulec].
2789This eliminates the dynamic Prolog interpreter from charging its
2790own reductions against the limit, enabling more logic to execute
2791within the same bounds.
2792+
2793A reductionLimit of 0 is nearly infinite, implemented by setting
2794the internal limit to 2^31-1.
2795+
2796Default is 100,000 reductions (about 14 ms on Intel Core i7 CPU).
2797
2798[[rules.compileReductionLimit]]rules.compileReductionLimit::
2799+
2800Maximum number of Prolog reductions that can be performed when
2801compiling source code to internal Prolog machine code.
2802+
2803Default is 10x reductionLimit (1,000,000).
2804
David Pursehouse511a35b2014-04-04 10:27:13 +09002805[[execution]]
2806=== Section execution
Bruce Zua7e34312014-04-01 17:35:41 +08002807
2808[[execution.defaultThreadPoolSize]]execution.defaultThreadPoolSize::
2809+
2810The default size of the background execution thread pool in
2811which miscellaneous tasks are handled.
2812+
2813Default is 1.
2814
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002815[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002816=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002817
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002818[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07002819+
2820If false Gerrit will not send email messages, for any reason,
2821and all other properties of section sendemail are ignored.
2822+
2823By default, true, allowing notifications to be sent.
2824
Bruce Zua7e34312014-04-01 17:35:41 +08002825[[sendemail.connectTimeout]]sendemail.connectTimeout::
2826+
2827The connection timeout of opening a socket connected to a
2828remote SMTP server.
2829+
2830Values can be specified using standard time unit abbreviations
2831('ms', 'sec', 'min', etc.).
2832If no unit is specified, milliseconds is assumed.
2833+
2834Default is 0. A timeout of zero is interpreted as an infinite
2835timeout. The connection will then block until established or
2836an error occurs.
2837
2838[[sendemail.threadPoolSize]]sendemail.threadPoolSize::
2839+
2840Maximum size of thread pool in which the review comments
2841notifications are sent out asynchronously.
2842+
2843By default, 1.
2844
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002845[[sendemail.from]]sendemail.from::
2846+
2847Designates what name and address Gerrit will place in the From
2848field of any generated email messages. The supported values are:
2849+
2850* `USER`
2851+
2852Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09002853Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002854classified as spam if the user's domain has SPF or DKIM enabled
2855and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
2856relay for that domain.
2857+
2858* `MIXED`
2859+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002860Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002861`review@example.com` is the same as <<user.email,user.email>>.
2862See below for a description of how the replacement is handled.
2863+
2864* `SERVER`
2865+
2866Gerrit will set the From header to the same name and address
2867it records in any commits Gerrit creates. This is set by
2868<<user.name,user.name>> and <<user.email,user.email>>, or guessed
2869from the local operating system.
2870+
2871* 'Code Review' `<`'review'`@`'example.com'`>`
2872+
2873If set to a name and email address in brackets, Gerrit will use
2874this name and email address for any messages, overriding the name
2875that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002876Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07002877which is replaced by the Full Name of the current user.
2878
2879+
2880By default, MIXED.
2881
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002882[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002883+
2884Hostname (or IP address) of a SMTP server that will relay
2885messages generated by Gerrit to end users.
2886+
2887By default, 127.0.0.1 (aka localhost).
2888
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002889[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002890+
2891Port number of the SMTP server in sendemail.smtpserver.
2892+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08002893By default, 25, or 465 if smtpEncryption is 'ssl'.
2894
2895[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
2896+
2897Specify the encryption to use, either 'ssl' or 'tls'.
2898+
2899By default, 'none', indicating no encryption is used.
2900
2901[[sendemail.sslVerify]]sendemail.sslVerify::
2902+
2903If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
2904will not verify the server certificate when it connects to send
2905an email message.
2906+
2907By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002908
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002909[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002910+
2911User name to authenticate with, if required for relay.
2912
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002913[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07002914+
2915Password for the account named by sendemail.smtpUser.
2916
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002917[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07002918+
2919If present, each value adds one entry to the whitelist of email
2920addresses that Gerrit can send email to. If set to a complete
2921email address, that one address is added to the white list.
2922If set to a domain name, any address at that domain can receive
2923email from Gerrit.
2924+
2925By default, unset, permitting delivery to any email address.
2926
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07002927[[sendemail.includeDiff]]sendemail.includeDiff::
2928+
Bruce Zueb00ff32012-11-27 17:38:10 +08002929If true, new change emails and merged change emails from Gerrit
2930will include the complete unified diff of the change.
2931Variable maxmimumDiffSize places an upper limit on how large the
2932email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07002933+
2934By default, false.
2935
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07002936[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
2937+
2938Largest size of unified diff output to include in an email. When
2939the diff exceeds this size the file paths will be listed instead.
2940Standard byte unit suffixes are supported.
2941+
2942By default, 256 KiB.
2943
Alex Blewitt9cca7402011-02-11 01:39:30 +00002944[[sendemail.importance]]sendemail.importance::
2945+
2946If present, emails sent from Gerrit will have the given level
2947of importance. Valid values include 'high' and 'low', which
2948email clients will render in different ways.
2949+
2950By default, unset, so no Importance header is generated.
2951
2952[[sendemail.expiryDays]]sendemail.expiryDays::
2953+
2954If present, emails sent from Gerrit will expire after the given
2955number of days. This will add the Expiry-Date header and
2956email clients may expire or expunge mails whose Expiry-Date
2957header is in the past. This should be a positive non-zero
2958number indicating how many days in the future the mails
2959should expire.
2960+
2961By default, unset, so no Expiry-Date header is generated.
2962
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002963
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002964[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002965=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002966
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002967[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
2968+
2969If true the server checks the site header, footer and CSS files for
2970updated versions. If false, a server restart is required to change
2971any of these resources. Default is true, allowing automatic reloads.
2972
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002973[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002974=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07002975
2976Variables in section ssh-alias permit the site administrator to alias
2977another command from Gerrit or a plugin into the `gerrit` command
2978namespace. To alias `replication start` to `gerrit replicate`:
2979
2980----
2981[ssh-alias]
2982 replicate = replication start
2983----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07002984
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002985[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002986=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07002987
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002988[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002989+
2990Specifies the local addresses the internal SSHD should listen
2991for connections on. The following forms may be used to specify
2992an address. In any form, `:'port'` may be omitted to use the
2993default of 29418.
2994+
2995* 'hostname':'port' (for example `review.example.com:29418`)
2996* 'IPv4':'port' (for example `10.0.0.1:29418`)
2997* ['IPv6']:'port' (for example `[ff02::1]:29418`)
Edwin Kempincdb0e002011-09-08 14:23:30 +02002998* *:'port' (for example `*:29418`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07002999
3000+
3001If multiple values are supplied, the daemon will listen on all
3002of them.
3003+
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07003004To disable the internal SSHD, set listenAddress to `off`.
3005+
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003006By default, *:29418.
3007
James Y Knight910bd862011-01-11 20:05:56 -05003008[[sshd.advertisedAddress]]sshd.advertisedAddress::
3009+
3010Specifies the addresses clients should be told to connect to.
3011This may differ from sshd.listenAddress if a firewall based port
3012redirector is being used, making Gerrit appear to answer on port
301322. The following forms may be used to specify an address. In any
3014form, `:'port'` may be omitted to use the default SSH port of 22.
3015+
3016* 'hostname':'port' (for example `review.example.com:22`)
3017* 'IPv4':'port' (for example `10.0.0.1:29418`)
3018* ['IPv6']:'port' (for example `[ff02::1]:29418`)
3019
3020+
3021If multiple values are supplied, the daemon will advertise all
3022of them.
3023+
3024By default, sshd.listenAddress.
3025
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003026[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07003027+
3028If true, enables TCP keepalive messages to the other side, so
3029the daemon can terminate connections if the peer disappears.
3030+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02003031Only effective when `sshd.backend` is set to `MINA`.
3032+
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07003033By default, true.
3034
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08003035[[sshd.threads]]sshd.threads::
3036+
3037Number of threads to use when executing SSH command requests.
3038If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09003039are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08003040+
3041By default, 1.5x the number of CPUs available to the JVM.
3042
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003043[[sshd.batchThreads]]sshd.batchThreads::
3044+
3045Number of threads to allocate for SSH command requests from
Fredrik Luthander46843022012-03-13 16:11:02 +01003046link:access-control.html#non-interactive_users[non-interactive users].
3047If equals to 0, then all non-interactive requests are executed in the same
3048queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003049+
3050Any other value will remove the number of threads from the queue
3051allocated to interactive users, and create a separate thread pool
3052of the requested size, which will be used to run commands from
3053non-interactive users.
3054+
3055If the number of threads requested for non-interactive users is larger
3056than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09003057value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003058+
3059By default, 0.
3060
Kenny Root15ac1b82010-02-24 00:29:20 -08003061[[sshd.streamThreads]]sshd.streamThreads::
3062+
3063Number of threads to use when formatting events to asynchronous
3064streaming clients. Event formatting is multiplexed onto this thread
3065pool by a simple FIFO scheduling system.
3066+
3067By default, 1 plus the number of CPUs available to the JVM.
3068
Edwin Kempinb5df3b82011-10-10 11:31:14 +02003069[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07003070+
3071Number of threads used to parse a command line submitted by a client
3072over SSH for execution, create the internal data structures used by
3073that command, and schedule it for execution on another thread.
3074+
3075By default, 2.
3076
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07003077[[sshd.maxAuthTries]]sshd.maxAuthTries::
3078+
3079Maximum number of authentication attempts before the server
3080disconnects the client. Each public key that a client has loaded
3081into its local agent counts as one auth request. Users can work
3082around the server's limit by loading less keys into their agent,
3083or selecting a specific key in their `~/.ssh/config` file with
3084the `IdentityFile` option.
3085+
3086By default, 6.
3087
3088[[sshd.loginGraceTime]]sshd.loginGraceTime::
3089+
3090Time in seconds that a client has to authenticate before the server
3091automatically terminates their connection. Values should use common
3092unit suffixes to express their setting:
3093+
3094* s, sec, second, seconds
3095* m, min, minute, minutes
3096* h, hr, hour, hours
3097* d, day, days
3098
3099+
3100By default, 2 minutes.
3101
Christian Aistleitner3d794592013-04-08 00:19:40 +02003102[[sshd.idleTimeout]]sshd.idleTimeout::
3103+
3104Time in seconds after which the server automatically terminates idle
3105connections (or 0 to disable closing of idle connections). Values
3106should use common unit suffixes to express their setting:
3107+
3108* s, sec, second, seconds
3109* m, min, minute, minutes
3110* h, hr, hour, hours
3111* d, day, days
3112
3113+
3114By default, 0.
3115
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07003116[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
3117+
3118Maximum number of concurrent SSH sessions that a user account
3119may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09003120that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07003121the number of commands a user may issue over a single connection.
3122If set to 0, there is no limit.
3123+
3124By default, 64.
3125
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003126[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003127+
3128Available ciphers. To permit multiple ciphers, specify multiple
3129`sshd.cipher` keys in the configuration file, one cipher name
3130per key. Cipher names starting with `+` are enabled in addition
3131to the default ciphers, cipher names starting with `-` are removed
3132from the default cipher set.
3133+
3134Supported ciphers: aes128-cbc, aes128-cbc, aes256-cbc, blowfish-cbc,
31353des-cbc, none.
3136+
3137By default, all supported ciphers except `none` are available.
3138
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003139[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003140+
3141Available MAC (message authentication code) algorithms. To permit
3142multiple algorithms, specify multiple `sshd.mac` keys in the
3143configuration file, one MAC per key. MAC names starting with `+`
3144are enabled in addition to the default MACs, MAC names starting with
3145`-` are removed from the default MACs.
3146+
3147Supported MACs: hmac-md5, hmac-md5-96, hmac-sha1, hmac-sha1-96.
3148+
3149By default, all supported MACs are available.
3150
Alex Blewitt7efb06f2013-04-01 12:46:48 -04003151[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
3152+
3153Enable kerberos authentication for SSH connections. To permit
3154kerberos authentication, the server must have a host principal
3155(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
3156This must be provisioned by the kerberos administrators, and is
3157typically installed into `/etc/krb5.keytab` on host machines.
3158+
3159The keytab must contain at least one `host/` principal, typically
3160using the host's canonical name. If it does not use the
3161canonical name, the `sshd.kerberosPrincipal` should be configured
3162with the correct name.
3163+
3164By default, not set and so kerberos authentication is not enabled.
3165
3166[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
3167+
3168If kerberos authentication is enabled with `sshd.kerberosKeytab`,
3169instead use the given principal name instead of the default.
3170If the principal does not begin with `host/` a warning message is
3171printed and may prevent successful authentication.
3172+
3173This may be useful if the host is behind an IP load balancer or
3174other SSH forwarding systems, since the principal name is constructed
3175by the client and must match for kerberos authentication to work.
3176+
3177By default, `host/canonical.host.name`
3178
Shawn Pearce318bfca2013-10-17 22:15:38 -07003179[[sshd.requestLog]]sshd.requestLog::
3180+
3181Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
3182If enabled, a request log file is written out by the SSH daemon.
3183+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01003184`log4j.appender` with the name `sshd_log` can be configured to overwrite
3185programmatic configuration.
3186+
Shawn Pearce318bfca2013-10-17 22:15:38 -07003187By default, true.
3188
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003189[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003190=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07003191
Dave Borowitz1ae8c532012-03-09 18:39:40 -08003192[[suggest.accounts]]suggest.accounts::
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07003193+
Dave Borowitz45baa892012-02-23 16:43:05 -08003194If `true`, visible user accounts (according to the value of
3195`accounts.visibility`) will be offered as completion suggestions
3196when adding a reviewer to a change, or a user to a group.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07003197+
Dave Borowitz45baa892012-02-23 16:43:05 -08003198If `false`, account suggestion is disabled.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07003199+
Dave Borowitz45baa892012-02-23 16:43:05 -08003200Older configurations may also have one of the `accounts.visibility`
3201values for this field, including `OFF` as a synonym for `NONE`. If
3202`accounts.visibility` is also set, that value overrides this one;
3203otherwise, this value applies to both `suggest.accounts` and
3204`accounts.visibility`.
Edwin Kempin42488812011-05-20 03:11:43 +02003205+
Dave Borowitz45baa892012-02-23 16:43:05 -08003206New configurations should prefer the boolean value for this field
3207and an enum value for `accounts.visibility`.
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07003208
Sven Selberg42d9d292014-08-13 11:20:11 +02003209[[suggest.maxSuggestedReviewers]]suggest.maxSuggestedReviewers::
3210+
3211The maximum numbers of reviewers suggested.
3212+
3213By default 10.
3214
3215[[suggest.fullTextSearch]]suggest.fullTextSearch::
3216+
3217If 'true' the reviewer completion suggestions will be based on a full text search.
3218
Edwin Kempinf957dc22012-10-19 20:41:18 +02003219[[suggest.from]]suggest.from::
3220+
3221The number of characters that a user must have typed before suggestions
3222are provided. If set to 0, suggestions are always provided.
3223+
3224By default 0.
3225
Sven Selberg42d9d292014-08-13 11:20:11 +02003226[[suggest.fullTextSearchMaxMatches]]suggest.fullTextSearchMaxMatches::
3227+
3228The maximum number of matches evaluated for change access when using full text search.
3229+
3230Making this number too high could have a negative impact on performance.
3231+
3232By default 100.
3233
3234
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003235[[theme]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003236=== Section theme
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003237
3238[[theme.backgroundColor]]theme.backgroundColor::
3239+
3240Background color for the page, and major data tables like the all
3241open changes table or the account dashboard. The value must be a
3242valid HTML hex color code, or standard color name.
3243+
Chad Horohoebbdf7482012-11-13 18:23:15 -08003244By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003245
3246[[theme.topMenuColor]]theme.topMenuColor::
3247+
3248This is the color of the main menu bar at the top of the page.
3249The value must be a valid HTML hex color code, or standard color
Chad Horohoebbdf7482012-11-13 18:23:15 -08003250name.
3251+
3252By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003253
3254[[theme.textColor]]theme.textColor::
3255+
3256Text color for the page, and major data tables like the all
3257open changes table or the account dashboard. The value must be a
3258valid HTML hex color code, or standard color name.
3259+
Chad Horohoebbdf7482012-11-13 18:23:15 -08003260By default dark grey, `353535`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003261
3262[[theme.trimColor]]theme.trimColor::
3263+
3264Primary color used as a background color behind text. This is
3265the color of the main menu bar at the top, of table headers,
3266and of major UI areas that we want to offset from other portions
3267of the page. The value must be a valid HTML hex color code, or
3268standard color name.
3269+
Chad Horohoebbdf7482012-11-13 18:23:15 -08003270By default a light grey, `EEEEEE`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003271
3272[[theme.selectionColor]]theme.selectionColor::
3273+
3274Background color used within a trimColor area to denote the currently
3275selected tab, or the background color used in a table to denote the
3276currently selected row. The value must be a valid HTML hex color
3277code, or standard color name.
3278+
Chad Horohoebbdf7482012-11-13 18:23:15 -08003279By default a pale blue, `D8EDF9`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003280
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01003281[[theme.changeTableOutdatedColor]]theme.changeTableOutdatedColor::
3282+
3283Background color used for patch outdated messages. The value must be
3284a valid HTML hex color code, or standard color name.
3285+
Edwin Kempinb0347332012-07-17 10:14:32 +02003286By default a shade of red, `F08080`.
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01003287
3288[[theme.tableOddRowColor]]theme.tableOddRowColor::
3289+
3290Background color for tables such as lists of open reviews for odd
3291rows. This is so you can have a different color for odd and even
3292rows of the table. The value must be a valid HTML hex color code,
3293or standard color name.
3294+
3295By default transparent.
3296
3297[[theme.tableEvenRowColor]]theme.tableEvenRowColor::
3298+
3299Background color for tables such as lists of open reviews for even
3300rows. This is so you can have a different color for odd and even
3301rows of the table. The value must be a valid HTML hex color code,
3302or standard color name.
3303+
3304By default transparent.
3305
Shawn O. Pearcea83bb1c2011-05-20 08:46:48 -07003306A different theme may be used for signed-in vs. signed-out user status
3307by using the "signed-in" and "signed-out" theme sections. Variables
3308not specified in a section are inherited from the default theme.
3309
3310----
3311[theme]
3312 backgroundColor = FFFFFF
3313[theme "signed-in"]
3314 backgroundColor = C0C0C0
3315[theme "signed-out"]
3316 backgroundColor = 00FFFF
3317----
3318
David Ostrovsky117c6032013-08-09 00:44:56 +02003319As example, here is the theme configuration to have the old green look:
3320
3321----
3322[theme]
3323 backgroundColor = FCFEEF
3324 textColor = 000000
3325 trimColor = D4E9A9
3326 selectionColor = FFFFCC
3327 topMenuColor = D4E9A9
3328 changeTableOutdatedColor = F08080
3329[theme "signed-in"]
3330 backgroundColor = FFFFFF
3331----
3332
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003333[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003334=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07003335
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07003336Tagged footer lines containing references to external
3337tracking systems, parsed out of the commit message and
Shawn Pearceff61c8a2013-10-07 19:35:53 -07003338saved in Gerrit's database.
3339
3340After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08003341must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07003342
Edwin Kempinbb421f12011-08-25 11:19:00 +02003343The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07003344bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07003345
3346----
3347[trackingid "jira-bug"]
3348 footer = Bugfix:
3349 match = JRA\\d{2,8}
3350 system = JIRA
3351
3352[trackingid "jira-feature"]
3353 footer = Feature
3354 match = JRA(\\d{2,8})
3355 system = JIRA
3356----
3357
3358[[trackingid.name.footer]]trackingid.<name>.footer::
3359+
3360A prefix tag that identify the footer line to parse for tracking ids.
Kevin Degi9af42ea2011-08-01 15:54:42 -06003361Several trackingid entries can have the same footer tag. A single
3362trackingid entry can have multiple footer tags. If multiple footer
3363tags are specified, each tag will be parsed separately.
Goran Lungberg04132a12010-06-15 17:20:37 -07003364(the trailing ":" is optional)
3365
3366[[trackingid.name.match]]trackingid.<name>.match::
3367+
Magnus Bäcke5611832011-02-02 08:57:15 +01003368A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
3369Java regular expression (java.util.regex)] used to match the
3370external tracking id part of the footer line. The match can
3371result in several entries in the DB. If grouping is used in the
3372regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01003373Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07003374+
3375The configuration file parser eats one level of backslashes, so the
3376character class `\s` requires `\\s` in the configuration file. The
3377parser also terminates the line at the first `#`, so a match
3378expression containing # must be wrapped in double quotes.
3379
3380[[trackingid.name.system]]trackingid.<name>.system::
3381+
David Pursehouse221d4f62012-06-08 17:38:08 +09003382The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07003383It is possible to have several trackingid entries for the same
3384tracking system.
3385
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003386[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003387=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07003388
3389[[transfer.timeout]]transfer.timeout::
3390+
3391Number of seconds to wait for a single network read or write
3392to complete before giving up and declaring the remote side is
3393not responding. If 0, there is no timeout, and this server will
3394wait indefinitely for a transfer to finish.
3395+
3396A timeout should be large enough to mostly transfer the objects to
3397the other side. 1 second may be too small for larger projects,
3398especially over a WAN link, while 10-30 seconds is a much more
3399reasonable timeout value.
3400+
3401Defaults to 0 seconds, wait indefinitely.
3402
lincoln2be11602010-07-05 10:53:25 -03003403
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003404[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003405=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003406
lincoln2be11602010-07-05 10:53:25 -03003407Sets the group of users allowed to execute 'upload-pack' on the
3408server, 'upload-pack' is what runs on the server during a user's
3409fetch, clone or repo sync command.
3410
3411----
3412[upload]
3413 allowGroup = GROUP_ALLOWED_TO_EXECUTE
3414 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
3415----
3416
3417[[upload.allowGroup]]upload.allowGroup::
3418+
3419Name of the groups of users that are allowed to execute 'upload-pack'
3420on the server. One or more groups can be set.
3421+
3422If no groups are added, any user will be allowed to execute
3423'upload-pack' on the server.
3424
3425
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003426[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003427=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003428
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003429[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003430+
3431Name that Gerrit calls itself in Git when it creates a new Git
3432commit, such as a merge during change submission.
3433+
3434By default this is "Gerrit Code Review".
3435
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003436[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003437+
3438Email address that Gerrit refers to itself as when it creates a
3439new Git commit, such as a merge commit during change submission.
3440+
3441If not set, Gerrit generates this as "gerrit@`hostname`", where
3442`hostname` is the hostname of the system Gerrit is running on.
3443+
3444By default, not set, generating the value at startup.
3445
Edwin Kempin0e02ded2011-09-16 15:10:14 +02003446[[user.anonymousCoward]]user.anonymousCoward::
3447+
David Pursehousea1d633b2014-05-02 17:21:02 +09003448Username that is displayed in the Gerrit Web UI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02003449notifications if the full name of the user is not set.
3450+
3451By default "Anonymous Coward" is used.
3452
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003453
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003454== File `etc/secure.config`
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003455The optional file `'$site_path'/etc/secure.config` overrides (or
3456supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003457The file should be readable only by the daemon process and can be
3458used to contain private configuration entries that wouldn't normally
3459be exposed to everyone.
3460
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003461Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003462----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07003463[auth]
3464 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
Brad Larson3a6f0772012-07-25 11:41:22 -05003465 restTokenPrivateKey = 7e40PzCjlUKOnXATvcBNXH6oyiu+r0dFk2c=
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07003466
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003467[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003468 username = webuser
3469 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003470
3471[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003472 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003473
3474[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003475 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003476
3477[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003478 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07003479
3480[remote "bar"]
3481 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003482----
3483
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003484== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01003485
3486The optional file `'$site_path'/etc/peer_keys` controls who can
3487login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
3488command.
3489
3490The format is one Base-64 encoded public key per line.
3491
3492
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003493== Database system_config
Shawn O. Pearce7b405712009-05-08 18:27:53 -07003494
3495Several columns in the `system_config` table within the metadata
3496database may be set to control how Gerrit behaves.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003497
3498[NOTE]
3499The contents of the `system_config` table are cached at startup
3500by Gerrit. If you modify any columns in this table, Gerrit needs
3501to be restarted before it will use the new values.
3502
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003503=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003504
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003505site_path::
3506+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003507Local filesystem directory holding the site customization assets.
3508Placing this directory under version control and/or backup is a
3509good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003510+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003511Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003512+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003513Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07003514+
Dave Borowitz1e49e142013-04-09 12:14:57 -07003515* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003516
Shawn O. Pearce5500e692009-05-28 15:55:01 -07003517GERRIT
3518------
3519Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07003520
3521SEARCHBOX
3522---------