blob: b7644399f503271286e3c2b9e364e8faadfb159c [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`.
585
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200586[[auth.gitOAuthProvider]]auth.gitOAuthProvider::
587+
588Selects the OAuth 2 provider to authenticate git over HTTP traffic with.
589+
590In general there is no way to determine from an access token alone, which
591OAuth 2 provider to address to verify that token, and the BasicAuth
592scheme does not support amending such details. If multiple OAuth provider
593plugins in a system offer support for git over HTTP authentication site
594administrators must configure, which one to use as default provider.
595In case the provider cannot be determined from a request the access token
596will be sent to the default provider for verification.
597+
598The value of this parameter must be the identifier of an OAuth 2 provider
599in the form `plugin-name:provider-name`. Consult the respective plugin
600documentation for details.
601
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200602[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
603+
604If set the username that is received to authenticate a git operation
605is converted to lower case for looking up the user account in Gerrit.
606+
607By setting this parameter a case insensitive authentication for the
608git operations can be achieved, if it is ensured that the usernames in
609Gerrit (scheme `username`) are stored in lower case (e.g. if the
610parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
611set to `${sAMAccountName.toLowerCase}`). It is important that for all
612existing accounts this username is already in lower case. It is not
613possible to convert the usernames of the existing accounts to lower
614case because this would break the access to existing per-user
Edwin Kempine7ae45c2018-09-20 09:57:15 +0200615branches and Gerrit provides no tool to do such a conversion.
616+
617Setting this parameter to `true` will prevent all users from login that
618have a non-lower-case username.
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200619+
620This parameter only affects git over http and git over SSH traffic.
621+
622By default this is set to false.
623
Shawn Pearcea931fe12013-06-11 12:29:17 -0700624[[auth.enableRunAs]]auth.enableRunAs::
625+
626If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
627header from any users granted the link:access-control.html#capability_runAs[Run As]
628capability. The header and capability permit the authenticated user
629to impersonate another account.
630+
631If false the feature is disabled and cannot be re-enabled without
632editing gerrit.config and restarting the server.
633+
634Default is true.
635
David Pursehouse21bd07b2015-11-27 00:15:42 +0900636[[auth.allowRegisterNewEmail]]auth.allowRegisterNewEmail::
637+
638Whether users are allowed to register new email addresses.
639+
640In addition for the HTTP authentication type
641link:#auth.httpemailheader[auth.httpemailheader] must *not* be set to
642enable registration of new email addresses.
643+
644By default, true.
645
Owen Lic24f7242017-06-14 10:04:00 -0400646[[auth.autoUpdateAccountActiveStatus]]auth.autoUpdateAccountActiveStatus::
647+
648Whether to allow automatic synchronization of an account's inactive flag upon login.
649If set to true, upon login, if the authentication back-end reports the account as active,
650the account's inactive flag in the internal Gerrit database will be updated to be active.
651If the authentication back-end reports the account as inactive, the account's flag will be
652updated to be inactive and the login attempt will be blocked. Users enabling this feature
653should ensure that their authentication back-end is supported. Currently, only
654strict 'LDAP' authentication is supported.
655+
Owen Lie2877bb2017-07-14 09:11:20 -0400656In addition, if this parameter is not set, or false, the corresponding scheduled
657task to deactivate inactive Gerrit accounts will also be disabled. If this
658parameter is set to true, users should also consider configuring the
659link:#accountDeactivation[accountDeactivation] section appropriately.
660+
Owen Lic24f7242017-06-14 10:04:00 -0400661By default, false.
662
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200663[[auth.skipFullRefEvaluationIfAllRefsAreVisible]]auth.skipFullRefEvaluationIfAllRefsAreVisible::
664+
665Whether to skip the full ref visibility checks as a performance shortcut when all refs are
666visible to a user. Full ref filtering would filter out things like pending edits.
667+
668By default, true.
669
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800670[[cache]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800671=== Section cache
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700672
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700673[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700674+
675Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700676future lookup. This local disk cache is used to retain potentially
677expensive to compute information across restarts. If the location
678does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700679+
David Pursehousea61ee502016-09-06 16:27:09 +0900680Technically, cached entities are persisted as a set of H2 databases
Saša Živkove607d6c2016-02-24 10:46:46 +0000681inside this directory.
682+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700683If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700684+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700685Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700686
Saša Živkovf3134572016-02-09 11:42:46 +0100687[[cache.h2CacheSize]]cache.h2CacheSize::
688+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200689The size of the in-memory cache for each opened H2 cache database, in bytes.
Saša Živkove607d6c2016-02-24 10:46:46 +0000690+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200691Some caches of Gerrit are persistent and are backed by an H2 database.
Saša Živkove607d6c2016-02-24 10:46:46 +0000692H2 uses memory to cache its database content. The parameter `h2CacheSize`
693allows to limit the memory used by H2 and thus prevent out-of-memory
Saša Živkovf3134572016-02-09 11:42:46 +0100694caused by the H2 database using too much memory.
695+
Dave Borowitz3d1f85c2018-11-16 15:36:04 -0800696Technically the H2 cache size is configured using the CACHE_SIZE parameter in
697the H2 JDBC connection URL, as described
698link:http://www.h2database.com/html/features.html#cache_settings[here]
Saša Živkovf3134572016-02-09 11:42:46 +0100699+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200700Default is unset, using up to half of the available memory.
David Pursehousee6976dc2017-06-30 16:33:44 +0900701+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200702H2 will persist this value in the database, so to unset explicitly specify 0.
Saša Živkovf3134572016-02-09 11:42:46 +0100703+
704Common unit suffixes of 'k', 'm', or 'g' are supported.
705
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200706[[cache.h2AutoServer]]cache.h2AutoServer::
707+
708If set to true, enable H2 autoserver mode for the H2-backed persistent cache
709databases.
710+
711See link:http://www.h2database.com/html/features.html#auto_mixed_mode[here]
712for detail.
713+
714Default is false.
715
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700716[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700717+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700718Maximum age to keep an entry in the cache. Entries are removed from
719the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700720Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700721+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700722* s, sec, second, seconds
723* m, min, minute, minutes
724* h, hr, hour, hours
725* d, day, days
726* w, week, weeks (`1 week` is treated as `7 days`)
727* mon, month, months (`1 month` is treated as `30 days`)
728* y, year, years (`1 year` is treated as `365 days`)
729
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700730+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200731--
Edwin Kempinabcd5042013-03-12 16:04:37 +0100732If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700733supplied, the maximum age is infinite and items are never purged
734except when the cache is full.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200735
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700736Default is `0`, meaning store forever with no expire, except:
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200737
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400738* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700739* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700740* `"web_sessions"`: default is `12 hours`
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200741--
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700742
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700743[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700744+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700745The total cost of entries to retain in memory. The cost computation
746varies by the cache. For most caches where the in-memory size of each
747entry is relatively the same, memoryLimit is currently defined to be
748the number of entries held by the cache (each entry costs 1).
749+
750For caches where the size of an entry can vary significantly between
751individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
752is an approximation of the total number of bytes stored by the cache.
753Larger entries that represent bigger patch sets or longer source files
754will consume a bigger portion of the memoryLimit. For these caches the
755memoryLimit should be set to roughly the amount of RAM (in bytes) the
756administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700757+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700758Default is 1024 for most caches, except:
759+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400760* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700761* `"diff"`: default is `10m` (10 MiB of memory)
762* `"diff_intraline"`: default is `10m` (10 MiB of memory)
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200763* `"diff_summary"`: default is `10m` (10 MiB of memory)
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400764* `"external_ids_map"`: default is `2` and should not be changed
Edwin Kempind967ec42017-11-13 15:14:41 +0100765* `"groups"`: default is unlimited
766* `"groups_byname"`: default is unlimited
767* `"groups_byuuid"`: default is unlimited
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700768* `"plugin_resources"`: default is 2m (2 MiB of memory)
769
770+
771If set to 0 the cache is disabled. Entries are removed immediately
772after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700773
Dave Borowitz08bac5ca2018-06-05 14:58:28 -0400774[[cache.name.expireFromMemoryAfterAccess]]cache.<name>.expireFromMemoryAfterAccess::
775+
776Time after last access to automatically expire entries from an in-memory
777cache. If 0 or not specified, entries are never expired in this manner.
778Values may use unit suffixes as in link:#cache.name.maxAge[maxAge].
779+
780This option only applies to in-memory caches; persistent cache values are
781not expired in this manner, and are only pruned via
782link:#cache.name.diskLimit[diskLimit].
783
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700784[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700785+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700786Total size in bytes of the keys and values stored on disk. Caches that
787have grown bigger than this size are scanned daily at 1 AM local
788server time to trim the cache. Entries are removed in least recently
789accessed order until the cache fits within this limit. Caches may
790grow larger than this during the day, as the size check is only
791performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700792+
Saša Živkove789f2e2016-09-22 10:37:34 +0200793Default is 128 MiB per cache, except:
794+
Dave Borowitzbab45862018-05-01 12:31:48 -0400795* `"change_notes"`: disk storage is disabled by default
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200796* `"diff_summary"`: default is `1g` (1 GiB of disk space)
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700797* `"external_ids_map"`: disk storage is disabled by default
Saša Živkove789f2e2016-09-22 10:37:34 +0200798
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700799+
Dave Borowitzdab51552018-05-14 16:35:37 -0700800If 0 or negative, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700801
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800802==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700803
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700804cache `"accounts"`::
805+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700806Cache entries contain important details of an active user, including
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +0200807their display name, preferences, and known email addresses. Entry
Dave Borowitzada289c2018-12-18 13:24:14 -0800808information is obtained from NoteDb data in the `All-Users` repo.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700809
810+
Dave Borowitzada289c2018-12-18 13:24:14 -0800811If direct updates are made to `All-Users`, this cache should be flushed.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700812
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400813cache `"adv_bases"`::
814+
815Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900816are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400817for the client to use as potential delta bases. Push over smart HTTP
818requires two HTTP requests, and this cache tries to carry state from
819the first request into the second to ensure it can complete.
820
Patrick Hieselace3dc92019-01-15 14:08:13 +0000821cache `"changes"`::
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200822+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200823The size of `memoryLimit` determines the number of projects for which
824all changes will be cached. If the cache is set to 1024, this means all
Patrick Hieselace3dc92019-01-15 14:08:13 +0000825changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800826+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000827Default value is 0 (disabled). It is disabled by default due to the fact
828that change updates are not communicated between Gerrit servers. Hence
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +0200829this cache should be disabled in an multi-master/multi-replica setup.
Gustaf Lundh53493772012-11-18 18:41:15 -0800830+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000831The cache should be flushed whenever the database changes table is modified
832outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200833
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700834cache `"diff"`::
835+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700836Each item caches the differences between two commits, at both the
837directory and file levels. Gerrit uses this cache to accelerate
838the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700839+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700840Entries in this cache are relatively large, so memoryLimit is an
841estimate in bytes of memory used. Administrators should try to target
842cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
843day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700844
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400845cache `"diff_intraline"`::
846+
847Each item caches the intraline difference of one file, when compared
848between two commits. Gerrit uses this cache to accelerate display of
849intraline differences when viewing a file.
850+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700851Entries in this cache are relatively large, so memoryLimit is an
852estimate in bytes of memory used. Administrators should try to target
853cache.diff.memoryLimit to fit all files users will view in a 1 or 2
854day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400855
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200856cache `"diff_summary"`::
Saša Živkove789f2e2016-09-22 10:37:34 +0200857+
858Each item caches list of file paths which are different between two
859commits. Gerrit uses this cache to accelerate computing of the list
860of paths of changed files.
861+
862Ideally, disk limit of this cache is large enough to cover all changes.
863This should significantly speed up change reindexing, especially
864full offline reindexing.
865
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400866cache `"external_ids_map"`::
867+
868A singleton cache whose sole entry is a map of the parsed representation
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400869of link:config-accounts.html#external-ids[all current external IDs]. The
870cache may temporarily contain 2 entries, but the second one is promptly
871expired.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400872+
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700873It is not recommended to change the in-memory attributes of this cache
874away from the defaults. The cache may be persisted by setting
875`diskLimit`, which is only recommended if cold start performance is
876problematic.
Patrick Hiesel42b47b12019-07-22 09:32:37 +0200877+
878`external_ids_map` supports computing the new cache value based on a
879previously cached state. This applies modifications based on the Git
880diff and is almost always faster.
881`cache.external_ids_map.enablePartialReloads` turns this behavior on
Patrick Hieselc486edf2019-08-19 15:55:17 +0200882or off. The default is `true`.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400883
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700884cache `"git_tags"`::
885+
886If branch or reference level READ access controls are used, this
887cache tracks which tags are reachable from the branch tips of a
888repository. Gerrit uses this information to determine the set
889of tags that a client may access, derived from which tags are
890part of the history of a visible branch.
891+
892The cache is persisted to disk across server restarts as it can
893be expensive to compute (60 or more seconds for a large history
894like the Linux kernel repository).
895
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700896cache `"groups"`::
897+
Edwin Kempin3091e112017-11-13 15:23:58 +0100898Caches the basic group information of internal groups by group ID,
899including the group owner, name, and description.
900+
Edwin Kempind967ec42017-11-13 15:14:41 +0100901For this cache it is important to configure a size that is larger than
902the number of internal Gerrit groups, otherwise general Gerrit
903performance may be poor. This is why by default this cache is
904unlimited.
905+
Edwin Kempin3091e112017-11-13 15:23:58 +0100906External group membership obtained from LDAP is cached under
907`"ldap_groups"`.
908
909cache `"groups_byname"`::
910+
911Caches the basic group information of internal groups by group name,
912including the group owner, name, and description.
913+
Edwin Kempind967ec42017-11-13 15:14:41 +0100914For this cache it is important to configure a size that is larger than
915the number of internal Gerrit groups, otherwise general Gerrit
916performance may be poor. This is why by default this cache is
917unlimited.
918+
Edwin Kempin3091e112017-11-13 15:23:58 +0100919External group membership obtained from LDAP is cached under
920`"ldap_groups"`.
921
922cache `"groups_byuuid"`::
923+
924Caches the basic group information of internal groups by group UUID,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700925including the group owner, name, and description.
926+
Edwin Kempind967ec42017-11-13 15:14:41 +0100927For this cache it is important to configure a size that is larger than
928the number of internal Gerrit groups, otherwise general Gerrit
929performance may be poor. This is why by default this cache is
930unlimited.
931+
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +0200932External group membership obtained from LDAP is cached under
933`"ldap_groups"`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700934
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +0200935cache `"groups_bymember"`::
Matt Fischer620255a2011-03-22 14:28:23 -0500936+
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +0200937Caches the groups which contain a specific member (account). If direct
938updates are made to the `account_group_members` table, this cache should
939be flushed.
940
Alice Kober-Sotzek3e1fe1b2017-10-12 14:44:17 +0200941cache `"groups_bysubgroups"`::
942+
943Caches the parent groups of a subgroup. If direct updates are made
Matt Fischer620255a2011-03-22 14:28:23 -0500944to the `account_group_includes` table, this cache should be flushed.
945
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700946cache `"ldap_groups"`::
947+
948Caches the LDAP groups that a user belongs to, if LDAP has been
949configured on this server. This cache should be configured with a
950low maxAge setting, to ensure LDAP modifications are picked up in
951a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700952
Gustaf Lundh0919a492012-10-19 15:29:23 +0200953cache `"ldap_groups_byinclude"`::
954+
955Caches the hierarchical structure of LDAP groups.
956
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -0700957cache `"ldap_usernames"`::
958+
959Caches a mapping of LDAP username to Gerrit account identity. The
960cache automatically updates when a user first creates their account
961within Gerrit, so the cache expire time is largely irrelevant.
962
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700963cache `"permission_sort"`::
964+
David Pursehouse221d4f62012-06-08 17:38:08 +0900965Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700966reference. Sorting the sections can be expensive when regular
967expressions are used, so this cache remembers the ordering for
968each branch.
969
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700970cache `"plugin_resources"`::
971+
972Caches formatted plugin resources, such as plugin documentation that
973has been converted from Markdown to HTML. The memoryLimit refers to
974the bytes of memory dedicated to storing the documentation.
975
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700976cache `"projects"`::
977+
978Caches the project description records, from the `projects` table
979in the database. If a project record is updated or deleted, this
980cache should be flushed. Newly inserted projects do not require
981a cache flush, as they will be read upon first reference.
982
Dave Borowitz08aa8bb2018-04-05 12:01:06 -0400983cache `"prolog_rules"`::
984+
985Caches parsed `rules.pl` contents for each project. This cache uses the same
986size as the `projects` cache, and cannot be configured independently.
987
Patrick Hiesela57c0d62019-02-19 09:09:22 +0100988cache `"pure_revert"`::
989+
990Result of checking if one change or commit is a pure/clean revert of
991another.
992
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700993cache `"sshkeys"`::
994+
995Caches unpacked versions of user SSH keys, so the internal SSH daemon
996can match against them during authentication. The unit of storage
997is per-user, so 1024 items translates to 1024 unique user accounts.
998As each individual user account may configure multiple SSH keys,
999the total number of keys may be larger than the item count.
1000
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001001cache `"web_sessions"`::
1002+
1003Tracks the live user sessions coming in over HTTP. Flushing this
1004cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -07001005them to sign-in again. To avoid breaking active users, this cache
1006is not flushed automatically by `gerrit flush-caches --all`, but
1007instead must be explicitly requested.
1008+
1009If no disk cache is configured (or `cache.web_sessions.diskLimit`
1010is set to 0) a server restart will force all users to sign-out,
1011and need to sign-in again after the restart, as the cache was
1012unable to persist the session information. Enabling a disk cache
1013is strongly recommended.
1014+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001015Session storage is relatively inexpensive. The average entry in
1016this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001017
Shawn O. Pearce4016a932009-05-28 15:12:40 -07001018See also link:cmd-flush-caches.html[gerrit flush-caches].
1019
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001020==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001021
Hugo Arès2bc86812015-03-09 15:20:28 -04001022[[cache.diff.timeout]]cache.diff.timeout::
1023+
1024Maximum number of milliseconds to wait for diff data before giving up and
1025falling back on a simpler diff algorithm that will not be able to break down
1026modified regions into smaller ones. This is a work around for an infinite loop
1027bug in the default difference algorithm implementation.
1028+
1029Values should use common unit suffixes to express their setting:
1030+
1031* ms, milliseconds
1032* s, sec, second, seconds
1033* m, min, minute, minutes
1034* h, hr, hour, hours
1035
1036+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001037--
Hugo Arès2bc86812015-03-09 15:20:28 -04001038If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001039
Hugo Arès2bc86812015-03-09 15:20:28 -04001040Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001041--
Hugo Arès2bc86812015-03-09 15:20:28 -04001042
Edwin Kempin42d27432013-11-24 17:06:24 +01001043[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001044+
1045Maximum number of milliseconds to wait for intraline difference data
1046before giving up and disabling it for a particular file pair. This is
1047a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +09001048implementation.
1049+
1050If computation takes longer than the timeout, the worker thread is
1051terminated, an error message is shown, and no intraline difference is
1052displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001053+
1054Values should use common unit suffixes to express their setting:
1055+
1056* ms, milliseconds
1057* s, sec, second, seconds
1058* m, min, minute, minutes
1059* h, hr, hour, hours
1060
1061+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001062--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001063If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001064
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001065Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001066--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001067
Edwin Kempin42d27432013-11-24 17:06:24 +01001068[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001069+
1070Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001071when populating a diff cache entry. This flag is provided primarily
1072as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +09001073necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001074this setting will fallback to `cache.diff.intraline` if not set in the
1075configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001076+
1077Default is true, enabled.
1078
Edwin Kempin42d27432013-11-24 17:06:24 +01001079[[cache.projects.checkFrequency]]cache.projects.checkFrequency::
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -07001080+
1081How often project configuration should be checked for update from Git.
1082Gerrit Code Review caches project access rules and configuration in
1083memory, checking the refs/meta/config branch every checkFrequency
1084minutes to see if a new revision should be loaded and used for future
1085access. Values can be specified using standard time unit abbreviations
1086('ms', 'sec', 'min', etc.).
1087+
1088If set to 0, checks occur every time, which may slow down operations.
Shawn Pearcec825ef12013-02-20 11:29:46 -08001089If set to 'disabled' or 'off', no check will ever be done.
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -07001090Administrators may force the cache to flush with
1091link:cmd-flush-caches.html[gerrit flush-caches].
1092+
1093Default is 5 minutes.
1094
Simon Leifc19ff12014-10-02 13:36:00 -04001095[[cache.projects.loadOnStartup]]cache.projects.loadOnStartup::
1096+
1097If the project cache should be loaded during server startup.
1098+
1099The cache is loaded concurrently. Admins should ensure that the cache
1100size set under <<cache.name.memoryLimit,cache.projects.memoryLimit>>
1101is not smaller than the number of repos.
1102+
1103Default is false, disabled.
1104
1105[[cache.projects.loadThreads]]cache.projects.loadThreads::
1106+
1107Only relevant if <<cache.projects.loadOnStartup,cache.projects.loadOnStartup>>
1108is true.
1109+
1110The number of threads to allocate for loading the cache at startup. These
1111threads will die out after the cache is loaded.
1112+
1113Default is the number of CPUs.
1114
Shawn Pearce67a33302016-08-11 11:51:59 -07001115
1116[[capability]]
1117=== Section capability
1118
1119[[capability.administrateServer]]capability.administrateServer::
1120+
1121Names of groups of users that are allowed to exercise the
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001122`administrateServer` capability, in addition to those listed in
Shawn Pearce67a33302016-08-11 11:51:59 -07001123All-Projects. Configuring this option can be a useful fail-safe
1124to recover a server in the event an administrator removed all
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001125groups from the `administrateServer` capability, or to ensure that
Shawn Pearce67a33302016-08-11 11:51:59 -07001126specific groups always have administration capabilities.
1127+
1128----
1129[capability]
1130 administrateServer = group Fail Safe Admins
1131----
1132+
1133The configuration file uses group names, not UUIDs. If a group is
1134renamed the gerrit.config file must be updated to reflect the new
1135name. If a group cannot be found for the configured name a warning
1136is logged and the server will continue normal startup.
1137+
1138If not specified (default), only the groups listed by All-Projects
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001139may use the `administrateServer` capability.
1140
1141[[capability.makeFirstUserAdmin]]capability.makeFirstUserAdmin::
1142+
1143Whether the first user that logs in to the Gerrit server should
1144automatically be added to the administrator group and hence get the
1145`administrateServer` capability assigned. This is useful to bootstrap
1146the authentication database.
1147+
1148Default is true.
Shawn Pearce67a33302016-08-11 11:51:59 -07001149
1150
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001151[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001152=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -07001153
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001154[[change.allowBlame]]change.allowBlame::
1155+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001156Allow blame on side by side diff. If set to false, blame cannot be used.
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001157+
1158Default is true.
1159
Patrick Hieselca6384d2017-12-21 11:51:11 +01001160[[change.api.allowedIdentifier]]change.api.allowedIdentifier::
1161+
1162Change identifier(s) that are allowed on the API. See
1163link:rest-api-changes.html#change-id[Change Id] for more information.
1164+
1165Possible values are `ALL`, `TRIPLET`, `NUMERIC_ID`, `I_HASH`, and
1166`COMMIT_HASH` or any combination of those as a string list.
1167`PROJECT_NUMERIC_ID` is always allowed and doesn't need to be listed
1168explicitly.
1169+
1170Default is `ALL`.
1171
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001172[[change.api.excludeMergeableInChangeInfo]]change.api.excludeMergeableInChangeInfo::
David Ostrovskyd1cb9182018-05-07 08:24:05 +02001173+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001174If true, the mergeability bit in
1175link:rest-api-changes.html#change-info[ChangeInfo] will never be set. It can
1176be requested separately through the
1177link:rest-api-changes.html#get-mergeable[get-mergeable] endpoint.
David Ostrovskyd1cb9182018-05-07 08:24:05 +02001178+
1179Default is false.
1180
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001181[[change.cacheAutomerge]]change.cacheAutomerge::
1182+
1183When reviewing diff commits, the left-hand side shows the output of the
1184result of JGit's automatic merge algorithm. This option controls whether
1185this output is cached in the change repository, or if only the diff is
1186cached in the persistent `diff` cache.
1187+
1188If true, automerge results are stored in the repository under
1189`refs/cache-automerge/*`; the results of diffing the change against its
1190automerge base are stored in the diff cache. If false, no extra data is
1191stored in the repository, only the diff cache. This can result in slight
1192performance improvements by reducing the number of refs in the repo.
1193+
1194Default is true.
1195
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001196[[change.disablePrivateChanges]]change.disablePrivateChanges::
Patrick Hieseldb8df482019-01-24 10:11:23 +01001197+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001198If set to true, users are not allowed to create private changes.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001199+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001200The default is false.
1201
1202[[change.largeChange]]change.largeChange::
1203+
1204Number of changed lines from which on a change is considered as a large
1205change. The number of changed lines of a change is the sum of the lines
1206that were inserted and deleted in the change.
1207+
1208The specified value is used to visualize the change sizes in the Web UI
1209in change tables and user dashboards.
1210+
1211By default 500.
1212
Dave Borowitzca614bc2019-04-15 15:29:15 -07001213[[change.maxUpdates]]change.maxUpdates::
1214+
1215Maximum number of updates to a change. Counts only updates to the main NoteDb
1216meta ref; draft comments, robot comments, stars, etc. do not count towards the
1217total.
1218+
1219Many NoteDb operations require walking the entire change meta ref and loading
1220its contents into memory, so changes with arbitrarily many updates may cause
1221high CPU usage, memory pressure, persistent cache bloat, and other problems.
1222+
Dave Borowitz18e7b552019-04-17 07:53:38 -07001223The following operations are allowed even when a change is at the limit:
1224* Abandon
1225* Submit
1226* Submit by push with `%submit`
1227* Auto-close by pushing directly to the branch
1228* Fix with link:rest-api-changes.html#fix-input[`expect_merged_as`]
1229+
Dave Borowitzca614bc2019-04-15 15:29:15 -07001230By default 1000.
1231
Edwin Kempin67229a42019-10-08 09:13:34 +02001232[[change.move]]change.move::
1233+
1234Whether the link:rest-api-changes.html#move-change[Move Change] REST
1235endpoint is enabled.
1236+
1237The move change functionality has some corner cases with undesired side
1238effects. Hence administrators may decide to disable this functionality.
1239In particular, if a change that has dependencies on other changes is
1240moved to a new branch, and the moved change gets submitted to the new
1241branch, the changes on which the change depends are silently merged
1242into the new branch, although these changes have not been moved to that
1243branch (see details in
1244link:https://bugs.chromium.org/p/gerrit/issues/detail?id=9877[issue
12459877]).
1246+
1247By default true.
1248
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001249[[change.replyLabel]]change.replyLabel::
1250+
1251Label name for the reply button. In the user interface an ellipsis (…)
1252is appended.
1253+
1254Default is "Reply". In the user interface it becomes "Reply…".
1255
1256[[change.replyTooltip]]change.replyTooltip::
1257+
1258Tooltip for the reply button. In the user interface a note about the
1259keyboard shortcut is appended.
1260+
1261Default is "Reply and score". In the user interface it becomes "Reply
1262and score (Shortcut: a)".
1263
1264[[change.robotCommentSizeLimit]]change.robotCommentSizeLimit::
1265+
1266Maximum allowed size of a robot comment that will be accepted. Robot comments
1267which exceed the indicated size will be rejected on addition. The specified
1268value is interpreted as the maximum size in bytes of the JSON representation of
1269the robot comment. Common unit suffixes of 'k', 'm', or 'g' are supported.
1270Zero or negative values allow robot comments of unlimited size.
1271+
1272The default limit is 1024kB.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001273
Luca Milanesiof2a275b2017-04-10 10:59:34 +01001274[[change.showAssigneeInChangesTable]]change.showAssigneeInChangesTable::
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001275+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001276Show assignee field in changes table. If set to false, assignees will
1277not be visible in changes table.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001278+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001279Default is false.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001280
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001281[[change.strictLabels]]change.strictLabels::
1282+
1283Reject invalid label votes: invalid labels or invalid values. This
David Pursehouse33495ab2019-10-31 09:38:43 +09001284configuration option is provided for backwards compatibility and may
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001285be removed in future gerrit versions.
1286+
1287Default is false.
1288
David Ostrovsky9933eb32014-05-20 16:08:20 +02001289[[change.submitLabel]]change.submitLabel::
1290+
1291Label name for the submit button.
1292+
1293Default is "Submit".
1294
Stefan Beller7c380d512015-08-21 10:55:21 -07001295[[change.submitLabelWithParents]]change.submitLabelWithParents::
1296+
1297Label name for the submit button if the change has parents which will
1298be submitted together with this change.
1299+
1300Default is "Submit including parents".
1301
David Ostrovsky9933eb32014-05-20 16:08:20 +02001302[[change.submitTooltip]]change.submitTooltip::
1303+
1304Tooltip for the submit button. Variables available for replacement
1305include `${patchSet}` for the current patch set number (1, 2, 3),
1306`${branch}` for the branch name ("master") and `${commit}` for the
1307abbreviated commit SHA-1 (`c9c0edb`).
1308+
1309Default is "Submit patch set ${patchSet} into ${branch}".
1310
Stefan Beller0e655542015-07-20 21:14:38 -07001311[[change.submitTooltipAncestors]]change.submitTooltipAncestors::
1312+
1313Tooltip for the submit button if there are ancestors which would
1314also be submitted by submitting the change. Additionally to the variables
1315as in link:#change.submitTooltip[change.submitTooltip], there is the
1316variable `${submitSize}` indicating the number of changes which are
1317submitted.
1318+
1319Default is "Submit all ${topicSize} changes of the same topic (${submitSize}
1320changes including ancestors and other changes related by topic)".
1321
Stefan Bellera038cf72015-01-13 16:25:10 -08001322[[change.submitTopicLabel]]change.submitTopicLabel::
1323+
1324If `change.submitWholeTopic` is set and a change has a topic,
1325the label name for the submit button is given here instead of
1326the configuration `change.submitLabel`.
1327+
1328Defaults to "Submit whole topic"
1329
1330[[change.submitTopicTooltip]]change.submitTopicTooltip::
1331+
David Pursehousea61ee502016-09-06 16:27:09 +09001332If `change.submitWholeTopic` is configured to true and a change has a
Stefan Bellera038cf72015-01-13 16:25:10 -08001333topic, this configuration determines the tooltip for the submit button
1334instead of `change.submitTooltip`. The variable `${topicSize}` is available
Stefan Beller7c380d512015-08-21 10:55:21 -07001335for the number of changes in the same topic to be submitted. The number of
1336all changes to be submitted is in the variable `${submitSize}`.
Stefan Bellera038cf72015-01-13 16:25:10 -08001337+
Stefan Beller7c380d512015-08-21 10:55:21 -07001338Defaults to "Submit all ${topicSize} changes of the same topic
1339(${submitSize} changes including ancestors and other
1340changes related by topic)".
Stefan Bellera038cf72015-01-13 16:25:10 -08001341
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001342[[change.submitWholeTopic]]change.submitWholeTopic::
Richard Möhne4abe9a2014-11-13 20:05:13 +01001343+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001344Determines if the submit button submits the whole topic instead of
1345just the current change.
David Ostrovskya304aff2018-04-05 23:07:51 +02001346+
1347Default is false.
1348
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001349[[change.updateDelay]]change.updateDelay::
Changcheng Xiao16095352017-12-18 10:03:08 +01001350+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001351How often in seconds the web interface should poll for updates to the
1352currently open change. The poller relies on the client's browser
1353cache to use If-Modified-Since and respect `304 Not Modified` HTTP
1354responses. This allows for fast polls, often under 8 milliseconds.
Changcheng Xiao16095352017-12-18 10:03:08 +01001355+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001356With a configured 30 second delay a server with 4900 active users will
1357typically need to dedicate 1 CPU to the update check. 4900 users
1358divided by an average delay of 30 seconds is 163 requests arriving per
1359second. If requests are served at \~6 ms response time, 1 CPU is
1360necessary to keep up with the update request traffic. On a smaller
1361user base of 500 active users, the default 30 second delay is only 17
1362requests per second and requires ~10% CPU.
1363+
1364If 0 the update polling is disabled.
1365+
1366Default is 5 minutes.
Changcheng Xiao16095352017-12-18 10:03:08 +01001367
Edwin Kempine326a1d2015-06-03 10:27:39 +02001368[[changeCleanup]]
1369=== Section changeCleanup
1370
1371This section allows to configure change cleanups and schedules them to
1372run periodically.
1373
1374[[changeCleanup.abandonAfter]]changeCleanup.abandonAfter::
1375+
1376Period of inactivity after which open changes should be abandoned
1377automatically.
1378+
1379By default `0`, never abandon open changes.
1380+
1381[WARNING] Auto-Abandoning changes may confuse/annoy users. When
1382enabling this, make sure to choose a reasonably large grace period and
1383inform users in advance.
1384+
1385The following suffixes are supported to define the time unit:
1386+
1387* `d, day, days`
1388* `w, week, weeks` (`1 week` is treated as `7 days`)
1389* `mon, month, months` (`1 month` is treated as `30 days`)
1390* `y, year, years` (`1 year` is treated as `365 days`)
1391
Edwin Kempin7080ef12015-06-10 15:03:09 +02001392[[changeCleanup.abandonIfMergeable]]changeCleanup.abandonIfMergeable::
1393+
1394Whether changes which are mergeable should be auto-abandoned.
1395+
1396By default `true`.
1397
Jacek Centkowski36d35212019-05-13 14:32:00 +02001398[[changeCleanup.cleanupAccountPatchReview]]changeCleanup.cleanupAccountPatchReview::
1399+
1400Whether accountPatchReview data should be also removed when change
1401gets auto-abandoned.
1402+
1403By default `false`.
1404
Edwin Kempine326a1d2015-06-03 10:27:39 +02001405[[changeCleanup.abandonMessage]]changeCleanup.abandonMessage::
1406+
1407Change message that should be posted when a change is abandoned.
1408+
1409'${URL}' can be used as a placeholder for the Gerrit web URL.
1410+
1411By default "Auto-Abandoned due to inactivity, see
1412${URL}Documentation/user-change-cleanup.html#auto-abandon\n\n
1413If this change is still wanted it should be restored.".
1414
1415[[changeCleanup.startTime]]changeCleanup.startTime::
1416+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001417The link:#schedule-configuration-startTime[start time] for running
1418change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001419
1420[[changeCleanup.interval]]changeCleanup.interval::
1421+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001422The link:#schedule-configuration-interval[interval] for running
1423change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001424
Edwin Kempind33d95a2018-02-16 11:44:04 +01001425link:#schedule-configuration-examples[Schedule examples] can be found
1426in the link:#schedule-configuration[Schedule Configuration] section.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001427
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001428[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001429=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001430
Brad Larson991a31b2009-11-03 14:30:26 -06001431Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -05001432patch comments, in-line code comments and approval category value descriptions
1433to turn set strings into hyperlinks. One common use is for linking to
1434bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -06001435
1436In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001437will match typical Gerrit Change-Id values and create a hyperlink
1438to changes which reference it. The second configuration 'bugzilla'
1439will hyperlink terms such as 'bug 42' to an external bug tracker,
1440supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +09001441configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001442how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -06001443
Sven Selberg2a0beab2018-04-20 14:49:20 +02001444commentlinks supports link:#reloadConfig[configuration reloads]. Though a
Gustaf Lundhca7eb792018-04-16 10:56:03 +02001445link:cmd-flush-caches.html[flush-caches] of "projects" is needed for the
1446commentlinks to be immediately available in the UI.
1447
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001448----
1449[commentlink "changeid"]
1450 match = (I[0-9a-f]{8,40})
David Pursehouse9f68e1a2016-01-28 09:21:03 +00001451 link = "#/q/$1"
Brad Larson991a31b2009-11-03 14:30:26 -06001452
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001453[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001454 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001455 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -06001456
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001457[commentlink "tracker"]
1458 match = ([Bb]ug:\\s+)(\\d+)
1459 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
1460----
1461
Dave Borowitz13b38002013-04-08 12:03:29 -07001462Comment links can also be specified in `project.config` and sections in
1463children override those in parents. The only restriction is that to
1464avoid injecting arbitrary user-supplied HTML in the page, comment links
1465defined in `project.config` may only supply `link`, not `html`.
1466
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001467[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -06001468+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001469A JavaScript regular expression to match positions to be replaced
1470with a hyperlink. Subexpressions of the matched string can be
1471stored using groups and accessed with `$'n'` syntax, where 'n'
1472is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -06001473+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001474The configuration file parser eats one level of backslashes, so the
1475character class `\s` requires `\\s` in the configuration file. The
1476parser also terminates the line at the first `#`, so a match
1477expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001478+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -08001479To match case insensitive strings, a character class with both the
1480upper and lower case character for each position must be used. For
1481example, to match the string `bug` in a case insensitive way the match
1482pattern `[bB][uU][gG]` needs to be used.
1483+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001484The commentlink.name.match regular expressions are applied to the raw,
1485unformatted and unescaped text form. Regex matching against HTML is not
1486supported. Comment link patterns that are written in this style should
1487be updated to match text formats.
Matthew Webbercd7d2bf2015-10-14 15:54:06 +01001488+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001489A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -06001490
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001491[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -06001492+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001493The URL to direct the user to whenever the regular expression is
1494matched. Groups in the match expression may be accessed as `$'n'`.
1495+
1496The link property is used only when the html property is not present.
1497
1498[[commentlink.name.html]]commentlink.<name>.html::
1499+
1500HTML to replace the entire matched string with. If present,
1501this property overrides the link property above. Groups in the
1502match expression may be accessed as `$'n'`.
1503+
1504The configuration file eats double quotes, so escaping them as
1505`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -06001506
Dave Borowitz82d79c02013-04-08 15:45:12 -07001507[[commentlink.name.enabled]]commentlink.<name>.enabled::
1508+
1509Whether the comment link is enabled. A child project may override a
1510section in a parent or the site-wide config that is disabled by
1511specifying `enabled = true`.
1512+
1513Disabling sections in `gerrit.config` can be used by site administrators
1514to create a library of comment links with `html` set that are not
1515user-supplied and thus can be verified to be XSS-free, but are only
1516enabled for a subset of projects.
1517+
David Pursehouse6f1af472013-12-11 19:23:33 +09001518By default, true.
1519+
Dave Borowitz82d79c02013-04-08 15:45:12 -07001520Note that the names and contents of disabled sections are visible even
1521to anonymous users via the
1522link:rest-api-projects.html#get-config[REST API].
1523
Brad Larson991a31b2009-11-03 14:30:26 -06001524
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001525[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001526=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001527
1528These settings are applied only if Gerrit is started as the container
1529process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
1530
1531[[container.heapLimit]]container.heapLimit::
1532+
1533Maximum heap size of the Java process running Gerrit, in bytes.
1534This property is translated into the '-Xmx' flag for the JVM.
1535+
1536Default is platform and JVM specific.
1537+
1538Common unit suffixes of 'k', 'm', or 'g' are supported.
1539
1540[[container.javaHome]]container.javaHome::
1541+
1542Path of the JRE/JDK installation to run Gerrit with. If not set, the
1543Gerrit startup script will attempt to search your system and guess
1544a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
1545
1546[[container.javaOptions]]container.javaOptions::
1547+
1548Additional options to pass along to the Java runtime. If multiple
1549values are configured, they are passed in order on the command line,
1550separated by spaces. These options are appended onto 'JAVA_OPTIONS'.
1551
David Ostrovskyc772bd82013-10-03 10:37:51 +02001552For example, it is possible to overwrite Gerrit's default log4j
1553configuration:
1554
1555----
1556 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
1557----
1558
Hugo Arès6710f0a2014-11-04 10:28:42 -05001559[[container.daemonOpt]]container.daemonOpt::
1560+
1561Additional options to pass to the daemon (e.g. '--enable-httpd'). If
1562multiple values are configured, they are passed in that order to the command
1563line, separated by spaces.
1564+
1565Execute `java -jar gerrit.war daemon --help` to see all possible
1566options.
1567
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001568[[container.replica]]container.replica::
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001569+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02001570Used on Gerrit replica installations. If set to true the Gerrit JVM is
1571called with the '--replica' switch, enabling replica mode. If no value is
Matt Baker8ce12fc2013-11-26 21:43:12 -07001572set (or any other value), Gerrit defaults to master mode.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001573
David Ostrovsky21fca752019-10-18 08:50:29 +02001574[[container.slave]]container.slave::
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001575+
1576Backward compatibility for 'container.slave' config setting.
1577
Khai Do6168beb2016-12-19 17:26:28 -08001578[[container.startupTimeout]]container.startupTimeout::
1579+
1580The maximum time (in seconds) to wait for a gerrit.sh start command
1581to run a new Gerrit daemon successfully. If not set, defaults to
158290 seconds.
1583
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001584[[container.user]]container.user::
1585+
1586Login name (or UID) of the operating system user the Gerrit JVM
1587will execute as. If not set, defaults to the user who launched
1588the 'gerrit.sh' wrapper script.
1589
1590[[container.war]]container.war::
1591+
1592Path of the JAR file to start daemon execution with. This should
1593be the path of the local 'gerrit.war' archive. Overrides the
1594environment variable 'GERRIT_WAR'.
1595+
1596If not set, defaults to '$site_path/bin/gerrit.war', or to
1597'$HOME/gerrit.war'.
1598
1599
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001600[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001601=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001602
Saša Živkovd34dfe32017-11-20 11:14:35 +01001603[NOTE]
1604The link:#jgitConfig[etc/jgit.config] file supports configuration of all JGit
1605options.
1606
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001607[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001608+
1609Number of bytes of a pack file to load into memory in a single
1610read operation. This is the "page size" of the JGit buffer cache,
1611used for all pack access operations. All disk IO occurs as single
1612window reads. Setting this too large may cause the process to load
1613more data than is required; setting this too small may increase
1614the frequency of `read()` system calls.
1615+
1616Default on JGit is 8 KiB on all platforms.
1617+
1618Common unit suffixes of 'k', 'm', or 'g' are supported.
1619
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001620[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001621+
1622Maximum number of bytes to load and cache in memory from pack files.
1623If JGit needs to access more than this many bytes it will unload less
1624frequently used windows to reclaim memory space within the process.
1625As this buffer must be shared with the rest of the JVM heap, it
1626should be a fraction of the total memory available.
1627+
1628Default on JGit is 10 MiB on all platforms.
1629+
1630Common unit suffixes of 'k', 'm', or 'g' are supported.
1631
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001632[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001633+
1634Maximum number of bytes to reserve for caching base objects
1635that multiple deltafied objects reference. By storing the entire
1636decompressed base object in a cache Git is able to avoid unpacking
1637and decompressing frequently used base objects multiple times.
1638+
1639Default on JGit is 10 MiB on all platforms. You probably do not
1640need to adjust this value.
1641+
1642Common unit suffixes of 'k', 'm', or 'g' are supported.
1643
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001644[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001645+
1646Maximum number of pack files to have open at once. A pack file
1647must be opened in order for any of its data to be available in
1648a cached window.
1649+
1650If you increase this to a larger setting you may need to also adjust
1651the ulimit on file descriptors for the host JVM, as Gerrit needs
1652additional file descriptors available for network sockets and other
1653repository data manipulation.
1654+
1655Default on JGit is 128 file descriptors on all platforms.
1656
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001657[[core.streamFileThreshold]]core.streamFileThreshold::
1658+
1659Largest object size, in bytes, that JGit will allocate as a
1660contiguous byte array. Any file revision larger than this threshold
1661will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001662files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001663during delta decompression.
1664+
1665Servers with very high traffic should set this to be larger than
1666the size of their common big files. For example a server managing
1667the Android platform typically has to deal with ~10-12 MiB XML
1668files, so `15 m` would be a reasonable setting in that environment.
1669Setting this too high may cause the JVM to run out of heap space
1670when handling very big binary files, such as device firmware or
1671CD-ROM ISO images.
1672+
Edwin Kempin7f5a4af2014-11-12 10:05:03 +01001673Defaults to 25% of the available JVM heap, limited to 2048m.
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001674+
1675Common unit suffixes of 'k', 'm', or 'g' are supported.
1676
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001677[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001678+
1679When true, JGit will use `mmap()` rather than `malloc()+read()`
1680to load data from pack files. The use of mmap can be problematic
1681on some JVMs as the garbage collector must deduce that a memory
1682mapped segment is no longer in use before a call to `munmap()`
1683can be made by the JVM native code.
1684+
1685In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001686pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001687of virtual address space, as the garbage collector cannot reclaim
1688unused mapped spaces fast enough.
1689+
1690Default on JGit is false. Although potentially slower, it yields
1691much more predictable behavior.
1692
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001693[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1694+
1695Size of the buffer to store logging events for asynchronous logging.
1696Putting a larger value can protect threads from stalling when the
1697AsyncAppender threads are not fast enough to consume the logging events
David Pursehouse1ff91c02015-05-19 15:05:26 +09001698from the buffer. It also protects from losing log entries in this case.
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001699+
1700Default is 64 entries.
1701
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001702[[core.useRecursiveMerge]]core.useRecursiveMerge::
1703+
Edwin Kempin71831d22014-07-15 08:54:29 +02001704Use JGit's recursive merger for three-way merges. This only affects
Sebastian Schuberth774aac92015-04-16 13:21:04 +02001705projects that allow content merges.
Edwin Kempin71831d22014-07-15 08:54:29 +02001706+
1707As explained in this
1708link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[
1709blog], the recursive merge produces better results if the two commits
1710that are merged have more than one common predecessor.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001711+
Edwin Kempin7853c5b2014-07-15 08:57:17 +02001712Default is true.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001713
Hugo Arès47344372016-06-27 10:23:17 -04001714[[core.repositoryCacheCleanupDelay]]core.repositoryCacheCleanupDelay::
1715+
1716Delay between each periodic cleanup of expired repositories.
1717+
1718Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1719`min`, etc.).
1720+
1721Set it to 0 in order to switch off cache expiration. If cache expiration is
1722switched off, the JVM can still evict cache entries when it is running low
1723on available heap memory.
1724+
1725Set it to -1 to automatically derive cleanup delay from
1726`core.repositoryCacheExpireAfter` (lowest value between 1/10 of
1727`core.repositoryCacheExpireAfter` and 10 minutes).
1728+
1729Default is -1.
1730
1731[[core.repositoryCacheExpireAfter]]core.repositoryCacheExpireAfter::
1732+
1733Time an unused repository should expire and be evicted from the repository
1734cache.
1735+
1736Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1737`min`, etc.).
1738+
1739Default is 1 hour.
1740
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001741[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001742=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03001743
1744----
1745[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001746 command = checkout
1747 command = cherry_pick
1748 command = pull
1749 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001750 scheme = ssh
1751 scheme = http
1752 scheme = anon_http
1753 scheme = anon_git
1754 scheme = repo_download
1755----
1756
1757The download section configures the allowed download methods.
1758
Edwin Kempin08b03a22012-09-14 16:32:57 +02001759[[download.command]]download.command::
1760+
1761Commands that should be offered to download changes.
1762+
1763Multiple commands are supported:
1764+
1765* `checkout`
1766+
1767Command to fetch and checkout the patch set.
1768+
1769* `cherry_pick`
1770+
1771Command to fetch the patch set and to cherry-pick it onto the current
1772commit.
1773+
1774* `pull`
1775+
1776Command to pull the patch set.
1777+
1778* `format_patch`
1779+
1780Command to fetch the patch set and to feed it into the `format-patch`
1781command.
1782
1783+
1784If `download.command` is not specified, all download commands are
1785offered.
1786
monica.dionisio3f630442010-06-29 15:42:57 -03001787[[download.scheme]]download.scheme::
1788+
1789Schemes that should be used to download changes.
1790+
1791Multiple schemes are supported:
1792+
1793* `http`
1794+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001795Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001796+
1797* `ssh`
1798+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001799Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001800+
1801* `anon_http`
1802+
1803Anonymous HTTP download is allowed.
1804+
1805* `anon_git`
1806+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001807Anonymous Git download is allowed. This is not default, it is also
1808necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1809variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001810+
1811* `repo_download`
1812+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001813Gerrit advertises patch set downloads with the `repo download`
1814command, assuming that all projects managed by this instance are
1815generally worked on with the repo multi-repository tool. This is
1816not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001817
1818+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001819If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001820downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001821
Edwin Kempin322db672015-07-03 08:50:46 +02001822[[download.checkForHiddenChangeRefs]]download.checkForHiddenChangeRefs::
1823+
1824Whether the download commands should be adapted when the change refs
1825are hidden.
1826+
1827Git has a configuration option to hide refs from the initial
1828advertisement (`uploadpack.hideRefs`). This option can be used to hide
1829the change refs from the client. As consequence fetching changes by
1830change ref does not work anymore. However by setting
1831`uploadpack.allowTipSha1InWant` to `true` fetching changes by commit ID
1832is possible. If `download.checkForHiddenChangeRefs` is set to `true`
1833the git download commands use the commit ID instead of the change ref
1834when a project is configured like this.
1835+
1836Example git configuration on a project:
1837+
1838----
1839[uploadpack]
1840 hideRefs = refs/changes/
1841 hideRefs = refs/cache-automerge/
1842 allowTipSha1InWant = true
1843----
1844+
1845By default `false`.
1846
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001847[[download.archive]]download.archive::
1848+
1849Specifies which archive formats, if any, should be offered on the change
Francois Ferrand1e933882014-09-25 11:19:08 +02001850screen and supported for `git-upload-archive` operation:
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001851+
1852----
1853[download]
1854 archive = tar
1855 archive = tbz2
1856 archive = tgz
1857 archive = txz
Francois Ferrand1e933882014-09-25 11:19:08 +02001858 archive = zip
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001859----
1860
Shawn Pearce6edde312014-03-26 22:00:26 -07001861If `download.archive` is not specified defaults to all archive
1862commands. Set to `off` or empty string to disable.
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001863
Francois Ferrand1e933882014-09-25 11:19:08 +02001864Zip is not supported because it may be interpreted by a Java plugin as a
1865valid JAR file, whose code would have access to cookies on the domain.
1866For this reason `zip` format is always excluded from formats offered
1867through the `Download` drop down or accessible in the REST API.
1868
Stefan Bellere1b2ad32016-11-29 14:54:13 -08001869[[download.maxBundleSize]]download.maxBundleSize::
1870+
1871Specifies the maximum size of a bundle in bytes that can be downloaded.
1872As bundles are kept in memory this setting is to protect the server
1873from a single request consuming too much heap when generating
1874a bundle and thereby impacting other users.
1875+
1876Defaults to 100MB.
1877
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001878[[gc]]
1879=== Section gc
1880
1881This section allows to configure the git garbage collection and schedules it
1882to run periodically. It will be triggered and executed sequentially for all
1883projects.
1884
Christian Halstricke6c68322015-03-11 15:21:42 +01001885[[gc.aggressive]]gc.aggressive::
1886+
1887Determines if scheduled garbage collections and garbage collections triggered
1888through Web-UI should run in aggressive mode or not. Aggressive garbage
1889collections are more expensive but may lead to significantly smaller
1890repositories.
1891+
1892Valid values are "true" and "false," default is "false".
1893
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001894[[gc.startTime]]gc.startTime::
1895+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001896The link:#schedule-configuration-startTime[start time] for running the
1897git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001898
1899[[gc.interval]]gc.interval::
1900+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001901The link:#schedule-configuration-interval[interval] for running the
1902git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001903
Edwin Kempind33d95a2018-02-16 11:44:04 +01001904link:#schedule-configuration-examples[Schedule examples] can be found
1905in the link:#schedule-configuration[Schedule Configuration] section.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001906
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001907[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001908=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001909
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001910[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001911+
1912Local filesystem directory holding all Git repositories that
1913Gerrit knows about and can process changes for. A project
1914entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02001915the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001916+
1917If relative, the path is resolved relative to `'$site_path'`.
1918
Shawn O. Pearce897d9212011-06-16 16:59:59 -07001919[[gerrit.allProjects]]gerrit.allProjects::
1920+
1921Name of the permissions-only project defining global server
1922access controls and settings. These are inherited into every
1923other project managed by the running server. The name is
1924relative to `gerrit.basePath`.
1925+
1926Defaults to `All-Projects` if not set.
1927
Edwin Kempin2bf5edd2014-03-25 22:21:23 +01001928[[gerrit.allUsers]]gerrit.allUsers::
1929+
1930Name of the project in which meta data of all users is stored.
1931The name is relative to `gerrit.basePath`.
1932+
1933Defaults to `All-Users` if not set.
1934
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001935[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001936+
1937The default URL for Gerrit to be accessed through.
1938+
Sebastian Schuberth64037132016-07-28 13:40:16 +02001939Typically this would be set to something like "http://review.example.com/"
1940or "http://example.com:8080/gerrit/" so Gerrit can output links that point
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001941back to itself.
1942+
1943Setting this is highly recommended, as its necessary for the upload
1944code invoked by "git push" or "repo upload" to output hyperlinks
1945to the newly uploaded changes.
1946
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001947[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001948+
1949Optional base URL for repositories available over the anonymous git
1950protocol. For example, set this to `git://mirror.example.com/base/`
1951to have Gerrit display patch set download URLs in the UI. Gerrit
1952automatically appends the project name onto the end of the URL.
1953+
1954By default unset, as the git daemon must be configured externally
1955by the system administrator, and might not even be running on the
1956same host as Gerrit.
1957
Dave Borowitza5d3fec2015-07-09 14:24:02 -07001958[[gerrit.docUrl]]gerrit.docUrl::
1959+
1960Optional base URL for documentation, under which one can find
1961"index.html", "rest-api.html", etc. Used as the base for the fixed set
1962of links in the "Documentation" tab. A slash is implicitly appended.
1963(For finer control over the top menu, consider writing a
1964link:dev-plugins.html#top-menu-extensions[plugin].)
1965+
1966If unset or empty, the documentation tab will only be shown if
1967`/Documentation/index.html` can be reached by the browser at app load
1968time.
1969
Dave Borowitza17a9842015-09-15 09:58:17 -04001970[[gerrit.editGpgKeys]]gerrit.editGpgKeys::
1971+
1972If enabled and server-side signed push validation is also
1973link:#receive.enableSignedPush[enabled], enable the
1974link:rest-api-accounts.html#list-gpg-keys[REST API endpoints] and web UI
1975for editing GPG keys. If disabled, GPG keys can only be added by
1976administrators with direct git access to All-Users.
1977+
1978Defaults to true.
1979
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001980[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
1981+
1982Optional command to install the `commit-msg` hook. Typically of the
1983form:
David Pursehouse05588e52015-01-07 14:25:11 +09001984+
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001985----
1986fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
1987----
1988+
1989By default unset; falls back to using scp from the canonical SSH host,
1990or curl from the canonical HTTP URL for the server. Only necessary if a
1991proxy or other server/network configuration prevents clients from
1992fetching from the default location.
1993
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07001994[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
1995+
1996Optional base URL for repositories available over the HTTP
1997protocol. For example, set this to `http://mirror.example.com/base/`
1998to have Gerrit display URLs from this server, rather than itself.
1999+
2000By default unset, as the HTTP daemon must be configured externally
2001by the system administrator, and might not even be running on the
2002same host as Gerrit.
2003
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002004[[gerrit.installDbModule]]gerrit.installDbModule::
2005+
2006Repeatable list of class name of additional Guice modules to load at
2007Gerrit startup as part of the dbInjector and during the init phases.
2008Classes are resolved using the primary Gerrit class loader, hence the
2009class needs to be either declared in Gerrit or an additional JAR
2010located under the `/lib` directory.
2011+
2012By default unset.
2013
Luca Milanesio62cc3502016-11-15 10:22:38 -08002014[[gerrit.installModule]]gerrit.installModule::
2015+
2016Repeatable list of class name of additional Guice modules to load at
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002017Gerrit startup as part of the sysInjector and during the init phases.
Luca Milanesio62cc3502016-11-15 10:22:38 -08002018Classes are resolved using the primary Gerrit class loader, hence the
2019class needs to be either declared in Gerrit or an additional JAR
2020located under the `/lib` directory.
2021+
2022By default unset.
2023+
2024Example:
2025----
2026[gerrit]
2027 installModule = com.googlesource.gerrit.libmodule.MyModule
2028 installModule = com.example.abc.OurSpecialSauceModule
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002029 installDbModule = com.example.def.OurCustomProvider
Luca Milanesio62cc3502016-11-15 10:22:38 -08002030----
2031
Luca Milanesio92254852019-02-14 01:33:14 +00002032[[gerrit.listProjectsFromIndex]]gerrit.listProjectsFromIndex::
2033+
2034Enable rendering of project list from the secondary index instead
2035of purely relying on the in-memory cache.
2036+
2037By default false.
2038+
2039[NOTE]
2040The in-memory cache (set to false) rendering provides an **unlimited list** as a result
2041of the list project API, causing the full list of projects to be
2042returned as a result of the link:rest-api-projects.html[/projects/] REST API
2043or the link:cmd-ls-projects.html[gerrit ls-projects] SSH command.
2044When the rendering from the secondary index (set to true),
2045the **list is limited** by the global capability
2046link:access-control.html#capability_queryLimit[queryLimit]
2047which is defaulted to 500 entries.
2048
Sven Selberge63e92d2019-01-22 18:19:19 +01002049[[gerrit.primaryWeblinkName]]gerrit.primaryWeblinkName::
2050+
2051Name of the link:dev-plugins.html#links-to-external-tools[Weblink] that should
2052be chosen in cases where only one Weblink can be used in the UI, for example in
2053inline links.
2054+
2055By default unset, meaning that the UI is responsible for trying to identify
2056a weblink to be used in these cases, most likely weblinks that links to code
2057browsers with known integrations with Gerrit (like Gitiles and Gitweb).
2058+
2059Example:
2060----
2061[gerrit]
2062 primaryWeblinkName = gitiles
2063----
2064
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002065[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
2066+
David Pursehouse214ab862014-12-01 11:48:26 +09002067URL to direct users to when they need to report a bug.
2068+
2069By default unset, meaning no bug report URL will be displayed. Administrators
2070should set this to the URL of their issue tracker, if necessary.
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002071
David Pursehouse46a2f6c2018-11-30 11:12:19 +09002072[[gerrit.enableReverseDnsLookup]]gerrit.enableReverseDnsLookup::
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002073+
David Pursehouse793525f2018-11-30 11:20:02 +09002074Enable reverse DNS lookup during computing ref log entry for identified user,
2075to record the actual hostname of the user's host in the ref log.
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002076+
David Pursehouse793525f2018-11-30 11:20:02 +09002077Enabling reverse DNS lookup can cause performance issues on git push when
2078the reverse DNS lookup is slow.
2079+
2080Defaults to false, reverse DNS lookup is disabled. The user's IP address
2081will be recorded in the ref log rather than their hostname.
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002082
David Pursehouse962e1182014-12-03 17:17:52 +09002083[[gerrit.secureStoreClass]]gerrit.secureStoreClass::
2084+
2085Use the secure store implementation from a specified class.
2086+
2087If specified, must be the fully qualified class name of a class that implements
2088the `com.google.gerrit.server.securestore.SecureStore` interface, and the jar
2089file containing the class must be placed in the `$site_path/lib` folder.
2090+
2091If not specified, the default no-op implementation is used.
2092
Dariusz Luksza7a046da2014-04-03 17:05:47 +02002093[[gerrit.canLoadInIFrame]]gerrit.canLoadInIFrame::
2094+
2095For security reasons Gerrit will always jump out of iframe.
2096Setting this option to true will prevent this behavior.
2097+
2098By default false.
2099
Wyatt Allen414659c2017-03-15 09:55:31 -07002100[[gerrit.cdnPath]]gerrit.cdnPath::
2101+
2102Path prefix for PolyGerrit's static resources if using a CDN.
2103
Viktar Donich65ae7482017-10-20 14:13:31 -07002104[[gerrit.faviconPath]]gerrit.faviconPath::
2105+
2106Path for PolyGerrit's favicon after link:#gerrit.canonicalWebUrl[default URL],
2107including icon name and extension (.ico should be used).
2108
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002109
2110[[gerrit.instanceName]]gerrit.instanceName::
2111+
2112Short identifier for this Gerrit instance.
2113A good name should be short but precise enough so that users can identify the instance among others.
2114+
2115Defaults to the full hostname of the Gerrit server.
2116
2117
Sven Selberg327c2e42018-04-10 11:42:19 +02002118[[gerrit.serverId]]gerrit.serverId::
2119+
2120Used by NoteDb to, amongst other things, identify author identities from
2121per-server specific account IDs.
2122+
2123If this value is not set on startup it is automatically set to a random UUID.
2124+
2125[NOTE]
2126If this value doesn't match the serverId used when creating an already existing
2127NoteDb, Gerrit will not be able to use that instance of NoteDb. The serverId
2128used to create the NoteDb will show in the resulting exception message in case
2129the value differs.
2130
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002131[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002132=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002133
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002134Gerrit can forward requests to either an internally managed gitweb
2135(which allows Gerrit to enforce some access controls), or to an
2136externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002137See also link:config-gitweb.html[Gitweb Integration].
2138
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002139[[gitweb.cgi]]gitweb.cgi::
2140+
2141Path to the locally installed `gitweb.cgi` executable. This CGI will
2142be called by Gerrit Code Review when the URL `/gitweb` is accessed.
2143Project level access controls are enforced prior to calling the CGI.
2144+
David Pursehousea89dc982016-09-15 09:35:44 +02002145Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if `gitweb.url` is not set.
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002146
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002147[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002148+
2149Optional URL of an affiliated gitweb service. Defines the
2150web location where a `gitweb.cgi` is installed to browse
David Pursehousea89dc982016-09-15 09:35:44 +02002151`gerrit.basePath` and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002152+
2153Gerrit appends any necessary query arguments onto the end of this URL.
David Pursehousea89dc982016-09-15 09:35:44 +02002154For example, `?p=$project.git;h=$commit`.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002155
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002156[[gitweb.type]]gitweb.type::
2157+
2158Optional type of affiliated gitweb service. This allows using
David Pursehousea66f7ff2016-09-05 21:11:10 +09002159alternatives to gitweb, such as cgit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002160+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07002161Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
David Pursehousea66f7ff2016-09-05 21:11:10 +09002162+
2163If not set, or set to `disabled`, there is no gitweb hyperlinking
2164support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002165
Edwin Kempind86909c2012-03-26 10:36:29 +02002166[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002167+
2168Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002169at a specific commit when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002170+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002171Valid replacements are `${project}` for the project name in Gerrit
2172and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002173
Edwin Kempind86909c2012-03-26 10:36:29 +02002174[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002175+
2176Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002177at a specific project when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002178+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002179Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002180
Edwin Kempind86909c2012-03-26 10:36:29 +02002181[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002182+
2183Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002184at a specific branch when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002185+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002186Valid replacements are `${project}` for the project name in Gerrit
2187and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002188
Paladox none5759f2c2017-10-27 18:13:54 +00002189[[gitweb.tag]]gitweb.tag::
2190+
2191Optional pattern to use for constructing the gitweb URL when pointing
2192at a specific tag when `gitweb.type` is set to `custom`.
2193+
2194Valid replacements are `${project}` for the project name in Gerrit
2195and `${tag}` for the name of the tag.
2196
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002197[[gitweb.roottree]]gitweb.roottree::
2198+
2199Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002200at the contents of the root tree in a specific commit when `gitweb.type`
2201is set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002202+
2203Valid replacements are `${project}` for the project name in Gerrit
2204and `${commit}` for the SHA1 hash for the commit.
2205
2206[[gitweb.file]]gitweb.file::
2207+
2208Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002209at the contents of a file in a specific commit when `gitweb.type` is
2210set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002211+
2212Valid replacements are `${project}` for the project name in Gerrit,
2213`${file}` for the file name and `${commit}` for the SHA1 hash for
2214the commit.
2215
Edwin Kempin64011562012-03-26 10:50:12 +02002216[[gitweb.filehistory]]gitweb.filehistory::
2217+
2218Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002219at the history of a file in a specific branch when when `gitweb.type`
2220is set to `custom`.
Edwin Kempin64011562012-03-26 10:50:12 +02002221+
2222Valid replacements are `${project}` for the project name in Gerrit,
2223`${file}` for the file name and `${branch}` for the name of the
2224branch.
2225
Gustaf Lundha07d2e72011-10-27 15:26:35 -07002226[[gitweb.linkname]]gitweb.linkname::
2227+
2228Optional setting for modifying the link name presented to the user
2229in the Gerrit web-UI.
2230+
David Pursehousea89dc982016-09-15 09:35:44 +02002231The default linkname for custom type is `gitweb`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002232
Adrian Goerlerf2007072011-11-10 08:39:55 +01002233[[gitweb.pathSeparator]]gitweb.pathSeparator::
2234+
2235Optional character to substitute the standard path separator (slash) in
2236project names and branch names.
2237+
2238By default, Gerrit will use hexadecimal encoding for slashes in project and
2239branch names. Some web servers, such as Tomcat, reject this hexadecimal
2240encoding in the URL.
2241+
2242Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
2243allow using an alternative path separator character. In Gitblit, this can be
2244configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
2245In Gerrit, the alternative path separator can be configured correspondingly
David Pursehousea89dc982016-09-15 09:35:44 +02002246using the property `gitweb.pathSeparator`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002247+
David Pursehousea89dc982016-09-15 09:35:44 +02002248Valid values are the characters `*`, `(` and `)`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002249
David Pursehouse5d592e82016-06-09 05:12:26 +00002250[[gitweb.urlEncode]]gitweb.urlEncode::
Luca Milanesio25312032013-10-11 11:34:39 +01002251+
2252Whether or not Gerrit should encode the generated viewer URL.
2253+
2254Gerrit composes the viewer URL using information about the project, branch, file
2255or commit of the target object to be displayed. Typically viewers such as CGit
David Pursehousea89dc982016-09-15 09:35:44 +02002256and gitweb do need those parts to be encoded, including the `/` in project's name,
Luca Milanesio25312032013-10-11 11:34:39 +01002257for being correctly parsed.
2258However other viewers could instead require an unencoded URL (e.g. GitHub web
David Pursehousea89dc982016-09-15 09:35:44 +02002259based viewer).
Luca Milanesio25312032013-10-11 11:34:39 +01002260+
David Pursehousea89dc982016-09-15 09:35:44 +02002261Valid values are `true` and `false`. The default is `true`.
Luca Milanesio25312032013-10-11 11:34:39 +01002262
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002263[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002264=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01002265
2266[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
2267+
2268Controls whether newly created groups should be by default visible to
2269all registered users.
2270+
2271By default, false.
2272
Edwin Kempinf3eddd52017-01-20 14:05:47 +01002273[[groups.uuid.name]]groups.<uuid>.name::
2274+
2275Display name for group with the given UUID.
2276+
2277This option is only supported for system groups (scheme 'global').
2278+
2279E.g. this parameter can be used to configure another name for the
2280`Anonymous Users` group:
2281+
2282----
2283[groups "global:Anonymous-Users"]
2284 name = All Users
2285----
2286+
2287When setting this parameter it should be verified that there is no
2288existing group with the same name (case-insensitive). Configuring an
2289ambiguous name makes Gerrit fail on startup. Once set Gerrit ensures
2290that it is not possible to create a group with this name. Gerrit also
2291keeps the default name reserved so that it cannot be used for new
2292groups either. This means there is no danger of ambiguous group names
2293when this parameter is removed and the system group uses the default
2294name again.
2295
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002296[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002297=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002298
2299[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002300+
2301URL of the proxy server when making outgoing HTTP
2302connections for OpenID login transactions. Syntax
2303should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002304
2305[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002306+
2307Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002308This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002309appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002310
2311[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002312+
2313Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002314This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002315appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002316
Hugo Arès88e33ac2014-03-03 13:52:45 -05002317[[http.addUserAsRequestAttribute]]http.addUserAsRequestAttribute::
2318+
2319If true, 'User' attribute will be added to the request attributes so it
2320can be accessed outside the request scope (will be set to username or id
2321if username not configured).
2322+
2323This attribute can be used by the servlet container to log user in the
2324http access log.
2325+
2326When running the embedded servlet container, this attribute is used to
2327print user in the httpd_log.
2328+
2329* `%{User}r`
2330+
2331Pattern to print user in Tomcat AccessLog.
2332
2333+
2334Default value is true.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002335
Gustaf Lundhe45c3332018-05-02 10:52:11 +02002336[[http.addUserAsResponseHeader]]http.addUserAsResponseHeader::
2337+
2338If true, the header 'User' will be added to the list of response headers so it
2339can be accessed from a reverse proxy for logging purposes.
2340
2341+
2342Default value is false.
2343
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002344[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002345=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002346
2347The httpd section configures the embedded servlet container.
2348
2349[[httpd.listenUrl]]httpd.listenUrl::
2350+
Gert van Dijk70e26612019-09-29 16:20:25 +02002351Configuration for the listening sockets of the internal HTTP daemon.
2352Each entry of `listenUrl` combines the following options for a
2353listening socket: protocol, network address, port and context path.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002354+
Gert van Dijk70e26612019-09-29 16:20:25 +02002355_Protocol_ can be either `http://`, `https://`, `proxy-http://` or
2356`proxy-https://`. The latter two are special forms of `http://` with
2357awareness of a reverse proxy (see below). _Network address_ selects
2358the interface and/or scope of the listening socket. For notes
2359examples, see below. _Port_ is the TCP port number and is optional
2360(default value depends on the protocol). _Context path_ is the
2361optional "base URI" for the Gerrit Code Review as application to
2362serve on.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002363+
Gert van Dijk70e26612019-09-29 16:20:25 +02002364**Protocol** schemes:
2365+
2366* `http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002367+
2368Plain-text HTTP protocol. If port is not supplied, defaults to 80,
2369the standard HTTP port.
2370+
Gert van Dijk70e26612019-09-29 16:20:25 +02002371* `https://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002372+
2373SSL encrypted HTTP protocol. If port is not supplied, defaults to
2374443, the standard HTTPS port.
2375+
Gert van Dijk70e26612019-09-29 16:20:25 +02002376For configuration of the certificate and private key, see
2377<<httpd.sslKeyStore,httpd.sslKeyStore>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002378+
Gert van Dijk70e26612019-09-29 16:20:25 +02002379[NOTE]
2380SSL/TLS configuration capabilities of Gerrit internal HTTP daemon
2381are very limited. Externally facing production sites are strongly
2382encouraged to use a reverse proxy configuration to handle SSL/TLS
2383and use a `proxy-https://` scheme here (below) for security and
2384performance reasons.
2385+
2386* `proxy-http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002387+
2388Plain-text HTTP relayed from a reverse proxy. If port is not
2389supplied, defaults to 8080.
2390+
Gert van Dijk70e26612019-09-29 16:20:25 +02002391Like `http://`, but additional header parsing features are
2392enabled to honor `X-Forwarded-For`, `X-Forwarded-Host` and
2393`X-Forwarded-Server`. These headers are typically set by Apache's
2394link:https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#x-headers[mod_proxy].
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002395+
Gert van Dijk70e26612019-09-29 16:20:25 +02002396[NOTE]
2397--
2398For secruity reasons, make sure to only allow connections from a
2399trusted reverse proxy in your network, as clients could otherwise
2400easily spoof these headers and thus spoof their originating IP
2401address effectively. If the reverse proxy is running on the same
2402machine as Gerrit daemon, the use of a _loopback_ network address
2403to bind to (see below) is strongly recommended to mitigate this.
2404
2405If not using Apache's mod_proxy, validate that your reverse proxy
2406sets these headers on all requests. If not, either configure it to
2407sanitize them from the origin, or use the `http://` scheme instead.
2408--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002409+
Gert van Dijk70e26612019-09-29 16:20:25 +02002410* `proxy-https://`
2411+
2412Plain-text HTTP relayed from a reverse proxy that has already
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002413handled the SSL encryption/decryption. If port is not supplied,
2414defaults to 8080.
2415+
Gert van Dijk70e26612019-09-29 16:20:25 +02002416Behaves exactly like `proxy-http://`, but also sets the scheme to
2417assume `https://` is the proper URL back to the server.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002418
2419+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002420--
Gert van Dijk70e26612019-09-29 16:20:25 +02002421**Network address** forms:
2422
2423* Loopback (localhost): `127.0.0.1` (IPv4) or `[::1]` (IPv6).
2424* All (unspecified): `0.0.0.0` (IPv4), `[::]` (IPv6) or `*`
2425 (IPv4 and IPv6)
2426* Interface IP address, e.g. `1.2.3.4` (IPv4) or
2427 `[2001:db8::a00:20ff:fea7:ccea]` (IPv6)
2428* Hostname, resolved at startup time to an address.
2429
2430**Context path** is the local part of the URL to be used to access
2431Gerrit on ('base URL'). E.g. `/gerrit/` to serve Gerrit on that URI
2432as base. If set, consider to align this with the
2433<<gerrit.canonicalWebUrl,gerrit.canonicalWebUrl>> setting. Correct
2434settings may depend on the reverse proxy configuration as well. By
2435default, this is `/` so that Gerrit serves requests on the root.
2436
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002437If multiple values are supplied, the daemon will listen on all
2438of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002439
Gert van Dijk70e26612019-09-29 16:20:25 +02002440Examples:
2441
2442----
2443[httpd]
2444 listenUrl = proxy-https://127.0.0.1:9999/gerrit/
2445[gerrit]
2446 # Reverse proxy is configured to serve with SSL/TLS on
2447 # example.com and to relay requests on /gerrit/ onto
2448 # http://127.0.0.1:9999/gerrit/
2449 canonicalWebUrl = https://example.com/gerrit/
2450----
2451
2452----
2453[httpd]
2454 # Listen on specific external interface with plaintext
2455 # HTTP on IPv6.
2456 listenUrl = http://[2001:db8::a00:20ff:fea7:ccea]
2457
2458 # Also listen on specific internal interface for use with
2459 # reverse proxy run on another host.
2460 listenUrl = proxy-https://192.168.100.123
2461----
2462
2463See also the page on link:config-reverseproxy.html[reverse proxy]
2464configuration.
2465
2466By default, `\http://*:8080`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002467--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002468
2469[[httpd.reuseAddress]]httpd.reuseAddress::
2470+
2471If true, permits the daemon to bind to the port even if the port
2472is already in use. If false, the daemon ensures the port is not
2473in use before starting. Busy sites may need to set this to true
2474to permit fast restarts.
2475+
2476By default, true.
2477
Luca Milanesio4e2bb452018-03-21 09:07:24 +00002478[[httpd.gracefulStopTimeout]]httpd.gracefulStopTimeout::
2479+
2480Set a graceful stop time. If set, the daemon ensures that all incoming
2481calls are preserved for a maximum period of time, before starting
2482the graceful shutdown process. Sites behind a workload balancer such as
2483HAProxy would need this to be set for avoiding serving errors during
2484rolling restarts.
2485+
2486Values should use common unit suffixes to express their setting:
2487+
2488* s, sec, second, seconds
2489* m, min, minute, minutes
2490+
2491By default, 0 seconds (immediate shutdown).
2492
Thomas Meyeraa93fdf2016-10-23 10:53:48 +02002493[[httpd.inheritChannel]]httpd.inheritChannel::
2494+
2495If true, permits the daemon to inherit its server socket channel
2496from fd0/1(stdin/stdout). When set to true, the server can be socket
2497activated via systemd or xinetd.
2498+
2499By default, false.
2500
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002501[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
2502+
2503Size, in bytes, of the buffer used to parse the HTTP headers of an
2504incoming HTTP request. The entire request headers, including any
2505cookies sent by the browser, must fit within this buffer, otherwise
2506the server aborts with the response '413 Request Entity Too Large'.
2507+
2508One buffer of this size is allocated per active connection.
2509Allocating a buffer that is too large wastes memory that cannot be
2510reclaimed, allocating a buffer that is too small may cause unexpected
2511errors caused by very long Referer URLs or large cookie values.
2512+
2513By default, 16384 (16 K), which is sufficient for most OpenID and
2514other web-based single-sign-on integrations.
2515
Chulho Yangb72ff8f2013-07-04 02:35:53 -04002516[[httpd.sslCrl]]httpd.sslCrl::
2517+
2518Path of the certificate revocation list file in PEM format. This
2519crl file is optional, and available for CLIENT_SSL_CERT_LDAP
2520authentication.
2521+
2522To create and view a crl using openssl:
2523+
2524----
2525openssl ca -gencrl -out crl.pem
2526openssl crl -in crl.pem -text
2527----
2528+
2529If not absolute, the path is resolved relative to `$site_path`.
2530+
2531By default, `$site_path/etc/crl.pem`.
2532
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002533[[httpd.sslKeyStore]]httpd.sslKeyStore::
2534+
2535Path of the Java keystore containing the server's SSL certificate
2536and private key. This keystore is required for `https://` in URL.
2537+
2538To create a self-signed certificate for simple internal usage:
2539+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002540----
2541keytool -keystore keystore -alias jetty -genkey -keyalg RSA
2542chmod 600 keystore
2543----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002544+
2545If not absolute, the path is resolved relative to `$site_path`.
2546+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002547By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002548
2549[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
2550+
2551Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09002552Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002553doesn't want to enable one.
2554+
2555If set to the empty string the embedded server will prompt for the
2556password during startup.
2557+
2558By default, `gerrit`.
2559
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002560[[httpd.requestLog]]httpd.requestLog::
2561+
2562Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
2563If enabled, an NCSA combined log format request log file is written
2564out by the internal HTTP daemon.
2565+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01002566`log4j.appender` with the name `httpd_log` can be configured to overwrite
2567programmatic configuration.
2568+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002569By default, true if httpd.listenUrl uses http:// or https://,
2570and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
2571
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002572[[httpd.acceptorThreads]]httpd.acceptorThreads::
2573+
2574Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09002575connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002576+
2577By default, 2, which should be suitable for most high-traffic sites.
2578
2579[[httpd.minThreads]]httpd.minThreads::
2580+
2581Minimum number of spare threads to keep in the worker thread pool.
2582This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09002583multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002584+
2585By default, 5, suitable for most lower-volume traffic sites.
2586
2587[[httpd.maxThreads]]httpd.maxThreads::
2588+
2589Maximum number of threads to permit in the worker thread pool.
2590+
2591By default 25, suitable for most lower-volume traffic sites.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02002592+
2593[NOTE]
2594Unless SSH daemon is disabled, see <<sshd.listenAddress, sshd.listenAddress>>,
2595the max number of concurrent Git requests over HTTP and SSH together is
2596defined by the <<sshd.threads, sshd.threads>> and
2597<<sshd.batchThreads, sshd.batchThreads>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002598
2599[[httpd.maxQueued]]httpd.maxQueued::
2600+
2601Maximum number of client connections which can enter the worker
2602thread pool waiting for a worker thread to become available.
David Ostrovsky14fe8bc2014-03-26 06:03:44 -070026030 sets the queue size to the Integer.MAX_VALUE.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002604+
Luca Milanesio0ae62fe2015-09-04 07:56:00 -07002605By default 200.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002606
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002607[[httpd.maxWait]]httpd.maxWait::
2608+
David Pursehouse221d4f62012-06-08 17:38:08 +09002609Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002610thread to handle a project clone, fetch or push request over the
2611smart HTTP transport.
2612+
2613Values should use common unit suffixes to express their setting:
2614+
2615* s, sec, second, seconds
2616* m, min, minute, minutes
2617* h, hr, hour, hours
2618* d, day, days
2619* w, week, weeks (`1 week` is treated as `7 days`)
2620* mon, month, months (`1 month` is treated as `30 days`)
2621* y, year, years (`1 year` is treated as `365 days`)
2622
2623+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002624--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002625If a unit suffix is not specified, `minutes` is assumed. If 0
2626is supplied, the maximum age is infinite and connections will not
2627abort until the client disconnects.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002628
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002629By default, 5 minutes.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002630--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002631
Luca Milanesioce7b7452013-06-18 11:40:49 +01002632[[httpd.filterClass]]httpd.filterClass::
2633+
2634Class that implements the javax.servlet.Filter interface
2635for filtering any HTTP related traffic going through the Gerrit
2636HTTP protocol.
2637Class is loaded and configured in the Gerrit Jetty container
2638and run in front of all Gerrit URL handlers, allowing the filter
2639to inspect, modify, allow or reject each request.
2640It needs to be provided as JAR library
2641under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
2642loader and cannot be dynamically loaded by a plugin.
2643+
2644Failing to load the Filter class would result in a Gerrit start-up
2645failure, as this class is supposed to provide mandatory filtering
2646in front of Gerrit HTTP protocol.
2647+
David Pursehouse42f42042013-08-01 14:02:25 +09002648Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01002649of an Apache HTTP proxy layer as security enforcement on top of Gerrit
2650by returning a trusted username as HTTP Header.
2651+
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002652Allow multiple values to install multiple servlet filters.
2653+
Luca Milanesioce7b7452013-06-18 11:40:49 +01002654Example of using a security library secure.jar under $GERRIT_SITE/lib
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002655that provides a org.anyorg.MySecureHeaderFilter Servlet Filter that enforces
2656a trusted username in the `TRUSTED_USER` HTTP Header and
2657org.anyorg.MySecureIPFilter that performs source IP security filtering:
Dyrone Teng14fc0832019-09-27 16:59:02 +08002658+
Luca Milanesioce7b7452013-06-18 11:40:49 +01002659----
2660[auth]
2661 type = HTTP
2662 httpHeader = TRUSTED_USER
2663
Dariusz Lukszaaac01132015-02-11 12:13:07 +01002664[httpd]
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002665 filterClass = org.anyorg.MySecureHeaderFilter
2666 filterClass = org.anyorg.MySecureIPFilter
Luca Milanesioce7b7452013-06-18 11:40:49 +01002667----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002668
Teng Longc192ca92019-09-23 11:22:03 +08002669[[filterClass.className.initParam]]filterClass.<className>.initParam::
2670+
2671Gerrit supports customized pluggable HTTP filters as `filterClass`. This
2672option allows to pass extra initialization parameters to the filter. It
2673allows for multiple key/value pairs to be passed in this pattern:
2674+
2675----
2676initParam = <key>=<value>
2677----
2678For a comprehensive example:
2679+
2680----
2681[httpd]
2682 filterClass = org.anyorg.AFilter
2683 filterClass = org.anyorg.BFilter
2684[filterClass "org.anyorg.AFilter"]
2685 key1 = value1
2686 key2 = value2
2687[filterClass "org.anyorg.BFilter"]
2688 key3 = value3
2689----
2690
Luca Milanesiodca95d52017-05-09 21:22:21 +01002691[[httpd.idleTimeout]]httpd.idleTimeout::
2692+
2693Maximum idle time for a connection, which roughly translates to the
2694TCP socket `SO_TIMEOUT`.
2695+
Luca Milanesiodca95d52017-05-09 21:22:21 +01002696This value is interpreted as the maximum time between some progress
2697being made on the connection. So if a single byte is read or written,
2698then the timeout is reset.
2699+
David Pursehouse9f0e5bc2017-06-30 16:16:53 +09002700The max idle time is applied:
2701+
2702* When waiting for a new message to be received on a connection
2703* When waiting for a new message to be sent on a connection
2704
2705+
Luca Milanesiodca95d52017-05-09 21:22:21 +01002706By default, 30 seconds.
2707
Juan Hernandezec512562013-08-06 16:30:50 +02002708[[httpd.robotsFile]]httpd.robotsFile::
2709+
2710Location of an external robots.txt file to be used instead of the one
2711bundled with the .war of the application.
2712+
2713If not absolute, the path is resolved relative to `$site_path`.
2714+
2715If the file doesn't exist or can't be read the default robots.txt file
2716bundled with the .war will be used instead.
2717
Dariusz Luksza011cfed2014-04-03 10:23:35 +02002718[[httpd.registerMBeans]]httpd.registerMBeans::
2719+
2720Enable (or disable) registration of Jetty MBeans for Java JMX.
2721+
2722By default, false.
2723
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002724[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002725=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09002726
2727The index section configures the secondary index.
2728
David Pursehouse3fc5ee32014-03-17 18:35:32 +09002729Note that after enabling the secondary index, the index must be built
2730using the link:pgm-reindex.html[reindex program] before restarting the
2731Gerrit server.
2732
David Pursehouse6d458432013-08-23 16:17:18 +09002733[[index.type]]index.type::
2734+
2735Type of secondary indexing employed by Gerrit. The supported
2736values are:
2737+
2738* `LUCENE`
2739+
2740A link:http://lucene.apache.org/[Lucene] index is used.
2741+
David Pursehouse8e72f532014-06-24 11:01:28 +09002742+
Dariusz Lukszaea529882017-04-25 15:11:31 +02002743* `ELASTICSEARCH` look into link:#elasticsearch[Elasticsearch section]
David Pursehouse8e72f532014-06-24 11:01:28 +09002744+
David Pursehoused09c5942018-04-20 10:22:31 +02002745An link:https://www.elastic.co/products/elasticsearch[Elasticsearch] index is
David Pursehouse2e79e5b2018-04-20 10:23:29 +02002746used. Refer to the link:#elasticsearch[Elasticsearch section] for further
2747configuration details.
David Pursehouse6d458432013-08-23 16:17:18 +09002748
2749+
Shawn Pearced4ae3a162013-11-24 17:00:31 -08002750By default, `LUCENE`.
David Pursehouse6d458432013-08-23 16:17:18 +09002751
David Pursehouse904db302014-03-17 18:55:38 +09002752[[index.threads]]index.threads::
2753+
Hugo Arèsfab06702016-06-10 12:49:52 -04002754Number of threads to use for indexing in normal interactive operations. Setting
2755it to 0 disables the dedicated thread pool and indexing will be done in the same
2756thread as the operation.
David Pursehouse904db302014-03-17 18:55:38 +09002757+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02002758If not set or set to a zero, defaults to the number of logical CPUs as returned
2759by the JVM. If set to a negative value, defaults to a direct executor.
David Pursehouse00c82142014-01-22 17:41:09 +09002760
Dave Borowitz787af5f2014-10-22 16:26:00 -07002761[[index.batchThreads]]index.batchThreads::
2762+
2763Number of threads to use for indexing in background operations, such as
2764online schema upgrades.
2765+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02002766If not set or set to a zero, defaults to the number of logical CPUs as returned
2767by the JVM. If set to a negative value, defaults to a direct executor.
Dave Borowitz787af5f2014-10-22 16:26:00 -07002768
Dave Borowitzd80b9342015-03-25 10:32:21 -07002769[[index.onlineUpgrade]]index.onlineUpgrade::
2770+
2771Whether to upgrade to new index schema versions while the server is
2772running. This is recommended as it prevents additional downtime during
2773Gerrit version upgrades (avoiding the need for an offline reindex step
2774using Reindex), but can add additional server load during the upgrade.
2775+
2776If set to false, there is no way to upgrade the index schema to take
2777advantage of new search features without restarting the server.
2778+
2779Defaults to true.
2780
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07002781[[index.maxLimit]]index.maxLimit::
2782+
2783Maximum limit to allow for search queries. Requesting results above this
2784limit will truncate the list (but will still set `_more_changes` on
2785result lists). Set to 0 for no limit.
2786+
David Pursehouse7c1f4a42018-03-15 17:03:40 +09002787When `index.type` is set to `ELASTICSEARCH`, this value should not exceed
2788the `index.max_result_window` value configured on the Elasticsearch
David Pursehouse52c2b4a2018-04-10 23:38:57 +09002789server. If a value is not configured during site initialization, defaults to
279010000, which is the default value of `index.max_result_window` in Elasticsearch.
David Pursehouse7c1f4a42018-03-15 17:03:40 +09002791+
David Pursehouse52c2b4a2018-04-10 23:38:57 +09002792When `index.type` is set to `LUCENE`, defaults to no limit.
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07002793
Dave Borowitzf56d3652015-04-22 17:35:34 -07002794[[index.maxPages]]index.maxPages::
2795+
2796Maximum number of pages of search results to allow, as index
2797implementations may have to scan through large numbers of skipped
2798results when searching with an offset. Requesting results starting past
2799this threshold times the requested limit will result in an error. Set to
28000 for no limit.
2801+
2802Defaults to no limit.
2803
Dave Borowitzd034ca82015-10-15 11:20:30 -04002804[[index.maxTerms]]index.maxTerms::
2805+
2806Maximum number of leaf terms to allow in a query. Too-large queries may
2807perform poorly, so setting this option causes query parsing to fail fast
Dave Borowitzada289c2018-12-18 13:24:14 -08002808before attempting to send them to the secondary index.
Dave Borowitzd034ca82015-10-15 11:20:30 -04002809+
Marco Miller6da22822016-01-29 12:31:38 -05002810When the index type is `LUCENE`, also sets the maximum number of clauses
2811permitted per BooleanQuery. This is so that all enforced query limits
2812are the same.
2813+
2814Defaults to 1024.
Dave Borowitzd034ca82015-10-15 11:20:30 -04002815
Dave Borowitz61155622017-04-17 16:53:13 -04002816[[index.reindexAfterRefUpdate]]index.reindexAfterRefUpdate::
2817+
2818Whether to reindex all affected open changes after a ref is updated. This
2819includes reindexing all open changes to recompute the "mergeable" bit every time
2820the destination branch moves, as well as reindexing changes to take into account
2821new project configuration (e.g. label definitions).
2822+
2823Leaving this enabled may result in fresher results, but may cause performance
2824problems if there are lots of open changes on a project whose branches advance
2825frequently.
2826+
2827Defaults to true.
2828
Dave Borowitz3747f0f2017-06-23 14:29:31 -04002829[[index.autoReindexIfStale]]index.autoReindexIfStale::
2830+
2831Whether to automatically check if a document became stale in the index
2832immediately after indexing it. If false, there is a race condition during two
2833simultaneous writes that may cause one of the writes to not be reflected in the
2834index. The check to avoid this does consume some resources.
2835+
Dave Borowitzb7da0762018-03-19 09:08:45 -04002836Defaults to false.
Dave Borowitz3747f0f2017-06-23 14:29:31 -04002837
Edwin Kempin0f0de862018-02-08 16:24:11 +01002838[[index.scheduledIndexer]]
2839==== Subsection index.scheduledIndexer
2840
2841This section configures periodic indexing. Periodic indexing is
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002842intended to run only on replicas and only updates the group index.
2843Replication to replicas happens on Git level so that Gerrit is not aware
2844of incoming replication events. But replicas need an updated group index
Edwin Kempin0f0de862018-02-08 16:24:11 +01002845to resolve memberships of users for ACL validation. To keep the group
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002846index in replicas up-to-date the Gerrit replica periodically scans the
Edwin Kempin0f0de862018-02-08 16:24:11 +01002847group refs in the All-Users repository to reindex groups if they are
2848stale.
2849
2850The scheduled reindexer is not able to detect group deletions that
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002851happened while the replica was offline, but since group deletions are not
Edwin Kempin0f0de862018-02-08 16:24:11 +01002852supported this should never happen. If nevertheless groups refs were
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002853deleted while a replica was offline a full offline link:pgm-reindex.html[
Edwin Kempin0f0de862018-02-08 16:24:11 +01002854reindex] must be performed.
2855
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002856This section is only used if Gerrit runs in replica mode, otherwise it is
Edwin Kempin0f0de862018-02-08 16:24:11 +01002857ignored.
2858
Edwin Kempina32d4432018-02-16 17:18:31 +01002859[[index.scheduledIndexer.runOnStartup]]index.scheduledIndexer.runOnStartup::
2860+
2861Whether the scheduled indexer should run once immediately on startup.
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002862If set to `true` the replica startup is blocked until all stale groups
2863were reindexed. Enabling this allows to prevent that replicas that were
Edwin Kempina32d4432018-02-16 17:18:31 +01002864offline for a longer period of time run with outdated group information
2865until the first scheduled indexing is done.
2866+
2867Defaults to `true`.
2868
Edwin Kempin0f0de862018-02-08 16:24:11 +01002869[[index.scheduledIndexer.enabled]]index.scheduledIndexer.enabled::
2870+
2871Whether the scheduled indexer is enabled. If the scheduled indexer is
2872disabled you must implement other means to keep the group index for the
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002873replica up-to-date (e.g. by using ElasticSearch for the indexes).
Edwin Kempin0f0de862018-02-08 16:24:11 +01002874+
2875Defaults to `true`.
2876
2877[[index.scheduledIndexer.startTime]]index.scheduledIndexer.startTime::
2878+
2879The link:#schedule-configuration-startTime[start time] for running
2880the scheduled indexer.
2881+
2882Defaults to `00:00`.
2883
2884[[index.scheduledIndexer.interval]]index.scheduledIndexer.interval::
2885+
2886The link:#schedule-configuration-interval[interval] for running
2887the scheduled indexer.
2888+
2889Defaults to `5m`.
2890
2891link:#schedule-configuration-examples[Schedule examples] can be found
2892in the link:#schedule-configuration[Schedule Configuration] section.
2893
David Pursehouse902b3ee2014-07-09 16:17:49 +09002894==== Lucene configuration
2895
2896Open and closed changes are indexed in separate indexes named
2897'open' and 'closed' respectively.
2898
2899The following settings are only used when the index type is `LUCENE`.
David Pursehouseac88c362014-02-06 12:01:34 +09002900
David Pursehouse00c82142014-01-22 17:41:09 +09002901[[index.name.ramBufferSize]]index.name.ramBufferSize::
2902+
David Pursehouse00c82142014-01-22 17:41:09 +09002903Determines the amount of RAM that may be used for buffering added documents
2904and deletions before they are flushed to the index. See the
2905link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
2906Lucene documentation] for further details.
2907+
2908Defaults to 16M.
2909
2910[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
2911+
David Pursehouse00c82142014-01-22 17:41:09 +09002912Determines the minimal number of documents required before the buffered
2913in-memory documents are flushed to the index. Large values generally
2914give faster indexing. See the
2915link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
2916Lucene documentation] for further details.
2917+
2918Defaults to -1, meaning no maximum is set and the writer will flush
2919according to RAM usage.
2920
Dave Borowitzd08b0452014-02-13 11:56:03 -08002921[[index.name.commitWithin]]index.name.commitWithin::
2922+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002923Determines the period at which changes are automatically committed to
2924stable store on disk. This is a costly operation and may block
2925additional index writes, so lower with caution.
2926+
Bruce Zuaf058e62014-03-21 10:03:05 +08002927If zero, changes are committed after every write. This is very costly
2928but may be useful if offline reindexing is infeasible, or for development
2929servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08002930+
Bruce Zuaf058e62014-03-21 10:03:05 +08002931Values can be specified using standard time unit abbreviations (`ms`, `sec`,
2932`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07002933+
Bruce Zuaf058e62014-03-21 10:03:05 +08002934If negative, `commitWithin` is disabled. Changes are flushed to disk when
2935the in-memory buffer fills, but only committed and guaranteed to be synced
2936to disk when the process finishes.
David Pursehouse902b3ee2014-07-09 16:17:49 +09002937+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002938Defaults to 300000 ms (5 minutes).
2939
Trevor Getty8fb5db52019-08-26 14:33:19 +02002940
2941[[index.name.maxMergeCount]]index.name.maxMergeCount::
2942+
2943Determines the max number of simultaneous merges that are allowed. If a merge
2944is necessary yet we already have this many threads running, the incoming thread
2945(that is calling add/updateDocument) will block until a merge thread has
2946completed. Note that Lucene will only run the smallest maxThreadCount merges
2947at a time. See the
2948link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
2949Lucene documentation] for further details.
2950+
2951Defaults to -1 for (auto detection).
2952
2953
2954[[index.name.maxThreadCount]]index.name.maxThreadCount::
2955+
2956Determines the max number of simultaneous Lucene merge threads that should be running at
2957once. This must be less than or equal to maxMergeCount. See the
2958link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
2959Lucene documentation] for further details.
2960+
2961For further details on Lucene index configuration (auto detection) which
2962affects maxThreadCount and maxMergeCount settings.
2963See the
2964link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#AUTO_DETECT_MERGES_AND_THREADS[
2965Lucene documentation]
2966+
2967Defaults to -1 for (auto detection).
2968
2969[[index.name.enableAutoIOThrottle]]index.name.enableAutoIOThrottle::
2970+
2971Allows the control of whether automatic IO throttling is enabled and used by
2972default in the lucene merge queue. Automatic dynamic IO throttling, which when
2973on is used to adaptively rate limit writes bytes/sec to the minimal rate necessary
2974so merges do not fall behind. See the
2975link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#enableAutoIOThrottle()[
2976Lucene documentation] for further details.
2977+
2978Defaults to true (throttling enabled).
2979
David Pursehouse902b3ee2014-07-09 16:17:49 +09002980Sample Lucene index configuration:
David Pursehouse00c82142014-01-22 17:41:09 +09002981----
2982[index]
2983 type = LUCENE
2984
2985[index "changes_open"]
2986 ramBufferSize = 60 m
2987 maxBufferedDocs = 3000
Trevor Getty8fb5db52019-08-26 14:33:19 +02002988 maxThreadCount = 5
2989 maxMergeCount = 50
2990
David Pursehouse00c82142014-01-22 17:41:09 +09002991
2992[index "changes_closed"]
2993 ramBufferSize = 20 m
2994 maxBufferedDocs = 500
Trevor Getty8fb5db52019-08-26 14:33:19 +02002995 maxThreadCount = 10
2996 maxMergeCount = 100
2997 enableIOThrottle = false
2998
David Pursehouse00c82142014-01-22 17:41:09 +09002999----
3000
Dariusz Lukszaea529882017-04-25 15:11:31 +02003001[[elasticsearch]]
3002=== Section elasticsearch
David Pursehouse8e72f532014-06-24 11:01:28 +09003003
David Pursehouse1a82b372018-06-19 11:14:21 +09003004WARNING: Support for Elasticsearch is still experimental and is not recommended
David Pursehouse7e566dc2018-09-20 14:12:15 +09003005for production use. For compatibility information, please refer to the
3006link:https://www.gerritcodereview.com/elasticsearch.html[project homepage].
David Pursehouse8e72f532014-06-24 11:01:28 +09003007
David Pursehouse0e39a8d2018-11-27 20:25:43 +09003008When using Elasticsearch version 5.6, the open and closed changes are
David Pursehouse1a82b372018-06-19 11:14:21 +09003009indexed in a single index, separated into types `open_changes` and `closed_changes`
3010respectively. When using version 6.2 or later, the open and closed changes are
3011merged into the default `_doc` type. The latter is also used for the accounts and
3012groups indices starting with Elasticsearch 6.2.
David Pursehouse8e72f532014-06-24 11:01:28 +09003013
David Pursehouse6ea25322018-07-03 21:26:07 +09003014Note that when Gerrit is configured to use Elasticsearch, the Elasticsearch
3015server(s) must be reachable during the site initialization.
3016
Dariusz Lukszaea529882017-04-25 15:11:31 +02003017[[elasticsearch.prefix]]elasticsearch.prefix::
David Pursehouse8e72f532014-06-24 11:01:28 +09003018+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08003019This setting can be used to prefix index names to allow multiple Gerrit
David Pursehouse997cf2a2018-05-10 15:40:47 +09003020instances in a single Elasticsearch cluster. Prefix `gerrit1_` would result in a
3021change index named `gerrit1_changes_0001`.
David Pursehouse8e72f532014-06-24 11:01:28 +09003022+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08003023Not set by default.
David Pursehouse8e72f532014-06-24 11:01:28 +09003024
David Pursehouse479c50b2018-07-02 12:47:07 +09003025[[elasticsearch.server]]elasticsearch.server::
Dariusz Lukszaea529882017-04-25 15:11:31 +02003026+
David Pursehouse479c50b2018-07-02 12:47:07 +09003027Elasticsearch server URI in the form `http[s]://hostname:port`. The `port` is
3028optional and defaults to `9200` if not specified.
Dariusz Lukszaea529882017-04-25 15:11:31 +02003029+
David Pursehouse479c50b2018-07-02 12:47:07 +09003030At least one server must be specified. May be specified multiple times to
3031configure multiple Elasticsearch servers.
Dariusz Lukszaea529882017-04-25 15:11:31 +02003032+
David Pursehouse479c50b2018-07-02 12:47:07 +09003033Note that the site initialization program only allows to configure a single
3034server. To configure multiple servers the `gerrit.config` file must be edited
3035manually.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003036
David Pursehouse499f7fe2018-11-30 16:07:21 +09003037[[elasticsearch.numberOfShards]]elasticsearch.numberOfShards::
3038+
3039Sets the number of shards to use per index. Refer to the
Marco Miller13906f22019-06-17 14:56:10 -04003040link:https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-concepts.html#getting-started-shards-and-replicas[
David Pursehouse499f7fe2018-11-30 16:07:21 +09003041Elasticsearch documentation] for details.
3042+
Marco Miller082139a2019-06-17 15:00:35 -04003043Defaults to 5 for Elasticsearch versions 5 and 6, and to 1 starting with Elasticsearch 7.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003044
3045[[elasticsearch.numberOfReplicas]]elasticsearch.numberOfReplicas::
3046+
3047Sets the number of replicas to use per index. Refer to the
Marco Miller13906f22019-06-17 14:56:10 -04003048link:https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-concepts.html#getting-started-shards-and-replicas[
David Pursehouse499f7fe2018-11-30 16:07:21 +09003049Elasticsearch documentation] for details.
3050+
3051Defaults to 1.
3052
David Pursehouse13f1d632018-07-02 14:37:36 +09003053==== Elasticsearch Security
Dariusz Lukszaea529882017-04-25 15:11:31 +02003054
David Pursehouse13f1d632018-07-02 14:37:36 +09003055When security is enabled in Elasticsearch, the username and password must be provided.
3056Note that the same username and password are used for all servers.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003057
David Pursehouse13f1d632018-07-02 14:37:36 +09003058For further information about Elasticsearch security, please refer to the documentation:
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003059
David Pursehouse13f1d632018-07-02 14:37:36 +09003060* link:https://www.elastic.co/guide/en/x-pack/5.6/security-getting-started.html[Elasticsearch 5.6]
3061* link:https://www.elastic.co/guide/en/x-pack/6.2/security-getting-started.html[Elasticsearch 6.2]
3062* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.3/security-getting-started.html[Elasticsearch 6.3]
David Pursehouseb54aee32018-09-20 14:13:17 +09003063* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.4/security-getting-started.html[Elasticsearch 6.4]
David Pursehousea348a012018-11-30 16:10:22 +09003064* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.5/security-getting-started.html[Elasticsearch 6.5]
Marco Miller2a898de2019-01-30 14:26:11 -05003065* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.6/security-getting-started.html[Elasticsearch 6.6]
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003066
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003067[[elasticsearch.username]]elasticsearch.username::
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003068+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003069Username used to connect to Elasticsearch.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003070+
David Pursehouse975fdd22018-07-02 14:23:07 +09003071If a password is set, defaults to `elastic`, otherwise not set by default.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003072
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003073[[elasticsearch.password]]elasticsearch.password::
3074+
3075Password used to connect to Elasticsearch.
3076+
3077Not set by default.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003078
Patrick Hieselda692472019-10-07 16:03:23 +02003079[[event]]
3080=== Section event
3081
3082[[event.payload.listChangeOptions]]events.payload.listChangeOptions::
3083+
3084List of options that Gerrit applies when rendering the payload of an
3085internal event. This is the same set of options that are documented
3086link:rest-api-changes.html#query-options[here].
3087+
3088Depending on the setup, these events might get serialized using stream
3089events.
3090+
3091This can be set to the set of minimal options that consumers of Gerrit's
3092events need. A minimal set would be (`SKIP_MERGEABLE`,`SKIP_DIFFSTAT`).
3093+
3094Every option that gets added here will have a performance impact. The
3095general recommendation is therefore to set this to a minimal set of
3096required options.
3097+
3098Defaults to all available options minus `CHANGE_ACTIONS`,
3099`CURRENT_ACTIONS` and `CHECK`. This is a rich default to make sure the
3100config is backwards compatible with what the default was before the config
3101was added.
3102
3103
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003104[[ldap]]
3105=== Section ldap
3106
3107LDAP integration is only enabled if `auth.type` is set to
3108`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
3109detailed description of the `auth.type` settings and their
3110implications.
3111
3112An example LDAP configuration follows, and then discussion of
3113the parameters introduced here. Suitable defaults for most
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003114parameters are automatically guessed based on the type of server
Michal Pasierb3e262742017-01-23 12:50:48 +01003115detected during startup. The guessed defaults support
3116link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307], Active
3117Directory and link:https://www.freeipa.org[FreeIPA].
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003118
3119----
3120[ldap]
3121 server = ldap://ldap.example.com
3122
3123 accountBase = ou=people,dc=example,dc=com
3124 accountPattern = (&(objectClass=person)(uid=${username}))
3125 accountFullName = displayName
3126 accountEmailAddress = mail
3127
3128 groupBase = ou=groups,dc=example,dc=com
3129 groupMemberPattern = (&(objectClass=group)(member=${dn}))
3130----
3131
Luca Milanesioa05d42b2018-12-19 01:13:06 +00003132[[ldap.guessRelevantGroups]]ldap.guessRelevantGroups::
3133+
3134Filter the groups found in LDAP by guessing the ones relevant to
3135Gerrit and removing the others from list completions and ACL evaluations.
3136The guess is based on two elements: the projects most recently
3137accessed in the cache and the list of LDAP groups included in their ACLs.
3138+
3139Please note that projects rarely used and thus not cached may be
3140temporarily inaccessible by users even with LDAP membership and grants
3141referenced in the ACLs.
3142+
3143By default, true.
3144
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003145[[ldap.server]]ldap.server::
3146+
3147URL of the organization's LDAP server to query for user information
3148and group membership from. Must be of the form `ldap://host` or
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003149`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003150+
3151If `auth.type` is `LDAP` this setting should use `ldaps://` to
3152ensure the end user's plaintext password is transmitted only over
3153an encrypted connection.
3154
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003155[[ldap.startTls]]ldap.startTls::
3156+
3157If true, Gerrit will perform StartTLS extended operation.
3158+
3159By default, false, StartTLS will not be enabled.
3160
Alon Bar-Leve39c35c2019-06-10 12:59:55 +03003161[[ldap.supportAnonymous]]ldap.supportAnonymous::
3162+
3163If false, Gerrit will provide credentials only at connection open, this is
3164required for some `LDAP` implementations that do not allow anonymous bind
3165for StartTLS or for reauthentication.
3166+
3167By default, true.
3168
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003169[[ldap.sslVerify]]ldap.sslVerify::
3170+
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003171If false and ldap.server is an `ldaps://` style URL or `ldap.startTls`
3172is true, Gerrit will not verify the server certificate when it connects
3173to perform a query.
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003174+
3175By default, true, requiring the certificate to be verified.
3176
Olga Grinbergcf1b06a2015-02-03 15:54:48 -05003177[[ldap.groupsVisibleToAll]]ldap.groupsVisibleToAll::
3178+
3179If true, LDAP groups are visible to all registered users.
3180+
3181By default, false, LDAP groups are visible only to administrators and
3182group members.
3183
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003184[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003185+
3186_(Optional)_ Username to bind to the LDAP server with. If not set,
3187an anonymous connection to the LDAP server is attempted.
3188
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003189[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003190+
3191_(Optional)_ Password for the user identified by `ldap.username`.
3192If not set, an anonymous (or passwordless) connection to the LDAP
3193server is attempted.
3194
Ben Wu0410a152010-06-04 16:17:24 +08003195[[ldap.referral]]ldap.referral::
3196+
3197_(Optional)_ How an LDAP referral should be handled if it is
3198encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05003199automatically follow any referrals, or `ignore` to ignore the
3200referrals.
Ben Wu0410a152010-06-04 16:17:24 +08003201+
3202By default, `ignore`.
3203
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003204[[ldap.readTimeout]]ldap.readTimeout::
3205+
3206_(Optional)_ The read timeout for an LDAP operation. The value is
3207in the usual time-unit format like "1 s", "100 ms", etc...
3208A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09003209threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003210+
3211By default there is no timeout and Gerrit will wait for the LDAP
3212server to respond until the TCP connection times out.
3213
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003214[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003215+
3216Root of the tree containing all user accounts. This is typically
3217of the form `ou=people,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003218+
3219This setting may be added multiple times to specify more than
3220one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003221
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003222[[ldap.accountScope]]ldap.accountScope::
3223+
3224Scope of the search performed for accounts. Must be one of:
3225+
3226* `one`: Search only one level below accountBase, but not recursive
3227* `sub` or `subtree`: Search recursively below accountBase
3228* `base` or `object`: Search exactly accountBase; probably not desired
3229
3230+
3231Default is `subtree` as many directories have several levels.
3232
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003233[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003234+
3235Query pattern to use when searching for a user account. This may be
3236any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09003237`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003238`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09003239that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02003240the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003241the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003242+
3243This pattern is used to search the objects contained directly under
3244the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02003245is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003246setting depends on the LDAP schema used by the directory server.
3247+
Michal Pasierb3e262742017-01-23 12:50:48 +01003248Default is `(uid=${username})` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003249and `(&(objectClass=user)(sAMAccountName=${username}))`
3250for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003251
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003252[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003253+
3254_(Optional)_ Name of an attribute on the user account object which
3255contains the initial value for the user's full name field in Gerrit.
3256Typically this is the `displayName` property in LDAP, but could
3257also be `legalName` or `cn`.
3258+
David Pursehouse221d4f62012-06-08 17:38:08 +09003259Attribute values may be concatenated with literal strings. For
3260example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02003261`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003262+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003263If set, users will be unable to modify their full name field, as
3264Gerrit will populate it only from the LDAP data.
3265+
Michal Pasierb3e262742017-01-23 12:50:48 +01003266Default is `displayName` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003267and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003268
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003269[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003270+
3271_(Optional)_ Name of an attribute on the user account object which
3272contains the user's Internet email address, as defined by this
3273LDAP server.
3274+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003275Attribute values may be concatenated with literal strings,
3276for example to set the email address to the lowercase form
3277of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02003278`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003279+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003280If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09003281but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003282and select a different preferred email address.
3283+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003284Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003285
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003286[[ldap.accountSshUserName]]ldap.accountSshUserName::
3287+
3288_(Optional)_ Name of an attribute on the user account object which
3289contains the initial value for the user's SSH username field in
3290Gerrit. Typically this is the `uid` property in LDAP, but could
3291also be `cn`. Administrators should prefer to match the attribute
3292corresponding to the user's workstation username, as this is what
3293SSH clients will default to.
3294+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003295Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02003296an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003297force the value of sAMAccountName, if defined, to be all lowercase.
3298The suffix `.toUpperCase` can be used for the other direction.
3299The suffix `.localPart` can be used to split attribute values of
3300the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02003301example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003302+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003303If set, users will be unable to modify their SSH username field, as
David Pursehousec12da502016-08-11 20:45:03 +09003304Gerrit will populate it only from the LDAP data. Note that once the
3305username has been set it cannot be changed, therefore it is
3306recommended not to make changes to this setting that would cause the
3307value to differ, as this will prevent users from logging in.
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003308+
Michal Pasierb3e262742017-01-23 12:50:48 +01003309Default is `uid` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003310and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003311
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003312[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04003313+
3314_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003315contains the groups the user is part of. Typically used for Active
Michal Pasierb3e262742017-01-23 12:50:48 +01003316Directory and FreeIPA servers.
Anthony93de7db2009-10-03 10:01:50 -04003317+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003318Default is unset for RFC 2307 servers (disabled)
Michal Pasierb3e262742017-01-23 12:50:48 +01003319and `memberOf` for Active Directory and FreeIPA.
3320
3321[[ldap.accountMemberExpandGroups]]ldap.accountMemberExpandGroups::
3322+
3323_(Optional)_ Whether to expand nested groups recursively. This
3324setting is used only if `ldap.accountMemberField` is set.
3325+
3326Default is unset for FreeIPA and `true` for RFC 2307 servers
3327and Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04003328
Saša Živkovc81291f2015-02-04 17:19:20 +01003329[[ldap.fetchMemberOfEagerly]]ldap.fetchMemberOfEagerly::
3330+
3331_(Optional)_ Whether to fetch the `memberOf` account attribute on
3332login. Setups which use LDAP for user authentication but don't make
3333use of the LDAP groups may benefit from setting this option to `false`
3334as this will result in a much faster LDAP login.
3335+
3336Default is unset for RFC 2307 servers (disabled) and `true` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003337Active Directory and FreeIPA.
Saša Živkovc81291f2015-02-04 17:19:20 +01003338
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003339[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003340+
3341Root of the tree containing all group objects. This is typically
3342of the form `ou=groups,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003343+
3344This setting may be added multiple times to specify more than
3345one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003346
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003347[[ldap.groupScope]]ldap.groupScope::
3348+
3349Scope of the search performed for group objects. Must be one of:
3350+
3351* `one`: Search only one level below groupBase, but not recursive
3352* `sub` or `subtree`: Search recursively below groupBase
3353* `base` or `object`: Search exactly groupBase; probably not desired
3354
3355+
3356Default is `subtree` as many directories have several levels.
3357
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003358[[ldap.groupPattern]]ldap.groupPattern::
3359+
3360Query pattern used when searching for an LDAP group to connect
3361to a Gerrit group. This may be any valid LDAP query expression,
3362including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003363`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003364group owner.
3365+
Michal Pasierb3e262742017-01-23 12:50:48 +01003366Default is `(cn=${groupname})` for FreeIPA and RFC 2307 servers,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003367and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003368
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003369[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003370+
3371Query pattern to use when searching for the groups that a user
3372account is currently a member of. This may be any valid LDAP query
3373expression, including the standard `(&...)` and `(|...)` operators.
3374+
David Pursehouse42f42042013-08-01 14:02:25 +09003375If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003376replaced with a parameter set to the username that was supplied
3377by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003378such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003379corresponding attribute (in this case, `fooBarAttribute`) as read
3380from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02003381Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003382+
Scott Dial50457502013-08-11 16:52:51 -04003383Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003384RFC 2307, and unset (disabled) for Active Directory and FreeIPA.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003385
Auke Schrijnen57809132012-09-26 21:05:39 +02003386[[ldap.groupName]]ldap.groupName::
3387+
David Pursehouse39489ae2012-10-12 13:50:04 +09003388_(Optional)_ Name of the attribute on the group object which contains
3389the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02003390+
David Pursehouse39489ae2012-10-12 13:50:04 +09003391Typically the attribute name is `cn` for RFC 2307 and Active Directory
3392servers. For other servers the attribute name may differ, for example
3393`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02003394+
David Pursehouse39489ae2012-10-12 13:50:04 +09003395It is also possible to specify a literal string containing a pattern of
3396attribute values. For example to create a Gerrit group name consisting of
3397LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
3398+
3399Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02003400
Gustaf Lundhdaf41af2016-12-05 19:05:09 +01003401[[ldap.mandatoryGroup]]ldap.mandatoryGroup::
3402+
3403All users must be a member of this group to allow account creation or
3404authentication.
3405+
3406Setting mandatoryGroup implies enabling of `ldap.fetchMemberOfEagerly`
3407+
3408By default, unset.
3409
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003410[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
3411+
3412Converts the local username, that is used to login into the Gerrit
David Pursehousea1d633b2014-05-02 17:21:02 +09003413Web UI, to lower case before doing the LDAP authentication. By setting
3414this parameter to true, a case insensitive login to the Gerrit Web UI
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003415can be achieved.
3416+
3417If set, it must be ensured that the local usernames for all existing
3418accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09003419local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003420anymore. The local usernames for the existing accounts can be
3421converted to lower case by running the server program
3422link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
3423Please be aware that the conversion of the local usernames to lower
3424case can't be undone. For newly created accounts the local username
3425will be directly stored in lower case.
3426+
3427By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003428
Robin Rosenberga3baed02012-10-14 14:09:32 +02003429[[ldap.authentication]]ldap.authentication::
3430+
3431Defines how Gerrit authenticates with the server. When set to `GSSAPI`
3432Gerrit will use Kerberos. To use kerberos the
3433`java.security.auth.login.config` system property must point to a
3434login to a JAAS configuration file and, if Java 6 is used, the system
3435property `java.security.krb5.conf` must point to the appropriate
3436krb5.ini file with references to the KDC.
3437
3438Typical jaas.conf.
3439
3440----
3441KerberosLogin {
3442 com.sun.security.auth.module.Krb5LoginModule
3443 required
3444 useTicketCache=true
3445 doNotPrompt=true
3446 renewTGT=true;
3447};
3448----
3449
3450See Java documentation on how to create the krb5.ini file.
3451
3452Note the `renewTGT` property to make sure the TGT does not expire,
3453and `useTicketCache` to use the TGT supplied by the operating system. As
3454the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09003455to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02003456
3457On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
3458must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
3459have local administrator privileges.
3460
Bruce Zucd04bbc2014-07-25 15:48:09 +08003461[[ldap.useConnectionPooling]]ldap.useConnectionPooling::
3462+
3463_(Optional)_ Enable the LDAP connection pooling or not.
3464+
3465If it is true, the LDAP service provider maintains a pool of (possibly)
3466previously used connections and assigns them to a Context instance as
3467needed. When a Context instance is done with a connection (closed or
3468garbage collected), the connection is returned to the pool for future use.
3469+
3470For details, see link:http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html[
3471LDAP connection management (Pool)] and link:http://docs.oracle.com/javase/tutorial/jndi/ldap/config.html[
3472LDAP connection management (Configuration)]
3473+
3474By default, false.
3475
3476[[ldap.connectTimeout]]ldap.connectTimeout::
3477+
Saša Živkov303701a2015-01-19 16:24:44 +01003478_(Optional)_ Timeout period for establishment of an LDAP connection.
Bruce Zucd04bbc2014-07-25 15:48:09 +08003479+
3480The value is in the usual time-unit format like "1 s", "100 ms",
3481etc...
3482+
3483By default there is no timeout and Gerrit will wait indefinitely.
3484
Saša Živkov5049f512015-01-19 17:04:43 +01003485[[ldap-connection-pooling]]
3486==== LDAP Connection Pooling
3487Once LDAP connection pooling is enabled by setting the link:#ldap.useConnectionPooling[
3488ldap.useConnectionPooling] configuration property to `true`, the connection pool
3489can be configured using JVM system properties as explained in the
3490link:http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-ldap.html#POOL[
3491Java SE Documentation].
Bruce Zucd04bbc2014-07-25 15:48:09 +08003492
Saša Živkov5049f512015-01-19 17:04:43 +01003493For standalone Gerrit (running with the embedded Jetty), JVM system properties
3494are specified in the link:#container[container section]:
Bruce Zucd04bbc2014-07-25 15:48:09 +08003495
Saša Živkov5049f512015-01-19 17:04:43 +01003496----
3497 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.maxsize=20
3498 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.prefsize=10
3499 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.timeout=300000
3500----
Bruce Zucd04bbc2014-07-25 15:48:09 +08003501
Saša Živkovca7a67e2015-12-01 14:25:10 +01003502[[lfs]]
3503=== Section lfs
3504
3505[[lfs.plugin]]lfs.plugin::
3506+
David Pursehouse2463c542016-08-02 16:04:58 +09003507The name of a plugin which serves the
3508link:https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md[
3509LFS protocol] on the `<project-name>/info/lfs/objects/batch` endpoint. When
3510not configured Gerrit will respond with `501 Not Implemented` on LFS protocol
3511requests.
Saša Živkovca7a67e2015-12-01 14:25:10 +01003512+
3513By default unset.
3514
Gustaf Lundhaef90122015-04-27 16:48:19 +02003515[[log]]
3516=== Section log
3517
3518[[log.jsonLogging]]log.jsonLogging::
3519+
3520If set to true, enables error logging in JSON format (file name: "logs/error_log.json").
3521+
3522Defaults to false.
3523
3524[[log.textLogging]]log.textLogging::
3525+
3526If set to true, enables error logging in regular plain text format. Can only be disabled
3527if `jsonLogging` is enabled.
3528+
3529Defaults to true.
3530
David Pursehouse2281fef2017-11-21 21:27:17 +09003531[[log.compress]]log.compress::
3532+
3533If set to true, log files are compressed at server startup and then daily at 11pm
3534(in the server's local time zone).
3535+
3536Defaults to true.
3537
David Pursehouse633fff32017-11-21 22:08:12 +09003538[[log.rotate]]log.rotate::
3539+
3540If set to true, log files are rotated daily at midnight (GMT).
3541+
3542Defaults to true.
3543
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003544[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003545=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003546
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003547[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003548+
3549If set to true, files with the MIME type `<name>` will be sent as
3550direct downloads to the user's browser, rather than being wrapped up
3551inside of zipped archives. The type name may be a complete type
Jonathan Nieder5758f182015-03-30 11:28:55 -07003552name, e.g. `image/gif`, a generic media type, e.g. `+image/*+`,
3553or the wildcard `+*/*+` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003554+
3555By default, false for all MIME types.
3556
3557Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003558----
3559[mimetype "image/*"]
3560 safe = true
3561
3562[mimetype "application/pdf"]
3563 safe = true
3564
3565[mimetype "application/msword"]
3566 safe = true
3567
3568[mimetype "application/vnd.ms-excel"]
3569 safe = true
3570----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003571
Dave Borowitzbc314912017-03-21 14:23:35 -07003572[[note-db]]
3573=== Section noteDb
3574
Dave Borowitzada289c2018-12-18 13:24:14 -08003575NoteDb is the Git-based database storage backend for Gerrit. For more
3576information, including how to migrate data from an older Gerrit version, see the
3577link:note-db.html[documentation].
Dave Borowitzbc314912017-03-21 14:23:35 -07003578
Edwin Kempin5be9c312017-07-07 10:40:55 +02003579[[notedb.accounts.sequenceBatchSize]]notedb.accounts.sequenceBatchSize::
3580+
Edwin Kempin311d5702017-07-28 15:10:24 +02003581The next available account sequence number is stored as UTF-8 text in a
3582blob pointed to by the `refs/sequences/accounts` ref in the `All-Users`
Edwin Kempin5be9c312017-07-07 10:40:55 +02003583repository. Multiple processes share the same sequence by incrementing
3584the counter using normal git ref updates. To amortize the cost of these
3585ref updates, processes increment the counter by a larger number and
3586hand out numbers from that range in memory until they run out. This
3587configuration parameter controls the size of the account ID batch that
3588each process retrieves at once.
3589+
Edwin Kempin5be9c312017-07-07 10:40:55 +02003590By default, 1.
3591
Han-Wen Nienhuyse5ca19c2017-11-08 13:33:33 +01003592
Michael Ochmann69813262016-01-27 17:53:55 +01003593[[oauth]]
3594=== Section oauth
3595
3596OAuth integration is only enabled if `auth.type` is set to `OAUTH`. See
3597link:#auth.type[above] for a detailed description of the `auth.type` settings
3598and their implications.
3599
3600By default, contact information, like the full name and email address,
3601is retrieved from the selected OAuth provider when a user account is created,
3602or when a user requests to reload that information in the settings UI. If
3603that is not supported by the OAuth provider, users can be allowed to edit
3604their contact information manually.
3605
3606[[oauth.allowEditFullName]]oauth.allowEditFullName::
3607+
3608If true, the full name can be edited in the contact information.
3609+
3610Default is false.
3611
3612[[oauth.allowRegisterNewEmail]]oauth.allowRegisterNewEmail::
3613+
3614If true, additional email addresses can be registered in the contact
3615information.
3616+
3617Default is false.
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003618
Zac Livingston70a16102018-11-20 15:07:34 -07003619[[operator-alias]]
3620=== Section operator alias
3621
3622Operator aliasing allows global aliases to be defined for query operators.
3623Currently only change queries are supported. The alias name is the git
3624config key name, and the operator being aliased is the git config value.
3625
3626For example:
3627
3628----
3629[operator-alias "change"]
3630 oldage = age
3631 number = change
3632----
3633
3634This section is particularly useful to alias operator names which may be
3635long and clunky because they include a plugin name in them to a shorter
3636name without the plugin name.
3637
3638Aliases are resolved dynamically at invocation time to any currently
3639loaded versions of plugins. If the alias points to an operator provided
3640by a plugin which is not currently loaded, or the plugin does not define
3641the operator, then "unsupported operator" is returned to the user.
3642
3643Aliases will override existing operators. In the case of multiple aliases
3644with the same name, the last one defined will be used.
3645
3646When the target of an alias doesn't exist, the operator with the name
3647of the alias will be used (if present). This enables an admin to config
3648the system to override a core operator with an operator provided by a
3649plugin when present and otherwise fall back to the operator provided by
3650core.
3651
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003652[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003653=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003654
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003655Global settings controlling how Gerrit Code Review creates pack
3656streams for Git clients running clone, fetch, or pull. Most of these
3657variables are per-client request, and thus should be carefully set
3658given the expected concurrent request load and available CPU and
3659memory resources.
3660
3661[[pack.deltacompression]]pack.deltacompression::
3662+
3663If true, delta compression between objects is enabled. This may
3664result in a smaller overall transfer for the client, but requires
3665more server memory and CPU time.
3666+
3667False (off) by default, matching Gerrit Code Review 2.1.4.
3668
3669[[pack.threads]]pack.threads::
3670+
3671Maximum number of threads to use for delta compression (if enabled).
3672This is per-client request. If set to 0 then the number of CPUs is
3673auto-detected and one thread per CPU is used, per client request.
3674+
3675By default, 1.
3676
3677
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003678[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003679=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003680
3681[[plugins.checkFrequency]]plugins.checkFrequency::
3682+
3683How often plugins should be examined for new plugins to load, removed
3684plugins to be unloaded, or updated plugins to be reloaded. Values can
3685be specified using standard time unit abbreviations ('ms', 'sec',
3686'min', etc.).
3687+
3688If set to 0, automatic plugin reloading is disabled. Administrators
Christian Aistleitner8ce1a4e2015-06-05 01:54:15 +02003689may force reloading with link:cmd-plugin-reload.html[gerrit plugin reload].
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003690+
3691Default is 1 minute.
3692
Shawn Pearcefd033502014-02-14 16:42:35 -08003693[[plugins.allowRemoteAdmin]]plugins.allowRemoteAdmin::
3694+
3695Enable remote installation, enable and disable of plugins over HTTP
3696and SSH. If set to true Administrators can install new plugins
3697remotely, or disable existing plugins. Defaults to false.
3698
Saša Živkov350fc682019-05-13 14:13:51 +02003699[[plugins.mandatory]]plugins.mandatory::
3700+
3701List of mandatory plugins. If a plugin from this list does not load,
David Pursehousef06aefb2019-10-18 20:39:53 +09003702Gerrit will fail to start.
3703+
3704Disabling and restarting of a mandatory plugin is rejected, but reloading
3705of a mandatory plugin is still possible.
Saša Živkov350fc682019-05-13 14:13:51 +02003706
Dariusz Luksza98f23522015-03-11 11:41:41 +01003707[[plugins.jsLoadTimeout]]plugins.jsLoadTimeout::
3708+
3709Set the timeout value for loading JavaScript plugins in Gerrit UI.
3710Values can be specified using standard time unit abbreviations ('ms',
3711'sec', 'min', etc.).
3712+
3713Default is 5 seconds. Negative values will be converted to 0.
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003714
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003715[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003716=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003717
Dave Borowitzff243892015-08-31 15:35:28 -04003718This section is used to configure behavior of the 'receive-pack'
3719handler, which responds to 'git push' requests.
lincoln2be11602010-07-05 10:53:25 -03003720
Dave Borowitzff243892015-08-31 15:35:28 -04003721[[receive.allowGroup]]receive.allowGroup::
Dave Borowitz532342bf2015-06-18 20:28:22 -04003722+
Dave Borowitzff243892015-08-31 15:35:28 -04003723Name of the groups of users that are allowed to execute
3724'receive-pack' on the server. One or more groups can be set.
Dave Borowitz532342bf2015-06-18 20:28:22 -04003725+
Dave Borowitzff243892015-08-31 15:35:28 -04003726If no groups are added, any user will be allowed to execute
3727'receive-pack' on the server.
Dave Borowitz532342bf2015-06-18 20:28:22 -04003728
3729[[receive.certNonceSeed]]receive.certNonceSeed::
3730+
3731If set to a non-empty value and server-side signed push validation is
3732link:#receive.enableSignedPush[enabled], use this value as the seed to
3733the HMAC SHA-1 nonce generator. If unset, a 64-byte random seed will be
3734generated at server startup.
3735+
3736As this is used as the seed of a cryptographic algorithm, it is
3737recommended to be placed in link:#secure-config[`secure.config`].
3738+
3739Defaults to unset.
3740
3741[[receive.certNonceSlop]]receive.certNonceSlop::
3742+
3743When validating the nonce passed as part of the signed push protocol,
3744accept valid nonces up to this many seconds old. This allows
3745certificate verification to work over HTTP where there is a lag between
3746the HTTP response providing the nonce to sign and the next request
3747containing the signed nonce. This can be significant on large
3748repositories, since the lag also includes the time to count objects on
3749the client.
3750+
3751Default is 5 minutes.
3752
Dave Borowitzff243892015-08-31 15:35:28 -04003753[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
3754+
3755Number of threads to perform change creation or patch set updates
3756concurrently. Each thread uses its own database connection from
3757the database connection pool, and if all threads are busy then
3758main receive thread will also perform a change creation or patch
3759set update.
3760+
3761Defaults to 1, using only the main receive thread. This feature is for
3762databases with very high latency that can benefit from concurrent
3763operations when multiple changes are impacted at once.
3764
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08003765[[receive.checkMagicRefs]]receive.checkMagicRefs::
3766+
3767If true, Gerrit will verify the destination repository has
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01003768no references under the magic 'refs/for' branch namespace. Names under
3769these locations confuse clients when trying to upload code reviews so
3770Gerrit requires them to be empty.
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08003771+
3772If false Gerrit skips the sanity check and assumes administrators
3773have ensured the repository does not contain any magic references.
3774Setting to false to skip the check can decrease latency during push.
3775+
3776Default is true.
3777
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02003778[[receive.allowProjectOwnersToChangeParent]]receive.allowProjectOwnersToChangeParent::
3779+
3780If true, Gerrit will allow project owners to change the parent of a project.
3781+
3782By default only Gerrit administrators are allowed to change the parent
3783of a project. By allowing project owners to change parents, it may
3784allow the owner to circumvent certain enforced rules (like important
3785BLOCK rules).
3786+
3787Default is false.
Rikard Almgrene9221be2018-09-18 11:12:03 +02003788+
3789This value supports configuration reloads:
3790link:cmd-reload-config.html[reload-config]
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02003791
Gustaf Lundh9062fd62013-02-14 17:23:11 +01003792[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
3793+
3794If set to true, Gerrit will validate that all referenced objects that
3795are not included in the received pack are reachable by the user.
3796+
3797Carrying out this check on gits with many refs and commits can be a
3798very CPU-heavy operation. For non public Gerrit-servers this check may
3799be overkill.
3800+
3801Only disable this check if you trust the clients not to forge SHA1
3802references to access commits intended to be hidden from the user.
3803+
3804Default is true.
3805
Patrick Hiesel24653be2019-10-22 09:47:32 +02003806[[receive.enableInMemoryRefCache]]receive.enableInMemoryRefCache::
3807+
3808If true, Gerrit will cache all refs advertised during push in memory and
3809base later receive operations on that cache.
3810+
3811Turning this cache off is considered experimental.
3812+
3813This cache provides value when the ref database is slow and/or does not
3814offer an inverse lookup of object ID to ref name. When RefTable is used,
3815this cache can be turned off (experimental) to get speed improvements.
3816+
3817Default is true.
3818
Dave Borowitzff243892015-08-31 15:35:28 -04003819[[receive.enableSignedPush]]receive.enableSignedPush::
lincoln2be11602010-07-05 10:53:25 -03003820+
Dave Borowitzff243892015-08-31 15:35:28 -04003821If true, server-side signed push validation is enabled.
lincoln2be11602010-07-05 10:53:25 -03003822+
Dave Borowitzff243892015-08-31 15:35:28 -04003823When a client pushes with `git push --signed`, this ensures that the
3824push certificate is valid and signed with a valid public key stored in
David Pursehouse6117a472016-07-26 08:02:49 +00003825the `refs/meta/gpg-keys` branch of `All-Users`.
Dave Borowitzff243892015-08-31 15:35:28 -04003826+
3827Defaults to false.
3828
3829[[receive.maxBatchChanges]]receive.maxBatchChanges::
3830+
3831The maximum number of changes that Gerrit allows to be pushed
3832in a batch for review. When this number is exceeded Gerrit rejects
3833the push with an error message.
3834+
3835May be overridden for certain groups by specifying a limit in the
3836link:access-control.html#capability_batchChangesLimit['Batch Changes Limit']
3837global capability.
3838+
3839This setting can be used to prevent users from uploading large
3840number of changes for review by mistake.
3841+
3842Default is zero, no limit.
lincoln2be11602010-07-05 10:53:25 -03003843
Dave Borowitz78542192017-08-31 10:45:47 -04003844[[receive.maxBatchCommits]]receive.maxBatchCommits::
3845+
3846The maximum number of commits that Gerrit allows to be pushed in a batch
3847directly to a branch when link:user-upload.html#bypass_review[bypassing review].
3848This limit can be bypassed if a user link:user-upload.html#skip_validation[skips
3849validation].
3850+
3851Default is 10000.
3852
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003853[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
3854+
3855Maximum allowed Git object size that 'receive-pack' will accept.
3856If an object is larger than the given size the pack-parsing will abort
3857and the push operation will fail. If set to zero then there is no
3858limit.
3859+
David Pursehouse221d4f62012-06-08 17:38:08 +09003860Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003861from pushing objects which are too large to Gerrit.
3862+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07003863This setting can also be set in the `project.config`
David Pursehouse2e548682018-08-01 15:12:47 +02003864(link:config-project-config.html[receive.maxObjectSizeLimit]) in order
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07003865to further reduce the global setting. The project specific setting is
3866only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02003867+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003868Default is zero.
3869+
3870Common unit suffixes of 'k', 'm', or 'g' are supported.
3871
David Pursehouse3f9c7402018-09-05 18:43:03 +09003872[[receive.inheritProjectMaxObjectSizeLimit]]receive.inheritProjectMaxObjectSizeLimit::
3873+
3874Controls whether the project-level link:config-project-config.html[`receive.maxObjectSizeLimit`]
3875value is inherited from the parent project. When `true`, the value is
3876inherited, otherwise it is not inherited.
3877+
3878Default is false, the value is not inherited.
3879
Dave Borowitz1bb49492015-08-31 15:36:59 -04003880[[receive.maxTrustDepth]]receive.maxTrustDepth::
3881+
3882If signed push validation is link:#receive.enableSignedPush[enabled],
3883set to the maximum depth to search when checking if a key is
3884link:#receive.trustedKey[trusted].
3885+
3886Default is 0, meaning only explicitly trusted keys are allowed.
3887
Dave Borowitz234734a2012-03-01 14:22:29 -08003888[[receive.threadPoolSize]]receive.threadPoolSize::
3889+
3890Maximum size of the thread pool in which the change data in received packs is
3891processed.
3892+
3893Defaults to the number of available CPUs according to the Java runtime.
3894
Dave Borowitz1c401362012-03-02 17:39:17 -08003895[[receive.timeout]]receive.timeout::
3896+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07003897Overall timeout on the time taken to process the change data in
3898received packs. Only includes the time processing Gerrit changes
3899and updating references, not the time to index the pack. Values can
3900be specified using standard time unit abbreviations ('ms', 'sec',
3901'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08003902+
Dariusz Lukszade482b02015-11-09 18:25:04 +01003903Default is 4 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07003904is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08003905
Dave Borowitz1bb49492015-08-31 15:36:59 -04003906[[receive.trustedKey]]receive.trustedKey::
3907+
3908List of GPG key fingerprints that should be considered trust roots by
3909the server when signed push validation is
3910link:#receive.enableSignedPush[enabled]. A key is trusted by the server
3911if it is either in this list, or a path of trust signatures leads from
3912the key to a configured trust root. The maximum length of the path is
3913determined by link:#receive.maxTrustDepth[`receive.maxTrustDepth`].
3914+
3915Key fingerprints can be displayed with `gpg --list-keys
3916--with-fingerprint`.
3917+
3918Trust signatures can be added to a key using the `tsign` command to
3919link:https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html[
3920`gpg --edit-key`], after which the signed key should be re-uploaded.
3921+
3922If no keys are specified, web-of-trust checks are disabled. This is the
3923default behavior.
3924
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003925[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003926=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003927
Hugo Josefson072b4702010-04-21 19:27:11 +02003928Repositories in this sense are the same as projects.
3929
Shawn O. Pearce897d9212011-06-16 16:59:59 -07003930In the following example configuration `Registered Users` is set
3931to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02003932
3933----
3934[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02003935 ownerGroup = Registered Users
3936----
3937
Hugo Arès7d2b9422014-11-25 15:33:42 -05003938The only matching patterns supported are exact match or wildcard matching which
3939can be specified by ending the name with a `*`. If a project matches more than one
3940repository configuration, then the configuration from the more precise match
3941will be used. In the following example, the default submit type for a project
3942named `project/plugins/a` would be `CHERRY_PICK`.
3943
3944----
3945[repository "project/*"]
3946 defaultSubmitType = MERGE_IF_NECESSARY
3947[repository "project/plugins/*"]
3948 defaultSubmitType = CHERRY_PICK
3949----
3950
Michael Ochmann8129ece2016-07-08 11:25:25 +02003951[NOTE]
3952All properties are used from the matching repository configuration. In
Hugo Arès7d2b9422014-11-25 15:33:42 -05003953the previous example, all properties will be used from `project/plugins/\*`
3954section and no properties will be inherited nor overridden from `project/*`.
Hugo Josefson072b4702010-04-21 19:27:11 +02003955
Hugo Arès218bb3b2015-04-22 15:05:14 -04003956[[repository.name.basePath]]repository.<name>.basePath::
3957+
3958Alternate to <<gerrit.basePath,gerrit.basePath>>. The repository will be created
3959and used from this location instead: ${alternateBasePath}/${projectName}.git.
3960+
3961If configuring the basePath for an existing project in gerrit, make sure to stop
3962gerrit, move the repository in the alternate basePath, configure basePath for
3963this repository and then start Gerrit.
3964+
3965Path must be absolute.
3966
Edwin Kempina79ea552013-11-19 11:24:37 +01003967[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
3968+
3969The default submit type for newly created projects. Supported values
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04003970are `INHERIT`, `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02003971`REBASE_ALWAYS`, `MERGE_ALWAYS` and `CHERRY_PICK`.
3972+
Changcheng Xiao21885982019-01-15 18:16:51 +01003973For more details see link:config-project-config.html#submit-type[Submit Types].
Edwin Kempina79ea552013-11-19 11:24:37 +01003974+
Changcheng Xiao21885982019-01-15 18:16:51 +01003975Default is link:config-project-config.html#submit_type_inherit[`INHERIT`].
Dave Borowitzcad4d262018-01-22 10:02:22 -05003976+
Dave Borowitz03e51742018-01-09 07:57:01 -05003977This submit type is only applied at project creation time if a submit type is
3978omitted from the link:rest-api-projects.html#project-input[ProjectInput]. If the
Dave Borowitzcad4d262018-01-22 10:02:22 -05003979submit type is unset in the project config at runtime, for backwards
3980compatibility purposes, it defaults to
3981link:project-configuration.html#merge_if_necessary[`MERGE_IF_NECESSARY`] rather
3982than `INHERIT`.
Edwin Kempina79ea552013-11-19 11:24:37 +01003983
Hugo Josefson072b4702010-04-21 19:27:11 +02003984[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
3985+
3986A name of a group which exists in the database. Zero, one or many
3987groups are allowed. Each on its own line. Groups which don't exist
3988in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02003989
Edwin Kempin22687fa2018-01-22 11:55:07 +01003990[[retry]]
3991=== Section retry
3992
3993[[retry.maxWait]]retry.maxWait::
3994+
3995Maximum time to wait between attempts to retry an operations when one attempt
3996fails (e.g. on NoteDb updates due to contention, aka lock failure, on the
3997underlying ref storage). Operations are retried with exponential backoff, plus
3998some random jitter, until the interval reaches this limit. After that, retries
3999continue to occur after a fixed timeout (plus jitter), up to
4000link:#retry.timeout[`retry.timeout`].
4001+
4002Defaults to 5 seconds; unit suffixes are supported, and assumes milliseconds if
4003not specified.
4004
4005[[retry.timeout]]retry.timeout::
4006+
4007Total timeout for retrying operations when one attempt fails.
4008+
4009It is possible to overwrite this default timeout based on operation types by
4010setting link:#retry.operationType.timeout[`retry.<operationType>.timeout`].
4011+
4012Defaults to 20 seconds; unit suffixes are supported, and assumes milliseconds if
4013not specified.
4014
4015[[retry.operationType.timeout]]retry.<operationType>.timeout::
4016+
4017Total timeout for retrying operations of type `<operationType>` when one
4018attempt fails. `<operationType>` can be `ACCOUNT_UPDATE`, `CHANGE_UPDATE`,
4019`GROUP_UPDATE` and `INDEX_QUERY`.
4020+
4021Defaults to link:#retry.timeout[`retry.timeout`]; unit suffixes are supported,
4022and assumes milliseconds if not specified.
4023
Edwin Kempindd837ae2019-06-18 11:42:14 +02004024[[retry.retryWithTraceOnFailure]]retry.retryWithTraceOnFailure::
4025+
4026Whether Gerrit should automatically retry operations on failure with tracing
4027enabled. The automatically generated traces can help with debugging. Please
4028note that only some of the REST endpoints support automatic retry.
4029+
4030By default this is set to false.
4031
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004032[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004033=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004034
4035[[rules.enable]]rules.enable::
4036+
Matt Baker8ce12fc2013-11-26 21:43:12 -07004037If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004038project's refs/meta/config branch, if present. When set to false,
4039only the default internal rules will be used.
4040+
4041Default is true, to execute project specific rules.
4042
Shawn Pearceed001d72014-12-17 14:25:55 -08004043[[rules.reductionLimit]]rules.reductionLimit::
4044+
4045Maximum number of Prolog reductions that can be performed when
4046evaluating rules for a single change. Each function call made
4047in user rule code, internal Gerrit Prolog code, or the Prolog
4048interpreter counts against this limit.
4049+
4050Sites using very complex rules that need many reductions should
4051compile Prolog to Java bytecode with link:pgm-rulec.html[rulec].
4052This eliminates the dynamic Prolog interpreter from charging its
4053own reductions against the limit, enabling more logic to execute
4054within the same bounds.
4055+
4056A reductionLimit of 0 is nearly infinite, implemented by setting
4057the internal limit to 2^31-1.
4058+
4059Default is 100,000 reductions (about 14 ms on Intel Core i7 CPU).
4060
4061[[rules.compileReductionLimit]]rules.compileReductionLimit::
4062+
4063Maximum number of Prolog reductions that can be performed when
4064compiling source code to internal Prolog machine code.
4065+
4066Default is 10x reductionLimit (1,000,000).
4067
Shawn Pearcea2b98522015-11-21 09:47:32 -08004068[[rules.maxSourceBytes]]rules.maxSourceBytes::
4069+
4070Maximum input size (in bytes) of a Prolog rules.pl file. Larger
4071source files may need a larger rules.compileReductionLimit. Consider
4072using link:pgm-rulec.html[rulec] to precompile larger rule files.
4073+
4074A size of 0 bytes disables rules, same as rules.enable = false.
4075+
David Pursehouse0c1dadf2015-11-24 09:14:21 +00004076Common unit suffixes of 'k', 'm', or 'g' are supported.
4077+
Shawn Pearcea2b98522015-11-21 09:47:32 -08004078Default is 128 KiB.
4079
4080[[rules.maxPrologDatabaseSize]]rules.maxPrologDatabaseSize::
4081+
4082Number of predicate clauses allowed to be defined in the Prolog
4083database by project rules. Very complex rules may need more than the
4084default 256 limit, but cost more memory and may need more time to
4085evaluate. Consider using link:pgm-rulec.html[rulec] to precompile
4086larger rule files.
4087+
4088Default is 256.
4089
David Pursehouse511a35b2014-04-04 10:27:13 +09004090[[execution]]
4091=== Section execution
Bruce Zua7e34312014-04-01 17:35:41 +08004092
4093[[execution.defaultThreadPoolSize]]execution.defaultThreadPoolSize::
4094+
4095The default size of the background execution thread pool in
4096which miscellaneous tasks are handled.
4097+
4098Default is 1.
4099
Patrick Hiesel2ed39822018-04-16 12:04:02 +02004100[[execution.fanOutThreadPoolSize]]execution.fanOutThreadPoolSize::
4101+
4102Maximum size of thread pool to on which a serving thread can fan-out
4103work to parallelize it.
4104+
4105When set to 0, a direct executor will be used.
4106+
4107By default, 25 which means that formatting happens in the caller thread.
4108
Patrick Hiesel328b7612016-10-21 16:43:13 +02004109[[receiveemail]]
4110=== Section receiveemail
4111
4112[[receiveemail.protocol]]receiveemail.protocol::
4113+
4114Specifies the protocol used for receiving emails. Valid options are
4115'POP3', 'IMAP' and 'NONE'. Note that Gerrit will automatically switch between
4116POP3 and POP3s as well as IMAP and IMAPS depending on the specified
4117link:#receiveemail.encryption[encryption].
4118+
4119Defaults to 'NONE' which means that receiving emails is disabled.
4120
4121[[receiveemail.host]]receiveemail.host::
4122+
4123The hostname of the mailserver. Example: 'imap.gmail.com'.
4124+
4125Defaults to an empty string which means that receiving emails is disabled.
4126
4127[[receiveemail.port]]receiveemail.port::
4128+
David Pursehouse4b067752017-03-03 15:54:53 +09004129The port the email server exposes for receiving emails.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004130+
4131Defaults to the industry standard for a given protocol and encryption:
David Pursehouse34907442017-04-04 09:55:38 +09004132POP3: 110; POP3S: 995; IMAP: 143; IMAPS: 993.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004133
4134[[receiveemail.username]]receiveemail.username::
4135+
4136Username used for authenticating with the email server.
4137+
4138Defaults to an empty string.
4139
4140[[receiveemail.password]]receiveemail.password::
4141+
4142Password used for authenticating with the email server.
4143+
4144Defaults to an empty string.
4145
4146[[receiveemail.encryption]]receiveemail.encryption::
4147+
4148Encryption standard used for transport layer security between Gerrit and the
4149email server. Possible values include 'NONE', 'SSL' and 'TLS'.
4150+
4151Defaults to 'NONE'.
4152
4153[[receiveemail.fetchInterval]]receiveemail.fetchInterval::
4154+
4155Time between two consecutive fetches from the email server. Communication with
4156the email server is not kept alive. Examples: 60s, 10m, 1h.
4157+
4158Defaults to 60 seconds.
4159
4160[[receiveemail.enableImapIdle]]receiveemail.enableImapIdle::
4161+
4162If the IMAP protocol is used for retrieving emails, IMAPv4 IDLE can be used to
4163keep the connection with the email server alive and receive a push when a new
4164email is delivered to the inbox. In this case, Gerrit will process the email
4165immediately and will not have a fetch delay.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004166+
4167Defaults to false.
4168
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004169[[receiveemail.filter.mode]]receiveemail.filter.mode::
4170+
4171A black- and whitelist filter to filter incoming emails.
4172+
4173If `OFF`, emails are not filtered by the list filter.
4174+
4175If `WHITELIST`, only emails where a pattern from
4176<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4177matches 'From' will be processed.
4178+
4179If `BLACKLIST`, only emails where no pattern from
4180<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4181matches 'From' will be processed.
4182+
4183Defaults to `OFF`.
4184
4185[[receiveemail.filter.patterns]]receiveemail.filter.patterns::
4186+
4187A list of regular expressions to match the email sender against. This can also
4188be a list of addresses when regular expression characters are escaped.
4189
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004190[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004191=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004192
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004193[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07004194+
4195If false Gerrit will not send email messages, for any reason,
4196and all other properties of section sendemail are ignored.
4197+
4198By default, true, allowing notifications to be sent.
4199
Jonathan Niederdabd8c22016-09-20 14:10:11 -07004200[[sendemail.html]]sendemail.html::
4201+
4202If false, Gerrit will only send plain-text emails.
4203If true, Gerrit will send multi-part emails with an HTML and
4204plain text part.
4205+
4206By default, true, allowing HTML in the emails Gerrit sends.
4207
Bruce Zua7e34312014-04-01 17:35:41 +08004208[[sendemail.connectTimeout]]sendemail.connectTimeout::
4209+
4210The connection timeout of opening a socket connected to a
4211remote SMTP server.
4212+
4213Values can be specified using standard time unit abbreviations
4214('ms', 'sec', 'min', etc.).
4215If no unit is specified, milliseconds is assumed.
4216+
4217Default is 0. A timeout of zero is interpreted as an infinite
4218timeout. The connection will then block until established or
4219an error occurs.
4220
4221[[sendemail.threadPoolSize]]sendemail.threadPoolSize::
4222+
4223Maximum size of thread pool in which the review comments
4224notifications are sent out asynchronously.
4225+
4226By default, 1.
4227
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004228[[sendemail.from]]sendemail.from::
4229+
4230Designates what name and address Gerrit will place in the From
4231field of any generated email messages. The supported values are:
4232+
4233* `USER`
4234+
4235Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09004236Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004237classified as spam if the user's domain has SPF or DKIM enabled
4238and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
Zhen Chenae765aa2016-08-08 15:49:44 -07004239relay for that domain. You can specify
4240<<sendemail.allowedDomain,sendemail.allowedDomain>> to instruct Gerrit to only
4241send as USER if USER is from those domains.
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004242+
4243* `MIXED`
4244+
Edwin Kempincdb0e002011-09-08 14:23:30 +02004245Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004246`review@example.com` is the same as <<user.email,user.email>>.
4247See below for a description of how the replacement is handled.
4248+
4249* `SERVER`
4250+
4251Gerrit will set the From header to the same name and address
4252it records in any commits Gerrit creates. This is set by
4253<<user.name,user.name>> and <<user.email,user.email>>, or guessed
4254from the local operating system.
4255+
Edwin Kempinebfbbac2015-07-01 16:02:39 +02004256* `Code Review <review@example.com>`
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004257+
4258If set to a name and email address in brackets, Gerrit will use
4259this name and email address for any messages, overriding the name
4260that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02004261Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004262which is replaced by the Full Name of the current user.
4263
4264+
4265By default, MIXED.
4266
Zhen Chenae765aa2016-08-08 15:49:44 -07004267[[sendemail.allowedDomain]]sendemail.allowedDomain::
4268+
4269Only used when `sendemail.from` is set to `USER`.
4270List of allowed domains. If user's email matches one of the domains, emails will
4271be sent as USER, otherwise as MIXED mode. Wildcards may be specified by
Maxime Guerreiroebac2d42018-03-21 13:54:51 +01004272including `\*` to match any number of characters, for example `*.example.com`
Zhen Chenae765aa2016-08-08 15:49:44 -07004273matches any subdomain of `example.com`.
4274+
4275By default, `*`.
4276
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004277[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004278+
4279Hostname (or IP address) of a SMTP server that will relay
4280messages generated by Gerrit to end users.
4281+
4282By default, 127.0.0.1 (aka localhost).
4283
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004284[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004285+
4286Port number of the SMTP server in sendemail.smtpserver.
4287+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08004288By default, 25, or 465 if smtpEncryption is 'ssl'.
4289
4290[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
4291+
4292Specify the encryption to use, either 'ssl' or 'tls'.
4293+
4294By default, 'none', indicating no encryption is used.
4295
4296[[sendemail.sslVerify]]sendemail.sslVerify::
4297+
4298If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
4299will not verify the server certificate when it connects to send
4300an email message.
4301+
4302By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004303
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004304[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004305+
4306User name to authenticate with, if required for relay.
4307
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004308[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004309+
4310Password for the account named by sendemail.smtpUser.
4311
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004312[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004313+
4314If present, each value adds one entry to the whitelist of email
4315addresses that Gerrit can send email to. If set to a complete
4316email address, that one address is added to the white list.
4317If set to a domain name, any address at that domain can receive
4318email from Gerrit.
4319+
4320By default, unset, permitting delivery to any email address.
4321
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004322[[sendemail.includeDiff]]sendemail.includeDiff::
4323+
Bruce Zueb00ff32012-11-27 17:38:10 +08004324If true, new change emails and merged change emails from Gerrit
4325will include the complete unified diff of the change.
4326Variable maxmimumDiffSize places an upper limit on how large the
4327email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004328+
4329By default, false.
4330
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07004331[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
4332+
4333Largest size of unified diff output to include in an email. When
4334the diff exceeds this size the file paths will be listed instead.
4335Standard byte unit suffixes are supported.
4336+
4337By default, 256 KiB.
4338
Alex Blewitt9cca7402011-02-11 01:39:30 +00004339[[sendemail.importance]]sendemail.importance::
4340+
4341If present, emails sent from Gerrit will have the given level
4342of importance. Valid values include 'high' and 'low', which
4343email clients will render in different ways.
4344+
4345By default, unset, so no Importance header is generated.
4346
4347[[sendemail.expiryDays]]sendemail.expiryDays::
4348+
4349If present, emails sent from Gerrit will expire after the given
4350number of days. This will add the Expiry-Date header and
4351email clients may expire or expunge mails whose Expiry-Date
4352header is in the past. This should be a positive non-zero
4353number indicating how many days in the future the mails
4354should expire.
4355+
4356By default, unset, so no Expiry-Date header is generated.
4357
Patrick Hiesel31d60f02017-02-09 17:38:40 +01004358[[sendemail.replyToAddress]]sendemail.replyToAddress::
4359+
4360A custom Reply-To address should only be provided if Gerrit is set up to
4361receive emails and the inbound address differs from
4362<<sendemail.from,sendemail.from>>.
4363It will be set as Reply-To header on all types of outgoing email where
4364Gerrit can parse back a user's reply.
4365+
4366Defaults to an empty string which adds <<sendemail.from,sendemail.from>> as
4367Reply-To if inbound email is enabled and the review's author otherwise.
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004368
David Pursehouse917b7262017-04-21 18:18:52 +02004369[[sendemail.allowTLD]]sendemail.allowTLD::
4370+
4371List of custom TLDs to allow sending emails to in addition to those specified
4372in the link:http://data.iana.org/TLD/[IANA list].
4373+
4374Defaults to an empty list, meaning no additional TLDs are allowed.
4375
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004376
4377[[sendemail.addInstanceNameInSubject]]sendemail.addInstanceNameInSubject::
4378+
4379When set to true, Gerrit will add its short name to the email subject, allowing recipients to quickly identify
4380what Gerrit instance the email came from.
4381+
4382The short name can be customized via the gerrit.instanceName option.
4383+
Luca Milanesiofdfca772018-04-04 23:42:32 +01004384Defaults to false.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004385
4386
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004387[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004388=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004389
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004390[[site.allowOriginRegex]]site.allowOriginRegex::
4391+
4392List of regular expressions matching origins that should be permitted
Shawn Pearce53ebad42017-06-10 11:14:20 -07004393to use the full Gerrit REST API. These should be trusted applications,
4394as the sites may be able to use the user's credentials. Applies to
4395all requests, including state changing methods (PUT, DELETE, POST).
4396+
4397Expressions should not require trailing slash. For example a valid
4398pattern might be `https://build-status[.]example[.]com`.
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004399+
4400By default, unset, denying all cross-origin requests.
4401
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004402[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
4403+
4404If true the server checks the site header, footer and CSS files for
4405updated versions. If false, a server restart is required to change
4406any of these resources. Default is true, allowing automatic reloads.
4407
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004408[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004409=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07004410
4411Variables in section ssh-alias permit the site administrator to alias
4412another command from Gerrit or a plugin into the `gerrit` command
4413namespace. To alias `replication start` to `gerrit replicate`:
4414
4415----
4416[ssh-alias]
4417 replicate = replication start
4418----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004419
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004420[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004421=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07004422
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02004423[[sshd.enableCompression]]sshd.enableCompression::
4424+
4425In the general case, we want to disable transparent compression, since
4426the majority of our data transfer is highly compressed Git pack files
4427and we cannot make them any smaller than they already are.
4428+
4429However, if there are CPU in abundance and the server is reachable
4430through slow networks, gits with huge amount of refs can benefit from
4431SSH-compression since git does not compress the ref announcement during
4432handshake.
4433+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02004434Compression can be especially useful when Gerrit replicas are being used
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02004435for the larger clones and fetches and the master server mostly takes
4436small receive-packs.
4437+
4438By default, `false`.
4439
David Ostrovskye2921b62015-03-04 22:36:10 +01004440[[sshd.backend]]sshd.backend::
4441+
4442Starting from version 0.9.0 Apache SSHD project added support for NIO2
Orgad Shanehb7bb7352019-09-19 10:26:19 +03004443IoSession. To use the old MINA session the `backend` option must be set
4444to `MINA`.
David Ostrovskye2921b62015-03-04 22:36:10 +01004445+
Luca Milanesiofc1ed9c2016-03-01 18:28:36 +00004446By default, `NIO2`.
David Ostrovskye2921b62015-03-04 22:36:10 +01004447
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004448[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004449+
4450Specifies the local addresses the internal SSHD should listen
4451for connections on. The following forms may be used to specify
4452an address. In any form, `:'port'` may be omitted to use the
David Pursehousea3af2552016-08-02 14:04:44 +09004453default of `29418`.
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004454+
David Pursehousea3af2552016-08-02 14:04:44 +09004455* `'hostname':'port'` (for example `review.example.com:29418`)
4456* `'IPv4':'port'` (for example `10.0.0.1:29418`)
4457* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
4458* `+*:'port'+` (for example `+*:29418+`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004459
4460+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004461--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004462If multiple values are supplied, the daemon will listen on all
4463of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004464
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07004465To disable the internal SSHD, set listenAddress to `off`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004466
David Pursehousea3af2552016-08-02 14:04:44 +09004467By default, `*:29418`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004468--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004469
James Y Knight910bd862011-01-11 20:05:56 -05004470[[sshd.advertisedAddress]]sshd.advertisedAddress::
4471+
4472Specifies the addresses clients should be told to connect to.
4473This may differ from sshd.listenAddress if a firewall based port
4474redirector is being used, making Gerrit appear to answer on port
447522. The following forms may be used to specify an address. In any
4476form, `:'port'` may be omitted to use the default SSH port of 22.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004477
David Pursehousea3af2552016-08-02 14:04:44 +09004478* `'hostname':'port'` (for example `review.example.com:22`)
4479* `'IPv4':'port'` (for example `10.0.0.1:29418`)
4480* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
James Y Knight910bd862011-01-11 20:05:56 -05004481
4482+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004483--
James Y Knight910bd862011-01-11 20:05:56 -05004484If multiple values are supplied, the daemon will advertise all
4485of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004486
David Pursehousea3af2552016-08-02 14:04:44 +09004487By default uses the value of `sshd.listenAddress`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004488--
James Y Knight910bd862011-01-11 20:05:56 -05004489
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004490[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07004491+
4492If true, enables TCP keepalive messages to the other side, so
4493the daemon can terminate connections if the peer disappears.
4494+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02004495Only effective when `sshd.backend` is set to `MINA`.
4496+
David Pursehousea3af2552016-08-02 14:04:44 +09004497By default, `true`.
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07004498
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004499[[sshd.threads]]sshd.threads::
4500+
4501Number of threads to use when executing SSH command requests.
4502If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09004503are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004504+
Florian Klink2a389462019-07-23 14:14:32 +02004505By default, 2x the number of CPUs available to the JVM (but at least 4
4506threads).
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02004507+
4508[NOTE]
4509When SSH daemon is enabled then this setting also defines the max number of
4510concurrent Git requests for interactive users over SSH and HTTP together.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004511
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004512[[sshd.batchThreads]]sshd.batchThreads::
4513+
4514Number of threads to allocate for SSH command requests from
Fredrik Luthander46843022012-03-13 16:11:02 +01004515link:access-control.html#non-interactive_users[non-interactive users].
4516If equals to 0, then all non-interactive requests are executed in the same
4517queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004518+
4519Any other value will remove the number of threads from the queue
4520allocated to interactive users, and create a separate thread pool
4521of the requested size, which will be used to run commands from
4522non-interactive users.
4523+
4524If the number of threads requested for non-interactive users is larger
4525than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09004526value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004527+
Dariusz Luksza145de472015-11-09 18:44:35 +01004528By default is 1 on single core node, 2 otherwise.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02004529+
4530[NOTE]
4531When SSH daemon is enabled then this setting also defines the max number of
4532concurrent Git requests for batch users over SSH and HTTP together.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004533
Kenny Root15ac1b82010-02-24 00:29:20 -08004534[[sshd.streamThreads]]sshd.streamThreads::
4535+
4536Number of threads to use when formatting events to asynchronous
4537streaming clients. Event formatting is multiplexed onto this thread
4538pool by a simple FIFO scheduling system.
4539+
4540By default, 1 plus the number of CPUs available to the JVM.
4541
Edwin Kempinb5df3b82011-10-10 11:31:14 +02004542[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07004543+
4544Number of threads used to parse a command line submitted by a client
4545over SSH for execution, create the internal data structures used by
4546that command, and schedule it for execution on another thread.
4547+
4548By default, 2.
4549
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004550[[sshd.maxAuthTries]]sshd.maxAuthTries::
4551+
4552Maximum number of authentication attempts before the server
4553disconnects the client. Each public key that a client has loaded
4554into its local agent counts as one auth request. Users can work
4555around the server's limit by loading less keys into their agent,
4556or selecting a specific key in their `~/.ssh/config` file with
4557the `IdentityFile` option.
4558+
4559By default, 6.
4560
4561[[sshd.loginGraceTime]]sshd.loginGraceTime::
4562+
4563Time in seconds that a client has to authenticate before the server
4564automatically terminates their connection. Values should use common
4565unit suffixes to express their setting:
4566+
4567* s, sec, second, seconds
4568* m, min, minute, minutes
4569* h, hr, hour, hours
4570* d, day, days
4571
4572+
4573By default, 2 minutes.
4574
Christian Aistleitner3d794592013-04-08 00:19:40 +02004575[[sshd.idleTimeout]]sshd.idleTimeout::
4576+
4577Time in seconds after which the server automatically terminates idle
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00004578connections (or 0 to disable closing of idle connections) not waiting for
4579any server operation to complete.
4580Values should use common unit suffixes to express their setting:
Christian Aistleitner3d794592013-04-08 00:19:40 +02004581+
4582* s, sec, second, seconds
4583* m, min, minute, minutes
4584* h, hr, hour, hours
4585* d, day, days
4586
4587+
4588By default, 0.
4589
Paladox nonedaafdb62017-10-14 16:18:42 +00004590[[sshd.waitTimeout]]sshd.waitTimeout::
4591+
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00004592Time in seconds after which the server automatically terminates
4593connections waiting for a server operation to complete, like for instance
4594cloning a very large repo with lots of refs.
Paladox nonedaafdb62017-10-14 16:18:42 +00004595Values should use common unit 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, 30s.
4604
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004605[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
4606+
4607Maximum number of concurrent SSH sessions that a user account
4608may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09004609that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004610the number of commands a user may issue over a single connection.
4611If set to 0, there is no limit.
4612+
4613By default, 64.
4614
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004615[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004616+
4617Available ciphers. To permit multiple ciphers, specify multiple
4618`sshd.cipher` keys in the configuration file, one cipher name
4619per key. Cipher names starting with `+` are enabled in addition
4620to the default ciphers, cipher names starting with `-` are removed
4621from the default cipher set.
4622+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004623Supported ciphers:
4624+
4625* `aes128-ctr`
4626* `aes192-ctr`
4627* `aes256-ctr`
4628* `aes128-cbc`
4629* `aes192-cbc`
4630* `aes256-cbc`
4631* `blowfish-cbc`
4632* `3des-cbc`
4633* `arcfour128`
4634* `arcfour256`
4635* `none`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004636+
4637By default, all supported ciphers except `none` are available.
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004638+
4639If your setup allows for it, it's recommended to disable all ciphers except
4640the AES-CTR modes.
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004641
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004642[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004643+
4644Available MAC (message authentication code) algorithms. To permit
4645multiple algorithms, specify multiple `sshd.mac` keys in the
4646configuration file, one MAC per key. MAC names starting with `+`
4647are enabled in addition to the default MACs, MAC names starting with
4648`-` are removed from the default MACs.
4649+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004650Supported MACs:
4651+
4652* `hmac-md5`
4653* `hmac-md5-96`
4654* `hmac-sha1`
4655* `hmac-sha1-96`
4656* `hmac-sha2-256`
4657* `hmac-sha2-512`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004658+
4659By default, all supported MACs are available.
4660
Scott Dialb4a04fa2016-03-15 09:44:11 -04004661[[sshd.kex]]sshd.kex::
4662+
4663--
4664Available key exchange algorithms. To permit multiple algorithms,
4665specify multiple `sshd.kex` keys in the configuration file, one key
4666exchange algorithm per key. Key exchange algorithm names starting
4667with `+` are enabled in addition to the default key exchange
4668algorithms, key exchange algorithm names starting with `-` are
4669removed from the default key exchange algorithms.
4670
4671In the following example configuration, support for the 1024-bit
4672`diffie-hellman-group1-sha1` key exchange is disabled while leaving
4673all of the other default algorithms enabled:
4674
4675----
4676[sshd]
4677 kex = -diffie-hellman-group1-sha1
4678----
4679
4680Supported key exchange algorithms:
4681
4682* `ecdh-sha2-nistp521`
4683* `ecdh-sha2-nistp384`
4684* `ecdh-sha2-nistp256`
4685* `diffie-hellman-group-exchange-sha256`
4686* `diffie-hellman-group-exchange-sha1`
4687* `diffie-hellman-group14-sha1`
4688* `diffie-hellman-group1-sha1`
4689
4690By default, all supported key exchange algorithms are available.
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004691
4692It is strongly recommended to disable at least `diffie-hellman-group1-sha1`
4693as it's known to be vulnerable (logjam attack). Additionally, if your setup
4694allows for it, it is recommended to disable the remaining two `sha1` key
4695exchange algorithms.
Scott Dialb4a04fa2016-03-15 09:44:11 -04004696--
4697
Alex Blewitt7efb06f2013-04-01 12:46:48 -04004698[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
4699+
4700Enable kerberos authentication for SSH connections. To permit
4701kerberos authentication, the server must have a host principal
4702(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
4703This must be provisioned by the kerberos administrators, and is
4704typically installed into `/etc/krb5.keytab` on host machines.
4705+
4706The keytab must contain at least one `host/` principal, typically
4707using the host's canonical name. If it does not use the
4708canonical name, the `sshd.kerberosPrincipal` should be configured
4709with the correct name.
4710+
4711By default, not set and so kerberos authentication is not enabled.
4712
4713[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
4714+
4715If kerberos authentication is enabled with `sshd.kerberosKeytab`,
4716instead use the given principal name instead of the default.
4717If the principal does not begin with `host/` a warning message is
4718printed and may prevent successful authentication.
4719+
4720This may be useful if the host is behind an IP load balancer or
4721other SSH forwarding systems, since the principal name is constructed
4722by the client and must match for kerberos authentication to work.
4723+
4724By default, `host/canonical.host.name`
4725
Shawn Pearce318bfca2013-10-17 22:15:38 -07004726[[sshd.requestLog]]sshd.requestLog::
4727+
4728Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
4729If enabled, a request log file is written out by the SSH daemon.
4730+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01004731`log4j.appender` with the name `sshd_log` can be configured to overwrite
4732programmatic configuration.
4733+
David Pursehousea3af2552016-08-02 14:04:44 +09004734By default, `true`.
Gustaf Lundh4e859932018-04-16 10:56:31 +02004735+
Sven Selberg2a0beab2018-04-20 14:49:20 +02004736This value supports link:#reloadConfig[configuration reloads].
Shawn Pearce318bfca2013-10-17 22:15:38 -07004737
David Ostrovsky985201b2015-03-04 22:37:33 +01004738[[sshd.rekeyBytesLimit]]sshd.rekeyBytesLimit::
4739+
4740The SSH daemon will issue a rekeying after a certain amount of data.
4741This configuration option allows you to tweak that setting.
4742+
4743By default, 1073741824 (bytes, 1GB).
4744+
David Pursehousea3af2552016-08-02 14:04:44 +09004745The `rekeyBytesLimit` cannot be set to lower than 32.
David Ostrovsky985201b2015-03-04 22:37:33 +01004746
4747[[sshd.rekeyTimeLimit]]sshd.rekeyTimeLimit::
4748+
4749The SSH daemon will issue a rekeying after a certain amount of time.
4750This configuration option allows you to tweak that setting.
4751+
4752By default, 1h.
4753+
4754Set to 0 to disable this check.
4755
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004756[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004757=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07004758
Sven Selberg42d9d292014-08-13 11:20:11 +02004759[[suggest.maxSuggestedReviewers]]suggest.maxSuggestedReviewers::
4760+
4761The maximum numbers of reviewers suggested.
4762+
4763By default 10.
Gustaf Lundh25e608f2018-04-16 10:54:53 +02004764+
Sven Selberg2a0beab2018-04-20 14:49:20 +02004765This value supports link:#reloadConfig[configuration reloads].
Sven Selberg42d9d292014-08-13 11:20:11 +02004766
Edwin Kempinf957dc22012-10-19 20:41:18 +02004767[[suggest.from]]suggest.from::
4768+
4769The number of characters that a user must have typed before suggestions
Patrick Hiesel87880b02016-05-03 18:15:08 +02004770are provided. If set to 0, suggestions are always provided. This is only
4771used for suggesting accounts when adding members to a group.
Edwin Kempinf957dc22012-10-19 20:41:18 +02004772+
4773By default 0.
4774
Edwin Kempin0a49eca2019-06-21 09:38:46 +02004775[[tracing]]
4776=== Section tracing
4777
4778[[tracing.performanceLogging]]tracing.performanceLogging::
4779+
4780Whether performance logging is enabled.
4781+
4782When performance logging is enabled, performance events for some
4783operations are collected in memory while a request is running. At the
4784end of the request the performance events are handed over to the
4785link:dev-plugins.html#performance-logger[PerformanceLogger] plugins.
4786This means if performance logging is enabled, the memory footprint of
4787requests is slightly increased.
4788+
4789This setting has no effect if no
4790link:dev-plugins.html#performance-logger[PerformanceLogger] plugins are
4791installed, because then performance logging is always disabled.
4792+
4793By default, true.
4794
Edwin Kempin2cba2982019-07-05 13:19:43 +02004795[[tracing.traceid]]
4796==== Subsection tracing.<trace-id>
4797
4798There can be multiple `tracing.<trace-id>` subsections to configure
4799automatic tracing of requests. To be traced a request must match all
4800conditions of one `tracing.<trace-id>` subsection. The subsection name
4801is used as trace ID. Using this trace ID administrators can find
4802matching log entries.
4803
4804[[tracing.traceid.requestType]]tracing.<trace-id>.requestType::
4805+
4806Type of request for which request tracing should be always enabled (can
4807be `GIT_RECEIVE`, `GIT_UPLOAD`, `REST` and `SSH`).
4808+
4809May be specified multiple times.
4810+
4811By default, unset (all request types are matched).
4812
Edwin Kempinb0ddb0b2019-07-08 12:11:32 +02004813[[tracing.traceid.requestUriPattern]]tracing.<trace-id>.requestUriPattern::
4814+
4815Regular expression to match request URIs for which request tracing
4816should be always enabled. Request URIs are only available for REST
4817requests. Request URIs never include the '/a' prefix.
4818+
4819May be specified multiple times.
4820+
4821By default, unset (all request URIs are matched).
4822
Edwin Kempin2cba2982019-07-05 13:19:43 +02004823[[tracing.traceid.account]]tracing.<trace-id>.account::
4824+
4825Account ID of an account for which request tracing should be always
4826enabled.
4827+
4828May be specified multiple times.
4829+
4830By default, unset (all accounts are matched).
4831
4832[[tracing.traceid.projectPattern]]tracing.<trace-id>.projectPattern::
4833+
4834Regular expression to match project names for which request tracing
4835should be always enabled.
4836+
4837May be specified multiple times.
4838+
4839By default, unset (all projects are matched).
4840
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004841[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004842=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07004843
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07004844Tagged footer lines containing references to external
4845tracking systems, parsed out of the commit message and
David Pursehoused55a6b62015-02-27 17:39:38 +09004846saved in Gerrit's secondary index.
Shawn Pearceff61c8a2013-10-07 19:35:53 -07004847
4848After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08004849must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07004850
Edwin Kempinbb421f12011-08-25 11:19:00 +02004851The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07004852bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07004853
4854----
4855[trackingid "jira-bug"]
4856 footer = Bugfix:
David Pursehousece7f6862015-02-19 14:52:45 +09004857 footer = Bug:
Goran Lungberg04132a12010-06-15 17:20:37 -07004858 match = JRA\\d{2,8}
4859 system = JIRA
4860
4861[trackingid "jira-feature"]
4862 footer = Feature
4863 match = JRA(\\d{2,8})
4864 system = JIRA
4865----
4866
4867[[trackingid.name.footer]]trackingid.<name>.footer::
4868+
David Pursehousece7f6862015-02-19 14:52:45 +09004869A prefix tag that identifies the footer line to parse for tracking ids.
4870+
4871Several trackingid entries can have the same footer tag, and a single trackingid
4872entry can have multiple footer tags.
4873+
4874If multiple footer tags are specified, each tag will be parsed separately and
4875duplicates will be ignored.
4876+
4877The trailing ":" is optional.
Goran Lungberg04132a12010-06-15 17:20:37 -07004878
4879[[trackingid.name.match]]trackingid.<name>.match::
4880+
Magnus Bäcke5611832011-02-02 08:57:15 +01004881A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
4882Java regular expression (java.util.regex)] used to match the
4883external tracking id part of the footer line. The match can
4884result in several entries in the DB. If grouping is used in the
4885regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01004886Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07004887+
4888The configuration file parser eats one level of backslashes, so the
4889character class `\s` requires `\\s` in the configuration file. The
4890parser also terminates the line at the first `#`, so a match
4891expression containing # must be wrapped in double quotes.
4892
4893[[trackingid.name.system]]trackingid.<name>.system::
4894+
David Pursehouse221d4f62012-06-08 17:38:08 +09004895The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07004896It is possible to have several trackingid entries for the same
4897tracking system.
4898
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004899[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004900=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07004901
4902[[transfer.timeout]]transfer.timeout::
4903+
4904Number of seconds to wait for a single network read or write
4905to complete before giving up and declaring the remote side is
4906not responding. If 0, there is no timeout, and this server will
4907wait indefinitely for a transfer to finish.
4908+
4909A timeout should be large enough to mostly transfer the objects to
4910the other side. 1 second may be too small for larger projects,
4911especially over a WAN link, while 10-30 seconds is a much more
4912reasonable timeout value.
4913+
4914Defaults to 0 seconds, wait indefinitely.
4915
lincoln2be11602010-07-05 10:53:25 -03004916
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004917[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004918=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004919
Dave Borowitzb1795142017-10-12 07:13:37 -07004920Options to control the behavior of `upload-pack` on the server side,
4921which handles a user's fetch, clone, or repo sync command.
lincoln2be11602010-07-05 10:53:25 -03004922
4923----
4924[upload]
4925 allowGroup = GROUP_ALLOWED_TO_EXECUTE
4926 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
4927----
4928
4929[[upload.allowGroup]]upload.allowGroup::
4930+
Dave Borowitzb1795142017-10-12 07:13:37 -07004931Name of the groups of users that are allowed to execute 'upload-pack'.
4932One or more groups can be set.
lincoln2be11602010-07-05 10:53:25 -03004933+
4934If no groups are added, any user will be allowed to execute
4935'upload-pack' on the server.
4936
Owen Lie2877bb2017-07-14 09:11:20 -04004937[[accountDeactivation]]
4938=== Section accountDeactivation
4939
4940Configures the parameters for the scheduled task to sweep and deactivate Gerrit
4941accounts according to their status reported by the auth backend. Currently only
4942supported for LDAP backends.
4943
4944[[accountDeactivation.startTime]]accountDeactivation.startTime::
4945+
Edwin Kempind33d95a2018-02-16 11:44:04 +01004946The link:#schedule-configuration-startTime[start time] for running
4947account deactivations.
Owen Lie2877bb2017-07-14 09:11:20 -04004948
4949[[accountDeactivation.interval]]accountDeactivation.interval::
4950+
Edwin Kempind33d95a2018-02-16 11:44:04 +01004951The link:#schedule-configuration-interval[interval] for running
4952account deactivations.
4953
4954link:#schedule-configuration-examples[Schedule examples] can be found
4955in the link:#schedule-configuration[Schedule Configuration] section.
Owen Lie2877bb2017-07-14 09:11:20 -04004956
Stefan Beller0f724ff2015-07-17 10:17:51 -07004957[[submodule]]
4958=== Section submodule
4959
Shawn Pearcedc477cd2016-03-24 19:56:18 -07004960[[submodule.verbosesuperprojectupdate]]submodule.verboseSuperprojectUpdate::
Stefan Beller0f724ff2015-07-17 10:17:51 -07004961+
4962When using link:user-submodules.html#automatic_update[automatic superproject updates]
Zhen Chenc877ca92016-07-27 14:22:37 -07004963this option will determine how the submodule commit messages are included into
Stefan Beller0f724ff2015-07-17 10:17:51 -07004964the commit message of the superproject update.
4965+
Zhen Chenc877ca92016-07-27 14:22:37 -07004966If `FALSE`, will not include any commit messages for the gitlink update.
4967+
4968If `SUBJECT_ONLY`, will include only the commit subjects.
4969+
4970If `TRUE`, will include full commit messages.
4971+
4972By default this is `TRUE`.
Stefan Beller0f724ff2015-07-17 10:17:51 -07004973
Shawn Pearcedc477cd2016-03-24 19:56:18 -07004974[[submodule.enableSuperProjectSubscriptions]]submodule.enableSuperProjectSubscriptions::
Stefan Beller8cc252e2016-03-10 10:06:53 -08004975+
4976This allows to enable the superproject subscription mechanism.
4977+
4978By default this is true.
Stefan Beller0f724ff2015-07-17 10:17:51 -07004979
Patrick Hiesel44e5d6e2017-08-24 16:07:26 +02004980[[submodule.maxCombinedCommitMessageSize]]submodule.maxCombinedCommitMessageSize::
4981+
4982This allows to limit the length of the commit message for a submodule.
4983+
4984By default this is 262144 (256 KiB).
4985+
4986Common unit suffixes of k, m, or g are supported.
4987
4988[[submodule.maxCommitMessages]]submodule.maxCommitMessages::
4989+
4990This allows to limit the number of commit messages that should be combined when creating
4991a commit message for a submodule.
4992+
4993By default this is 1000.
4994
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004995[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004996=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07004997
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004998[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07004999+
5000Name that Gerrit calls itself in Git when it creates a new Git
5001commit, such as a merge during change submission.
5002+
5003By default this is "Gerrit Code Review".
5004
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005005[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005006+
5007Email address that Gerrit refers to itself as when it creates a
5008new Git commit, such as a merge commit during change submission.
5009+
5010If not set, Gerrit generates this as "gerrit@`hostname`", where
5011`hostname` is the hostname of the system Gerrit is running on.
5012+
5013By default, not set, generating the value at startup.
5014
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005015[[user.anonymousCoward]]user.anonymousCoward::
5016+
David Pursehousea1d633b2014-05-02 17:21:02 +09005017Username that is displayed in the Gerrit Web UI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005018notifications if the full name of the user is not set.
5019+
Han-Wen Nienhuys3fb723d2017-11-20 19:21:13 +01005020By default "Name of user not set" is used.
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005021
Edwin Kempind33d95a2018-02-16 11:44:04 +01005022[[schedule-configuration]]
5023=== Schedule Configuration
5024
5025Schedule configurations are used for running periodic background jobs.
5026
5027A schedule configuration consists of two parameters:
5028
5029[[schedule-configuration-interval]]
5030* `interval`:
5031Interval for running the periodic background job. The interval must be
5032larger than zero. The following suffixes are supported to define the
5033time unit for the interval:
5034** `s`, `sec`, `second`, `seconds`
5035** `m`, `min`, `minute`, `minutes`
5036** `h`, `hr`, `hour`, `hours`
5037** `d`, `day`, `days`
5038** `w`, `week`, `weeks` (`1 week` is treated as `7 days`)
5039** `mon`, `month`, `months` (`1 month` is treated as `30 days`)
5040** `y`, `year`, `years` (`1 year` is treated as `365 days`)
5041
5042[[schedule-configuration-startTime]]
5043* `startTime`:
5044The start time defines the first execution of the periodic background
5045job. If the configured `interval` is shorter than `startTime - now` the
5046start time will be preponed by the maximum integral multiple of
5047`interval` so that the start time is still in the future. `startTime`
5048must have one of the following formats:
5049
5050** `<day of week> <hours>:<minutes>`
5051** `<hours>:<minutes>`
5052
5053+
5054The placeholders can have the following values:
5055
5056*** `<day of week>`:
5057`Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`
5058*** `<hours>`:
5059`00`-`23`
5060*** `<minutes>`:
5061`00`-`59`
5062
5063+
5064The time zone cannot be specified but is always the system default
David Pursehouse18f388a2019-04-10 09:36:18 +09005065time zone. Hours must be zero-padded, i.e. `06:00` rather than `6:00`.
Edwin Kempind33d95a2018-02-16 11:44:04 +01005066
5067The section (and optionally the subsection) in which the `interval` and
5068`startTime` keys must be set depends on the background job for which a
5069schedule should be configured. E.g. for the change cleanup job the keys
5070must be set in the link:#changeCleanup[changeCleanup] section:
5071
5072----
5073 [changeCleanup]
5074 startTime = Fri 10:30
5075 interval = 2 days
5076----
5077
5078[[schedule-configuration-examples]]
5079Examples for a schedule configuration:
5080
5081* Example 1:
5082+
5083----
5084 startTime = Fri 10:30
5085 interval = 2 days
5086----
5087+
5088Assuming that the server is started on `Mon 07:00` then
5089`startTime - now` is `4 days 3:30 hours`. This is larger than the
5090interval hence the start time is preponed by the maximum integral
5091multiple of the interval so that start time is still in the future,
5092i.e. preponed by 4 days. This yields a start time of `Mon 10:30`, next
5093executions are `Wed 10:30`, `Fri 10:30`. etc.
5094
5095* Example 2:
5096+
5097----
5098 startTime = 06:00
5099 interval = 1 day
5100----
5101+
5102Assuming that the server is started on `Mon 07:00` then this yields the
5103first run on Tuesday at 06:00 and a repetition interval of 1 day.
5104
Dave Borowitzd4fdc932018-11-02 15:06:25 -07005105[[All-Projects-project.config]]
5106== File `etc/All-Projects/project.config`
5107
5108The optional file `'$site_path'/etc/All-Projects/project.config` provides
5109defaults for configuration read from
5110link:config-project-config.html[`project.config`] in the
5111`All-Projects` repo. Unlike `gerrit.config`, this file contains project-type
5112configuration rather than server-type configuration.
5113
5114Most administrators will not need this file, and should instead make commits to
5115`All-Projects` to modify global config. However, a separate file can be useful
5116when managing multiple Gerrit servers, since pushing changes to defaults using
5117Puppet or a similar tool can be easier than scripting git updates to
5118`All-Projects`.
5119
5120The contents of the file are loaded each time the `All-Projects` project is
5121reloaded. Updating the file requires either evicting the project cache or
5122restarting the server.
5123
5124Caveats:
5125
5126* The path from which the file is read corresponds to the name of the repo,
5127 which is link:#gerrit.allProjects[configurable].
5128* Although the file lives in a directory that shares a name with a repository,
5129 this directory is not a Git repository.
5130* Only the file `project.config` is read from this directory to provide
5131 defaults; any other files in this directory, such as `rules.pl`, are ignored.
5132 (This behavior may change in the future.)
5133* Group names listed in the access config in this file are resolved to UUIDs
5134 using the `groups` file in the repository, not in the config directory. As a
5135 result, setting ACLs in this file is not recommended.
5136
Hector Oswaldo Caballero98952b02017-08-24 06:31:28 -04005137[[secure.config]]
5138== File `etc/secure.config`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005139
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005140The optional file `'$site_path'/etc/secure.config` overrides (or
5141supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005142The file should be readable only by the daemon process and can be
5143used to contain private configuration entries that wouldn't normally
5144be exposed to everyone.
5145
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005146Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005147----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07005148[auth]
5149 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
5150
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005151[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005152 username = webuser
5153 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005154
5155[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005156 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005157
5158[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005159 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005160
5161[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005162 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07005163
5164[remote "bar"]
5165 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005166----
5167
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005168== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01005169
5170The optional file `'$site_path'/etc/peer_keys` controls who can
5171login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
5172command.
5173
5174The format is one Base-64 encoded public key per line.
5175
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005176=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005177
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005178site_path::
5179+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005180Local filesystem directory holding the site customization assets.
5181Placing this directory under version control and/or backup is a
5182good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005183+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005184Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005185+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005186Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005187+
Dave Borowitz1e49e142013-04-09 12:14:57 -07005188* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005189
Saša Živkovd34dfe32017-11-20 11:14:35 +01005190[[jgitConfig]]
5191== File `etc/jgit.config`
5192
5193Gerrit uses the `$site_path/etc/jgit.config` file instead of the
5194system-wide and user-global Git configuration for its runtime JGit
5195configuration.
5196
5197Sample `etc/jgit.config` file:
5198----
5199[core]
5200 trustFolderStat = false
5201----
5202
Shawn O. Pearce5500e692009-05-28 15:55:01 -07005203GERRIT
5204------
5205Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07005206
5207SEARCHBOX
5208---------