blob: bcb13fe5a731c0033d3a66c14f8c5cafaf7b601f [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
Sven Selberg2a0beab2018-04-20 14:49:20 +020010by Gerrit. For most properties, if they are modified in this file, Gerrit
11needs to be restarted before it will use the new values. Some properties
David Pursehousec5286212019-10-21 20:50:17 +090012support being link:#reloadConfig[`reloaded`] without restart.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070013
Shawn O. Pearcec5fed822009-11-17 16:10:10 -080014Sample `etc/gerrit.config`:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070015----
16[core]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080017 packedGitLimit = 200 m
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070018
19[cache]
David Pursehouse64df83a2017-07-04 21:20:47 +090020 directory = /var/cache/gerrit
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070021----
22
Sven Selberg2a0beab2018-04-20 14:49:20 +020023[[reloadConfig]]
24=== Reload `etc/gerrit.config`
25Some properties support being reloaded without restart when a `reload config`
26command is issued through link:cmd-reload-config.html[`SSH`] or the
27link:rest-api-config.html#reload-config[`REST API`]. If a property supports
28this it is specified in the documentation for the property below.
29
30
Hongkai Liu49799b22017-04-07 16:54:25 -040031[[accountPatchReviewDb]]
32=== Section accountPatchReviewDb
33
Gert van Dijk49c56132017-10-17 23:44:25 +020034The AccountPatchReviewDb is a database used to store the user file reviewed
David Pursehousee3eaf9e2019-02-01 10:41:20 +090035flags.
Gert van Dijk49c56132017-10-17 23:44:25 +020036
Hongkai Liu49799b22017-04-07 16:54:25 -040037[[accountPatchReviewDb.url]]accountPatchReviewDb.url::
38+
Paladox nonee3a9dd72017-04-26 12:45:56 +000039The url of accountPatchReviewDb. Supported types are `H2`, `POSTGRESQL`,
40`MARIADB`, and `MYSQL`. Drop the driver jar in the lib folder of the site path
41if the Jdbc driver of the corresponding Database is not yet in the class path.
Hongkai Liu49799b22017-04-07 16:54:25 -040042+
43Default is to create H2 database in the db folder of the site path.
44+
45Changing this parameter requires to migrate database using the
Hugo Arès3e1d4cd2017-04-26 12:02:53 +020046link:pgm-MigrateAccountPatchReviewDb.html[MigrateAccountPatchReviewDb] program.
47Migration cannot be done while the server is running.
Paladox none1a4c01f2017-04-29 18:19:37 +000048+
Dave Borowitzada289c2018-12-18 13:24:14 -080049Also note that the db_name has to be a new db and not reusing an old ReviewDb
50database from a former 2.x site, otherwise gerrit's init will remove the table.
Hongkai Liu49799b22017-04-07 16:54:25 -040051
52----
53[accountPatchReviewDb]
54 url = jdbc:postgresql://<host>:<port>/<db_name>?user=<user>&password=<password>
55----
56
Hector Oswaldo Caballero8dead962017-08-08 05:30:06 -040057[[accountPatchReviewDb.poolLimit]]accountPatchReviewDb.poolLimit::
58+
59Maximum number of open database connections. If the server needs
60more than this number, request processing threads will wait up
61to <<accountPatchReviewDb.poolMaxWait, poolMaxWait>> seconds for a
62connection to be released before they abort with an exception.
63This limit must be several units higher than the total number of
64httpd and sshd threads as some request processing code paths may
65need multiple connections.
66+
67Default is <<sshd.threads, sshd.threads>>
68 + <<httpd.maxThreads, httpd.maxThreads>> + 2.
69+
70
71[[accountPatchReviewDb.poolMinIdle]]database.poolMinIdle::
72+
73Minimum number of connections to keep idle in the pool.
74Default is 4.
75+
76
77[[accountPatchReviewDb.poolMaxIdle]]accountPatchReviewDb.poolMaxIdle::
78+
79Maximum number of connections to keep idle in the pool. If there
80are more idle connections, connections will be closed instead of
81being returned back to the pool.
82Default is min(<<accountPatchReviewDb.poolLimit, accountPatchReviewDb.poolLimit>>, 16).
83+
84
85[[accountPatchReviewDb.poolMaxWait]]accountPatchReviewDb.poolMaxWait::
86+
87Maximum amount of time a request processing thread will wait to
88acquire a database connection from the pool. If no connection is
89released within this time period, the processing thread will abort
90its current operations and return an error to the client.
91Values should use common unit suffixes to express their setting:
92+
93* ms, milliseconds
94* s, sec, second, seconds
95* m, min, minute, minutes
96* h, hr, hour, hours
97
98+
Hector Oswaldo Caballero8dead962017-08-08 05:30:06 -040099If a unit suffix is not specified, `milliseconds` is assumed.
Hector Oswaldo Caballero8dead962017-08-08 05:30:06 -0400100Default is `30 seconds`.
101
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800102[[accounts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800103=== Section accounts
Dave Borowitz45baa892012-02-23 16:43:05 -0800104
Matthias Sohnf3360662012-04-05 15:42:52 +0200105[[accounts.visibility]]accounts.visibility::
Dave Borowitz45baa892012-02-23 16:43:05 -0800106+
107Controls visibility of other users' dashboard pages and
108completion suggestions to web users.
109+
110If `ALL`, all users are visible to all other users, even
111anonymous users.
112+
113If `SAME_GROUP`, only users who are also members of a group the
114current user is a member of are visible.
115+
116If `VISIBLE_GROUP`, only users who are members of at least one group
117that is visible to the current user are visible.
118+
119If `NONE`, no users other than the current user are visible.
120+
121Default is `ALL`.
122
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800123[[addreviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800124=== Section addreviewer
Edwin Kempin49cb3e12011-06-29 14:35:14 +0200125
126[[addreviewer.maxWithoutConfirmation]]addreviewer.maxWithoutConfirmation::
127+
128The maximum number of reviewers a user can add at once by adding a
129group as reviewer without being asked to confirm the operation.
130+
131If set to 0, the user will never be asked to confirm adding a group
132as reviewer.
133+
134Default is 10.
Edwin Kempin5e65d9b2011-07-08 07:35:48 +0200135+
David Pursehousea1d633b2014-05-02 17:21:02 +0900136This setting only applies for adding reviewers in the Gerrit Web UI,
Edwin Kempin5e65d9b2011-07-08 07:35:48 +0200137but is ignored when adding reviewers with the
Edwin Kempin33e92d02011-07-11 22:00:57 +0200138link:cmd-set-reviewers.html[set-reviewers] command.
Gustaf Lundh25e608f2018-04-16 10:54:53 +0200139+
Sven Selberg2a0beab2018-04-20 14:49:20 +0200140This value supports link:#reloadConfig[configuration reloads].
Edwin Kempin49cb3e12011-06-29 14:35:14 +0200141
142[[addreviewer.maxAllowed]]addreviewer.maxAllowed::
143+
144The maximum number of reviewers a user can add at once by adding a
145group as reviewer.
146+
147If set to 0, there is no limit for the number of reviewers that can
148be added at once by adding a group as reviewer.
149+
150Default is 20.
Gustaf Lundh25e608f2018-04-16 10:54:53 +0200151+
Sven Selberg2a0beab2018-04-20 14:49:20 +0200152This value supports link:#reloadConfig[configuration reloads].
Edwin Kempin49cb3e12011-06-29 14:35:14 +0200153
Patrick Hiesel87880b02016-05-03 18:15:08 +0200154[[addReviewer.baseWeight]]addReviewer.baseWeight::
155+
156The weight that will be applied in the default reviewer ranking algorithm.
157This can be increased or decreased to give more or less influence to plugins.
158If set to zero, the base ranking will not have any effect. Reviewers will then
159be ordered as ranked by the plugins (if there are any).
160+
161By default 1.
162
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800163[[auth]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800164=== Section auth
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700165
166See also link:config-sso.html[SSO configuration].
167
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700168[[auth.type]]auth.type::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700169+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700170Type of user authentication employed by Gerrit. The supported
171values are:
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700172+
173* `OpenID`
174+
175The default setting. Gerrit uses any valid OpenID
176provider chosen by the end-user. For more information see
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700177http://openid.net/[openid.net].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700178+
James E. Blairca8bc3b2011-12-21 18:12:26 +0000179* `OpenID_SSO`
180+
181Supports OpenID from a single provider. There is no registration
182link, and the "Sign In" link sends the user directly to the provider's
183SSO entry point.
184+
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700185* `HTTP`
186+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700187Gerrit relies upon data presented in the HTTP request. This includes
Edwin Kempinf1acbb82011-09-15 12:49:42 +0200188HTTP basic authentication, or some types of commercial single-sign-on
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700189solutions. With this setting enabled the authentication must
190take place in the web server or servlet container, and not from
191within Gerrit.
192+
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700193* `HTTP_LDAP`
194+
195Exactly like `HTTP` (above), but additionally Gerrit pre-populates
196a user's full name and email address based on information obtained
197from the user's account object in LDAP. The user's group membership
198is also pulled from LDAP, making any LDAP groups that a user is a
David Pursehouseef92bec2017-08-25 18:45:02 +0900199member of available as groups in Gerrit. Hence the `_LDAP` suffix in
200the name of this authentication type. Gerrit does NOT authenticate
201the user via LDAP.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700202+
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200203* `CLIENT_SSL_CERT_LDAP`
204+
205This authentication type is actually kind of SSO. Gerrit will configure
David Pursehouse221d4f62012-06-08 17:38:08 +0900206Jetty's SSL channel to request the client's SSL certificate. For this
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200207authentication to work a Gerrit administrator has to import the root
208certificate of the trust chain used to issue the client's certificate
209into the <review-site>/etc/keystore.
210After the authentication is done Gerrit will obtain basic user
211registration (name and email) from LDAP, and some group memberships.
David Pursehouseef92bec2017-08-25 18:45:02 +0900212Hence the `_LDAP` suffix in the name of this authentication type.
213Gerrit does NOT authenticate the user via LDAP.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200214This authentication type can only be used under hosted daemon mode, and
215the httpd.listenUrl must use https:// as the protocol.
Chulho Yangb72ff8f2013-07-04 02:35:53 -0400216Optionally, certificate revocation list file can be used
217at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200218+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700219* `LDAP`
220+
221Gerrit prompts the user to enter a username and a password, which
222it then verifies by performing a simple bind against the configured
223<<ldap.server,ldap.server>>. In this configuration the web server
224is not involved in the user authentication process.
225+
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800226The actual username used in the LDAP simple bind request is the
227account's full DN, which is discovered by first querying the
228directory using either an anonymous request, or the configured
Robin Rosenberga3baed02012-10-14 14:09:32 +0200229<<ldap.username,ldap.username>> identity. Gerrit can also use kerberos if
230<<ldap.authentication,ldap.authentication>> is set to `GSSAPI`.
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100231+
232If link:#auth.gitBasicAuthPolicy[`auth.gitBasicAuthPolicy`] is set to `HTTP`,
233the randomly generated HTTP password is used for authentication. On the other hand,
234if link:#auth.gitBasicAuthPolicy[`auth.gitBasicAuthPolicy`] is set to `HTTP_LDAP`,
235the password in the request is first checked against the HTTP password and, if
236it does not match, it is then validated against the LDAP password.
237Service users that only exist in the Gerrit database are authenticated by their
238HTTP passwords.
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800239
240* `LDAP_BIND`
241+
242Gerrit prompts the user to enter a username and a password, which
243it then verifies by performing a simple bind against the configured
244<<ldap.server,ldap.server>>. In this configuration the web server
245is not involved in the user authentication process.
246+
David Pursehouse42f42042013-08-01 14:02:25 +0900247Unlike `LDAP` above, the username used to perform the LDAP simple bind
David Pursehouse1344f5b2013-08-09 17:35:47 +0900248request is the exact string supplied in the dialog by the user.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200249The configured <<ldap.username,ldap.username>> identity is not used to obtain
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800250account information.
251+
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200252* `OAUTH`
David Ostrovskye9707d82015-02-22 01:14:02 +0100253+
254OAuth is a protocol that lets external apps request authorization to private
255details in a user's account without getting their password. This is
256preferred over Basic Authentication because tokens can be limited to specific
257types of data, and can be revoked by users at any time.
258+
259Site owners have to register their application before getting started. Note
260that provider specific plugins must be used with this authentication scheme.
261+
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100262Git clients may send OAuth 2 access tokens instead of passwords in the Basic
263authentication header. Note that provider specific plugins must be installed to
264facilitate this authentication scheme. If multiple OAuth 2 provider plugins are
265installed one of them must be selected as default with the
266`auth.gitOAuthProvider` option.
267+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700268* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
269+
270*DO NOT USE*. Only for use in a development environment.
271+
272When this is the configured authentication method a hyperlink titled
273`Become` appears in the top right corner of the page, taking the
274user to a form where they can enter the username of any existing
275user account, and immediately login as that account, without any
David Ostrovsky7163dac2017-07-29 06:49:38 +0200276authentication taking place.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700277
278+
279By default, OpenID.
280
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700281[[auth.allowedOpenID]]auth.allowedOpenID::
282+
283List of permitted OpenID providers. A user may only authenticate
284with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse42f42042013-08-01 14:02:25 +0900285is set to `OpenID` (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700286+
Magnus Bäcke5611832011-02-02 08:57:15 +0100287Patterns may be either a
288link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
289Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700290end with `$`) or be a simple prefix (any other string).
291+
292By default, the list contains two values, `http://` and `https://`,
293allowing users to authenticate with any OpenID provider.
294
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700295[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700296+
David Pursehouse221d4f62012-06-08 17:38:08 +0900297List of trusted OpenID providers. Only used if `auth.type` is
David Pursehouse42f42042013-08-01 14:02:25 +0900298set to `OpenID` (the default).
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700299+
300In order for a user to take advantage of permissions beyond those
301granted to the `Anonymous Users` and `Registered Users` groups,
302the user account must only have OpenIDs which match at least one
303pattern from this list.
304+
Magnus Bäcke5611832011-02-02 08:57:15 +0100305Patterns may be either a
306link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
307Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700308end with `$`) or be a simple prefix (any other string).
309+
310By default, the list contains two values, `http://` and `https://`,
311allowing Gerrit to trust any OpenID it receives.
312
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100313[[auth.openIdDomain]]auth.openIdDomain::
314+
315List of allowed OpenID email address domains. Only used if
David Pursehouse42f42042013-08-01 14:02:25 +0900316`auth.type` is set to `OPENID` or `OPENID_SSO`.
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100317+
318Domain is case insensitive and must be in the same form as it
319appears in the email address, for example, "example.com".
320+
321By default, any domain is accepted.
322
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700323[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
324+
325Time in seconds before an OpenID provider must force the user
326to authenticate themselves again before authentication to this
327Gerrit server. Currently this is only a polite request, and users
328coming from providers that don't support the PAPE extension will
329be accepted anyway. In the future it may be enforced, rejecting
330users coming from providers that don't honor the max session age.
331+
332If set to 0, the provider will always force the user to authenticate
333(e.g. supply their password). Values should use common unit suffixes
334to express their setting:
335+
336* s, sec, second, seconds
337* m, min, minute, minutes
338* h, hr, hour, hours
339* d, day, days
340* w, week, weeks (`1 week` is treated as `7 days`)
341* mon, month, months (`1 month` is treated as `30 days`)
342* y, year, years (`1 year` is treated as `365 days`)
343
344+
345Default is -1, permitting infinite time between authentications.
346
David Pursehouse5be35a32015-09-09 17:35:32 +0900347[[auth.registerEmailPrivateKey]]auth.registerEmailPrivateKey::
348+
349Private key to use when generating an email verification token.
350+
351If not set, a random key is generated when running the
352link:pgm-init.html[site initialization].
353
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700354[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
355+
356Time in seconds before an email verification token sent to a user in
357order to validate their email address expires.
358+
359* s, sec, second, seconds
360* m, min, minute, minutes
361* h, hr, hour, hours
362* d, day, days
363* w, week, weeks (`1 week` is treated as `7 days`)
364* mon, month, months (`1 month` is treated as `30 days`)
365* y, year, years (`1 year` is treated as `365 days`)
366
367+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800368Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700369
James E. Blairca8bc3b2011-12-21 18:12:26 +0000370[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
371+
David Pursehouse42f42042013-08-01 14:02:25 +0900372The SSO entry point URL. Only used if `auth.type` is set to
373`OpenID_SSO`.
James E. Blairca8bc3b2011-12-21 18:12:26 +0000374+
375The "Sign In" link will send users directly to this URL.
376
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700377[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700378+
379HTTP header to trust the username from, or unset to select HTTP basic
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100380authentication. Only used if `auth.type` is set to `HTTP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700381
Luca Milanesio384ed6c2013-07-30 09:10:07 +0100382[[auth.httpDisplaynameHeader]]auth.httpDisplaynameHeader::
383+
384HTTP header to retrieve the user's display name from. Only used if `auth.type`
385is set to `HTTP`.
386+
387If set, Gerrit trusts and enforces the user's full name using the HTTP header
388and disables the ability to manually modify the user's full name
389from the contact information page.
390
391[[auth.httpEmailHeader]]auth.httpEmailHeader::
392+
393HTTP header to retrieve the user's e-mail from. Only used if `auth.type`
394is set to `HTTP`.
395+
396If set, Gerrit trusts and enforces the user's e-mail using the HTTP header
397and disables the ability to manually modify or register other e-mails
398from the contact information page.
399
Luca Milanesio97d07352014-07-17 08:31:06 +0100400[[auth.httpExternalIdHeader]]auth.httpExternalIdHeader::
401+
402HTTP header to retrieve the user's external identification token.
403Only used if `auth.type` is set to `HTTP`.
404+
405If set, Gerrit adds the value contained in the HTTP header to the
406user's identity. Typical use is with a federated identity token from
407an external system (e.g. GitHub OAuth 2.0 authentication) where
408the user's auth token exchanged during authentication handshake
409needs to be used for authenticated communication to the external
410system later on.
411+
412Example: `auth.httpExternalIdHeader: X-GitHub-OTP`
413
Luca Milanesio5185b042013-07-27 22:03:06 +0100414[[auth.loginUrl]]auth.loginUrl::
415+
416URL to redirect a browser to after the end-user has clicked on the
David Pursehouse42f42042013-08-01 14:02:25 +0900417login link in the upper right corner. Only used if `auth.type` is set
418to `HTTP` or `HTTP_LDAP`.
Luca Milanesio5185b042013-07-27 22:03:06 +0100419Organizations using an enterprise single-sign-on solution may want to
420redirect the browser to the SSO product's sign-in page for completing the
421login process and validate their credentials.
422+
David Pursehouse42f42042013-08-01 14:02:25 +0900423If set, Gerrit allows anonymous access until the end-user performs the login
424and provides a trusted identity through the HTTP header.
Luca Milanesio5185b042013-07-27 22:03:06 +0100425If not set, Gerrit requires the HTTP header with a trusted identity
David Pursehouse42f42042013-08-01 14:02:25 +0900426and returns the error page 'LoginRedirect.html' if such a header is not
427present.
Luca Milanesio5185b042013-07-27 22:03:06 +0100428
429[[auth.loginText]]auth.loginText::
430+
David Pursehouse42f42042013-08-01 14:02:25 +0900431Text displayed in the loginUrl link. Only used if `auth.loginUrl` is set.
Luca Milanesio5185b042013-07-27 22:03:06 +0100432+
David Pursehouse42f42042013-08-01 14:02:25 +0900433If not set, the "Sign In" text is used.
Luca Milanesio5185b042013-07-27 22:03:06 +0100434
Luca Milanesio111e0b72013-08-15 18:56:42 +0100435[[auth.registerPageUrl]]auth.registerPageUrl::
436+
David Pursehouse268744b2013-08-17 15:32:11 +0900437URL of the registration page to use when a new user logs in to Gerrit for
438the first time. Used only when `auth.type` is set to `HTTP`.
Luca Milanesio111e0b72013-08-15 18:56:42 +0100439+
440If not set, the standard Gerrit registration page `/#/register/` is displayed.
441
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700442[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700443+
444URL to redirect a browser to after the end-user has clicked on the
445"Sign Out" link in the upper right corner. Organizations using an
446enterprise single-sign-on solution may want to redirect the browser
447to the SSO product's sign-out page.
448+
449If not set, the redirect returns to the list of all open changes.
450
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800451[[auth.registerUrl]]auth.registerUrl::
452+
453Target for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200454when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800455+
456If not set, no "Register" link is displayed.
457
Chad Horohoe65897082012-11-10 10:26:25 -0800458[[auth.registerText]]auth.registerText::
459+
460Text for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200461when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Chad Horohoe65897082012-11-10 10:26:25 -0800462+
463If not set, defaults to "Register".
464
David Pursehouse3d604492013-01-25 17:41:53 +0900465[[auth.editFullNameUrl]]auth.editFullNameUrl::
466+
467Target for the "Edit" button when the user is allowed to edit their
Edwin Kempin54093152015-05-08 10:50:35 +0200468full name. Used only when `auth.type` is `LDAP`, `LDAP_BIND` or
469`CUSTOM_EXTENSION`.
David Pursehouse3d604492013-01-25 17:41:53 +0900470
471[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
472+
David Pursehouse42f42042013-08-01 14:02:25 +0900473Target for the "Obtain Password" link. Used only when `auth.type` is
Edwin Kempin54093152015-05-08 10:50:35 +0200474`CUSTOM_EXTENSION`.
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700475
476[[auth.switchAccountUrl]]auth.switchAccountUrl::
David Pursehouse3d604492013-01-25 17:41:53 +0900477+
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700478URL to switch user identities and login as a different account than
479the currently active account. This is disabled by default except when
480`auth.type` is `OPENID` and `DEVELOPMENT_BECOME_ANY_ACCOUNT`. If set
481the "Switch Account" link is displayed next to "Sign Out".
482+
483When `auth.type` does not normally enable this URL administrators may
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700484set this to `login/`, allowing users to begin a new web session. This value
David Ostrovsky7163dac2017-07-29 06:49:38 +0200485is used as an href in PolyGerrit, so absolute URLs like
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700486`https://someotherhost/login` work as well.
487+
488If a ${path} parameter is included, then PolyGerrit will substitute the
489currently viewed path in the link. Be aware that this path will include
490a leading slash, so a value like this might be appropriate: `/login${path}`.
David Pursehouse3d604492013-01-25 17:41:53 +0900491
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000492[[auth.cookiePath]]auth.cookiePath::
493+
494Sets "path" attribute of the authentication cookie.
495+
496If not set, HTTP request's path is used.
497
Sammy Gillespie26873c02016-02-11 14:39:43 +0000498[[auth.cookieDomain]]auth.cookieDomain::
499+
500Sets "domain" attribute of the authentication cookie.
501+
502If not set, HTTP request's domain is used.
503
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000504[[auth.cookieSecure]]auth.cookieSecure::
505+
506Sets "secure" flag of the authentication cookie. If true, cookies
507will be transmitted only over HTTPS protocol.
508+
509By default, false.
510
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700511[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700512+
513Optional format string to construct user email addresses out of
David Pursehouse42f42042013-08-01 14:02:25 +0900514user login names. Only used if `auth.type` is `HTTP`, `HTTP_LDAP`
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700515or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700516+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700517This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700518with the login name. E.g. "\{0\}+gerrit@example.com" with a user
519login name of "foo" will produce "foo+gerrit@example.com" during
520the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700521+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700522If the site is using `HTTP_LDAP` or `LDAP`, using this option is
523discouraged. Setting `ldap.accountEmailAddress` and importing the
524email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700525
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700526[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700527+
528Controls whether or not the contributor agreement features are
529enabled for the Gerrit site. If enabled a user must complete a
530contributor agreement before they can upload changes.
531+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800532If enabled, the admin must also add one or more
533link:config-cla.html[contributor-agreement sections]
534in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700535`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700536more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700537+
538By default this is false (no agreements are used).
Fredrik Luthandera3cf3542012-07-04 16:55:35 -0700539+
540To enable the actual usage of contributor agreement the project
541specific config option in the `project.config` must be set:
542link:config-project-config.html[receive.requireContributorAgreement].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700543
Christian Halstricka3d88a52011-08-31 09:21:41 +0200544[[auth.trustContainerAuth]]auth.trustContainerAuth::
545+
546If true then it is the responsibility of the container hosting
547Gerrit to authenticate users. In this case Gerrit will blindly trust
548the container.
549+
550This parameter only affects git over http traffic. If set to false
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100551then Gerrit will do the authentication (using Basic authentication).
Christian Halstricka3d88a52011-08-31 09:21:41 +0200552+
553By default this is set to false.
554
Luca Milanesio42058842012-01-05 21:25:38 +0000555
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400556[[auth.gitBasicAuthPolicy]]auth.gitBasicAuthPolicy::
557+
David Pursehousef7a1c2a2017-08-25 19:12:54 +0900558When `auth.type` is `LDAP`, `LDAP_BIND` or `OAUTH`, it allows using either the generated
Luca Milanesio51edcb72017-03-06 11:59:55 +0000559HTTP password, the LDAP or OAUTH password, or a combination of HTTP and LDAP
560authentication, to authenticate Git over HTTP and REST API requests.
561The supported values are:
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400562+
563*`HTTP`
564+
David Pursehousee2920032017-08-25 19:12:21 +0900565Only the HTTP password is accepted when doing Git over HTTP and REST API requests.
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400566+
567*`LDAP`
568+
569Only the `LDAP` password is allowed when doing Git over HTTP and REST API
570requests.
571+
Luca Milanesio51edcb72017-03-06 11:59:55 +0000572*`OAUTH`
573+
David Pursehousee2920032017-08-25 19:12:21 +0900574Only the `OAUTH` authentication is allowed when doing Git over HTTP and REST API
Luca Milanesio51edcb72017-03-06 11:59:55 +0000575requests.
576+
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400577*`HTTP_LDAP`
578+
579The password in the request is first checked against the HTTP password and, if
580it does not match, it is then validated against the `LDAP` password.
581+
Luca Milanesio51edcb72017-03-06 11:59:55 +0000582By default this is set to `LDAP` when link:#auth.type[`auth.type`] is `LDAP`
583and `OAUTH` when link:#auth.type[`auth.type`] is `OAUTH`.
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400584Otherwise, the default value is `HTTP`.
Luca Milanesio1a918712021-05-06 20:20:48 +0100585+
586When gitBasicAuthPolicy is set to `LDAP` or `HTTP_LDAP` and the user
587is authenticating with the LDAP username/password, the Git client config
588needs to have `http.cookieFile` set to a local file, otherwise every
589single call would trigger a full LDAP authentication and groups resolution
590which could introduce a noticeable latency on the overall execution
591and produce unwanted load to the LDAP server.
592+
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200593[[auth.gitOAuthProvider]]auth.gitOAuthProvider::
594+
595Selects the OAuth 2 provider to authenticate git over HTTP traffic with.
596+
597In general there is no way to determine from an access token alone, which
598OAuth 2 provider to address to verify that token, and the BasicAuth
599scheme does not support amending such details. If multiple OAuth provider
600plugins in a system offer support for git over HTTP authentication site
601administrators must configure, which one to use as default provider.
602In case the provider cannot be determined from a request the access token
603will be sent to the default provider for verification.
604+
605The value of this parameter must be the identifier of an OAuth 2 provider
606in the form `plugin-name:provider-name`. Consult the respective plugin
607documentation for details.
608
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200609[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
610+
611If set the username that is received to authenticate a git operation
612is converted to lower case for looking up the user account in Gerrit.
613+
614By setting this parameter a case insensitive authentication for the
615git operations can be achieved, if it is ensured that the usernames in
616Gerrit (scheme `username`) are stored in lower case (e.g. if the
617parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
618set to `${sAMAccountName.toLowerCase}`). It is important that for all
619existing accounts this username is already in lower case. It is not
620possible to convert the usernames of the existing accounts to lower
621case because this would break the access to existing per-user
Thomas Draebing85510402021-03-15 08:03:00 +0100622branches and Gerrit provides no tool to do such a conversion. Accounts
623created using the REST API or the `create-account` SSH command will
624be created with all lowercase characters, when this option is set.
Edwin Kempine7ae45c2018-09-20 09:57:15 +0200625+
626Setting this parameter to `true` will prevent all users from login that
627have a non-lower-case username.
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200628+
629This parameter only affects git over http and git over SSH traffic.
630+
631By default this is set to false.
632
Shawn Pearcea931fe12013-06-11 12:29:17 -0700633[[auth.enableRunAs]]auth.enableRunAs::
634+
635If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
636header from any users granted the link:access-control.html#capability_runAs[Run As]
637capability. The header and capability permit the authenticated user
638to impersonate another account.
639+
640If false the feature is disabled and cannot be re-enabled without
641editing gerrit.config and restarting the server.
642+
643Default is true.
644
David Pursehouse21bd07b2015-11-27 00:15:42 +0900645[[auth.allowRegisterNewEmail]]auth.allowRegisterNewEmail::
646+
647Whether users are allowed to register new email addresses.
648+
649In addition for the HTTP authentication type
650link:#auth.httpemailheader[auth.httpemailheader] must *not* be set to
651enable registration of new email addresses.
652+
653By default, true.
654
Owen Lic24f7242017-06-14 10:04:00 -0400655[[auth.autoUpdateAccountActiveStatus]]auth.autoUpdateAccountActiveStatus::
656+
657Whether to allow automatic synchronization of an account's inactive flag upon login.
658If set to true, upon login, if the authentication back-end reports the account as active,
659the account's inactive flag in the internal Gerrit database will be updated to be active.
660If the authentication back-end reports the account as inactive, the account's flag will be
661updated to be inactive and the login attempt will be blocked. Users enabling this feature
662should ensure that their authentication back-end is supported. Currently, only
663strict 'LDAP' authentication is supported.
664+
Owen Lie2877bb2017-07-14 09:11:20 -0400665In addition, if this parameter is not set, or false, the corresponding scheduled
666task to deactivate inactive Gerrit accounts will also be disabled. If this
667parameter is set to true, users should also consider configuring the
668link:#accountDeactivation[accountDeactivation] section appropriately.
669+
Owen Lic24f7242017-06-14 10:04:00 -0400670By default, false.
671
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200672[[auth.skipFullRefEvaluationIfAllRefsAreVisible]]auth.skipFullRefEvaluationIfAllRefsAreVisible::
673+
674Whether to skip the full ref visibility checks as a performance shortcut when all refs are
675visible to a user. Full ref filtering would filter out things like pending edits.
676+
677By default, true.
678
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800679[[cache]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800680=== Section cache
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700681
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700682[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700683+
684Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700685future lookup. This local disk cache is used to retain potentially
686expensive to compute information across restarts. If the location
687does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700688+
David Pursehousea61ee502016-09-06 16:27:09 +0900689Technically, cached entities are persisted as a set of H2 databases
Saša Živkove607d6c2016-02-24 10:46:46 +0000690inside this directory.
691+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700692If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700693+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700694Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700695
Thomas Draebinge5dcc602020-04-20 15:40:54 +0200696[[cache.enableDiskStatMetrics]]cache.enableDiskStatMetrics::
697+
698Whether to enable the computation of disk statistics of persistent caches.
699This computation is expensive and requires a long time on larger installations.
700+
701By default, false.
702
Saša Živkovf3134572016-02-09 11:42:46 +0100703[[cache.h2CacheSize]]cache.h2CacheSize::
704+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200705The size of the in-memory cache for each opened H2 cache database, in bytes.
Saša Živkove607d6c2016-02-24 10:46:46 +0000706+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200707Some caches of Gerrit are persistent and are backed by an H2 database.
Saša Živkove607d6c2016-02-24 10:46:46 +0000708H2 uses memory to cache its database content. The parameter `h2CacheSize`
709allows to limit the memory used by H2 and thus prevent out-of-memory
Saša Živkovf3134572016-02-09 11:42:46 +0100710caused by the H2 database using too much memory.
711+
Dave Borowitz3d1f85c2018-11-16 15:36:04 -0800712Technically the H2 cache size is configured using the CACHE_SIZE parameter in
713the H2 JDBC connection URL, as described
714link:http://www.h2database.com/html/features.html#cache_settings[here]
Saša Živkovf3134572016-02-09 11:42:46 +0100715+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200716Default is unset, using up to half of the available memory.
David Pursehousee6976dc2017-06-30 16:33:44 +0900717+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200718H2 will persist this value in the database, so to unset explicitly specify 0.
Saša Živkovf3134572016-02-09 11:42:46 +0100719+
720Common unit suffixes of 'k', 'm', or 'g' are supported.
721
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200722[[cache.h2AutoServer]]cache.h2AutoServer::
723+
724If set to true, enable H2 autoserver mode for the H2-backed persistent cache
725databases.
726+
727See link:http://www.h2database.com/html/features.html#auto_mixed_mode[here]
728for detail.
729+
730Default is false.
731
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700732[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700733+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700734Maximum age to keep an entry in the cache. Entries are removed from
735the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700736Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700737+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700738* s, sec, second, seconds
739* m, min, minute, minutes
740* h, hr, hour, hours
741* d, day, days
742* w, week, weeks (`1 week` is treated as `7 days`)
743* mon, month, months (`1 month` is treated as `30 days`)
744* y, year, years (`1 year` is treated as `365 days`)
745
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700746+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200747--
Edwin Kempinabcd5042013-03-12 16:04:37 +0100748If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700749supplied, the maximum age is infinite and items are never purged
750except when the cache is full.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200751
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700752Default is `0`, meaning store forever with no expire, except:
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200753
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400754* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700755* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700756* `"web_sessions"`: default is `12 hours`
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200757--
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700758
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700759[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700760+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700761The total cost of entries to retain in memory. The cost computation
762varies by the cache. For most caches where the in-memory size of each
763entry is relatively the same, memoryLimit is currently defined to be
764the number of entries held by the cache (each entry costs 1).
765+
766For caches where the size of an entry can vary significantly between
767individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
768is an approximation of the total number of bytes stored by the cache.
769Larger entries that represent bigger patch sets or longer source files
770will consume a bigger portion of the memoryLimit. For these caches the
771memoryLimit should be set to roughly the amount of RAM (in bytes) the
772administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700773+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700774Default is 1024 for most caches, except:
775+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400776* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700777* `"diff"`: default is `10m` (10 MiB of memory)
778* `"diff_intraline"`: default is `10m` (10 MiB of memory)
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200779* `"diff_summary"`: default is `10m` (10 MiB of memory)
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400780* `"external_ids_map"`: default is `2` and should not be changed
Edwin Kempind967ec42017-11-13 15:14:41 +0100781* `"groups"`: default is unlimited
782* `"groups_byname"`: default is unlimited
783* `"groups_byuuid"`: default is unlimited
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700784* `"plugin_resources"`: default is 2m (2 MiB of memory)
785
786+
787If set to 0 the cache is disabled. Entries are removed immediately
788after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700789
Dave Borowitz08bac5ca2018-06-05 14:58:28 -0400790[[cache.name.expireFromMemoryAfterAccess]]cache.<name>.expireFromMemoryAfterAccess::
791+
792Time after last access to automatically expire entries from an in-memory
793cache. If 0 or not specified, entries are never expired in this manner.
794Values may use unit suffixes as in link:#cache.name.maxAge[maxAge].
795+
796This option only applies to in-memory caches; persistent cache values are
797not expired in this manner, and are only pruned via
798link:#cache.name.diskLimit[diskLimit].
799
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700800[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700801+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700802Total size in bytes of the keys and values stored on disk. Caches that
803have grown bigger than this size are scanned daily at 1 AM local
804server time to trim the cache. Entries are removed in least recently
805accessed order until the cache fits within this limit. Caches may
806grow larger than this during the day, as the size check is only
807performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700808+
Saša Živkove789f2e2016-09-22 10:37:34 +0200809Default is 128 MiB per cache, except:
810+
Dave Borowitzbab45862018-05-01 12:31:48 -0400811* `"change_notes"`: disk storage is disabled by default
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200812* `"diff_summary"`: default is `1g` (1 GiB of disk space)
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700813* `"external_ids_map"`: disk storage is disabled by default
Saša Živkove789f2e2016-09-22 10:37:34 +0200814
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700815+
Dave Borowitzdab51552018-05-14 16:35:37 -0700816If 0 or negative, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700817
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800818==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700819
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700820cache `"accounts"`::
821+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700822Cache entries contain important details of an active user, including
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +0200823their display name, preferences, and known email addresses. Entry
Dave Borowitzada289c2018-12-18 13:24:14 -0800824information is obtained from NoteDb data in the `All-Users` repo.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700825
826+
Dave Borowitzada289c2018-12-18 13:24:14 -0800827If direct updates are made to `All-Users`, this cache should be flushed.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700828
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400829cache `"adv_bases"`::
830+
831Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900832are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400833for the client to use as potential delta bases. Push over smart HTTP
834requires two HTTP requests, and this cache tries to carry state from
835the first request into the second to ensure it can complete.
836
Patrick Hieselace3dc92019-01-15 14:08:13 +0000837cache `"changes"`::
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200838+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200839The size of `memoryLimit` determines the number of projects for which
840all changes will be cached. If the cache is set to 1024, this means all
Patrick Hieselace3dc92019-01-15 14:08:13 +0000841changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800842+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000843Default value is 0 (disabled). It is disabled by default due to the fact
844that change updates are not communicated between Gerrit servers. Hence
Matthias Sohnd8182ba2019-12-09 14:50:23 +0100845this cache should be disabled in a cluster setup using multiple primary
846or multiple replica nodes.
Gustaf Lundh53493772012-11-18 18:41:15 -0800847+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000848The cache should be flushed whenever the database changes table is modified
849outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200850
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700851cache `"diff"`::
852+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700853Each item caches the differences between two commits, at both the
854directory and file levels. Gerrit uses this cache to accelerate
855the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700856+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700857Entries in this cache are relatively large, so memoryLimit is an
858estimate in bytes of memory used. Administrators should try to target
859cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
860day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700861
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400862cache `"diff_intraline"`::
863+
864Each item caches the intraline difference of one file, when compared
865between two commits. Gerrit uses this cache to accelerate display of
866intraline differences when viewing a file.
867+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700868Entries in this cache are relatively large, so memoryLimit is an
869estimate in bytes of memory used. Administrators should try to target
870cache.diff.memoryLimit to fit all files users will view in a 1 or 2
871day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400872
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200873cache `"diff_summary"`::
Saša Živkove789f2e2016-09-22 10:37:34 +0200874+
875Each item caches list of file paths which are different between two
876commits. Gerrit uses this cache to accelerate computing of the list
877of paths of changed files.
878+
879Ideally, disk limit of this cache is large enough to cover all changes.
880This should significantly speed up change reindexing, especially
881full offline reindexing.
882
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400883cache `"external_ids_map"`::
884+
885A singleton cache whose sole entry is a map of the parsed representation
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400886of link:config-accounts.html#external-ids[all current external IDs]. The
887cache may temporarily contain 2 entries, but the second one is promptly
888expired.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400889+
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700890It is not recommended to change the in-memory attributes of this cache
891away from the defaults. The cache may be persisted by setting
892`diskLimit`, which is only recommended if cold start performance is
893problematic.
Patrick Hiesel42b47b12019-07-22 09:32:37 +0200894+
895`external_ids_map` supports computing the new cache value based on a
896previously cached state. This applies modifications based on the Git
897diff and is almost always faster.
898`cache.external_ids_map.enablePartialReloads` turns this behavior on
Patrick Hieselc486edf2019-08-19 15:55:17 +0200899or off. The default is `true`.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400900
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700901cache `"git_tags"`::
902+
903If branch or reference level READ access controls are used, this
904cache tracks which tags are reachable from the branch tips of a
905repository. Gerrit uses this information to determine the set
906of tags that a client may access, derived from which tags are
907part of the history of a visible branch.
908+
909The cache is persisted to disk across server restarts as it can
910be expensive to compute (60 or more seconds for a large history
911like the Linux kernel repository).
912
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700913cache `"groups"`::
914+
Edwin Kempin3091e112017-11-13 15:23:58 +0100915Caches the basic group information of internal groups by group ID,
916including the group owner, name, and description.
917+
Edwin Kempind967ec42017-11-13 15:14:41 +0100918For this cache it is important to configure a size that is larger than
919the number of internal Gerrit groups, otherwise general Gerrit
920performance may be poor. This is why by default this cache is
921unlimited.
922+
Edwin Kempin3091e112017-11-13 15:23:58 +0100923External group membership obtained from LDAP is cached under
924`"ldap_groups"`.
925
926cache `"groups_byname"`::
927+
928Caches the basic group information of internal groups by group name,
929including the group owner, name, and description.
930+
Edwin Kempind967ec42017-11-13 15:14:41 +0100931For this cache it is important to configure a size that is larger than
932the number of internal Gerrit groups, otherwise general Gerrit
933performance may be poor. This is why by default this cache is
934unlimited.
935+
Edwin Kempin3091e112017-11-13 15:23:58 +0100936External group membership obtained from LDAP is cached under
937`"ldap_groups"`.
938
939cache `"groups_byuuid"`::
940+
941Caches the basic group information of internal groups by group UUID,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700942including the group owner, name, and description.
943+
Edwin Kempind967ec42017-11-13 15:14:41 +0100944For this cache it is important to configure a size that is larger than
945the number of internal Gerrit groups, otherwise general Gerrit
946performance may be poor. This is why by default this cache is
947unlimited.
948+
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +0200949External group membership obtained from LDAP is cached under
950`"ldap_groups"`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700951
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +0200952cache `"groups_bymember"`::
Matt Fischer620255a2011-03-22 14:28:23 -0500953+
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +0200954Caches the groups which contain a specific member (account). If direct
955updates are made to the `account_group_members` table, this cache should
956be flushed.
957
Alice Kober-Sotzek3e1fe1b2017-10-12 14:44:17 +0200958cache `"groups_bysubgroups"`::
959+
960Caches the parent groups of a subgroup. If direct updates are made
Matt Fischer620255a2011-03-22 14:28:23 -0500961to the `account_group_includes` table, this cache should be flushed.
962
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700963cache `"ldap_groups"`::
964+
965Caches the LDAP groups that a user belongs to, if LDAP has been
966configured on this server. This cache should be configured with a
967low maxAge setting, to ensure LDAP modifications are picked up in
968a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700969
Gustaf Lundh0919a492012-10-19 15:29:23 +0200970cache `"ldap_groups_byinclude"`::
971+
972Caches the hierarchical structure of LDAP groups.
973
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -0700974cache `"ldap_usernames"`::
975+
976Caches a mapping of LDAP username to Gerrit account identity. The
977cache automatically updates when a user first creates their account
978within Gerrit, so the cache expire time is largely irrelevant.
979
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700980cache `"permission_sort"`::
981+
David Pursehouse221d4f62012-06-08 17:38:08 +0900982Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700983reference. Sorting the sections can be expensive when regular
984expressions are used, so this cache remembers the ordering for
985each branch.
986
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700987cache `"plugin_resources"`::
988+
989Caches formatted plugin resources, such as plugin documentation that
990has been converted from Markdown to HTML. The memoryLimit refers to
991the bytes of memory dedicated to storing the documentation.
992
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700993cache `"projects"`::
994+
995Caches the project description records, from the `projects` table
996in the database. If a project record is updated or deleted, this
997cache should be flushed. Newly inserted projects do not require
998a cache flush, as they will be read upon first reference.
999
Dave Borowitz08aa8bb2018-04-05 12:01:06 -04001000cache `"prolog_rules"`::
1001+
1002Caches parsed `rules.pl` contents for each project. This cache uses the same
1003size as the `projects` cache, and cannot be configured independently.
1004
Patrick Hiesela57c0d62019-02-19 09:09:22 +01001005cache `"pure_revert"`::
1006+
1007Result of checking if one change or commit is a pure/clean revert of
1008another.
1009
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001010cache `"sshkeys"`::
1011+
1012Caches unpacked versions of user SSH keys, so the internal SSH daemon
1013can match against them during authentication. The unit of storage
1014is per-user, so 1024 items translates to 1024 unique user accounts.
1015As each individual user account may configure multiple SSH keys,
1016the total number of keys may be larger than the item count.
1017
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001018cache `"web_sessions"`::
1019+
1020Tracks the live user sessions coming in over HTTP. Flushing this
1021cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -07001022them to sign-in again. To avoid breaking active users, this cache
1023is not flushed automatically by `gerrit flush-caches --all`, but
1024instead must be explicitly requested.
1025+
1026If no disk cache is configured (or `cache.web_sessions.diskLimit`
1027is set to 0) a server restart will force all users to sign-out,
1028and need to sign-in again after the restart, as the cache was
1029unable to persist the session information. Enabling a disk cache
1030is strongly recommended.
1031+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001032Session storage is relatively inexpensive. The average entry in
1033this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001034
Shawn O. Pearce4016a932009-05-28 15:12:40 -07001035See also link:cmd-flush-caches.html[gerrit flush-caches].
1036
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001037==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001038
Hugo Arès2bc86812015-03-09 15:20:28 -04001039[[cache.diff.timeout]]cache.diff.timeout::
1040+
1041Maximum number of milliseconds to wait for diff data before giving up and
1042falling back on a simpler diff algorithm that will not be able to break down
1043modified regions into smaller ones. This is a work around for an infinite loop
1044bug in the default difference algorithm implementation.
1045+
1046Values should use common unit suffixes to express their setting:
1047+
1048* ms, milliseconds
1049* s, sec, second, seconds
1050* m, min, minute, minutes
1051* h, hr, hour, hours
1052
1053+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001054--
Hugo Arès2bc86812015-03-09 15:20:28 -04001055If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001056
Hugo Arès2bc86812015-03-09 15:20:28 -04001057Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001058--
Hugo Arès2bc86812015-03-09 15:20:28 -04001059
Edwin Kempin42d27432013-11-24 17:06:24 +01001060[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001061+
1062Maximum number of milliseconds to wait for intraline difference data
1063before giving up and disabling it for a particular file pair. This is
1064a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +09001065implementation.
1066+
1067If computation takes longer than the timeout, the worker thread is
1068terminated, an error message is shown, and no intraline difference is
1069displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001070+
1071Values should use common unit suffixes to express their setting:
1072+
1073* ms, milliseconds
1074* s, sec, second, seconds
1075* m, min, minute, minutes
1076* h, hr, hour, hours
1077
1078+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001079--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001080If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001081
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001082Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001083--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001084
Edwin Kempin42d27432013-11-24 17:06:24 +01001085[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001086+
1087Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001088when populating a diff cache entry. This flag is provided primarily
1089as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +09001090necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001091this setting will fallback to `cache.diff.intraline` if not set in the
1092configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001093+
1094Default is true, enabled.
1095
Edwin Kempin42d27432013-11-24 17:06:24 +01001096[[cache.projects.checkFrequency]]cache.projects.checkFrequency::
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -07001097+
1098How often project configuration should be checked for update from Git.
1099Gerrit Code Review caches project access rules and configuration in
1100memory, checking the refs/meta/config branch every checkFrequency
1101minutes to see if a new revision should be loaded and used for future
1102access. Values can be specified using standard time unit abbreviations
1103('ms', 'sec', 'min', etc.).
1104+
1105If set to 0, checks occur every time, which may slow down operations.
Shawn Pearcec825ef12013-02-20 11:29:46 -08001106If set to 'disabled' or 'off', no check will ever be done.
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -07001107Administrators may force the cache to flush with
1108link:cmd-flush-caches.html[gerrit flush-caches].
1109+
1110Default is 5 minutes.
1111
Simon Leifc19ff12014-10-02 13:36:00 -04001112[[cache.projects.loadOnStartup]]cache.projects.loadOnStartup::
1113+
1114If the project cache should be loaded during server startup.
1115+
1116The cache is loaded concurrently. Admins should ensure that the cache
1117size set under <<cache.name.memoryLimit,cache.projects.memoryLimit>>
1118is not smaller than the number of repos.
1119+
1120Default is false, disabled.
1121
1122[[cache.projects.loadThreads]]cache.projects.loadThreads::
1123+
1124Only relevant if <<cache.projects.loadOnStartup,cache.projects.loadOnStartup>>
1125is true.
1126+
1127The number of threads to allocate for loading the cache at startup. These
1128threads will die out after the cache is loaded.
1129+
1130Default is the number of CPUs.
1131
Shawn Pearce67a33302016-08-11 11:51:59 -07001132
1133[[capability]]
1134=== Section capability
1135
1136[[capability.administrateServer]]capability.administrateServer::
1137+
1138Names of groups of users that are allowed to exercise the
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001139`administrateServer` capability, in addition to those listed in
Shawn Pearce67a33302016-08-11 11:51:59 -07001140All-Projects. Configuring this option can be a useful fail-safe
1141to recover a server in the event an administrator removed all
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001142groups from the `administrateServer` capability, or to ensure that
Shawn Pearce67a33302016-08-11 11:51:59 -07001143specific groups always have administration capabilities.
1144+
1145----
1146[capability]
1147 administrateServer = group Fail Safe Admins
1148----
1149+
1150The configuration file uses group names, not UUIDs. If a group is
1151renamed the gerrit.config file must be updated to reflect the new
1152name. If a group cannot be found for the configured name a warning
1153is logged and the server will continue normal startup.
1154+
1155If not specified (default), only the groups listed by All-Projects
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001156may use the `administrateServer` capability.
1157
1158[[capability.makeFirstUserAdmin]]capability.makeFirstUserAdmin::
1159+
1160Whether the first user that logs in to the Gerrit server should
1161automatically be added to the administrator group and hence get the
1162`administrateServer` capability assigned. This is useful to bootstrap
1163the authentication database.
1164+
1165Default is true.
Shawn Pearce67a33302016-08-11 11:51:59 -07001166
1167
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001168[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001169=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -07001170
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001171[[change.allowBlame]]change.allowBlame::
1172+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001173Allow blame on side by side diff. If set to false, blame cannot be used.
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001174+
1175Default is true.
1176
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001177[[change.api.excludeMergeableInChangeInfo]]change.api.excludeMergeableInChangeInfo::
David Ostrovskyd1cb9182018-05-07 08:24:05 +02001178+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001179If true, the mergeability bit in
1180link:rest-api-changes.html#change-info[ChangeInfo] will never be set. It can
1181be requested separately through the
1182link:rest-api-changes.html#get-mergeable[get-mergeable] endpoint.
David Ostrovskyd1cb9182018-05-07 08:24:05 +02001183+
1184Default is false.
1185
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001186[[change.cacheAutomerge]]change.cacheAutomerge::
1187+
Sven Selberg0299e252020-05-05 16:16:41 +02001188When reviewing merge commits, the left-hand side shows the output of the
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001189result of JGit's automatic merge algorithm. This option controls whether
1190this output is cached in the change repository, or if only the diff is
1191cached in the persistent `diff` cache.
1192+
1193If true, automerge results are stored in the repository under
1194`refs/cache-automerge/*`; the results of diffing the change against its
1195automerge base are stored in the diff cache. If false, no extra data is
1196stored in the repository, only the diff cache. This can result in slight
1197performance improvements by reducing the number of refs in the repo.
1198+
1199Default is true.
1200
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001201[[change.disablePrivateChanges]]change.disablePrivateChanges::
Patrick Hieseldb8df482019-01-24 10:11:23 +01001202+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001203If set to true, users are not allowed to create private changes.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001204+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001205The default is false.
1206
1207[[change.largeChange]]change.largeChange::
1208+
1209Number of changed lines from which on a change is considered as a large
1210change. The number of changed lines of a change is the sum of the lines
1211that were inserted and deleted in the change.
1212+
1213The specified value is used to visualize the change sizes in the Web UI
1214in change tables and user dashboards.
1215+
1216By default 500.
1217
Dave Borowitzca614bc2019-04-15 15:29:15 -07001218[[change.maxUpdates]]change.maxUpdates::
1219+
1220Maximum number of updates to a change. Counts only updates to the main NoteDb
1221meta ref; draft comments, robot comments, stars, etc. do not count towards the
1222total.
1223+
1224Many NoteDb operations require walking the entire change meta ref and loading
1225its contents into memory, so changes with arbitrarily many updates may cause
1226high CPU usage, memory pressure, persistent cache bloat, and other problems.
1227+
Dave Borowitz18e7b552019-04-17 07:53:38 -07001228The following operations are allowed even when a change is at the limit:
1229* Abandon
1230* Submit
1231* Submit by push with `%submit`
1232* Auto-close by pushing directly to the branch
1233* Fix with link:rest-api-changes.html#fix-input[`expect_merged_as`]
1234+
Dave Borowitzca614bc2019-04-15 15:29:15 -07001235By default 1000.
1236
Edwin Kempin67229a42019-10-08 09:13:34 +02001237[[change.move]]change.move::
1238+
1239Whether the link:rest-api-changes.html#move-change[Move Change] REST
1240endpoint is enabled.
1241+
1242The move change functionality has some corner cases with undesired side
1243effects. Hence administrators may decide to disable this functionality.
1244In particular, if a change that has dependencies on other changes is
1245moved to a new branch, and the moved change gets submitted to the new
1246branch, the changes on which the change depends are silently merged
1247into the new branch, although these changes have not been moved to that
1248branch (see details in
1249link:https://bugs.chromium.org/p/gerrit/issues/detail?id=9877[issue
12509877]).
1251+
1252By default true.
1253
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001254[[change.replyLabel]]change.replyLabel::
1255+
1256Label name for the reply button. In the user interface an ellipsis (…)
1257is appended.
1258+
1259Default is "Reply". In the user interface it becomes "Reply…".
1260
1261[[change.replyTooltip]]change.replyTooltip::
1262+
1263Tooltip for the reply button. In the user interface a note about the
1264keyboard shortcut is appended.
1265+
1266Default is "Reply and score". In the user interface it becomes "Reply
1267and score (Shortcut: a)".
1268
1269[[change.robotCommentSizeLimit]]change.robotCommentSizeLimit::
1270+
1271Maximum allowed size of a robot comment that will be accepted. Robot comments
1272which exceed the indicated size will be rejected on addition. The specified
1273value is interpreted as the maximum size in bytes of the JSON representation of
1274the robot comment. Common unit suffixes of 'k', 'm', or 'g' are supported.
1275Zero or negative values allow robot comments of unlimited size.
1276+
1277The default limit is 1024kB.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001278
Luca Milanesiof2a275b2017-04-10 10:59:34 +01001279[[change.showAssigneeInChangesTable]]change.showAssigneeInChangesTable::
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001280+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001281Show assignee field in changes table. If set to false, assignees will
1282not be visible in changes table.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001283+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001284Default is false.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001285
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001286[[change.strictLabels]]change.strictLabels::
1287+
1288Reject invalid label votes: invalid labels or invalid values. This
David Pursehouse33495ab2019-10-31 09:38:43 +09001289configuration option is provided for backwards compatibility and may
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001290be removed in future gerrit versions.
1291+
1292Default is false.
1293
David Ostrovsky9933eb32014-05-20 16:08:20 +02001294[[change.submitLabel]]change.submitLabel::
1295+
1296Label name for the submit button.
1297+
1298Default is "Submit".
1299
Stefan Beller7c380d512015-08-21 10:55:21 -07001300[[change.submitLabelWithParents]]change.submitLabelWithParents::
1301+
1302Label name for the submit button if the change has parents which will
1303be submitted together with this change.
1304+
1305Default is "Submit including parents".
1306
David Ostrovsky9933eb32014-05-20 16:08:20 +02001307[[change.submitTooltip]]change.submitTooltip::
1308+
1309Tooltip for the submit button. Variables available for replacement
1310include `${patchSet}` for the current patch set number (1, 2, 3),
1311`${branch}` for the branch name ("master") and `${commit}` for the
1312abbreviated commit SHA-1 (`c9c0edb`).
1313+
1314Default is "Submit patch set ${patchSet} into ${branch}".
1315
Stefan Beller0e655542015-07-20 21:14:38 -07001316[[change.submitTooltipAncestors]]change.submitTooltipAncestors::
1317+
1318Tooltip for the submit button if there are ancestors which would
1319also be submitted by submitting the change. Additionally to the variables
1320as in link:#change.submitTooltip[change.submitTooltip], there is the
1321variable `${submitSize}` indicating the number of changes which are
1322submitted.
1323+
1324Default is "Submit all ${topicSize} changes of the same topic (${submitSize}
1325changes including ancestors and other changes related by topic)".
1326
Stefan Bellera038cf72015-01-13 16:25:10 -08001327[[change.submitTopicLabel]]change.submitTopicLabel::
1328+
1329If `change.submitWholeTopic` is set and a change has a topic,
1330the label name for the submit button is given here instead of
1331the configuration `change.submitLabel`.
1332+
1333Defaults to "Submit whole topic"
1334
1335[[change.submitTopicTooltip]]change.submitTopicTooltip::
1336+
David Pursehousea61ee502016-09-06 16:27:09 +09001337If `change.submitWholeTopic` is configured to true and a change has a
Stefan Bellera038cf72015-01-13 16:25:10 -08001338topic, this configuration determines the tooltip for the submit button
1339instead of `change.submitTooltip`. The variable `${topicSize}` is available
Stefan Beller7c380d512015-08-21 10:55:21 -07001340for the number of changes in the same topic to be submitted. The number of
1341all changes to be submitted is in the variable `${submitSize}`.
Stefan Bellera038cf72015-01-13 16:25:10 -08001342+
Stefan Beller7c380d512015-08-21 10:55:21 -07001343Defaults to "Submit all ${topicSize} changes of the same topic
1344(${submitSize} changes including ancestors and other
1345changes related by topic)".
Stefan Bellera038cf72015-01-13 16:25:10 -08001346
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001347[[change.submitWholeTopic]]change.submitWholeTopic::
Richard Möhne4abe9a2014-11-13 20:05:13 +01001348+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001349Determines if the submit button submits the whole topic instead of
1350just the current change.
David Ostrovskya304aff2018-04-05 23:07:51 +02001351+
1352Default is false.
1353
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001354[[change.updateDelay]]change.updateDelay::
Changcheng Xiao16095352017-12-18 10:03:08 +01001355+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001356How often in seconds the web interface should poll for updates to the
1357currently open change. The poller relies on the client's browser
1358cache to use If-Modified-Since and respect `304 Not Modified` HTTP
1359responses. This allows for fast polls, often under 8 milliseconds.
Changcheng Xiao16095352017-12-18 10:03:08 +01001360+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001361With a configured 30 second delay a server with 4900 active users will
1362typically need to dedicate 1 CPU to the update check. 4900 users
1363divided by an average delay of 30 seconds is 163 requests arriving per
1364second. If requests are served at \~6 ms response time, 1 CPU is
1365necessary to keep up with the update request traffic. On a smaller
1366user base of 500 active users, the default 30 second delay is only 17
1367requests per second and requires ~10% CPU.
1368+
1369If 0 the update polling is disabled.
1370+
1371Default is 5 minutes.
Changcheng Xiao16095352017-12-18 10:03:08 +01001372
Edwin Kempine326a1d2015-06-03 10:27:39 +02001373[[changeCleanup]]
1374=== Section changeCleanup
1375
1376This section allows to configure change cleanups and schedules them to
1377run periodically.
1378
1379[[changeCleanup.abandonAfter]]changeCleanup.abandonAfter::
1380+
1381Period of inactivity after which open changes should be abandoned
1382automatically.
1383+
1384By default `0`, never abandon open changes.
1385+
1386[WARNING] Auto-Abandoning changes may confuse/annoy users. When
1387enabling this, make sure to choose a reasonably large grace period and
1388inform users in advance.
1389+
1390The following suffixes are supported to define the time unit:
1391+
1392* `d, day, days`
1393* `w, week, weeks` (`1 week` is treated as `7 days`)
1394* `mon, month, months` (`1 month` is treated as `30 days`)
1395* `y, year, years` (`1 year` is treated as `365 days`)
1396
Edwin Kempin7080ef12015-06-10 15:03:09 +02001397[[changeCleanup.abandonIfMergeable]]changeCleanup.abandonIfMergeable::
1398+
1399Whether changes which are mergeable should be auto-abandoned.
1400+
1401By default `true`.
1402
Jacek Centkowski36d35212019-05-13 14:32:00 +02001403[[changeCleanup.cleanupAccountPatchReview]]changeCleanup.cleanupAccountPatchReview::
1404+
1405Whether accountPatchReview data should be also removed when change
1406gets auto-abandoned.
1407+
1408By default `false`.
1409
Edwin Kempine326a1d2015-06-03 10:27:39 +02001410[[changeCleanup.abandonMessage]]changeCleanup.abandonMessage::
1411+
1412Change message that should be posted when a change is abandoned.
1413+
1414'${URL}' can be used as a placeholder for the Gerrit web URL.
1415+
1416By default "Auto-Abandoned due to inactivity, see
1417${URL}Documentation/user-change-cleanup.html#auto-abandon\n\n
1418If this change is still wanted it should be restored.".
1419
1420[[changeCleanup.startTime]]changeCleanup.startTime::
1421+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001422The link:#schedule-configuration-startTime[start time] for running
1423change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001424
1425[[changeCleanup.interval]]changeCleanup.interval::
1426+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001427The link:#schedule-configuration-interval[interval] for running
1428change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001429
Edwin Kempind33d95a2018-02-16 11:44:04 +01001430link:#schedule-configuration-examples[Schedule examples] can be found
1431in the link:#schedule-configuration[Schedule Configuration] section.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001432
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001433[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001434=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001435
Brad Larson991a31b2009-11-03 14:30:26 -06001436Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -05001437patch comments, in-line code comments and approval category value descriptions
1438to turn set strings into hyperlinks. One common use is for linking to
1439bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -06001440
1441In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001442will match typical Gerrit Change-Id values and create a hyperlink
1443to changes which reference it. The second configuration 'bugzilla'
1444will hyperlink terms such as 'bug 42' to an external bug tracker,
1445supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +09001446configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001447how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -06001448
Sven Selberg2a0beab2018-04-20 14:49:20 +02001449commentlinks supports link:#reloadConfig[configuration reloads]. Though a
Gustaf Lundhca7eb792018-04-16 10:56:03 +02001450link:cmd-flush-caches.html[flush-caches] of "projects" is needed for the
1451commentlinks to be immediately available in the UI.
1452
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001453----
1454[commentlink "changeid"]
1455 match = (I[0-9a-f]{8,40})
David Pursehouse9f68e1a2016-01-28 09:21:03 +00001456 link = "#/q/$1"
Brad Larson991a31b2009-11-03 14:30:26 -06001457
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001458[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001459 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001460 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -06001461
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001462[commentlink "tracker"]
1463 match = ([Bb]ug:\\s+)(\\d+)
1464 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
1465----
1466
Dave Borowitz13b38002013-04-08 12:03:29 -07001467Comment links can also be specified in `project.config` and sections in
1468children override those in parents. The only restriction is that to
1469avoid injecting arbitrary user-supplied HTML in the page, comment links
1470defined in `project.config` may only supply `link`, not `html`.
1471
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001472[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -06001473+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001474A JavaScript regular expression to match positions to be replaced
1475with a hyperlink. Subexpressions of the matched string can be
1476stored using groups and accessed with `$'n'` syntax, where 'n'
1477is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -06001478+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001479The configuration file parser eats one level of backslashes, so the
1480character class `\s` requires `\\s` in the configuration file. The
1481parser also terminates the line at the first `#`, so a match
1482expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001483+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -08001484To match case insensitive strings, a character class with both the
1485upper and lower case character for each position must be used. For
1486example, to match the string `bug` in a case insensitive way the match
1487pattern `[bB][uU][gG]` needs to be used.
1488+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001489The commentlink.name.match regular expressions are applied to the raw,
1490unformatted and unescaped text form. Regex matching against HTML is not
1491supported. Comment link patterns that are written in this style should
1492be updated to match text formats.
Matthew Webbercd7d2bf2015-10-14 15:54:06 +01001493+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001494A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -06001495
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001496[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -06001497+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001498The URL to direct the user to whenever the regular expression is
1499matched. Groups in the match expression may be accessed as `$'n'`.
1500+
1501The link property is used only when the html property is not present.
1502
1503[[commentlink.name.html]]commentlink.<name>.html::
1504+
1505HTML to replace the entire matched string with. If present,
1506this property overrides the link property above. Groups in the
1507match expression may be accessed as `$'n'`.
1508+
1509The configuration file eats double quotes, so escaping them as
1510`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -06001511
Dave Borowitz82d79c02013-04-08 15:45:12 -07001512[[commentlink.name.enabled]]commentlink.<name>.enabled::
1513+
1514Whether the comment link is enabled. A child project may override a
1515section in a parent or the site-wide config that is disabled by
1516specifying `enabled = true`.
1517+
1518Disabling sections in `gerrit.config` can be used by site administrators
1519to create a library of comment links with `html` set that are not
1520user-supplied and thus can be verified to be XSS-free, but are only
1521enabled for a subset of projects.
1522+
David Pursehouse6f1af472013-12-11 19:23:33 +09001523By default, true.
1524+
Dave Borowitz82d79c02013-04-08 15:45:12 -07001525Note that the names and contents of disabled sections are visible even
1526to anonymous users via the
1527link:rest-api-projects.html#get-config[REST API].
1528
Brad Larson991a31b2009-11-03 14:30:26 -06001529
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001530[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001531=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001532
1533These settings are applied only if Gerrit is started as the container
1534process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
1535
1536[[container.heapLimit]]container.heapLimit::
1537+
1538Maximum heap size of the Java process running Gerrit, in bytes.
1539This property is translated into the '-Xmx' flag for the JVM.
1540+
1541Default is platform and JVM specific.
1542+
1543Common unit suffixes of 'k', 'm', or 'g' are supported.
1544
1545[[container.javaHome]]container.javaHome::
1546+
1547Path of the JRE/JDK installation to run Gerrit with. If not set, the
1548Gerrit startup script will attempt to search your system and guess
1549a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
1550
1551[[container.javaOptions]]container.javaOptions::
1552+
David Pursehousea13052b2020-02-10 14:26:08 +09001553Additional options to pass along to the Java runtime. May be specified
1554multiple times to configure multiple values. If multiple values are
1555configured, they are passed in order on the command line, separated by
1556spaces. These options are appended onto 'JAVA_OPTIONS'.
David Pursehousea70a60c2020-02-10 14:22:43 +09001557+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001558For example, it is possible to overwrite Gerrit's default log4j
1559configuration:
David Pursehousea70a60c2020-02-10 14:22:43 +09001560+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001561----
1562 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
1563----
1564
Hugo Arès6710f0a2014-11-04 10:28:42 -05001565[[container.daemonOpt]]container.daemonOpt::
1566+
1567Additional options to pass to the daemon (e.g. '--enable-httpd'). If
1568multiple values are configured, they are passed in that order to the command
1569line, separated by spaces.
1570+
1571Execute `java -jar gerrit.war daemon --help` to see all possible
1572options.
1573
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001574[[container.replica]]container.replica::
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001575+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02001576Used on Gerrit replica installations. If set to true the Gerrit JVM is
1577called with the '--replica' switch, enabling replica mode. If no value is
Matthias Sohnd8182ba2019-12-09 14:50:23 +01001578set (or any other value), Gerrit defaults to primary mode enabling write
1579operations.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001580
David Ostrovsky21fca752019-10-18 08:50:29 +02001581[[container.slave]]container.slave::
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001582+
Christian Aistleitnerdcd731f2020-06-20 22:17:23 +02001583Backward compatibility for link:#container.replica[`container.replica`]
1584config setting.
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001585
Khai Do6168beb2016-12-19 17:26:28 -08001586[[container.startupTimeout]]container.startupTimeout::
1587+
1588The maximum time (in seconds) to wait for a gerrit.sh start command
1589to run a new Gerrit daemon successfully. If not set, defaults to
159090 seconds.
1591
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001592[[container.user]]container.user::
1593+
1594Login name (or UID) of the operating system user the Gerrit JVM
1595will execute as. If not set, defaults to the user who launched
1596the 'gerrit.sh' wrapper script.
1597
1598[[container.war]]container.war::
1599+
1600Path of the JAR file to start daemon execution with. This should
1601be the path of the local 'gerrit.war' archive. Overrides the
1602environment variable 'GERRIT_WAR'.
1603+
1604If not set, defaults to '$site_path/bin/gerrit.war', or to
1605'$HOME/gerrit.war'.
1606
1607
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001608[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001609=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001610
Saša Živkovd34dfe32017-11-20 11:14:35 +01001611[NOTE]
1612The link:#jgitConfig[etc/jgit.config] file supports configuration of all JGit
1613options.
1614
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001615[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001616+
1617Number of bytes of a pack file to load into memory in a single
1618read operation. This is the "page size" of the JGit buffer cache,
1619used for all pack access operations. All disk IO occurs as single
1620window reads. Setting this too large may cause the process to load
1621more data than is required; setting this too small may increase
1622the frequency of `read()` system calls.
1623+
1624Default on JGit is 8 KiB on all platforms.
1625+
1626Common unit suffixes of 'k', 'm', or 'g' are supported.
1627
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001628[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001629+
1630Maximum number of bytes to load and cache in memory from pack files.
1631If JGit needs to access more than this many bytes it will unload less
1632frequently used windows to reclaim memory space within the process.
1633As this buffer must be shared with the rest of the JVM heap, it
1634should be a fraction of the total memory available.
1635+
1636Default on JGit is 10 MiB on all platforms.
1637+
1638Common unit suffixes of 'k', 'm', or 'g' are supported.
1639
Matthias Sohn79bec412020-02-12 01:00:31 +01001640[[core.packedGitUseStrongRefs]]core.packedGitUseStrongRefs::
1641+
1642Set to `true` in order to use strong references to reference packfile
1643pages cached in the WindowCache. Otherwise SoftReferences are used.
1644If this option is set to `false`, the Java garbage collector will
1645flush the WindowCache to free memory if the used heap comes close to
1646the maximum heap size. This has the advantage that it can quickly
1647reclaim memory which was used by the WindowCache but comes at the
1648price that the previously cached pack file content needs to be again
1649copied from the file system cache to the Gerrit process.
1650Setting this option to `true` prevents flushing the WindowCache
1651which provides more predictable performance.
1652+
1653Default is `false`.
1654
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001655[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001656+
1657Maximum number of bytes to reserve for caching base objects
1658that multiple deltafied objects reference. By storing the entire
1659decompressed base object in a cache Git is able to avoid unpacking
1660and decompressing frequently used base objects multiple times.
1661+
1662Default on JGit is 10 MiB on all platforms. You probably do not
1663need to adjust this value.
1664+
1665Common unit suffixes of 'k', 'm', or 'g' are supported.
1666
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001667[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001668+
1669Maximum number of pack files to have open at once. A pack file
1670must be opened in order for any of its data to be available in
1671a cached window.
1672+
1673If you increase this to a larger setting you may need to also adjust
1674the ulimit on file descriptors for the host JVM, as Gerrit needs
1675additional file descriptors available for network sockets and other
1676repository data manipulation.
1677+
1678Default on JGit is 128 file descriptors on all platforms.
1679
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001680[[core.streamFileThreshold]]core.streamFileThreshold::
1681+
1682Largest object size, in bytes, that JGit will allocate as a
1683contiguous byte array. Any file revision larger than this threshold
1684will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001685files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001686during delta decompression.
1687+
1688Servers with very high traffic should set this to be larger than
1689the size of their common big files. For example a server managing
1690the Android platform typically has to deal with ~10-12 MiB XML
1691files, so `15 m` would be a reasonable setting in that environment.
1692Setting this too high may cause the JVM to run out of heap space
1693when handling very big binary files, such as device firmware or
1694CD-ROM ISO images.
1695+
Luca Milanesiob104a552019-11-18 17:28:56 -08001696Defaults to 25% of the available JVM heap, limited to 2g.
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001697+
1698Common unit suffixes of 'k', 'm', or 'g' are supported.
1699
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001700[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001701+
1702When true, JGit will use `mmap()` rather than `malloc()+read()`
1703to load data from pack files. The use of mmap can be problematic
1704on some JVMs as the garbage collector must deduce that a memory
1705mapped segment is no longer in use before a call to `munmap()`
1706can be made by the JVM native code.
1707+
1708In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001709pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001710of virtual address space, as the garbage collector cannot reclaim
1711unused mapped spaces fast enough.
1712+
1713Default on JGit is false. Although potentially slower, it yields
1714much more predictable behavior.
1715
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001716[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1717+
1718Size of the buffer to store logging events for asynchronous logging.
1719Putting a larger value can protect threads from stalling when the
1720AsyncAppender threads are not fast enough to consume the logging events
David Pursehouse1ff91c02015-05-19 15:05:26 +09001721from the buffer. It also protects from losing log entries in this case.
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001722+
1723Default is 64 entries.
1724
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001725[[core.useRecursiveMerge]]core.useRecursiveMerge::
1726+
Edwin Kempin71831d22014-07-15 08:54:29 +02001727Use JGit's recursive merger for three-way merges. This only affects
Sebastian Schuberth774aac92015-04-16 13:21:04 +02001728projects that allow content merges.
Edwin Kempin71831d22014-07-15 08:54:29 +02001729+
1730As explained in this
1731link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[
1732blog], the recursive merge produces better results if the two commits
1733that are merged have more than one common predecessor.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001734+
Edwin Kempin7853c5b2014-07-15 08:57:17 +02001735Default is true.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001736
Hugo Arès47344372016-06-27 10:23:17 -04001737[[core.repositoryCacheCleanupDelay]]core.repositoryCacheCleanupDelay::
1738+
1739Delay between each periodic cleanup of expired repositories.
1740+
1741Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1742`min`, etc.).
1743+
1744Set it to 0 in order to switch off cache expiration. If cache expiration is
1745switched off, the JVM can still evict cache entries when it is running low
1746on available heap memory.
1747+
1748Set it to -1 to automatically derive cleanup delay from
1749`core.repositoryCacheExpireAfter` (lowest value between 1/10 of
1750`core.repositoryCacheExpireAfter` and 10 minutes).
1751+
1752Default is -1.
1753
1754[[core.repositoryCacheExpireAfter]]core.repositoryCacheExpireAfter::
1755+
1756Time an unused repository should expire and be evicted from the repository
1757cache.
1758+
1759Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1760`min`, etc.).
1761+
1762Default is 1 hour.
1763
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001764[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001765=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03001766
1767----
1768[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001769 command = checkout
1770 command = cherry_pick
1771 command = pull
1772 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001773 scheme = ssh
1774 scheme = http
1775 scheme = anon_http
1776 scheme = anon_git
1777 scheme = repo_download
1778----
1779
1780The download section configures the allowed download methods.
1781
Edwin Kempin08b03a22012-09-14 16:32:57 +02001782[[download.command]]download.command::
1783+
1784Commands that should be offered to download changes.
1785+
1786Multiple commands are supported:
1787+
1788* `checkout`
1789+
1790Command to fetch and checkout the patch set.
1791+
1792* `cherry_pick`
1793+
1794Command to fetch the patch set and to cherry-pick it onto the current
1795commit.
1796+
1797* `pull`
1798+
1799Command to pull the patch set.
1800+
1801* `format_patch`
1802+
1803Command to fetch the patch set and to feed it into the `format-patch`
1804command.
1805
1806+
1807If `download.command` is not specified, all download commands are
1808offered.
1809
monica.dionisio3f630442010-06-29 15:42:57 -03001810[[download.scheme]]download.scheme::
1811+
1812Schemes that should be used to download changes.
1813+
1814Multiple schemes are supported:
1815+
1816* `http`
1817+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001818Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001819+
1820* `ssh`
1821+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001822Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001823+
1824* `anon_http`
1825+
1826Anonymous HTTP download is allowed.
1827+
1828* `anon_git`
1829+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001830Anonymous Git download is allowed. This is not default, it is also
1831necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1832variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001833+
1834* `repo_download`
1835+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001836Gerrit advertises patch set downloads with the `repo download`
1837command, assuming that all projects managed by this instance are
1838generally worked on with the repo multi-repository tool. This is
1839not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001840
1841+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001842If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001843downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001844
Edwin Kempin322db672015-07-03 08:50:46 +02001845[[download.checkForHiddenChangeRefs]]download.checkForHiddenChangeRefs::
1846+
1847Whether the download commands should be adapted when the change refs
1848are hidden.
1849+
1850Git has a configuration option to hide refs from the initial
1851advertisement (`uploadpack.hideRefs`). This option can be used to hide
1852the change refs from the client. As consequence fetching changes by
1853change ref does not work anymore. However by setting
1854`uploadpack.allowTipSha1InWant` to `true` fetching changes by commit ID
1855is possible. If `download.checkForHiddenChangeRefs` is set to `true`
1856the git download commands use the commit ID instead of the change ref
1857when a project is configured like this.
1858+
1859Example git configuration on a project:
1860+
1861----
1862[uploadpack]
1863 hideRefs = refs/changes/
1864 hideRefs = refs/cache-automerge/
1865 allowTipSha1InWant = true
1866----
1867+
1868By default `false`.
1869
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001870[[download.archive]]download.archive::
1871+
1872Specifies which archive formats, if any, should be offered on the change
Francois Ferrand1e933882014-09-25 11:19:08 +02001873screen and supported for `git-upload-archive` operation:
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001874+
1875----
1876[download]
1877 archive = tar
1878 archive = tbz2
1879 archive = tgz
1880 archive = txz
Francois Ferrand1e933882014-09-25 11:19:08 +02001881 archive = zip
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001882----
1883
Shawn Pearce6edde312014-03-26 22:00:26 -07001884If `download.archive` is not specified defaults to all archive
1885commands. Set to `off` or empty string to disable.
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001886
Francois Ferrand1e933882014-09-25 11:19:08 +02001887Zip is not supported because it may be interpreted by a Java plugin as a
1888valid JAR file, whose code would have access to cookies on the domain.
1889For this reason `zip` format is always excluded from formats offered
1890through the `Download` drop down or accessible in the REST API.
1891
Stefan Bellere1b2ad32016-11-29 14:54:13 -08001892[[download.maxBundleSize]]download.maxBundleSize::
1893+
1894Specifies the maximum size of a bundle in bytes that can be downloaded.
1895As bundles are kept in memory this setting is to protect the server
1896from a single request consuming too much heap when generating
1897a bundle and thereby impacting other users.
1898+
1899Defaults to 100MB.
1900
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001901[[gc]]
1902=== Section gc
1903
1904This section allows to configure the git garbage collection and schedules it
1905to run periodically. It will be triggered and executed sequentially for all
1906projects.
1907
Christian Halstricke6c68322015-03-11 15:21:42 +01001908[[gc.aggressive]]gc.aggressive::
1909+
1910Determines if scheduled garbage collections and garbage collections triggered
1911through Web-UI should run in aggressive mode or not. Aggressive garbage
1912collections are more expensive but may lead to significantly smaller
1913repositories.
1914+
1915Valid values are "true" and "false," default is "false".
1916
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001917[[gc.startTime]]gc.startTime::
1918+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001919The link:#schedule-configuration-startTime[start time] for running the
1920git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001921
1922[[gc.interval]]gc.interval::
1923+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001924The link:#schedule-configuration-interval[interval] for running the
1925git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001926
Edwin Kempind33d95a2018-02-16 11:44:04 +01001927link:#schedule-configuration-examples[Schedule examples] can be found
1928in the link:#schedule-configuration[Schedule Configuration] section.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001929
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001930[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001931=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001932
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001933[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001934+
1935Local filesystem directory holding all Git repositories that
1936Gerrit knows about and can process changes for. A project
1937entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02001938the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001939+
1940If relative, the path is resolved relative to `'$site_path'`.
1941
Shawn O. Pearce897d9212011-06-16 16:59:59 -07001942[[gerrit.allProjects]]gerrit.allProjects::
1943+
1944Name of the permissions-only project defining global server
1945access controls and settings. These are inherited into every
1946other project managed by the running server. The name is
1947relative to `gerrit.basePath`.
1948+
1949Defaults to `All-Projects` if not set.
1950
Edwin Kempin2bf5edd2014-03-25 22:21:23 +01001951[[gerrit.allUsers]]gerrit.allUsers::
1952+
1953Name of the project in which meta data of all users is stored.
1954The name is relative to `gerrit.basePath`.
1955+
1956Defaults to `All-Users` if not set.
1957
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001958[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001959+
1960The default URL for Gerrit to be accessed through.
1961+
Sebastian Schuberth64037132016-07-28 13:40:16 +02001962Typically this would be set to something like "http://review.example.com/"
1963or "http://example.com:8080/gerrit/" so Gerrit can output links that point
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001964back to itself.
1965+
1966Setting this is highly recommended, as its necessary for the upload
1967code invoked by "git push" or "repo upload" to output hyperlinks
1968to the newly uploaded changes.
1969
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001970[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001971+
1972Optional base URL for repositories available over the anonymous git
1973protocol. For example, set this to `git://mirror.example.com/base/`
1974to have Gerrit display patch set download URLs in the UI. Gerrit
1975automatically appends the project name onto the end of the URL.
1976+
1977By default unset, as the git daemon must be configured externally
1978by the system administrator, and might not even be running on the
1979same host as Gerrit.
1980
Dave Borowitza5d3fec2015-07-09 14:24:02 -07001981[[gerrit.docUrl]]gerrit.docUrl::
1982+
1983Optional base URL for documentation, under which one can find
1984"index.html", "rest-api.html", etc. Used as the base for the fixed set
1985of links in the "Documentation" tab. A slash is implicitly appended.
1986(For finer control over the top menu, consider writing a
1987link:dev-plugins.html#top-menu-extensions[plugin].)
1988+
1989If unset or empty, the documentation tab will only be shown if
1990`/Documentation/index.html` can be reached by the browser at app load
1991time.
1992
Dave Borowitza17a9842015-09-15 09:58:17 -04001993[[gerrit.editGpgKeys]]gerrit.editGpgKeys::
1994+
1995If enabled and server-side signed push validation is also
1996link:#receive.enableSignedPush[enabled], enable the
1997link:rest-api-accounts.html#list-gpg-keys[REST API endpoints] and web UI
1998for editing GPG keys. If disabled, GPG keys can only be added by
1999administrators with direct git access to All-Users.
2000+
2001Defaults to true.
2002
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002003[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
2004+
2005Optional command to install the `commit-msg` hook. Typically of the
2006form:
David Pursehouse05588e52015-01-07 14:25:11 +09002007+
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002008----
2009fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
2010----
2011+
2012By default unset; falls back to using scp from the canonical SSH host,
2013or curl from the canonical HTTP URL for the server. Only necessary if a
2014proxy or other server/network configuration prevents clients from
2015fetching from the default location.
2016
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07002017[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
2018+
2019Optional base URL for repositories available over the HTTP
2020protocol. For example, set this to `http://mirror.example.com/base/`
2021to have Gerrit display URLs from this server, rather than itself.
2022+
2023By default unset, as the HTTP daemon must be configured externally
2024by the system administrator, and might not even be running on the
2025same host as Gerrit.
2026
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002027[[gerrit.installDbModule]]gerrit.installDbModule::
2028+
2029Repeatable list of class name of additional Guice modules to load at
2030Gerrit startup as part of the dbInjector and during the init phases.
2031Classes are resolved using the primary Gerrit class loader, hence the
2032class needs to be either declared in Gerrit or an additional JAR
2033located under the `/lib` directory.
2034+
2035By default unset.
2036
Luca Milanesio62cc3502016-11-15 10:22:38 -08002037[[gerrit.installModule]]gerrit.installModule::
2038+
2039Repeatable list of class name of additional Guice modules to load at
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002040Gerrit startup as part of the sysInjector and during the init phases.
Luca Milanesio62cc3502016-11-15 10:22:38 -08002041Classes are resolved using the primary Gerrit class loader, hence the
2042class needs to be either declared in Gerrit or an additional JAR
2043located under the `/lib` directory.
2044+
2045By default unset.
2046+
2047Example:
2048----
2049[gerrit]
2050 installModule = com.googlesource.gerrit.libmodule.MyModule
2051 installModule = com.example.abc.OurSpecialSauceModule
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002052 installDbModule = com.example.def.OurCustomProvider
Luca Milanesio62cc3502016-11-15 10:22:38 -08002053----
2054
Luca Milanesio92254852019-02-14 01:33:14 +00002055[[gerrit.listProjectsFromIndex]]gerrit.listProjectsFromIndex::
2056+
2057Enable rendering of project list from the secondary index instead
2058of purely relying on the in-memory cache.
2059+
2060By default false.
2061+
2062[NOTE]
2063The in-memory cache (set to false) rendering provides an **unlimited list** as a result
2064of the list project API, causing the full list of projects to be
2065returned as a result of the link:rest-api-projects.html[/projects/] REST API
2066or the link:cmd-ls-projects.html[gerrit ls-projects] SSH command.
2067When the rendering from the secondary index (set to true),
2068the **list is limited** by the global capability
2069link:access-control.html#capability_queryLimit[queryLimit]
2070which is defaulted to 500 entries.
2071
Sven Selberge63e92d2019-01-22 18:19:19 +01002072[[gerrit.primaryWeblinkName]]gerrit.primaryWeblinkName::
2073+
2074Name of the link:dev-plugins.html#links-to-external-tools[Weblink] that should
2075be chosen in cases where only one Weblink can be used in the UI, for example in
2076inline links.
2077+
2078By default unset, meaning that the UI is responsible for trying to identify
2079a weblink to be used in these cases, most likely weblinks that links to code
2080browsers with known integrations with Gerrit (like Gitiles and Gitweb).
2081+
2082Example:
2083----
2084[gerrit]
2085 primaryWeblinkName = gitiles
2086----
2087
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002088[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
2089+
David Pursehouse214ab862014-12-01 11:48:26 +09002090URL to direct users to when they need to report a bug.
2091+
2092By default unset, meaning no bug report URL will be displayed. Administrators
2093should set this to the URL of their issue tracker, if necessary.
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002094
David Pursehouse46a2f6c2018-11-30 11:12:19 +09002095[[gerrit.enableReverseDnsLookup]]gerrit.enableReverseDnsLookup::
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002096+
David Pursehouse793525f2018-11-30 11:20:02 +09002097Enable reverse DNS lookup during computing ref log entry for identified user,
2098to record the actual hostname of the user's host in the ref log.
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002099+
David Pursehouse793525f2018-11-30 11:20:02 +09002100Enabling reverse DNS lookup can cause performance issues on git push when
2101the reverse DNS lookup is slow.
2102+
2103Defaults to false, reverse DNS lookup is disabled. The user's IP address
2104will be recorded in the ref log rather than their hostname.
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002105
David Pursehouse962e1182014-12-03 17:17:52 +09002106[[gerrit.secureStoreClass]]gerrit.secureStoreClass::
2107+
2108Use the secure store implementation from a specified class.
2109+
2110If specified, must be the fully qualified class name of a class that implements
2111the `com.google.gerrit.server.securestore.SecureStore` interface, and the jar
2112file containing the class must be placed in the `$site_path/lib` folder.
2113+
2114If not specified, the default no-op implementation is used.
2115
Marcin Czech56918392020-06-16 07:47:16 +00002116[[gerrit.canLoadInIFrame]]gerrit.canLoadInIFrame::
2117+
2118For security reasons Gerrit will always jump out of iframe.
2119Setting this option to true will prevent this behavior.
2120+
2121By default false.
2122
Marcin Czech559ea2b2020-06-15 17:36:18 +02002123[[gerrit.xframeOption]]gerrit.xframeOption::
2124+
2125Add link:https://tools.ietf.org/html/rfc7034[`X-Frame-Options`] header to all HTTP
2126responses. The `X-Frame-Options` HTTP response header can be used to indicate
2127whether or not a browser should be allowed to render a page in a
2128`<frame>`, `<iframe>`, `<embed>` or `<object>`.
2129+
2130Available values:
2131+
21321. ALLOW - The page can be displayed in a frame.
21332. SAMEORIGIN - The page can only be displayed in a frame on the same origin as the page itself.
2134+
2135If link:#gerrit.canLoadInIFrame is set to false this option is ignored and the
2136`X-Frame-Options` header is always set to `DENY`.
2137Setting this option to `ALLOW` will cause the `X-Frame-Options` header to be omitted
2138the the page can be displayed in a frame.
2139+
2140By default SAMEORIGIN.
2141
Wyatt Allen414659c2017-03-15 09:55:31 -07002142[[gerrit.cdnPath]]gerrit.cdnPath::
2143+
2144Path prefix for PolyGerrit's static resources if using a CDN.
2145
Viktar Donich65ae7482017-10-20 14:13:31 -07002146[[gerrit.faviconPath]]gerrit.faviconPath::
2147+
2148Path for PolyGerrit's favicon after link:#gerrit.canonicalWebUrl[default URL],
2149including icon name and extension (.ico should be used).
2150
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002151
2152[[gerrit.instanceName]]gerrit.instanceName::
2153+
2154Short identifier for this Gerrit instance.
2155A good name should be short but precise enough so that users can identify the instance among others.
2156+
2157Defaults to the full hostname of the Gerrit server.
2158
Luca Milanesio1a3d84f2020-05-04 17:14:12 +01002159[[gerrit.experimentalRollingUpgrade]]gerrit.experimentalRollingUpgrade::
2160+
2161Enable Gerrit rolling upgrade to the next version.
2162For example if Gerrit v3.1 is version N (All-Projects:refs/meta/version=181)
2163then its next version N+1 is v3.2 (All-Projects:refs/meta/version=183).
2164Allow Gerrit to start even if the underlying schema version has been bumped to
2165the next Gerrit version.
2166+
2167Set to true if Gerrit is installed in
2168[high-availability configuration](https://gerrit.googlesource.com/plugins/high-availability/+/refs/heads/master/README.md)
2169during the rolling upgrade to the next version.
2170+
2171By default false.
2172+
2173The rolling upgrade process, at high level, assumes that Gerrit is installed
2174on two or more nodes sharing the repositories over NFS. The upgrade is composed
2175of the following steps:
2176+
21771. Set gerrit.experimentalRollingUpgrade to true on all Gerrit masters
21782. Set the first master unhealthy
21793. Shutdown the first master and [upgrade](install.html#init) to the next version
21804. Startup the first master, wait for the online reindex to complete
21815. Verify the the first master upgrade is successful and online reindex is complete
21826. Set the first master healthy
21837. Repeat steps 2. to 6. for all the other Gerrit nodes
2184+
2185[WARNING]
2186Rolling upgrade may or may not be possible depending on the changes introduced
2187by the target version of the upgrade. Refer to the release notes and check whether
2188the rolling upgrade is possible or not and the associated constraints.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002189
Sven Selberg327c2e42018-04-10 11:42:19 +02002190[[gerrit.serverId]]gerrit.serverId::
2191+
2192Used by NoteDb to, amongst other things, identify author identities from
2193per-server specific account IDs.
2194+
2195If this value is not set on startup it is automatically set to a random UUID.
2196+
2197[NOTE]
2198If this value doesn't match the serverId used when creating an already existing
2199NoteDb, Gerrit will not be able to use that instance of NoteDb. The serverId
2200used to create the NoteDb will show in the resulting exception message in case
2201the value differs.
2202
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002203[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002204=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002205
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002206Gerrit can forward requests to either an internally managed gitweb
2207(which allows Gerrit to enforce some access controls), or to an
2208externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002209See also link:config-gitweb.html[Gitweb Integration].
2210
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002211[[gitweb.cgi]]gitweb.cgi::
2212+
2213Path to the locally installed `gitweb.cgi` executable. This CGI will
2214be called by Gerrit Code Review when the URL `/gitweb` is accessed.
2215Project level access controls are enforced prior to calling the CGI.
2216+
David Pursehousea89dc982016-09-15 09:35:44 +02002217Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if `gitweb.url` is not set.
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002218
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002219[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002220+
2221Optional URL of an affiliated gitweb service. Defines the
2222web location where a `gitweb.cgi` is installed to browse
David Pursehousea89dc982016-09-15 09:35:44 +02002223`gerrit.basePath` and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002224+
2225Gerrit appends any necessary query arguments onto the end of this URL.
David Pursehousea89dc982016-09-15 09:35:44 +02002226For example, `?p=$project.git;h=$commit`.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002227
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002228[[gitweb.type]]gitweb.type::
2229+
2230Optional type of affiliated gitweb service. This allows using
David Pursehousea66f7ff2016-09-05 21:11:10 +09002231alternatives to gitweb, such as cgit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002232+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07002233Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
David Pursehousea66f7ff2016-09-05 21:11:10 +09002234+
2235If not set, or set to `disabled`, there is no gitweb hyperlinking
2236support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002237
Edwin Kempind86909c2012-03-26 10:36:29 +02002238[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002239+
2240Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002241at a specific commit when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002242+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002243Valid replacements are `${project}` for the project name in Gerrit
2244and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002245
Edwin Kempind86909c2012-03-26 10:36:29 +02002246[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002247+
2248Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002249at a specific project when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002250+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002251Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002252
Edwin Kempind86909c2012-03-26 10:36:29 +02002253[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002254+
2255Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002256at a specific branch when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002257+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002258Valid replacements are `${project}` for the project name in Gerrit
2259and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002260
Paladox none5759f2c2017-10-27 18:13:54 +00002261[[gitweb.tag]]gitweb.tag::
2262+
2263Optional pattern to use for constructing the gitweb URL when pointing
2264at a specific tag when `gitweb.type` is set to `custom`.
2265+
2266Valid replacements are `${project}` for the project name in Gerrit
2267and `${tag}` for the name of the tag.
2268
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002269[[gitweb.roottree]]gitweb.roottree::
2270+
2271Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002272at the contents of the root tree in a specific commit when `gitweb.type`
2273is set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002274+
2275Valid replacements are `${project}` for the project name in Gerrit
2276and `${commit}` for the SHA1 hash for the commit.
2277
2278[[gitweb.file]]gitweb.file::
2279+
2280Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002281at the contents of a file in a specific commit when `gitweb.type` is
2282set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002283+
2284Valid replacements are `${project}` for the project name in Gerrit,
2285`${file}` for the file name and `${commit}` for the SHA1 hash for
2286the commit.
2287
Edwin Kempin64011562012-03-26 10:50:12 +02002288[[gitweb.filehistory]]gitweb.filehistory::
2289+
2290Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002291at the history of a file in a specific branch when when `gitweb.type`
2292is set to `custom`.
Edwin Kempin64011562012-03-26 10:50:12 +02002293+
2294Valid replacements are `${project}` for the project name in Gerrit,
2295`${file}` for the file name and `${branch}` for the name of the
2296branch.
2297
Gustaf Lundha07d2e72011-10-27 15:26:35 -07002298[[gitweb.linkname]]gitweb.linkname::
2299+
2300Optional setting for modifying the link name presented to the user
2301in the Gerrit web-UI.
2302+
David Pursehousea89dc982016-09-15 09:35:44 +02002303The default linkname for custom type is `gitweb`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002304
Adrian Goerlerf2007072011-11-10 08:39:55 +01002305[[gitweb.pathSeparator]]gitweb.pathSeparator::
2306+
2307Optional character to substitute the standard path separator (slash) in
2308project names and branch names.
2309+
2310By default, Gerrit will use hexadecimal encoding for slashes in project and
2311branch names. Some web servers, such as Tomcat, reject this hexadecimal
2312encoding in the URL.
2313+
2314Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
2315allow using an alternative path separator character. In Gitblit, this can be
2316configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
2317In Gerrit, the alternative path separator can be configured correspondingly
David Pursehousea89dc982016-09-15 09:35:44 +02002318using the property `gitweb.pathSeparator`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002319+
David Pursehousea89dc982016-09-15 09:35:44 +02002320Valid values are the characters `*`, `(` and `)`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002321
David Pursehouse5d592e82016-06-09 05:12:26 +00002322[[gitweb.urlEncode]]gitweb.urlEncode::
Luca Milanesio25312032013-10-11 11:34:39 +01002323+
2324Whether or not Gerrit should encode the generated viewer URL.
2325+
2326Gerrit composes the viewer URL using information about the project, branch, file
2327or commit of the target object to be displayed. Typically viewers such as CGit
David Pursehousea89dc982016-09-15 09:35:44 +02002328and gitweb do need those parts to be encoded, including the `/` in project's name,
Luca Milanesio25312032013-10-11 11:34:39 +01002329for being correctly parsed.
2330However other viewers could instead require an unencoded URL (e.g. GitHub web
David Pursehousea89dc982016-09-15 09:35:44 +02002331based viewer).
Luca Milanesio25312032013-10-11 11:34:39 +01002332+
David Pursehousea89dc982016-09-15 09:35:44 +02002333Valid values are `true` and `false`. The default is `true`.
Luca Milanesio25312032013-10-11 11:34:39 +01002334
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002335[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002336=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01002337
2338[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
2339+
2340Controls whether newly created groups should be by default visible to
2341all registered users.
2342+
2343By default, false.
2344
Edwin Kempinf3eddd52017-01-20 14:05:47 +01002345[[groups.uuid.name]]groups.<uuid>.name::
2346+
2347Display name for group with the given UUID.
2348+
2349This option is only supported for system groups (scheme 'global').
2350+
2351E.g. this parameter can be used to configure another name for the
2352`Anonymous Users` group:
2353+
2354----
2355[groups "global:Anonymous-Users"]
2356 name = All Users
2357----
2358+
2359When setting this parameter it should be verified that there is no
2360existing group with the same name (case-insensitive). Configuring an
2361ambiguous name makes Gerrit fail on startup. Once set Gerrit ensures
2362that it is not possible to create a group with this name. Gerrit also
2363keeps the default name reserved so that it cannot be used for new
2364groups either. This means there is no danger of ambiguous group names
2365when this parameter is removed and the system group uses the default
2366name again.
2367
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002368[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002369=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002370
2371[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002372+
2373URL of the proxy server when making outgoing HTTP
2374connections for OpenID login transactions. Syntax
2375should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002376
2377[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002378+
2379Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002380This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002381appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002382
2383[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002384+
2385Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002386This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002387appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002388
Hugo Arès88e33ac2014-03-03 13:52:45 -05002389[[http.addUserAsRequestAttribute]]http.addUserAsRequestAttribute::
2390+
2391If true, 'User' attribute will be added to the request attributes so it
2392can be accessed outside the request scope (will be set to username or id
2393if username not configured).
2394+
2395This attribute can be used by the servlet container to log user in the
2396http access log.
2397+
2398When running the embedded servlet container, this attribute is used to
2399print user in the httpd_log.
2400+
2401* `%{User}r`
2402+
2403Pattern to print user in Tomcat AccessLog.
2404
2405+
2406Default value is true.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002407
Gustaf Lundhe45c3332018-05-02 10:52:11 +02002408[[http.addUserAsResponseHeader]]http.addUserAsResponseHeader::
2409+
2410If true, the header 'User' will be added to the list of response headers so it
2411can be accessed from a reverse proxy for logging purposes.
2412
2413+
2414Default value is false.
2415
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002416[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002417=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002418
2419The httpd section configures the embedded servlet container.
2420
2421[[httpd.listenUrl]]httpd.listenUrl::
2422+
Gert van Dijk70e26612019-09-29 16:20:25 +02002423Configuration for the listening sockets of the internal HTTP daemon.
2424Each entry of `listenUrl` combines the following options for a
2425listening socket: protocol, network address, port and context path.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002426+
Gert van Dijk70e26612019-09-29 16:20:25 +02002427_Protocol_ can be either `http://`, `https://`, `proxy-http://` or
2428`proxy-https://`. The latter two are special forms of `http://` with
2429awareness of a reverse proxy (see below). _Network address_ selects
2430the interface and/or scope of the listening socket. For notes
2431examples, see below. _Port_ is the TCP port number and is optional
2432(default value depends on the protocol). _Context path_ is the
2433optional "base URI" for the Gerrit Code Review as application to
2434serve on.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002435+
Gert van Dijk70e26612019-09-29 16:20:25 +02002436**Protocol** schemes:
2437+
2438* `http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002439+
2440Plain-text HTTP protocol. If port is not supplied, defaults to 80,
2441the standard HTTP port.
2442+
Gert van Dijk70e26612019-09-29 16:20:25 +02002443* `https://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002444+
2445SSL encrypted HTTP protocol. If port is not supplied, defaults to
2446443, the standard HTTPS port.
2447+
Gert van Dijk70e26612019-09-29 16:20:25 +02002448For configuration of the certificate and private key, see
2449<<httpd.sslKeyStore,httpd.sslKeyStore>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002450+
Gert van Dijk70e26612019-09-29 16:20:25 +02002451[NOTE]
2452SSL/TLS configuration capabilities of Gerrit internal HTTP daemon
2453are very limited. Externally facing production sites are strongly
2454encouraged to use a reverse proxy configuration to handle SSL/TLS
2455and use a `proxy-https://` scheme here (below) for security and
2456performance reasons.
2457+
2458* `proxy-http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002459+
2460Plain-text HTTP relayed from a reverse proxy. If port is not
2461supplied, defaults to 8080.
2462+
Gert van Dijk70e26612019-09-29 16:20:25 +02002463Like `http://`, but additional header parsing features are
2464enabled to honor `X-Forwarded-For`, `X-Forwarded-Host` and
2465`X-Forwarded-Server`. These headers are typically set by Apache's
2466link:https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#x-headers[mod_proxy].
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002467+
Gert van Dijk70e26612019-09-29 16:20:25 +02002468[NOTE]
2469--
2470For secruity reasons, make sure to only allow connections from a
2471trusted reverse proxy in your network, as clients could otherwise
2472easily spoof these headers and thus spoof their originating IP
2473address effectively. If the reverse proxy is running on the same
2474machine as Gerrit daemon, the use of a _loopback_ network address
2475to bind to (see below) is strongly recommended to mitigate this.
2476
2477If not using Apache's mod_proxy, validate that your reverse proxy
2478sets these headers on all requests. If not, either configure it to
2479sanitize them from the origin, or use the `http://` scheme instead.
2480--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002481+
Gert van Dijk70e26612019-09-29 16:20:25 +02002482* `proxy-https://`
2483+
2484Plain-text HTTP relayed from a reverse proxy that has already
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002485handled the SSL encryption/decryption. If port is not supplied,
2486defaults to 8080.
2487+
Gert van Dijk70e26612019-09-29 16:20:25 +02002488Behaves exactly like `proxy-http://`, but also sets the scheme to
2489assume `https://` is the proper URL back to the server.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002490
2491+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002492--
Gert van Dijk70e26612019-09-29 16:20:25 +02002493**Network address** forms:
2494
2495* Loopback (localhost): `127.0.0.1` (IPv4) or `[::1]` (IPv6).
2496* All (unspecified): `0.0.0.0` (IPv4), `[::]` (IPv6) or `*`
2497 (IPv4 and IPv6)
2498* Interface IP address, e.g. `1.2.3.4` (IPv4) or
2499 `[2001:db8::a00:20ff:fea7:ccea]` (IPv6)
2500* Hostname, resolved at startup time to an address.
2501
2502**Context path** is the local part of the URL to be used to access
2503Gerrit on ('base URL'). E.g. `/gerrit/` to serve Gerrit on that URI
2504as base. If set, consider to align this with the
2505<<gerrit.canonicalWebUrl,gerrit.canonicalWebUrl>> setting. Correct
2506settings may depend on the reverse proxy configuration as well. By
2507default, this is `/` so that Gerrit serves requests on the root.
2508
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002509If multiple values are supplied, the daemon will listen on all
2510of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002511
Gert van Dijk70e26612019-09-29 16:20:25 +02002512Examples:
2513
2514----
2515[httpd]
2516 listenUrl = proxy-https://127.0.0.1:9999/gerrit/
2517[gerrit]
2518 # Reverse proxy is configured to serve with SSL/TLS on
2519 # example.com and to relay requests on /gerrit/ onto
2520 # http://127.0.0.1:9999/gerrit/
2521 canonicalWebUrl = https://example.com/gerrit/
2522----
2523
2524----
2525[httpd]
2526 # Listen on specific external interface with plaintext
2527 # HTTP on IPv6.
2528 listenUrl = http://[2001:db8::a00:20ff:fea7:ccea]
2529
2530 # Also listen on specific internal interface for use with
2531 # reverse proxy run on another host.
2532 listenUrl = proxy-https://192.168.100.123
2533----
2534
2535See also the page on link:config-reverseproxy.html[reverse proxy]
2536configuration.
2537
2538By default, `\http://*:8080`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002539--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002540
2541[[httpd.reuseAddress]]httpd.reuseAddress::
2542+
2543If true, permits the daemon to bind to the port even if the port
2544is already in use. If false, the daemon ensures the port is not
2545in use before starting. Busy sites may need to set this to true
2546to permit fast restarts.
2547+
2548By default, true.
2549
Luca Milanesio4e2bb452018-03-21 09:07:24 +00002550[[httpd.gracefulStopTimeout]]httpd.gracefulStopTimeout::
2551+
2552Set a graceful stop time. If set, the daemon ensures that all incoming
2553calls are preserved for a maximum period of time, before starting
2554the graceful shutdown process. Sites behind a workload balancer such as
2555HAProxy would need this to be set for avoiding serving errors during
2556rolling restarts.
2557+
2558Values should use common unit suffixes to express their setting:
2559+
2560* s, sec, second, seconds
2561* m, min, minute, minutes
2562+
2563By default, 0 seconds (immediate shutdown).
2564
Thomas Meyeraa93fdf2016-10-23 10:53:48 +02002565[[httpd.inheritChannel]]httpd.inheritChannel::
2566+
2567If true, permits the daemon to inherit its server socket channel
2568from fd0/1(stdin/stdout). When set to true, the server can be socket
2569activated via systemd or xinetd.
2570+
2571By default, false.
2572
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002573[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
2574+
2575Size, in bytes, of the buffer used to parse the HTTP headers of an
2576incoming HTTP request. The entire request headers, including any
2577cookies sent by the browser, must fit within this buffer, otherwise
2578the server aborts with the response '413 Request Entity Too Large'.
2579+
2580One buffer of this size is allocated per active connection.
2581Allocating a buffer that is too large wastes memory that cannot be
2582reclaimed, allocating a buffer that is too small may cause unexpected
2583errors caused by very long Referer URLs or large cookie values.
2584+
2585By default, 16384 (16 K), which is sufficient for most OpenID and
2586other web-based single-sign-on integrations.
2587
Chulho Yangb72ff8f2013-07-04 02:35:53 -04002588[[httpd.sslCrl]]httpd.sslCrl::
2589+
2590Path of the certificate revocation list file in PEM format. This
2591crl file is optional, and available for CLIENT_SSL_CERT_LDAP
2592authentication.
2593+
2594To create and view a crl using openssl:
2595+
2596----
2597openssl ca -gencrl -out crl.pem
2598openssl crl -in crl.pem -text
2599----
2600+
2601If not absolute, the path is resolved relative to `$site_path`.
2602+
2603By default, `$site_path/etc/crl.pem`.
2604
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002605[[httpd.sslKeyStore]]httpd.sslKeyStore::
2606+
2607Path of the Java keystore containing the server's SSL certificate
2608and private key. This keystore is required for `https://` in URL.
2609+
2610To create a self-signed certificate for simple internal usage:
2611+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002612----
2613keytool -keystore keystore -alias jetty -genkey -keyalg RSA
2614chmod 600 keystore
2615----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002616+
2617If not absolute, the path is resolved relative to `$site_path`.
2618+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002619By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002620
2621[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
2622+
2623Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09002624Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002625doesn't want to enable one.
2626+
2627If set to the empty string the embedded server will prompt for the
2628password during startup.
2629+
2630By default, `gerrit`.
2631
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002632[[httpd.requestLog]]httpd.requestLog::
2633+
2634Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
2635If enabled, an NCSA combined log format request log file is written
Matthias Sohn450bc202020-08-20 14:40:32 +02002636out by the internal HTTP daemon. The httpd log format is documented
2637link:logs.html#_httpd_log[here].
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002638+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01002639`log4j.appender` with the name `httpd_log` can be configured to overwrite
2640programmatic configuration.
2641+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002642By default, true if httpd.listenUrl uses http:// or https://,
2643and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
2644
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002645[[httpd.acceptorThreads]]httpd.acceptorThreads::
2646+
2647Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09002648connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002649+
2650By default, 2, which should be suitable for most high-traffic sites.
2651
2652[[httpd.minThreads]]httpd.minThreads::
2653+
2654Minimum number of spare threads to keep in the worker thread pool.
2655This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09002656multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002657+
2658By default, 5, suitable for most lower-volume traffic sites.
2659
2660[[httpd.maxThreads]]httpd.maxThreads::
2661+
2662Maximum number of threads to permit in the worker thread pool.
2663+
2664By default 25, suitable for most lower-volume traffic sites.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02002665+
2666[NOTE]
2667Unless SSH daemon is disabled, see <<sshd.listenAddress, sshd.listenAddress>>,
2668the max number of concurrent Git requests over HTTP and SSH together is
2669defined by the <<sshd.threads, sshd.threads>> and
2670<<sshd.batchThreads, sshd.batchThreads>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002671
2672[[httpd.maxQueued]]httpd.maxQueued::
2673+
2674Maximum number of client connections which can enter the worker
2675thread pool waiting for a worker thread to become available.
David Ostrovsky14fe8bc2014-03-26 06:03:44 -070026760 sets the queue size to the Integer.MAX_VALUE.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002677+
Luca Milanesio0ae62fe2015-09-04 07:56:00 -07002678By default 200.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002679
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002680[[httpd.maxWait]]httpd.maxWait::
2681+
David Pursehouse221d4f62012-06-08 17:38:08 +09002682Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002683thread to handle a project clone, fetch or push request over the
2684smart HTTP transport.
2685+
2686Values should use common unit suffixes to express their setting:
2687+
2688* s, sec, second, seconds
2689* m, min, minute, minutes
2690* h, hr, hour, hours
2691* d, day, days
2692* w, week, weeks (`1 week` is treated as `7 days`)
2693* mon, month, months (`1 month` is treated as `30 days`)
2694* y, year, years (`1 year` is treated as `365 days`)
2695
2696+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002697--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002698If a unit suffix is not specified, `minutes` is assumed. If 0
2699is supplied, the maximum age is infinite and connections will not
2700abort until the client disconnects.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002701
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002702By default, 5 minutes.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002703--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002704
Luca Milanesioce7b7452013-06-18 11:40:49 +01002705[[httpd.filterClass]]httpd.filterClass::
2706+
2707Class that implements the javax.servlet.Filter interface
2708for filtering any HTTP related traffic going through the Gerrit
2709HTTP protocol.
2710Class is loaded and configured in the Gerrit Jetty container
2711and run in front of all Gerrit URL handlers, allowing the filter
2712to inspect, modify, allow or reject each request.
2713It needs to be provided as JAR library
2714under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
2715loader and cannot be dynamically loaded by a plugin.
2716+
2717Failing to load the Filter class would result in a Gerrit start-up
2718failure, as this class is supposed to provide mandatory filtering
2719in front of Gerrit HTTP protocol.
2720+
David Pursehouse42f42042013-08-01 14:02:25 +09002721Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01002722of an Apache HTTP proxy layer as security enforcement on top of Gerrit
2723by returning a trusted username as HTTP Header.
2724+
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002725Allow multiple values to install multiple servlet filters.
2726+
Luca Milanesioce7b7452013-06-18 11:40:49 +01002727Example of using a security library secure.jar under $GERRIT_SITE/lib
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002728that provides a org.anyorg.MySecureHeaderFilter Servlet Filter that enforces
2729a trusted username in the `TRUSTED_USER` HTTP Header and
2730org.anyorg.MySecureIPFilter that performs source IP security filtering:
Dyrone Teng14fc0832019-09-27 16:59:02 +08002731+
Luca Milanesioce7b7452013-06-18 11:40:49 +01002732----
2733[auth]
2734 type = HTTP
2735 httpHeader = TRUSTED_USER
2736
Dariusz Lukszaaac01132015-02-11 12:13:07 +01002737[httpd]
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002738 filterClass = org.anyorg.MySecureHeaderFilter
2739 filterClass = org.anyorg.MySecureIPFilter
Luca Milanesioce7b7452013-06-18 11:40:49 +01002740----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002741
Luca Milanesiodca95d52017-05-09 21:22:21 +01002742[[httpd.idleTimeout]]httpd.idleTimeout::
2743+
2744Maximum idle time for a connection, which roughly translates to the
2745TCP socket `SO_TIMEOUT`.
2746+
Luca Milanesiodca95d52017-05-09 21:22:21 +01002747This value is interpreted as the maximum time between some progress
2748being made on the connection. So if a single byte is read or written,
2749then the timeout is reset.
2750+
David Pursehouse9f0e5bc2017-06-30 16:16:53 +09002751The max idle time is applied:
2752+
2753* When waiting for a new message to be received on a connection
2754* When waiting for a new message to be sent on a connection
2755
2756+
Luca Milanesiodca95d52017-05-09 21:22:21 +01002757By default, 30 seconds.
2758
Juan Hernandezec512562013-08-06 16:30:50 +02002759[[httpd.robotsFile]]httpd.robotsFile::
2760+
2761Location of an external robots.txt file to be used instead of the one
2762bundled with the .war of the application.
2763+
2764If not absolute, the path is resolved relative to `$site_path`.
2765+
2766If the file doesn't exist or can't be read the default robots.txt file
2767bundled with the .war will be used instead.
2768
Dariusz Luksza011cfed2014-04-03 10:23:35 +02002769[[httpd.registerMBeans]]httpd.registerMBeans::
2770+
2771Enable (or disable) registration of Jetty MBeans for Java JMX.
2772+
2773By default, false.
2774
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002775[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002776=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09002777
2778The index section configures the secondary index.
2779
David Pursehouse3fc5ee32014-03-17 18:35:32 +09002780Note that after enabling the secondary index, the index must be built
2781using the link:pgm-reindex.html[reindex program] before restarting the
2782Gerrit server.
2783
David Pursehouse6d458432013-08-23 16:17:18 +09002784[[index.type]]index.type::
2785+
2786Type of secondary indexing employed by Gerrit. The supported
2787values are:
2788+
2789* `LUCENE`
2790+
2791A link:http://lucene.apache.org/[Lucene] index is used.
2792+
David Pursehouse8e72f532014-06-24 11:01:28 +09002793+
Dariusz Lukszaea529882017-04-25 15:11:31 +02002794* `ELASTICSEARCH` look into link:#elasticsearch[Elasticsearch section]
David Pursehouse8e72f532014-06-24 11:01:28 +09002795+
David Pursehoused09c5942018-04-20 10:22:31 +02002796An link:https://www.elastic.co/products/elasticsearch[Elasticsearch] index is
David Pursehouse2e79e5b2018-04-20 10:23:29 +02002797used. Refer to the link:#elasticsearch[Elasticsearch section] for further
2798configuration details.
David Pursehouse6d458432013-08-23 16:17:18 +09002799
2800+
Shawn Pearced4ae3a162013-11-24 17:00:31 -08002801By default, `LUCENE`.
David Pursehouse6d458432013-08-23 16:17:18 +09002802
David Pursehouse904db302014-03-17 18:55:38 +09002803[[index.threads]]index.threads::
2804+
Hugo Arèsfab06702016-06-10 12:49:52 -04002805Number of threads to use for indexing in normal interactive operations. Setting
2806it to 0 disables the dedicated thread pool and indexing will be done in the same
2807thread as the operation.
David Pursehouse904db302014-03-17 18:55:38 +09002808+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02002809If not set or set to a zero, defaults to the number of logical CPUs as returned
2810by the JVM. If set to a negative value, defaults to a direct executor.
David Pursehouse00c82142014-01-22 17:41:09 +09002811
Dave Borowitz787af5f2014-10-22 16:26:00 -07002812[[index.batchThreads]]index.batchThreads::
2813+
2814Number of threads to use for indexing in background operations, such as
Christian Aistleitner6e3c1a12020-06-14 20:57:00 +02002815online schema upgrades, and also for offline reindexing.
Dave Borowitz787af5f2014-10-22 16:26:00 -07002816+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02002817If not set or set to a zero, defaults to the number of logical CPUs as returned
2818by the JVM. If set to a negative value, defaults to a direct executor.
Dave Borowitz787af5f2014-10-22 16:26:00 -07002819
Dave Borowitzd80b9342015-03-25 10:32:21 -07002820[[index.onlineUpgrade]]index.onlineUpgrade::
2821+
2822Whether to upgrade to new index schema versions while the server is
2823running. This is recommended as it prevents additional downtime during
2824Gerrit version upgrades (avoiding the need for an offline reindex step
2825using Reindex), but can add additional server load during the upgrade.
2826+
2827If set to false, there is no way to upgrade the index schema to take
2828advantage of new search features without restarting the server.
2829+
2830Defaults to true.
2831
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07002832[[index.maxLimit]]index.maxLimit::
2833+
2834Maximum limit to allow for search queries. Requesting results above this
2835limit will truncate the list (but will still set `_more_changes` on
2836result lists). Set to 0 for no limit.
2837+
David Pursehouse7c1f4a42018-03-15 17:03:40 +09002838When `index.type` is set to `ELASTICSEARCH`, this value should not exceed
2839the `index.max_result_window` value configured on the Elasticsearch
David Pursehouse52c2b4a2018-04-10 23:38:57 +09002840server. If a value is not configured during site initialization, defaults to
284110000, which is the default value of `index.max_result_window` in Elasticsearch.
David Pursehouse7c1f4a42018-03-15 17:03:40 +09002842+
David Pursehouse52c2b4a2018-04-10 23:38:57 +09002843When `index.type` is set to `LUCENE`, defaults to no limit.
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07002844
Dave Borowitzf56d3652015-04-22 17:35:34 -07002845[[index.maxPages]]index.maxPages::
2846+
2847Maximum number of pages of search results to allow, as index
2848implementations may have to scan through large numbers of skipped
2849results when searching with an offset. Requesting results starting past
2850this threshold times the requested limit will result in an error. Set to
28510 for no limit.
2852+
2853Defaults to no limit.
2854
Dave Borowitzd034ca82015-10-15 11:20:30 -04002855[[index.maxTerms]]index.maxTerms::
2856+
2857Maximum number of leaf terms to allow in a query. Too-large queries may
2858perform poorly, so setting this option causes query parsing to fail fast
Dave Borowitzada289c2018-12-18 13:24:14 -08002859before attempting to send them to the secondary index.
Dave Borowitzd034ca82015-10-15 11:20:30 -04002860+
Marco Miller6da22822016-01-29 12:31:38 -05002861When the index type is `LUCENE`, also sets the maximum number of clauses
2862permitted per BooleanQuery. This is so that all enforced query limits
2863are the same.
2864+
2865Defaults to 1024.
Dave Borowitzd034ca82015-10-15 11:20:30 -04002866
Dave Borowitz61155622017-04-17 16:53:13 -04002867[[index.reindexAfterRefUpdate]]index.reindexAfterRefUpdate::
2868+
2869Whether to reindex all affected open changes after a ref is updated. This
2870includes reindexing all open changes to recompute the "mergeable" bit every time
2871the destination branch moves, as well as reindexing changes to take into account
2872new project configuration (e.g. label definitions).
2873+
2874Leaving this enabled may result in fresher results, but may cause performance
2875problems if there are lots of open changes on a project whose branches advance
2876frequently.
2877+
2878Defaults to true.
2879
Dave Borowitz3747f0f2017-06-23 14:29:31 -04002880[[index.autoReindexIfStale]]index.autoReindexIfStale::
2881+
2882Whether to automatically check if a document became stale in the index
2883immediately after indexing it. If false, there is a race condition during two
2884simultaneous writes that may cause one of the writes to not be reflected in the
2885index. The check to avoid this does consume some resources.
2886+
Dave Borowitzb7da0762018-03-19 09:08:45 -04002887Defaults to false.
Dave Borowitz3747f0f2017-06-23 14:29:31 -04002888
Edwin Kempin0f0de862018-02-08 16:24:11 +01002889[[index.scheduledIndexer]]
2890==== Subsection index.scheduledIndexer
2891
2892This section configures periodic indexing. Periodic indexing is
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002893intended to run only on replicas and only updates the group index.
2894Replication to replicas happens on Git level so that Gerrit is not aware
2895of incoming replication events. But replicas need an updated group index
Edwin Kempin0f0de862018-02-08 16:24:11 +01002896to resolve memberships of users for ACL validation. To keep the group
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002897index in replicas up-to-date the Gerrit replica periodically scans the
Edwin Kempin0f0de862018-02-08 16:24:11 +01002898group refs in the All-Users repository to reindex groups if they are
2899stale.
2900
2901The scheduled reindexer is not able to detect group deletions that
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002902happened while the replica was offline, but since group deletions are not
Edwin Kempin0f0de862018-02-08 16:24:11 +01002903supported this should never happen. If nevertheless groups refs were
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002904deleted while a replica was offline a full offline link:pgm-reindex.html[
Edwin Kempin0f0de862018-02-08 16:24:11 +01002905reindex] must be performed.
2906
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002907This section is only used if Gerrit runs in replica mode, otherwise it is
Edwin Kempin0f0de862018-02-08 16:24:11 +01002908ignored.
2909
Edwin Kempina32d4432018-02-16 17:18:31 +01002910[[index.scheduledIndexer.runOnStartup]]index.scheduledIndexer.runOnStartup::
2911+
2912Whether the scheduled indexer should run once immediately on startup.
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002913If set to `true` the replica startup is blocked until all stale groups
2914were reindexed. Enabling this allows to prevent that replicas that were
Edwin Kempina32d4432018-02-16 17:18:31 +01002915offline for a longer period of time run with outdated group information
2916until the first scheduled indexing is done.
2917+
2918Defaults to `true`.
2919
Edwin Kempin0f0de862018-02-08 16:24:11 +01002920[[index.scheduledIndexer.enabled]]index.scheduledIndexer.enabled::
2921+
2922Whether the scheduled indexer is enabled. If the scheduled indexer is
2923disabled you must implement other means to keep the group index for the
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002924replica up-to-date (e.g. by using ElasticSearch for the indexes).
Edwin Kempin0f0de862018-02-08 16:24:11 +01002925+
2926Defaults to `true`.
2927
2928[[index.scheduledIndexer.startTime]]index.scheduledIndexer.startTime::
2929+
2930The link:#schedule-configuration-startTime[start time] for running
2931the scheduled indexer.
2932+
2933Defaults to `00:00`.
2934
2935[[index.scheduledIndexer.interval]]index.scheduledIndexer.interval::
2936+
2937The link:#schedule-configuration-interval[interval] for running
2938the scheduled indexer.
2939+
2940Defaults to `5m`.
2941
2942link:#schedule-configuration-examples[Schedule examples] can be found
2943in the link:#schedule-configuration[Schedule Configuration] section.
2944
David Pursehouse902b3ee2014-07-09 16:17:49 +09002945==== Lucene configuration
2946
2947Open and closed changes are indexed in separate indexes named
2948'open' and 'closed' respectively.
2949
2950The following settings are only used when the index type is `LUCENE`.
David Pursehouseac88c362014-02-06 12:01:34 +09002951
David Pursehouse00c82142014-01-22 17:41:09 +09002952[[index.name.ramBufferSize]]index.name.ramBufferSize::
2953+
David Pursehouse00c82142014-01-22 17:41:09 +09002954Determines the amount of RAM that may be used for buffering added documents
2955and deletions before they are flushed to the index. See the
2956link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
2957Lucene documentation] for further details.
2958+
2959Defaults to 16M.
2960
2961[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
2962+
David Pursehouse00c82142014-01-22 17:41:09 +09002963Determines the minimal number of documents required before the buffered
2964in-memory documents are flushed to the index. Large values generally
2965give faster indexing. See the
2966link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
2967Lucene documentation] for further details.
2968+
2969Defaults to -1, meaning no maximum is set and the writer will flush
2970according to RAM usage.
2971
Dave Borowitzd08b0452014-02-13 11:56:03 -08002972[[index.name.commitWithin]]index.name.commitWithin::
2973+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002974Determines the period at which changes are automatically committed to
2975stable store on disk. This is a costly operation and may block
2976additional index writes, so lower with caution.
2977+
Bruce Zuaf058e62014-03-21 10:03:05 +08002978If zero, changes are committed after every write. This is very costly
2979but may be useful if offline reindexing is infeasible, or for development
2980servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08002981+
Bruce Zuaf058e62014-03-21 10:03:05 +08002982Values can be specified using standard time unit abbreviations (`ms`, `sec`,
2983`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07002984+
Bruce Zuaf058e62014-03-21 10:03:05 +08002985If negative, `commitWithin` is disabled. Changes are flushed to disk when
2986the in-memory buffer fills, but only committed and guaranteed to be synced
2987to disk when the process finishes.
David Pursehouse902b3ee2014-07-09 16:17:49 +09002988+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002989Defaults to 300000 ms (5 minutes).
2990
Trevor Getty8fb5db52019-08-26 14:33:19 +02002991
2992[[index.name.maxMergeCount]]index.name.maxMergeCount::
2993+
2994Determines the max number of simultaneous merges that are allowed. If a merge
2995is necessary yet we already have this many threads running, the incoming thread
2996(that is calling add/updateDocument) will block until a merge thread has
2997completed. Note that Lucene will only run the smallest maxThreadCount merges
2998at a time. See the
2999link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
3000Lucene documentation] for further details.
3001+
3002Defaults to -1 for (auto detection).
3003
3004
3005[[index.name.maxThreadCount]]index.name.maxThreadCount::
3006+
3007Determines the max number of simultaneous Lucene merge threads that should be running at
3008once. This must be less than or equal to maxMergeCount. See the
3009link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
3010Lucene documentation] for further details.
3011+
3012For further details on Lucene index configuration (auto detection) which
3013affects maxThreadCount and maxMergeCount settings.
3014See the
3015link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#AUTO_DETECT_MERGES_AND_THREADS[
3016Lucene documentation]
3017+
3018Defaults to -1 for (auto detection).
3019
3020[[index.name.enableAutoIOThrottle]]index.name.enableAutoIOThrottle::
3021+
3022Allows the control of whether automatic IO throttling is enabled and used by
3023default in the lucene merge queue. Automatic dynamic IO throttling, which when
3024on is used to adaptively rate limit writes bytes/sec to the minimal rate necessary
3025so merges do not fall behind. See the
3026link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#enableAutoIOThrottle()[
3027Lucene documentation] for further details.
3028+
3029Defaults to true (throttling enabled).
3030
David Pursehouse902b3ee2014-07-09 16:17:49 +09003031Sample Lucene index configuration:
David Pursehouse00c82142014-01-22 17:41:09 +09003032----
3033[index]
3034 type = LUCENE
3035
3036[index "changes_open"]
3037 ramBufferSize = 60 m
3038 maxBufferedDocs = 3000
Trevor Getty8fb5db52019-08-26 14:33:19 +02003039 maxThreadCount = 5
3040 maxMergeCount = 50
3041
David Pursehouse00c82142014-01-22 17:41:09 +09003042
3043[index "changes_closed"]
3044 ramBufferSize = 20 m
3045 maxBufferedDocs = 500
Trevor Getty8fb5db52019-08-26 14:33:19 +02003046 maxThreadCount = 10
3047 maxMergeCount = 100
3048 enableIOThrottle = false
3049
David Pursehouse00c82142014-01-22 17:41:09 +09003050----
3051
Dariusz Lukszaea529882017-04-25 15:11:31 +02003052[[elasticsearch]]
3053=== Section elasticsearch
David Pursehouse8e72f532014-06-24 11:01:28 +09003054
David Pursehouse1a82b372018-06-19 11:14:21 +09003055WARNING: Support for Elasticsearch is still experimental and is not recommended
David Pursehouse7e566dc2018-09-20 14:12:15 +09003056for production use. For compatibility information, please refer to the
3057link:https://www.gerritcodereview.com/elasticsearch.html[project homepage].
David Pursehouse8e72f532014-06-24 11:01:28 +09003058
David Pursehouse6ea25322018-07-03 21:26:07 +09003059Note that when Gerrit is configured to use Elasticsearch, the Elasticsearch
3060server(s) must be reachable during the site initialization.
3061
Dariusz Lukszaea529882017-04-25 15:11:31 +02003062[[elasticsearch.prefix]]elasticsearch.prefix::
David Pursehouse8e72f532014-06-24 11:01:28 +09003063+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08003064This setting can be used to prefix index names to allow multiple Gerrit
David Pursehouse997cf2a2018-05-10 15:40:47 +09003065instances in a single Elasticsearch cluster. Prefix `gerrit1_` would result in a
3066change index named `gerrit1_changes_0001`.
David Pursehouse8e72f532014-06-24 11:01:28 +09003067+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08003068Not set by default.
David Pursehouse8e72f532014-06-24 11:01:28 +09003069
David Pursehouse479c50b2018-07-02 12:47:07 +09003070[[elasticsearch.server]]elasticsearch.server::
Dariusz Lukszaea529882017-04-25 15:11:31 +02003071+
David Pursehouse479c50b2018-07-02 12:47:07 +09003072Elasticsearch server URI in the form `http[s]://hostname:port`. The `port` is
3073optional and defaults to `9200` if not specified.
Dariusz Lukszaea529882017-04-25 15:11:31 +02003074+
David Pursehouse479c50b2018-07-02 12:47:07 +09003075At least one server must be specified. May be specified multiple times to
3076configure multiple Elasticsearch servers.
Dariusz Lukszaea529882017-04-25 15:11:31 +02003077+
David Pursehouse479c50b2018-07-02 12:47:07 +09003078Note that the site initialization program only allows to configure a single
3079server. To configure multiple servers the `gerrit.config` file must be edited
3080manually.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003081
David Pursehouse499f7fe2018-11-30 16:07:21 +09003082[[elasticsearch.numberOfShards]]elasticsearch.numberOfShards::
3083+
3084Sets the number of shards to use per index. Refer to the
Dyrone Tengae8babd2020-03-18 16:06:29 +08003085link:https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#_static_index_settings[
David Pursehouse499f7fe2018-11-30 16:07:21 +09003086Elasticsearch documentation] for details.
3087+
Marco Miller9caa81a2020-12-06 16:10:20 -05003088Defaults to 1.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003089
3090[[elasticsearch.numberOfReplicas]]elasticsearch.numberOfReplicas::
3091+
3092Sets the number of replicas to use per index. Refer to the
Dyrone Tengae8babd2020-03-18 16:06:29 +08003093link:https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings[
David Pursehouse499f7fe2018-11-30 16:07:21 +09003094Elasticsearch documentation] for details.
3095+
3096Defaults to 1.
3097
Dyrone Teng76fed532020-03-18 11:20:03 +08003098[[elasticsearch.maxResultWindow]]elasticsearch.maxResultWindow::
3099+
3100Sets the maximum value of `from + size` for searches to use per index. Refer to the
3101link:https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings[
3102Elasticsearch documentation] for details.
3103+
3104Defaults to 10000.
3105
David Pursehouse13f1d632018-07-02 14:37:36 +09003106==== Elasticsearch Security
Dariusz Lukszaea529882017-04-25 15:11:31 +02003107
David Pursehouse13f1d632018-07-02 14:37:36 +09003108When security is enabled in Elasticsearch, the username and password must be provided.
3109Note that the same username and password are used for all servers.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003110
Marco Milleree4eefc2020-07-29 16:24:59 -04003111For further information about Elasticsearch security, please refer to
3112link:https://www.elastic.co/guide/en/elasticsearch/reference/current/security-getting-started.html[the documentation].
3113This is the current documentation link. Select another Elasticsearch version
3114from the dropdown menu available on that page if need be.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003115
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003116[[elasticsearch.username]]elasticsearch.username::
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003117+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003118Username used to connect to Elasticsearch.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003119+
David Pursehouse975fdd22018-07-02 14:23:07 +09003120If a password is set, defaults to `elastic`, otherwise not set by default.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003121
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003122[[elasticsearch.password]]elasticsearch.password::
3123+
3124Password used to connect to Elasticsearch.
3125+
3126Not set by default.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003127
Patrick Hieselda692472019-10-07 16:03:23 +02003128[[event]]
3129=== Section event
3130
3131[[event.payload.listChangeOptions]]events.payload.listChangeOptions::
3132+
3133List of options that Gerrit applies when rendering the payload of an
3134internal event. This is the same set of options that are documented
3135link:rest-api-changes.html#query-options[here].
3136+
3137Depending on the setup, these events might get serialized using stream
3138events.
3139+
3140This can be set to the set of minimal options that consumers of Gerrit's
3141events need. A minimal set would be (`SKIP_MERGEABLE`,`SKIP_DIFFSTAT`).
3142+
3143Every option that gets added here will have a performance impact. The
3144general recommendation is therefore to set this to a minimal set of
3145required options.
3146+
3147Defaults to all available options minus `CHANGE_ACTIONS`,
3148`CURRENT_ACTIONS` and `CHECK`. This is a rich default to make sure the
3149config is backwards compatible with what the default was before the config
3150was added.
3151
3152
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003153[[ldap]]
3154=== Section ldap
3155
3156LDAP integration is only enabled if `auth.type` is set to
3157`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
3158detailed description of the `auth.type` settings and their
3159implications.
3160
3161An example LDAP configuration follows, and then discussion of
3162the parameters introduced here. Suitable defaults for most
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003163parameters are automatically guessed based on the type of server
Michal Pasierb3e262742017-01-23 12:50:48 +01003164detected during startup. The guessed defaults support
3165link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307], Active
3166Directory and link:https://www.freeipa.org[FreeIPA].
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003167
3168----
3169[ldap]
3170 server = ldap://ldap.example.com
3171
3172 accountBase = ou=people,dc=example,dc=com
3173 accountPattern = (&(objectClass=person)(uid=${username}))
3174 accountFullName = displayName
3175 accountEmailAddress = mail
3176
3177 groupBase = ou=groups,dc=example,dc=com
3178 groupMemberPattern = (&(objectClass=group)(member=${dn}))
3179----
3180
Luca Milanesioa05d42b2018-12-19 01:13:06 +00003181[[ldap.guessRelevantGroups]]ldap.guessRelevantGroups::
3182+
3183Filter the groups found in LDAP by guessing the ones relevant to
3184Gerrit and removing the others from list completions and ACL evaluations.
3185The guess is based on two elements: the projects most recently
3186accessed in the cache and the list of LDAP groups included in their ACLs.
3187+
3188Please note that projects rarely used and thus not cached may be
3189temporarily inaccessible by users even with LDAP membership and grants
3190referenced in the ACLs.
3191+
3192By default, true.
3193
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003194[[ldap.server]]ldap.server::
3195+
3196URL of the organization's LDAP server to query for user information
3197and group membership from. Must be of the form `ldap://host` or
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003198`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003199+
3200If `auth.type` is `LDAP` this setting should use `ldaps://` to
3201ensure the end user's plaintext password is transmitted only over
3202an encrypted connection.
3203
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003204[[ldap.startTls]]ldap.startTls::
3205+
3206If true, Gerrit will perform StartTLS extended operation.
3207+
3208By default, false, StartTLS will not be enabled.
3209
Alon Bar-Leve39c35c2019-06-10 12:59:55 +03003210[[ldap.supportAnonymous]]ldap.supportAnonymous::
3211+
3212If false, Gerrit will provide credentials only at connection open, this is
3213required for some `LDAP` implementations that do not allow anonymous bind
3214for StartTLS or for reauthentication.
3215+
3216By default, true.
3217
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003218[[ldap.sslVerify]]ldap.sslVerify::
3219+
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003220If false and ldap.server is an `ldaps://` style URL or `ldap.startTls`
3221is true, Gerrit will not verify the server certificate when it connects
3222to perform a query.
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003223+
3224By default, true, requiring the certificate to be verified.
3225
Olga Grinbergcf1b06a2015-02-03 15:54:48 -05003226[[ldap.groupsVisibleToAll]]ldap.groupsVisibleToAll::
3227+
3228If true, LDAP groups are visible to all registered users.
3229+
3230By default, false, LDAP groups are visible only to administrators and
3231group members.
3232
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003233[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003234+
3235_(Optional)_ Username to bind to the LDAP server with. If not set,
3236an anonymous connection to the LDAP server is attempted.
3237
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003238[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003239+
3240_(Optional)_ Password for the user identified by `ldap.username`.
3241If not set, an anonymous (or passwordless) connection to the LDAP
3242server is attempted.
3243
Ben Wu0410a152010-06-04 16:17:24 +08003244[[ldap.referral]]ldap.referral::
3245+
3246_(Optional)_ How an LDAP referral should be handled if it is
3247encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05003248automatically follow any referrals, or `ignore` to ignore the
3249referrals.
Ben Wu0410a152010-06-04 16:17:24 +08003250+
3251By default, `ignore`.
3252
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003253[[ldap.readTimeout]]ldap.readTimeout::
3254+
3255_(Optional)_ The read timeout for an LDAP operation. The value is
3256in the usual time-unit format like "1 s", "100 ms", etc...
3257A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09003258threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003259+
3260By default there is no timeout and Gerrit will wait for the LDAP
3261server to respond until the TCP connection times out.
3262
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003263[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003264+
3265Root of the tree containing all user accounts. This is typically
3266of the form `ou=people,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003267+
3268This setting may be added multiple times to specify more than
3269one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003270
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003271[[ldap.accountScope]]ldap.accountScope::
3272+
3273Scope of the search performed for accounts. Must be one of:
3274+
3275* `one`: Search only one level below accountBase, but not recursive
3276* `sub` or `subtree`: Search recursively below accountBase
3277* `base` or `object`: Search exactly accountBase; probably not desired
3278
3279+
3280Default is `subtree` as many directories have several levels.
3281
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003282[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003283+
3284Query pattern to use when searching for a user account. This may be
3285any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09003286`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003287`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09003288that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02003289the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003290the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003291+
3292This pattern is used to search the objects contained directly under
3293the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02003294is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003295setting depends on the LDAP schema used by the directory server.
3296+
Michal Pasierb3e262742017-01-23 12:50:48 +01003297Default is `(uid=${username})` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003298and `(&(objectClass=user)(sAMAccountName=${username}))`
3299for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003300
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003301[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003302+
3303_(Optional)_ Name of an attribute on the user account object which
3304contains the initial value for the user's full name field in Gerrit.
3305Typically this is the `displayName` property in LDAP, but could
3306also be `legalName` or `cn`.
3307+
David Pursehouse221d4f62012-06-08 17:38:08 +09003308Attribute values may be concatenated with literal strings. For
3309example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02003310`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003311+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003312If set, users will be unable to modify their full name field, as
3313Gerrit will populate it only from the LDAP data.
3314+
Michal Pasierb3e262742017-01-23 12:50:48 +01003315Default is `displayName` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003316and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003317
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003318[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003319+
3320_(Optional)_ Name of an attribute on the user account object which
3321contains the user's Internet email address, as defined by this
3322LDAP server.
3323+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003324Attribute values may be concatenated with literal strings,
3325for example to set the email address to the lowercase form
3326of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02003327`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003328+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003329If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09003330but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003331and select a different preferred email address.
3332+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003333Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003334
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003335[[ldap.accountSshUserName]]ldap.accountSshUserName::
3336+
3337_(Optional)_ Name of an attribute on the user account object which
3338contains the initial value for the user's SSH username field in
3339Gerrit. Typically this is the `uid` property in LDAP, but could
3340also be `cn`. Administrators should prefer to match the attribute
3341corresponding to the user's workstation username, as this is what
3342SSH clients will default to.
3343+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003344Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02003345an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003346force the value of sAMAccountName, if defined, to be all lowercase.
3347The suffix `.toUpperCase` can be used for the other direction.
3348The suffix `.localPart` can be used to split attribute values of
3349the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02003350example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003351+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003352If set, users will be unable to modify their SSH username field, as
David Pursehousec12da502016-08-11 20:45:03 +09003353Gerrit will populate it only from the LDAP data. Note that once the
3354username has been set it cannot be changed, therefore it is
3355recommended not to make changes to this setting that would cause the
3356value to differ, as this will prevent users from logging in.
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003357+
Michal Pasierb3e262742017-01-23 12:50:48 +01003358Default is `uid` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003359and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003360
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003361[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04003362+
3363_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003364contains the groups the user is part of. Typically used for Active
Michal Pasierb3e262742017-01-23 12:50:48 +01003365Directory and FreeIPA servers.
Anthony93de7db2009-10-03 10:01:50 -04003366+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003367Default is unset for RFC 2307 servers (disabled)
Michal Pasierb3e262742017-01-23 12:50:48 +01003368and `memberOf` for Active Directory and FreeIPA.
3369
3370[[ldap.accountMemberExpandGroups]]ldap.accountMemberExpandGroups::
3371+
3372_(Optional)_ Whether to expand nested groups recursively. This
3373setting is used only if `ldap.accountMemberField` is set.
3374+
3375Default is unset for FreeIPA and `true` for RFC 2307 servers
3376and Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04003377
Saša Živkovc81291f2015-02-04 17:19:20 +01003378[[ldap.fetchMemberOfEagerly]]ldap.fetchMemberOfEagerly::
3379+
3380_(Optional)_ Whether to fetch the `memberOf` account attribute on
3381login. Setups which use LDAP for user authentication but don't make
3382use of the LDAP groups may benefit from setting this option to `false`
3383as this will result in a much faster LDAP login.
3384+
3385Default is unset for RFC 2307 servers (disabled) and `true` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003386Active Directory and FreeIPA.
Saša Živkovc81291f2015-02-04 17:19:20 +01003387
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003388[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003389+
3390Root of the tree containing all group objects. This is typically
3391of the form `ou=groups,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003392+
3393This setting may be added multiple times to specify more than
3394one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003395
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003396[[ldap.groupScope]]ldap.groupScope::
3397+
3398Scope of the search performed for group objects. Must be one of:
3399+
3400* `one`: Search only one level below groupBase, but not recursive
3401* `sub` or `subtree`: Search recursively below groupBase
3402* `base` or `object`: Search exactly groupBase; probably not desired
3403
3404+
3405Default is `subtree` as many directories have several levels.
3406
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003407[[ldap.groupPattern]]ldap.groupPattern::
3408+
3409Query pattern used when searching for an LDAP group to connect
3410to a Gerrit group. This may be any valid LDAP query expression,
3411including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003412`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003413group owner.
3414+
Michal Pasierb3e262742017-01-23 12:50:48 +01003415Default is `(cn=${groupname})` for FreeIPA and RFC 2307 servers,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003416and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003417
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003418[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003419+
3420Query pattern to use when searching for the groups that a user
3421account is currently a member of. This may be any valid LDAP query
3422expression, including the standard `(&...)` and `(|...)` operators.
3423+
David Pursehouse42f42042013-08-01 14:02:25 +09003424If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003425replaced with a parameter set to the username that was supplied
3426by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003427such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003428corresponding attribute (in this case, `fooBarAttribute`) as read
3429from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02003430Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003431+
Scott Dial50457502013-08-11 16:52:51 -04003432Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003433RFC 2307, and unset (disabled) for Active Directory and FreeIPA.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003434
Auke Schrijnen57809132012-09-26 21:05:39 +02003435[[ldap.groupName]]ldap.groupName::
3436+
David Pursehouse39489ae2012-10-12 13:50:04 +09003437_(Optional)_ Name of the attribute on the group object which contains
3438the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02003439+
David Pursehouse39489ae2012-10-12 13:50:04 +09003440Typically the attribute name is `cn` for RFC 2307 and Active Directory
3441servers. For other servers the attribute name may differ, for example
3442`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02003443+
David Pursehouse39489ae2012-10-12 13:50:04 +09003444It is also possible to specify a literal string containing a pattern of
3445attribute values. For example to create a Gerrit group name consisting of
3446LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
3447+
3448Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02003449
Gustaf Lundhdaf41af2016-12-05 19:05:09 +01003450[[ldap.mandatoryGroup]]ldap.mandatoryGroup::
3451+
3452All users must be a member of this group to allow account creation or
3453authentication.
3454+
3455Setting mandatoryGroup implies enabling of `ldap.fetchMemberOfEagerly`
3456+
3457By default, unset.
3458
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003459[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
3460+
3461Converts the local username, that is used to login into the Gerrit
David Pursehousea1d633b2014-05-02 17:21:02 +09003462Web UI, to lower case before doing the LDAP authentication. By setting
3463this parameter to true, a case insensitive login to the Gerrit Web UI
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003464can be achieved.
3465+
3466If set, it must be ensured that the local usernames for all existing
3467accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09003468local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003469anymore. The local usernames for the existing accounts can be
3470converted to lower case by running the server program
3471link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
3472Please be aware that the conversion of the local usernames to lower
3473case can't be undone. For newly created accounts the local username
3474will be directly stored in lower case.
3475+
3476By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003477
Robin Rosenberga3baed02012-10-14 14:09:32 +02003478[[ldap.authentication]]ldap.authentication::
3479+
3480Defines how Gerrit authenticates with the server. When set to `GSSAPI`
3481Gerrit will use Kerberos. To use kerberos the
3482`java.security.auth.login.config` system property must point to a
3483login to a JAAS configuration file and, if Java 6 is used, the system
3484property `java.security.krb5.conf` must point to the appropriate
3485krb5.ini file with references to the KDC.
3486
3487Typical jaas.conf.
3488
3489----
3490KerberosLogin {
3491 com.sun.security.auth.module.Krb5LoginModule
3492 required
3493 useTicketCache=true
3494 doNotPrompt=true
3495 renewTGT=true;
3496};
3497----
3498
3499See Java documentation on how to create the krb5.ini file.
3500
3501Note the `renewTGT` property to make sure the TGT does not expire,
3502and `useTicketCache` to use the TGT supplied by the operating system. As
3503the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09003504to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02003505
3506On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
3507must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
3508have local administrator privileges.
3509
Bruce Zucd04bbc2014-07-25 15:48:09 +08003510[[ldap.useConnectionPooling]]ldap.useConnectionPooling::
3511+
3512_(Optional)_ Enable the LDAP connection pooling or not.
3513+
3514If it is true, the LDAP service provider maintains a pool of (possibly)
3515previously used connections and assigns them to a Context instance as
3516needed. When a Context instance is done with a connection (closed or
3517garbage collected), the connection is returned to the pool for future use.
3518+
3519For details, see link:http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html[
3520LDAP connection management (Pool)] and link:http://docs.oracle.com/javase/tutorial/jndi/ldap/config.html[
3521LDAP connection management (Configuration)]
3522+
3523By default, false.
3524
3525[[ldap.connectTimeout]]ldap.connectTimeout::
3526+
Saša Živkov303701a2015-01-19 16:24:44 +01003527_(Optional)_ Timeout period for establishment of an LDAP connection.
Bruce Zucd04bbc2014-07-25 15:48:09 +08003528+
3529The value is in the usual time-unit format like "1 s", "100 ms",
3530etc...
3531+
3532By default there is no timeout and Gerrit will wait indefinitely.
3533
Saša Živkov5049f512015-01-19 17:04:43 +01003534[[ldap-connection-pooling]]
3535==== LDAP Connection Pooling
3536Once LDAP connection pooling is enabled by setting the link:#ldap.useConnectionPooling[
3537ldap.useConnectionPooling] configuration property to `true`, the connection pool
3538can be configured using JVM system properties as explained in the
3539link:http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-ldap.html#POOL[
3540Java SE Documentation].
Bruce Zucd04bbc2014-07-25 15:48:09 +08003541
Saša Živkov5049f512015-01-19 17:04:43 +01003542For standalone Gerrit (running with the embedded Jetty), JVM system properties
3543are specified in the link:#container[container section]:
Bruce Zucd04bbc2014-07-25 15:48:09 +08003544
Saša Živkov5049f512015-01-19 17:04:43 +01003545----
3546 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.maxsize=20
3547 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.prefsize=10
3548 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.timeout=300000
3549----
Bruce Zucd04bbc2014-07-25 15:48:09 +08003550
Saša Živkovca7a67e2015-12-01 14:25:10 +01003551[[lfs]]
3552=== Section lfs
3553
3554[[lfs.plugin]]lfs.plugin::
3555+
David Pursehouse2463c542016-08-02 16:04:58 +09003556The name of a plugin which serves the
3557link:https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md[
3558LFS protocol] on the `<project-name>/info/lfs/objects/batch` endpoint. When
3559not configured Gerrit will respond with `501 Not Implemented` on LFS protocol
3560requests.
Saša Živkovca7a67e2015-12-01 14:25:10 +01003561+
3562By default unset.
3563
Gustaf Lundhaef90122015-04-27 16:48:19 +02003564[[log]]
3565=== Section log
3566
3567[[log.jsonLogging]]log.jsonLogging::
3568+
Thomas Draebing6930b212020-02-13 17:51:42 +01003569If set to true, enables error, ssh and http logging in JSON format (file name:
3570"logs/{error|sshd|httpd}_log.json").
Gustaf Lundhaef90122015-04-27 16:48:19 +02003571+
3572Defaults to false.
3573
3574[[log.textLogging]]log.textLogging::
3575+
3576If set to true, enables error logging in regular plain text format. Can only be disabled
3577if `jsonLogging` is enabled.
3578+
3579Defaults to true.
3580
David Pursehouse2281fef2017-11-21 21:27:17 +09003581[[log.compress]]log.compress::
3582+
3583If set to true, log files are compressed at server startup and then daily at 11pm
3584(in the server's local time zone).
3585+
3586Defaults to true.
3587
David Pursehouse633fff32017-11-21 22:08:12 +09003588[[log.rotate]]log.rotate::
3589+
3590If set to true, log files are rotated daily at midnight (GMT).
3591+
3592Defaults to true.
3593
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003594[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003595=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003596
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003597[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003598+
3599If set to true, files with the MIME type `<name>` will be sent as
3600direct downloads to the user's browser, rather than being wrapped up
3601inside of zipped archives. The type name may be a complete type
Jonathan Nieder5758f182015-03-30 11:28:55 -07003602name, e.g. `image/gif`, a generic media type, e.g. `+image/*+`,
3603or the wildcard `+*/*+` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003604+
3605By default, false for all MIME types.
3606
3607Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003608----
3609[mimetype "image/*"]
3610 safe = true
3611
3612[mimetype "application/pdf"]
3613 safe = true
3614
3615[mimetype "application/msword"]
3616 safe = true
3617
3618[mimetype "application/vnd.ms-excel"]
3619 safe = true
3620----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003621
Dave Borowitzbc314912017-03-21 14:23:35 -07003622[[note-db]]
3623=== Section noteDb
3624
Dave Borowitzada289c2018-12-18 13:24:14 -08003625NoteDb is the Git-based database storage backend for Gerrit. For more
3626information, including how to migrate data from an older Gerrit version, see the
3627link:note-db.html[documentation].
Dave Borowitzbc314912017-03-21 14:23:35 -07003628
Edwin Kempin5be9c312017-07-07 10:40:55 +02003629[[notedb.accounts.sequenceBatchSize]]notedb.accounts.sequenceBatchSize::
3630+
Edwin Kempin311d5702017-07-28 15:10:24 +02003631The next available account sequence number is stored as UTF-8 text in a
3632blob pointed to by the `refs/sequences/accounts` ref in the `All-Users`
Edwin Kempin5be9c312017-07-07 10:40:55 +02003633repository. Multiple processes share the same sequence by incrementing
3634the counter using normal git ref updates. To amortize the cost of these
3635ref updates, processes increment the counter by a larger number and
3636hand out numbers from that range in memory until they run out. This
3637configuration parameter controls the size of the account ID batch that
3638each process retrieves at once.
3639+
Edwin Kempin5be9c312017-07-07 10:40:55 +02003640By default, 1.
3641
David Pursehouse05eaefe2020-06-02 15:42:46 +09003642[[notedb.changes.sequenceBatchSize]]notedb.changes.sequenceBatchSize::
3643+
3644The next available change sequence number is stored as UTF-8 text in a
3645blob pointed to by the `refs/sequences/changes` ref in the `All-Projects`
3646repository. Multiple processes share the same sequence by incrementing
3647the counter using normal git ref updates. To amortize the cost of these
3648ref updates, processes increment the counter by a larger number and
3649hand out numbers from that range in memory until they run out. This
3650configuration parameter controls the size of the change ID batch that
3651each process retrieves at once.
3652+
3653By default, 20.
Han-Wen Nienhuyse5ca19c2017-11-08 13:33:33 +01003654
Michael Ochmann69813262016-01-27 17:53:55 +01003655[[oauth]]
3656=== Section oauth
3657
3658OAuth integration is only enabled if `auth.type` is set to `OAUTH`. See
3659link:#auth.type[above] for a detailed description of the `auth.type` settings
3660and their implications.
3661
3662By default, contact information, like the full name and email address,
3663is retrieved from the selected OAuth provider when a user account is created,
3664or when a user requests to reload that information in the settings UI. If
3665that is not supported by the OAuth provider, users can be allowed to edit
3666their contact information manually.
3667
3668[[oauth.allowEditFullName]]oauth.allowEditFullName::
3669+
3670If true, the full name can be edited in the contact information.
3671+
3672Default is false.
3673
3674[[oauth.allowRegisterNewEmail]]oauth.allowRegisterNewEmail::
3675+
3676If true, additional email addresses can be registered in the contact
3677information.
3678+
3679Default is false.
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003680
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003681[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003682=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003683
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003684Global settings controlling how Gerrit Code Review creates pack
3685streams for Git clients running clone, fetch, or pull. Most of these
3686variables are per-client request, and thus should be carefully set
3687given the expected concurrent request load and available CPU and
3688memory resources.
3689
3690[[pack.deltacompression]]pack.deltacompression::
3691+
3692If true, delta compression between objects is enabled. This may
3693result in a smaller overall transfer for the client, but requires
3694more server memory and CPU time.
3695+
3696False (off) by default, matching Gerrit Code Review 2.1.4.
3697
3698[[pack.threads]]pack.threads::
3699+
3700Maximum number of threads to use for delta compression (if enabled).
3701This is per-client request. If set to 0 then the number of CPUs is
3702auto-detected and one thread per CPU is used, per client request.
3703+
3704By default, 1.
3705
3706
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003707[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003708=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003709
3710[[plugins.checkFrequency]]plugins.checkFrequency::
3711+
3712How often plugins should be examined for new plugins to load, removed
3713plugins to be unloaded, or updated plugins to be reloaded. Values can
3714be specified using standard time unit abbreviations ('ms', 'sec',
3715'min', etc.).
3716+
3717If set to 0, automatic plugin reloading is disabled. Administrators
Christian Aistleitner8ce1a4e2015-06-05 01:54:15 +02003718may force reloading with link:cmd-plugin-reload.html[gerrit plugin reload].
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003719+
3720Default is 1 minute.
3721
Shawn Pearcefd033502014-02-14 16:42:35 -08003722[[plugins.allowRemoteAdmin]]plugins.allowRemoteAdmin::
3723+
3724Enable remote installation, enable and disable of plugins over HTTP
3725and SSH. If set to true Administrators can install new plugins
3726remotely, or disable existing plugins. Defaults to false.
3727
Saša Živkov350fc682019-05-13 14:13:51 +02003728[[plugins.mandatory]]plugins.mandatory::
3729+
3730List of mandatory plugins. If a plugin from this list does not load,
David Pursehousef06aefb2019-10-18 20:39:53 +09003731Gerrit will fail to start.
3732+
3733Disabling and restarting of a mandatory plugin is rejected, but reloading
3734of a mandatory plugin is still possible.
Saša Živkov350fc682019-05-13 14:13:51 +02003735
Dariusz Luksza98f23522015-03-11 11:41:41 +01003736[[plugins.jsLoadTimeout]]plugins.jsLoadTimeout::
3737+
3738Set the timeout value for loading JavaScript plugins in Gerrit UI.
3739Values can be specified using standard time unit abbreviations ('ms',
3740'sec', 'min', etc.).
3741+
3742Default is 5 seconds. Negative values will be converted to 0.
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003743
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003744[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003745=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003746
Dave Borowitzff243892015-08-31 15:35:28 -04003747This section is used to configure behavior of the 'receive-pack'
3748handler, which responds to 'git push' requests.
lincoln2be11602010-07-05 10:53:25 -03003749
Dave Borowitzff243892015-08-31 15:35:28 -04003750[[receive.allowGroup]]receive.allowGroup::
Dave Borowitz532342bf2015-06-18 20:28:22 -04003751+
Dave Borowitzff243892015-08-31 15:35:28 -04003752Name of the groups of users that are allowed to execute
3753'receive-pack' on the server. One or more groups can be set.
Dave Borowitz532342bf2015-06-18 20:28:22 -04003754+
Dave Borowitzff243892015-08-31 15:35:28 -04003755If no groups are added, any user will be allowed to execute
3756'receive-pack' on the server.
Dave Borowitz532342bf2015-06-18 20:28:22 -04003757
3758[[receive.certNonceSeed]]receive.certNonceSeed::
3759+
3760If set to a non-empty value and server-side signed push validation is
3761link:#receive.enableSignedPush[enabled], use this value as the seed to
3762the HMAC SHA-1 nonce generator. If unset, a 64-byte random seed will be
3763generated at server startup.
3764+
3765As this is used as the seed of a cryptographic algorithm, it is
3766recommended to be placed in link:#secure-config[`secure.config`].
3767+
3768Defaults to unset.
3769
3770[[receive.certNonceSlop]]receive.certNonceSlop::
3771+
3772When validating the nonce passed as part of the signed push protocol,
3773accept valid nonces up to this many seconds old. This allows
3774certificate verification to work over HTTP where there is a lag between
3775the HTTP response providing the nonce to sign and the next request
3776containing the signed nonce. This can be significant on large
3777repositories, since the lag also includes the time to count objects on
3778the client.
3779+
3780Default is 5 minutes.
3781
Dave Borowitzff243892015-08-31 15:35:28 -04003782[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
3783+
3784Number of threads to perform change creation or patch set updates
3785concurrently. Each thread uses its own database connection from
3786the database connection pool, and if all threads are busy then
3787main receive thread will also perform a change creation or patch
3788set update.
3789+
3790Defaults to 1, using only the main receive thread. This feature is for
3791databases with very high latency that can benefit from concurrent
3792operations when multiple changes are impacted at once.
3793
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08003794[[receive.checkMagicRefs]]receive.checkMagicRefs::
3795+
3796If true, Gerrit will verify the destination repository has
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01003797no references under the magic 'refs/for' branch namespace. Names under
3798these locations confuse clients when trying to upload code reviews so
3799Gerrit requires them to be empty.
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08003800+
3801If false Gerrit skips the sanity check and assumes administrators
3802have ensured the repository does not contain any magic references.
3803Setting to false to skip the check can decrease latency during push.
3804+
3805Default is true.
3806
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02003807[[receive.allowProjectOwnersToChangeParent]]receive.allowProjectOwnersToChangeParent::
3808+
3809If true, Gerrit will allow project owners to change the parent of a project.
3810+
3811By default only Gerrit administrators are allowed to change the parent
3812of a project. By allowing project owners to change parents, it may
3813allow the owner to circumvent certain enforced rules (like important
3814BLOCK rules).
3815+
3816Default is false.
Rikard Almgrene9221be2018-09-18 11:12:03 +02003817+
3818This value supports configuration reloads:
3819link:cmd-reload-config.html[reload-config]
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02003820
Gustaf Lundh9062fd62013-02-14 17:23:11 +01003821[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
3822+
3823If set to true, Gerrit will validate that all referenced objects that
3824are not included in the received pack are reachable by the user.
3825+
3826Carrying out this check on gits with many refs and commits can be a
3827very CPU-heavy operation. For non public Gerrit-servers this check may
3828be overkill.
3829+
3830Only disable this check if you trust the clients not to forge SHA1
3831references to access commits intended to be hidden from the user.
3832+
3833Default is true.
3834
Dave Borowitzff243892015-08-31 15:35:28 -04003835[[receive.enableSignedPush]]receive.enableSignedPush::
lincoln2be11602010-07-05 10:53:25 -03003836+
Dave Borowitzff243892015-08-31 15:35:28 -04003837If true, server-side signed push validation is enabled.
lincoln2be11602010-07-05 10:53:25 -03003838+
Dave Borowitzff243892015-08-31 15:35:28 -04003839When a client pushes with `git push --signed`, this ensures that the
3840push certificate is valid and signed with a valid public key stored in
David Pursehouse6117a472016-07-26 08:02:49 +00003841the `refs/meta/gpg-keys` branch of `All-Users`.
Dave Borowitzff243892015-08-31 15:35:28 -04003842+
3843Defaults to false.
3844
3845[[receive.maxBatchChanges]]receive.maxBatchChanges::
3846+
3847The maximum number of changes that Gerrit allows to be pushed
3848in a batch for review. When this number is exceeded Gerrit rejects
3849the push with an error message.
3850+
3851May be overridden for certain groups by specifying a limit in the
3852link:access-control.html#capability_batchChangesLimit['Batch Changes Limit']
3853global capability.
3854+
3855This setting can be used to prevent users from uploading large
3856number of changes for review by mistake.
3857+
3858Default is zero, no limit.
lincoln2be11602010-07-05 10:53:25 -03003859
Dave Borowitz78542192017-08-31 10:45:47 -04003860[[receive.maxBatchCommits]]receive.maxBatchCommits::
3861+
3862The maximum number of commits that Gerrit allows to be pushed in a batch
3863directly to a branch when link:user-upload.html#bypass_review[bypassing review].
3864This limit can be bypassed if a user link:user-upload.html#skip_validation[skips
3865validation].
3866+
3867Default is 10000.
3868
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003869[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
3870+
3871Maximum allowed Git object size that 'receive-pack' will accept.
3872If an object is larger than the given size the pack-parsing will abort
3873and the push operation will fail. If set to zero then there is no
3874limit.
3875+
David Pursehouse221d4f62012-06-08 17:38:08 +09003876Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003877from pushing objects which are too large to Gerrit.
3878+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07003879This setting can also be set in the `project.config`
David Pursehouse2e548682018-08-01 15:12:47 +02003880(link:config-project-config.html[receive.maxObjectSizeLimit]) in order
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07003881to further reduce the global setting. The project specific setting is
3882only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02003883+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003884Default is zero.
3885+
3886Common unit suffixes of 'k', 'm', or 'g' are supported.
3887
David Pursehouse3f9c7402018-09-05 18:43:03 +09003888[[receive.inheritProjectMaxObjectSizeLimit]]receive.inheritProjectMaxObjectSizeLimit::
3889+
3890Controls whether the project-level link:config-project-config.html[`receive.maxObjectSizeLimit`]
3891value is inherited from the parent project. When `true`, the value is
3892inherited, otherwise it is not inherited.
3893+
3894Default is false, the value is not inherited.
3895
Dave Borowitz1bb49492015-08-31 15:36:59 -04003896[[receive.maxTrustDepth]]receive.maxTrustDepth::
3897+
3898If signed push validation is link:#receive.enableSignedPush[enabled],
3899set to the maximum depth to search when checking if a key is
3900link:#receive.trustedKey[trusted].
3901+
3902Default is 0, meaning only explicitly trusted keys are allowed.
3903
Dave Borowitz234734a2012-03-01 14:22:29 -08003904[[receive.threadPoolSize]]receive.threadPoolSize::
3905+
3906Maximum size of the thread pool in which the change data in received packs is
3907processed.
3908+
3909Defaults to the number of available CPUs according to the Java runtime.
3910
Dave Borowitz1c401362012-03-02 17:39:17 -08003911[[receive.timeout]]receive.timeout::
3912+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07003913Overall timeout on the time taken to process the change data in
3914received packs. Only includes the time processing Gerrit changes
3915and updating references, not the time to index the pack. Values can
3916be specified using standard time unit abbreviations ('ms', 'sec',
3917'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08003918+
Dariusz Lukszade482b02015-11-09 18:25:04 +01003919Default is 4 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07003920is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08003921
Dave Borowitz1bb49492015-08-31 15:36:59 -04003922[[receive.trustedKey]]receive.trustedKey::
3923+
3924List of GPG key fingerprints that should be considered trust roots by
3925the server when signed push validation is
3926link:#receive.enableSignedPush[enabled]. A key is trusted by the server
3927if it is either in this list, or a path of trust signatures leads from
3928the key to a configured trust root. The maximum length of the path is
3929determined by link:#receive.maxTrustDepth[`receive.maxTrustDepth`].
3930+
3931Key fingerprints can be displayed with `gpg --list-keys
3932--with-fingerprint`.
3933+
3934Trust signatures can be added to a key using the `tsign` command to
3935link:https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html[
3936`gpg --edit-key`], after which the signed key should be re-uploaded.
3937+
3938If no keys are specified, web-of-trust checks are disabled. This is the
3939default behavior.
3940
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003941[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003942=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003943
Hugo Josefson072b4702010-04-21 19:27:11 +02003944Repositories in this sense are the same as projects.
3945
Shawn O. Pearce897d9212011-06-16 16:59:59 -07003946In the following example configuration `Registered Users` is set
3947to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02003948
3949----
3950[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02003951 ownerGroup = Registered Users
3952----
3953
Hugo Arès7d2b9422014-11-25 15:33:42 -05003954The only matching patterns supported are exact match or wildcard matching which
3955can be specified by ending the name with a `*`. If a project matches more than one
3956repository configuration, then the configuration from the more precise match
3957will be used. In the following example, the default submit type for a project
3958named `project/plugins/a` would be `CHERRY_PICK`.
3959
3960----
3961[repository "project/*"]
3962 defaultSubmitType = MERGE_IF_NECESSARY
3963[repository "project/plugins/*"]
3964 defaultSubmitType = CHERRY_PICK
3965----
3966
Michael Ochmann8129ece2016-07-08 11:25:25 +02003967[NOTE]
3968All properties are used from the matching repository configuration. In
Hugo Arès7d2b9422014-11-25 15:33:42 -05003969the previous example, all properties will be used from `project/plugins/\*`
3970section and no properties will be inherited nor overridden from `project/*`.
Hugo Josefson072b4702010-04-21 19:27:11 +02003971
Hugo Arès218bb3b2015-04-22 15:05:14 -04003972[[repository.name.basePath]]repository.<name>.basePath::
3973+
3974Alternate to <<gerrit.basePath,gerrit.basePath>>. The repository will be created
3975and used from this location instead: ${alternateBasePath}/${projectName}.git.
3976+
3977If configuring the basePath for an existing project in gerrit, make sure to stop
3978gerrit, move the repository in the alternate basePath, configure basePath for
3979this repository and then start Gerrit.
3980+
3981Path must be absolute.
3982
Edwin Kempina79ea552013-11-19 11:24:37 +01003983[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
3984+
3985The default submit type for newly created projects. Supported values
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04003986are `INHERIT`, `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02003987`REBASE_ALWAYS`, `MERGE_ALWAYS` and `CHERRY_PICK`.
3988+
Changcheng Xiao21885982019-01-15 18:16:51 +01003989For more details see link:config-project-config.html#submit-type[Submit Types].
Edwin Kempina79ea552013-11-19 11:24:37 +01003990+
Changcheng Xiao21885982019-01-15 18:16:51 +01003991Default is link:config-project-config.html#submit_type_inherit[`INHERIT`].
Dave Borowitzcad4d262018-01-22 10:02:22 -05003992+
Dave Borowitz03e51742018-01-09 07:57:01 -05003993This submit type is only applied at project creation time if a submit type is
3994omitted from the link:rest-api-projects.html#project-input[ProjectInput]. If the
Dave Borowitzcad4d262018-01-22 10:02:22 -05003995submit type is unset in the project config at runtime, for backwards
3996compatibility purposes, it defaults to
3997link:project-configuration.html#merge_if_necessary[`MERGE_IF_NECESSARY`] rather
3998than `INHERIT`.
Edwin Kempina79ea552013-11-19 11:24:37 +01003999
Hugo Josefson072b4702010-04-21 19:27:11 +02004000[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
4001+
4002A name of a group which exists in the database. Zero, one or many
4003groups are allowed. Each on its own line. Groups which don't exist
4004in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02004005
Edwin Kempin22687fa2018-01-22 11:55:07 +01004006[[retry]]
4007=== Section retry
4008
4009[[retry.maxWait]]retry.maxWait::
4010+
4011Maximum time to wait between attempts to retry an operations when one attempt
4012fails (e.g. on NoteDb updates due to contention, aka lock failure, on the
4013underlying ref storage). Operations are retried with exponential backoff, plus
4014some random jitter, until the interval reaches this limit. After that, retries
4015continue to occur after a fixed timeout (plus jitter), up to
4016link:#retry.timeout[`retry.timeout`].
4017+
4018Defaults to 5 seconds; unit suffixes are supported, and assumes milliseconds if
4019not specified.
4020
4021[[retry.timeout]]retry.timeout::
4022+
4023Total timeout for retrying operations when one attempt fails.
4024+
4025It is possible to overwrite this default timeout based on operation types by
4026setting link:#retry.operationType.timeout[`retry.<operationType>.timeout`].
4027+
4028Defaults to 20 seconds; unit suffixes are supported, and assumes milliseconds if
4029not specified.
4030
4031[[retry.operationType.timeout]]retry.<operationType>.timeout::
4032+
4033Total timeout for retrying operations of type `<operationType>` when one
4034attempt fails. `<operationType>` can be `ACCOUNT_UPDATE`, `CHANGE_UPDATE`,
4035`GROUP_UPDATE` and `INDEX_QUERY`.
4036+
4037Defaults to link:#retry.timeout[`retry.timeout`]; unit suffixes are supported,
4038and assumes milliseconds if not specified.
4039
Edwin Kempindd837ae2019-06-18 11:42:14 +02004040[[retry.retryWithTraceOnFailure]]retry.retryWithTraceOnFailure::
4041+
4042Whether Gerrit should automatically retry operations on failure with tracing
4043enabled. The automatically generated traces can help with debugging. Please
4044note that only some of the REST endpoints support automatic retry.
4045+
4046By default this is set to false.
4047
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004048[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004049=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004050
4051[[rules.enable]]rules.enable::
4052+
Matt Baker8ce12fc2013-11-26 21:43:12 -07004053If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004054project's refs/meta/config branch, if present. When set to false,
4055only the default internal rules will be used.
4056+
4057Default is true, to execute project specific rules.
4058
Shawn Pearceed001d72014-12-17 14:25:55 -08004059[[rules.reductionLimit]]rules.reductionLimit::
4060+
4061Maximum number of Prolog reductions that can be performed when
4062evaluating rules for a single change. Each function call made
4063in user rule code, internal Gerrit Prolog code, or the Prolog
4064interpreter counts against this limit.
4065+
4066Sites using very complex rules that need many reductions should
4067compile Prolog to Java bytecode with link:pgm-rulec.html[rulec].
4068This eliminates the dynamic Prolog interpreter from charging its
4069own reductions against the limit, enabling more logic to execute
4070within the same bounds.
4071+
4072A reductionLimit of 0 is nearly infinite, implemented by setting
4073the internal limit to 2^31-1.
4074+
4075Default is 100,000 reductions (about 14 ms on Intel Core i7 CPU).
4076
4077[[rules.compileReductionLimit]]rules.compileReductionLimit::
4078+
4079Maximum number of Prolog reductions that can be performed when
4080compiling source code to internal Prolog machine code.
4081+
4082Default is 10x reductionLimit (1,000,000).
4083
Shawn Pearcea2b98522015-11-21 09:47:32 -08004084[[rules.maxSourceBytes]]rules.maxSourceBytes::
4085+
4086Maximum input size (in bytes) of a Prolog rules.pl file. Larger
4087source files may need a larger rules.compileReductionLimit. Consider
4088using link:pgm-rulec.html[rulec] to precompile larger rule files.
4089+
4090A size of 0 bytes disables rules, same as rules.enable = false.
4091+
David Pursehouse0c1dadf2015-11-24 09:14:21 +00004092Common unit suffixes of 'k', 'm', or 'g' are supported.
4093+
Shawn Pearcea2b98522015-11-21 09:47:32 -08004094Default is 128 KiB.
4095
4096[[rules.maxPrologDatabaseSize]]rules.maxPrologDatabaseSize::
4097+
4098Number of predicate clauses allowed to be defined in the Prolog
4099database by project rules. Very complex rules may need more than the
4100default 256 limit, but cost more memory and may need more time to
4101evaluate. Consider using link:pgm-rulec.html[rulec] to precompile
4102larger rule files.
4103+
4104Default is 256.
4105
David Pursehouse511a35b2014-04-04 10:27:13 +09004106[[execution]]
4107=== Section execution
Bruce Zua7e34312014-04-01 17:35:41 +08004108
4109[[execution.defaultThreadPoolSize]]execution.defaultThreadPoolSize::
4110+
4111The default size of the background execution thread pool in
4112which miscellaneous tasks are handled.
4113+
Jacek Centkowskice5510d2019-11-13 16:27:25 -08004114Default and minimum is 2 so that a single, potentially longer executing
4115task (e.g. GC), is not blocking the entire execution.
Bruce Zua7e34312014-04-01 17:35:41 +08004116
Patrick Hiesel2ed39822018-04-16 12:04:02 +02004117[[execution.fanOutThreadPoolSize]]execution.fanOutThreadPoolSize::
4118+
4119Maximum size of thread pool to on which a serving thread can fan-out
4120work to parallelize it.
4121+
4122When set to 0, a direct executor will be used.
4123+
4124By default, 25 which means that formatting happens in the caller thread.
4125
Patrick Hiesel328b7612016-10-21 16:43:13 +02004126[[receiveemail]]
4127=== Section receiveemail
4128
4129[[receiveemail.protocol]]receiveemail.protocol::
4130+
4131Specifies the protocol used for receiving emails. Valid options are
4132'POP3', 'IMAP' and 'NONE'. Note that Gerrit will automatically switch between
4133POP3 and POP3s as well as IMAP and IMAPS depending on the specified
4134link:#receiveemail.encryption[encryption].
4135+
4136Defaults to 'NONE' which means that receiving emails is disabled.
4137
4138[[receiveemail.host]]receiveemail.host::
4139+
4140The hostname of the mailserver. Example: 'imap.gmail.com'.
4141+
4142Defaults to an empty string which means that receiving emails is disabled.
4143
4144[[receiveemail.port]]receiveemail.port::
4145+
David Pursehouse4b067752017-03-03 15:54:53 +09004146The port the email server exposes for receiving emails.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004147+
4148Defaults to the industry standard for a given protocol and encryption:
David Pursehouse34907442017-04-04 09:55:38 +09004149POP3: 110; POP3S: 995; IMAP: 143; IMAPS: 993.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004150
4151[[receiveemail.username]]receiveemail.username::
4152+
4153Username used for authenticating with the email server.
4154+
4155Defaults to an empty string.
4156
4157[[receiveemail.password]]receiveemail.password::
4158+
4159Password used for authenticating with the email server.
4160+
4161Defaults to an empty string.
4162
4163[[receiveemail.encryption]]receiveemail.encryption::
4164+
4165Encryption standard used for transport layer security between Gerrit and the
4166email server. Possible values include 'NONE', 'SSL' and 'TLS'.
4167+
4168Defaults to 'NONE'.
4169
4170[[receiveemail.fetchInterval]]receiveemail.fetchInterval::
4171+
4172Time between two consecutive fetches from the email server. Communication with
4173the email server is not kept alive. Examples: 60s, 10m, 1h.
4174+
4175Defaults to 60 seconds.
4176
4177[[receiveemail.enableImapIdle]]receiveemail.enableImapIdle::
4178+
4179If the IMAP protocol is used for retrieving emails, IMAPv4 IDLE can be used to
4180keep the connection with the email server alive and receive a push when a new
4181email is delivered to the inbox. In this case, Gerrit will process the email
4182immediately and will not have a fetch delay.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004183+
4184Defaults to false.
4185
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004186[[receiveemail.filter.mode]]receiveemail.filter.mode::
4187+
4188A black- and whitelist filter to filter incoming emails.
4189+
4190If `OFF`, emails are not filtered by the list filter.
4191+
4192If `WHITELIST`, only emails where a pattern from
4193<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4194matches 'From' will be processed.
4195+
4196If `BLACKLIST`, only emails where no pattern from
4197<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4198matches 'From' will be processed.
4199+
4200Defaults to `OFF`.
4201
4202[[receiveemail.filter.patterns]]receiveemail.filter.patterns::
4203+
4204A list of regular expressions to match the email sender against. This can also
4205be a list of addresses when regular expression characters are escaped.
4206
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004207[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004208=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004209
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004210[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07004211+
4212If false Gerrit will not send email messages, for any reason,
4213and all other properties of section sendemail are ignored.
4214+
4215By default, true, allowing notifications to be sent.
4216
Jonathan Niederdabd8c22016-09-20 14:10:11 -07004217[[sendemail.html]]sendemail.html::
4218+
4219If false, Gerrit will only send plain-text emails.
4220If true, Gerrit will send multi-part emails with an HTML and
4221plain text part.
4222+
4223By default, true, allowing HTML in the emails Gerrit sends.
4224
Bruce Zua7e34312014-04-01 17:35:41 +08004225[[sendemail.connectTimeout]]sendemail.connectTimeout::
4226+
4227The connection timeout of opening a socket connected to a
4228remote SMTP server.
4229+
4230Values can be specified using standard time unit abbreviations
4231('ms', 'sec', 'min', etc.).
4232If no unit is specified, milliseconds is assumed.
4233+
4234Default is 0. A timeout of zero is interpreted as an infinite
4235timeout. The connection will then block until established or
4236an error occurs.
4237
4238[[sendemail.threadPoolSize]]sendemail.threadPoolSize::
4239+
4240Maximum size of thread pool in which the review comments
4241notifications are sent out asynchronously.
4242+
4243By default, 1.
4244
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004245[[sendemail.from]]sendemail.from::
4246+
4247Designates what name and address Gerrit will place in the From
4248field of any generated email messages. The supported values are:
4249+
4250* `USER`
4251+
4252Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09004253Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004254classified as spam if the user's domain has SPF or DKIM enabled
4255and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
Zhen Chenae765aa2016-08-08 15:49:44 -07004256relay for that domain. You can specify
4257<<sendemail.allowedDomain,sendemail.allowedDomain>> to instruct Gerrit to only
4258send as USER if USER is from those domains.
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004259+
4260* `MIXED`
4261+
Edwin Kempincdb0e002011-09-08 14:23:30 +02004262Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004263`review@example.com` is the same as <<user.email,user.email>>.
4264See below for a description of how the replacement is handled.
4265+
4266* `SERVER`
4267+
4268Gerrit will set the From header to the same name and address
4269it records in any commits Gerrit creates. This is set by
4270<<user.name,user.name>> and <<user.email,user.email>>, or guessed
4271from the local operating system.
4272+
Edwin Kempinebfbbac2015-07-01 16:02:39 +02004273* `Code Review <review@example.com>`
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004274+
4275If set to a name and email address in brackets, Gerrit will use
4276this name and email address for any messages, overriding the name
4277that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02004278Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004279which is replaced by the Full Name of the current user.
4280
4281+
4282By default, MIXED.
4283
Zhen Chenae765aa2016-08-08 15:49:44 -07004284[[sendemail.allowedDomain]]sendemail.allowedDomain::
4285+
4286Only used when `sendemail.from` is set to `USER`.
4287List of allowed domains. If user's email matches one of the domains, emails will
4288be sent as USER, otherwise as MIXED mode. Wildcards may be specified by
Maxime Guerreiroebac2d42018-03-21 13:54:51 +01004289including `\*` to match any number of characters, for example `*.example.com`
Zhen Chenae765aa2016-08-08 15:49:44 -07004290matches any subdomain of `example.com`.
4291+
4292By default, `*`.
4293
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004294[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004295+
4296Hostname (or IP address) of a SMTP server that will relay
4297messages generated by Gerrit to end users.
4298+
4299By default, 127.0.0.1 (aka localhost).
4300
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004301[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004302+
4303Port number of the SMTP server in sendemail.smtpserver.
4304+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08004305By default, 25, or 465 if smtpEncryption is 'ssl'.
4306
4307[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
4308+
4309Specify the encryption to use, either 'ssl' or 'tls'.
4310+
4311By default, 'none', indicating no encryption is used.
4312
4313[[sendemail.sslVerify]]sendemail.sslVerify::
4314+
4315If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
4316will not verify the server certificate when it connects to send
4317an email message.
4318+
4319By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004320
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004321[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004322+
4323User name to authenticate with, if required for relay.
4324
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004325[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004326+
4327Password for the account named by sendemail.smtpUser.
4328
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004329[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004330+
4331If present, each value adds one entry to the whitelist of email
4332addresses that Gerrit can send email to. If set to a complete
4333email address, that one address is added to the white list.
4334If set to a domain name, any address at that domain can receive
4335email from Gerrit.
4336+
Rikard Almgren5b9de1c2019-03-12 17:55:16 +01004337If allowrcpt is configured, The set of allowed recipients is:
4338`allowrcpt - denyrcpt`.
4339+
4340By default, unset, permitting delivery to any email address.
4341
4342[[sendemail.denyrcpt]]sendemail.denyrcpt::
4343+
4344If present, each value adds one entry to the blacklist of email
4345addresses that Gerrit can send email to. If set to a complete
4346email address, that one address is added to the blacklist.
4347If set to a domain name, any address at that domain can *not* receive
4348email from Gerrit.
4349+
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004350By default, unset, permitting delivery to any email address.
4351
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004352[[sendemail.includeDiff]]sendemail.includeDiff::
4353+
Bruce Zueb00ff32012-11-27 17:38:10 +08004354If true, new change emails and merged change emails from Gerrit
4355will include the complete unified diff of the change.
4356Variable maxmimumDiffSize places an upper limit on how large the
4357email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004358+
4359By default, false.
4360
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07004361[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
4362+
4363Largest size of unified diff output to include in an email. When
4364the diff exceeds this size the file paths will be listed instead.
4365Standard byte unit suffixes are supported.
4366+
4367By default, 256 KiB.
4368
Alex Blewitt9cca7402011-02-11 01:39:30 +00004369[[sendemail.importance]]sendemail.importance::
4370+
4371If present, emails sent from Gerrit will have the given level
4372of importance. Valid values include 'high' and 'low', which
4373email clients will render in different ways.
4374+
4375By default, unset, so no Importance header is generated.
4376
4377[[sendemail.expiryDays]]sendemail.expiryDays::
4378+
4379If present, emails sent from Gerrit will expire after the given
4380number of days. This will add the Expiry-Date header and
4381email clients may expire or expunge mails whose Expiry-Date
4382header is in the past. This should be a positive non-zero
4383number indicating how many days in the future the mails
4384should expire.
4385+
4386By default, unset, so no Expiry-Date header is generated.
4387
Patrick Hiesel31d60f02017-02-09 17:38:40 +01004388[[sendemail.replyToAddress]]sendemail.replyToAddress::
4389+
4390A custom Reply-To address should only be provided if Gerrit is set up to
4391receive emails and the inbound address differs from
4392<<sendemail.from,sendemail.from>>.
4393It will be set as Reply-To header on all types of outgoing email where
4394Gerrit can parse back a user's reply.
4395+
4396Defaults to an empty string which adds <<sendemail.from,sendemail.from>> as
4397Reply-To if inbound email is enabled and the review's author otherwise.
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004398
David Pursehouse917b7262017-04-21 18:18:52 +02004399[[sendemail.allowTLD]]sendemail.allowTLD::
4400+
4401List of custom TLDs to allow sending emails to in addition to those specified
4402in the link:http://data.iana.org/TLD/[IANA list].
4403+
4404Defaults to an empty list, meaning no additional TLDs are allowed.
4405
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004406
4407[[sendemail.addInstanceNameInSubject]]sendemail.addInstanceNameInSubject::
4408+
4409When set to true, Gerrit will add its short name to the email subject, allowing recipients to quickly identify
4410what Gerrit instance the email came from.
4411+
4412The short name can be customized via the gerrit.instanceName option.
4413+
Luca Milanesiofdfca772018-04-04 23:42:32 +01004414Defaults to false.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004415
4416
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004417[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004418=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004419
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004420[[site.allowOriginRegex]]site.allowOriginRegex::
4421+
4422List of regular expressions matching origins that should be permitted
Shawn Pearce53ebad42017-06-10 11:14:20 -07004423to use the full Gerrit REST API. These should be trusted applications,
4424as the sites may be able to use the user's credentials. Applies to
4425all requests, including state changing methods (PUT, DELETE, POST).
4426+
4427Expressions should not require trailing slash. For example a valid
4428pattern might be `https://build-status[.]example[.]com`.
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004429+
4430By default, unset, denying all cross-origin requests.
4431
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004432[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
4433+
4434If true the server checks the site header, footer and CSS files for
4435updated versions. If false, a server restart is required to change
4436any of these resources. Default is true, allowing automatic reloads.
4437
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004438[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004439=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07004440
4441Variables in section ssh-alias permit the site administrator to alias
4442another command from Gerrit or a plugin into the `gerrit` command
4443namespace. To alias `replication start` to `gerrit replicate`:
4444
4445----
4446[ssh-alias]
4447 replicate = replication start
4448----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004449
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004450[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004451=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07004452
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02004453[[sshd.enableCompression]]sshd.enableCompression::
4454+
4455In the general case, we want to disable transparent compression, since
4456the majority of our data transfer is highly compressed Git pack files
4457and we cannot make them any smaller than they already are.
4458+
4459However, if there are CPU in abundance and the server is reachable
4460through slow networks, gits with huge amount of refs can benefit from
4461SSH-compression since git does not compress the ref announcement during
4462handshake.
4463+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02004464Compression can be especially useful when Gerrit replicas are being used
Matthias Sohnd8182ba2019-12-09 14:50:23 +01004465for the larger clones and fetches and the primary server mostly takes
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02004466small receive-packs.
4467+
4468By default, `false`.
4469
David Ostrovskye2921b62015-03-04 22:36:10 +01004470[[sshd.backend]]sshd.backend::
4471+
4472Starting from version 0.9.0 Apache SSHD project added support for NIO2
Orgad Shanehb7bb7352019-09-19 10:26:19 +03004473IoSession. To use the old MINA session the `backend` option must be set
4474to `MINA`.
David Ostrovskye2921b62015-03-04 22:36:10 +01004475+
Luca Milanesiofc1ed9c2016-03-01 18:28:36 +00004476By default, `NIO2`.
David Ostrovskye2921b62015-03-04 22:36:10 +01004477
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004478[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004479+
4480Specifies the local addresses the internal SSHD should listen
4481for connections on. The following forms may be used to specify
4482an address. In any form, `:'port'` may be omitted to use the
David Pursehousea3af2552016-08-02 14:04:44 +09004483default of `29418`.
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004484+
David Pursehousea3af2552016-08-02 14:04:44 +09004485* `'hostname':'port'` (for example `review.example.com:29418`)
4486* `'IPv4':'port'` (for example `10.0.0.1:29418`)
4487* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
4488* `+*:'port'+` (for example `+*:29418+`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004489
4490+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004491--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004492If multiple values are supplied, the daemon will listen on all
4493of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004494
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07004495To disable the internal SSHD, set listenAddress to `off`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004496
David Pursehousea3af2552016-08-02 14:04:44 +09004497By default, `*:29418`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004498--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004499
James Y Knight910bd862011-01-11 20:05:56 -05004500[[sshd.advertisedAddress]]sshd.advertisedAddress::
4501+
4502Specifies the addresses clients should be told to connect to.
4503This may differ from sshd.listenAddress if a firewall based port
4504redirector is being used, making Gerrit appear to answer on port
450522. The following forms may be used to specify an address. In any
4506form, `:'port'` may be omitted to use the default SSH port of 22.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004507
David Pursehousea3af2552016-08-02 14:04:44 +09004508* `'hostname':'port'` (for example `review.example.com:22`)
4509* `'IPv4':'port'` (for example `10.0.0.1:29418`)
4510* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
James Y Knight910bd862011-01-11 20:05:56 -05004511
4512+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004513--
James Y Knight910bd862011-01-11 20:05:56 -05004514If multiple values are supplied, the daemon will advertise all
4515of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004516
David Pursehousea3af2552016-08-02 14:04:44 +09004517By default uses the value of `sshd.listenAddress`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004518--
James Y Knight910bd862011-01-11 20:05:56 -05004519
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004520[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07004521+
4522If true, enables TCP keepalive messages to the other side, so
4523the daemon can terminate connections if the peer disappears.
4524+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02004525Only effective when `sshd.backend` is set to `MINA`.
4526+
David Pursehousea3af2552016-08-02 14:04:44 +09004527By default, `true`.
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07004528
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004529[[sshd.threads]]sshd.threads::
4530+
4531Number of threads to use when executing SSH command requests.
4532If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09004533are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004534+
Florian Klink2a389462019-07-23 14:14:32 +02004535By default, 2x the number of CPUs available to the JVM (but at least 4
4536threads).
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02004537+
4538[NOTE]
4539When SSH daemon is enabled then this setting also defines the max number of
4540concurrent Git requests for interactive users over SSH and HTTP together.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004541
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004542[[sshd.batchThreads]]sshd.batchThreads::
4543+
4544Number of threads to allocate for SSH command requests from
Fredrik Luthander46843022012-03-13 16:11:02 +01004545link:access-control.html#non-interactive_users[non-interactive users].
4546If equals to 0, then all non-interactive requests are executed in the same
4547queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004548+
4549Any other value will remove the number of threads from the queue
4550allocated to interactive users, and create a separate thread pool
4551of the requested size, which will be used to run commands from
4552non-interactive users.
4553+
4554If the number of threads requested for non-interactive users is larger
4555than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09004556value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004557+
Dariusz Luksza145de472015-11-09 18:44:35 +01004558By default is 1 on single core node, 2 otherwise.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02004559+
4560[NOTE]
4561When SSH daemon is enabled then this setting also defines the max number of
4562concurrent Git requests for batch users over SSH and HTTP together.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004563
Kenny Root15ac1b82010-02-24 00:29:20 -08004564[[sshd.streamThreads]]sshd.streamThreads::
4565+
4566Number of threads to use when formatting events to asynchronous
4567streaming clients. Event formatting is multiplexed onto this thread
4568pool by a simple FIFO scheduling system.
4569+
4570By default, 1 plus the number of CPUs available to the JVM.
4571
Edwin Kempinb5df3b82011-10-10 11:31:14 +02004572[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07004573+
4574Number of threads used to parse a command line submitted by a client
4575over SSH for execution, create the internal data structures used by
4576that command, and schedule it for execution on another thread.
4577+
4578By default, 2.
4579
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004580[[sshd.maxAuthTries]]sshd.maxAuthTries::
4581+
4582Maximum number of authentication attempts before the server
4583disconnects the client. Each public key that a client has loaded
4584into its local agent counts as one auth request. Users can work
4585around the server's limit by loading less keys into their agent,
4586or selecting a specific key in their `~/.ssh/config` file with
4587the `IdentityFile` option.
4588+
4589By default, 6.
4590
4591[[sshd.loginGraceTime]]sshd.loginGraceTime::
4592+
4593Time in seconds that a client has to authenticate before the server
4594automatically terminates their connection. Values should use common
4595unit suffixes to express their setting:
4596+
4597* s, sec, second, seconds
4598* m, min, minute, minutes
4599* h, hr, hour, hours
4600* d, day, days
4601
4602+
4603By default, 2 minutes.
4604
Christian Aistleitner3d794592013-04-08 00:19:40 +02004605[[sshd.idleTimeout]]sshd.idleTimeout::
4606+
4607Time in seconds after which the server automatically terminates idle
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00004608connections (or 0 to disable closing of idle connections) not waiting for
4609any server operation to complete.
4610Values should use common unit suffixes to express their setting:
Christian Aistleitner3d794592013-04-08 00:19:40 +02004611+
4612* s, sec, second, seconds
4613* m, min, minute, minutes
4614* h, hr, hour, hours
4615* d, day, days
4616
4617+
4618By default, 0.
4619
Paladox nonedaafdb62017-10-14 16:18:42 +00004620[[sshd.waitTimeout]]sshd.waitTimeout::
4621+
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00004622Time in seconds after which the server automatically terminates
4623connections waiting for a server operation to complete, like for instance
4624cloning a very large repo with lots of refs.
Paladox nonedaafdb62017-10-14 16:18:42 +00004625Values should use common unit suffixes to express their setting:
4626+
4627* s, sec, second, seconds
4628* m, min, minute, minutes
4629* h, hr, hour, hours
4630* d, day, days
4631
4632+
4633By default, 30s.
4634
Thomas Draebing2c7346a2020-08-03 17:51:15 +02004635[[sshd.gracefulStopTimeout]]sshd.gracefulStopTimeout::
4636+
4637Set a graceful stop time. If set, Gerrit ensures that all open SSH
4638sessions are preserved for a maximum period of time, before forcing the
4639shutdown of the SSH daemon. During this period, no new requests
4640will be accepted. This option is meant to be used in setups performing
4641rolling restarts.
4642+
4643Values should use common unit suffixes to express their setting:
4644+
4645* s, sec, second, seconds
4646* m, min, minute, minutes
4647+
4648By default, 0 seconds (immediate shutdown).
4649
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004650[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
4651+
4652Maximum number of concurrent SSH sessions that a user account
4653may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09004654that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004655the number of commands a user may issue over a single connection.
4656If set to 0, there is no limit.
4657+
4658By default, 64.
4659
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004660[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004661+
4662Available ciphers. To permit multiple ciphers, specify multiple
4663`sshd.cipher` keys in the configuration file, one cipher name
4664per key. Cipher names starting with `+` are enabled in addition
4665to the default ciphers, cipher names starting with `-` are removed
4666from the default cipher set.
4667+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004668Supported ciphers:
4669+
4670* `aes128-ctr`
4671* `aes192-ctr`
4672* `aes256-ctr`
4673* `aes128-cbc`
4674* `aes192-cbc`
4675* `aes256-cbc`
4676* `blowfish-cbc`
4677* `3des-cbc`
4678* `arcfour128`
4679* `arcfour256`
4680* `none`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004681+
4682By default, all supported ciphers except `none` are available.
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004683+
4684If your setup allows for it, it's recommended to disable all ciphers except
4685the AES-CTR modes.
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004686
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004687[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004688+
4689Available MAC (message authentication code) algorithms. To permit
4690multiple algorithms, specify multiple `sshd.mac` keys in the
4691configuration file, one MAC per key. MAC names starting with `+`
4692are enabled in addition to the default MACs, MAC names starting with
4693`-` are removed from the default MACs.
4694+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004695Supported MACs:
4696+
4697* `hmac-md5`
4698* `hmac-md5-96`
4699* `hmac-sha1`
4700* `hmac-sha1-96`
4701* `hmac-sha2-256`
4702* `hmac-sha2-512`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004703+
4704By default, all supported MACs are available.
4705
Scott Dialb4a04fa2016-03-15 09:44:11 -04004706[[sshd.kex]]sshd.kex::
4707+
4708--
4709Available key exchange algorithms. To permit multiple algorithms,
4710specify multiple `sshd.kex` keys in the configuration file, one key
4711exchange algorithm per key. Key exchange algorithm names starting
4712with `+` are enabled in addition to the default key exchange
4713algorithms, key exchange algorithm names starting with `-` are
4714removed from the default key exchange algorithms.
4715
4716In the following example configuration, support for the 1024-bit
4717`diffie-hellman-group1-sha1` key exchange is disabled while leaving
4718all of the other default algorithms enabled:
4719
4720----
4721[sshd]
4722 kex = -diffie-hellman-group1-sha1
4723----
4724
4725Supported key exchange algorithms:
4726
4727* `ecdh-sha2-nistp521`
4728* `ecdh-sha2-nistp384`
4729* `ecdh-sha2-nistp256`
4730* `diffie-hellman-group-exchange-sha256`
4731* `diffie-hellman-group-exchange-sha1`
4732* `diffie-hellman-group14-sha1`
4733* `diffie-hellman-group1-sha1`
4734
4735By default, all supported key exchange algorithms are available.
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004736
4737It is strongly recommended to disable at least `diffie-hellman-group1-sha1`
4738as it's known to be vulnerable (logjam attack). Additionally, if your setup
4739allows for it, it is recommended to disable the remaining two `sha1` key
4740exchange algorithms.
Scott Dialb4a04fa2016-03-15 09:44:11 -04004741--
4742
Alex Blewitt7efb06f2013-04-01 12:46:48 -04004743[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
4744+
4745Enable kerberos authentication for SSH connections. To permit
4746kerberos authentication, the server must have a host principal
4747(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
4748This must be provisioned by the kerberos administrators, and is
4749typically installed into `/etc/krb5.keytab` on host machines.
4750+
4751The keytab must contain at least one `host/` principal, typically
4752using the host's canonical name. If it does not use the
4753canonical name, the `sshd.kerberosPrincipal` should be configured
4754with the correct name.
4755+
4756By default, not set and so kerberos authentication is not enabled.
4757
4758[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
4759+
4760If kerberos authentication is enabled with `sshd.kerberosKeytab`,
4761instead use the given principal name instead of the default.
4762If the principal does not begin with `host/` a warning message is
4763printed and may prevent successful authentication.
4764+
4765This may be useful if the host is behind an IP load balancer or
4766other SSH forwarding systems, since the principal name is constructed
4767by the client and must match for kerberos authentication to work.
4768+
4769By default, `host/canonical.host.name`
4770
Shawn Pearce318bfca2013-10-17 22:15:38 -07004771[[sshd.requestLog]]sshd.requestLog::
4772+
4773Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
4774If enabled, a request log file is written out by the SSH daemon.
Matthias Sohn450bc202020-08-20 14:40:32 +02004775The sshd log format is documented link:logs.html#_sshd_log[here].
Shawn Pearce318bfca2013-10-17 22:15:38 -07004776+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01004777`log4j.appender` with the name `sshd_log` can be configured to overwrite
4778programmatic configuration.
4779+
David Pursehousea3af2552016-08-02 14:04:44 +09004780By default, `true`.
Gustaf Lundh4e859932018-04-16 10:56:31 +02004781+
Sven Selberg2a0beab2018-04-20 14:49:20 +02004782This value supports link:#reloadConfig[configuration reloads].
Shawn Pearce318bfca2013-10-17 22:15:38 -07004783
David Ostrovsky985201b2015-03-04 22:37:33 +01004784[[sshd.rekeyBytesLimit]]sshd.rekeyBytesLimit::
4785+
4786The SSH daemon will issue a rekeying after a certain amount of data.
4787This configuration option allows you to tweak that setting.
4788+
4789By default, 1073741824 (bytes, 1GB).
4790+
David Pursehousea3af2552016-08-02 14:04:44 +09004791The `rekeyBytesLimit` cannot be set to lower than 32.
David Ostrovsky985201b2015-03-04 22:37:33 +01004792
4793[[sshd.rekeyTimeLimit]]sshd.rekeyTimeLimit::
4794+
4795The SSH daemon will issue a rekeying after a certain amount of time.
4796This configuration option allows you to tweak that setting.
4797+
4798By default, 1h.
4799+
4800Set to 0 to disable this check.
4801
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004802[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004803=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07004804
Sven Selberg42d9d292014-08-13 11:20:11 +02004805[[suggest.maxSuggestedReviewers]]suggest.maxSuggestedReviewers::
4806+
4807The maximum numbers of reviewers suggested.
4808+
4809By default 10.
Gustaf Lundh25e608f2018-04-16 10:54:53 +02004810+
Sven Selberg2a0beab2018-04-20 14:49:20 +02004811This value supports link:#reloadConfig[configuration reloads].
Sven Selberg42d9d292014-08-13 11:20:11 +02004812
Edwin Kempinf957dc22012-10-19 20:41:18 +02004813[[suggest.from]]suggest.from::
4814+
4815The number of characters that a user must have typed before suggestions
Patrick Hiesel87880b02016-05-03 18:15:08 +02004816are provided. If set to 0, suggestions are always provided. This is only
4817used for suggesting accounts when adding members to a group.
Edwin Kempinf957dc22012-10-19 20:41:18 +02004818+
4819By default 0.
4820
Edwin Kempin0a49eca2019-06-21 09:38:46 +02004821[[tracing]]
4822=== Section tracing
4823
4824[[tracing.performanceLogging]]tracing.performanceLogging::
4825+
4826Whether performance logging is enabled.
4827+
4828When performance logging is enabled, performance events for some
4829operations are collected in memory while a request is running. At the
4830end of the request the performance events are handed over to the
4831link:dev-plugins.html#performance-logger[PerformanceLogger] plugins.
4832This means if performance logging is enabled, the memory footprint of
4833requests is slightly increased.
4834+
4835This setting has no effect if no
4836link:dev-plugins.html#performance-logger[PerformanceLogger] plugins are
4837installed, because then performance logging is always disabled.
4838+
4839By default, true.
4840
Edwin Kempin2cba2982019-07-05 13:19:43 +02004841[[tracing.traceid]]
4842==== Subsection tracing.<trace-id>
4843
4844There can be multiple `tracing.<trace-id>` subsections to configure
4845automatic tracing of requests. To be traced a request must match all
4846conditions of one `tracing.<trace-id>` subsection. The subsection name
4847is used as trace ID. Using this trace ID administrators can find
4848matching log entries.
4849
4850[[tracing.traceid.requestType]]tracing.<trace-id>.requestType::
4851+
4852Type of request for which request tracing should be always enabled (can
4853be `GIT_RECEIVE`, `GIT_UPLOAD`, `REST` and `SSH`).
4854+
4855May be specified multiple times.
4856+
4857By default, unset (all request types are matched).
4858
Edwin Kempinb0ddb0b2019-07-08 12:11:32 +02004859[[tracing.traceid.requestUriPattern]]tracing.<trace-id>.requestUriPattern::
4860+
4861Regular expression to match request URIs for which request tracing
4862should be always enabled. Request URIs are only available for REST
4863requests. Request URIs never include the '/a' prefix.
4864+
4865May be specified multiple times.
4866+
4867By default, unset (all request URIs are matched).
4868
Edwin Kempin2cba2982019-07-05 13:19:43 +02004869[[tracing.traceid.account]]tracing.<trace-id>.account::
4870+
4871Account ID of an account for which request tracing should be always
4872enabled.
4873+
4874May be specified multiple times.
4875+
4876By default, unset (all accounts are matched).
4877
4878[[tracing.traceid.projectPattern]]tracing.<trace-id>.projectPattern::
4879+
4880Regular expression to match project names for which request tracing
4881should be always enabled.
4882+
4883May be specified multiple times.
4884+
4885By default, unset (all projects are matched).
4886
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004887[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004888=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07004889
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07004890Tagged footer lines containing references to external
4891tracking systems, parsed out of the commit message and
David Pursehoused55a6b62015-02-27 17:39:38 +09004892saved in Gerrit's secondary index.
Shawn Pearceff61c8a2013-10-07 19:35:53 -07004893
4894After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08004895must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07004896
Edwin Kempinbb421f12011-08-25 11:19:00 +02004897The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07004898bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07004899
4900----
4901[trackingid "jira-bug"]
4902 footer = Bugfix:
David Pursehousece7f6862015-02-19 14:52:45 +09004903 footer = Bug:
Goran Lungberg04132a12010-06-15 17:20:37 -07004904 match = JRA\\d{2,8}
4905 system = JIRA
4906
4907[trackingid "jira-feature"]
4908 footer = Feature
4909 match = JRA(\\d{2,8})
4910 system = JIRA
4911----
4912
4913[[trackingid.name.footer]]trackingid.<name>.footer::
4914+
David Pursehousece7f6862015-02-19 14:52:45 +09004915A prefix tag that identifies the footer line to parse for tracking ids.
4916+
4917Several trackingid entries can have the same footer tag, and a single trackingid
4918entry can have multiple footer tags.
4919+
4920If multiple footer tags are specified, each tag will be parsed separately and
4921duplicates will be ignored.
4922+
4923The trailing ":" is optional.
Goran Lungberg04132a12010-06-15 17:20:37 -07004924
4925[[trackingid.name.match]]trackingid.<name>.match::
4926+
Magnus Bäcke5611832011-02-02 08:57:15 +01004927A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
4928Java regular expression (java.util.regex)] used to match the
4929external tracking id part of the footer line. The match can
4930result in several entries in the DB. If grouping is used in the
4931regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01004932Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07004933+
4934The configuration file parser eats one level of backslashes, so the
4935character class `\s` requires `\\s` in the configuration file. The
4936parser also terminates the line at the first `#`, so a match
4937expression containing # must be wrapped in double quotes.
4938
4939[[trackingid.name.system]]trackingid.<name>.system::
4940+
David Pursehouse221d4f62012-06-08 17:38:08 +09004941The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07004942It is possible to have several trackingid entries for the same
4943tracking system.
4944
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004945[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004946=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07004947
4948[[transfer.timeout]]transfer.timeout::
4949+
4950Number of seconds to wait for a single network read or write
4951to complete before giving up and declaring the remote side is
4952not responding. If 0, there is no timeout, and this server will
4953wait indefinitely for a transfer to finish.
4954+
4955A timeout should be large enough to mostly transfer the objects to
4956the other side. 1 second may be too small for larger projects,
4957especially over a WAN link, while 10-30 seconds is a much more
4958reasonable timeout value.
4959+
4960Defaults to 0 seconds, wait indefinitely.
4961
lincoln2be11602010-07-05 10:53:25 -03004962
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004963[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004964=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004965
Dave Borowitzb1795142017-10-12 07:13:37 -07004966Options to control the behavior of `upload-pack` on the server side,
4967which handles a user's fetch, clone, or repo sync command.
lincoln2be11602010-07-05 10:53:25 -03004968
4969----
4970[upload]
4971 allowGroup = GROUP_ALLOWED_TO_EXECUTE
4972 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
4973----
4974
4975[[upload.allowGroup]]upload.allowGroup::
4976+
Dave Borowitzb1795142017-10-12 07:13:37 -07004977Name of the groups of users that are allowed to execute 'upload-pack'.
4978One or more groups can be set.
lincoln2be11602010-07-05 10:53:25 -03004979+
4980If no groups are added, any user will be allowed to execute
4981'upload-pack' on the server.
4982
Owen Lie2877bb2017-07-14 09:11:20 -04004983[[accountDeactivation]]
4984=== Section accountDeactivation
4985
4986Configures the parameters for the scheduled task to sweep and deactivate Gerrit
4987accounts according to their status reported by the auth backend. Currently only
4988supported for LDAP backends.
4989
4990[[accountDeactivation.startTime]]accountDeactivation.startTime::
4991+
Edwin Kempind33d95a2018-02-16 11:44:04 +01004992The link:#schedule-configuration-startTime[start time] for running
4993account deactivations.
Owen Lie2877bb2017-07-14 09:11:20 -04004994
4995[[accountDeactivation.interval]]accountDeactivation.interval::
4996+
Edwin Kempind33d95a2018-02-16 11:44:04 +01004997The link:#schedule-configuration-interval[interval] for running
4998account deactivations.
4999
Saša Živkovf0966112020-03-17 12:20:31 +01005000Note that the task will only be scheduled if the
5001link:#autoUpdateAccountActiveStatus[auth.autoUpdateAccountActiveStatus]
5002is set to true.
5003
Edwin Kempind33d95a2018-02-16 11:44:04 +01005004link:#schedule-configuration-examples[Schedule examples] can be found
5005in the link:#schedule-configuration[Schedule Configuration] section.
Owen Lie2877bb2017-07-14 09:11:20 -04005006
Stefan Beller0f724ff2015-07-17 10:17:51 -07005007[[submodule]]
5008=== Section submodule
5009
Shawn Pearcedc477cd2016-03-24 19:56:18 -07005010[[submodule.verbosesuperprojectupdate]]submodule.verboseSuperprojectUpdate::
Stefan Beller0f724ff2015-07-17 10:17:51 -07005011+
5012When using link:user-submodules.html#automatic_update[automatic superproject updates]
Zhen Chenc877ca92016-07-27 14:22:37 -07005013this option will determine how the submodule commit messages are included into
Stefan Beller0f724ff2015-07-17 10:17:51 -07005014the commit message of the superproject update.
5015+
Zhen Chenc877ca92016-07-27 14:22:37 -07005016If `FALSE`, will not include any commit messages for the gitlink update.
5017+
5018If `SUBJECT_ONLY`, will include only the commit subjects.
5019+
5020If `TRUE`, will include full commit messages.
5021+
5022By default this is `TRUE`.
Stefan Beller0f724ff2015-07-17 10:17:51 -07005023
Shawn Pearcedc477cd2016-03-24 19:56:18 -07005024[[submodule.enableSuperProjectSubscriptions]]submodule.enableSuperProjectSubscriptions::
Stefan Beller8cc252e2016-03-10 10:06:53 -08005025+
5026This allows to enable the superproject subscription mechanism.
5027+
5028By default this is true.
Stefan Beller0f724ff2015-07-17 10:17:51 -07005029
Patrick Hiesel44e5d6e2017-08-24 16:07:26 +02005030[[submodule.maxCombinedCommitMessageSize]]submodule.maxCombinedCommitMessageSize::
5031+
5032This allows to limit the length of the commit message for a submodule.
5033+
5034By default this is 262144 (256 KiB).
5035+
5036Common unit suffixes of k, m, or g are supported.
5037
5038[[submodule.maxCommitMessages]]submodule.maxCommitMessages::
5039+
5040This allows to limit the number of commit messages that should be combined when creating
5041a commit message for a submodule.
5042+
5043By default this is 1000.
5044
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005045[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005046=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005047
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005048[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005049+
5050Name that Gerrit calls itself in Git when it creates a new Git
5051commit, such as a merge during change submission.
5052+
5053By default this is "Gerrit Code Review".
5054
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005055[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005056+
5057Email address that Gerrit refers to itself as when it creates a
5058new Git commit, such as a merge commit during change submission.
5059+
5060If not set, Gerrit generates this as "gerrit@`hostname`", where
5061`hostname` is the hostname of the system Gerrit is running on.
5062+
5063By default, not set, generating the value at startup.
5064
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005065[[user.anonymousCoward]]user.anonymousCoward::
5066+
David Pursehousea1d633b2014-05-02 17:21:02 +09005067Username that is displayed in the Gerrit Web UI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005068notifications if the full name of the user is not set.
5069+
Han-Wen Nienhuys3fb723d2017-11-20 19:21:13 +01005070By default "Name of user not set" is used.
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005071
Edwin Kempind33d95a2018-02-16 11:44:04 +01005072[[schedule-configuration]]
5073=== Schedule Configuration
5074
5075Schedule configurations are used for running periodic background jobs.
5076
5077A schedule configuration consists of two parameters:
5078
5079[[schedule-configuration-interval]]
5080* `interval`:
5081Interval for running the periodic background job. The interval must be
5082larger than zero. The following suffixes are supported to define the
5083time unit for the interval:
5084** `s`, `sec`, `second`, `seconds`
5085** `m`, `min`, `minute`, `minutes`
5086** `h`, `hr`, `hour`, `hours`
5087** `d`, `day`, `days`
5088** `w`, `week`, `weeks` (`1 week` is treated as `7 days`)
5089** `mon`, `month`, `months` (`1 month` is treated as `30 days`)
5090** `y`, `year`, `years` (`1 year` is treated as `365 days`)
5091
5092[[schedule-configuration-startTime]]
5093* `startTime`:
5094The start time defines the first execution of the periodic background
5095job. If the configured `interval` is shorter than `startTime - now` the
5096start time will be preponed by the maximum integral multiple of
5097`interval` so that the start time is still in the future. `startTime`
5098must have one of the following formats:
5099
5100** `<day of week> <hours>:<minutes>`
5101** `<hours>:<minutes>`
5102
5103+
5104The placeholders can have the following values:
5105
5106*** `<day of week>`:
5107`Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`
5108*** `<hours>`:
5109`00`-`23`
5110*** `<minutes>`:
5111`00`-`59`
5112
5113+
5114The time zone cannot be specified but is always the system default
David Pursehouse18f388a2019-04-10 09:36:18 +09005115time zone. Hours must be zero-padded, i.e. `06:00` rather than `6:00`.
Edwin Kempind33d95a2018-02-16 11:44:04 +01005116
5117The section (and optionally the subsection) in which the `interval` and
5118`startTime` keys must be set depends on the background job for which a
5119schedule should be configured. E.g. for the change cleanup job the keys
5120must be set in the link:#changeCleanup[changeCleanup] section:
5121
5122----
5123 [changeCleanup]
5124 startTime = Fri 10:30
5125 interval = 2 days
5126----
5127
5128[[schedule-configuration-examples]]
5129Examples for a schedule configuration:
5130
5131* Example 1:
5132+
5133----
5134 startTime = Fri 10:30
5135 interval = 2 days
5136----
5137+
5138Assuming that the server is started on `Mon 07:00` then
5139`startTime - now` is `4 days 3:30 hours`. This is larger than the
5140interval hence the start time is preponed by the maximum integral
5141multiple of the interval so that start time is still in the future,
5142i.e. preponed by 4 days. This yields a start time of `Mon 10:30`, next
5143executions are `Wed 10:30`, `Fri 10:30`. etc.
5144
5145* Example 2:
5146+
5147----
5148 startTime = 06:00
5149 interval = 1 day
5150----
5151+
5152Assuming that the server is started on `Mon 07:00` then this yields the
5153first run on Tuesday at 06:00 and a repetition interval of 1 day.
5154
Dave Borowitzd4fdc932018-11-02 15:06:25 -07005155[[All-Projects-project.config]]
5156== File `etc/All-Projects/project.config`
5157
5158The optional file `'$site_path'/etc/All-Projects/project.config` provides
5159defaults for configuration read from
5160link:config-project-config.html[`project.config`] in the
5161`All-Projects` repo. Unlike `gerrit.config`, this file contains project-type
5162configuration rather than server-type configuration.
5163
5164Most administrators will not need this file, and should instead make commits to
5165`All-Projects` to modify global config. However, a separate file can be useful
5166when managing multiple Gerrit servers, since pushing changes to defaults using
5167Puppet or a similar tool can be easier than scripting git updates to
5168`All-Projects`.
5169
5170The contents of the file are loaded each time the `All-Projects` project is
5171reloaded. Updating the file requires either evicting the project cache or
5172restarting the server.
5173
5174Caveats:
5175
5176* The path from which the file is read corresponds to the name of the repo,
5177 which is link:#gerrit.allProjects[configurable].
5178* Although the file lives in a directory that shares a name with a repository,
5179 this directory is not a Git repository.
5180* Only the file `project.config` is read from this directory to provide
5181 defaults; any other files in this directory, such as `rules.pl`, are ignored.
5182 (This behavior may change in the future.)
5183* Group names listed in the access config in this file are resolved to UUIDs
5184 using the `groups` file in the repository, not in the config directory. As a
5185 result, setting ACLs in this file is not recommended.
5186
Hector Oswaldo Caballero98952b02017-08-24 06:31:28 -04005187[[secure.config]]
5188== File `etc/secure.config`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005189
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005190The optional file `'$site_path'/etc/secure.config` overrides (or
5191supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005192The file should be readable only by the daemon process and can be
5193used to contain private configuration entries that wouldn't normally
5194be exposed to everyone.
5195
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005196Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005197----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07005198[auth]
5199 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
5200
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005201[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005202 username = webuser
5203 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005204
5205[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005206 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005207
5208[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005209 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005210
5211[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005212 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07005213
5214[remote "bar"]
5215 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005216----
5217
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005218== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01005219
5220The optional file `'$site_path'/etc/peer_keys` controls who can
5221login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
5222command.
5223
5224The format is one Base-64 encoded public key per line.
5225
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005226=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005227
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005228site_path::
5229+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005230Local filesystem directory holding the site customization assets.
5231Placing this directory under version control and/or backup is a
5232good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005233+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005234Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005235+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005236Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005237+
Dave Borowitz1e49e142013-04-09 12:14:57 -07005238* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005239
Saša Živkovd34dfe32017-11-20 11:14:35 +01005240[[jgitConfig]]
5241== File `etc/jgit.config`
5242
5243Gerrit uses the `$site_path/etc/jgit.config` file instead of the
5244system-wide and user-global Git configuration for its runtime JGit
5245configuration.
5246
5247Sample `etc/jgit.config` file:
5248----
5249[core]
5250 trustFolderStat = false
5251----
5252
Matthias Sohn85c18792020-09-08 01:42:03 +02005253[[jgit-gc]]
5254=== Section gc
5255
5256Options in section gc are used when command link:cmd-gc.html[gerrit gc] is used
5257or scheduled via options link:cmd-gc.html#gc.startTime[gc.startTime] and
5258link:cmd-gc.html#gc.interval[gc.interval].
5259
5260[[gc.auto]]gc.auto::
5261+
5262When there are approximately more than this many loose objects in the repository,
5263auto gc will pack them. Some commands use this command to perform a light-weight
5264garbage collection from time to time. The default value is 6700.
5265+
5266Setting this to 0 disables not only automatic packing based on the number of
5267loose objects, but any other heuristic auto gc will otherwise use to determine
5268if there’s work to do, such as link:#gc.autoPackLimit[gc.autoPackLimit].
5269
5270[[gc.autodetach]]gc.autodetach::
5271+
5272Makes auto gc run in a background thread. Default is `true`.
5273
5274[[gc.autopacklimit]]gc.autopacklimit::
5275+
5276When there are more than this many packs that are not marked with `*.keep` file
5277in the repository, auto gc consolidates them into one larger pack. The
5278default value is 50. Setting this to 0 disables it. Setting `gc.auto` to 0 will
5279also disable this.
5280
5281[[gc.packRefs]]gc.packRefs::
5282+
5283This variable determines whether gc runs git pack-refs. The default is `true`.
5284
5285[[gc.reflogExpire]]gc.reflogExpire::
5286+
5287Removes reflog entries older than this time; defaults to 90 days. The value "now"
5288expires all entries immediately, and "never" suppresses expiration altogether.
5289
5290[[gc.reflogExpireUnreachable]]gc.reflogExpireUnreachable::
5291+
5292Removes reflog entries older than this time and not reachable from the
5293current tip; defaults to 30 days. The value "now" expires all entries immediately,
5294and "never" suppresses expiration altogether.
5295
Matthias Sohnbf7ca5a2020-09-08 00:57:20 +02005296[[jgit-protocol]]
5297=== Section protocol
5298
5299[[protocol.version]]protocol.version::
5300+
5301If set, the server will accept requests from a client attempting to communicate
5302using the specified protocol version. Otherwise communication falls back to version 0.
5303If set in file `etc/jgit.config` this option will be used for all repositories of
5304the site. It can be overridden for a given repository by configuring a different
5305value in the repository's `config` file.
5306+
5307Supported versions:
53080:: the original wire protocol.
53091:: the original wire protocol with the addition of a version string in the initial response from the server.
53102:: wire protocol version 2. Speeds up fetches from repositories with many refs by allowing the client
5311 to specify which refs to list before the server lists them.
5312
Matthias Sohn85c18792020-09-08 01:42:03 +02005313[[jgit-receive]]
5314=== Section receive
5315
5316[[receive.autogc]]receive.autogc::
5317+
5318By default, `git-receive-pack` will run auto gc after receiving data from git-push and updating refs.
5319You can stop it by setting this variable to `false`. This is recommended in gerrit to avoid the
5320additional load this creates. Instead schedule gc using link:cmd-gc.html#gc.startTime[gc.startTime]
5321and link:cmd-gc.html#gc.interval[gc.interval] or e.g. in a cron job that runs gc in a separate process.
5322
Shawn O. Pearce5500e692009-05-28 15:55:01 -07005323GERRIT
5324------
5325Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07005326
5327SEARCHBOX
5328---------