blob: 065a211891eb38a54301dd51b0d9ae423a02e165 [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+
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200148* `OAUTH`
David Ostrovskye9707d82015-02-22 01:14:02 +0100149+
150OAuth is a protocol that lets external apps request authorization to private
151details in a user's account without getting their password. This is
152preferred over Basic Authentication because tokens can be limited to specific
153types of data, and can be revoked by users at any time.
154+
155Site owners have to register their application before getting started. Note
156that provider specific plugins must be used with this authentication scheme.
157+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700158* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
159+
160*DO NOT USE*. Only for use in a development environment.
161+
162When this is the configured authentication method a hyperlink titled
163`Become` appears in the top right corner of the page, taking the
164user to a form where they can enter the username of any existing
165user account, and immediately login as that account, without any
166authentication taking place. This form of authentication is only
167useful for the GWT hosted mode shell, where OpenID authentication
168redirects might be risky to the developer's host computer, and HTTP
169authentication is not possible.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700170
171+
172By default, OpenID.
173
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700174[[auth.allowedOpenID]]auth.allowedOpenID::
175+
176List of permitted OpenID providers. A user may only authenticate
177with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse42f42042013-08-01 14:02:25 +0900178is set to `OpenID` (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700179+
Magnus Bäcke5611832011-02-02 08:57:15 +0100180Patterns may be either a
181link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
182Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700183end with `$`) or be a simple prefix (any other string).
184+
185By default, the list contains two values, `http://` and `https://`,
186allowing users to authenticate with any OpenID provider.
187
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700188[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700189+
David Pursehouse221d4f62012-06-08 17:38:08 +0900190List of trusted OpenID providers. Only used if `auth.type` is
David Pursehouse42f42042013-08-01 14:02:25 +0900191set to `OpenID` (the default).
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700192+
193In order for a user to take advantage of permissions beyond those
194granted to the `Anonymous Users` and `Registered Users` groups,
195the user account must only have OpenIDs which match at least one
196pattern from this list.
197+
Magnus Bäcke5611832011-02-02 08:57:15 +0100198Patterns may be either a
199link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
200Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700201end with `$`) or be a simple prefix (any other string).
202+
203By default, the list contains two values, `http://` and `https://`,
204allowing Gerrit to trust any OpenID it receives.
205
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100206[[auth.openIdDomain]]auth.openIdDomain::
207+
208List of allowed OpenID email address domains. Only used if
David Pursehouse42f42042013-08-01 14:02:25 +0900209`auth.type` is set to `OPENID` or `OPENID_SSO`.
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100210+
211Domain is case insensitive and must be in the same form as it
212appears in the email address, for example, "example.com".
213+
214By default, any domain is accepted.
215
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700216[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
217+
218Time in seconds before an OpenID provider must force the user
219to authenticate themselves again before authentication to this
220Gerrit server. Currently this is only a polite request, and users
221coming from providers that don't support the PAPE extension will
222be accepted anyway. In the future it may be enforced, rejecting
223users coming from providers that don't honor the max session age.
224+
225If set to 0, the provider will always force the user to authenticate
226(e.g. supply their password). Values should use common unit suffixes
227to express their setting:
228+
229* s, sec, second, seconds
230* m, min, minute, minutes
231* h, hr, hour, hours
232* d, day, days
233* w, week, weeks (`1 week` is treated as `7 days`)
234* mon, month, months (`1 month` is treated as `30 days`)
235* y, year, years (`1 year` is treated as `365 days`)
236
237+
238Default is -1, permitting infinite time between authentications.
239
David Pursehouse5be35a32015-09-09 17:35:32 +0900240[[auth.registerEmailPrivateKey]]auth.registerEmailPrivateKey::
241+
242Private key to use when generating an email verification token.
243+
244If not set, a random key is generated when running the
245link:pgm-init.html[site initialization].
246
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700247[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
248+
249Time in seconds before an email verification token sent to a user in
250order to validate their email address expires.
251+
252* s, sec, second, seconds
253* m, min, minute, minutes
254* h, hr, hour, hours
255* d, day, days
256* w, week, weeks (`1 week` is treated as `7 days`)
257* mon, month, months (`1 month` is treated as `30 days`)
258* y, year, years (`1 year` is treated as `365 days`)
259
260+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800261Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700262
James E. Blairca8bc3b2011-12-21 18:12:26 +0000263[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
264+
David Pursehouse42f42042013-08-01 14:02:25 +0900265The SSO entry point URL. Only used if `auth.type` is set to
266`OpenID_SSO`.
James E. Blairca8bc3b2011-12-21 18:12:26 +0000267+
268The "Sign In" link will send users directly to this URL.
269
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700270[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700271+
272HTTP header to trust the username from, or unset to select HTTP basic
David Pursehouse42f42042013-08-01 14:02:25 +0900273or digest authentication. Only used if `auth.type` is set to `HTTP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700274
Luca Milanesio384ed6c2013-07-30 09:10:07 +0100275[[auth.httpDisplaynameHeader]]auth.httpDisplaynameHeader::
276+
277HTTP header to retrieve the user's display name from. Only used if `auth.type`
278is set to `HTTP`.
279+
280If set, Gerrit trusts and enforces the user's full name using the HTTP header
281and disables the ability to manually modify the user's full name
282from the contact information page.
283
284[[auth.httpEmailHeader]]auth.httpEmailHeader::
285+
286HTTP header to retrieve the user's e-mail from. Only used if `auth.type`
287is set to `HTTP`.
288+
289If set, Gerrit trusts and enforces the user's e-mail using the HTTP header
290and disables the ability to manually modify or register other e-mails
291from the contact information page.
292
Luca Milanesio97d07352014-07-17 08:31:06 +0100293[[auth.httpExternalIdHeader]]auth.httpExternalIdHeader::
294+
295HTTP header to retrieve the user's external identification token.
296Only used if `auth.type` is set to `HTTP`.
297+
298If set, Gerrit adds the value contained in the HTTP header to the
299user's identity. Typical use is with a federated identity token from
300an external system (e.g. GitHub OAuth 2.0 authentication) where
301the user's auth token exchanged during authentication handshake
302needs to be used for authenticated communication to the external
303system later on.
304+
305Example: `auth.httpExternalIdHeader: X-GitHub-OTP`
306
Luca Milanesio5185b042013-07-27 22:03:06 +0100307[[auth.loginUrl]]auth.loginUrl::
308+
309URL to redirect a browser to after the end-user has clicked on the
David Pursehouse42f42042013-08-01 14:02:25 +0900310login link in the upper right corner. Only used if `auth.type` is set
311to `HTTP` or `HTTP_LDAP`.
Luca Milanesio5185b042013-07-27 22:03:06 +0100312Organizations using an enterprise single-sign-on solution may want to
313redirect the browser to the SSO product's sign-in page for completing the
314login process and validate their credentials.
315+
David Pursehouse42f42042013-08-01 14:02:25 +0900316If set, Gerrit allows anonymous access until the end-user performs the login
317and provides a trusted identity through the HTTP header.
Luca Milanesio5185b042013-07-27 22:03:06 +0100318If not set, Gerrit requires the HTTP header with a trusted identity
David Pursehouse42f42042013-08-01 14:02:25 +0900319and returns the error page 'LoginRedirect.html' if such a header is not
320present.
Luca Milanesio5185b042013-07-27 22:03:06 +0100321
322[[auth.loginText]]auth.loginText::
323+
David Pursehouse42f42042013-08-01 14:02:25 +0900324Text displayed in the loginUrl link. Only used if `auth.loginUrl` is set.
Luca Milanesio5185b042013-07-27 22:03:06 +0100325+
David Pursehouse42f42042013-08-01 14:02:25 +0900326If not set, the "Sign In" text is used.
Luca Milanesio5185b042013-07-27 22:03:06 +0100327
Luca Milanesio111e0b72013-08-15 18:56:42 +0100328[[auth.registerPageUrl]]auth.registerPageUrl::
329+
David Pursehouse268744b2013-08-17 15:32:11 +0900330URL of the registration page to use when a new user logs in to Gerrit for
331the first time. Used only when `auth.type` is set to `HTTP`.
Luca Milanesio111e0b72013-08-15 18:56:42 +0100332+
333If not set, the standard Gerrit registration page `/#/register/` is displayed.
334
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700335[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700336+
337URL to redirect a browser to after the end-user has clicked on the
338"Sign Out" link in the upper right corner. Organizations using an
339enterprise single-sign-on solution may want to redirect the browser
340to the SSO product's sign-out page.
341+
342If not set, the redirect returns to the list of all open changes.
343
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800344[[auth.registerUrl]]auth.registerUrl::
345+
346Target for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200347when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800348+
349If not set, no "Register" link is displayed.
350
Chad Horohoe65897082012-11-10 10:26:25 -0800351[[auth.registerText]]auth.registerText::
352+
353Text for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200354when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Chad Horohoe65897082012-11-10 10:26:25 -0800355+
356If not set, defaults to "Register".
357
David Pursehouse3d604492013-01-25 17:41:53 +0900358[[auth.editFullNameUrl]]auth.editFullNameUrl::
359+
360Target for the "Edit" button when the user is allowed to edit their
Edwin Kempin54093152015-05-08 10:50:35 +0200361full name. Used only when `auth.type` is `LDAP`, `LDAP_BIND` or
362`CUSTOM_EXTENSION`.
David Pursehouse3d604492013-01-25 17:41:53 +0900363
364[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
365+
David Pursehouse42f42042013-08-01 14:02:25 +0900366Target for the "Obtain Password" link. Used only when `auth.type` is
Edwin Kempin54093152015-05-08 10:50:35 +0200367`CUSTOM_EXTENSION`.
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700368
369[[auth.switchAccountUrl]]auth.switchAccountUrl::
David Pursehouse3d604492013-01-25 17:41:53 +0900370+
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700371URL to switch user identities and login as a different account than
372the currently active account. This is disabled by default except when
373`auth.type` is `OPENID` and `DEVELOPMENT_BECOME_ANY_ACCOUNT`. If set
374the "Switch Account" link is displayed next to "Sign Out".
375+
376When `auth.type` does not normally enable this URL administrators may
377set this to `login/` or `$canonicalWebUrl/login`, allowing users to
378begin a new web session.
David Pursehouse3d604492013-01-25 17:41:53 +0900379
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000380[[auth.cookiePath]]auth.cookiePath::
381+
382Sets "path" attribute of the authentication cookie.
383+
384If not set, HTTP request's path is used.
385
Sammy Gillespie26873c02016-02-11 14:39:43 +0000386[[auth.cookieDomain]]auth.cookieDomain::
387+
388Sets "domain" attribute of the authentication cookie.
389+
390If not set, HTTP request's domain is used.
391
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000392[[auth.cookieSecure]]auth.cookieSecure::
393+
394Sets "secure" flag of the authentication cookie. If true, cookies
395will be transmitted only over HTTPS protocol.
396+
397By default, false.
398
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700399[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700400+
401Optional format string to construct user email addresses out of
David Pursehouse42f42042013-08-01 14:02:25 +0900402user login names. Only used if `auth.type` is `HTTP`, `HTTP_LDAP`
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700403or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700404+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700405This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700406with the login name. E.g. "\{0\}+gerrit@example.com" with a user
407login name of "foo" will produce "foo+gerrit@example.com" during
408the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700409+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700410If the site is using `HTTP_LDAP` or `LDAP`, using this option is
411discouraged. Setting `ldap.accountEmailAddress` and importing the
412email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700413
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700414[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700415+
416Controls whether or not the contributor agreement features are
417enabled for the Gerrit site. If enabled a user must complete a
418contributor agreement before they can upload changes.
419+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800420If enabled, the admin must also add one or more
421link:config-cla.html[contributor-agreement sections]
422in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700423`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700424more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700425+
426By default this is false (no agreements are used).
Fredrik Luthandera3cf3542012-07-04 16:55:35 -0700427+
428To enable the actual usage of contributor agreement the project
429specific config option in the `project.config` must be set:
430link:config-project-config.html[receive.requireContributorAgreement].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700431
Christian Halstricka3d88a52011-08-31 09:21:41 +0200432[[auth.trustContainerAuth]]auth.trustContainerAuth::
433+
434If true then it is the responsibility of the container hosting
435Gerrit to authenticate users. In this case Gerrit will blindly trust
436the container.
437+
438This parameter only affects git over http traffic. If set to false
439then Gerrit will do the authentication (using DIGEST authentication).
440+
441By default this is set to false.
442
Luca Milanesio42058842012-01-05 21:25:38 +0000443[[auth.gitBasicAuth]]auth.gitBasicAuth::
444+
445If true then Git over HTTP and HTTP/S traffic is authenticated using
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200446standard BasicAuth. Depending on the configured `auth.type` credentials
447are validated against the randomly generated HTTP password, against LDAP
448(`auth.type = LDAP`) or against an OAuth 2 provider (`auth.type = OAUTH`).
Luca Milanesio42058842012-01-05 21:25:38 +0000449+
Edwin Kempin4b9d9982014-04-16 11:27:46 +0200450This parameter affects git over HTTP traffic and access to the REST
451API. If set to false then Gerrit will authenticate through DIGEST
452authentication and the randomly generated HTTP password in the Gerrit
453database.
Luca Milanesio42058842012-01-05 21:25:38 +0000454+
Edwin Kempinc5eb0032014-04-16 11:09:58 +0200455When `auth.type` is `LDAP`, service users that only exist in the Gerrit
456database are still authenticated by their HTTP passwords.
Luca Milanesio42058842012-01-05 21:25:38 +0000457+
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200458When `auth.type` is `OAUTH`, Git clients may send OAuth 2 access tokens
459instead of passwords in the Basic authentication header. Note that provider
460specific plugins must be installed to facilitate this authentication scheme.
461If multiple OAuth 2 provider plugins are installed one of them must be
462selected as default with the `auth.gitOAuthProvider` option.
463+
Luca Milanesio42058842012-01-05 21:25:38 +0000464By default this is set to false.
465
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200466[[auth.gitOAuthProvider]]auth.gitOAuthProvider::
467+
468Selects the OAuth 2 provider to authenticate git over HTTP traffic with.
469+
470In general there is no way to determine from an access token alone, which
471OAuth 2 provider to address to verify that token, and the BasicAuth
472scheme does not support amending such details. If multiple OAuth provider
473plugins in a system offer support for git over HTTP authentication site
474administrators must configure, which one to use as default provider.
475In case the provider cannot be determined from a request the access token
476will be sent to the default provider for verification.
477+
478The value of this parameter must be the identifier of an OAuth 2 provider
479in the form `plugin-name:provider-name`. Consult the respective plugin
480documentation for details.
481
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200482[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
483+
484If set the username that is received to authenticate a git operation
485is converted to lower case for looking up the user account in Gerrit.
486+
487By setting this parameter a case insensitive authentication for the
488git operations can be achieved, if it is ensured that the usernames in
489Gerrit (scheme `username`) are stored in lower case (e.g. if the
490parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
491set to `${sAMAccountName.toLowerCase}`). It is important that for all
492existing accounts this username is already in lower case. It is not
493possible to convert the usernames of the existing accounts to lower
494case because this would break the access to existing per-user
495branches.
496+
497This parameter only affects git over http and git over SSH traffic.
498+
499By default this is set to false.
500
Shawn Pearcea931fe12013-06-11 12:29:17 -0700501[[auth.enableRunAs]]auth.enableRunAs::
502+
503If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
504header from any users granted the link:access-control.html#capability_runAs[Run As]
505capability. The header and capability permit the authenticated user
506to impersonate another account.
507+
508If false the feature is disabled and cannot be re-enabled without
509editing gerrit.config and restarting the server.
510+
511Default is true.
512
David Pursehouse21bd07b2015-11-27 00:15:42 +0900513[[auth.allowRegisterNewEmail]]auth.allowRegisterNewEmail::
514+
515Whether users are allowed to register new email addresses.
516+
517In addition for the HTTP authentication type
518link:#auth.httpemailheader[auth.httpemailheader] must *not* be set to
519enable registration of new email addresses.
520+
521By default, true.
522
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800523[[cache]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800524=== Section cache
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700525
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700526[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700527+
528Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700529future lookup. This local disk cache is used to retain potentially
530expensive to compute information across restarts. If the location
531does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700532+
Saša Živkove607d6c2016-02-24 10:46:46 +0000533Tehnically, cached entities are persisted as a set of H2 databases
534inside this directory.
535+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700536If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700537+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700538Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700539
Saša Živkovf3134572016-02-09 11:42:46 +0100540[[cache.h2CacheSize]]cache.h2CacheSize::
541+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200542The size of the in-memory cache for each opened H2 cache database, in bytes.
Saša Živkove607d6c2016-02-24 10:46:46 +0000543+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200544Some caches of Gerrit are persistent and are backed by an H2 database.
Saša Živkove607d6c2016-02-24 10:46:46 +0000545H2 uses memory to cache its database content. The parameter `h2CacheSize`
546allows to limit the memory used by H2 and thus prevent out-of-memory
Saša Živkovf3134572016-02-09 11:42:46 +0100547caused by the H2 database using too much memory.
548+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200549See <<database.h2.cachesize,database.h2.cachesize>> for a detailed discussion.
Saša Živkovf3134572016-02-09 11:42:46 +0100550+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200551Default is unset, using up to half of the available memory.
552
553H2 will persist this value in the database, so to unset explicitly specify 0.
Saša Živkovf3134572016-02-09 11:42:46 +0100554+
555Common unit suffixes of 'k', 'm', or 'g' are supported.
556
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200557[[cache.h2AutoServer]]cache.h2AutoServer::
558+
559If set to true, enable H2 autoserver mode for the H2-backed persistent cache
560databases.
561+
562See link:http://www.h2database.com/html/features.html#auto_mixed_mode[here]
563for detail.
564+
565Default is false.
566
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700567[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700568+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700569Maximum age to keep an entry in the cache. Entries are removed from
570the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700571Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700572+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700573* s, sec, second, seconds
574* m, min, minute, minutes
575* h, hr, hour, hours
576* d, day, days
577* w, week, weeks (`1 week` is treated as `7 days`)
578* mon, month, months (`1 month` is treated as `30 days`)
579* y, year, years (`1 year` is treated as `365 days`)
580
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700581+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200582--
Edwin Kempinabcd5042013-03-12 16:04:37 +0100583If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700584supplied, the maximum age is infinite and items are never purged
585except when the cache is full.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200586
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700587Default is `0`, meaning store forever with no expire, except:
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200588
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400589* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700590* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700591* `"web_sessions"`: default is `12 hours`
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200592--
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700593
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700594[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700595+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700596The total cost of entries to retain in memory. The cost computation
597varies by the cache. For most caches where the in-memory size of each
598entry is relatively the same, memoryLimit is currently defined to be
599the number of entries held by the cache (each entry costs 1).
600+
601For caches where the size of an entry can vary significantly between
602individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
603is an approximation of the total number of bytes stored by the cache.
604Larger entries that represent bigger patch sets or longer source files
605will consume a bigger portion of the memoryLimit. For these caches the
606memoryLimit should be set to roughly the amount of RAM (in bytes) the
607administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700608+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700609Default is 1024 for most caches, except:
610+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400611* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700612* `"diff"`: default is `10m` (10 MiB of memory)
613* `"diff_intraline"`: default is `10m` (10 MiB of memory)
614* `"plugin_resources"`: default is 2m (2 MiB of memory)
615
616+
617If set to 0 the cache is disabled. Entries are removed immediately
618after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700619
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700620[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700621+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700622Total size in bytes of the keys and values stored on disk. Caches that
623have grown bigger than this size are scanned daily at 1 AM local
624server time to trim the cache. Entries are removed in least recently
625accessed order until the cache fits within this limit. Caches may
626grow larger than this during the day, as the size check is only
627performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700628+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700629Default is 128 MiB per cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700630+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700631If 0, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700632
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800633==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700634
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700635cache `"accounts"`::
636+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700637Cache entries contain important details of an active user, including
638their display name, preferences, known email addresses, and group
639memberships. Entry information is obtained from the following
640database tables:
641+
642* `accounts`
643+
644* `account_group_members`
645+
646* `account_external_ids`
647
648+
649If direct updates are made to any of these database tables, this
650cache should be flushed.
651
652cache `"accounts_byemail"`::
653+
654Caches account identities keyed by email address, which is scanned
655from the `account_external_ids` database table. If updates are
656made to this table, this cache should be flushed.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700657
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400658cache `"adv_bases"`::
659+
660Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900661are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400662for the client to use as potential delta bases. Push over smart HTTP
663requires two HTTP requests, and this cache tries to carry state from
664the first request into the second to ensure it can complete.
665
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200666cache `"changes"`::
667+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200668The size of `memoryLimit` determines the number of projects for which
669all changes will be cached. If the cache is set to 1024, this means all
670changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800671+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200672Default value is 0 (disabled). It is disabled by default due to the fact
673that change updates are not communicated between Gerrit servers. Hence
674this cache should be disabled in an multi-master/multi-slave setup.
Gustaf Lundh53493772012-11-18 18:41:15 -0800675+
676The cache should be flushed whenever the database changes table is modified
Matt Baker8ce12fc2013-11-26 21:43:12 -0700677outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200678
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700679cache `"diff"`::
680+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700681Each item caches the differences between two commits, at both the
682directory and file levels. Gerrit uses this cache to accelerate
683the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700684+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700685Entries in this cache are relatively large, so memoryLimit is an
686estimate in bytes of memory used. Administrators should try to target
687cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
688day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700689
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400690cache `"diff_intraline"`::
691+
692Each item caches the intraline difference of one file, when compared
693between two commits. Gerrit uses this cache to accelerate display of
694intraline differences when viewing a file.
695+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700696Entries in this cache are relatively large, so memoryLimit is an
697estimate in bytes of memory used. Administrators should try to target
698cache.diff.memoryLimit to fit all files users will view in a 1 or 2
699day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400700
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700701cache `"git_tags"`::
702+
703If branch or reference level READ access controls are used, this
704cache tracks which tags are reachable from the branch tips of a
705repository. Gerrit uses this information to determine the set
706of tags that a client may access, derived from which tags are
707part of the history of a visible branch.
708+
709The cache is persisted to disk across server restarts as it can
710be expensive to compute (60 or more seconds for a large history
711like the Linux kernel repository).
712
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700713cache `"groups"`::
714+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700715Caches the basic group information from the `account_groups` table,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700716including the group owner, name, and description.
717+
718Gerrit group membership obtained from the `account_group_members`
719table is cached under the `"accounts"` cache, above. External group
720membership obtained from LDAP is cached under `"ldap_groups"`.
721
Matt Fischer620255a2011-03-22 14:28:23 -0500722cache `"groups_byinclude"`::
723+
724Caches group inclusions in other groups. If direct updates are made
725to the `account_group_includes` table, this cache should be flushed.
726
Bruce Zu825125a2014-11-19 17:01:42 +0900727cache `"groups_members"`::
728+
729Caches subgroups. If direct updates are made to the
730`account_group_includes` table, this cache should be flushed.
731
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700732cache `"ldap_groups"`::
733+
734Caches the LDAP groups that a user belongs to, if LDAP has been
735configured on this server. This cache should be configured with a
736low maxAge setting, to ensure LDAP modifications are picked up in
737a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700738
Gustaf Lundh0919a492012-10-19 15:29:23 +0200739cache `"ldap_groups_byinclude"`::
740+
741Caches the hierarchical structure of LDAP groups.
742
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -0700743cache `"ldap_usernames"`::
744+
745Caches a mapping of LDAP username to Gerrit account identity. The
746cache automatically updates when a user first creates their account
747within Gerrit, so the cache expire time is largely irrelevant.
748
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700749cache `"permission_sort"`::
750+
David Pursehouse221d4f62012-06-08 17:38:08 +0900751Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700752reference. Sorting the sections can be expensive when regular
753expressions are used, so this cache remembers the ordering for
754each branch.
755
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700756cache `"plugin_resources"`::
757+
758Caches formatted plugin resources, such as plugin documentation that
759has been converted from Markdown to HTML. The memoryLimit refers to
760the bytes of memory dedicated to storing the documentation.
761
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700762cache `"projects"`::
763+
764Caches the project description records, from the `projects` table
765in the database. If a project record is updated or deleted, this
766cache should be flushed. Newly inserted projects do not require
767a cache flush, as they will be read upon first reference.
768
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700769cache `"sshkeys"`::
770+
771Caches unpacked versions of user SSH keys, so the internal SSH daemon
772can match against them during authentication. The unit of storage
773is per-user, so 1024 items translates to 1024 unique user accounts.
774As each individual user account may configure multiple SSH keys,
775the total number of keys may be larger than the item count.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700776+
777This cache is based off the `account_ssh_keys` table and the
778`accounts.ssh_user_name` column in the database. If either is
779modified directly, this cache should be flushed.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700780
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700781cache `"web_sessions"`::
782+
783Tracks the live user sessions coming in over HTTP. Flushing this
784cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -0700785them to sign-in again. To avoid breaking active users, this cache
786is not flushed automatically by `gerrit flush-caches --all`, but
787instead must be explicitly requested.
788+
789If no disk cache is configured (or `cache.web_sessions.diskLimit`
790is set to 0) a server restart will force all users to sign-out,
791and need to sign-in again after the restart, as the cache was
792unable to persist the session information. Enabling a disk cache
793is strongly recommended.
794+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700795Session storage is relatively inexpensive. The average entry in
796this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700797
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700798See also link:cmd-flush-caches.html[gerrit flush-caches].
799
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800800==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800801
Hugo Arès2bc86812015-03-09 15:20:28 -0400802[[cache.diff.timeout]]cache.diff.timeout::
803+
804Maximum number of milliseconds to wait for diff data before giving up and
805falling back on a simpler diff algorithm that will not be able to break down
806modified regions into smaller ones. This is a work around for an infinite loop
807bug in the default difference algorithm implementation.
808+
809Values should use common unit suffixes to express their setting:
810+
811* ms, milliseconds
812* s, sec, second, seconds
813* m, min, minute, minutes
814* h, hr, hour, hours
815
816+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200817--
Hugo Arès2bc86812015-03-09 15:20:28 -0400818If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200819
Hugo Arès2bc86812015-03-09 15:20:28 -0400820Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200821--
Hugo Arès2bc86812015-03-09 15:20:28 -0400822
Edwin Kempin42d27432013-11-24 17:06:24 +0100823[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800824+
825Maximum number of milliseconds to wait for intraline difference data
826before giving up and disabling it for a particular file pair. This is
827a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +0900828implementation.
829+
830If computation takes longer than the timeout, the worker thread is
831terminated, an error message is shown, and no intraline difference is
832displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800833+
834Values should use common unit suffixes to express their setting:
835+
836* ms, milliseconds
837* s, sec, second, seconds
838* m, min, minute, minutes
839* h, hr, hour, hours
840
841+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200842--
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800843If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200844
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800845Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200846--
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800847
Edwin Kempin42d27432013-11-24 17:06:24 +0100848[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800849+
850Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800851when populating a diff cache entry. This flag is provided primarily
852as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +0900853necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800854this setting will fallback to `cache.diff.intraline` if not set in the
855configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800856+
857Default is true, enabled.
858
Edwin Kempin42d27432013-11-24 17:06:24 +0100859[[cache.projects.checkFrequency]]cache.projects.checkFrequency::
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700860+
861How often project configuration should be checked for update from Git.
862Gerrit Code Review caches project access rules and configuration in
863memory, checking the refs/meta/config branch every checkFrequency
864minutes to see if a new revision should be loaded and used for future
865access. Values can be specified using standard time unit abbreviations
866('ms', 'sec', 'min', etc.).
867+
868If set to 0, checks occur every time, which may slow down operations.
Shawn Pearcec825ef12013-02-20 11:29:46 -0800869If set to 'disabled' or 'off', no check will ever be done.
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700870Administrators may force the cache to flush with
871link:cmd-flush-caches.html[gerrit flush-caches].
872+
873Default is 5 minutes.
874
Simon Leifc19ff12014-10-02 13:36:00 -0400875[[cache.projects.loadOnStartup]]cache.projects.loadOnStartup::
876+
877If the project cache should be loaded during server startup.
878+
879The cache is loaded concurrently. Admins should ensure that the cache
880size set under <<cache.name.memoryLimit,cache.projects.memoryLimit>>
881is not smaller than the number of repos.
882+
883Default is false, disabled.
884
885[[cache.projects.loadThreads]]cache.projects.loadThreads::
886+
887Only relevant if <<cache.projects.loadOnStartup,cache.projects.loadOnStartup>>
888is true.
889+
890The number of threads to allocate for loading the cache at startup. These
891threads will die out after the cache is loaded.
892+
893Default is the number of CPUs.
894
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800895[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800896=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700897
Edwin Kempin662e55f2013-11-23 12:50:29 +0100898[[change.largeChange]]change.largeChange::
899+
900Number of changed lines from which on a change is considered as a large
901change. The number of changed lines of a change is the sum of the lines
902that were inserted and deleted in the change.
903+
David Pursehousea1d633b2014-05-02 17:21:02 +0900904The specified value is used to visualize the change sizes in the Web UI
Edwin Kempin662e55f2013-11-23 12:50:29 +0100905in change tables and user dashboards.
906+
907By default 500.
908
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700909[[change.updateDelay]]change.updateDelay::
910+
911How often in seconds the web interface should poll for updates to the
912currently open change. The poller relies on the client's browser
913cache to use If-Modified-Since and respect `304 Not Modified` HTTP
Matt Baker8ce12fc2013-11-26 21:43:12 -0700914responses. This allows for fast polls, often under 8 milliseconds.
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700915+
916With a configured 30 second delay a server with 4900 active users will
917typically need to dedicate 1 CPU to the update check. 4900 users
918divided by an average delay of 30 seconds is 163 requests arriving per
Edwin Kempin720eebe2014-07-16 13:44:04 +0200919second. If requests are served at \~6 ms response time, 1 CPU is
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700920necessary to keep up with the update request traffic. On a smaller
921user base of 500 active users, the default 30 second delay is only 17
922requests per second and requires ~10% CPU.
923+
924If 0 the update polling is disabled.
925+
926Default is 30 seconds.
927
Gabor Somossyb72d4c62015-10-20 23:40:07 +0100928[[change.allowBlame]]change.allowBlame::
929+
930Allow blame on side by side diff. If set to false, blame cannot be used.
931+
932Default is true.
933
David Ostrovsky1b61dc72014-01-28 18:40:48 +0100934[[change.allowDrafts]]change.allowDrafts::
935+
936Allow drafts workflow. If set to false, drafts cannot be created,
937deleted or published.
938+
939Default is true.
940
Dave Borowitzf5e6e042016-04-25 13:03:42 -0400941[[change.cacheAutomerge]]change.cacheAutomerge::
942+
943When reviewing diff commits, the left-hand side shows the output of the
944result of JGit's automatic merge algorithm. This option controls whether
945this output is cached in the change repository, or if only the diff is
946cached in the persistent `diff` cache.
947+
948If true, automerge results are stored in the repository under
949`refs/cache-automerge/*`; the results of diffing the change against its
950automerge base are stored in the diff cache. If false, no extra data is
951stored in the repository, only the diff cache. This can result in slight
952performance improvements by reducing the number of refs in the repo.
953+
954Default is true.
955
David Ostrovsky9933eb32014-05-20 16:08:20 +0200956[[change.submitLabel]]change.submitLabel::
957+
958Label name for the submit button.
959+
960Default is "Submit".
961
Stefan Beller7c380d512015-08-21 10:55:21 -0700962[[change.submitLabelWithParents]]change.submitLabelWithParents::
963+
964Label name for the submit button if the change has parents which will
965be submitted together with this change.
966+
967Default is "Submit including parents".
968
David Ostrovsky9933eb32014-05-20 16:08:20 +0200969[[change.submitTooltip]]change.submitTooltip::
970+
971Tooltip for the submit button. Variables available for replacement
972include `${patchSet}` for the current patch set number (1, 2, 3),
973`${branch}` for the branch name ("master") and `${commit}` for the
974abbreviated commit SHA-1 (`c9c0edb`).
975+
976Default is "Submit patch set ${patchSet} into ${branch}".
977
Stefan Beller0e655542015-07-20 21:14:38 -0700978[[change.submitTooltipAncestors]]change.submitTooltipAncestors::
979+
980Tooltip for the submit button if there are ancestors which would
981also be submitted by submitting the change. Additionally to the variables
982as in link:#change.submitTooltip[change.submitTooltip], there is the
983variable `${submitSize}` indicating the number of changes which are
984submitted.
985+
986Default is "Submit all ${topicSize} changes of the same topic (${submitSize}
987changes including ancestors and other changes related by topic)".
988
David Pursehouse2ecd0302016-04-07 19:12:00 +0900989[[change.submitWholeTopic]]change.submitWholeTopic::
Stefan Bellera038cf72015-01-13 16:25:10 -0800990+
991Determines if the submit button submits the whole topic instead of
992just the current change.
993+
994Default is false.
995
996[[change.submitTopicLabel]]change.submitTopicLabel::
997+
998If `change.submitWholeTopic` is set and a change has a topic,
999the label name for the submit button is given here instead of
1000the configuration `change.submitLabel`.
1001+
1002Defaults to "Submit whole topic"
1003
1004[[change.submitTopicTooltip]]change.submitTopicTooltip::
1005+
1006If `change.submitWholeTopic` is configuerd to true and a change has a
1007topic, this configuration determines the tooltip for the submit button
1008instead of `change.submitTooltip`. The variable `${topicSize}` is available
Stefan Beller7c380d512015-08-21 10:55:21 -07001009for the number of changes in the same topic to be submitted. The number of
1010all changes to be submitted is in the variable `${submitSize}`.
Stefan Bellera038cf72015-01-13 16:25:10 -08001011+
Stefan Beller7c380d512015-08-21 10:55:21 -07001012Defaults to "Submit all ${topicSize} changes of the same topic
1013(${submitSize} changes including ancestors and other
1014changes related by topic)".
Stefan Bellera038cf72015-01-13 16:25:10 -08001015
Richard Möhne4abe9a2014-11-13 20:05:13 +01001016[[change.replyLabel]]change.replyLabel::
1017+
1018Label name for the reply button. In the user interface an ellipsis (…)
1019is appended.
1020+
1021Default is "Reply". In the user interface it becomes "Reply…".
1022
1023[[change.replyTooltip]]change.replyTooltip::
1024+
1025Tooltip for the reply button. In the user interface a note about the
1026keyboard shortcut is appended.
1027+
1028Default is "Reply and score". In the user interface it becomes "Reply
1029and score (Shortcut: a)".
1030
Edwin Kempine326a1d2015-06-03 10:27:39 +02001031[[changeCleanup]]
1032=== Section changeCleanup
1033
1034This section allows to configure change cleanups and schedules them to
1035run periodically.
1036
1037[[changeCleanup.abandonAfter]]changeCleanup.abandonAfter::
1038+
1039Period of inactivity after which open changes should be abandoned
1040automatically.
1041+
1042By default `0`, never abandon open changes.
1043+
1044[WARNING] Auto-Abandoning changes may confuse/annoy users. When
1045enabling this, make sure to choose a reasonably large grace period and
1046inform users in advance.
1047+
1048The following suffixes are supported to define the time unit:
1049+
1050* `d, day, days`
1051* `w, week, weeks` (`1 week` is treated as `7 days`)
1052* `mon, month, months` (`1 month` is treated as `30 days`)
1053* `y, year, years` (`1 year` is treated as `365 days`)
1054
Edwin Kempin7080ef12015-06-10 15:03:09 +02001055[[changeCleanup.abandonIfMergeable]]changeCleanup.abandonIfMergeable::
1056+
1057Whether changes which are mergeable should be auto-abandoned.
1058+
1059By default `true`.
1060
Edwin Kempine326a1d2015-06-03 10:27:39 +02001061[[changeCleanup.abandonMessage]]changeCleanup.abandonMessage::
1062+
1063Change message that should be posted when a change is abandoned.
1064+
1065'${URL}' can be used as a placeholder for the Gerrit web URL.
1066+
1067By default "Auto-Abandoned due to inactivity, see
1068${URL}Documentation/user-change-cleanup.html#auto-abandon\n\n
1069If this change is still wanted it should be restored.".
1070
1071[[changeCleanup.startTime]]changeCleanup.startTime::
1072+
1073Start time to define the first execution of the change cleanups.
1074If the configured `'changeCleanup.interval'` is shorter than
1075`'changeCleanup.startTime - now'` the start time will be preponed by
1076the maximum integral multiple of `'changeCleanup.interval'` so that the
1077start time is still in the future.
1078+
1079----
1080<day of week> <hours>:<minutes>
1081or
1082<hours>:<minutes>
1083
1084<day of week> : Mon, Tue, Wed, Thu, Fri, Sat, Sun
1085<hours> : 00-23
1086<minutes> : 0-59
1087----
1088
1089
1090[[changeCleanup.interval]]changeCleanup.interval::
1091+
1092Interval for periodic repetition of triggering the change cleanups.
1093The interval must be larger than zero. The following suffixes are supported
1094to define the time unit for the interval:
1095+
1096* `s, sec, second, seconds`
1097* `m, min, minute, minutes`
1098* `h, hr, hour, hours`
1099* `d, day, days`
1100* `w, week, weeks` (`1 week` is treated as `7 days`)
1101* `mon, month, months` (`1 month` is treated as `30 days`)
1102* `y, year, years` (`1 year` is treated as `365 days`)
1103
1104link:#schedule-examples[Schedule examples] can be found in the
1105link:#gc[gc] section.
1106
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001107[[changeMerge]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001108=== Section changeMerge
carloseduardo.baldacin14246de2011-07-14 17:52:22 -03001109
Edwin Kempin42d27432013-11-24 17:06:24 +01001110[[changeMerge.checkFrequency]]changeMerge.checkFrequency::
Dave Borowitz204669c22012-10-11 11:06:08 -07001111+
1112How often the database should be rescanned for changes that have been
1113submitted but not merged due to transient errors. Values can be
1114specified using standard time unit abbreviations ('ms', 'sec', 'min',
1115etc.). Set to 0 to disable periodic rescanning, only scanning once on
1116master node startup.
1117+
1118Default is 300 seconds (5 minutes).
1119
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001120[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001121=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001122
Brad Larson991a31b2009-11-03 14:30:26 -06001123Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -05001124patch comments, in-line code comments and approval category value descriptions
1125to turn set strings into hyperlinks. One common use is for linking to
1126bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -06001127
1128In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001129will match typical Gerrit Change-Id values and create a hyperlink
1130to changes which reference it. The second configuration 'bugzilla'
1131will hyperlink terms such as 'bug 42' to an external bug tracker,
1132supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +09001133configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001134how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -06001135
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001136----
1137[commentlink "changeid"]
1138 match = (I[0-9a-f]{8,40})
David Pursehouse9f68e1a2016-01-28 09:21:03 +00001139 link = "#/q/$1"
Brad Larson991a31b2009-11-03 14:30:26 -06001140
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001141[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001142 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001143 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -06001144
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001145[commentlink "tracker"]
1146 match = ([Bb]ug:\\s+)(\\d+)
1147 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
1148----
1149
Dave Borowitz13b38002013-04-08 12:03:29 -07001150Comment links can also be specified in `project.config` and sections in
1151children override those in parents. The only restriction is that to
1152avoid injecting arbitrary user-supplied HTML in the page, comment links
1153defined in `project.config` may only supply `link`, not `html`.
1154
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001155[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -06001156+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001157A JavaScript regular expression to match positions to be replaced
1158with a hyperlink. Subexpressions of the matched string can be
1159stored using groups and accessed with `$'n'` syntax, where 'n'
1160is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -06001161+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001162The configuration file parser eats one level of backslashes, so the
1163character class `\s` requires `\\s` in the configuration file. The
1164parser also terminates the line at the first `#`, so a match
1165expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001166+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -08001167To match case insensitive strings, a character class with both the
1168upper and lower case character for each position must be used. For
1169example, to match the string `bug` in a case insensitive way the match
1170pattern `[bB][uU][gG]` needs to be used.
1171+
Matthew Webbercd7d2bf2015-10-14 15:54:06 +01001172The regular expression pattern is applied to the HTML form of the message
1173in question, which means it needs to assume the data has been escaped.
1174So `"` needs to be matched as `&amp;quot;`, `<` as `&amp;lt;`, and `'` as
1175`&amp;#39;`.
1176+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001177A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -06001178
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001179[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -06001180+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001181The URL to direct the user to whenever the regular expression is
1182matched. Groups in the match expression may be accessed as `$'n'`.
1183+
1184The link property is used only when the html property is not present.
1185
1186[[commentlink.name.html]]commentlink.<name>.html::
1187+
1188HTML to replace the entire matched string with. If present,
1189this property overrides the link property above. Groups in the
1190match expression may be accessed as `$'n'`.
1191+
1192The configuration file eats double quotes, so escaping them as
1193`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -06001194
Dave Borowitz82d79c02013-04-08 15:45:12 -07001195[[commentlink.name.enabled]]commentlink.<name>.enabled::
1196+
1197Whether the comment link is enabled. A child project may override a
1198section in a parent or the site-wide config that is disabled by
1199specifying `enabled = true`.
1200+
1201Disabling sections in `gerrit.config` can be used by site administrators
1202to create a library of comment links with `html` set that are not
1203user-supplied and thus can be verified to be XSS-free, but are only
1204enabled for a subset of projects.
1205+
David Pursehouse6f1af472013-12-11 19:23:33 +09001206By default, true.
1207+
Dave Borowitz82d79c02013-04-08 15:45:12 -07001208Note that the names and contents of disabled sections are visible even
1209to anonymous users via the
1210link:rest-api-projects.html#get-config[REST API].
1211
Brad Larson991a31b2009-11-03 14:30:26 -06001212
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001213[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001214=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001215
1216These settings are applied only if Gerrit is started as the container
1217process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
1218
1219[[container.heapLimit]]container.heapLimit::
1220+
1221Maximum heap size of the Java process running Gerrit, in bytes.
1222This property is translated into the '-Xmx' flag for the JVM.
1223+
1224Default is platform and JVM specific.
1225+
1226Common unit suffixes of 'k', 'm', or 'g' are supported.
1227
1228[[container.javaHome]]container.javaHome::
1229+
1230Path of the JRE/JDK installation to run Gerrit with. If not set, the
1231Gerrit startup script will attempt to search your system and guess
1232a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
1233
1234[[container.javaOptions]]container.javaOptions::
1235+
1236Additional options to pass along to the Java runtime. If multiple
1237values are configured, they are passed in order on the command line,
1238separated by spaces. These options are appended onto 'JAVA_OPTIONS'.
1239
David Ostrovskyc772bd82013-10-03 10:37:51 +02001240For example, it is possible to overwrite Gerrit's default log4j
1241configuration:
1242
1243----
1244 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
1245----
1246
Hugo Arès6710f0a2014-11-04 10:28:42 -05001247[[container.daemonOpt]]container.daemonOpt::
1248+
1249Additional options to pass to the daemon (e.g. '--enable-httpd'). If
1250multiple values are configured, they are passed in that order to the command
1251line, separated by spaces.
1252+
1253Execute `java -jar gerrit.war daemon --help` to see all possible
1254options.
1255
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001256[[container.slave]]container.slave::
1257+
1258Used on Gerrit slave installations. If set to true the Gerrit JVM is
1259called with the '--slave' switch, enabling slave mode. If no value is
Matt Baker8ce12fc2013-11-26 21:43:12 -07001260set (or any other value), Gerrit defaults to master mode.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001261
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001262[[container.user]]container.user::
1263+
1264Login name (or UID) of the operating system user the Gerrit JVM
1265will execute as. If not set, defaults to the user who launched
1266the 'gerrit.sh' wrapper script.
1267
1268[[container.war]]container.war::
1269+
1270Path of the JAR file to start daemon execution with. This should
1271be the path of the local 'gerrit.war' archive. Overrides the
1272environment variable 'GERRIT_WAR'.
1273+
1274If not set, defaults to '$site_path/bin/gerrit.war', or to
1275'$HOME/gerrit.war'.
1276
1277
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001278[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001279=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001280
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001281[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001282+
1283Number of bytes of a pack file to load into memory in a single
1284read operation. This is the "page size" of the JGit buffer cache,
1285used for all pack access operations. All disk IO occurs as single
1286window reads. Setting this too large may cause the process to load
1287more data than is required; setting this too small may increase
1288the frequency of `read()` system calls.
1289+
1290Default on JGit is 8 KiB on all platforms.
1291+
1292Common unit suffixes of 'k', 'm', or 'g' are supported.
1293
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001294[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001295+
1296Maximum number of bytes to load and cache in memory from pack files.
1297If JGit needs to access more than this many bytes it will unload less
1298frequently used windows to reclaim memory space within the process.
1299As this buffer must be shared with the rest of the JVM heap, it
1300should be a fraction of the total memory available.
1301+
1302Default on JGit is 10 MiB on all platforms.
1303+
1304Common unit suffixes of 'k', 'm', or 'g' are supported.
1305
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001306[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001307+
1308Maximum number of bytes to reserve for caching base objects
1309that multiple deltafied objects reference. By storing the entire
1310decompressed base object in a cache Git is able to avoid unpacking
1311and decompressing frequently used base objects multiple times.
1312+
1313Default on JGit is 10 MiB on all platforms. You probably do not
1314need to adjust this value.
1315+
1316Common unit suffixes of 'k', 'm', or 'g' are supported.
1317
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001318[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001319+
1320Maximum number of pack files to have open at once. A pack file
1321must be opened in order for any of its data to be available in
1322a cached window.
1323+
1324If you increase this to a larger setting you may need to also adjust
1325the ulimit on file descriptors for the host JVM, as Gerrit needs
1326additional file descriptors available for network sockets and other
1327repository data manipulation.
1328+
1329Default on JGit is 128 file descriptors on all platforms.
1330
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001331[[core.streamFileThreshold]]core.streamFileThreshold::
1332+
1333Largest object size, in bytes, that JGit will allocate as a
1334contiguous byte array. Any file revision larger than this threshold
1335will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001336files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001337during delta decompression.
1338+
1339Servers with very high traffic should set this to be larger than
1340the size of their common big files. For example a server managing
1341the Android platform typically has to deal with ~10-12 MiB XML
1342files, so `15 m` would be a reasonable setting in that environment.
1343Setting this too high may cause the JVM to run out of heap space
1344when handling very big binary files, such as device firmware or
1345CD-ROM ISO images.
1346+
Edwin Kempin7f5a4af2014-11-12 10:05:03 +01001347Defaults to 25% of the available JVM heap, limited to 2048m.
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001348+
1349Common unit suffixes of 'k', 'm', or 'g' are supported.
1350
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001351[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001352+
1353When true, JGit will use `mmap()` rather than `malloc()+read()`
1354to load data from pack files. The use of mmap can be problematic
1355on some JVMs as the garbage collector must deduce that a memory
1356mapped segment is no longer in use before a call to `munmap()`
1357can be made by the JVM native code.
1358+
1359In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001360pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001361of virtual address space, as the garbage collector cannot reclaim
1362unused mapped spaces fast enough.
1363+
1364Default on JGit is false. Although potentially slower, it yields
1365much more predictable behavior.
1366
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001367[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1368+
1369Size of the buffer to store logging events for asynchronous logging.
1370Putting a larger value can protect threads from stalling when the
1371AsyncAppender threads are not fast enough to consume the logging events
David Pursehouse1ff91c02015-05-19 15:05:26 +09001372from the buffer. It also protects from losing log entries in this case.
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001373+
1374Default is 64 entries.
1375
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001376[[core.useRecursiveMerge]]core.useRecursiveMerge::
1377+
Edwin Kempin71831d22014-07-15 08:54:29 +02001378Use JGit's recursive merger for three-way merges. This only affects
Sebastian Schuberth774aac92015-04-16 13:21:04 +02001379projects that allow content merges.
Edwin Kempin71831d22014-07-15 08:54:29 +02001380+
1381As explained in this
1382link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[
1383blog], the recursive merge produces better results if the two commits
1384that are merged have more than one common predecessor.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001385+
Edwin Kempin7853c5b2014-07-15 08:57:17 +02001386Default is true.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001387
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001388[[database]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001389=== Section database
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001390
1391The database section configures where Gerrit stores its metadata
1392records about user accounts and change reviews.
1393
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001394----
1395[database]
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001396 type = POSTGRESQL
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001397 hostname = localhost
1398 database = reviewdb
1399 username = gerrit2
1400 password = s3kr3t
1401----
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001402
1403[[database.type]]database.type::
1404+
1405Type of database server to connect to. If set this value will be
1406used to automatically create correct database.driver and database.url
1407values to open the connection.
1408+
David Pursehouse227e4032016-02-26 15:47:14 +09001409* `DB2`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001410+
David Pursehouse227e4032016-02-26 15:47:14 +09001411Connect to a DB2 database server.
1412+
1413* `DERBY`
1414+
1415Connect to an Apache Derby database server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001416+
1417* `H2`
1418+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001419Connect to a local embedded H2 database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001420+
David Pursehouse4f859e72016-02-26 15:44:38 +09001421* `JDBC`
1422+
1423Connect using a JDBC driver class name and URL.
1424+
David Pursehouse227e4032016-02-26 15:47:14 +09001425* `MAXDB`
1426+
1427Connect to an SAP MaxDb database server.
1428+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001429* `MYSQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001430+
1431Connect to a MySQL database server.
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001432+
David Pursehouse227e4032016-02-26 15:47:14 +09001433* `ORACLE`
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001434+
David Pursehouse227e4032016-02-26 15:47:14 +09001435Connect to an Oracle database server.
1436+
David Pursehouse4f859e72016-02-26 15:44:38 +09001437* `POSTGRESQL`
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001438+
David Pursehouse4f859e72016-02-26 15:44:38 +09001439Connect to a PostgreSQL database server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001440
1441+
1442If not specified, database.driver and database.url are used as-is,
1443and if they are also not specified, defaults to H2.
1444
1445[[database.hostname]]database.hostname::
1446+
1447Hostname of the database server. Defaults to 'localhost'.
1448
1449[[database.port]]database.port::
1450+
1451Port number of the database server. Defaults to the default port
1452of the server named by database.type.
1453
1454[[database.database]]database.database::
1455+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001456For POSTGRESQL or MYSQL, the name of the database on the server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001457+
1458For H2, this is the path to the database, and if not absolute is
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001459relative to `'$site_path'`.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001460
1461[[database.username]]database.username::
1462+
1463Username to connect to the database server as.
1464
1465[[database.password]]database.password::
1466+
1467Password to authenticate to the database server with.
1468
1469[[database.driver]]database.driver::
1470+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001471Name of the JDBC driver class to connect to the database with.
1472Setting this usually isn't necessary as it can be derived from
1473database.type or database.url for any supported database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001474
1475[[database.url]]database.url::
1476+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001477'jdbc:' URL for the database. Setting this variable usually
1478isn't necessary as it can be constructed from the all of the
1479above properties.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001480
Christian Aistleitner851072a2013-05-05 15:04:09 +02001481[[database.connectionPool]]database.connectionPool::
1482+
1483If true, use connection pooling for database connections. Otherwise, a
1484new database connection is opened for each request.
1485+
1486Default is false for MySQL, and true for other database backends.
1487
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001488[[database.poolLimit]]database.poolLimit::
1489+
1490Maximum number of open database connections. If the server needs
1491more than this number, request processing threads will wait up
1492to <<database.poolMaxWait, poolMaxWait>> seconds for a
1493connection to be released before they abort with an exception.
1494This limit must be several units higher than the total number of
1495httpd and sshd threads as some request processing code paths may
1496need multiple connections.
1497+
Dariusz Luksza2ebfc282015-11-09 20:25:25 +01001498Default is <<sshd.threads, sshd.threads>>
1499 + <<httpd.maxThreads, httpd.maxThreads>> + 2.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001500+
1501This setting only applies if
1502<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001503
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001504[[database.poolMinIdle]]database.poolMinIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001505+
1506Minimum number of connections to keep idle in the pool.
1507Default is 4.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001508+
1509This setting only applies if
1510<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001511
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001512[[database.poolMaxIdle]]database.poolMaxIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001513+
1514Maximum number of connections to keep idle in the pool. If there
1515are more idle connections, connections will be closed instead of
1516being returned back to the pool.
Dariusz Luksza30d70ae2015-11-09 22:19:59 +01001517Default is min(<<database.poolLimit, database.poolLimit>>, 16).
Christian Aistleitner851072a2013-05-05 15:04:09 +02001518+
1519This setting only applies if
1520<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001521
1522[[database.poolMaxWait]]database.poolMaxWait::
1523+
1524Maximum amount of time a request processing thread will wait to
1525acquire a database connection from the pool. If no connection is
1526released within this time period, the processing thread will abort
1527its current operations and return an error to the client.
1528Values should use common unit suffixes to express their setting:
1529+
1530* ms, milliseconds
1531* s, sec, second, seconds
1532* m, min, minute, minutes
1533* h, hr, hour, hours
1534
1535+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001536--
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001537If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001538
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001539Default is `30 seconds`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001540
Christian Aistleitner851072a2013-05-05 15:04:09 +02001541This setting only applies if
1542<<database.connectionPool,database.connectionPool>> is true.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001543--
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001544
David Ostrovsky38a6f6c2014-01-11 13:56:09 +01001545[[database.dataSourceInterceptorClass]]database.dataSourceInterceptorClass::
1546
1547Class that implements DataSourceInterceptor interface to monitor SQL activity.
1548This class must have default constructor and be available on Gerrit's bootstrap
1549classpath, e. g. in `$gerrit_site/lib` directory. Example implementation of
1550SQL monitoring can be found in javamelody-plugin.
1551
Björn Pedersen64af3ad2016-05-20 10:21:07 +02001552[[database.h2]]database.h2::
1553+
1554The settings in this section are used for the reviewdb if the
1555<<database.type,database.type>> is H2.
1556+
1557Additionally gerrit uses H2 for storing reviewed flags on changes.
1558
1559[[database.h2.cacheSize]]database.h2.cacheSize::
1560+
1561The size of the H2 internal database cache, in bytes. The H2 internal cache for
1562persistent H2-backed caches is controlled by
1563<<cache.h2CacheSize,cache.h2CacheSize>>.
1564+
1565H2 uses memory to cache its database content. The parameter `cacheSize`
1566allows to limit the memory used by H2 and thus prevent out-of-memory
1567caused by the H2 database using too much memory.
1568+
1569Technically the H2 cache size is configured using the CACHE_SIZE parameter in
1570the H2 JDBC connection URL, as described
1571link:http://www.h2database.com/html/features.html#cache_settings[here]
1572+
1573Default is unset, using up to half of the available memory.
1574
1575H2 will persist this value in the database, so to unset explicitly specify 0.
1576+
1577Common unit suffixes of 'k', 'm', or 'g' are supported.
1578
1579[[database.h2.autoServer]]database.h2.autoServer::
1580+
1581If `true` enable the automatic mixed mode
1582(see link:http://www.h2database.com/html/features.html#auto_mixed_mode[Automatic Mixed Mode]).
1583This enables concurrent access to the embedded H2 database from command line
1584utils (e.g. RebuildNoteDb).
1585+
1586Default is `false`.
1587
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001588[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001589=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03001590
1591----
1592[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001593 command = checkout
1594 command = cherry_pick
1595 command = pull
1596 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001597 scheme = ssh
1598 scheme = http
1599 scheme = anon_http
1600 scheme = anon_git
1601 scheme = repo_download
1602----
1603
1604The download section configures the allowed download methods.
1605
Edwin Kempin08b03a22012-09-14 16:32:57 +02001606[[download.command]]download.command::
1607+
1608Commands that should be offered to download changes.
1609+
1610Multiple commands are supported:
1611+
1612* `checkout`
1613+
1614Command to fetch and checkout the patch set.
1615+
1616* `cherry_pick`
1617+
1618Command to fetch the patch set and to cherry-pick it onto the current
1619commit.
1620+
1621* `pull`
1622+
1623Command to pull the patch set.
1624+
1625* `format_patch`
1626+
1627Command to fetch the patch set and to feed it into the `format-patch`
1628command.
1629
1630+
1631If `download.command` is not specified, all download commands are
1632offered.
1633
monica.dionisio3f630442010-06-29 15:42:57 -03001634[[download.scheme]]download.scheme::
1635+
1636Schemes that should be used to download changes.
1637+
1638Multiple schemes are supported:
1639+
1640* `http`
1641+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001642Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001643+
1644* `ssh`
1645+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001646Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001647+
1648* `anon_http`
1649+
1650Anonymous HTTP download is allowed.
1651+
1652* `anon_git`
1653+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001654Anonymous Git download is allowed. This is not default, it is also
1655necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1656variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001657+
1658* `repo_download`
1659+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001660Gerrit advertises patch set downloads with the `repo download`
1661command, assuming that all projects managed by this instance are
1662generally worked on with the repo multi-repository tool. This is
1663not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001664
1665+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001666If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001667downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001668
Edwin Kempin322db672015-07-03 08:50:46 +02001669[[download.checkForHiddenChangeRefs]]download.checkForHiddenChangeRefs::
1670+
1671Whether the download commands should be adapted when the change refs
1672are hidden.
1673+
1674Git has a configuration option to hide refs from the initial
1675advertisement (`uploadpack.hideRefs`). This option can be used to hide
1676the change refs from the client. As consequence fetching changes by
1677change ref does not work anymore. However by setting
1678`uploadpack.allowTipSha1InWant` to `true` fetching changes by commit ID
1679is possible. If `download.checkForHiddenChangeRefs` is set to `true`
1680the git download commands use the commit ID instead of the change ref
1681when a project is configured like this.
1682+
1683Example git configuration on a project:
1684+
1685----
1686[uploadpack]
1687 hideRefs = refs/changes/
1688 hideRefs = refs/cache-automerge/
1689 allowTipSha1InWant = true
1690----
1691+
1692By default `false`.
1693
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001694[[download.archive]]download.archive::
1695+
1696Specifies which archive formats, if any, should be offered on the change
Francois Ferrand1e933882014-09-25 11:19:08 +02001697screen and supported for `git-upload-archive` operation:
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001698+
1699----
1700[download]
1701 archive = tar
1702 archive = tbz2
1703 archive = tgz
1704 archive = txz
Francois Ferrand1e933882014-09-25 11:19:08 +02001705 archive = zip
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001706----
1707
Shawn Pearce6edde312014-03-26 22:00:26 -07001708If `download.archive` is not specified defaults to all archive
1709commands. Set to `off` or empty string to disable.
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001710
Francois Ferrand1e933882014-09-25 11:19:08 +02001711Zip is not supported because it may be interpreted by a Java plugin as a
1712valid JAR file, whose code would have access to cookies on the domain.
1713For this reason `zip` format is always excluded from formats offered
1714through the `Download` drop down or accessible in the REST API.
1715
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001716[[gc]]
1717=== Section gc
1718
1719This section allows to configure the git garbage collection and schedules it
1720to run periodically. It will be triggered and executed sequentially for all
1721projects.
1722
Christian Halstricke6c68322015-03-11 15:21:42 +01001723[[gc.aggressive]]gc.aggressive::
1724+
1725Determines if scheduled garbage collections and garbage collections triggered
1726through Web-UI should run in aggressive mode or not. Aggressive garbage
1727collections are more expensive but may lead to significantly smaller
1728repositories.
1729+
1730Valid values are "true" and "false," default is "false".
1731
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001732[[gc.startTime]]gc.startTime::
1733+
1734Start time to define the first execution of the git garbage collection.
1735If the configured `'gc.interval'` is shorter than `'gc.startTime - now'`
1736the start time will be preponed by the maximum integral multiple of
1737`'gc.interval'` so that the start time is still in the future.
1738+
1739----
1740<day of week> <hours>:<minutes>
1741or
1742<hours>:<minutes>
1743
1744<day of week> : Mon, Tue, Wed, Thu, Fri, Sat, Sun
1745<hours> : 00-23
1746<minutes> : 0-59
1747----
1748
1749
1750[[gc.interval]]gc.interval::
1751+
1752Interval for periodic repetition of triggering the git garbage collection.
1753The interval must be larger than zero. The following suffixes are supported
1754to define the time unit for the interval:
1755+
1756* `s, sec, second, seconds`
1757* `m, min, minute, minutes`
1758* `h, hr, hour, hours`
1759* `d, day, days`
1760* `w, week, weeks` (`1 week` is treated as `7 days`)
1761* `mon, month, months` (`1 month` is treated as `30 days`)
1762* `y, year, years` (`1 year` is treated as `365 days`)
1763
Edwin Kempine326a1d2015-06-03 10:27:39 +02001764[[schedule-examples]]
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001765Examples::
1766+
1767----
1768gc.startTime = Fri 10:30
1769gc.interval = 2 day
1770----
1771+
1772Assuming the server is started on Mon 7:00 -> `'startTime - now = 4 days 3:30 hours'`.
1773This is larger than the interval hence prepone the start time
1774by the maximum integral multiple of the interval so that start
1775time is still in the future, i.e. prepone by 4 days. This yields
1776a start time of Mon 10:30, next executions are Wed 10:30, Fri 10:30
1777etc.
1778+
1779----
1780gc.startTime = 6:00
1781gc.interval = 1 day
1782----
1783+
1784Assuming the server is started on Mon 7:00 this yields the first run on next Tuesday
1785at 6:00 and a repetition interval of 1 day.
1786
1787
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001788[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001789=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001790
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001791[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001792+
1793Local filesystem directory holding all Git repositories that
1794Gerrit knows about and can process changes for. A project
1795entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02001796the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001797+
1798If relative, the path is resolved relative to `'$site_path'`.
1799
Shawn O. Pearce897d9212011-06-16 16:59:59 -07001800[[gerrit.allProjects]]gerrit.allProjects::
1801+
1802Name of the permissions-only project defining global server
1803access controls and settings. These are inherited into every
1804other project managed by the running server. The name is
1805relative to `gerrit.basePath`.
1806+
1807Defaults to `All-Projects` if not set.
1808
Edwin Kempin2bf5edd2014-03-25 22:21:23 +01001809[[gerrit.allUsers]]gerrit.allUsers::
1810+
1811Name of the project in which meta data of all users is stored.
1812The name is relative to `gerrit.basePath`.
1813+
1814Defaults to `All-Users` if not set.
1815
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001816[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001817+
1818The default URL for Gerrit to be accessed through.
1819+
1820Typically this would be set to "http://review.example.com/" or
1821"http://example.com/gerrit/" so Gerrit can output links that point
1822back to itself.
1823+
1824Setting this is highly recommended, as its necessary for the upload
1825code invoked by "git push" or "repo upload" to output hyperlinks
1826to the newly uploaded changes.
1827
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001828[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001829+
1830Optional base URL for repositories available over the anonymous git
1831protocol. For example, set this to `git://mirror.example.com/base/`
1832to have Gerrit display patch set download URLs in the UI. Gerrit
1833automatically appends the project name onto the end of the URL.
1834+
1835By default unset, as the git daemon must be configured externally
1836by the system administrator, and might not even be running on the
1837same host as Gerrit.
1838
Dave Borowitza5d3fec2015-07-09 14:24:02 -07001839[[gerrit.docUrl]]gerrit.docUrl::
1840+
1841Optional base URL for documentation, under which one can find
1842"index.html", "rest-api.html", etc. Used as the base for the fixed set
1843of links in the "Documentation" tab. A slash is implicitly appended.
1844(For finer control over the top menu, consider writing a
1845link:dev-plugins.html#top-menu-extensions[plugin].)
1846+
1847If unset or empty, the documentation tab will only be shown if
1848`/Documentation/index.html` can be reached by the browser at app load
1849time.
1850
Dave Borowitza17a9842015-09-15 09:58:17 -04001851[[gerrit.editGpgKeys]]gerrit.editGpgKeys::
1852+
1853If enabled and server-side signed push validation is also
1854link:#receive.enableSignedPush[enabled], enable the
1855link:rest-api-accounts.html#list-gpg-keys[REST API endpoints] and web UI
1856for editing GPG keys. If disabled, GPG keys can only be added by
1857administrators with direct git access to All-Users.
1858+
1859Defaults to true.
1860
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001861[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
1862+
1863Optional command to install the `commit-msg` hook. Typically of the
1864form:
David Pursehouse05588e52015-01-07 14:25:11 +09001865+
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001866----
1867fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
1868----
1869+
1870By default unset; falls back to using scp from the canonical SSH host,
1871or curl from the canonical HTTP URL for the server. Only necessary if a
1872proxy or other server/network configuration prevents clients from
1873fetching from the default location.
1874
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07001875[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
1876+
1877Optional base URL for repositories available over the HTTP
1878protocol. For example, set this to `http://mirror.example.com/base/`
1879to have Gerrit display URLs from this server, rather than itself.
1880+
1881By default unset, as the HTTP daemon must be configured externally
1882by the system administrator, and might not even be running on the
1883same host as Gerrit.
1884
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07001885[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
1886+
David Pursehouse214ab862014-12-01 11:48:26 +09001887URL to direct users to when they need to report a bug.
1888+
1889By default unset, meaning no bug report URL will be displayed. Administrators
1890should set this to the URL of their issue tracker, if necessary.
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07001891
David Pursehouse753ca332013-12-10 15:36:29 +09001892[[gerrit.reportBugText]]gerrit.reportBugText::
1893+
1894Text to be displayed in the link to the bug report URL.
1895+
David Pursehouse214ab862014-12-01 11:48:26 +09001896Only used when `gerrit.reportBugUrl` is set.
1897+
David Pursehouse753ca332013-12-10 15:36:29 +09001898Defaults to "Report Bug".
1899
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02001900[[gerrit.disableReverseDnsLookup]]gerrit.disableReverseDnsLookup::
1901+
1902Disables reverse DNS lookup during computing ref log entry for identified user.
1903+
1904Defaults to false.
1905
David Pursehouse962e1182014-12-03 17:17:52 +09001906[[gerrit.secureStoreClass]]gerrit.secureStoreClass::
1907+
1908Use the secure store implementation from a specified class.
1909+
1910If specified, must be the fully qualified class name of a class that implements
1911the `com.google.gerrit.server.securestore.SecureStore` interface, and the jar
1912file containing the class must be placed in the `$site_path/lib` folder.
1913+
1914If not specified, the default no-op implementation is used.
1915
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001916[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001917=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001918
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001919Gerrit can forward requests to either an internally managed gitweb
1920(which allows Gerrit to enforce some access controls), or to an
1921externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001922See also link:config-gitweb.html[Gitweb Integration].
1923
Shawn O. Pearce618dae22010-03-12 19:07:43 -08001924[[gitweb.cgi]]gitweb.cgi::
1925+
1926Path to the locally installed `gitweb.cgi` executable. This CGI will
1927be called by Gerrit Code Review when the URL `/gitweb` is accessed.
1928Project level access controls are enforced prior to calling the CGI.
1929+
1930Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if gitweb.url is not set.
1931
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001932[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001933+
1934Optional URL of an affiliated gitweb service. Defines the
1935web location where a `gitweb.cgi` is installed to browse
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001936gerrit.basePath and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07001937+
1938Gerrit appends any necessary query arguments onto the end of this URL.
1939For example, "?p=$project.git;h=$commit".
1940
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001941[[gitweb.type]]gitweb.type::
1942+
1943Optional type of affiliated gitweb service. This allows using
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001944alternatives to gitweb, such as cgit. If set to disabled there
1945is no gitweb hyperlinking support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001946+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07001947Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001948
Edwin Kempind86909c2012-03-26 10:36:29 +02001949[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001950+
1951Optional pattern to use for constructing the gitweb URL when pointing
1952at a specific commit when `custom` is used above.
1953+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001954Valid replacements are `${project}` for the project name in Gerrit
1955and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001956
Edwin Kempind86909c2012-03-26 10:36:29 +02001957[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001958+
1959Optional pattern to use for constructing the gitweb URL when pointing
1960at a specific project when `custom` is used above.
1961+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001962Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001963
Edwin Kempind86909c2012-03-26 10:36:29 +02001964[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001965+
1966Optional pattern to use for constructing the gitweb URL when pointing
1967at a specific branch when `custom` is used above.
1968+
Edwin Kempincdb0e002011-09-08 14:23:30 +02001969Valid replacements are `${project}` for the project name in Gerrit
1970and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00001971
Colby Ranger79d4ebe2013-12-16 14:19:18 -08001972[[gitweb.roottree]]gitweb.roottree::
1973+
1974Optional pattern to use for constructing the gitweb URL when pointing
1975at the contents of the root tree in a specific commit when `custom` is
1976used above.
1977+
1978Valid replacements are `${project}` for the project name in Gerrit
1979and `${commit}` for the SHA1 hash for the commit.
1980
1981[[gitweb.file]]gitweb.file::
1982+
1983Optional pattern to use for constructing the gitweb URL when pointing
1984at the contents of a file in a specific commit when `custom` is used
1985above.
1986+
1987Valid replacements are `${project}` for the project name in Gerrit,
1988`${file}` for the file name and `${commit}` for the SHA1 hash for
1989the commit.
1990
Edwin Kempin64011562012-03-26 10:50:12 +02001991[[gitweb.filehistory]]gitweb.filehistory::
1992+
1993Optional pattern to use for constructing the gitweb URL when pointing
1994at the history of a file in a specific branch when `custom` is used
1995above.
1996+
1997Valid replacements are `${project}` for the project name in Gerrit,
1998`${file}` for the file name and `${branch}` for the name of the
1999branch.
2000
Gustaf Lundha07d2e72011-10-27 15:26:35 -07002001[[gitweb.linkname]]gitweb.linkname::
2002+
2003Optional setting for modifying the link name presented to the user
2004in the Gerrit web-UI.
2005+
2006Default linkname for custom type is "gitweb".
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002007
Adrian Goerlerf2007072011-11-10 08:39:55 +01002008[[gitweb.pathSeparator]]gitweb.pathSeparator::
2009+
2010Optional character to substitute the standard path separator (slash) in
2011project names and branch names.
2012+
2013By default, Gerrit will use hexadecimal encoding for slashes in project and
2014branch names. Some web servers, such as Tomcat, reject this hexadecimal
2015encoding in the URL.
2016+
2017Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
2018allow using an alternative path separator character. In Gitblit, this can be
2019configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
2020In Gerrit, the alternative path separator can be configured correspondingly
2021using the property 'gitweb.pathSeparator'.
2022+
2023Valid values are the characters '*', '(' and ')'.
2024
David Pursehouse5d592e82016-06-09 05:12:26 +00002025[[gitweb.urlEncode]]gitweb.urlEncode::
Luca Milanesio25312032013-10-11 11:34:39 +01002026+
2027Whether or not Gerrit should encode the generated viewer URL.
2028+
2029Gerrit composes the viewer URL using information about the project, branch, file
2030or commit of the target object to be displayed. Typically viewers such as CGit
Dave Borowitza3d67882015-06-05 15:22:23 -07002031and gitweb do need those parts to be encoded, including the '/' in project's name,
Luca Milanesio25312032013-10-11 11:34:39 +01002032for being correctly parsed.
2033However other viewers could instead require an unencoded URL (e.g. GitHub web
2034based viewer)
2035+
2036Valid values are "true" and "false," default is "true."
2037
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002038[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002039=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01002040
2041[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
2042+
2043Controls whether newly created groups should be by default visible to
2044all registered users.
2045+
2046By default, false.
2047
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002048[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002049=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002050
2051[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002052+
2053URL of the proxy server when making outgoing HTTP
2054connections for OpenID login transactions. Syntax
2055should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002056
2057[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002058+
2059Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002060This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002061appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002062
2063[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002064+
2065Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002066This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002067appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002068
Hugo Arès88e33ac2014-03-03 13:52:45 -05002069[[http.addUserAsRequestAttribute]]http.addUserAsRequestAttribute::
2070+
2071If true, 'User' attribute will be added to the request attributes so it
2072can be accessed outside the request scope (will be set to username or id
2073if username not configured).
2074+
2075This attribute can be used by the servlet container to log user in the
2076http access log.
2077+
2078When running the embedded servlet container, this attribute is used to
2079print user in the httpd_log.
2080+
2081* `%{User}r`
2082+
2083Pattern to print user in Tomcat AccessLog.
2084
2085+
2086Default value is true.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002087
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002088[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002089=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002090
2091The httpd section configures the embedded servlet container.
2092
2093[[httpd.listenUrl]]httpd.listenUrl::
2094+
2095Specifies the URLs the internal HTTP daemon should listen for
Edwin Kempincdb0e002011-09-08 14:23:30 +02002096connections on. The special hostname '*' may be used to listen
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002097on all local addresses. A context path may optionally be included,
2098placing Gerrit Code Review's web address within a subdirectory of
2099the server.
2100+
2101Multiple protocol schemes are supported:
2102+
2103* `http://`'hostname'`:`'port'
2104+
2105Plain-text HTTP protocol. If port is not supplied, defaults to 80,
2106the standard HTTP port.
2107+
2108* `https://`'hostname'`:`'port'
2109+
2110SSL encrypted HTTP protocol. If port is not supplied, defaults to
2111443, the standard HTTPS port.
2112+
2113Externally facing production sites are encouraged to use a reverse
2114proxy configuration and `proxy-https://` (below), rather than using
2115the embedded servlet container to implement the SSL processing.
2116The proxy server with SSL support is probably easier to configure,
2117provides more configuration options to control cipher usage, and
2118is likely using natively compiled encryption algorithms, resulting
2119in higher throughput.
2120+
2121* `proxy-http://`'hostname'`:`'port'
2122+
2123Plain-text HTTP relayed from a reverse proxy. If port is not
2124supplied, defaults to 8080.
2125+
2126Like http, but additional header parsing features are
2127enabled to honor X-Forwarded-For, X-Forwarded-Host and
2128X-Forwarded-Server. These headers are typically set by Apache's
2129link:http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers[mod_proxy].
2130+
2131* `proxy-https://`'hostname'`:`'port'
2132+
2133Plain text HTTP relayed from a reverse proxy that has already
2134handled the SSL encryption/decryption. If port is not supplied,
2135defaults to 8080.
2136+
2137Behaves exactly like proxy-http, but also sets the scheme to assume
2138'https://' is the proper URL back to the server.
2139
2140+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002141--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002142If multiple values are supplied, the daemon will listen on all
2143of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002144
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002145By default, http://*:8080.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002146--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002147
2148[[httpd.reuseAddress]]httpd.reuseAddress::
2149+
2150If true, permits the daemon to bind to the port even if the port
2151is already in use. If false, the daemon ensures the port is not
2152in use before starting. Busy sites may need to set this to true
2153to permit fast restarts.
2154+
2155By default, true.
2156
2157[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
2158+
2159Size, in bytes, of the buffer used to parse the HTTP headers of an
2160incoming HTTP request. The entire request headers, including any
2161cookies sent by the browser, must fit within this buffer, otherwise
2162the server aborts with the response '413 Request Entity Too Large'.
2163+
2164One buffer of this size is allocated per active connection.
2165Allocating a buffer that is too large wastes memory that cannot be
2166reclaimed, allocating a buffer that is too small may cause unexpected
2167errors caused by very long Referer URLs or large cookie values.
2168+
2169By default, 16384 (16 K), which is sufficient for most OpenID and
2170other web-based single-sign-on integrations.
2171
Chulho Yangb72ff8f2013-07-04 02:35:53 -04002172[[httpd.sslCrl]]httpd.sslCrl::
2173+
2174Path of the certificate revocation list file in PEM format. This
2175crl file is optional, and available for CLIENT_SSL_CERT_LDAP
2176authentication.
2177+
2178To create and view a crl using openssl:
2179+
2180----
2181openssl ca -gencrl -out crl.pem
2182openssl crl -in crl.pem -text
2183----
2184+
2185If not absolute, the path is resolved relative to `$site_path`.
2186+
2187By default, `$site_path/etc/crl.pem`.
2188
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002189[[httpd.sslKeyStore]]httpd.sslKeyStore::
2190+
2191Path of the Java keystore containing the server's SSL certificate
2192and private key. This keystore is required for `https://` in URL.
2193+
2194To create a self-signed certificate for simple internal usage:
2195+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002196----
2197keytool -keystore keystore -alias jetty -genkey -keyalg RSA
2198chmod 600 keystore
2199----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002200+
2201If not absolute, the path is resolved relative to `$site_path`.
2202+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002203By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002204
2205[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
2206+
2207Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09002208Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002209doesn't want to enable one.
2210+
2211If set to the empty string the embedded server will prompt for the
2212password during startup.
2213+
2214By default, `gerrit`.
2215
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002216[[httpd.requestLog]]httpd.requestLog::
2217+
2218Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
2219If enabled, an NCSA combined log format request log file is written
2220out by the internal HTTP daemon.
2221+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01002222`log4j.appender` with the name `httpd_log` can be configured to overwrite
2223programmatic configuration.
2224+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002225By default, true if httpd.listenUrl uses http:// or https://,
2226and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
2227
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002228[[httpd.acceptorThreads]]httpd.acceptorThreads::
2229+
2230Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09002231connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002232+
2233By default, 2, which should be suitable for most high-traffic sites.
2234
2235[[httpd.minThreads]]httpd.minThreads::
2236+
2237Minimum number of spare threads to keep in the worker thread pool.
2238This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09002239multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002240+
2241By default, 5, suitable for most lower-volume traffic sites.
2242
2243[[httpd.maxThreads]]httpd.maxThreads::
2244+
2245Maximum number of threads to permit in the worker thread pool.
2246+
2247By default 25, suitable for most lower-volume traffic sites.
2248
2249[[httpd.maxQueued]]httpd.maxQueued::
2250+
2251Maximum number of client connections which can enter the worker
2252thread pool waiting for a worker thread to become available.
David Ostrovsky14fe8bc2014-03-26 06:03:44 -070022530 sets the queue size to the Integer.MAX_VALUE.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002254+
Luca Milanesio0ae62fe2015-09-04 07:56:00 -07002255By default 200.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002256
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002257[[httpd.maxWait]]httpd.maxWait::
2258+
David Pursehouse221d4f62012-06-08 17:38:08 +09002259Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002260thread to handle a project clone, fetch or push request over the
2261smart HTTP transport.
2262+
2263Values should use common unit suffixes to express their setting:
2264+
2265* s, sec, second, seconds
2266* m, min, minute, minutes
2267* h, hr, hour, hours
2268* d, day, days
2269* w, week, weeks (`1 week` is treated as `7 days`)
2270* mon, month, months (`1 month` is treated as `30 days`)
2271* y, year, years (`1 year` is treated as `365 days`)
2272
2273+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002274--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002275If a unit suffix is not specified, `minutes` is assumed. If 0
2276is supplied, the maximum age is infinite and connections will not
2277abort until the client disconnects.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002278
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002279By default, 5 minutes.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002280--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002281
Luca Milanesioce7b7452013-06-18 11:40:49 +01002282[[httpd.filterClass]]httpd.filterClass::
2283+
2284Class that implements the javax.servlet.Filter interface
2285for filtering any HTTP related traffic going through the Gerrit
2286HTTP protocol.
2287Class is loaded and configured in the Gerrit Jetty container
2288and run in front of all Gerrit URL handlers, allowing the filter
2289to inspect, modify, allow or reject each request.
2290It needs to be provided as JAR library
2291under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
2292loader and cannot be dynamically loaded by a plugin.
2293+
2294Failing to load the Filter class would result in a Gerrit start-up
2295failure, as this class is supposed to provide mandatory filtering
2296in front of Gerrit HTTP protocol.
2297+
David Pursehouse42f42042013-08-01 14:02:25 +09002298Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01002299of an Apache HTTP proxy layer as security enforcement on top of Gerrit
2300by returning a trusted username as HTTP Header.
2301+
2302Example of using a security library secure.jar under $GERRIT_SITE/lib
2303that provides a org.anyorg.MySecureFilter Servlet Filter that enforces
2304a trusted username in the `TRUSTED_USER` HTTP Header:
2305
2306----
2307[auth]
2308type = HTTP
2309httpHeader = TRUSTED_USER
2310
Dariusz Lukszaaac01132015-02-11 12:13:07 +01002311[httpd]
Luca Milanesioce7b7452013-06-18 11:40:49 +01002312filterClass = org.anyorg.MySecureFilter
2313----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002314
Juan Hernandezec512562013-08-06 16:30:50 +02002315[[httpd.robotsFile]]httpd.robotsFile::
2316+
2317Location of an external robots.txt file to be used instead of the one
2318bundled with the .war of the application.
2319+
2320If not absolute, the path is resolved relative to `$site_path`.
2321+
2322If the file doesn't exist or can't be read the default robots.txt file
2323bundled with the .war will be used instead.
2324
Dariusz Luksza011cfed2014-04-03 10:23:35 +02002325[[httpd.registerMBeans]]httpd.registerMBeans::
2326+
2327Enable (or disable) registration of Jetty MBeans for Java JMX.
2328+
2329By default, false.
2330
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002331[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002332=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09002333
2334The index section configures the secondary index.
2335
David Pursehouse3fc5ee32014-03-17 18:35:32 +09002336Note that after enabling the secondary index, the index must be built
2337using the link:pgm-reindex.html[reindex program] before restarting the
2338Gerrit server.
2339
David Pursehouse6d458432013-08-23 16:17:18 +09002340[[index.type]]index.type::
2341+
2342Type of secondary indexing employed by Gerrit. The supported
2343values are:
2344+
2345* `LUCENE`
2346+
2347A link:http://lucene.apache.org/[Lucene] index is used.
2348+
David Pursehouse6d458432013-08-23 16:17:18 +09002349
2350+
Shawn Pearced4ae3a162013-11-24 17:00:31 -08002351By default, `LUCENE`.
David Pursehouse6d458432013-08-23 16:17:18 +09002352
David Pursehouse904db302014-03-17 18:55:38 +09002353[[index.threads]]index.threads::
2354+
Hugo Arèsfab06702016-06-10 12:49:52 -04002355Number of threads to use for indexing in normal interactive operations. Setting
2356it to 0 disables the dedicated thread pool and indexing will be done in the same
2357thread as the operation.
David Pursehouse904db302014-03-17 18:55:38 +09002358+
Hugo Arès176cd582016-05-06 14:37:09 -04002359If not set or set to a negative value, defaults to 1 plus half of the number of
2360logical CPUs as returned by the JVM.
David Pursehouse00c82142014-01-22 17:41:09 +09002361
Dave Borowitz787af5f2014-10-22 16:26:00 -07002362[[index.batchThreads]]index.batchThreads::
2363+
2364Number of threads to use for indexing in background operations, such as
2365online schema upgrades.
2366+
Sebastian Schubertha13dc292015-05-21 15:31:28 +02002367If not set or set to a negative value, defaults to the number of logical
Hugo Arès1cf252c2016-05-06 08:38:22 -04002368CPUs as returned by the JVM.
Dave Borowitz787af5f2014-10-22 16:26:00 -07002369
Dave Borowitzd80b9342015-03-25 10:32:21 -07002370[[index.onlineUpgrade]]index.onlineUpgrade::
2371+
2372Whether to upgrade to new index schema versions while the server is
2373running. This is recommended as it prevents additional downtime during
2374Gerrit version upgrades (avoiding the need for an offline reindex step
2375using Reindex), but can add additional server load during the upgrade.
2376+
2377If set to false, there is no way to upgrade the index schema to take
2378advantage of new search features without restarting the server.
2379+
2380Defaults to true.
2381
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07002382[[index.maxLimit]]index.maxLimit::
2383+
2384Maximum limit to allow for search queries. Requesting results above this
2385limit will truncate the list (but will still set `_more_changes` on
2386result lists). Set to 0 for no limit.
2387+
2388Defaults to no limit.
2389
Dave Borowitzf56d3652015-04-22 17:35:34 -07002390[[index.maxPages]]index.maxPages::
2391+
2392Maximum number of pages of search results to allow, as index
2393implementations may have to scan through large numbers of skipped
2394results when searching with an offset. Requesting results starting past
2395this threshold times the requested limit will result in an error. Set to
23960 for no limit.
2397+
2398Defaults to no limit.
2399
Dave Borowitzd034ca82015-10-15 11:20:30 -04002400[[index.maxTerms]]index.maxTerms::
2401+
2402Maximum number of leaf terms to allow in a query. Too-large queries may
2403perform poorly, so setting this option causes query parsing to fail fast
Marco Miller6da22822016-01-29 12:31:38 -05002404before attempting to send them to the secondary index. Should this limit
2405be reached, database is used instead of index as applicable.
Dave Borowitzd034ca82015-10-15 11:20:30 -04002406+
Marco Miller6da22822016-01-29 12:31:38 -05002407When the index type is `LUCENE`, also sets the maximum number of clauses
2408permitted per BooleanQuery. This is so that all enforced query limits
2409are the same.
2410+
2411Defaults to 1024.
Dave Borowitzd034ca82015-10-15 11:20:30 -04002412
David Pursehouse902b3ee2014-07-09 16:17:49 +09002413==== Lucene configuration
2414
2415Open and closed changes are indexed in separate indexes named
2416'open' and 'closed' respectively.
2417
2418The following settings are only used when the index type is `LUCENE`.
David Pursehouseac88c362014-02-06 12:01:34 +09002419
David Pursehouse00c82142014-01-22 17:41:09 +09002420[[index.name.ramBufferSize]]index.name.ramBufferSize::
2421+
David Pursehouse00c82142014-01-22 17:41:09 +09002422Determines the amount of RAM that may be used for buffering added documents
2423and deletions before they are flushed to the index. See the
2424link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
2425Lucene documentation] for further details.
2426+
2427Defaults to 16M.
2428
2429[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
2430+
David Pursehouse00c82142014-01-22 17:41:09 +09002431Determines the minimal number of documents required before the buffered
2432in-memory documents are flushed to the index. Large values generally
2433give faster indexing. See the
2434link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
2435Lucene documentation] for further details.
2436+
2437Defaults to -1, meaning no maximum is set and the writer will flush
2438according to RAM usage.
2439
Dave Borowitzd08b0452014-02-13 11:56:03 -08002440[[index.name.commitWithin]]index.name.commitWithin::
2441+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002442Determines the period at which changes are automatically committed to
2443stable store on disk. This is a costly operation and may block
2444additional index writes, so lower with caution.
2445+
Bruce Zuaf058e62014-03-21 10:03:05 +08002446If zero, changes are committed after every write. This is very costly
2447but may be useful if offline reindexing is infeasible, or for development
2448servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08002449+
Bruce Zuaf058e62014-03-21 10:03:05 +08002450Values can be specified using standard time unit abbreviations (`ms`, `sec`,
2451`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07002452+
Bruce Zuaf058e62014-03-21 10:03:05 +08002453If negative, `commitWithin` is disabled. Changes are flushed to disk when
2454the in-memory buffer fills, but only committed and guaranteed to be synced
2455to disk when the process finishes.
David Pursehouse902b3ee2014-07-09 16:17:49 +09002456+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002457Defaults to 300000 ms (5 minutes).
2458
David Pursehouse902b3ee2014-07-09 16:17:49 +09002459Sample Lucene index configuration:
David Pursehouse00c82142014-01-22 17:41:09 +09002460----
2461[index]
2462 type = LUCENE
2463
2464[index "changes_open"]
2465 ramBufferSize = 60 m
2466 maxBufferedDocs = 3000
2467
2468[index "changes_closed"]
2469 ramBufferSize = 20 m
2470 maxBufferedDocs = 500
2471----
2472
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002473[[ldap]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002474=== Section ldap
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002475
David Pursehouse221d4f62012-06-08 17:38:08 +09002476LDAP integration is only enabled if `auth.type` is set to
Sasa Zivkoveabc8972010-10-04 15:47:08 +02002477`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
David Pursehouse42f42042013-08-01 14:02:25 +09002478detailed description of the `auth.type` settings and their
Sasa Zivkoveabc8972010-10-04 15:47:08 +02002479implications.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002480
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002481An example LDAP configuration follows, and then discussion of
2482the parameters introduced here. Suitable defaults for most
2483parameters are automatically guessed based on the type of server
2484detected during startup. The guessed defaults support both
2485link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307] and Active
2486Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002487
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002488----
2489[ldap]
2490 server = ldap://ldap.example.com
2491
2492 accountBase = ou=people,dc=example,dc=com
2493 accountPattern = (&(objectClass=person)(uid=${username}))
2494 accountFullName = displayName
2495 accountEmailAddress = mail
2496
2497 groupBase = ou=groups,dc=example,dc=com
2498 groupMemberPattern = (&(objectClass=group)(member=${dn}))
2499----
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002500
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002501[[ldap.server]]ldap.server::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002502+
2503URL of the organization's LDAP server to query for user information
2504and group membership from. Must be of the form `ldap://host` or
2505`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002506+
David Pursehouse42f42042013-08-01 14:02:25 +09002507If `auth.type` is `LDAP` this setting should use `ldaps://` to
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002508ensure the end user's plaintext password is transmitted only over
2509an encrypted connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002510
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002511[[ldap.sslVerify]]ldap.sslVerify::
2512+
2513If false and ldap.server is an `ldaps://` style URL, Gerrit
2514will not verify the server certificate when it connects to
2515perform a query.
2516+
2517By default, true, requiring the certificate to be verified.
2518
Olga Grinbergcf1b06a2015-02-03 15:54:48 -05002519[[ldap.groupsVisibleToAll]]ldap.groupsVisibleToAll::
2520+
2521If true, LDAP groups are visible to all registered users.
2522+
2523By default, false, LDAP groups are visible only to administrators and
2524group members.
2525
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002526[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002527+
2528_(Optional)_ Username to bind to the LDAP server with. If not set,
2529an anonymous connection to the LDAP server is attempted.
2530
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002531[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002532+
2533_(Optional)_ Password for the user identified by `ldap.username`.
2534If not set, an anonymous (or passwordless) connection to the LDAP
2535server is attempted.
2536
Ben Wu0410a152010-06-04 16:17:24 +08002537[[ldap.referral]]ldap.referral::
2538+
2539_(Optional)_ How an LDAP referral should be handled if it is
2540encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05002541automatically follow any referrals, or `ignore` to ignore the
2542referrals.
Ben Wu0410a152010-06-04 16:17:24 +08002543+
2544By default, `ignore`.
2545
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01002546[[ldap.readTimeout]]ldap.readTimeout::
2547+
2548_(Optional)_ The read timeout for an LDAP operation. The value is
2549in the usual time-unit format like "1 s", "100 ms", etc...
2550A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09002551threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01002552+
2553By default there is no timeout and Gerrit will wait for the LDAP
2554server to respond until the TCP connection times out.
2555
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002556[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002557+
2558Root of the tree containing all user accounts. This is typically
2559of the form `ou=people,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00002560+
2561This setting may be added multiple times to specify more than
2562one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002563
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002564[[ldap.accountScope]]ldap.accountScope::
2565+
2566Scope of the search performed for accounts. Must be one of:
2567+
2568* `one`: Search only one level below accountBase, but not recursive
2569* `sub` or `subtree`: Search recursively below accountBase
2570* `base` or `object`: Search exactly accountBase; probably not desired
2571
2572+
2573Default is `subtree` as many directories have several levels.
2574
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002575[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002576+
2577Query pattern to use when searching for a user account. This may be
2578any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09002579`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002580`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09002581that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02002582the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002583the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002584+
2585This pattern is used to search the objects contained directly under
2586the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02002587is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002588setting depends on the LDAP schema used by the directory server.
2589+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002590Default is `(uid=${username})` for RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002591and `(&(objectClass=user)(sAMAccountName=${username}))`
2592for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002593
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07002594[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002595+
2596_(Optional)_ Name of an attribute on the user account object which
2597contains the initial value for the user's full name field in Gerrit.
2598Typically this is the `displayName` property in LDAP, but could
2599also be `legalName` or `cn`.
2600+
David Pursehouse221d4f62012-06-08 17:38:08 +09002601Attribute values may be concatenated with literal strings. For
2602example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02002603`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002604+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002605If set, users will be unable to modify their full name field, as
2606Gerrit will populate it only from the LDAP data.
2607+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002608Default is `displayName` for RFC 2307 servers,
2609and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002610
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002611[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002612+
2613_(Optional)_ Name of an attribute on the user account object which
2614contains the user's Internet email address, as defined by this
2615LDAP server.
2616+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002617Attribute values may be concatenated with literal strings,
2618for example to set the email address to the lowercase form
2619of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02002620`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002621+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002622If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09002623but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002624and select a different preferred email address.
2625+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002626Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002627
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002628[[ldap.accountSshUserName]]ldap.accountSshUserName::
2629+
2630_(Optional)_ Name of an attribute on the user account object which
2631contains the initial value for the user's SSH username field in
2632Gerrit. Typically this is the `uid` property in LDAP, but could
2633also be `cn`. Administrators should prefer to match the attribute
2634corresponding to the user's workstation username, as this is what
2635SSH clients will default to.
2636+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002637Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02002638an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002639force the value of sAMAccountName, if defined, to be all lowercase.
2640The suffix `.toUpperCase` can be used for the other direction.
2641The suffix `.localPart` can be used to split attribute values of
2642the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02002643example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002644+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002645If set, users will be unable to modify their SSH username field, as
2646Gerrit will populate it only from the LDAP data.
2647+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002648Default is `uid` for RFC 2307 servers,
2649and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002650
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002651[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04002652+
2653_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002654contains the groups the user is part of. Typically used for Active
2655Directory servers.
Anthony93de7db2009-10-03 10:01:50 -04002656+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002657Default is unset for RFC 2307 servers (disabled)
2658and `memberOf` for Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04002659
Saša Živkovc81291f2015-02-04 17:19:20 +01002660[[ldap.fetchMemberOfEagerly]]ldap.fetchMemberOfEagerly::
2661+
2662_(Optional)_ Whether to fetch the `memberOf` account attribute on
2663login. Setups which use LDAP for user authentication but don't make
2664use of the LDAP groups may benefit from setting this option to `false`
2665as this will result in a much faster LDAP login.
2666+
2667Default is unset for RFC 2307 servers (disabled) and `true` for
2668Active Directory.
2669
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002670[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002671+
2672Root of the tree containing all group objects. This is typically
2673of the form `ou=groups,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00002674+
2675This setting may be added multiple times to specify more than
2676one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002677
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002678[[ldap.groupScope]]ldap.groupScope::
2679+
2680Scope of the search performed for group objects. Must be one of:
2681+
2682* `one`: Search only one level below groupBase, but not recursive
2683* `sub` or `subtree`: Search recursively below groupBase
2684* `base` or `object`: Search exactly groupBase; probably not desired
2685
2686+
2687Default is `subtree` as many directories have several levels.
2688
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002689[[ldap.groupPattern]]ldap.groupPattern::
2690+
2691Query pattern used when searching for an LDAP group to connect
2692to a Gerrit group. This may be any valid LDAP query expression,
2693including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002694`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002695group owner.
2696+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002697Default is `(cn=${groupname})` for RFC 2307,
2698and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002699
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002700[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002701+
2702Query pattern to use when searching for the groups that a user
2703account is currently a member of. This may be any valid LDAP query
2704expression, including the standard `(&...)` and `(|...)` operators.
2705+
David Pursehouse42f42042013-08-01 14:02:25 +09002706If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002707replaced with a parameter set to the username that was supplied
2708by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02002709such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002710corresponding attribute (in this case, `fooBarAttribute`) as read
2711from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002712Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002713+
Scott Dial50457502013-08-11 16:52:51 -04002714Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
2715RFC 2307, and unset (disabled) for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002716
Auke Schrijnen57809132012-09-26 21:05:39 +02002717[[ldap.groupName]]ldap.groupName::
2718+
David Pursehouse39489ae2012-10-12 13:50:04 +09002719_(Optional)_ Name of the attribute on the group object which contains
2720the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02002721+
David Pursehouse39489ae2012-10-12 13:50:04 +09002722Typically the attribute name is `cn` for RFC 2307 and Active Directory
2723servers. For other servers the attribute name may differ, for example
2724`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02002725+
David Pursehouse39489ae2012-10-12 13:50:04 +09002726It is also possible to specify a literal string containing a pattern of
2727attribute values. For example to create a Gerrit group name consisting of
2728LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
2729+
2730Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02002731
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002732[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
2733+
2734Converts the local username, that is used to login into the Gerrit
David Pursehousea1d633b2014-05-02 17:21:02 +09002735Web UI, to lower case before doing the LDAP authentication. By setting
2736this parameter to true, a case insensitive login to the Gerrit Web UI
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002737can be achieved.
2738+
2739If set, it must be ensured that the local usernames for all existing
2740accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09002741local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002742anymore. The local usernames for the existing accounts can be
2743converted to lower case by running the server program
2744link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
2745Please be aware that the conversion of the local usernames to lower
2746case can't be undone. For newly created accounts the local username
2747will be directly stored in lower case.
2748+
2749By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002750
Robin Rosenberga3baed02012-10-14 14:09:32 +02002751[[ldap.authentication]]ldap.authentication::
2752+
2753Defines how Gerrit authenticates with the server. When set to `GSSAPI`
2754Gerrit will use Kerberos. To use kerberos the
2755`java.security.auth.login.config` system property must point to a
2756login to a JAAS configuration file and, if Java 6 is used, the system
2757property `java.security.krb5.conf` must point to the appropriate
2758krb5.ini file with references to the KDC.
2759
2760Typical jaas.conf.
2761
2762----
2763KerberosLogin {
2764 com.sun.security.auth.module.Krb5LoginModule
2765 required
2766 useTicketCache=true
2767 doNotPrompt=true
2768 renewTGT=true;
2769};
2770----
2771
2772See Java documentation on how to create the krb5.ini file.
2773
2774Note the `renewTGT` property to make sure the TGT does not expire,
2775and `useTicketCache` to use the TGT supplied by the operating system. As
2776the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09002777to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02002778
2779On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
2780must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
2781have local administrator privileges.
2782
Bruce Zucd04bbc2014-07-25 15:48:09 +08002783[[ldap.useConnectionPooling]]ldap.useConnectionPooling::
2784+
2785_(Optional)_ Enable the LDAP connection pooling or not.
2786+
2787If it is true, the LDAP service provider maintains a pool of (possibly)
2788previously used connections and assigns them to a Context instance as
2789needed. When a Context instance is done with a connection (closed or
2790garbage collected), the connection is returned to the pool for future use.
2791+
2792For details, see link:http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html[
2793LDAP connection management (Pool)] and link:http://docs.oracle.com/javase/tutorial/jndi/ldap/config.html[
2794LDAP connection management (Configuration)]
2795+
2796By default, false.
2797
2798[[ldap.connectTimeout]]ldap.connectTimeout::
2799+
Saša Živkov303701a2015-01-19 16:24:44 +01002800_(Optional)_ Timeout period for establishment of an LDAP connection.
Bruce Zucd04bbc2014-07-25 15:48:09 +08002801+
2802The value is in the usual time-unit format like "1 s", "100 ms",
2803etc...
2804+
2805By default there is no timeout and Gerrit will wait indefinitely.
2806
Saša Živkov5049f512015-01-19 17:04:43 +01002807[[ldap-connection-pooling]]
2808==== LDAP Connection Pooling
2809Once LDAP connection pooling is enabled by setting the link:#ldap.useConnectionPooling[
2810ldap.useConnectionPooling] configuration property to `true`, the connection pool
2811can be configured using JVM system properties as explained in the
2812link:http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-ldap.html#POOL[
2813Java SE Documentation].
Bruce Zucd04bbc2014-07-25 15:48:09 +08002814
Saša Živkov5049f512015-01-19 17:04:43 +01002815For standalone Gerrit (running with the embedded Jetty), JVM system properties
2816are specified in the link:#container[container section]:
Bruce Zucd04bbc2014-07-25 15:48:09 +08002817
Saša Živkov5049f512015-01-19 17:04:43 +01002818----
2819 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.maxsize=20
2820 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.prefsize=10
2821 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.timeout=300000
2822----
Bruce Zucd04bbc2014-07-25 15:48:09 +08002823
Saša Živkovca7a67e2015-12-01 14:25:10 +01002824[[lfs]]
2825=== Section lfs
2826
2827[[lfs.plugin]]lfs.plugin::
2828+
2829The name of a plugin which serves the LFS protocol on the
2830`<project-name>/info/lfs/objects/batch` endpoint. When not configured Gerrit
2831will respond with `501 Not Implemented` on LFS protocol requests.
2832+
2833By default unset.
2834
Gustaf Lundhaef90122015-04-27 16:48:19 +02002835[[log]]
2836=== Section log
2837
2838[[log.jsonLogging]]log.jsonLogging::
2839+
2840If set to true, enables error logging in JSON format (file name: "logs/error_log.json").
2841+
2842Defaults to false.
2843
2844[[log.textLogging]]log.textLogging::
2845+
2846If set to true, enables error logging in regular plain text format. Can only be disabled
2847if `jsonLogging` is enabled.
2848+
2849Defaults to true.
2850
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002851[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002852=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002853
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002854[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002855+
2856If set to true, files with the MIME type `<name>` will be sent as
2857direct downloads to the user's browser, rather than being wrapped up
2858inside of zipped archives. The type name may be a complete type
Jonathan Nieder5758f182015-03-30 11:28:55 -07002859name, e.g. `image/gif`, a generic media type, e.g. `+image/*+`,
2860or the wildcard `+*/*+` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002861+
2862By default, false for all MIME types.
2863
2864Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002865----
2866[mimetype "image/*"]
2867 safe = true
2868
2869[mimetype "application/pdf"]
2870 safe = true
2871
2872[mimetype "application/msword"]
2873 safe = true
2874
2875[mimetype "application/vnd.ms-excel"]
2876 safe = true
2877----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07002878
Michael Ochmann69813262016-01-27 17:53:55 +01002879[[oauth]]
2880=== Section oauth
2881
2882OAuth integration is only enabled if `auth.type` is set to `OAUTH`. See
2883link:#auth.type[above] for a detailed description of the `auth.type` settings
2884and their implications.
2885
2886By default, contact information, like the full name and email address,
2887is retrieved from the selected OAuth provider when a user account is created,
2888or when a user requests to reload that information in the settings UI. If
2889that is not supported by the OAuth provider, users can be allowed to edit
2890their contact information manually.
2891
2892[[oauth.allowEditFullName]]oauth.allowEditFullName::
2893+
2894If true, the full name can be edited in the contact information.
2895+
2896Default is false.
2897
2898[[oauth.allowRegisterNewEmail]]oauth.allowRegisterNewEmail::
2899+
2900If true, additional email addresses can be registered in the contact
2901information.
2902+
2903Default is false.
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07002904
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002905[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002906=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002907
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07002908Global settings controlling how Gerrit Code Review creates pack
2909streams for Git clients running clone, fetch, or pull. Most of these
2910variables are per-client request, and thus should be carefully set
2911given the expected concurrent request load and available CPU and
2912memory resources.
2913
2914[[pack.deltacompression]]pack.deltacompression::
2915+
2916If true, delta compression between objects is enabled. This may
2917result in a smaller overall transfer for the client, but requires
2918more server memory and CPU time.
2919+
2920False (off) by default, matching Gerrit Code Review 2.1.4.
2921
2922[[pack.threads]]pack.threads::
2923+
2924Maximum number of threads to use for delta compression (if enabled).
2925This is per-client request. If set to 0 then the number of CPUs is
2926auto-detected and one thread per CPU is used, per client request.
2927+
2928By default, 1.
2929
2930
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002931[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002932=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07002933
2934[[plugins.checkFrequency]]plugins.checkFrequency::
2935+
2936How often plugins should be examined for new plugins to load, removed
2937plugins to be unloaded, or updated plugins to be reloaded. Values can
2938be specified using standard time unit abbreviations ('ms', 'sec',
2939'min', etc.).
2940+
2941If set to 0, automatic plugin reloading is disabled. Administrators
Christian Aistleitner8ce1a4e2015-06-05 01:54:15 +02002942may force reloading with link:cmd-plugin-reload.html[gerrit plugin reload].
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07002943+
2944Default is 1 minute.
2945
Shawn Pearcefd033502014-02-14 16:42:35 -08002946[[plugins.allowRemoteAdmin]]plugins.allowRemoteAdmin::
2947+
2948Enable remote installation, enable and disable of plugins over HTTP
2949and SSH. If set to true Administrators can install new plugins
2950remotely, or disable existing plugins. Defaults to false.
2951
Dariusz Luksza98f23522015-03-11 11:41:41 +01002952[[plugins.jsLoadTimeout]]plugins.jsLoadTimeout::
2953+
2954Set the timeout value for loading JavaScript plugins in Gerrit UI.
2955Values can be specified using standard time unit abbreviations ('ms',
2956'sec', 'min', etc.).
2957+
2958Default is 5 seconds. Negative values will be converted to 0.
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07002959
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002960[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002961=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002962
Dave Borowitzff243892015-08-31 15:35:28 -04002963This section is used to configure behavior of the 'receive-pack'
2964handler, which responds to 'git push' requests.
lincoln2be11602010-07-05 10:53:25 -03002965
Dave Borowitzff243892015-08-31 15:35:28 -04002966[[receive.allowGroup]]receive.allowGroup::
Dave Borowitz532342bf2015-06-18 20:28:22 -04002967+
Dave Borowitzff243892015-08-31 15:35:28 -04002968Name of the groups of users that are allowed to execute
2969'receive-pack' on the server. One or more groups can be set.
Dave Borowitz532342bf2015-06-18 20:28:22 -04002970+
Dave Borowitzff243892015-08-31 15:35:28 -04002971If no groups are added, any user will be allowed to execute
2972'receive-pack' on the server.
Dave Borowitz532342bf2015-06-18 20:28:22 -04002973
2974[[receive.certNonceSeed]]receive.certNonceSeed::
2975+
2976If set to a non-empty value and server-side signed push validation is
2977link:#receive.enableSignedPush[enabled], use this value as the seed to
2978the HMAC SHA-1 nonce generator. If unset, a 64-byte random seed will be
2979generated at server startup.
2980+
2981As this is used as the seed of a cryptographic algorithm, it is
2982recommended to be placed in link:#secure-config[`secure.config`].
2983+
2984Defaults to unset.
2985
2986[[receive.certNonceSlop]]receive.certNonceSlop::
2987+
2988When validating the nonce passed as part of the signed push protocol,
2989accept valid nonces up to this many seconds old. This allows
2990certificate verification to work over HTTP where there is a lag between
2991the HTTP response providing the nonce to sign and the next request
2992containing the signed nonce. This can be significant on large
2993repositories, since the lag also includes the time to count objects on
2994the client.
2995+
2996Default is 5 minutes.
2997
Dave Borowitzff243892015-08-31 15:35:28 -04002998[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
2999+
3000Number of threads to perform change creation or patch set updates
3001concurrently. Each thread uses its own database connection from
3002the database connection pool, and if all threads are busy then
3003main receive thread will also perform a change creation or patch
3004set update.
3005+
3006Defaults to 1, using only the main receive thread. This feature is for
3007databases with very high latency that can benefit from concurrent
3008operations when multiple changes are impacted at once.
3009
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08003010[[receive.checkMagicRefs]]receive.checkMagicRefs::
3011+
3012If true, Gerrit will verify the destination repository has
3013no references under the magic 'refs/drafts', 'refs/for', or
3014'refs/publish' branch namespaces. Names under these locations
3015confuse clients when trying to upload code reviews so Gerrit
3016requires them to be empty.
3017+
3018If false Gerrit skips the sanity check and assumes administrators
3019have ensured the repository does not contain any magic references.
3020Setting to false to skip the check can decrease latency during push.
3021+
3022Default is true.
3023
Gustaf Lundh9062fd62013-02-14 17:23:11 +01003024[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
3025+
3026If set to true, Gerrit will validate that all referenced objects that
3027are not included in the received pack are reachable by the user.
3028+
3029Carrying out this check on gits with many refs and commits can be a
3030very CPU-heavy operation. For non public Gerrit-servers this check may
3031be overkill.
3032+
3033Only disable this check if you trust the clients not to forge SHA1
3034references to access commits intended to be hidden from the user.
3035+
3036Default is true.
3037
Dave Borowitzff243892015-08-31 15:35:28 -04003038[[receive.enableSignedPush]]receive.enableSignedPush::
lincoln2be11602010-07-05 10:53:25 -03003039+
Dave Borowitzff243892015-08-31 15:35:28 -04003040If true, server-side signed push validation is enabled.
lincoln2be11602010-07-05 10:53:25 -03003041+
Dave Borowitzff243892015-08-31 15:35:28 -04003042When a client pushes with `git push --signed`, this ensures that the
3043push certificate is valid and signed with a valid public key stored in
David Pursehouse6117a472016-07-26 08:02:49 +00003044the `refs/meta/gpg-keys` branch of `All-Users`.
Dave Borowitzff243892015-08-31 15:35:28 -04003045+
3046Defaults to false.
3047
3048[[receive.maxBatchChanges]]receive.maxBatchChanges::
3049+
3050The maximum number of changes that Gerrit allows to be pushed
3051in a batch for review. When this number is exceeded Gerrit rejects
3052the push with an error message.
3053+
3054May be overridden for certain groups by specifying a limit in the
3055link:access-control.html#capability_batchChangesLimit['Batch Changes Limit']
3056global capability.
3057+
3058This setting can be used to prevent users from uploading large
3059number of changes for review by mistake.
3060+
3061Default is zero, no limit.
lincoln2be11602010-07-05 10:53:25 -03003062
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003063[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
3064+
3065Maximum allowed Git object size that 'receive-pack' will accept.
3066If an object is larger than the given size the pack-parsing will abort
3067and the push operation will fail. If set to zero then there is no
3068limit.
3069+
David Pursehouse221d4f62012-06-08 17:38:08 +09003070Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003071from pushing objects which are too large to Gerrit.
3072+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07003073This setting can also be set in the `project.config`
3074link:config-project-config.html[receive.maxObjectSizeLimit] in order
3075to further reduce the global setting. The project specific setting is
3076only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02003077+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003078Default is zero.
3079+
3080Common unit suffixes of 'k', 'm', or 'g' are supported.
3081
Dave Borowitz1bb49492015-08-31 15:36:59 -04003082[[receive.maxTrustDepth]]receive.maxTrustDepth::
3083+
3084If signed push validation is link:#receive.enableSignedPush[enabled],
3085set to the maximum depth to search when checking if a key is
3086link:#receive.trustedKey[trusted].
3087+
3088Default is 0, meaning only explicitly trusted keys are allowed.
3089
Dave Borowitz234734a2012-03-01 14:22:29 -08003090[[receive.threadPoolSize]]receive.threadPoolSize::
3091+
3092Maximum size of the thread pool in which the change data in received packs is
3093processed.
3094+
3095Defaults to the number of available CPUs according to the Java runtime.
3096
Dave Borowitz1c401362012-03-02 17:39:17 -08003097[[receive.timeout]]receive.timeout::
3098+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07003099Overall timeout on the time taken to process the change data in
3100received packs. Only includes the time processing Gerrit changes
3101and updating references, not the time to index the pack. Values can
3102be specified using standard time unit abbreviations ('ms', 'sec',
3103'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08003104+
Dariusz Lukszade482b02015-11-09 18:25:04 +01003105Default is 4 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07003106is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08003107
Dave Borowitz1bb49492015-08-31 15:36:59 -04003108[[receive.trustedKey]]receive.trustedKey::
3109+
3110List of GPG key fingerprints that should be considered trust roots by
3111the server when signed push validation is
3112link:#receive.enableSignedPush[enabled]. A key is trusted by the server
3113if it is either in this list, or a path of trust signatures leads from
3114the key to a configured trust root. The maximum length of the path is
3115determined by link:#receive.maxTrustDepth[`receive.maxTrustDepth`].
3116+
3117Key fingerprints can be displayed with `gpg --list-keys
3118--with-fingerprint`.
3119+
3120Trust signatures can be added to a key using the `tsign` command to
3121link:https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html[
3122`gpg --edit-key`], after which the signed key should be re-uploaded.
3123+
3124If no keys are specified, web-of-trust checks are disabled. This is the
3125default behavior.
3126
lincoln2be11602010-07-05 10:53:25 -03003127
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003128[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003129=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003130
Hugo Josefson072b4702010-04-21 19:27:11 +02003131Repositories in this sense are the same as projects.
3132
Shawn O. Pearce897d9212011-06-16 16:59:59 -07003133In the following example configuration `Registered Users` is set
3134to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02003135
3136----
3137[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02003138 ownerGroup = Registered Users
3139----
3140
Hugo Arès7d2b9422014-11-25 15:33:42 -05003141The only matching patterns supported are exact match or wildcard matching which
3142can be specified by ending the name with a `*`. If a project matches more than one
3143repository configuration, then the configuration from the more precise match
3144will be used. In the following example, the default submit type for a project
3145named `project/plugins/a` would be `CHERRY_PICK`.
3146
3147----
3148[repository "project/*"]
3149 defaultSubmitType = MERGE_IF_NECESSARY
3150[repository "project/plugins/*"]
3151 defaultSubmitType = CHERRY_PICK
3152----
3153
Michael Ochmann8129ece2016-07-08 11:25:25 +02003154[NOTE]
3155All properties are used from the matching repository configuration. In
Hugo Arès7d2b9422014-11-25 15:33:42 -05003156the previous example, all properties will be used from `project/plugins/\*`
3157section and no properties will be inherited nor overridden from `project/*`.
Hugo Josefson072b4702010-04-21 19:27:11 +02003158
Hugo Arès218bb3b2015-04-22 15:05:14 -04003159[[repository.name.basePath]]repository.<name>.basePath::
3160+
3161Alternate to <<gerrit.basePath,gerrit.basePath>>. The repository will be created
3162and used from this location instead: ${alternateBasePath}/${projectName}.git.
3163+
3164If configuring the basePath for an existing project in gerrit, make sure to stop
3165gerrit, move the repository in the alternate basePath, configure basePath for
3166this repository and then start Gerrit.
3167+
3168Path must be absolute.
3169
Edwin Kempina79ea552013-11-19 11:24:37 +01003170[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
3171+
3172The default submit type for newly created projects. Supported values
3173are `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
3174`MERGE_ALWAYS` and `CHERRY_PICK`.
3175+
3176By default, `MERGE_IF_NECESSARY`.
3177
Hugo Josefson072b4702010-04-21 19:27:11 +02003178[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
3179+
3180A name of a group which exists in the database. Zero, one or many
3181groups are allowed. Each on its own line. Groups which don't exist
3182in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02003183
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003184[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003185=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07003186
3187[[rules.enable]]rules.enable::
3188+
Matt Baker8ce12fc2013-11-26 21:43:12 -07003189If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07003190project's refs/meta/config branch, if present. When set to false,
3191only the default internal rules will be used.
3192+
3193Default is true, to execute project specific rules.
3194
Shawn Pearceed001d72014-12-17 14:25:55 -08003195[[rules.reductionLimit]]rules.reductionLimit::
3196+
3197Maximum number of Prolog reductions that can be performed when
3198evaluating rules for a single change. Each function call made
3199in user rule code, internal Gerrit Prolog code, or the Prolog
3200interpreter counts against this limit.
3201+
3202Sites using very complex rules that need many reductions should
3203compile Prolog to Java bytecode with link:pgm-rulec.html[rulec].
3204This eliminates the dynamic Prolog interpreter from charging its
3205own reductions against the limit, enabling more logic to execute
3206within the same bounds.
3207+
3208A reductionLimit of 0 is nearly infinite, implemented by setting
3209the internal limit to 2^31-1.
3210+
3211Default is 100,000 reductions (about 14 ms on Intel Core i7 CPU).
3212
3213[[rules.compileReductionLimit]]rules.compileReductionLimit::
3214+
3215Maximum number of Prolog reductions that can be performed when
3216compiling source code to internal Prolog machine code.
3217+
3218Default is 10x reductionLimit (1,000,000).
3219
Shawn Pearcea2b98522015-11-21 09:47:32 -08003220[[rules.maxSourceBytes]]rules.maxSourceBytes::
3221+
3222Maximum input size (in bytes) of a Prolog rules.pl file. Larger
3223source files may need a larger rules.compileReductionLimit. Consider
3224using link:pgm-rulec.html[rulec] to precompile larger rule files.
3225+
3226A size of 0 bytes disables rules, same as rules.enable = false.
3227+
David Pursehouse0c1dadf2015-11-24 09:14:21 +00003228Common unit suffixes of 'k', 'm', or 'g' are supported.
3229+
Shawn Pearcea2b98522015-11-21 09:47:32 -08003230Default is 128 KiB.
3231
3232[[rules.maxPrologDatabaseSize]]rules.maxPrologDatabaseSize::
3233+
3234Number of predicate clauses allowed to be defined in the Prolog
3235database by project rules. Very complex rules may need more than the
3236default 256 limit, but cost more memory and may need more time to
3237evaluate. Consider using link:pgm-rulec.html[rulec] to precompile
3238larger rule files.
3239+
3240Default is 256.
3241
David Pursehouse511a35b2014-04-04 10:27:13 +09003242[[execution]]
3243=== Section execution
Bruce Zua7e34312014-04-01 17:35:41 +08003244
3245[[execution.defaultThreadPoolSize]]execution.defaultThreadPoolSize::
3246+
3247The default size of the background execution thread pool in
3248which miscellaneous tasks are handled.
3249+
3250Default is 1.
3251
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003252[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003253=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003254
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003255[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07003256+
3257If false Gerrit will not send email messages, for any reason,
3258and all other properties of section sendemail are ignored.
3259+
3260By default, true, allowing notifications to be sent.
3261
Bruce Zua7e34312014-04-01 17:35:41 +08003262[[sendemail.connectTimeout]]sendemail.connectTimeout::
3263+
3264The connection timeout of opening a socket connected to a
3265remote SMTP server.
3266+
3267Values can be specified using standard time unit abbreviations
3268('ms', 'sec', 'min', etc.).
3269If no unit is specified, milliseconds is assumed.
3270+
3271Default is 0. A timeout of zero is interpreted as an infinite
3272timeout. The connection will then block until established or
3273an error occurs.
3274
3275[[sendemail.threadPoolSize]]sendemail.threadPoolSize::
3276+
3277Maximum size of thread pool in which the review comments
3278notifications are sent out asynchronously.
3279+
3280By default, 1.
3281
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003282[[sendemail.from]]sendemail.from::
3283+
3284Designates what name and address Gerrit will place in the From
3285field of any generated email messages. The supported values are:
3286+
3287* `USER`
3288+
3289Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09003290Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003291classified as spam if the user's domain has SPF or DKIM enabled
3292and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
3293relay for that domain.
3294+
3295* `MIXED`
3296+
Edwin Kempincdb0e002011-09-08 14:23:30 +02003297Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003298`review@example.com` is the same as <<user.email,user.email>>.
3299See below for a description of how the replacement is handled.
3300+
3301* `SERVER`
3302+
3303Gerrit will set the From header to the same name and address
3304it records in any commits Gerrit creates. This is set by
3305<<user.name,user.name>> and <<user.email,user.email>>, or guessed
3306from the local operating system.
3307+
Edwin Kempinebfbbac2015-07-01 16:02:39 +02003308* `Code Review <review@example.com>`
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003309+
3310If set to a name and email address in brackets, Gerrit will use
3311this name and email address for any messages, overriding the name
3312that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02003313Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003314which is replaced by the Full Name of the current user.
3315
3316+
3317By default, MIXED.
3318
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003319[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003320+
3321Hostname (or IP address) of a SMTP server that will relay
3322messages generated by Gerrit to end users.
3323+
3324By default, 127.0.0.1 (aka localhost).
3325
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003326[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003327+
3328Port number of the SMTP server in sendemail.smtpserver.
3329+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08003330By default, 25, or 465 if smtpEncryption is 'ssl'.
3331
3332[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
3333+
3334Specify the encryption to use, either 'ssl' or 'tls'.
3335+
3336By default, 'none', indicating no encryption is used.
3337
3338[[sendemail.sslVerify]]sendemail.sslVerify::
3339+
3340If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
3341will not verify the server certificate when it connects to send
3342an email message.
3343+
3344By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003345
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003346[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003347+
3348User name to authenticate with, if required for relay.
3349
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003350[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003351+
3352Password for the account named by sendemail.smtpUser.
3353
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003354[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07003355+
3356If present, each value adds one entry to the whitelist of email
3357addresses that Gerrit can send email to. If set to a complete
3358email address, that one address is added to the white list.
3359If set to a domain name, any address at that domain can receive
3360email from Gerrit.
3361+
3362By default, unset, permitting delivery to any email address.
3363
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07003364[[sendemail.includeDiff]]sendemail.includeDiff::
3365+
Bruce Zueb00ff32012-11-27 17:38:10 +08003366If true, new change emails and merged change emails from Gerrit
3367will include the complete unified diff of the change.
3368Variable maxmimumDiffSize places an upper limit on how large the
3369email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07003370+
3371By default, false.
3372
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07003373[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
3374+
3375Largest size of unified diff output to include in an email. When
3376the diff exceeds this size the file paths will be listed instead.
3377Standard byte unit suffixes are supported.
3378+
3379By default, 256 KiB.
3380
Alex Blewitt9cca7402011-02-11 01:39:30 +00003381[[sendemail.importance]]sendemail.importance::
3382+
3383If present, emails sent from Gerrit will have the given level
3384of importance. Valid values include 'high' and 'low', which
3385email clients will render in different ways.
3386+
3387By default, unset, so no Importance header is generated.
3388
3389[[sendemail.expiryDays]]sendemail.expiryDays::
3390+
3391If present, emails sent from Gerrit will expire after the given
3392number of days. This will add the Expiry-Date header and
3393email clients may expire or expunge mails whose Expiry-Date
3394header is in the past. This should be a positive non-zero
3395number indicating how many days in the future the mails
3396should expire.
3397+
3398By default, unset, so no Expiry-Date header is generated.
3399
Shawn O. Pearcedba97642011-09-07 20:12:31 -07003400
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003401[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003402=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07003403
Shawn O. Pearcedba97642011-09-07 20:12:31 -07003404[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
3405+
3406If true the server checks the site header, footer and CSS files for
3407updated versions. If false, a server restart is required to change
3408any of these resources. Default is true, allowing automatic reloads.
3409
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003410[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003411=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07003412
3413Variables in section ssh-alias permit the site administrator to alias
3414another command from Gerrit or a plugin into the `gerrit` command
3415namespace. To alias `replication start` to `gerrit replicate`:
3416
3417----
3418[ssh-alias]
3419 replicate = replication start
3420----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07003421
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003422[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003423=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07003424
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02003425[[sshd.enableCompression]]sshd.enableCompression::
3426+
3427In the general case, we want to disable transparent compression, since
3428the majority of our data transfer is highly compressed Git pack files
3429and we cannot make them any smaller than they already are.
3430+
3431However, if there are CPU in abundance and the server is reachable
3432through slow networks, gits with huge amount of refs can benefit from
3433SSH-compression since git does not compress the ref announcement during
3434handshake.
3435+
3436Compression can be especially useful when Gerrit slaves are being used
3437for the larger clones and fetches and the master server mostly takes
3438small receive-packs.
3439+
3440By default, `false`.
3441
David Ostrovskye2921b62015-03-04 22:36:10 +01003442[[sshd.backend]]sshd.backend::
3443+
3444Starting from version 0.9.0 Apache SSHD project added support for NIO2
3445IoSession. To use the new NIO2 session the `backend` option must be set
Marco Miller4eba49e2016-04-06 08:23:01 -04003446to `NIO2`. Otherwise, this option must be set to `MINA`.
David Ostrovskye2921b62015-03-04 22:36:10 +01003447+
Luca Milanesiofc1ed9c2016-03-01 18:28:36 +00003448By default, `NIO2`.
David Ostrovskye2921b62015-03-04 22:36:10 +01003449
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003450[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003451+
3452Specifies the local addresses the internal SSHD should listen
3453for connections on. The following forms may be used to specify
3454an address. In any form, `:'port'` may be omitted to use the
3455default of 29418.
3456+
3457* 'hostname':'port' (for example `review.example.com:29418`)
3458* 'IPv4':'port' (for example `10.0.0.1:29418`)
3459* ['IPv6']:'port' (for example `[ff02::1]:29418`)
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003460* +*:'port'+ (for example `+*:29418+`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003461
3462+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003463--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003464If multiple values are supplied, the daemon will listen on all
3465of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003466
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07003467To disable the internal SSHD, set listenAddress to `off`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003468
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003469By default, *:29418.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003470--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003471
James Y Knight910bd862011-01-11 20:05:56 -05003472[[sshd.advertisedAddress]]sshd.advertisedAddress::
3473+
3474Specifies the addresses clients should be told to connect to.
3475This may differ from sshd.listenAddress if a firewall based port
3476redirector is being used, making Gerrit appear to answer on port
347722. The following forms may be used to specify an address. In any
3478form, `:'port'` may be omitted to use the default SSH port of 22.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003479
James Y Knight910bd862011-01-11 20:05:56 -05003480* 'hostname':'port' (for example `review.example.com:22`)
3481* 'IPv4':'port' (for example `10.0.0.1:29418`)
3482* ['IPv6']:'port' (for example `[ff02::1]:29418`)
3483
3484+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003485--
James Y Knight910bd862011-01-11 20:05:56 -05003486If multiple values are supplied, the daemon will advertise all
3487of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003488
James Y Knight910bd862011-01-11 20:05:56 -05003489By default, sshd.listenAddress.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003490--
James Y Knight910bd862011-01-11 20:05:56 -05003491
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003492[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07003493+
3494If true, enables TCP keepalive messages to the other side, so
3495the daemon can terminate connections if the peer disappears.
3496+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02003497Only effective when `sshd.backend` is set to `MINA`.
3498+
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07003499By default, true.
3500
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08003501[[sshd.threads]]sshd.threads::
3502+
3503Number of threads to use when executing SSH command requests.
3504If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09003505are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08003506+
Dariusz Luksza4b5a4162015-11-09 21:53:29 +01003507By default, 2x the number of CPUs available to the JVM.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08003508
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003509[[sshd.batchThreads]]sshd.batchThreads::
3510+
3511Number of threads to allocate for SSH command requests from
Fredrik Luthander46843022012-03-13 16:11:02 +01003512link:access-control.html#non-interactive_users[non-interactive users].
3513If equals to 0, then all non-interactive requests are executed in the same
3514queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003515+
3516Any other value will remove the number of threads from the queue
3517allocated to interactive users, and create a separate thread pool
3518of the requested size, which will be used to run commands from
3519non-interactive users.
3520+
3521If the number of threads requested for non-interactive users is larger
3522than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09003523value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003524+
Dariusz Luksza145de472015-11-09 18:44:35 +01003525By default is 1 on single core node, 2 otherwise.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003526
Kenny Root15ac1b82010-02-24 00:29:20 -08003527[[sshd.streamThreads]]sshd.streamThreads::
3528+
3529Number of threads to use when formatting events to asynchronous
3530streaming clients. Event formatting is multiplexed onto this thread
3531pool by a simple FIFO scheduling system.
3532+
3533By default, 1 plus the number of CPUs available to the JVM.
3534
Edwin Kempinb5df3b82011-10-10 11:31:14 +02003535[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07003536+
3537Number of threads used to parse a command line submitted by a client
3538over SSH for execution, create the internal data structures used by
3539that command, and schedule it for execution on another thread.
3540+
3541By default, 2.
3542
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07003543[[sshd.maxAuthTries]]sshd.maxAuthTries::
3544+
3545Maximum number of authentication attempts before the server
3546disconnects the client. Each public key that a client has loaded
3547into its local agent counts as one auth request. Users can work
3548around the server's limit by loading less keys into their agent,
3549or selecting a specific key in their `~/.ssh/config` file with
3550the `IdentityFile` option.
3551+
3552By default, 6.
3553
3554[[sshd.loginGraceTime]]sshd.loginGraceTime::
3555+
3556Time in seconds that a client has to authenticate before the server
3557automatically terminates their connection. Values should use common
3558unit suffixes to express their setting:
3559+
3560* s, sec, second, seconds
3561* m, min, minute, minutes
3562* h, hr, hour, hours
3563* d, day, days
3564
3565+
3566By default, 2 minutes.
3567
Christian Aistleitner3d794592013-04-08 00:19:40 +02003568[[sshd.idleTimeout]]sshd.idleTimeout::
3569+
3570Time in seconds after which the server automatically terminates idle
3571connections (or 0 to disable closing of idle connections). Values
3572should use common unit suffixes to express their setting:
3573+
3574* s, sec, second, seconds
3575* m, min, minute, minutes
3576* h, hr, hour, hours
3577* d, day, days
3578
3579+
3580By default, 0.
3581
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07003582[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
3583+
3584Maximum number of concurrent SSH sessions that a user account
3585may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09003586that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07003587the number of commands a user may issue over a single connection.
3588If set to 0, there is no limit.
3589+
3590By default, 64.
3591
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003592[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003593+
3594Available ciphers. To permit multiple ciphers, specify multiple
3595`sshd.cipher` keys in the configuration file, one cipher name
3596per key. Cipher names starting with `+` are enabled in addition
3597to the default ciphers, cipher names starting with `-` are removed
3598from the default cipher set.
3599+
3600Supported ciphers: aes128-cbc, aes128-cbc, aes256-cbc, blowfish-cbc,
36013des-cbc, none.
3602+
3603By default, all supported ciphers except `none` are available.
3604
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003605[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003606+
3607Available MAC (message authentication code) algorithms. To permit
3608multiple algorithms, specify multiple `sshd.mac` keys in the
3609configuration file, one MAC per key. MAC names starting with `+`
3610are enabled in addition to the default MACs, MAC names starting with
3611`-` are removed from the default MACs.
3612+
Scott Dialbe1c4002015-11-10 11:07:44 -05003613Supported MACs: hmac-md5, hmac-md5-96, hmac-sha1, hmac-sha1-96,
3614hmac-sha2-256, hmac-sha2-512.
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003615+
3616By default, all supported MACs are available.
3617
Alex Blewitt7efb06f2013-04-01 12:46:48 -04003618[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
3619+
3620Enable kerberos authentication for SSH connections. To permit
3621kerberos authentication, the server must have a host principal
3622(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
3623This must be provisioned by the kerberos administrators, and is
3624typically installed into `/etc/krb5.keytab` on host machines.
3625+
3626The keytab must contain at least one `host/` principal, typically
3627using the host's canonical name. If it does not use the
3628canonical name, the `sshd.kerberosPrincipal` should be configured
3629with the correct name.
3630+
3631By default, not set and so kerberos authentication is not enabled.
3632
3633[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
3634+
3635If kerberos authentication is enabled with `sshd.kerberosKeytab`,
3636instead use the given principal name instead of the default.
3637If the principal does not begin with `host/` a warning message is
3638printed and may prevent successful authentication.
3639+
3640This may be useful if the host is behind an IP load balancer or
3641other SSH forwarding systems, since the principal name is constructed
3642by the client and must match for kerberos authentication to work.
3643+
3644By default, `host/canonical.host.name`
3645
Shawn Pearce318bfca2013-10-17 22:15:38 -07003646[[sshd.requestLog]]sshd.requestLog::
3647+
3648Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
3649If enabled, a request log file is written out by the SSH daemon.
3650+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01003651`log4j.appender` with the name `sshd_log` can be configured to overwrite
3652programmatic configuration.
3653+
Shawn Pearce318bfca2013-10-17 22:15:38 -07003654By default, true.
3655
David Ostrovsky985201b2015-03-04 22:37:33 +01003656[[sshd.rekeyBytesLimit]]sshd.rekeyBytesLimit::
3657+
3658The SSH daemon will issue a rekeying after a certain amount of data.
3659This configuration option allows you to tweak that setting.
3660+
3661By default, 1073741824 (bytes, 1GB).
3662+
3663The rekeyBytesLimit cannot be set to lower than 32.
3664
3665[[sshd.rekeyTimeLimit]]sshd.rekeyTimeLimit::
3666+
3667The SSH daemon will issue a rekeying after a certain amount of time.
3668This configuration option allows you to tweak that setting.
3669+
3670By default, 1h.
3671+
3672Set to 0 to disable this check.
3673
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003674[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003675=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07003676
Sven Selberg42d9d292014-08-13 11:20:11 +02003677[[suggest.maxSuggestedReviewers]]suggest.maxSuggestedReviewers::
3678+
3679The maximum numbers of reviewers suggested.
3680+
3681By default 10.
3682
Edwin Kempinf957dc22012-10-19 20:41:18 +02003683[[suggest.from]]suggest.from::
3684+
3685The number of characters that a user must have typed before suggestions
3686are provided. If set to 0, suggestions are always provided.
3687+
3688By default 0.
3689
Sven Selberg42d9d292014-08-13 11:20:11 +02003690
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003691[[theme]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003692=== Section theme
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003693
3694[[theme.backgroundColor]]theme.backgroundColor::
3695+
3696Background color for the page, and major data tables like the all
3697open changes table or the account dashboard. The value must be a
3698valid HTML hex color code, or standard color name.
3699+
Chad Horohoebbdf7482012-11-13 18:23:15 -08003700By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003701
3702[[theme.topMenuColor]]theme.topMenuColor::
3703+
3704This is the color of the main menu bar at the top of the page.
3705The value must be a valid HTML hex color code, or standard color
Chad Horohoebbdf7482012-11-13 18:23:15 -08003706name.
3707+
3708By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003709
3710[[theme.textColor]]theme.textColor::
3711+
3712Text color for the page, and major data tables like the all
3713open changes table or the account dashboard. The value must be a
3714valid HTML hex color code, or standard color name.
3715+
Chad Horohoebbdf7482012-11-13 18:23:15 -08003716By default dark grey, `353535`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003717
3718[[theme.trimColor]]theme.trimColor::
3719+
3720Primary color used as a background color behind text. This is
3721the color of the main menu bar at the top, of table headers,
3722and of major UI areas that we want to offset from other portions
3723of the page. The value must be a valid HTML hex color code, or
3724standard color name.
3725+
Chad Horohoebbdf7482012-11-13 18:23:15 -08003726By default a light grey, `EEEEEE`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003727
3728[[theme.selectionColor]]theme.selectionColor::
3729+
3730Background color used within a trimColor area to denote the currently
3731selected tab, or the background color used in a table to denote the
3732currently selected row. The value must be a valid HTML hex color
3733code, or standard color name.
3734+
Chad Horohoebbdf7482012-11-13 18:23:15 -08003735By default a pale blue, `D8EDF9`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08003736
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01003737[[theme.changeTableOutdatedColor]]theme.changeTableOutdatedColor::
3738+
3739Background color used for patch outdated messages. The value must be
3740a valid HTML hex color code, or standard color name.
3741+
Edwin Kempinb0347332012-07-17 10:14:32 +02003742By default a shade of red, `F08080`.
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01003743
3744[[theme.tableOddRowColor]]theme.tableOddRowColor::
3745+
3746Background color for tables such as lists of open reviews for odd
3747rows. This is so you can have a different color for odd and even
3748rows of the table. The value must be a valid HTML hex color code,
3749or standard color name.
3750+
3751By default transparent.
3752
3753[[theme.tableEvenRowColor]]theme.tableEvenRowColor::
3754+
3755Background color for tables such as lists of open reviews for even
3756rows. This is so you can have a different color for odd and even
3757rows of the table. The value must be a valid HTML hex color code,
3758or standard color name.
3759+
3760By default transparent.
3761
Shawn O. Pearcea83bb1c2011-05-20 08:46:48 -07003762A different theme may be used for signed-in vs. signed-out user status
3763by using the "signed-in" and "signed-out" theme sections. Variables
3764not specified in a section are inherited from the default theme.
3765
3766----
3767[theme]
3768 backgroundColor = FFFFFF
3769[theme "signed-in"]
3770 backgroundColor = C0C0C0
3771[theme "signed-out"]
3772 backgroundColor = 00FFFF
3773----
3774
David Ostrovsky117c6032013-08-09 00:44:56 +02003775As example, here is the theme configuration to have the old green look:
3776
3777----
3778[theme]
3779 backgroundColor = FCFEEF
3780 textColor = 000000
3781 trimColor = D4E9A9
3782 selectionColor = FFFFCC
3783 topMenuColor = D4E9A9
3784 changeTableOutdatedColor = F08080
3785[theme "signed-in"]
3786 backgroundColor = FFFFFF
3787----
3788
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003789[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003790=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07003791
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07003792Tagged footer lines containing references to external
3793tracking systems, parsed out of the commit message and
David Pursehoused55a6b62015-02-27 17:39:38 +09003794saved in Gerrit's secondary index.
Shawn Pearceff61c8a2013-10-07 19:35:53 -07003795
3796After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08003797must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07003798
Edwin Kempinbb421f12011-08-25 11:19:00 +02003799The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07003800bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07003801
3802----
3803[trackingid "jira-bug"]
3804 footer = Bugfix:
David Pursehousece7f6862015-02-19 14:52:45 +09003805 footer = Bug:
Goran Lungberg04132a12010-06-15 17:20:37 -07003806 match = JRA\\d{2,8}
3807 system = JIRA
3808
3809[trackingid "jira-feature"]
3810 footer = Feature
3811 match = JRA(\\d{2,8})
3812 system = JIRA
3813----
3814
3815[[trackingid.name.footer]]trackingid.<name>.footer::
3816+
David Pursehousece7f6862015-02-19 14:52:45 +09003817A prefix tag that identifies the footer line to parse for tracking ids.
3818+
3819Several trackingid entries can have the same footer tag, and a single trackingid
3820entry can have multiple footer tags.
3821+
3822If multiple footer tags are specified, each tag will be parsed separately and
3823duplicates will be ignored.
3824+
3825The trailing ":" is optional.
Goran Lungberg04132a12010-06-15 17:20:37 -07003826
3827[[trackingid.name.match]]trackingid.<name>.match::
3828+
Magnus Bäcke5611832011-02-02 08:57:15 +01003829A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
3830Java regular expression (java.util.regex)] used to match the
3831external tracking id part of the footer line. The match can
3832result in several entries in the DB. If grouping is used in the
3833regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01003834Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07003835+
3836The configuration file parser eats one level of backslashes, so the
3837character class `\s` requires `\\s` in the configuration file. The
3838parser also terminates the line at the first `#`, so a match
3839expression containing # must be wrapped in double quotes.
3840
3841[[trackingid.name.system]]trackingid.<name>.system::
3842+
David Pursehouse221d4f62012-06-08 17:38:08 +09003843The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07003844It is possible to have several trackingid entries for the same
3845tracking system.
3846
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003847[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003848=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07003849
3850[[transfer.timeout]]transfer.timeout::
3851+
3852Number of seconds to wait for a single network read or write
3853to complete before giving up and declaring the remote side is
3854not responding. If 0, there is no timeout, and this server will
3855wait indefinitely for a transfer to finish.
3856+
3857A timeout should be large enough to mostly transfer the objects to
3858the other side. 1 second may be too small for larger projects,
3859especially over a WAN link, while 10-30 seconds is a much more
3860reasonable timeout value.
3861+
3862Defaults to 0 seconds, wait indefinitely.
3863
lincoln2be11602010-07-05 10:53:25 -03003864
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003865[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003866=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003867
lincoln2be11602010-07-05 10:53:25 -03003868Sets the group of users allowed to execute 'upload-pack' on the
3869server, 'upload-pack' is what runs on the server during a user's
3870fetch, clone or repo sync command.
3871
3872----
3873[upload]
3874 allowGroup = GROUP_ALLOWED_TO_EXECUTE
3875 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
3876----
3877
3878[[upload.allowGroup]]upload.allowGroup::
3879+
3880Name of the groups of users that are allowed to execute 'upload-pack'
3881on the server. One or more groups can be set.
3882+
3883If no groups are added, any user will be allowed to execute
3884'upload-pack' on the server.
3885
Edwin Kempinfa0d4942015-07-16 12:38:52 +02003886[[urlAlias]]
3887=== Section urlAlias
3888
3889URL aliases define regular expressions for URL tokens that are mapped
3890to target URL tokens.
3891
3892Each URL alias must be specified in its own subsection. The subsection
3893name should be a descriptive name. It must be unique, but is not
3894interpreted in any way.
3895
3896The URL aliases are applied in no particular order. The first matching
3897URL alias is used and further matches are ignored.
3898
3899URL aliases can be used to map plugin screens into the Gerrit URL
3900namespace, or to replace Gerrit screens by plugin screens.
3901
3902Example:
3903
3904----
3905[urlAlias "MyPluginScreen"]
3906 match = /myscreen/(.*)
3907 token = /x/myplugin/myscreen/$1
3908[urlAlias "MyChangeScreen"]
3909 match = /c/(.*)
3910 token = /x/myplugin/c/$1
3911----
3912
3913[[urlAlias.match]]urlAlias.match::
3914+
3915A regular expression for a URL token.
3916+
3917The matched URL token is replaced by `urlAlias.token`.
3918
3919[[urlAlias.token]]urlAlias.token::
3920+
3921The target URL token.
3922+
3923It can contain placeholders for the groups matched by the
3924`urlAlias.match` regular expression: `$1` for the first matched group,
3925`$2` for the second matched group, etc.
lincoln2be11602010-07-05 10:53:25 -03003926
Stefan Beller0f724ff2015-07-17 10:17:51 -07003927[[submodule]]
3928=== Section submodule
3929
Shawn Pearcedc477cd2016-03-24 19:56:18 -07003930[[submodule.verbosesuperprojectupdate]]submodule.verboseSuperprojectUpdate::
Stefan Beller0f724ff2015-07-17 10:17:51 -07003931+
3932When using link:user-submodules.html#automatic_update[automatic superproject updates]
3933this option will determine if the submodule commit messages are included into
3934the commit message of the superproject update.
3935+
3936By default this is true.
3937
Shawn Pearcedc477cd2016-03-24 19:56:18 -07003938[[submodule.enableSuperProjectSubscriptions]]submodule.enableSuperProjectSubscriptions::
Stefan Beller8cc252e2016-03-10 10:06:53 -08003939+
3940This allows to enable the superproject subscription mechanism.
3941+
3942By default this is true.
Stefan Beller0f724ff2015-07-17 10:17:51 -07003943
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003944[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003945=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003946
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003947[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003948+
3949Name that Gerrit calls itself in Git when it creates a new Git
3950commit, such as a merge during change submission.
3951+
3952By default this is "Gerrit Code Review".
3953
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003954[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07003955+
3956Email address that Gerrit refers to itself as when it creates a
3957new Git commit, such as a merge commit during change submission.
3958+
3959If not set, Gerrit generates this as "gerrit@`hostname`", where
3960`hostname` is the hostname of the system Gerrit is running on.
3961+
3962By default, not set, generating the value at startup.
3963
Edwin Kempin0e02ded2011-09-16 15:10:14 +02003964[[user.anonymousCoward]]user.anonymousCoward::
3965+
David Pursehousea1d633b2014-05-02 17:21:02 +09003966Username that is displayed in the Gerrit Web UI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02003967notifications if the full name of the user is not set.
3968+
3969By default "Anonymous Coward" is used.
3970
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003971
Dave Borowitz532342bf2015-06-18 20:28:22 -04003972== [[secure.config]]File `etc/secure.config`
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003973The optional file `'$site_path'/etc/secure.config` overrides (or
3974supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003975The file should be readable only by the daemon process and can be
3976used to contain private configuration entries that wouldn't normally
3977be exposed to everyone.
3978
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003979Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003980----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07003981[auth]
3982 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
3983
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003984[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003985 username = webuser
3986 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003987
3988[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003989 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003990
3991[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003992 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003993
3994[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003995 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07003996
3997[remote "bar"]
3998 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08003999----
4000
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004001== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01004002
4003The optional file `'$site_path'/etc/peer_keys` controls who can
4004login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
4005command.
4006
4007The format is one Base-64 encoded public key per line.
4008
4009
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004010== Database system_config
Shawn O. Pearce7b405712009-05-08 18:27:53 -07004011
4012Several columns in the `system_config` table within the metadata
4013database may be set to control how Gerrit behaves.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08004014
4015[NOTE]
4016The contents of the `system_config` table are cached at startup
4017by Gerrit. If you modify any columns in this table, Gerrit needs
4018to be restarted before it will use the new values.
4019
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004020=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08004021
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07004022site_path::
4023+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08004024Local filesystem directory holding the site customization assets.
4025Placing this directory under version control and/or backup is a
4026good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07004027+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08004028Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07004029+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08004030Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07004031+
Dave Borowitz1e49e142013-04-09 12:14:57 -07004032* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08004033
Shawn O. Pearce5500e692009-05-28 15:55:01 -07004034GERRIT
4035------
4036Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07004037
4038SEARCHBOX
4039---------