blob: dd7fa02db2d5ac2a95b88627b153f225745fd382 [file] [log] [blame]
Marian Harbachebeb1542019-12-13 10:42:46 +01001:linkattrs:
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002= Gerrit Code Review - Configuration
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08003
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004== File `etc/gerrit.config`
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07005
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08006The optional file `'$site_path'/etc/gerrit.config` is a Git-style
7config file that controls many host specific settings for Gerrit.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07008
9[NOTE]
Shawn O. Pearcec5fed822009-11-17 16:10:10 -080010The contents of the `etc/gerrit.config` file are cached at startup
Sven Selberg2a0beab2018-04-20 14:49:20 +020011by Gerrit. For most properties, if they are modified in this file, Gerrit
12needs to be restarted before it will use the new values. Some properties
David Pursehousec5286212019-10-21 20:50:17 +090013support being link:#reloadConfig[`reloaded`] without restart.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070014
Shawn O. Pearcec5fed822009-11-17 16:10:10 -080015Sample `etc/gerrit.config`:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070016----
17[core]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080018 packedGitLimit = 200 m
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070019
20[cache]
David Pursehouse64df83a2017-07-04 21:20:47 +090021 directory = /var/cache/gerrit
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070022----
23
Sven Selberg2a0beab2018-04-20 14:49:20 +020024[[reloadConfig]]
25=== Reload `etc/gerrit.config`
26Some properties support being reloaded without restart when a `reload config`
27command is issued through link:cmd-reload-config.html[`SSH`] or the
28link:rest-api-config.html#reload-config[`REST API`]. If a property supports
29this it is specified in the documentation for the property below.
30
31
Hongkai Liu49799b22017-04-07 16:54:25 -040032[[accountPatchReviewDb]]
33=== Section accountPatchReviewDb
34
Gert van Dijk49c56132017-10-17 23:44:25 +020035The AccountPatchReviewDb is a database used to store the user file reviewed
David Pursehousee3eaf9e2019-02-01 10:41:20 +090036flags.
Gert van Dijk49c56132017-10-17 23:44:25 +020037
Hongkai Liu49799b22017-04-07 16:54:25 -040038[[accountPatchReviewDb.url]]accountPatchReviewDb.url::
39+
Wendy Wang1dd445d2023-09-04 14:00:27 +020040The url of accountPatchReviewDb. Supported types are `CLOUDSPANNER`, `H2`,
41`POSTGRESQL`, `MARIADB`, and `MYSQL`. Drop the driver jar in the lib folder of
42the site path if the Jdbc driver of the corresponding Database is not yet in
43the class path.
Hongkai Liu49799b22017-04-07 16:54:25 -040044+
45Default is to create H2 database in the db folder of the site path.
46+
47Changing this parameter requires to migrate database using the
Hugo Arès3e1d4cd2017-04-26 12:02:53 +020048link:pgm-MigrateAccountPatchReviewDb.html[MigrateAccountPatchReviewDb] program.
49Migration cannot be done while the server is running.
Paladox none1a4c01f2017-04-29 18:19:37 +000050+
Dave Borowitzada289c2018-12-18 13:24:14 -080051Also note that the db_name has to be a new db and not reusing an old ReviewDb
52database from a former 2.x site, otherwise gerrit's init will remove the table.
Hongkai Liu49799b22017-04-07 16:54:25 -040053
54----
55[accountPatchReviewDb]
56 url = jdbc:postgresql://<host>:<port>/<db_name>?user=<user>&password=<password>
57----
58
Hector Oswaldo Caballero8dead962017-08-08 05:30:06 -040059[[accountPatchReviewDb.poolLimit]]accountPatchReviewDb.poolLimit::
60+
61Maximum number of open database connections. If the server needs
62more than this number, request processing threads will wait up
63to <<accountPatchReviewDb.poolMaxWait, poolMaxWait>> seconds for a
64connection to be released before they abort with an exception.
65This limit must be several units higher than the total number of
66httpd and sshd threads as some request processing code paths may
67need multiple connections.
68+
69Default is <<sshd.threads, sshd.threads>>
70 + <<httpd.maxThreads, httpd.maxThreads>> + 2.
71+
72
73[[accountPatchReviewDb.poolMinIdle]]database.poolMinIdle::
74+
75Minimum number of connections to keep idle in the pool.
76Default is 4.
77+
78
79[[accountPatchReviewDb.poolMaxIdle]]accountPatchReviewDb.poolMaxIdle::
80+
81Maximum number of connections to keep idle in the pool. If there
82are more idle connections, connections will be closed instead of
83being returned back to the pool.
84Default is min(<<accountPatchReviewDb.poolLimit, accountPatchReviewDb.poolLimit>>, 16).
85+
86
87[[accountPatchReviewDb.poolMaxWait]]accountPatchReviewDb.poolMaxWait::
88+
89Maximum amount of time a request processing thread will wait to
90acquire a database connection from the pool. If no connection is
91released within this time period, the processing thread will abort
92its current operations and return an error to the client.
93Values should use common unit suffixes to express their setting:
94+
95* ms, milliseconds
96* s, sec, second, seconds
97* m, min, minute, minutes
98* h, hr, hour, hours
99
100+
Hector Oswaldo Caballero8dead962017-08-08 05:30:06 -0400101If a unit suffix is not specified, `milliseconds` is assumed.
Hector Oswaldo Caballero8dead962017-08-08 05:30:06 -0400102Default is `30 seconds`.
103
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800104[[accounts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800105=== Section accounts
Dave Borowitz45baa892012-02-23 16:43:05 -0800106
Matthias Sohnf3360662012-04-05 15:42:52 +0200107[[accounts.visibility]]accounts.visibility::
Dave Borowitz45baa892012-02-23 16:43:05 -0800108+
109Controls visibility of other users' dashboard pages and
110completion suggestions to web users.
111+
112If `ALL`, all users are visible to all other users, even
113anonymous users.
114+
115If `SAME_GROUP`, only users who are also members of a group the
116current user is a member of are visible.
117+
118If `VISIBLE_GROUP`, only users who are members of at least one group
119that is visible to the current user are visible.
120+
121If `NONE`, no users other than the current user are visible.
122+
123Default is `ALL`.
124
Ben Rohlfs99f16a12020-02-11 19:44:17 +0100125[[accounts.defaultDisplayName]]accounts.defaultDisplayName::
126+
127If a user account does not have a display name set, which is the normal
128case, then this configuration value chooses the strategy how to choose
129the display name. Note that this strategy is not applied by the backend.
130If the AccountInfo has the display name unset, then the client has to
131apply this strategy.
132+
133If `FULL_NAME`, then the (full) name of the user is chosen from
134link:rest-api-accounts.html#account-info[AccountInfo].
135+
136If `FIRST_NAME`, then the first word (i.e. everything until first
137whitespace character) of the (full) name of the user is chosen from
138link:rest-api-accounts.html#account-info[AccountInfo].
139+
140If `USERNAME`, then the username of the user is chosen from
141link:rest-api-accounts.html#account-info[AccountInfo]. If that is not
142set, then the (full) name will be used.
143+
144Default is `FULL_NAME`.
145
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800146[[addreviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800147=== Section addreviewer
Edwin Kempin49cb3e12011-06-29 14:35:14 +0200148
149[[addreviewer.maxWithoutConfirmation]]addreviewer.maxWithoutConfirmation::
150+
151The maximum number of reviewers a user can add at once by adding a
152group as reviewer without being asked to confirm the operation.
153+
154If set to 0, the user will never be asked to confirm adding a group
155as reviewer.
156+
157Default is 10.
Edwin Kempin5e65d9b2011-07-08 07:35:48 +0200158+
David Pursehousea1d633b2014-05-02 17:21:02 +0900159This setting only applies for adding reviewers in the Gerrit Web UI,
Edwin Kempin5e65d9b2011-07-08 07:35:48 +0200160but is ignored when adding reviewers with the
Edwin Kempin33e92d02011-07-11 22:00:57 +0200161link:cmd-set-reviewers.html[set-reviewers] command.
Gustaf Lundh25e608f2018-04-16 10:54:53 +0200162+
Sven Selberg2a0beab2018-04-20 14:49:20 +0200163This value supports link:#reloadConfig[configuration reloads].
Edwin Kempin49cb3e12011-06-29 14:35:14 +0200164
165[[addreviewer.maxAllowed]]addreviewer.maxAllowed::
166+
167The maximum number of reviewers a user can add at once by adding a
168group as reviewer.
169+
170If set to 0, there is no limit for the number of reviewers that can
171be added at once by adding a group as reviewer.
172+
173Default is 20.
Gustaf Lundh25e608f2018-04-16 10:54:53 +0200174+
Sven Selberg2a0beab2018-04-20 14:49:20 +0200175This value supports link:#reloadConfig[configuration reloads].
Edwin Kempin49cb3e12011-06-29 14:35:14 +0200176
Patrick Hiesel87880b02016-05-03 18:15:08 +0200177[[addReviewer.baseWeight]]addReviewer.baseWeight::
178+
179The weight that will be applied in the default reviewer ranking algorithm.
180This can be increased or decreased to give more or less influence to plugins.
181If set to zero, the base ranking will not have any effect. Reviewers will then
182be ordered as ranked by the plugins (if there are any).
183+
184By default 1.
185
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800186[[auth]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800187=== Section auth
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700188
189See also link:config-sso.html[SSO configuration].
190
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700191[[auth.type]]auth.type::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700192+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700193Type of user authentication employed by Gerrit. The supported
194values are:
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700195+
196* `OpenID`
197+
198The default setting. Gerrit uses any valid OpenID
199provider chosen by the end-user. For more information see
Marian Harbach34253372019-12-10 18:01:31 +0100200http://openid.net/[openid.net,role=external,window=_blank].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700201+
James E. Blairca8bc3b2011-12-21 18:12:26 +0000202* `OpenID_SSO`
203+
204Supports OpenID from a single provider. There is no registration
205link, and the "Sign In" link sends the user directly to the provider's
206SSO entry point.
207+
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700208* `HTTP`
209+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700210Gerrit relies upon data presented in the HTTP request. This includes
Edwin Kempinf1acbb82011-09-15 12:49:42 +0200211HTTP basic authentication, or some types of commercial single-sign-on
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700212solutions. With this setting enabled the authentication must
213take place in the web server or servlet container, and not from
214within Gerrit.
215+
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700216* `HTTP_LDAP`
217+
218Exactly like `HTTP` (above), but additionally Gerrit pre-populates
219a user's full name and email address based on information obtained
220from the user's account object in LDAP. The user's group membership
221is also pulled from LDAP, making any LDAP groups that a user is a
David Pursehouseef92bec2017-08-25 18:45:02 +0900222member of available as groups in Gerrit. Hence the `_LDAP` suffix in
223the name of this authentication type. Gerrit does NOT authenticate
224the user via LDAP.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700225+
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200226* `CLIENT_SSL_CERT_LDAP`
227+
228This authentication type is actually kind of SSO. Gerrit will configure
David Pursehouse221d4f62012-06-08 17:38:08 +0900229Jetty's SSL channel to request the client's SSL certificate. For this
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200230authentication to work a Gerrit administrator has to import the root
231certificate of the trust chain used to issue the client's certificate
232into the <review-site>/etc/keystore.
233After the authentication is done Gerrit will obtain basic user
234registration (name and email) from LDAP, and some group memberships.
David Pursehouseef92bec2017-08-25 18:45:02 +0900235Hence the `_LDAP` suffix in the name of this authentication type.
236Gerrit does NOT authenticate the user via LDAP.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200237This authentication type can only be used under hosted daemon mode, and
238the httpd.listenUrl must use https:// as the protocol.
Chulho Yangb72ff8f2013-07-04 02:35:53 -0400239Optionally, certificate revocation list file can be used
240at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200241+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700242* `LDAP`
243+
244Gerrit prompts the user to enter a username and a password, which
245it then verifies by performing a simple bind against the configured
246<<ldap.server,ldap.server>>. In this configuration the web server
247is not involved in the user authentication process.
248+
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800249The actual username used in the LDAP simple bind request is the
250account's full DN, which is discovered by first querying the
251directory using either an anonymous request, or the configured
Robin Rosenberga3baed02012-10-14 14:09:32 +0200252<<ldap.username,ldap.username>> identity. Gerrit can also use kerberos if
253<<ldap.authentication,ldap.authentication>> is set to `GSSAPI`.
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100254+
255If link:#auth.gitBasicAuthPolicy[`auth.gitBasicAuthPolicy`] is set to `HTTP`,
256the randomly generated HTTP password is used for authentication. On the other hand,
257if link:#auth.gitBasicAuthPolicy[`auth.gitBasicAuthPolicy`] is set to `HTTP_LDAP`,
258the password in the request is first checked against the HTTP password and, if
259it does not match, it is then validated against the LDAP password.
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -0700260Service users that are link:cmd-create-account.html[internal-only] are
261authenticated by their HTTP passwords.
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800262
263* `LDAP_BIND`
264+
265Gerrit prompts the user to enter a username and a password, which
266it then verifies by performing a simple bind against the configured
267<<ldap.server,ldap.server>>. In this configuration the web server
268is not involved in the user authentication process.
269+
David Pursehouse42f42042013-08-01 14:02:25 +0900270Unlike `LDAP` above, the username used to perform the LDAP simple bind
David Pursehouse1344f5b2013-08-09 17:35:47 +0900271request is the exact string supplied in the dialog by the user.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200272The configured <<ldap.username,ldap.username>> identity is not used to obtain
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800273account information.
274+
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200275* `OAUTH`
David Ostrovskye9707d82015-02-22 01:14:02 +0100276+
277OAuth is a protocol that lets external apps request authorization to private
278details in a user's account without getting their password. This is
279preferred over Basic Authentication because tokens can be limited to specific
280types of data, and can be revoked by users at any time.
281+
282Site owners have to register their application before getting started. Note
283that provider specific plugins must be used with this authentication scheme.
284+
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100285Git clients may send OAuth 2 access tokens instead of passwords in the Basic
286authentication header. Note that provider specific plugins must be installed to
287facilitate this authentication scheme. If multiple OAuth 2 provider plugins are
288installed one of them must be selected as default with the
289`auth.gitOAuthProvider` option.
290+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700291* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
292+
293*DO NOT USE*. Only for use in a development environment.
294+
295When this is the configured authentication method a hyperlink titled
296`Become` appears in the top right corner of the page, taking the
297user to a form where they can enter the username of any existing
298user account, and immediately login as that account, without any
David Ostrovsky7163dac2017-07-29 06:49:38 +0200299authentication taking place.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700300
301+
302By default, OpenID.
303
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700304[[auth.allowedOpenID]]auth.allowedOpenID::
305+
306List of permitted OpenID providers. A user may only authenticate
307with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse42f42042013-08-01 14:02:25 +0900308is set to `OpenID` (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700309+
Magnus Bäcke5611832011-02-02 08:57:15 +0100310Patterns may be either a
311link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +0100312Java regular expression (java.util.regex),role=external,window=_blank] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700313end with `$`) or be a simple prefix (any other string).
314+
315By default, the list contains two values, `http://` and `https://`,
316allowing users to authenticate with any OpenID provider.
317
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700318[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700319+
David Pursehouse221d4f62012-06-08 17:38:08 +0900320List of trusted OpenID providers. Only used if `auth.type` is
David Pursehouse42f42042013-08-01 14:02:25 +0900321set to `OpenID` (the default).
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700322+
323In order for a user to take advantage of permissions beyond those
324granted to the `Anonymous Users` and `Registered Users` groups,
325the user account must only have OpenIDs which match at least one
326pattern from this list.
327+
Magnus Bäcke5611832011-02-02 08:57:15 +0100328Patterns may be either a
329link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +0100330Java regular expression (java.util.regex),role=external,window=_blank] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700331end with `$`) or be a simple prefix (any other string).
332+
333By default, the list contains two values, `http://` and `https://`,
334allowing Gerrit to trust any OpenID it receives.
335
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100336[[auth.openIdDomain]]auth.openIdDomain::
337+
338List of allowed OpenID email address domains. Only used if
David Pursehouse42f42042013-08-01 14:02:25 +0900339`auth.type` is set to `OPENID` or `OPENID_SSO`.
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100340+
341Domain is case insensitive and must be in the same form as it
342appears in the email address, for example, "example.com".
343+
344By default, any domain is accepted.
345
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700346[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
347+
348Time in seconds before an OpenID provider must force the user
349to authenticate themselves again before authentication to this
350Gerrit server. Currently this is only a polite request, and users
351coming from providers that don't support the PAPE extension will
352be accepted anyway. In the future it may be enforced, rejecting
353users coming from providers that don't honor the max session age.
354+
355If set to 0, the provider will always force the user to authenticate
356(e.g. supply their password). Values should use common unit suffixes
357to express their setting:
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+
368Default is -1, permitting infinite time between authentications.
369
David Pursehouse5be35a32015-09-09 17:35:32 +0900370[[auth.registerEmailPrivateKey]]auth.registerEmailPrivateKey::
371+
372Private key to use when generating an email verification token.
373+
374If not set, a random key is generated when running the
375link:pgm-init.html[site initialization].
376
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700377[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
378+
379Time in seconds before an email verification token sent to a user in
380order to validate their email address expires.
381+
382* s, sec, second, seconds
383* m, min, minute, minutes
384* h, hr, hour, hours
385* d, day, days
386* w, week, weeks (`1 week` is treated as `7 days`)
387* mon, month, months (`1 month` is treated as `30 days`)
388* y, year, years (`1 year` is treated as `365 days`)
389
390+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800391Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700392
James E. Blairca8bc3b2011-12-21 18:12:26 +0000393[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
394+
David Pursehouse42f42042013-08-01 14:02:25 +0900395The SSO entry point URL. Only used if `auth.type` is set to
396`OpenID_SSO`.
James E. Blairca8bc3b2011-12-21 18:12:26 +0000397+
398The "Sign In" link will send users directly to this URL.
399
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700400[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700401+
402HTTP header to trust the username from, or unset to select HTTP basic
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100403authentication. Only used if `auth.type` is set to `HTTP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700404
Luca Milanesio384ed6c2013-07-30 09:10:07 +0100405[[auth.httpDisplaynameHeader]]auth.httpDisplaynameHeader::
406+
407HTTP header to retrieve the user's display name from. Only used if `auth.type`
408is set to `HTTP`.
409+
410If set, Gerrit trusts and enforces the user's full name using the HTTP header
411and disables the ability to manually modify the user's full name
412from the contact information page.
413
414[[auth.httpEmailHeader]]auth.httpEmailHeader::
415+
416HTTP header to retrieve the user's e-mail from. Only used if `auth.type`
417is set to `HTTP`.
418+
419If set, Gerrit trusts and enforces the user's e-mail using the HTTP header
420and disables the ability to manually modify or register other e-mails
421from the contact information page.
422
Luca Milanesio97d07352014-07-17 08:31:06 +0100423[[auth.httpExternalIdHeader]]auth.httpExternalIdHeader::
424+
425HTTP header to retrieve the user's external identification token.
426Only used if `auth.type` is set to `HTTP`.
427+
428If set, Gerrit adds the value contained in the HTTP header to the
429user's identity. Typical use is with a federated identity token from
430an external system (e.g. GitHub OAuth 2.0 authentication) where
431the user's auth token exchanged during authentication handshake
432needs to be used for authenticated communication to the external
433system later on.
434+
435Example: `auth.httpExternalIdHeader: X-GitHub-OTP`
436
Luca Milanesio5185b042013-07-27 22:03:06 +0100437[[auth.loginUrl]]auth.loginUrl::
438+
439URL to redirect a browser to after the end-user has clicked on the
David Pursehouse42f42042013-08-01 14:02:25 +0900440login link in the upper right corner. Only used if `auth.type` is set
441to `HTTP` or `HTTP_LDAP`.
Luca Milanesio5185b042013-07-27 22:03:06 +0100442Organizations using an enterprise single-sign-on solution may want to
443redirect the browser to the SSO product's sign-in page for completing the
444login process and validate their credentials.
445+
David Pursehouse42f42042013-08-01 14:02:25 +0900446If set, Gerrit allows anonymous access until the end-user performs the login
447and provides a trusted identity through the HTTP header.
Luca Milanesio5185b042013-07-27 22:03:06 +0100448If not set, Gerrit requires the HTTP header with a trusted identity
David Pursehouse42f42042013-08-01 14:02:25 +0900449and returns the error page 'LoginRedirect.html' if such a header is not
450present.
Luca Milanesio5185b042013-07-27 22:03:06 +0100451
452[[auth.loginText]]auth.loginText::
453+
David Pursehouse42f42042013-08-01 14:02:25 +0900454Text displayed in the loginUrl link. Only used if `auth.loginUrl` is set.
Luca Milanesio5185b042013-07-27 22:03:06 +0100455+
David Pursehouse42f42042013-08-01 14:02:25 +0900456If not set, the "Sign In" text is used.
Luca Milanesio5185b042013-07-27 22:03:06 +0100457
Luca Milanesio111e0b72013-08-15 18:56:42 +0100458[[auth.registerPageUrl]]auth.registerPageUrl::
459+
David Pursehouse268744b2013-08-17 15:32:11 +0900460URL of the registration page to use when a new user logs in to Gerrit for
461the first time. Used only when `auth.type` is set to `HTTP`.
Luca Milanesio111e0b72013-08-15 18:56:42 +0100462+
463If not set, the standard Gerrit registration page `/#/register/` is displayed.
464
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700465[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700466+
467URL to redirect a browser to after the end-user has clicked on the
468"Sign Out" link in the upper right corner. Organizations using an
469enterprise single-sign-on solution may want to redirect the browser
470to the SSO product's sign-out page.
471+
472If not set, the redirect returns to the list of all open changes.
473
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800474[[auth.registerUrl]]auth.registerUrl::
475+
476Target for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200477when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800478+
479If not set, no "Register" link is displayed.
480
Chad Horohoe65897082012-11-10 10:26:25 -0800481[[auth.registerText]]auth.registerText::
482+
483Text for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200484when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Chad Horohoe65897082012-11-10 10:26:25 -0800485+
486If not set, defaults to "Register".
487
David Pursehouse3d604492013-01-25 17:41:53 +0900488[[auth.editFullNameUrl]]auth.editFullNameUrl::
489+
490Target for the "Edit" button when the user is allowed to edit their
Edwin Kempin54093152015-05-08 10:50:35 +0200491full name. Used only when `auth.type` is `LDAP`, `LDAP_BIND` or
492`CUSTOM_EXTENSION`.
David Pursehouse3d604492013-01-25 17:41:53 +0900493
494[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
495+
David Pursehouse42f42042013-08-01 14:02:25 +0900496Target for the "Obtain Password" link. Used only when `auth.type` is
Edwin Kempin54093152015-05-08 10:50:35 +0200497`CUSTOM_EXTENSION`.
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700498
499[[auth.switchAccountUrl]]auth.switchAccountUrl::
David Pursehouse3d604492013-01-25 17:41:53 +0900500+
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700501URL to switch user identities and login as a different account than
502the currently active account. This is disabled by default except when
503`auth.type` is `OPENID` and `DEVELOPMENT_BECOME_ANY_ACCOUNT`. If set
504the "Switch Account" link is displayed next to "Sign Out".
505+
506When `auth.type` does not normally enable this URL administrators may
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700507set this to `login/`, allowing users to begin a new web session. This value
Ben Rohlfsda0a62b2021-04-26 17:02:19 +0200508is used as an href in the Gerrit web app, so absolute URLs like
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700509`https://someotherhost/login` work as well.
510+
Ben Rohlfsda0a62b2021-04-26 17:02:19 +0200511If a ${path} parameter is included, then the Gerrit web app will substitute the
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700512currently viewed path in the link. Be aware that this path will include
513a leading slash, so a value like this might be appropriate: `/login${path}`.
David Pursehouse3d604492013-01-25 17:41:53 +0900514
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000515[[auth.cookiePath]]auth.cookiePath::
516+
517Sets "path" attribute of the authentication cookie.
518+
519If not set, HTTP request's path is used.
520
Sammy Gillespie26873c02016-02-11 14:39:43 +0000521[[auth.cookieDomain]]auth.cookieDomain::
522+
523Sets "domain" attribute of the authentication cookie.
524+
525If not set, HTTP request's domain is used.
526
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000527[[auth.cookieSecure]]auth.cookieSecure::
528+
529Sets "secure" flag of the authentication cookie. If true, cookies
530will be transmitted only over HTTPS protocol.
531+
532By default, false.
533
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700534[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700535+
536Optional format string to construct user email addresses out of
David Pursehouse42f42042013-08-01 14:02:25 +0900537user login names. Only used if `auth.type` is `HTTP`, `HTTP_LDAP`
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700538or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700539+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700540This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700541with the login name. E.g. "\{0\}+gerrit@example.com" with a user
542login name of "foo" will produce "foo+gerrit@example.com" during
543the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700544+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700545If the site is using `HTTP_LDAP` or `LDAP`, using this option is
546discouraged. Setting `ldap.accountEmailAddress` and importing the
547email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700548
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700549[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700550+
551Controls whether or not the contributor agreement features are
552enabled for the Gerrit site. If enabled a user must complete a
553contributor agreement before they can upload changes.
554+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800555If enabled, the admin must also add one or more
556link:config-cla.html[contributor-agreement sections]
557in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700558`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700559more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700560+
561By default this is false (no agreements are used).
Fredrik Luthandera3cf3542012-07-04 16:55:35 -0700562+
563To enable the actual usage of contributor agreement the project
564specific config option in the `project.config` must be set:
Edwin Kempin7b640222022-12-08 16:24:10 +0100565link:config-project-config.html#receive.requireContributorAgreement[
566receive.requireContributorAgreement].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700567
Christian Halstricka3d88a52011-08-31 09:21:41 +0200568[[auth.trustContainerAuth]]auth.trustContainerAuth::
569+
570If true then it is the responsibility of the container hosting
571Gerrit to authenticate users. In this case Gerrit will blindly trust
572the container.
573+
574This parameter only affects git over http traffic. If set to false
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100575then Gerrit will do the authentication (using Basic authentication).
Christian Halstricka3d88a52011-08-31 09:21:41 +0200576+
577By default this is set to false.
578
Luca Milanesio42058842012-01-05 21:25:38 +0000579
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400580[[auth.gitBasicAuthPolicy]]auth.gitBasicAuthPolicy::
581+
David Pursehousef7a1c2a2017-08-25 19:12:54 +0900582When `auth.type` is `LDAP`, `LDAP_BIND` or `OAUTH`, it allows using either the generated
Luca Milanesio51edcb72017-03-06 11:59:55 +0000583HTTP password, the LDAP or OAUTH password, or a combination of HTTP and LDAP
584authentication, to authenticate Git over HTTP and REST API requests.
585The supported values are:
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400586+
587*`HTTP`
588+
David Pursehousee2920032017-08-25 19:12:21 +0900589Only the HTTP password is accepted when doing Git over HTTP and REST API requests.
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400590+
591*`LDAP`
592+
593Only the `LDAP` password is allowed when doing Git over HTTP and REST API
594requests.
595+
Luca Milanesio51edcb72017-03-06 11:59:55 +0000596*`OAUTH`
597+
David Pursehousee2920032017-08-25 19:12:21 +0900598Only the `OAUTH` authentication is allowed when doing Git over HTTP and REST API
Luca Milanesio51edcb72017-03-06 11:59:55 +0000599requests.
600+
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400601*`HTTP_LDAP`
602+
603The password in the request is first checked against the HTTP password and, if
604it does not match, it is then validated against the `LDAP` password.
605+
Luca Milanesio51edcb72017-03-06 11:59:55 +0000606By default this is set to `LDAP` when link:#auth.type[`auth.type`] is `LDAP`
607and `OAUTH` when link:#auth.type[`auth.type`] is `OAUTH`.
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400608Otherwise, the default value is `HTTP`.
Luca Milanesio1a918712021-05-06 20:20:48 +0100609+
610When gitBasicAuthPolicy is set to `LDAP` or `HTTP_LDAP` and the user
611is authenticating with the LDAP username/password, the Git client config
612needs to have `http.cookieFile` set to a local file, otherwise every
613single call would trigger a full LDAP authentication and groups resolution
614which could introduce a noticeable latency on the overall execution
615and produce unwanted load to the LDAP server.
Nasser Grainawic3b05342022-02-25 16:58:13 -0700616
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200617[[auth.gitOAuthProvider]]auth.gitOAuthProvider::
618+
619Selects the OAuth 2 provider to authenticate git over HTTP traffic with.
620+
621In general there is no way to determine from an access token alone, which
622OAuth 2 provider to address to verify that token, and the BasicAuth
623scheme does not support amending such details. If multiple OAuth provider
624plugins in a system offer support for git over HTTP authentication site
625administrators must configure, which one to use as default provider.
626In case the provider cannot be determined from a request the access token
627will be sent to the default provider for verification.
628+
629The value of this parameter must be the identifier of an OAuth 2 provider
630in the form `plugin-name:provider-name`. Consult the respective plugin
631documentation for details.
632
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200633[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
634+
635If set the username that is received to authenticate a git operation
636is converted to lower case for looking up the user account in Gerrit.
637+
638By setting this parameter a case insensitive authentication for the
639git operations can be achieved, if it is ensured that the usernames in
640Gerrit (scheme `username`) are stored in lower case (e.g. if the
641parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
642set to `${sAMAccountName.toLowerCase}`). It is important that for all
643existing accounts this username is already in lower case. It is not
644possible to convert the usernames of the existing accounts to lower
645case because this would break the access to existing per-user
Thomas Draebing85510402021-03-15 08:03:00 +0100646branches and Gerrit provides no tool to do such a conversion. Accounts
647created using the REST API or the `create-account` SSH command will
648be created with all lowercase characters, when this option is set.
Edwin Kempine7ae45c2018-09-20 09:57:15 +0200649+
650Setting this parameter to `true` will prevent all users from login that
651have a non-lower-case username.
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200652+
653This parameter only affects git over http and git over SSH traffic.
654+
655By default this is set to false.
656
Thomas Draebing29595cd2021-03-24 15:23:35 +0100657[[auth.userNameCaseInsensitive]]auth.userNameCaseInsensitive::
658+
659If set the username will be handled case insensitively but case preserving,
660i.e. a user can login with `johndoe` or `JohnDoe` for the same account
661created for `JohnDoe`. The form of the username used during account creation
662will be used wherever the username is displayed. Sandbox branches created
663for a user can also only be created for this original form.
664+
665Note, that this does not work for all existing accounts, if they were
666not originally created with all lowercase, since the note keys of the
667external IDs will not match the new scheme. For more details refer to
668the link:config-accounts.html#external-ids[External ID documentation].
669+
Thomas Draebing585197a2021-03-31 09:50:52 +0200670Gerrit provides the
Marcin Czech62f989f2021-11-16 21:54:43 +0100671link:pgm-ChangeExternalIdCaseSensitivity.html[offline]
672and the online link:externalid-case-insensitivity.html#online-migration[online]
673tools to migrate existing accounts to match the new scheme.
Thomas Draebing585197a2021-03-31 09:50:52 +0200674+
Thomas Draebing29595cd2021-03-24 15:23:35 +0100675Naturally, if there were two accounts only different in capitalization,
676e.g. `johndoe` and `JohnDoe`, the account `JohnDoe` will not be able
Thomas Draebing585197a2021-03-31 09:50:52 +0200677to authenticate anymore after setting this option. If such duplicate
678accounts exist the migration tool will fail, since the newly computed
679note name would be identical and thus conflict. These duplicates thus
680have to be deleted manually by deleting the respective external ID.
Thomas Draebing29595cd2021-03-24 15:23:35 +0100681+
Thomas Draebing350d8e32021-11-19 13:16:53 +0100682For newly initialized sites this option defaults to true.
683+
Thomas Draebing29595cd2021-03-24 15:23:35 +0100684Default is false.
685
Marcin Czech540a7a32021-10-29 16:07:39 +0200686[[auth.userNameCaseInsensitiveMigrationMode]]auth.userNameCaseInsensitiveMigrationMode::
687+
688Setting migration mode to true allows to fallback to case sensitive
689behaviour if the migrated external ID cannot be found. This allows to
690trigger the migration while Gerrit process is running.
691+
David Pursehouse21bd07b2015-11-27 00:15:42 +0900692Default is false.
693
694[[auth.enableRunAs]]auth.enableRunAs::
695+
696If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
Owen Lic24f7242017-06-14 10:04:00 -0400697header from any users granted the link:access-control.html#capability_runAs[Run As]
698capability. The header and capability permit the authenticated user
699to impersonate another account.
700+
701If false the feature is disabled and cannot be re-enabled without
702editing gerrit.config and restarting the server.
703+
704Default is true.
705
706[[auth.allowRegisterNewEmail]]auth.allowRegisterNewEmail::
Owen Lie2877bb2017-07-14 09:11:20 -0400707+
708Whether users are allowed to register new email addresses.
709+
710In addition for the HTTP authentication type
711link:#auth.httpemailheader[auth.httpemailheader] must *not* be set to
Owen Lic24f7242017-06-14 10:04:00 -0400712enable registration of new email addresses.
713+
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200714By default, true.
715
Edwin Kempin3e856b22020-11-04 14:45:21 +0100716[[auth.autoUpdateAccountActiveStatus]]auth.autoUpdateAccountActiveStatus::
717+
718Whether to allow automatic synchronization of an account's inactive flag upon login.
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -0700719+
Shawn Pearcea931fe12013-06-11 12:29:17 -0700720If set to true, upon login, if the authentication back-end reports the account as active,
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -0700721the account's inactive flag in NoteDb will be updated to be active.
722+
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800723If the authentication back-end reports the account as inactive, the account's flag will be
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800724updated to be inactive and the login attempt will be blocked. Users enabling this feature
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700725should ensure that their authentication back-end is supported. Currently, only
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700726strict 'LDAP' authentication is supported.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700727+
728In addition, if this parameter is not set, or false, the corresponding scheduled
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700729task to deactivate inactive Gerrit accounts will also be disabled. If this
730parameter is set to true, users should also consider configuring the
731link:#accountDeactivation[accountDeactivation] section appropriately.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700732+
David Pursehousea61ee502016-09-06 16:27:09 +0900733By default, false.
Saša Živkove607d6c2016-02-24 10:46:46 +0000734
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200735[[auth.skipFullRefEvaluationIfAllRefsAreVisible]]auth.skipFullRefEvaluationIfAllRefsAreVisible::
736+
Edwin Kempin3e856b22020-11-04 14:45:21 +0100737Whether to skip the full ref visibility checks as a performance shortcut when a
738user has READ permission for all refs.
739+
740The full ref filtering would filter out refs for pending edits, private changes
741and auto merge commits.
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200742+
743By default, true.
744
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700745[[cache]]
746=== Section cache
747
Luca Milanesio82ea7302023-01-02 17:01:14 +0000748[[cache.threads]]cache.threads::
749+
750Number of threads to use when running asynchronous cache tasks.
751The threads executor is delegated to when sending removal notifications to listeners,
752when asynchronous computations like refresh, refreshAfterWrite are performed, or when
753performing periodic maintenance.
754+
755**NOTE**: Setting it to 0 disables the dedicated thread pool and indexing will be done in the
756same thread as the operation. This may result in evictions taking longer because the
757listeners are executed in the caller's thread.
758+
759By default, the JVM common ForkJoinPool is used.
760
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700761[[cache.directory]]cache.directory::
762+
763Path to a local directory where Gerrit can write cached entities for
764future lookup. This local disk cache is used to retain potentially
765expensive to compute information across restarts. If the location
766does not exist, Gerrit will try to create it.
767+
Saša Živkove607d6c2016-02-24 10:46:46 +0000768Technically, cached entities are persisted as a set of H2 databases
769inside this directory.
770+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700771If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700772+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700773Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700774
Thomas Draebinge5dcc602020-04-20 15:40:54 +0200775[[cache.enableDiskStatMetrics]]cache.enableDiskStatMetrics::
776+
777Whether to enable the computation of disk statistics of persistent caches.
778This computation is expensive and requires a long time on larger installations.
779+
780By default, false.
781
Saša Živkovf3134572016-02-09 11:42:46 +0100782[[cache.h2CacheSize]]cache.h2CacheSize::
783+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200784The size of the in-memory cache for each opened H2 cache database, in bytes.
Saša Živkove607d6c2016-02-24 10:46:46 +0000785+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200786Some caches of Gerrit are persistent and are backed by an H2 database.
Saša Živkove607d6c2016-02-24 10:46:46 +0000787H2 uses memory to cache its database content. The parameter `h2CacheSize`
788allows to limit the memory used by H2 and thus prevent out-of-memory
Saša Živkovf3134572016-02-09 11:42:46 +0100789caused by the H2 database using too much memory.
790+
Dave Borowitz3d1f85c2018-11-16 15:36:04 -0800791Technically the H2 cache size is configured using the CACHE_SIZE parameter in
792the H2 JDBC connection URL, as described
Marian Harbach34253372019-12-10 18:01:31 +0100793link:http://www.h2database.com/html/features.html#cache_settings[here,role=external,window=_blank]
Saša Živkovf3134572016-02-09 11:42:46 +0100794+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200795Default is unset, using up to half of the available memory.
David Pursehousee6976dc2017-06-30 16:33:44 +0900796+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200797H2 will persist this value in the database, so to unset explicitly specify 0.
Saša Živkovf3134572016-02-09 11:42:46 +0100798+
799Common unit suffixes of 'k', 'm', or 'g' are supported.
800
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200801[[cache.h2AutoServer]]cache.h2AutoServer::
802+
803If set to true, enable H2 autoserver mode for the H2-backed persistent cache
804databases.
805+
Marian Harbach34253372019-12-10 18:01:31 +0100806See link:http://www.h2database.com/html/features.html#auto_mixed_mode[here,role=external,window=_blank]
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200807for detail.
808+
809Default is false.
810
Antonio Barone09250812020-11-13 18:06:00 +0100811[[cache.openFiles]]cache.openFiles::
812+
813The number of file descriptors to add to the limit set by the Gerrit daemon.
814+
815Persistent caches are stored on the file system and as such participate in the
816file descriptors utilization. The number of file descriptors can vary depending
817on the cache configuration and the specific backend used.
818+
819The additional file descriptors required by the cache should be accounted for
820via this setting, so that the Gerrit daemon can adjust the ulimit accordingly.
821+
822If you increase this to a larger setting you may need to also adjust
823the ulimit on file descriptors for the host JVM, as Gerrit needs
824additional file descriptors available for network sockets and other
825repository data manipulation.
826+
827Default is 0.
828
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700829[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700830+
Prudhvi Akhil Alaharib9417cf2023-09-27 14:17:40 +0530831Maximum age to keep an entry in the cache.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700832Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700833+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700834* s, sec, second, seconds
835* m, min, minute, minutes
836* h, hr, hour, hours
837* d, day, days
838* w, week, weeks (`1 week` is treated as `7 days`)
839* mon, month, months (`1 month` is treated as `30 days`)
840* y, year, years (`1 year` is treated as `365 days`)
841
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700842+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200843--
Edwin Kempinabcd5042013-03-12 16:04:37 +0100844If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700845supplied, the maximum age is infinite and items are never purged
846except when the cache is full.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200847
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700848Default is `0`, meaning store forever with no expire, except:
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200849
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400850* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700851* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700852* `"web_sessions"`: default is `12 hours`
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200853--
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700854
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700855[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700856+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700857The total cost of entries to retain in memory. The cost computation
858varies by the cache. For most caches where the in-memory size of each
859entry is relatively the same, memoryLimit is currently defined to be
860the number of entries held by the cache (each entry costs 1).
861+
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +0200862For caches where the size of an entry can vary significantly between individual
863entries (notably `"git_modified_files"`, `"modified_files"`, `"git_file_diff"`,
864`"gerrit_file_diff"`, `"diff_intraline"`), memoryLimit is an approximation of
865the total number of bytes stored by the cache. Larger entries that represent
866bigger patch sets or longer source files will consume a bigger portion of the
867memoryLimit. For these caches the memoryLimit should be set to roughly the
868amount of RAM (in bytes) the administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700869+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700870Default is 1024 for most caches, except:
871+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400872* `"adv_bases"`: default is `4096`
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +0200873* `"git_modified_files"`: default is `10m` (10 MiB of memory)
874* `"modified_files"`: default is `10m` (10 MiB of memory)
875* `"git_file_diff"`: default is `10m` (10 MiB of memory)
876* `"gerrit_file_diff"`: default is `10m` (10 MiB of memory)
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700877* `"diff_intraline"`: default is `10m` (10 MiB of memory)
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200878* `"diff_summary"`: default is `10m` (10 MiB of memory)
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400879* `"external_ids_map"`: default is `2` and should not be changed
Edwin Kempind967ec42017-11-13 15:14:41 +0100880* `"groups"`: default is unlimited
881* `"groups_byname"`: default is unlimited
882* `"groups_byuuid"`: default is unlimited
Gal Paikinf74ee382021-03-22 16:00:25 +0100883* `"groups_byuuid_persisted"`: default is `1g` (1 GiB of disk space)
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700884* `"plugin_resources"`: default is 2m (2 MiB of memory)
885
886+
Luca Milanesio3bce5682022-11-03 19:41:01 +0000887If set to 0 the cache is disabled; entries are loaded but not stored
888in-memory.
Youssef Elghareebe2f9d5b2023-07-04 18:13:03 +0200889
Luca Milanesio3bce5682022-11-03 19:41:01 +0000890+
891**NOTE**: When the cache is disabled, there is no locking when accessing
892the same key/value, and therefore multiple threads may
893load the same value concurrently with a higher memory footprint.
894To keep a minimum caching and avoid concurrent loading of the same
895key/value, set `memoryLimit` to `1` and `maxAge` to `1`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700896
Dave Borowitz08bac5ca2018-06-05 14:58:28 -0400897[[cache.name.expireFromMemoryAfterAccess]]cache.<name>.expireFromMemoryAfterAccess::
898+
899Time after last access to automatically expire entries from an in-memory
900cache. If 0 or not specified, entries are never expired in this manner.
901Values may use unit suffixes as in link:#cache.name.maxAge[maxAge].
902+
903This option only applies to in-memory caches; persistent cache values are
904not expired in this manner, and are only pruned via
905link:#cache.name.diskLimit[diskLimit].
906
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700907[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700908+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700909Total size in bytes of the keys and values stored on disk. Caches that
910have grown bigger than this size are scanned daily at 1 AM local
911server time to trim the cache. Entries are removed in least recently
912accessed order until the cache fits within this limit. Caches may
913grow larger than this during the day, as the size check is only
914performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700915+
Saša Živkove789f2e2016-09-22 10:37:34 +0200916Default is 128 MiB per cache, except:
917+
Dave Borowitzbab45862018-05-01 12:31:48 -0400918* `"change_notes"`: disk storage is disabled by default
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200919* `"diff_summary"`: default is `1g` (1 GiB of disk space)
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700920* `"external_ids_map"`: disk storage is disabled by default
Patrick Hieselc2c108c2020-07-23 09:54:22 +0200921* `"persisted_projects"`: default is `1g` (1 GiB of disk space)
Saša Živkove789f2e2016-09-22 10:37:34 +0200922
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700923+
Dave Borowitzdab51552018-05-14 16:35:37 -0700924If 0 or negative, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700925
Patrick Hieseld70f37f2020-04-16 14:12:31 +0200926[[cache.name.refreshAfterWrite]]cache.<name>.refreshAfterWrite::
927+
928Duration after which we asynchronously refresh the cached value.
929+
930Values should use common unit suffixes to express their setting:
931+
932* ms, milliseconds
933* s, sec, second, seconds
934* m, min, minute, minutes
935* h, hr, hour, hours
936+
937This applies only to these caches that support refreshing:
938+
939* `"projects"`: Caching project information in-memory. Defaults to 15 minutes.
940
941[[cache.refreshThreadPoolSize]]cache.refreshThreadPoolSize::
942+
943Number of threads that are available to refresh cached values that became
944out of date. This applies only to these caches that support refreshing:
945+
946* `"projects"`: Caching project information in-memory
947+
948Refreshes will only be scheduled on this executor if the values are
949out of sync.
950The check if they are is cheap and always happens on the thread that
951inquires for a cached value.
952+
953Defaults to 2.
954
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800955==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700956
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700957cache `"accounts"`::
958+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700959Cache entries contain important details of an active user, including
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +0200960their display name, preferences, and known email addresses. Entry
Dave Borowitzada289c2018-12-18 13:24:14 -0800961information is obtained from NoteDb data in the `All-Users` repo.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700962
963+
Dave Borowitzada289c2018-12-18 13:24:14 -0800964If direct updates are made to `All-Users`, this cache should be flushed.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700965
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400966cache `"adv_bases"`::
967+
968Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900969are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400970for the client to use as potential delta bases. Push over smart HTTP
971requires two HTTP requests, and this cache tries to carry state from
972the first request into the second to ensure it can complete.
973
Patrick Hiesel7575e882020-04-06 14:09:32 +0200974cache `"default_preferences"`::
975+
976Caches the server's default general, edit and diff preferences.
977+
978Default value is 1 to hold only the most current version in-memory.
979
Patrick Hieselace3dc92019-01-15 14:08:13 +0000980cache `"changes"`::
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200981+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200982The size of `memoryLimit` determines the number of projects for which
983all changes will be cached. If the cache is set to 1024, this means all
Patrick Hieselace3dc92019-01-15 14:08:13 +0000984changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800985+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000986Default value is 0 (disabled). It is disabled by default due to the fact
987that change updates are not communicated between Gerrit servers. Hence
Matthias Sohnd8182ba2019-12-09 14:50:23 +0100988this cache should be disabled in a cluster setup using multiple primary
989or multiple replica nodes.
Gustaf Lundh53493772012-11-18 18:41:15 -0800990+
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -0700991The cache should be flushed whenever NoteDb change metadata in a repository is
992modified outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200993
Martin Fick9bfeb0e2023-08-09 10:04:58 -0600994cache `"changes_by_project"`::
995+
996Ideally, the memorylimit of this cache is large enough to cover all projects.
997This should significantly speed up change ref advertisements and git pushes,
998especially for projects with lots of changes, and particularly on replicas
999where there is no index.
1000
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001001cache `"git_modified_files"`::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001002+
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001003Each item caches the list of git modified files between two git trees
1004corresponding to two different commits. This cache does not read the actual
1005file contents nor does it include the edits (modified regions) of the files.
1006
1007cache `"modified_files"`::
1008+
1009Each item caches the list of modified files between two commits. This cache
1010is similar to the `git_modified_files` cache but performs extra logic including
1011filtering out files that are untouched by both commits because they were purely
1012modified between the parent commits.
1013
1014cache `"git_file_diff"`::
1015+
1016Each item caches the pure git diff between two git trees for a specific file
1017path. The diff includes all the file attributes (old/new paths, change/patch
1018types) as well as the list of edits corresponding to the modified regions in
1019the file.
1020
1021cache `"gerrit_file_diff"`::
1022+
1023Each item caches the diff between two git commits for a specific file path.
1024This cache is similar to the `git_file_diff` cache but performs extra logic
1025including identifying the edits that are due to rebase. The diff for the
1026"commit message" and "merge list" can also be requested from this cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001027+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001028Entries in this cache are relatively large, so memoryLimit is an
1029estimate in bytes of memory used. Administrators should try to target
1030cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001031day span. The same applies for other diff caches: `"git_modified_files"`,
1032`"modified_files"` and `"git_file_diff"`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001033
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -04001034cache `"diff_intraline"`::
1035+
1036Each item caches the intraline difference of one file, when compared
1037between two commits. Gerrit uses this cache to accelerate display of
1038intraline differences when viewing a file.
1039+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001040Entries in this cache are relatively large, so memoryLimit is an
1041estimate in bytes of memory used. Administrators should try to target
1042cache.diff.memoryLimit to fit all files users will view in a 1 or 2
1043day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -04001044
Dave Borowitz7388e9e2016-09-23 13:20:29 +02001045cache `"diff_summary"`::
Saša Živkove789f2e2016-09-22 10:37:34 +02001046+
1047Each item caches list of file paths which are different between two
1048commits. Gerrit uses this cache to accelerate computing of the list
1049of paths of changed files.
1050+
1051Ideally, disk limit of this cache is large enough to cover all changes.
1052This should significantly speed up change reindexing, especially
1053full offline reindexing.
1054
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -04001055cache `"external_ids_map"`::
1056+
1057A singleton cache whose sole entry is a map of the parsed representation
Dave Borowitz70dfbd62018-06-05 13:30:48 -04001058of link:config-accounts.html#external-ids[all current external IDs]. The
1059cache may temporarily contain 2 entries, but the second one is promptly
1060expired.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -04001061+
Dave Borowitzb20d23a82018-08-21 13:43:10 -07001062It is not recommended to change the in-memory attributes of this cache
1063away from the defaults. The cache may be persisted by setting
1064`diskLimit`, which is only recommended if cold start performance is
1065problematic.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -04001066
Shawn O. Pearce2d65d292011-06-24 08:12:02 -07001067cache `"git_tags"`::
1068+
1069If branch or reference level READ access controls are used, this
1070cache tracks which tags are reachable from the branch tips of a
1071repository. Gerrit uses this information to determine the set
1072of tags that a client may access, derived from which tags are
1073part of the history of a visible branch.
1074+
1075The cache is persisted to disk across server restarts as it can
1076be expensive to compute (60 or more seconds for a large history
1077like the Linux kernel repository).
1078
Youssef Elghareeb3d549302020-07-15 17:08:28 +02001079cache `"comment_context"`::
1080+
1081Caches the context lines of comments, which are the lines of the source file
1082highlighted by the user when the comment was written.
1083
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001084cache `"groups"`::
1085+
Edwin Kempin3091e112017-11-13 15:23:58 +01001086Caches the basic group information of internal groups by group ID,
1087including the group owner, name, and description.
1088+
Edwin Kempind967ec42017-11-13 15:14:41 +01001089For this cache it is important to configure a size that is larger than
1090the number of internal Gerrit groups, otherwise general Gerrit
1091performance may be poor. This is why by default this cache is
1092unlimited.
1093+
Edwin Kempin3091e112017-11-13 15:23:58 +01001094External group membership obtained from LDAP is cached under
1095`"ldap_groups"`.
1096
1097cache `"groups_byname"`::
1098+
1099Caches the basic group information of internal groups by group name,
1100including the group owner, name, and description.
1101+
Edwin Kempind967ec42017-11-13 15:14:41 +01001102For this cache it is important to configure a size that is larger than
1103the number of internal Gerrit groups, otherwise general Gerrit
1104performance may be poor. This is why by default this cache is
1105unlimited.
1106+
Edwin Kempin3091e112017-11-13 15:23:58 +01001107External group membership obtained from LDAP is cached under
1108`"ldap_groups"`.
1109
1110cache `"groups_byuuid"`::
1111+
1112Caches the basic group information of internal groups by group UUID,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001113including the group owner, name, and description.
1114+
Edwin Kempind967ec42017-11-13 15:14:41 +01001115For this cache it is important to configure a size that is larger than
1116the number of internal Gerrit groups, otherwise general Gerrit
1117performance may be poor. This is why by default this cache is
1118unlimited.
1119+
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +02001120External group membership obtained from LDAP is cached under
1121`"ldap_groups"`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001122
Gal Paikinf74ee382021-03-22 16:00:25 +01001123cache `"groups_byuuid_persisted"`::
1124+
1125Caches the basic group information of internal groups by group UUID,
1126including the group owner, name, and description.
1127+
1128This is the persisted version of `groups_byuuid` cache. The intention of this
1129cache is to have an in-memory size of 0.
1130+
1131External group membership obtained from LDAP is cached under
1132`"ldap_groups"`.
1133
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +02001134cache `"groups_bymember"`::
Matt Fischer620255a2011-03-22 14:28:23 -05001135+
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +02001136Caches the groups which contain a specific member (account). If direct
1137updates are made to the `account_group_members` table, this cache should
1138be flushed.
1139
Alice Kober-Sotzek3e1fe1b2017-10-12 14:44:17 +02001140cache `"groups_bysubgroups"`::
1141+
1142Caches the parent groups of a subgroup. If direct updates are made
Matt Fischer620255a2011-03-22 14:28:23 -05001143to the `account_group_includes` table, this cache should be flushed.
1144
Youssef Elghareebf08d4b32020-03-26 18:02:15 +01001145cache `"groups_external"`::
1146+
1147Caches all the external groups available to Gerrit. The cache holds a
1148single entry which maps to the latest available of all external groups'
1149UUIDs. This cache uses "groups_external_persisted" to load its value.
1150
1151cache `"groups_external_persisted"`::
1152+
1153Caches all external groups available to Gerrit at some point in history.
1154The cache key is representation of a specific groups state in NoteDb and
1155the value is the list of all external groups.
1156The cache is persisted to enhance performance.
1157
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001158cache `"ldap_groups"`::
1159+
1160Caches the LDAP groups that a user belongs to, if LDAP has been
1161configured on this server. This cache should be configured with a
1162low maxAge setting, to ensure LDAP modifications are picked up in
1163a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001164
Gustaf Lundh0919a492012-10-19 15:29:23 +02001165cache `"ldap_groups_byinclude"`::
1166+
1167Caches the hierarchical structure of LDAP groups.
1168
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -07001169cache `"ldap_usernames"`::
1170+
1171Caches a mapping of LDAP username to Gerrit account identity. The
1172cache automatically updates when a user first creates their account
1173within Gerrit, so the cache expire time is largely irrelevant.
1174
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -07001175cache `"permission_sort"`::
1176+
David Pursehouse221d4f62012-06-08 17:38:08 +09001177Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -07001178reference. Sorting the sections can be expensive when regular
1179expressions are used, so this cache remembers the ordering for
1180each branch.
1181
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001182cache `"plugin_resources"`::
1183+
1184Caches formatted plugin resources, such as plugin documentation that
1185has been converted from Markdown to HTML. The memoryLimit refers to
1186the bytes of memory dedicated to storing the documentation.
1187
Patrick Hieselc2c108c2020-07-23 09:54:22 +02001188cache `"persisted_projects"`::
1189+
1190Caches the project description records, from the `refs/meta/config`
1191branch of each project. This is the persisted variant of the
1192`projects` cache. The intention is for this cache to have an in-memory
1193size of 0.
1194
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001195cache `"projects"`::
1196+
Patrick Hieselc2c108c2020-07-23 09:54:22 +02001197Caches the project description records, from the `refs/meta/config`
1198branch of each project. If a project record is updated or deleted, this
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001199cache should be flushed. Newly inserted projects do not require
1200a cache flush, as they will be read upon first reference.
1201
Luca Milanesioe1e392f2023-07-19 21:52:59 +01001202NOTE: This cache should be disabled or set with a low refreshAfterWrite
1203in a cluster setup using multiple primary or multiple replica nodes.
1204
Dave Borowitz08aa8bb2018-04-05 12:01:06 -04001205cache `"prolog_rules"`::
1206+
1207Caches parsed `rules.pl` contents for each project. This cache uses the same
Prudhvi Akhil Alahari69bc0162022-10-05 23:05:13 +05301208size as the `projects` cache when `cache.prolog_rules.memoryLimit` is not set.
Dave Borowitz08aa8bb2018-04-05 12:01:06 -04001209
Patrick Hiesela57c0d62019-02-19 09:09:22 +01001210cache `"pure_revert"`::
1211+
1212Result of checking if one change or commit is a pure/clean revert of
1213another.
1214
Dmitrii Filippov4fe3b6e2021-10-19 10:21:09 +02001215cache `"soy_sauce_compiled_templates"`::
1216+
1217Caches compiled soy templates. Stores at most only one key-value pair with
1218a constant key value and the value is a compiled SoySauce templates. The value
1219is reloaded automatically every few seconds if there are reads from the cache.
1220If cache is not used for 1 minute, the item is removed (i.e. emails can be send
1221with templates which are max 1 minute old).
1222
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001223cache `"sshkeys"`::
1224+
1225Caches unpacked versions of user SSH keys, so the internal SSH daemon
1226can match against them during authentication. The unit of storage
1227is per-user, so 1024 items translates to 1024 unique user accounts.
1228As each individual user account may configure multiple SSH keys,
1229the total number of keys may be larger than the item count.
1230
Luca Milanesioe1e392f2023-07-19 21:52:59 +01001231NOTE: This cache should be disabled or set with a low refreshAfterWrite
1232in a cluster setup using multiple primary or multiple replica nodes.
1233
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001234cache `"web_sessions"`::
1235+
1236Tracks the live user sessions coming in over HTTP. Flushing this
1237cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -07001238them to sign-in again. To avoid breaking active users, this cache
1239is not flushed automatically by `gerrit flush-caches --all`, but
1240instead must be explicitly requested.
1241+
1242If no disk cache is configured (or `cache.web_sessions.diskLimit`
1243is set to 0) a server restart will force all users to sign-out,
1244and need to sign-in again after the restart, as the cache was
1245unable to persist the session information. Enabling a disk cache
1246is strongly recommended.
1247+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001248Session storage is relatively inexpensive. The average entry in
1249this cache is approximately 346 bytes.
Luca Milanesio64bcd6c2023-08-27 22:12:56 +01001250+
1251The `maxAge` configuration is also used for as maximum lifetime
1252of the HTTP servlet container session.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001253
Shawn O. Pearce4016a932009-05-28 15:12:40 -07001254See also link:cmd-flush-caches.html[gerrit flush-caches].
1255
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001256==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001257
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001258[[cache.git_file_diff.timeout]]cache.git_file_diff.timeout::
Hugo Arès2bc86812015-03-09 15:20:28 -04001259+
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001260Maximum number of milliseconds to wait for git diff data before giving up and
Hugo Arès2bc86812015-03-09 15:20:28 -04001261falling back on a simpler diff algorithm that will not be able to break down
1262modified regions into smaller ones. This is a work around for an infinite loop
1263bug in the default difference algorithm implementation.
1264+
1265Values should use common unit suffixes to express their setting:
1266+
1267* ms, milliseconds
1268* s, sec, second, seconds
1269* m, min, minute, minutes
1270* h, hr, hour, hours
1271
1272+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001273--
Hugo Arès2bc86812015-03-09 15:20:28 -04001274If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001275
Hugo Arès2bc86812015-03-09 15:20:28 -04001276Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001277--
Hugo Arès2bc86812015-03-09 15:20:28 -04001278
Edwin Kempin42d27432013-11-24 17:06:24 +01001279[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001280+
1281Maximum number of milliseconds to wait for intraline difference data
1282before giving up and disabling it for a particular file pair. This is
1283a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +09001284implementation.
1285+
1286If computation takes longer than the timeout, the worker thread is
1287terminated, an error message is shown, and no intraline difference is
1288displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001289+
1290Values should use common unit suffixes to express their setting:
1291+
1292* ms, milliseconds
1293* s, sec, second, seconds
1294* m, min, minute, minutes
1295* h, hr, hour, hours
1296
1297+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001298--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001299If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001300
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001301Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001302--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001303
Edwin Kempin42d27432013-11-24 17:06:24 +01001304[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001305+
1306Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001307when populating a diff cache entry. This flag is provided primarily
1308as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +09001309necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001310this setting will fallback to `cache.diff.intraline` if not set in the
1311configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001312+
1313Default is true, enabled.
1314
Simon Leifc19ff12014-10-02 13:36:00 -04001315[[cache.projects.loadOnStartup]]cache.projects.loadOnStartup::
1316+
1317If the project cache should be loaded during server startup.
1318+
1319The cache is loaded concurrently. Admins should ensure that the cache
1320size set under <<cache.name.memoryLimit,cache.projects.memoryLimit>>
1321is not smaller than the number of repos.
1322+
1323Default is false, disabled.
1324
1325[[cache.projects.loadThreads]]cache.projects.loadThreads::
1326+
1327Only relevant if <<cache.projects.loadOnStartup,cache.projects.loadOnStartup>>
1328is true.
1329+
1330The number of threads to allocate for loading the cache at startup. These
1331threads will die out after the cache is loaded.
1332+
1333Default is the number of CPUs.
1334
Prudhvi Akhil Alaharib60b15e2022-10-04 00:41:09 +05301335[[cache.project_list.interval]]cache.project_list.interval::
1336+
1337The link:#schedule-configuration-interval[interval] for running
1338the project_list cache warmer.
1339
1340By default, if `cache.project_list.maxAge` is set, `interval` will be set to
1341half its value. If `cache.project_list.maxAge` is not set or `interval` is set
1342to `-1`, it is disabled.
1343
1344[[cache.project_list.startTime]]cache.project_list.startTime::
1345+
1346The link:#schedule-configuration-startTime[start time] for running
1347the project_list cache warmer.
1348
1349Default is 00:00 if the project_list cache warmer is enabled.
Shawn Pearce67a33302016-08-11 11:51:59 -07001350
1351[[capability]]
1352=== Section capability
1353
1354[[capability.administrateServer]]capability.administrateServer::
1355+
1356Names of groups of users that are allowed to exercise the
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001357`administrateServer` capability, in addition to those listed in
Shawn Pearce67a33302016-08-11 11:51:59 -07001358All-Projects. Configuring this option can be a useful fail-safe
1359to recover a server in the event an administrator removed all
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001360groups from the `administrateServer` capability, or to ensure that
Shawn Pearce67a33302016-08-11 11:51:59 -07001361specific groups always have administration capabilities.
1362+
1363----
1364[capability]
1365 administrateServer = group Fail Safe Admins
1366----
1367+
1368The configuration file uses group names, not UUIDs. If a group is
1369renamed the gerrit.config file must be updated to reflect the new
1370name. If a group cannot be found for the configured name a warning
1371is logged and the server will continue normal startup.
1372+
1373If not specified (default), only the groups listed by All-Projects
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001374may use the `administrateServer` capability.
1375
1376[[capability.makeFirstUserAdmin]]capability.makeFirstUserAdmin::
1377+
1378Whether the first user that logs in to the Gerrit server should
1379automatically be added to the administrator group and hence get the
1380`administrateServer` capability assigned. This is useful to bootstrap
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -07001381the link:config-accounts.html[account data].
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001382+
1383Default is true.
Shawn Pearce67a33302016-08-11 11:51:59 -07001384
1385
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001386[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001387=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -07001388
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001389[[change.allowBlame]]change.allowBlame::
1390+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001391Allow blame on side by side diff. If set to false, blame cannot be used.
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001392+
1393Default is true.
1394
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001395[[change.cacheAutomerge]]change.cacheAutomerge::
1396+
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001397When reviewing merge commits, the left-hand side shows the output of the result
1398of JGit's automatic merge algorithm. This option controls whether this output is
1399cached in the change repository, or if only the diff is cached in the persistent
1400diff caches (`"git_modified_files"`, `modified_files`, `"git_file_diff"`,
1401`"file_diff"`).
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001402+
1403If true, automerge results are stored in the repository under
1404`refs/cache-automerge/*`; the results of diffing the change against its
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001405automerge base are stored in the diff caches. If false, no extra data is
1406stored in the repository, only the diff caches. This can result in slight
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001407performance improvements by reducing the number of refs in the repo.
1408+
1409Default is true.
1410
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001411[[change.commentSizeLimit]]change.commentSizeLimit::
1412+
1413Maximum allowed size in characters of a regular (non-robot) comment. Comments
1414which exceed this size will be rejected. Size computation is approximate and may
1415be off by roughly 1%. Common unit suffixes of 'k', 'm', or 'g' are supported.
1416The value must be positive.
1417+
Joerg Zierenfaea7e12020-04-06 10:44:46 +02001418The default limit is 16kiB.
1419
Ben Rohlfs04ac31f2023-08-01 10:35:01 +00001420[[change.topicLimit]]change.topicLimit::
1421+
1422Maximum allowed number of changes with the same topic. 0 or negative values
1423mean "unlimited".
1424+
1425By default 5,000.
1426
Joerg Zierenfaea7e12020-04-06 10:44:46 +02001427[[change.cumulativeCommentSizeLimit]]change.cumulativeCommentSizeLimit::
1428+
1429Maximum allowed size in characters of all comments (including robot comments)
1430and change messages. Size computation is approximate and may be off by roughly
14311%. Common unit suffixes of 'k', 'm', or 'g' are supported.
1432+
1433The default limit is 3MiB.
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001434
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001435[[change.disablePrivateChanges]]change.disablePrivateChanges::
Patrick Hieseldb8df482019-01-24 10:11:23 +01001436+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001437If set to true, users are not allowed to create private changes.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001438+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001439The default is false.
1440
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001441[[change.maxComments]]change.maxComments::
1442+
1443Maximum number of comments (regular plus robot) allowed per change. Additional
1444comments are rejected.
1445+
1446By default 5,000.
1447
Joerg Zieren1ebe6872021-01-28 13:45:55 +01001448[[change.maxFiles]]change.maxFiles::
1449+
1450Maximum number of files allowed per change. Larger changes are rejected and must
Ben Rohlfs69c194d2023-09-22 13:37:52 +02001451be split up. For merge changes we are comparing against the auto-merge commit,
1452so we allow large merges, if they merge cleanly.
Joerg Zieren1ebe6872021-01-28 13:45:55 +01001453+
1454By default 100,000.
1455
Edwin Kempina5d863e2023-08-09 06:47:04 +00001456[[change.maxFileSizeDownload]]change.maxFileSizeDownload::
Ben Rohlfsee1283b2023-08-04 08:44:38 +00001457+
1458The link:rest-api-changes.html#get-content[GetContent] and
1459link:rest-api-changes.html#get-safe-content[DownloadContent] REST APIs will
1460refuse to load files larger than this limit (in bytes). 0 or negative values
1461mean "unlimited".
1462
1463+
1464By default 0 (unlimited).
1465
Joerg Zieren1ebe6872021-01-28 13:45:55 +01001466[[change.maxPatchSets]]change.maxPatchSets::
1467+
1468Maximum number of patch sets allowed per change. If this is insufficient,
1469recreate the change with a new Change-Id, then abandon the old change.
1470+
Prabhu Kondarangi31b41712022-09-28 12:29:44 +05301471By default 1000.
Joerg Zieren1ebe6872021-01-28 13:45:55 +01001472
Dave Borowitzca614bc2019-04-15 15:29:15 -07001473[[change.maxUpdates]]change.maxUpdates::
1474+
1475Maximum number of updates to a change. Counts only updates to the main NoteDb
1476meta ref; draft comments, robot comments, stars, etc. do not count towards the
1477total.
1478+
1479Many NoteDb operations require walking the entire change meta ref and loading
1480its contents into memory, so changes with arbitrarily many updates may cause
1481high CPU usage, memory pressure, persistent cache bloat, and other problems.
1482+
Dave Borowitz18e7b552019-04-17 07:53:38 -07001483The following operations are allowed even when a change is at the limit:
Edwin Kempinf2f815b2020-01-22 17:09:16 +01001484
Dave Borowitz18e7b552019-04-17 07:53:38 -07001485* Abandon
1486* Submit
1487* Submit by push with `%submit`
1488* Auto-close by pushing directly to the branch
1489* Fix with link:rest-api-changes.html#fix-input[`expect_merged_as`]
Edwin Kempinf2f815b2020-01-22 17:09:16 +01001490
Dave Borowitzca614bc2019-04-15 15:29:15 -07001491By default 1000.
1492
Patrick Hiesela4824db2019-12-20 10:55:26 +01001493[[change.mergeabilityComputationBehavior]]change.mergeabilityComputationBehavior::
1494+
1495This setting determines when Gerrit computes if a change is mergeable or not.
1496This computation is expensive, especially when the repository is large or when
1497there are many open changes.
1498+
1499This config can have the following states:
1500+
1501* `API_REF_UPDATED_AND_CHANGE_REINDEX`: Gerrit indexes `mergeability` enabling
1502 the `is:mergeable` predicate in change search and allowing fast retrieval of
1503 this bit in query responses. Gerrit will always serve `mergeable` in
1504 link:rest-api-changes.html#change-info[ChangeInfo] objects.
1505 Gerrit will reindex all open changes when the target ref advances (expensive).
1506* `REF_UPDATED_AND_CHANGE_REINDEX`: Gerrit indexes `mergeability` enabling the
1507 `is:mergeable` predicate in change search and allowing fast retrieval of this
1508 bit in query responses. Gerrit will never serve `mergeable` in
1509 link:rest-api-changes.html#change-info[ChangeInfo]
1510 objects. This state can be a final state for instances that only want to
1511 optimize the read path, but not the write path for speed or serve as an
1512 intermediary step for instances that want to optimize both and need to migrate
1513 callers of their API.
1514 Gerrit will reindex all open changes when the target ref advances (expensive).
1515* `NEVER`: Gerrit does not index `mergeable`, so `is:mergeable` is disabled as
1516 query operator. Gerrit does not serve `mergeable` in
1517 link:rest-api-changes.html#change-info[ChangeInfo].
1518
Matthias Sohn1e2cd2902021-03-23 14:31:21 +01001519NOTE: Gerrit would only render conflict changes section on change
1520screen if `API_REF_UPDATED_AND_CHANGE_REINDEX` value is set.
1521
David Ostrovsky8aaace12021-05-12 12:27:54 +02001522Default is `NEVER`.
Patrick Hiesela4824db2019-12-20 10:55:26 +01001523
Matthias Sohn1e2cd2902021-03-23 14:31:21 +01001524[[change.conflictsPredicateEnabled]]change.conflictsPredicateEnabled::
1525
1526+
1527This setting determines when Gerrit renders conflict changes section on change
1528screen and also supports `conflicts` predicate. This computation is expensive,
1529computing ConflictsPredicate has a runtime complexity of O(nˆ2) with n number
1530of open changes on a branch. When set to false GUI will silently ignore the
1531error message and leave the conflict changes section on change screen empty.
1532See also implications on rendering of conflict changes section in configuration
1533section:link:#change.mergeabilityComputationBehavior[change.mergeabilityComputationBehavior].
1534
1535Default is true.
1536
Luca Milanesioeb903122022-06-01 22:56:17 -07001537[[change.maxSubmittableAtOnce]]change.maxSubmittableAtOnce::
1538+
1539Maximum number of changes that can be chained together in the same repository
1540to be submitted at once.
1541+
1542Default is 32767.
1543
Edwin Kempin67229a42019-10-08 09:13:34 +02001544[[change.move]]change.move::
1545+
1546Whether the link:rest-api-changes.html#move-change[Move Change] REST
1547endpoint is enabled.
1548+
1549The move change functionality has some corner cases with undesired side
1550effects. Hence administrators may decide to disable this functionality.
1551In particular, if a change that has dependencies on other changes is
1552moved to a new branch, and the moved change gets submitted to the new
1553branch, the changes on which the change depends are silently merged
1554into the new branch, although these changes have not been moved to that
1555branch (see details in
Edwin Kempin6d99fb62023-06-21 10:08:28 +00001556link:https://issues.gerritcodereview.com/issues/40009784[issue 40009784]).
Edwin Kempin67229a42019-10-08 09:13:34 +02001557+
1558By default true.
1559
Ben Rohlfsc6f31d02023-03-15 12:48:41 +01001560[[change.enableRobotComments]]change.enableRobotComments::
1561+
1562Are robot comments enabled in the Gerrit UI? This setting allows phasing out
1563robot comments.
1564+
1565By default true.
1566
Han-Wen Nienhuys37390f02023-08-24 12:40:45 +02001567[[change.propagateSubmitRequirementErrors]]change.propagateSubmitRequirementErrors::
1568+
1569If a SubmitRequirement evaluation for a given change results in an
1570ERROR status, abort the REST response with an HTTP 500 error.
1571+
1572The ERROR status can occur if a SubmitRequirement uses a
1573plugin-provided predicate (and the plugin is not available), due to
1574bugs, or due to bypassing the validation that normally happens when
1575updating `refs/meta/config`.
1576+
1577Enabling this flag makes gerrit unusuable under such conditions, so
1578it is generally not recommended. However, this makes the
1579application-specific ERROR status into a generic HTTP error, and can
1580thus be acted on by automated deployment and monitoring infrastructure.
1581
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001582[[change.robotCommentSizeLimit]]change.robotCommentSizeLimit::
1583+
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001584Maximum allowed size in characters of a robot comment. Robot comments which
1585exceed this size will be rejected on addition. Size computation is approximate
1586and may be off by roughly 1%. Common unit suffixes of 'k', 'm', or 'g' are
1587supported. Zero or negative values allow robot comments of unlimited size.
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001588+
Joerg Zierenfaea7e12020-04-06 10:44:46 +02001589The default limit is 1MiB.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001590
Gal Paikin02d6ba62020-07-13 23:49:24 +03001591[[change.sendNewPatchsetEmails]]change.sendNewPatchsetEmails::
1592+
1593When false, emails will not be sent to owners, reviewers, and cc for
1594creating a new patchset unless they are project watchers or have starred
1595the change.
1596+
1597Default is true.
1598
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001599[[change.strictLabels]]change.strictLabels::
1600+
1601Reject invalid label votes: invalid labels or invalid values. This
David Pursehouse33495ab2019-10-31 09:38:43 +09001602configuration option is provided for backwards compatibility and may
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001603be removed in future gerrit versions.
1604+
1605Default is false.
1606
David Ostrovsky9933eb32014-05-20 16:08:20 +02001607[[change.submitLabel]]change.submitLabel::
1608+
1609Label name for the submit button.
1610+
1611Default is "Submit".
1612
Stefan Beller7c380d512015-08-21 10:55:21 -07001613[[change.submitLabelWithParents]]change.submitLabelWithParents::
1614+
1615Label name for the submit button if the change has parents which will
1616be submitted together with this change.
1617+
1618Default is "Submit including parents".
1619
David Ostrovsky9933eb32014-05-20 16:08:20 +02001620[[change.submitTooltip]]change.submitTooltip::
1621+
1622Tooltip for the submit button. Variables available for replacement
1623include `${patchSet}` for the current patch set number (1, 2, 3),
1624`${branch}` for the branch name ("master") and `${commit}` for the
1625abbreviated commit SHA-1 (`c9c0edb`).
1626+
1627Default is "Submit patch set ${patchSet} into ${branch}".
1628
Stefan Beller0e655542015-07-20 21:14:38 -07001629[[change.submitTooltipAncestors]]change.submitTooltipAncestors::
1630+
1631Tooltip for the submit button if there are ancestors which would
1632also be submitted by submitting the change. Additionally to the variables
1633as in link:#change.submitTooltip[change.submitTooltip], there is the
1634variable `${submitSize}` indicating the number of changes which are
1635submitted.
1636+
1637Default is "Submit all ${topicSize} changes of the same topic (${submitSize}
1638changes including ancestors and other changes related by topic)".
1639
Stefan Bellera038cf72015-01-13 16:25:10 -08001640[[change.submitTopicLabel]]change.submitTopicLabel::
1641+
1642If `change.submitWholeTopic` is set and a change has a topic,
1643the label name for the submit button is given here instead of
1644the configuration `change.submitLabel`.
1645+
1646Defaults to "Submit whole topic"
1647
1648[[change.submitTopicTooltip]]change.submitTopicTooltip::
1649+
David Pursehousea61ee502016-09-06 16:27:09 +09001650If `change.submitWholeTopic` is configured to true and a change has a
Stefan Bellera038cf72015-01-13 16:25:10 -08001651topic, this configuration determines the tooltip for the submit button
1652instead of `change.submitTooltip`. The variable `${topicSize}` is available
Stefan Beller7c380d512015-08-21 10:55:21 -07001653for the number of changes in the same topic to be submitted. The number of
1654all changes to be submitted is in the variable `${submitSize}`.
Stefan Bellera038cf72015-01-13 16:25:10 -08001655+
Stefan Beller7c380d512015-08-21 10:55:21 -07001656Defaults to "Submit all ${topicSize} changes of the same topic
1657(${submitSize} changes including ancestors and other
1658changes related by topic)".
Stefan Bellera038cf72015-01-13 16:25:10 -08001659
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001660[[change.submitWholeTopic]]change.submitWholeTopic::
Richard Möhne4abe9a2014-11-13 20:05:13 +01001661+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001662Determines if the submit button submits the whole topic instead of
1663just the current change.
David Ostrovskya304aff2018-04-05 23:07:51 +02001664+
1665Default is false.
1666
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001667[[change.updateDelay]]change.updateDelay::
Changcheng Xiao16095352017-12-18 10:03:08 +01001668+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001669How often in seconds the web interface should poll for updates to the
1670currently open change. The poller relies on the client's browser
1671cache to use If-Modified-Since and respect `304 Not Modified` HTTP
1672responses. This allows for fast polls, often under 8 milliseconds.
Changcheng Xiao16095352017-12-18 10:03:08 +01001673+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001674With a configured 30 second delay a server with 4900 active users will
1675typically need to dedicate 1 CPU to the update check. 4900 users
1676divided by an average delay of 30 seconds is 163 requests arriving per
1677second. If requests are served at \~6 ms response time, 1 CPU is
1678necessary to keep up with the update request traffic. On a smaller
1679user base of 500 active users, the default 30 second delay is only 17
1680requests per second and requires ~10% CPU.
1681+
1682If 0 the update polling is disabled.
1683+
1684Default is 5 minutes.
Changcheng Xiao16095352017-12-18 10:03:08 +01001685
Haamed Gheibi972b7272023-08-17 09:22:29 -07001686[[change.diff3ConflictView]]change.diff3ConflictView::
1687+
1688Use the diff3 formatter for merge commits with conflicts. With diff3 when
1689the conflicts are shown in the "Auto Merge" view, the base section from the
1690common parents will be shown as well.
1691This setting takes effect when generating the automerge, which happens on upload.
1692Changing the setting leaves existing changes unaffected.
1693+
1694Default is false.
1695
Youssef Elghareeb01c8f562023-08-31 13:33:35 +00001696[[change.maxFileSizeDiff]]change.maxFileSizeDiff::
1697+
1698The threshold of file sizes in megabytes beyond which a
1699link:rest-api-changes.html#get-diff[file diff] request will fail.
1700+
1701If not set or set to zero, no limits are applied on file sizes.
1702
Dariusz Lukszaa63c7a52023-10-23 13:07:58 +01001703[[change.skipCurrentRulesEvaluationOnClosedChanges]]
1704+
1705If false, Gerrit will always take latest project configuration to
1706compute submit labels. This means that, closed changes (either merged
1707or abandoned) will be evaluated against the latest configuration which
1708may produce different results. Especially for merged changes, they may
1709look like they didn't meet the submit requirements.
1710+
1711When true, evaluation will be skipped and Gerrit will show the
1712exact status of submit labels when change was submitted. Post-review
1713votes will only be allowed on labels that were configured when change
1714was closed.
1715+
1716Default it false.
1717
Edwin Kempine326a1d2015-06-03 10:27:39 +02001718[[changeCleanup]]
1719=== Section changeCleanup
1720
1721This section allows to configure change cleanups and schedules them to
1722run periodically.
1723
1724[[changeCleanup.abandonAfter]]changeCleanup.abandonAfter::
1725+
1726Period of inactivity after which open changes should be abandoned
1727automatically.
1728+
1729By default `0`, never abandon open changes.
1730+
1731[WARNING] Auto-Abandoning changes may confuse/annoy users. When
1732enabling this, make sure to choose a reasonably large grace period and
1733inform users in advance.
1734+
1735The following suffixes are supported to define the time unit:
1736+
1737* `d, day, days`
1738* `w, week, weeks` (`1 week` is treated as `7 days`)
1739* `mon, month, months` (`1 month` is treated as `30 days`)
1740* `y, year, years` (`1 year` is treated as `365 days`)
1741
Edwin Kempin7080ef12015-06-10 15:03:09 +02001742[[changeCleanup.abandonIfMergeable]]changeCleanup.abandonIfMergeable::
1743+
David Pursehousef4bc2562019-12-04 09:55:40 +09001744Whether changes which are mergeable should be auto-abandoned. When set
1745to `false`, `-is:mergeable` is appended to the query used to find
1746the changes to auto-abandon.
Edwin Kempin7080ef12015-06-10 15:03:09 +02001747+
David Pursehousef4bc2562019-12-04 09:55:40 +09001748By default `true`, meaning mergeable changes are auto-abandoned.
1749+
Patrick Hiesela4824db2019-12-20 10:55:26 +01001750If
1751link:#change.mergeabilityComputationBehavior[`change.mergeabilityComputationBehavior`]
1752is set to `NEVER`, setting this option to `false` has no effect and it behaves
1753as though it were set to `true`.
Edwin Kempin7080ef12015-06-10 15:03:09 +02001754
Jacek Centkowski36d35212019-05-13 14:32:00 +02001755[[changeCleanup.cleanupAccountPatchReview]]changeCleanup.cleanupAccountPatchReview::
1756+
1757Whether accountPatchReview data should be also removed when change
1758gets auto-abandoned.
1759+
1760By default `false`.
1761
Edwin Kempine326a1d2015-06-03 10:27:39 +02001762[[changeCleanup.abandonMessage]]changeCleanup.abandonMessage::
1763+
1764Change message that should be posted when a change is abandoned.
1765+
1766'${URL}' can be used as a placeholder for the Gerrit web URL.
1767+
1768By default "Auto-Abandoned due to inactivity, see
1769${URL}Documentation/user-change-cleanup.html#auto-abandon\n\n
1770If this change is still wanted it should be restored.".
1771
1772[[changeCleanup.startTime]]changeCleanup.startTime::
1773+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001774The link:#schedule-configuration-startTime[start time] for running
1775change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001776
1777[[changeCleanup.interval]]changeCleanup.interval::
1778+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001779The link:#schedule-configuration-interval[interval] for running
1780change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001781
Edwin Kempind33d95a2018-02-16 11:44:04 +01001782link:#schedule-configuration-examples[Schedule examples] can be found
1783in the link:#schedule-configuration[Schedule Configuration] section.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001784
David Åkerman757840b2023-02-21 10:56:24 +01001785[[attentionSet]]
1786=== Section attentionSet
1787
1788This section allows to configure readding of change owners and schedules them to
1789run periodically.
1790
1791[[attentionSet.readdAfter]]attentionSet.readdAfter::
1792+
1793Period of inactivity after which open no-WIP/private changes should have change owner
1794added to attention-set automatically (if they are not already).
1795+
1796By default `0`, never readd change owner.
1797+
1798[WARNING] Auto-readding change owners may confuse/annoy users. When
1799enabling this, make sure to choose a reasonably large grace period and
1800inform users in advance.
1801+
1802The following suffixes are supported to define the time unit:
1803+
1804* `d, day, days`
1805* `w, week, weeks` (`1 week` is treated as `7 days`)
1806* `mon, month, months` (`1 month` is treated as `30 days`)
1807* `y, year, years` (`1 year` is treated as `365 days`)
1808
1809[[attentionSet.readdMessage]]attentionSet.readdMessage::
1810+
1811Attention-set message that should be shown as reason when an change owner is readded.
1812+
1813'${URL}' can be used as a placeholder for the Gerrit web URL.
1814+
1815By default "Owner readded to attention-set due to inactivity, see
1816${URL}Documentation/user-attention-set.html#auto-readd-owner\n\n
1817If you do not want to be readded to the attention-set when the timer has counted down.
1818Set this change as WIP or private.".
1819
1820[[attentionSet.startTime]]attentionSet.startTime::
1821+
1822The link:#schedule-configuration-startTime[start time] for running
1823readd owner to attention-set.
1824
1825[[attentionSet.interval]]attentionSet.interval::
1826+
1827The link:#schedule-configuration-interval[interval] for running
1828readd owner to attention-set.
1829
1830link:#schedule-configuration-examples[Schedule examples] can be found
1831in the link:#schedule-configuration[Schedule Configuration] section.
1832
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001833[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001834=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001835
Brad Larson991a31b2009-11-03 14:30:26 -06001836Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -05001837patch comments, in-line code comments and approval category value descriptions
1838to turn set strings into hyperlinks. One common use is for linking to
1839bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -06001840
1841In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001842will match typical Gerrit Change-Id values and create a hyperlink
1843to changes which reference it. The second configuration 'bugzilla'
1844will hyperlink terms such as 'bug 42' to an external bug tracker,
Kamil Musin734db9a2022-11-11 11:19:25 +01001845supplying the argument record number '42' for display.
Brad Larson991a31b2009-11-03 14:30:26 -06001846
Sven Selberg2a0beab2018-04-20 14:49:20 +02001847commentlinks supports link:#reloadConfig[configuration reloads]. Though a
Gustaf Lundhca7eb792018-04-16 10:56:03 +02001848link:cmd-flush-caches.html[flush-caches] of "projects" is needed for the
1849commentlinks to be immediately available in the UI.
1850
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001851----
1852[commentlink "changeid"]
1853 match = (I[0-9a-f]{8,40})
Ben Rohlfs3f9924a2023-05-17 08:41:20 +02001854 link = "/q/$1"
Brad Larson991a31b2009-11-03 14:30:26 -06001855
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001856[commentlink "bugzilla"]
Kamil Musin9148ba62022-09-15 14:21:34 +02001857 match = "(^|\\s)(bug\\s+#?)(\\d+)($|\\s)"
1858 link = http://bugs.example.com/show_bug.cgi?id=$3
1859 prefix = $1
1860 suffix = $4
1861 text = $2$3
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001862----
1863
Dave Borowitz13b38002013-04-08 12:03:29 -07001864Comment links can also be specified in `project.config` and sections in
Kamil Musin734db9a2022-11-11 11:19:25 +01001865children override those in parents.
Dave Borowitz13b38002013-04-08 12:03:29 -07001866
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001867[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -06001868+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001869A JavaScript regular expression to match positions to be replaced
1870with a hyperlink. Subexpressions of the matched string can be
1871stored using groups and accessed with `$'n'` syntax, where 'n'
1872is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -06001873+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001874The configuration file parser eats one level of backslashes, so the
1875character class `\s` requires `\\s` in the configuration file. The
1876parser also terminates the line at the first `#`, so a match
1877expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001878+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -08001879To match case insensitive strings, a character class with both the
1880upper and lower case character for each position must be used. For
1881example, to match the string `bug` in a case insensitive way the match
1882pattern `[bB][uU][gG]` needs to be used.
1883+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001884The commentlink.name.match regular expressions are applied to the raw,
1885unformatted and unescaped text form. Regex matching against HTML is not
1886supported. Comment link patterns that are written in this style should
1887be updated to match text formats.
Matthew Webbercd7d2bf2015-10-14 15:54:06 +01001888+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001889A common pattern to match is `bug\\s+(\\d+)`.
Kamil Musin9148ba62022-09-15 14:21:34 +02001890+
1891In order to better control the visual presentation of the link `prefix`,
1892`suffix` and `text` is used. With the generated link html looking like:
1893`prefix<a ...>text</a>suffix`.
Brad Larson991a31b2009-11-03 14:30:26 -06001894
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001895[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -06001896+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001897The URL to direct the user to whenever the regular expression is
1898matched. Groups in the match expression may be accessed as `$'n'`.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001899
Kamil Musin9148ba62022-09-15 14:21:34 +02001900[[commentlink.name.prefix]]commentlink.<name>.prefix::
1901+
1902The text inserted before the link. Groups in the match expression may be
1903accessed as `$'n'`.
Kamil Musin9148ba62022-09-15 14:21:34 +02001904
1905[[commentlink.name.suffix]]commentlink.<name>.suffix::
1906+
1907The text inserted after the link. Groups in the match expression may be
1908accessed as `$'n'`.
Kamil Musin9148ba62022-09-15 14:21:34 +02001909
1910[[commentlink.name.text]]commentlink.<name>.text::
1911+
1912The text content of the link. Groups in the match expression may be
1913accessed as `$'n'`.
1914+
Kamil Musin734db9a2022-11-11 11:19:25 +01001915If not specified defaults to `$&` (the matched text).
Brad Larson991a31b2009-11-03 14:30:26 -06001916
Dave Borowitz82d79c02013-04-08 15:45:12 -07001917[[commentlink.name.enabled]]commentlink.<name>.enabled::
1918+
1919Whether the comment link is enabled. A child project may override a
1920section in a parent or the site-wide config that is disabled by
1921specifying `enabled = true`.
1922+
David Pursehouse6f1af472013-12-11 19:23:33 +09001923By default, true.
1924+
Dave Borowitz82d79c02013-04-08 15:45:12 -07001925Note that the names and contents of disabled sections are visible even
1926to anonymous users via the
1927link:rest-api-projects.html#get-config[REST API].
1928
Brad Larson991a31b2009-11-03 14:30:26 -06001929
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001930[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001931=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001932
1933These settings are applied only if Gerrit is started as the container
1934process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
1935
1936[[container.heapLimit]]container.heapLimit::
1937+
1938Maximum heap size of the Java process running Gerrit, in bytes.
1939This property is translated into the '-Xmx' flag for the JVM.
1940+
1941Default is platform and JVM specific.
1942+
1943Common unit suffixes of 'k', 'm', or 'g' are supported.
1944
1945[[container.javaHome]]container.javaHome::
1946+
1947Path of the JRE/JDK installation to run Gerrit with. If not set, the
1948Gerrit startup script will attempt to search your system and guess
1949a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
1950
1951[[container.javaOptions]]container.javaOptions::
1952+
David Pursehousea13052b2020-02-10 14:26:08 +09001953Additional options to pass along to the Java runtime. May be specified
1954multiple times to configure multiple values. If multiple values are
1955configured, they are passed in order on the command line, separated by
1956spaces. These options are appended onto 'JAVA_OPTIONS'.
David Pursehousea70a60c2020-02-10 14:22:43 +09001957+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001958For example, it is possible to overwrite Gerrit's default log4j
1959configuration:
David Pursehousea70a60c2020-02-10 14:22:43 +09001960+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001961----
1962 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
1963----
Antoine Musso9ed4b4f2020-11-17 16:52:35 +01001964+
1965Gerrit built-in loggers are then ignored: error logger (`error_log` file),
1966link:#httpd.requestLog[httpd.requestLog] and
1967link:#sshd.requestLog[sshd.requestLog]. The
1968link:#log.jsonLogging[log.jsonLogging] and
1969link:#log.textLogging[log.textLogging] options are also ignored.
David Ostrovskyc772bd82013-10-03 10:37:51 +02001970
Hugo Arès6710f0a2014-11-04 10:28:42 -05001971[[container.daemonOpt]]container.daemonOpt::
1972+
1973Additional options to pass to the daemon (e.g. '--enable-httpd'). If
1974multiple values are configured, they are passed in that order to the command
1975line, separated by spaces.
1976+
1977Execute `java -jar gerrit.war daemon --help` to see all possible
1978options.
1979
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001980[[container.replica]]container.replica::
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001981+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02001982Used on Gerrit replica installations. If set to true the Gerrit JVM is
1983called with the '--replica' switch, enabling replica mode. If no value is
Matthias Sohnd8182ba2019-12-09 14:50:23 +01001984set (or any other value), Gerrit defaults to primary mode enabling write
1985operations.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001986
David Ostrovsky21fca752019-10-18 08:50:29 +02001987[[container.slave]]container.slave::
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001988+
Christian Aistleitnerde8b0722020-06-20 22:17:23 +02001989Backward compatibility for link:#container.replica[`container.replica`]
1990config setting.
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001991
Khai Do6168beb2016-12-19 17:26:28 -08001992[[container.startupTimeout]]container.startupTimeout::
1993+
1994The maximum time (in seconds) to wait for a gerrit.sh start command
1995to run a new Gerrit daemon successfully. If not set, defaults to
199690 seconds.
1997
Daniele Sassoli92b74a52024-01-12 15:30:34 -08001998[[container.shutdownTimeout]]container.shutdownTimeout::
1999+
2000The maximum time (in seconds) to wait for a gerrit.sh stop command.
2001This is added to the highest value between either 'sshd.gracefulStopTimeout'
2002or 'httpd.gracefulStopTimeout'. If not set, defaults to
200330 seconds
2004
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08002005[[container.user]]container.user::
2006+
2007Login name (or UID) of the operating system user the Gerrit JVM
2008will execute as. If not set, defaults to the user who launched
2009the 'gerrit.sh' wrapper script.
2010
2011[[container.war]]container.war::
2012+
2013Path of the JAR file to start daemon execution with. This should
2014be the path of the local 'gerrit.war' archive. Overrides the
2015environment variable 'GERRIT_WAR'.
2016+
2017If not set, defaults to '$site_path/bin/gerrit.war', or to
2018'$HOME/gerrit.war'.
2019
2020
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002021[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002022=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07002023
Saša Živkovd34dfe32017-11-20 11:14:35 +01002024[NOTE]
2025The link:#jgitConfig[etc/jgit.config] file supports configuration of all JGit
2026options.
2027
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002028[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07002029+
2030Number of bytes of a pack file to load into memory in a single
2031read operation. This is the "page size" of the JGit buffer cache,
2032used for all pack access operations. All disk IO occurs as single
2033window reads. Setting this too large may cause the process to load
2034more data than is required; setting this too small may increase
2035the frequency of `read()` system calls.
2036+
2037Default on JGit is 8 KiB on all platforms.
2038+
2039Common unit suffixes of 'k', 'm', or 'g' are supported.
2040
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002041[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07002042+
2043Maximum number of bytes to load and cache in memory from pack files.
2044If JGit needs to access more than this many bytes it will unload less
2045frequently used windows to reclaim memory space within the process.
2046As this buffer must be shared with the rest of the JVM heap, it
2047should be a fraction of the total memory available.
2048+
2049Default on JGit is 10 MiB on all platforms.
2050+
2051Common unit suffixes of 'k', 'm', or 'g' are supported.
2052
Matthias Sohn79bec412020-02-12 01:00:31 +01002053[[core.packedGitUseStrongRefs]]core.packedGitUseStrongRefs::
2054+
2055Set to `true` in order to use strong references to reference packfile
2056pages cached in the WindowCache. Otherwise SoftReferences are used.
2057If this option is set to `false`, the Java garbage collector will
2058flush the WindowCache to free memory if the used heap comes close to
2059the maximum heap size. This has the advantage that it can quickly
2060reclaim memory which was used by the WindowCache but comes at the
2061price that the previously cached pack file content needs to be again
2062copied from the file system cache to the Gerrit process.
2063Setting this option to `true` prevents flushing the WindowCache
2064which provides more predictable performance.
2065+
2066Default is `false`.
2067
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002068[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07002069+
2070Maximum number of bytes to reserve for caching base objects
2071that multiple deltafied objects reference. By storing the entire
2072decompressed base object in a cache Git is able to avoid unpacking
2073and decompressing frequently used base objects multiple times.
2074+
2075Default on JGit is 10 MiB on all platforms. You probably do not
2076need to adjust this value.
2077+
2078Common unit suffixes of 'k', 'm', or 'g' are supported.
2079
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002080[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07002081+
2082Maximum number of pack files to have open at once. A pack file
2083must be opened in order for any of its data to be available in
2084a cached window.
2085+
2086If you increase this to a larger setting you may need to also adjust
2087the ulimit on file descriptors for the host JVM, as Gerrit needs
2088additional file descriptors available for network sockets and other
2089repository data manipulation.
2090+
2091Default on JGit is 128 file descriptors on all platforms.
2092
Shawn O. Pearce329fe792010-09-03 15:44:23 -07002093[[core.streamFileThreshold]]core.streamFileThreshold::
2094+
2095Largest object size, in bytes, that JGit will allocate as a
2096contiguous byte array. Any file revision larger than this threshold
2097will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09002098files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07002099during delta decompression.
2100+
2101Servers with very high traffic should set this to be larger than
2102the size of their common big files. For example a server managing
2103the Android platform typically has to deal with ~10-12 MiB XML
2104files, so `15 m` would be a reasonable setting in that environment.
2105Setting this too high may cause the JVM to run out of heap space
2106when handling very big binary files, such as device firmware or
2107CD-ROM ISO images.
2108+
Luca Milanesiob104a552019-11-18 17:28:56 -08002109Defaults to 25% of the available JVM heap, limited to 2g.
Shawn O. Pearce329fe792010-09-03 15:44:23 -07002110+
2111Common unit suffixes of 'k', 'm', or 'g' are supported.
2112
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002113[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07002114+
2115When true, JGit will use `mmap()` rather than `malloc()+read()`
2116to load data from pack files. The use of mmap can be problematic
2117on some JVMs as the garbage collector must deduce that a memory
2118mapped segment is no longer in use before a call to `munmap()`
2119can be made by the JVM native code.
2120+
2121In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09002122pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07002123of virtual address space, as the garbage collector cannot reclaim
2124unused mapped spaces fast enough.
2125+
2126Default on JGit is false. Although potentially slower, it yields
2127much more predictable behavior.
2128
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02002129[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
2130+
2131Size of the buffer to store logging events for asynchronous logging.
2132Putting a larger value can protect threads from stalling when the
2133AsyncAppender threads are not fast enough to consume the logging events
David Pursehouse1ff91c02015-05-19 15:05:26 +09002134from the buffer. It also protects from losing log entries in this case.
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02002135+
2136Default is 64 entries.
2137
Dave Borowitz1bec65a2013-03-13 10:59:01 -07002138[[core.useRecursiveMerge]]core.useRecursiveMerge::
2139+
Edwin Kempin71831d22014-07-15 08:54:29 +02002140Use JGit's recursive merger for three-way merges. This only affects
Sebastian Schuberth774aac92015-04-16 13:21:04 +02002141projects that allow content merges.
Edwin Kempin71831d22014-07-15 08:54:29 +02002142+
2143As explained in this
2144link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[
Marian Harbach34253372019-12-10 18:01:31 +01002145blog,role=external,window=_blank], the recursive merge produces better results if the two commits
Edwin Kempin71831d22014-07-15 08:54:29 +02002146that are merged have more than one common predecessor.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07002147+
Edwin Kempin7853c5b2014-07-15 08:57:17 +02002148Default is true.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07002149
Hugo Arès47344372016-06-27 10:23:17 -04002150[[core.repositoryCacheCleanupDelay]]core.repositoryCacheCleanupDelay::
2151+
2152Delay between each periodic cleanup of expired repositories.
2153+
2154Values can be specified using standard time unit abbreviations (`ms`, `sec`,
2155`min`, etc.).
2156+
2157Set it to 0 in order to switch off cache expiration. If cache expiration is
2158switched off, the JVM can still evict cache entries when it is running low
2159on available heap memory.
2160+
2161Set it to -1 to automatically derive cleanup delay from
2162`core.repositoryCacheExpireAfter` (lowest value between 1/10 of
2163`core.repositoryCacheExpireAfter` and 10 minutes).
2164+
2165Default is -1.
2166
2167[[core.repositoryCacheExpireAfter]]core.repositoryCacheExpireAfter::
2168+
2169Time an unused repository should expire and be evicted from the repository
2170cache.
2171+
2172Values can be specified using standard time unit abbreviations (`ms`, `sec`,
2173`min`, etc.).
2174+
2175Default is 1 hour.
2176
Martin Fick5f5d9792023-03-16 09:22:27 -06002177[[core.usePerRequestRefCache]]core.usePerRequestRefCache::
2178+
2179Use a per request (currently per request thread) ref cache. The ref
2180cache uses JGit's SnapshottingRefDirectory to ensure that packed
2181refs are checked and potentially read at least once per request
2182(lazily) if needed. This helps reduce the overhead of checking if
2183the packed-refs file is outdated.
2184+
2185Default is true.
2186
Youssef Elghareeb3fa84312022-01-14 15:25:05 +01002187[[dashboard]]
2188=== Section dashboard
2189
2190[[dashboard.submitRequirementColumns]]dashboard.submitRequirementColumns::
2191+
2192The list of submit requirement names that should be displayed as separate
2193columns in the dashboard.
2194
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002195[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002196=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03002197
2198----
2199[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02002200 command = checkout
2201 command = cherry_pick
2202 command = pull
2203 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03002204 scheme = ssh
2205 scheme = http
2206 scheme = anon_http
2207 scheme = anon_git
Mike Frysingerde097a92021-04-29 10:55:15 -04002208 scheme = repo
Thomas Draebingee305192023-03-08 16:40:11 +01002209 hide = ssh
monica.dionisio3f630442010-06-29 15:42:57 -03002210----
2211
2212The download section configures the allowed download methods.
2213
Edwin Kempin08b03a22012-09-14 16:32:57 +02002214[[download.command]]download.command::
2215+
2216Commands that should be offered to download changes.
2217+
2218Multiple commands are supported:
2219+
2220* `checkout`
2221+
2222Command to fetch and checkout the patch set.
2223+
2224* `cherry_pick`
2225+
2226Command to fetch the patch set and to cherry-pick it onto the current
2227commit.
2228+
2229* `pull`
2230+
2231Command to pull the patch set.
2232+
2233* `format_patch`
2234+
2235Command to fetch the patch set and to feed it into the `format-patch`
2236command.
2237
2238+
2239If `download.command` is not specified, all download commands are
2240offered.
2241
monica.dionisio3f630442010-06-29 15:42:57 -03002242[[download.scheme]]download.scheme::
2243+
2244Schemes that should be used to download changes.
2245+
2246Multiple schemes are supported:
2247+
2248* `http`
2249+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002250Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03002251+
2252* `ssh`
2253+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002254Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03002255+
2256* `anon_http`
2257+
2258Anonymous HTTP download is allowed.
2259+
2260* `anon_git`
2261+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002262Anonymous Git download is allowed. This is not default, it is also
2263necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
2264variable.
monica.dionisio3f630442010-06-29 15:42:57 -03002265+
Mike Frysingerde097a92021-04-29 10:55:15 -04002266* `repo`
monica.dionisio3f630442010-06-29 15:42:57 -03002267+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002268Gerrit advertises patch set downloads with the `repo download`
2269command, assuming that all projects managed by this instance are
Mike Frysingerde097a92021-04-29 10:55:15 -04002270generally worked on with the
Kenyon Ralphce209b62022-01-07 00:52:02 -08002271https://gerrit.googlesource.com/git-repo[repo multi-repository tool].
Mike Frysingerde097a92021-04-29 10:55:15 -04002272This is not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03002273
2274+
Edwin Kempin08b03a22012-09-14 16:32:57 +02002275If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002276downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08002277
Thomas Draebingee305192023-03-08 16:40:11 +01002278[[download.hide]]download.hide::
2279+
2280Schemes that can be used to download changes, but will not be advertised
2281in the UI. This can be any scheme that can be configured in <<download.scheme>>.
2282+
2283This is mostly useful in a deprecation scenario during a time where using
2284a scheme is discouraged, but has to be supported until all clients have
2285migrated to use a different scheme.
2286+
2287By default, no scheme will be hidden in the UI.
2288
Edwin Kempin322db672015-07-03 08:50:46 +02002289[[download.checkForHiddenChangeRefs]]download.checkForHiddenChangeRefs::
2290+
2291Whether the download commands should be adapted when the change refs
2292are hidden.
2293+
2294Git has a configuration option to hide refs from the initial
2295advertisement (`uploadpack.hideRefs`). This option can be used to hide
2296the change refs from the client. As consequence fetching changes by
2297change ref does not work anymore. However by setting
2298`uploadpack.allowTipSha1InWant` to `true` fetching changes by commit ID
2299is possible. If `download.checkForHiddenChangeRefs` is set to `true`
2300the git download commands use the commit ID instead of the change ref
2301when a project is configured like this.
2302+
2303Example git configuration on a project:
2304+
2305----
2306[uploadpack]
2307 hideRefs = refs/changes/
2308 hideRefs = refs/cache-automerge/
2309 allowTipSha1InWant = true
2310----
2311+
2312By default `false`.
2313
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002314[[download.archive]]download.archive::
2315+
2316Specifies which archive formats, if any, should be offered on the change
Francois Ferrand1e933882014-09-25 11:19:08 +02002317screen and supported for `git-upload-archive` operation:
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002318+
2319----
2320[download]
2321 archive = tar
2322 archive = tbz2
2323 archive = tgz
2324 archive = txz
Francois Ferrand1e933882014-09-25 11:19:08 +02002325 archive = zip
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002326----
2327
Shawn Pearce6edde312014-03-26 22:00:26 -07002328If `download.archive` is not specified defaults to all archive
2329commands. Set to `off` or empty string to disable.
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002330
Francois Ferrand1e933882014-09-25 11:19:08 +02002331Zip is not supported because it may be interpreted by a Java plugin as a
2332valid JAR file, whose code would have access to cookies on the domain.
2333For this reason `zip` format is always excluded from formats offered
2334through the `Download` drop down or accessible in the REST API.
2335
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002336[[gc]]
2337=== Section gc
2338
2339This section allows to configure the git garbage collection and schedules it
2340to run periodically. It will be triggered and executed sequentially for all
2341projects.
2342
Christian Halstricke6c68322015-03-11 15:21:42 +01002343[[gc.aggressive]]gc.aggressive::
2344+
2345Determines if scheduled garbage collections and garbage collections triggered
2346through Web-UI should run in aggressive mode or not. Aggressive garbage
2347collections are more expensive but may lead to significantly smaller
2348repositories.
2349+
2350Valid values are "true" and "false," default is "false".
2351
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002352[[gc.startTime]]gc.startTime::
2353+
Edwin Kempind33d95a2018-02-16 11:44:04 +01002354The link:#schedule-configuration-startTime[start time] for running the
2355git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002356
2357[[gc.interval]]gc.interval::
2358+
Edwin Kempind33d95a2018-02-16 11:44:04 +01002359The link:#schedule-configuration-interval[interval] for running the
2360git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002361
Edwin Kempind33d95a2018-02-16 11:44:04 +01002362link:#schedule-configuration-examples[Schedule examples] can be found
2363in the link:#schedule-configuration[Schedule Configuration] section.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002364
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002365[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002366=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002367
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002368[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07002369+
2370Local filesystem directory holding all Git repositories that
2371Gerrit knows about and can process changes for. A project
2372entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02002373the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07002374+
2375If relative, the path is resolved relative to `'$site_path'`.
2376
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002377[[gerrit.allProjects]]gerrit.allProjects::
2378+
2379Name of the permissions-only project defining global server
2380access controls and settings. These are inherited into every
2381other project managed by the running server. The name is
2382relative to `gerrit.basePath`.
2383+
Patrick Hiesel8622fa8b2022-01-27 14:09:55 +01002384The link:#cache_names[persisted_projects cache] must be
2385flushed after this setting is changed.
2386+
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002387Defaults to `All-Projects` if not set.
2388
Marija Savtchouk714fbff2021-03-12 16:02:12 +00002389[[gerrit.defaultBranch]]gerrit.defaultBranch::
2390+
2391Name of the link:project-configuration.html#default-branch[default branch]
2392to use on the project creation, if no other branches were specified in the input.
2393+
2394Defaults to `refs/heads/master` if not set.
2395
Edwin Kempin2bf5edd2014-03-25 22:21:23 +01002396[[gerrit.allUsers]]gerrit.allUsers::
2397+
2398Name of the project in which meta data of all users is stored.
2399The name is relative to `gerrit.basePath`.
2400+
2401Defaults to `All-Users` if not set.
2402
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002403[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002404+
2405The default URL for Gerrit to be accessed through.
2406+
Sebastian Schuberth64037132016-07-28 13:40:16 +02002407Typically this would be set to something like "http://review.example.com/"
2408or "http://example.com:8080/gerrit/" so Gerrit can output links that point
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002409back to itself.
2410+
Kenyon Ralph9536ac92022-01-05 17:15:41 -08002411Setting this is highly recommended, as it is necessary for the upload
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002412code invoked by "git push" or "repo upload" to output hyperlinks
2413to the newly uploaded changes.
2414
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002415[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002416+
2417Optional base URL for repositories available over the anonymous git
2418protocol. For example, set this to `git://mirror.example.com/base/`
2419to have Gerrit display patch set download URLs in the UI. Gerrit
2420automatically appends the project name onto the end of the URL.
2421+
2422By default unset, as the git daemon must be configured externally
2423by the system administrator, and might not even be running on the
2424same host as Gerrit.
2425
Dave Borowitza5d3fec2015-07-09 14:24:02 -07002426[[gerrit.docUrl]]gerrit.docUrl::
2427+
2428Optional base URL for documentation, under which one can find
2429"index.html", "rest-api.html", etc. Used as the base for the fixed set
2430of links in the "Documentation" tab. A slash is implicitly appended.
2431(For finer control over the top menu, consider writing a
2432link:dev-plugins.html#top-menu-extensions[plugin].)
2433+
2434If unset or empty, the documentation tab will only be shown if
2435`/Documentation/index.html` can be reached by the browser at app load
2436time.
2437
Dave Borowitza17a9842015-09-15 09:58:17 -04002438[[gerrit.editGpgKeys]]gerrit.editGpgKeys::
2439+
2440If enabled and server-side signed push validation is also
2441link:#receive.enableSignedPush[enabled], enable the
2442link:rest-api-accounts.html#list-gpg-keys[REST API endpoints] and web UI
2443for editing GPG keys. If disabled, GPG keys can only be added by
2444administrators with direct git access to All-Users.
2445+
2446Defaults to true.
2447
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002448[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
2449+
2450Optional command to install the `commit-msg` hook. Typically of the
2451form:
David Pursehouse05588e52015-01-07 14:25:11 +09002452+
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002453----
2454fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
2455----
2456+
2457By default unset; falls back to using scp from the canonical SSH host,
2458or curl from the canonical HTTP URL for the server. Only necessary if a
2459proxy or other server/network configuration prevents clients from
2460fetching from the default location.
2461
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07002462[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
2463+
2464Optional base URL for repositories available over the HTTP
2465protocol. For example, set this to `http://mirror.example.com/base/`
2466to have Gerrit display URLs from this server, rather than itself.
2467+
2468By default unset, as the HTTP daemon must be configured externally
2469by the system administrator, and might not even be running on the
2470same host as Gerrit.
Nasser Grainawic3b05342022-02-25 16:58:13 -07002471
Luca Milanesio2c7ff592021-02-15 23:53:09 +00002472[[gerrit.installBatchModule]]gerrit.installBatchModule::
2473+
2474Repeatable list of class name of additional Guice modules to load as
2475override to the batchInjector's modules during the init phases.
2476Classes are resolved using the primary Gerrit class loader, hence the
2477class needs to be either declared in Gerrit or an additional JAR
2478located under the `/lib` directory.
2479+
2480By default unset.
Nasser Grainawic3b05342022-02-25 16:58:13 -07002481
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002482[[gerrit.installDbModule]]gerrit.installDbModule::
2483+
2484Repeatable list of class name of additional Guice modules to load at
Luca Milanesio2c7ff592021-02-15 23:53:09 +00002485Gerrit startup as part of the dbInjector.
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002486Classes are resolved using the primary Gerrit class loader, hence the
2487class needs to be either declared in Gerrit or an additional JAR
2488located under the `/lib` directory.
2489+
2490By default unset.
2491
Luca Milanesioc336ce92021-11-16 01:10:49 +00002492[[gerrit.installIndexModule]]gerrit.installIndexModule::
2493+
2494Class name of the Guice modules to load as alternate implementation
2495for the Gerrit indexes backend.
2496Classes are resolved using the primary Gerrit class loader, hence the
2497class needs to be either declared in Gerrit or an additional JAR
2498located under the `/lib` directory.
2499+
2500NOTE: The `gerrit.installIndexModule` has precedence over the
2501`index.type`.
2502+
2503By default unset.
2504+
2505Example:
2506----
2507[gerrit]
2508 installIndexModule = com.google.gerrit.elasticsearch.ElasticIndexModule
2509----
Youssef Elghareebe2f9d5b2023-07-04 18:13:03 +02002510
Luca Milanesio62cc3502016-11-15 10:22:38 -08002511[[gerrit.installModule]]gerrit.installModule::
2512+
2513Repeatable list of class name of additional Guice modules to load at
Luca Milanesio2c7ff592021-02-15 23:53:09 +00002514Gerrit startup as part of the sysInjector.
Luca Milanesio62cc3502016-11-15 10:22:38 -08002515Classes are resolved using the primary Gerrit class loader, hence the
2516class needs to be either declared in Gerrit or an additional JAR
2517located under the `/lib` directory.
2518+
2519By default unset.
2520+
2521Example:
2522----
2523[gerrit]
2524 installModule = com.googlesource.gerrit.libmodule.MyModule
2525 installModule = com.example.abc.OurSpecialSauceModule
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002526 installDbModule = com.example.def.OurCustomProvider
Luca Milanesio2c7ff592021-02-15 23:53:09 +00002527 installBatchModule = com.example.ghi.CustomBatchInitModule
Luca Milanesio62cc3502016-11-15 10:22:38 -08002528----
2529
Luca Milanesio92254852019-02-14 01:33:14 +00002530[[gerrit.listProjectsFromIndex]]gerrit.listProjectsFromIndex::
2531+
2532Enable rendering of project list from the secondary index instead
2533of purely relying on the in-memory cache.
2534+
2535By default false.
2536+
2537[NOTE]
2538The in-memory cache (set to false) rendering provides an **unlimited list** as a result
2539of the list project API, causing the full list of projects to be
2540returned as a result of the link:rest-api-projects.html[/projects/] REST API
2541or the link:cmd-ls-projects.html[gerrit ls-projects] SSH command.
2542When the rendering from the secondary index (set to true),
2543the **list is limited** by the global capability
2544link:access-control.html#capability_queryLimit[queryLimit]
2545which is defaulted to 500 entries.
2546
Sven Selberge63e92d2019-01-22 18:19:19 +01002547[[gerrit.primaryWeblinkName]]gerrit.primaryWeblinkName::
2548+
2549Name of the link:dev-plugins.html#links-to-external-tools[Weblink] that should
2550be chosen in cases where only one Weblink can be used in the UI, for example in
2551inline links.
2552+
2553By default unset, meaning that the UI is responsible for trying to identify
2554a weblink to be used in these cases, most likely weblinks that links to code
2555browsers with known integrations with Gerrit (like Gitiles and Gitweb).
2556+
2557Example:
2558----
2559[gerrit]
2560 primaryWeblinkName = gitiles
2561----
2562
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002563[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
2564+
David Pursehouse214ab862014-12-01 11:48:26 +09002565URL to direct users to when they need to report a bug.
2566+
2567By default unset, meaning no bug report URL will be displayed. Administrators
2568should set this to the URL of their issue tracker, if necessary.
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002569
David Ostrovsky8e6acc92021-04-14 20:00:37 +02002570[[gerrit.enablePeerIPInReflogRecord]]gerrit.enablePeerIPInReflogRecord::
2571
2572Record actual peer IP address in ref log entry for identified user.
2573
David Ostrovsky9f200d22021-04-17 14:06:12 +02002574Defaults to false.
David Ostrovsky8e6acc92021-04-14 20:00:37 +02002575
David Pursehouse962e1182014-12-03 17:17:52 +09002576[[gerrit.secureStoreClass]]gerrit.secureStoreClass::
2577+
2578Use the secure store implementation from a specified class.
2579+
2580If specified, must be the fully qualified class name of a class that implements
2581the `com.google.gerrit.server.securestore.SecureStore` interface, and the jar
2582file containing the class must be placed in the `$site_path/lib` folder.
2583+
2584If not specified, the default no-op implementation is used.
2585
Dariusz Luksza7a046da2014-04-03 17:05:47 +02002586[[gerrit.canLoadInIFrame]]gerrit.canLoadInIFrame::
2587+
2588For security reasons Gerrit will always jump out of iframe.
2589Setting this option to true will prevent this behavior.
2590+
2591By default false.
2592
Marcin Czech559ea2b2020-06-15 17:36:18 +02002593[[gerrit.xframeOption]]gerrit.xframeOption::
2594+
2595Add link:https://tools.ietf.org/html/rfc7034[`X-Frame-Options`] header to all HTTP
2596responses. The `X-Frame-Options` HTTP response header can be used to indicate
2597whether or not a browser should be allowed to render a page in a
2598`<frame>`, `<iframe>`, `<embed>` or `<object>`.
2599+
2600Available values:
2601+
26021. ALLOW - The page can be displayed in a frame.
26032. SAMEORIGIN - The page can only be displayed in a frame on the same origin as the page itself.
2604+
2605If link:#gerrit.canLoadInIFrame is set to false this option is ignored and the
2606`X-Frame-Options` header is always set to `DENY`.
2607Setting this option to `ALLOW` will cause the `X-Frame-Options` header to be omitted
2608the the page can be displayed in a frame.
2609+
2610By default SAMEORIGIN.
2611
Wyatt Allen414659c2017-03-15 09:55:31 -07002612[[gerrit.cdnPath]]gerrit.cdnPath::
2613+
Ben Rohlfsda0a62b2021-04-26 17:02:19 +02002614Path prefix for Gerrit's static resources if using a CDN.
Wyatt Allen414659c2017-03-15 09:55:31 -07002615
Viktar Donich65ae7482017-10-20 14:13:31 -07002616[[gerrit.faviconPath]]gerrit.faviconPath::
2617+
Ben Rohlfsda0a62b2021-04-26 17:02:19 +02002618Path for Gerrit's favicon after link:#gerrit.canonicalWebUrl[default URL],
Viktar Donich65ae7482017-10-20 14:13:31 -07002619including icon name and extension (.ico should be used).
2620
Fabio Ponciroli829be0d2020-05-06 13:59:20 +02002621[[gerrit.instanceId]]gerrit.instanceId::
2622+
2623Optional identifier for this Gerrit instance.
2624Used to identify a specific instance within a group of Gerrit instances with the
2625same `serverId` (i.e.: a Gerrit cluster).
2626Unlike `instanceName` this value is not available in the email templates.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002627
Thomas Draebing40eb5672023-08-18 12:33:16 +02002628The instance ID can also be configured by setting the Java system property
2629`gerrit.instanceId` on startup. This will override the configuration in the
2630gerrit.config.
2631
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002632[[gerrit.instanceName]]gerrit.instanceName::
2633+
2634Short identifier for this Gerrit instance.
2635A good name should be short but precise enough so that users can identify the instance among others.
2636+
2637Defaults to the full hostname of the Gerrit server.
2638
Luca Milanesio1a3d84f2020-05-04 17:14:12 +01002639[[gerrit.experimentalRollingUpgrade]]gerrit.experimentalRollingUpgrade::
2640+
2641Enable Gerrit rolling upgrade to the next version.
Luca Milanesioba8dfad2020-11-27 12:59:07 +00002642For example if Gerrit v3.2 is version N (All-Projects:refs/meta/version=183)
2643then its next version N+1 is v3.3 (All-Projects:refs/meta/version=184).
Luca Milanesio1a3d84f2020-05-04 17:14:12 +01002644Allow Gerrit to start even if the underlying schema version has been bumped to
2645the next Gerrit version.
2646+
2647Set to true if Gerrit is installed in
2648[high-availability configuration](https://gerrit.googlesource.com/plugins/high-availability/+/refs/heads/master/README.md)
2649during the rolling upgrade to the next version.
2650+
2651By default false.
2652+
2653The rolling upgrade process, at high level, assumes that Gerrit is installed
2654on two or more nodes sharing the repositories over NFS. The upgrade is composed
2655of the following steps:
2656+
26571. Set gerrit.experimentalRollingUpgrade to true on all Gerrit masters
26582. Set the first master unhealthy
26593. Shutdown the first master and [upgrade](install.html#init) to the next version
Luca Milanesioba8dfad2020-11-27 12:59:07 +000026604. Startup the first master, wait for the online reindex to complete (where applicable)
Luca Milanesio1a3d84f2020-05-04 17:14:12 +010026615. Verify the the first master upgrade is successful and online reindex is complete
26626. Set the first master healthy
26637. Repeat steps 2. to 6. for all the other Gerrit nodes
2664+
2665[WARNING]
2666Rolling upgrade may or may not be possible depending on the changes introduced
2667by the target version of the upgrade. Refer to the release notes and check whether
2668the rolling upgrade is possible or not and the associated constraints.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002669
Luca Milanesio37258db2022-06-27 14:40:08 +01002670[[gerrit.importedServerId]]gerrit.importedServerId::
2671+
2672ServerId of the repositories imported from other Gerrit servers. Changes coming
Fabio Poncirolia0eae5d2023-06-16 10:48:38 +02002673associated with the imported serverIds are indexed and displayed in the UI
Luca Milanesio0eebefd2023-06-20 21:38:29 +01002674but they are not searchable by `changeNumber` therefore the
2675`index.cacheQueryResultsByChangeNum` must also be set to false.
2676Imported changes are still discoverable in any other ways, for example:
Fabio Poncirolia0eae5d2023-06-16 10:48:38 +02002677
2678 project:someproject branch:main changeId:I78a7add1fe2597cad788c833d8f771f09b54cf33
Luca Milanesio37258db2022-06-27 14:40:08 +01002679+
2680Specify multiple `gerrit.importedServerId` for allowing the import from multiple
Luca Milanesioc6737c92022-06-28 00:07:06 +01002681Gerrit servers with different serverIds.
2682+
2683[NOTE]
2684The account-ids referenced in the imported changes are used for looking up the
2685associated account-id locally, using the `imported:` external-id.
2686Example: the account-id 1000 from the imported server-id 59a4964e-6376-4ed9-beef
2687will be looked up in the local accounts using the `imported:1000@59a4964e-6376-4ed9-beef`
2688external-id.
Luca Milanesio37258db2022-06-27 14:40:08 +01002689+
2690If this value is not set, all changes imported from other Gerrit servers will be
2691ignored.
2692+
2693By default empty.
2694
Sven Selberg327c2e42018-04-10 11:42:19 +02002695[[gerrit.serverId]]gerrit.serverId::
2696+
2697Used by NoteDb to, amongst other things, identify author identities from
2698per-server specific account IDs.
2699+
2700If this value is not set on startup it is automatically set to a random UUID.
2701+
2702[NOTE]
2703If this value doesn't match the serverId used when creating an already existing
2704NoteDb, Gerrit will not be able to use that instance of NoteDb. The serverId
2705used to create the NoteDb will show in the resulting exception message in case
2706the value differs.
2707
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002708[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002709=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002710
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002711Gerrit can forward requests to either an internally managed gitweb
2712(which allows Gerrit to enforce some access controls), or to an
2713externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002714See also link:config-gitweb.html[Gitweb Integration].
2715
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002716[[gitweb.cgi]]gitweb.cgi::
2717+
2718Path to the locally installed `gitweb.cgi` executable. This CGI will
2719be called by Gerrit Code Review when the URL `/gitweb` is accessed.
2720Project level access controls are enforced prior to calling the CGI.
2721+
David Pursehousea89dc982016-09-15 09:35:44 +02002722Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if `gitweb.url` is not set.
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002723
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002724[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002725+
2726Optional URL of an affiliated gitweb service. Defines the
2727web location where a `gitweb.cgi` is installed to browse
David Pursehousea89dc982016-09-15 09:35:44 +02002728`gerrit.basePath` and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002729+
2730Gerrit appends any necessary query arguments onto the end of this URL.
David Pursehousea89dc982016-09-15 09:35:44 +02002731For example, `?p=$project.git;h=$commit`.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002732
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002733[[gitweb.type]]gitweb.type::
2734+
2735Optional type of affiliated gitweb service. This allows using
David Pursehousea66f7ff2016-09-05 21:11:10 +09002736alternatives to gitweb, such as cgit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002737+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07002738Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
David Pursehousea66f7ff2016-09-05 21:11:10 +09002739+
2740If not set, or set to `disabled`, there is no gitweb hyperlinking
2741support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002742
Edwin Kempind86909c2012-03-26 10:36:29 +02002743[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002744+
2745Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002746at a specific commit when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002747+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002748Valid replacements are `${project}` for the project name in Gerrit
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02002749and `${commit}` for the SHA-1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002750
Edwin Kempind86909c2012-03-26 10:36:29 +02002751[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002752+
2753Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002754at a specific project when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002755+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002756Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002757
Edwin Kempind86909c2012-03-26 10:36:29 +02002758[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002759+
2760Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002761at a specific branch when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002762+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002763Valid replacements are `${project}` for the project name in Gerrit
2764and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002765
Paladox none5759f2c2017-10-27 18:13:54 +00002766[[gitweb.tag]]gitweb.tag::
2767+
2768Optional pattern to use for constructing the gitweb URL when pointing
2769at a specific tag when `gitweb.type` is set to `custom`.
2770+
2771Valid replacements are `${project}` for the project name in Gerrit
2772and `${tag}` for the name of the tag.
2773
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002774[[gitweb.roottree]]gitweb.roottree::
2775+
2776Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002777at the contents of the root tree in a specific commit when `gitweb.type`
2778is set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002779+
2780Valid replacements are `${project}` for the project name in Gerrit
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02002781and `${commit}` for the SHA-1 hash for the commit.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002782
2783[[gitweb.file]]gitweb.file::
2784+
2785Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002786at the contents of a file in a specific commit when `gitweb.type` is
2787set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002788+
2789Valid replacements are `${project}` for the project name in Gerrit,
Clark Boylan77f5a062022-02-14 10:55:30 -08002790`${file}` for the file name, `${hash}` for the SHA-1 hash for the commit,
2791and `${commit}` for the change ref or SHA-1 of the commit if no base
2792patch set.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002793
Edwin Kempin64011562012-03-26 10:50:12 +02002794[[gitweb.filehistory]]gitweb.filehistory::
2795+
2796Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002797at the history of a file in a specific branch when when `gitweb.type`
2798is set to `custom`.
Edwin Kempin64011562012-03-26 10:50:12 +02002799+
2800Valid replacements are `${project}` for the project name in Gerrit,
2801`${file}` for the file name and `${branch}` for the name of the
2802branch.
2803
Gustaf Lundha07d2e72011-10-27 15:26:35 -07002804[[gitweb.linkname]]gitweb.linkname::
2805+
2806Optional setting for modifying the link name presented to the user
2807in the Gerrit web-UI.
2808+
David Pursehousea89dc982016-09-15 09:35:44 +02002809The default linkname for custom type is `gitweb`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002810
Adrian Goerlerf2007072011-11-10 08:39:55 +01002811[[gitweb.pathSeparator]]gitweb.pathSeparator::
2812+
2813Optional character to substitute the standard path separator (slash) in
2814project names and branch names.
2815+
2816By default, Gerrit will use hexadecimal encoding for slashes in project and
2817branch names. Some web servers, such as Tomcat, reject this hexadecimal
2818encoding in the URL.
2819+
Marian Harbach34253372019-12-10 18:01:31 +01002820Some alternative gitweb services, such as link:http://gitblit.com[Gitblit,role=external,window=_blank],
Adrian Goerlerf2007072011-11-10 08:39:55 +01002821allow using an alternative path separator character. In Gitblit, this can be
Marian Harbach34253372019-12-10 18:01:31 +01002822configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter,role=external,window=_blank].
Adrian Goerlerf2007072011-11-10 08:39:55 +01002823In Gerrit, the alternative path separator can be configured correspondingly
David Pursehousea89dc982016-09-15 09:35:44 +02002824using the property `gitweb.pathSeparator`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002825+
David Pursehousea89dc982016-09-15 09:35:44 +02002826Valid values are the characters `*`, `(` and `)`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002827
David Pursehouse5d592e82016-06-09 05:12:26 +00002828[[gitweb.urlEncode]]gitweb.urlEncode::
Luca Milanesio25312032013-10-11 11:34:39 +01002829+
2830Whether or not Gerrit should encode the generated viewer URL.
2831+
2832Gerrit composes the viewer URL using information about the project, branch, file
2833or commit of the target object to be displayed. Typically viewers such as CGit
David Pursehousea89dc982016-09-15 09:35:44 +02002834and gitweb do need those parts to be encoded, including the `/` in project's name,
Luca Milanesio25312032013-10-11 11:34:39 +01002835for being correctly parsed.
2836However other viewers could instead require an unencoded URL (e.g. GitHub web
David Pursehousea89dc982016-09-15 09:35:44 +02002837based viewer).
Luca Milanesio25312032013-10-11 11:34:39 +01002838+
David Pursehousea89dc982016-09-15 09:35:44 +02002839Valid values are `true` and `false`. The default is `true`.
Luca Milanesio25312032013-10-11 11:34:39 +01002840
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002841[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002842=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01002843
Dmitrii Filippov4e16eb92023-11-02 17:42:29 +01002844[[groups.auditLog.ignoreRecordsFromUnidentifiedUsers]]groups.auditLog.ignoreRecordsFromUnidentifiedUsers::
2845+
2846Controls whether AuditLogReader should ignore commits created by unidentified users.
2847If true, then AuditLogReader ignores commits in the refs/groups/* made by unidentified users (i.e.
2848when the author of a commit can't be parsed as account id).
2849+
2850The current version of Gerrit writes identified users as authors for new refs/groups/* commits.
2851However, some old versions used a server identity as the author (e.g. "Gerrit Code Review
2852<server@googlesource.com>") for such commits. Such string can't be converted to account id but
2853usually the commit shouldn't be ignored.
2854+
2855By default, false.
2856+
2857Setting it to true may lead to some unexpected results in audit log and must be set carefully.
2858
Patrick Hiesela0242422020-11-30 16:54:21 +01002859[[groups.includeExternalUsersInRegisteredUsersGroup]]groups.includeExternalUsersInRegisteredUsersGroup::
2860+
2861Controls whether external users (these are users we have sufficient
2862knowledge about but who don't yet have a Gerrit account) are considered
2863to be members of the `REGISTERED_USERS` group.
2864+
2865This setting only makes sense if you run custom code (e.g. from a plugin
2866or a custom authentication backend). By default, Gerrit core always requires
2867users to register and doesn't use external users.
2868+
2869By default, true.
2870
Edwin Kempin4bbff702013-01-11 09:59:53 +01002871[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
2872+
2873Controls whether newly created groups should be by default visible to
2874all registered users.
2875+
2876By default, false.
2877
Edwin Kempinf3eddd52017-01-20 14:05:47 +01002878[[groups.uuid.name]]groups.<uuid>.name::
2879+
2880Display name for group with the given UUID.
2881+
2882This option is only supported for system groups (scheme 'global').
2883+
2884E.g. this parameter can be used to configure another name for the
2885`Anonymous Users` group:
2886+
2887----
2888[groups "global:Anonymous-Users"]
2889 name = All Users
2890----
2891+
2892When setting this parameter it should be verified that there is no
2893existing group with the same name (case-insensitive). Configuring an
2894ambiguous name makes Gerrit fail on startup. Once set Gerrit ensures
2895that it is not possible to create a group with this name. Gerrit also
2896keeps the default name reserved so that it cannot be used for new
2897groups either. This means there is no danger of ambiguous group names
2898when this parameter is removed and the system group uses the default
2899name again.
2900
Edwin Kempinc94df962022-11-03 08:56:21 +01002901[[groups.relevantGroup]]groups.relevantGroup::
2902+
2903UUID of an external group that should always be considered as relevant
2904when checking whether an account is visible.
2905+
2906This setting is only relevant for external group backends and only if
2907the link:#accounts.visibility[account visibility] is set to
2908`SAME_GROUP` or `VISIBLE_GROUP`.
2909+
2910If the link:#accounts.visibility[account visibility] is set to
2911`SAME_GROUP` or `VISIBLE_GROUP` users should see all accounts that are
2912a member of a group that contains themselves or that is visible to
2913them. Checking this would require getting all groups of the current
2914user and all groups of the accounts for which the visibility is being
2915checked, but since getting all groups that a user is a member of is
2916expensive for external group backends Gerrit doesn't query these groups
2917but instead guesses the relevant groups. Guessing relevant groups
2918limits the inspected groups to all groups that are mentioned in the
2919ACLs of the projects that are currently cached (i.e. all groups that
2920are listed in the link:config-project-config.html#file-groups[groups]
2921files of the cached projects). This is not very reliable since it
2922depends on which groups are mentioned in the ACLs and which projects
2923are currently cached. To make this more reliable this configuration
2924parameter allows to configure external groups that should always be
2925considered as relevant.
2926+
2927As said this setting is only relevant for external group backends. In
2928Gerrit core this is only the LDAP backend, but it may apply to further
2929group backends that are added by plugins.
2930+
2931This parameter may be added multiple times to specify multiple relevant
2932groups.
2933
Prakash Aswala6d49fb2020-02-27 15:09:30 +05302934[[has-operand-alias]]
2935=== Section has operand alias
2936
2937'has' operand aliasing allows global aliases to be defined for query
2938'has' operands. Currently only change queries are supported. The alias
2939name is the git config key name, and the 'has' operand being aliased
2940is the git config value.
2941
2942For example:
2943
2944----
2945[has-operand-alias "change"]
2946 oldtopic = topic
2947----
2948
2949This section is particularly useful to alias 'has' operands (which may
2950be long and clunky as they include a plugin name in them) to shorter
2951operands without the plugin name. Admins should take care to choose
2952shorter operands that are unique and unlikely to conflict in the future.
2953
2954Aliases are resolved dynamically at invocation time to the currently
2955loaded version of plugins. If a referenced plugin is not loaded, or
2956does not define the command, "unsupported operand" is returned to the
2957user.
2958
2959Aliases will override existing 'has' operands. In case of multiple
2960aliases with same name, the last one defined will be used.
2961
2962When the target of an alias does not exist, the 'has' operand with the
2963name of the alias will be used (if present). This enables an admin to
2964configure the system to override a core 'has' operand with an operand
2965provided by a plugin when present and otherwise fall back to the 'has'
2966operand provided by core.
2967
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002968[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002969=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002970
2971[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002972+
2973URL of the proxy server when making outgoing HTTP
2974connections for OpenID login transactions. Syntax
2975should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002976
2977[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002978+
2979Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002980This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002981appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002982
2983[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002984+
2985Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002986This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002987appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002988
Hugo Arès88e33ac2014-03-03 13:52:45 -05002989[[http.addUserAsRequestAttribute]]http.addUserAsRequestAttribute::
2990+
2991If true, 'User' attribute will be added to the request attributes so it
2992can be accessed outside the request scope (will be set to username or id
2993if username not configured).
2994+
2995This attribute can be used by the servlet container to log user in the
2996http access log.
2997+
2998When running the embedded servlet container, this attribute is used to
2999print user in the httpd_log.
3000+
3001* `%{User}r`
3002+
3003Pattern to print user in Tomcat AccessLog.
3004
3005+
3006Default value is true.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08003007
Gustaf Lundhe45c3332018-05-02 10:52:11 +02003008[[http.addUserAsResponseHeader]]http.addUserAsResponseHeader::
3009+
3010If true, the header 'User' will be added to the list of response headers so it
3011can be accessed from a reverse proxy for logging purposes.
3012
3013+
3014Default value is false.
3015
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003016[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003017=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003018
3019The httpd section configures the embedded servlet container.
3020
3021[[httpd.listenUrl]]httpd.listenUrl::
3022+
Gert van Dijk70e26612019-09-29 16:20:25 +02003023Configuration for the listening sockets of the internal HTTP daemon.
3024Each entry of `listenUrl` combines the following options for a
3025listening socket: protocol, network address, port and context path.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003026+
Gert van Dijk70e26612019-09-29 16:20:25 +02003027_Protocol_ can be either `http://`, `https://`, `proxy-http://` or
3028`proxy-https://`. The latter two are special forms of `http://` with
3029awareness of a reverse proxy (see below). _Network address_ selects
3030the interface and/or scope of the listening socket. For notes
3031examples, see below. _Port_ is the TCP port number and is optional
3032(default value depends on the protocol). _Context path_ is the
3033optional "base URI" for the Gerrit Code Review as application to
3034serve on.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003035+
Gert van Dijk70e26612019-09-29 16:20:25 +02003036**Protocol** schemes:
3037+
3038* `http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003039+
3040Plain-text HTTP protocol. If port is not supplied, defaults to 80,
3041the standard HTTP port.
3042+
Gert van Dijk70e26612019-09-29 16:20:25 +02003043* `https://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003044+
3045SSL encrypted HTTP protocol. If port is not supplied, defaults to
3046443, the standard HTTPS port.
3047+
Gert van Dijk70e26612019-09-29 16:20:25 +02003048For configuration of the certificate and private key, see
3049<<httpd.sslKeyStore,httpd.sslKeyStore>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003050+
Gert van Dijk70e26612019-09-29 16:20:25 +02003051[NOTE]
3052SSL/TLS configuration capabilities of Gerrit internal HTTP daemon
3053are very limited. Externally facing production sites are strongly
3054encouraged to use a reverse proxy configuration to handle SSL/TLS
3055and use a `proxy-https://` scheme here (below) for security and
3056performance reasons.
3057+
3058* `proxy-http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003059+
3060Plain-text HTTP relayed from a reverse proxy. If port is not
3061supplied, defaults to 8080.
3062+
Gert van Dijk70e26612019-09-29 16:20:25 +02003063Like `http://`, but additional header parsing features are
3064enabled to honor `X-Forwarded-For`, `X-Forwarded-Host` and
3065`X-Forwarded-Server`. These headers are typically set by Apache's
Marian Harbach34253372019-12-10 18:01:31 +01003066link:https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#x-headers[mod_proxy,role=external,window=_blank].
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003067+
Gert van Dijk70e26612019-09-29 16:20:25 +02003068[NOTE]
3069--
3070For secruity reasons, make sure to only allow connections from a
3071trusted reverse proxy in your network, as clients could otherwise
3072easily spoof these headers and thus spoof their originating IP
3073address effectively. If the reverse proxy is running on the same
3074machine as Gerrit daemon, the use of a _loopback_ network address
3075to bind to (see below) is strongly recommended to mitigate this.
3076
3077If not using Apache's mod_proxy, validate that your reverse proxy
3078sets these headers on all requests. If not, either configure it to
3079sanitize them from the origin, or use the `http://` scheme instead.
3080--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003081+
Gert van Dijk70e26612019-09-29 16:20:25 +02003082* `proxy-https://`
3083+
3084Plain-text HTTP relayed from a reverse proxy that has already
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003085handled the SSL encryption/decryption. If port is not supplied,
3086defaults to 8080.
3087+
Gert van Dijk70e26612019-09-29 16:20:25 +02003088Behaves exactly like `proxy-http://`, but also sets the scheme to
3089assume `https://` is the proper URL back to the server.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003090
3091+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003092--
Gert van Dijk70e26612019-09-29 16:20:25 +02003093**Network address** forms:
3094
3095* Loopback (localhost): `127.0.0.1` (IPv4) or `[::1]` (IPv6).
3096* All (unspecified): `0.0.0.0` (IPv4), `[::]` (IPv6) or `*`
3097 (IPv4 and IPv6)
3098* Interface IP address, e.g. `1.2.3.4` (IPv4) or
3099 `[2001:db8::a00:20ff:fea7:ccea]` (IPv6)
3100* Hostname, resolved at startup time to an address.
3101
3102**Context path** is the local part of the URL to be used to access
3103Gerrit on ('base URL'). E.g. `/gerrit/` to serve Gerrit on that URI
3104as base. If set, consider to align this with the
3105<<gerrit.canonicalWebUrl,gerrit.canonicalWebUrl>> setting. Correct
3106settings may depend on the reverse proxy configuration as well. By
3107default, this is `/` so that Gerrit serves requests on the root.
3108
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003109If multiple values are supplied, the daemon will listen on all
3110of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003111
Gert van Dijk70e26612019-09-29 16:20:25 +02003112Examples:
3113
3114----
3115[httpd]
3116 listenUrl = proxy-https://127.0.0.1:9999/gerrit/
3117[gerrit]
3118 # Reverse proxy is configured to serve with SSL/TLS on
3119 # example.com and to relay requests on /gerrit/ onto
3120 # http://127.0.0.1:9999/gerrit/
3121 canonicalWebUrl = https://example.com/gerrit/
3122----
3123
3124----
3125[httpd]
3126 # Listen on specific external interface with plaintext
3127 # HTTP on IPv6.
3128 listenUrl = http://[2001:db8::a00:20ff:fea7:ccea]
3129
3130 # Also listen on specific internal interface for use with
3131 # reverse proxy run on another host.
3132 listenUrl = proxy-https://192.168.100.123
3133----
3134
3135See also the page on link:config-reverseproxy.html[reverse proxy]
3136configuration.
3137
3138By default, `\http://*:8080`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003139--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003140
3141[[httpd.reuseAddress]]httpd.reuseAddress::
3142+
3143If true, permits the daemon to bind to the port even if the port
3144is already in use. If false, the daemon ensures the port is not
3145in use before starting. Busy sites may need to set this to true
3146to permit fast restarts.
3147+
3148By default, true.
3149
Luca Milanesio4e2bb452018-03-21 09:07:24 +00003150[[httpd.gracefulStopTimeout]]httpd.gracefulStopTimeout::
3151+
3152Set a graceful stop time. If set, the daemon ensures that all incoming
3153calls are preserved for a maximum period of time, before starting
3154the graceful shutdown process. Sites behind a workload balancer such as
3155HAProxy would need this to be set for avoiding serving errors during
3156rolling restarts.
3157+
3158Values should use common unit suffixes to express their setting:
3159+
3160* s, sec, second, seconds
3161* m, min, minute, minutes
3162+
3163By default, 0 seconds (immediate shutdown).
3164
Thomas Meyeraa93fdf2016-10-23 10:53:48 +02003165[[httpd.inheritChannel]]httpd.inheritChannel::
3166+
3167If true, permits the daemon to inherit its server socket channel
3168from fd0/1(stdin/stdout). When set to true, the server can be socket
3169activated via systemd or xinetd.
3170+
3171By default, false.
3172
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003173[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
3174+
3175Size, in bytes, of the buffer used to parse the HTTP headers of an
3176incoming HTTP request. The entire request headers, including any
3177cookies sent by the browser, must fit within this buffer, otherwise
3178the server aborts with the response '413 Request Entity Too Large'.
3179+
3180One buffer of this size is allocated per active connection.
3181Allocating a buffer that is too large wastes memory that cannot be
3182reclaimed, allocating a buffer that is too small may cause unexpected
3183errors caused by very long Referer URLs or large cookie values.
3184+
3185By default, 16384 (16 K), which is sufficient for most OpenID and
3186other web-based single-sign-on integrations.
3187
Chulho Yangb72ff8f2013-07-04 02:35:53 -04003188[[httpd.sslCrl]]httpd.sslCrl::
3189+
3190Path of the certificate revocation list file in PEM format. This
3191crl file is optional, and available for CLIENT_SSL_CERT_LDAP
3192authentication.
3193+
3194To create and view a crl using openssl:
3195+
3196----
3197openssl ca -gencrl -out crl.pem
3198openssl crl -in crl.pem -text
3199----
3200+
3201If not absolute, the path is resolved relative to `$site_path`.
3202+
3203By default, `$site_path/etc/crl.pem`.
3204
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003205[[httpd.sslKeyStore]]httpd.sslKeyStore::
3206+
3207Path of the Java keystore containing the server's SSL certificate
3208and private key. This keystore is required for `https://` in URL.
3209+
3210To create a self-signed certificate for simple internal usage:
3211+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003212----
3213keytool -keystore keystore -alias jetty -genkey -keyalg RSA
3214chmod 600 keystore
3215----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003216+
3217If not absolute, the path is resolved relative to `$site_path`.
3218+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003219By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003220
3221[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
3222+
3223Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09003224Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003225doesn't want to enable one.
3226+
3227If set to the empty string the embedded server will prompt for the
3228password during startup.
3229+
3230By default, `gerrit`.
3231
Shawn O. Pearce1766f502010-01-15 10:49:46 -08003232[[httpd.requestLog]]httpd.requestLog::
3233+
3234Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
3235If enabled, an NCSA combined log format request log file is written
Matthias Sohn450bc202020-08-20 14:40:32 +02003236out by the internal HTTP daemon. The httpd log format is documented
3237link:logs.html#_httpd_log[here].
Shawn O. Pearce1766f502010-01-15 10:49:46 -08003238+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01003239`log4j.appender` with the name `httpd_log` can be configured to overwrite
3240programmatic configuration.
3241+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08003242By default, true if httpd.listenUrl uses http:// or https://,
3243and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
3244
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003245[[httpd.acceptorThreads]]httpd.acceptorThreads::
3246+
3247Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09003248connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003249+
3250By default, 2, which should be suitable for most high-traffic sites.
3251
3252[[httpd.minThreads]]httpd.minThreads::
3253+
3254Minimum number of spare threads to keep in the worker thread pool.
3255This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09003256multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003257+
3258By default, 5, suitable for most lower-volume traffic sites.
3259
3260[[httpd.maxThreads]]httpd.maxThreads::
3261+
3262Maximum number of threads to permit in the worker thread pool.
3263+
3264By default 25, suitable for most lower-volume traffic sites.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02003265+
3266[NOTE]
3267Unless SSH daemon is disabled, see <<sshd.listenAddress, sshd.listenAddress>>,
3268the max number of concurrent Git requests over HTTP and SSH together is
3269defined by the <<sshd.threads, sshd.threads>> and
3270<<sshd.batchThreads, sshd.batchThreads>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003271
3272[[httpd.maxQueued]]httpd.maxQueued::
3273+
3274Maximum number of client connections which can enter the worker
3275thread pool waiting for a worker thread to become available.
David Ostrovsky14fe8bc2014-03-26 06:03:44 -070032760 sets the queue size to the Integer.MAX_VALUE.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003277+
Luca Milanesio0ae62fe2015-09-04 07:56:00 -07003278By default 200.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003279
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08003280[[httpd.maxWait]]httpd.maxWait::
3281+
David Pursehouse221d4f62012-06-08 17:38:08 +09003282Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08003283thread to handle a project clone, fetch or push request over the
3284smart HTTP transport.
3285+
3286Values should use common unit suffixes to express their setting:
3287+
3288* s, sec, second, seconds
3289* m, min, minute, minutes
3290* h, hr, hour, hours
3291* d, day, days
3292* w, week, weeks (`1 week` is treated as `7 days`)
3293* mon, month, months (`1 month` is treated as `30 days`)
3294* y, year, years (`1 year` is treated as `365 days`)
3295
3296+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003297--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08003298If a unit suffix is not specified, `minutes` is assumed. If 0
3299is supplied, the maximum age is infinite and connections will not
3300abort until the client disconnects.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003301
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08003302By default, 5 minutes.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003303--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08003304
Luca Milanesioce7b7452013-06-18 11:40:49 +01003305[[httpd.filterClass]]httpd.filterClass::
3306+
3307Class that implements the javax.servlet.Filter interface
3308for filtering any HTTP related traffic going through the Gerrit
3309HTTP protocol.
3310Class is loaded and configured in the Gerrit Jetty container
3311and run in front of all Gerrit URL handlers, allowing the filter
3312to inspect, modify, allow or reject each request.
3313It needs to be provided as JAR library
3314under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
3315loader and cannot be dynamically loaded by a plugin.
3316+
3317Failing to load the Filter class would result in a Gerrit start-up
3318failure, as this class is supposed to provide mandatory filtering
3319in front of Gerrit HTTP protocol.
3320+
David Pursehouse42f42042013-08-01 14:02:25 +09003321Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01003322of an Apache HTTP proxy layer as security enforcement on top of Gerrit
3323by returning a trusted username as HTTP Header.
3324+
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01003325Allow multiple values to install multiple servlet filters.
3326+
Luca Milanesioce7b7452013-06-18 11:40:49 +01003327Example of using a security library secure.jar under $GERRIT_SITE/lib
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01003328that provides a org.anyorg.MySecureHeaderFilter Servlet Filter that enforces
3329a trusted username in the `TRUSTED_USER` HTTP Header and
3330org.anyorg.MySecureIPFilter that performs source IP security filtering:
Dyrone Teng14fc0832019-09-27 16:59:02 +08003331+
Luca Milanesioce7b7452013-06-18 11:40:49 +01003332----
3333[auth]
3334 type = HTTP
3335 httpHeader = TRUSTED_USER
3336
Dariusz Lukszaaac01132015-02-11 12:13:07 +01003337[httpd]
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01003338 filterClass = org.anyorg.MySecureHeaderFilter
3339 filterClass = org.anyorg.MySecureIPFilter
Luca Milanesioce7b7452013-06-18 11:40:49 +01003340----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003341
Teng Longc192ca92019-09-23 11:22:03 +08003342[[filterClass.className.initParam]]filterClass.<className>.initParam::
3343+
3344Gerrit supports customized pluggable HTTP filters as `filterClass`. This
3345option allows to pass extra initialization parameters to the filter. It
3346allows for multiple key/value pairs to be passed in this pattern:
3347+
3348----
3349initParam = <key>=<value>
3350----
3351For a comprehensive example:
3352+
3353----
3354[httpd]
3355 filterClass = org.anyorg.AFilter
3356 filterClass = org.anyorg.BFilter
3357[filterClass "org.anyorg.AFilter"]
3358 key1 = value1
3359 key2 = value2
3360[filterClass "org.anyorg.BFilter"]
3361 key3 = value3
3362----
3363
Luca Milanesiodca95d52017-05-09 21:22:21 +01003364[[httpd.idleTimeout]]httpd.idleTimeout::
3365+
3366Maximum idle time for a connection, which roughly translates to the
3367TCP socket `SO_TIMEOUT`.
3368+
Luca Milanesiodca95d52017-05-09 21:22:21 +01003369This value is interpreted as the maximum time between some progress
3370being made on the connection. So if a single byte is read or written,
3371then the timeout is reset.
3372+
David Pursehouse9f0e5bc2017-06-30 16:16:53 +09003373The max idle time is applied:
3374+
3375* When waiting for a new message to be received on a connection
3376* When waiting for a new message to be sent on a connection
3377
3378+
Luca Milanesiodca95d52017-05-09 21:22:21 +01003379By default, 30 seconds.
3380
Juan Hernandezec512562013-08-06 16:30:50 +02003381[[httpd.robotsFile]]httpd.robotsFile::
3382+
3383Location of an external robots.txt file to be used instead of the one
3384bundled with the .war of the application.
3385+
3386If not absolute, the path is resolved relative to `$site_path`.
3387+
3388If the file doesn't exist or can't be read the default robots.txt file
3389bundled with the .war will be used instead.
3390
Dariusz Luksza011cfed2014-04-03 10:23:35 +02003391[[httpd.registerMBeans]]httpd.registerMBeans::
3392+
3393Enable (or disable) registration of Jetty MBeans for Java JMX.
3394+
3395By default, false.
3396
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003397[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003398=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09003399
3400The index section configures the secondary index.
3401
David Pursehouse3fc5ee32014-03-17 18:35:32 +09003402Note that after enabling the secondary index, the index must be built
3403using the link:pgm-reindex.html[reindex program] before restarting the
3404Gerrit server.
3405
David Pursehouse6d458432013-08-23 16:17:18 +09003406[[index.type]]index.type::
3407+
Luca Milanesioc336ce92021-11-16 01:10:49 +00003408*(DEPRECATED)* The only supported value is `LUCENE`, which is the default,
3409that means a link:http://lucene.apache.org/[Lucene]
3410index is used.
David Pursehouse6d458432013-08-23 16:17:18 +09003411+
Luca Milanesioc336ce92021-11-16 01:10:49 +00003412For using other indexing backends (e.g. ElasticSearch), refer to
3413`gerrit.installIndexModule` setting.
David Pursehouse6d458432013-08-23 16:17:18 +09003414+
David Pursehouse904db302014-03-17 18:55:38 +09003415[[index.threads]]index.threads::
3416+
Hugo Arèsfab06702016-06-10 12:49:52 -04003417Number of threads to use for indexing in normal interactive operations. Setting
3418it to 0 disables the dedicated thread pool and indexing will be done in the same
3419thread as the operation.
David Pursehouse904db302014-03-17 18:55:38 +09003420+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02003421If not set or set to a zero, defaults to the number of logical CPUs as returned
3422by the JVM. If set to a negative value, defaults to a direct executor.
David Pursehouse00c82142014-01-22 17:41:09 +09003423
Dave Borowitz787af5f2014-10-22 16:26:00 -07003424[[index.batchThreads]]index.batchThreads::
3425+
3426Number of threads to use for indexing in background operations, such as
Adithya Chakilam963727c2021-11-04 10:15:43 -07003427online schema upgrades, and also the default for offline reindexing.
Dave Borowitz787af5f2014-10-22 16:26:00 -07003428+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02003429If not set or set to a zero, defaults to the number of logical CPUs as returned
3430by the JVM. If set to a negative value, defaults to a direct executor.
Dave Borowitz787af5f2014-10-22 16:26:00 -07003431
Luca Milanesio8ee12d52022-10-27 23:14:13 +01003432[[index.cacheQueryResultsByChangeNum]]index.cacheQueryResultsByChangeNum::
3433+
3434Allow to cache and reuse the change JSON elements by their Change number.
3435This improves the performance of queries that are returning Changes duplicates.
3436It needs to be turned off when having Changes imported from other servers
3437because of the potential conflicts of change numbers.
3438+
3439Defaults to true.
3440
Dave Borowitzd80b9342015-03-25 10:32:21 -07003441[[index.onlineUpgrade]]index.onlineUpgrade::
3442+
3443Whether to upgrade to new index schema versions while the server is
3444running. This is recommended as it prevents additional downtime during
3445Gerrit version upgrades (avoiding the need for an offline reindex step
3446using Reindex), but can add additional server load during the upgrade.
3447+
3448If set to false, there is no way to upgrade the index schema to take
3449advantage of new search features without restarting the server.
3450+
3451Defaults to true.
3452
Thomas Draebingfafafb92023-01-04 14:44:15 +01003453[[index.excludeProjectFromChangeReindex]]index.excludeProjectFromChangeReindex::
3454+
3455A list of projects that will be excluded from reindexing. This can be used
3456to exclude projects which are expensive to reindex to prioritize the other
3457projects.
3458+
3459Excluded projects can later be reindexed by for example using the
3460link:cmd-index-changes-in-project.html[index changes in project command].
3461
Kaushik Lingarkar7fdf4142022-08-17 13:57:27 -07003462[[index.paginationType]]index.paginationType::
3463+
3464The pagination type to use when index queries are repeated to
3465obtain the next set of results. Supported values are:
3466+
3467* `OFFSET`
3468+
3469Index queries are repeated with a non-zero offset to obtain the
3470next set of results.
Diego Zambelli Sessonaa0da7232023-07-10 14:22:29 +01003471_Note: Results may be inaccurate if the data-set is changing during the query
3472execution._
Kaushik Lingarkar7fdf4142022-08-17 13:57:27 -07003473+
3474* `SEARCH_AFTER`
3475+
Kaushik Lingarkar75096ad2022-09-13 10:16:15 -07003476Index queries are repeated using a search-after object. Index
3477backends can provide their custom implementations for search-after.
3478Note that, `SEARCH_AFTER` does not impact using offsets in Gerrit
3479query APIs.
Diego Zambelli Sessonaa0da7232023-07-10 14:22:29 +01003480_Note: Depending on the index backend and its settings, results may be
3481inaccurate if the data-set is changing during the query execution._
3482+
3483* `NONE`
3484+
3485Index queries are executed returning all results, without internal
3486pagination.
3487_Note: Since the entire set of indexing results is kept in memory
3488during the API execution, this option may lead to higher memory utilisation
3489and overall reduced performance.
3490Bear in mind that some indexing backends may not support unbounded queries;
3491therefore, the NONE option is unavailable._
Kaushik Lingarkar7fdf4142022-08-17 13:57:27 -07003492+
3493Defaults to `OFFSET`.
3494
Ben Rohlfs618b7cc2023-07-28 12:22:19 +00003495[[index.defaultLimit]]index.defaultLimit::
3496+
3497Default limit, if the user does not provide a limit. If this is not set or set
3498to 0, then index queries are executed with the maximum permitted limit for the
3499user, which may be really high and cause too much load on the index. Thus
3500setting this default limit to something smaller like 100 allows you to control
3501the load, while not taking away any permission from the user. If the user
3502provides a limit themselves, then `defaultLimit` is ignored.
3503
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07003504[[index.maxLimit]]index.maxLimit::
3505+
3506Maximum limit to allow for search queries. Requesting results above this
3507limit will truncate the list (but will still set `_more_changes` on
3508result lists). Set to 0 for no limit.
3509+
David Pursehouse52c2b4a2018-04-10 23:38:57 +09003510When `index.type` is set to `LUCENE`, defaults to no limit.
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07003511
Dave Borowitzf56d3652015-04-22 17:35:34 -07003512[[index.maxPages]]index.maxPages::
3513+
3514Maximum number of pages of search results to allow, as index
3515implementations may have to scan through large numbers of skipped
3516results when searching with an offset. Requesting results starting past
3517this threshold times the requested limit will result in an error. Set to
35180 for no limit.
3519+
3520Defaults to no limit.
3521
Kaushik Lingarkarf84e5182022-08-12 13:27:37 -07003522[[index.pageSizeMultiplier]]index.pageSizeMultiplier::
3523+
3524When index queries are repeated to obtain more results, this multiplier
3525will be used to determine the limit for the next query. Using a page
3526multiplier allows queries to start off small and thus provide good
3527latency for queries which may end up only having very few results, and
3528then scaling up to have better throughput to handle queries with larger
3529result sets without incurring the overhead of making as many queries as
3530would be required with a smaller limit. This strategy of using a multiplier
3531attempts to create a balance between latency and throughput by dynamically
3532adjusting the query size to the number of results being returned by each
3533query in the pagination.
3534+
3535The larger the multiplier, the better the throughput on large queries, and
3536it also improves latency on large queries by scaling up quickly. However, a
3537larger multiplier can hurt latencies a bit by making the "last" query in a
3538series longer than needed. The impact of this depends on how much the backend
3539latency goes up when specifying a large limit and few results are returned.
3540Setting link:#index.maxPageSize[index.maxPageSize] that isn't too large, can
3541likely help reduce the impacts of this.
3542+
Kaushik Lingarkarf84e5182022-08-12 13:27:37 -07003543For example, if the limit of the previous query was 500 and pageSizeMultiplier
3544is configured to 5, the next query will have a limit of 2500.
3545+
Diego Zambelli Sessonaa0da7232023-07-10 14:22:29 +01003546_Note: ignored when paginationType is `NONE`_
3547+
Kaushik Lingarkarf84e5182022-08-12 13:27:37 -07003548Defaults to 1 which effectively turns this feature off.
3549
3550[[index.maxPageSize]]index.maxPageSize::
3551+
3552Maximum size to allow when index queries are repeated to obtain more results. Note
3553that, link:#index.maxLimit[index.maxLimit] will be used to limit page size if it
3554is configured to a value lower than maxPageSize.
3555+
3556For example, if the limit of previous query was 500, pageSizeMultiplier is
3557configured to 5 and maxPageSize to 2000, the next query will have a limit of
35582000 (instead of 2500).
3559+
Diego Zambelli Sessonaa0da7232023-07-10 14:22:29 +01003560_Note: ignored when paginationType is `NONE`_
3561+
Kaushik Lingarkarf84e5182022-08-12 13:27:37 -07003562Defaults to no limit.
3563
Dave Borowitzd034ca82015-10-15 11:20:30 -04003564[[index.maxTerms]]index.maxTerms::
3565+
3566Maximum number of leaf terms to allow in a query. Too-large queries may
3567perform poorly, so setting this option causes query parsing to fail fast
Dave Borowitzada289c2018-12-18 13:24:14 -08003568before attempting to send them to the secondary index.
Dave Borowitzd034ca82015-10-15 11:20:30 -04003569+
Marco Miller6da22822016-01-29 12:31:38 -05003570When the index type is `LUCENE`, also sets the maximum number of clauses
3571permitted per BooleanQuery. This is so that all enforced query limits
3572are the same.
3573+
3574Defaults to 1024.
Dave Borowitzd034ca82015-10-15 11:20:30 -04003575
Dave Borowitz3747f0f2017-06-23 14:29:31 -04003576[[index.autoReindexIfStale]]index.autoReindexIfStale::
3577+
3578Whether to automatically check if a document became stale in the index
3579immediately after indexing it. If false, there is a race condition during two
3580simultaneous writes that may cause one of the writes to not be reflected in the
3581index. The check to avoid this does consume some resources.
3582+
Dave Borowitzb7da0762018-03-19 09:08:45 -04003583Defaults to false.
Dave Borowitz3747f0f2017-06-23 14:29:31 -04003584
Marija Savtchouk55b15552023-08-28 14:01:05 +00003585[[index.indexChangesAsync]]index.indexChangesAsync::
3586+
3587On BatchUpdate, do not await indexing completion before returning the request
3588to the user (WEB_BROWSER requests only).
3589This has an advantage of faster UI (because indexing latency does not contribute
3590to the write request latency) and disadvantage that the indexing result might not be
3591immediately available after the write request.
3592+
3593Defaults to false.
3594
Edwin Kempin0f0de862018-02-08 16:24:11 +01003595[[index.scheduledIndexer]]
3596==== Subsection index.scheduledIndexer
3597
3598This section configures periodic indexing. Periodic indexing is
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003599intended to run only on replicas and only updates the group index.
3600Replication to replicas happens on Git level so that Gerrit is not aware
3601of incoming replication events. But replicas need an updated group index
Edwin Kempin0f0de862018-02-08 16:24:11 +01003602to resolve memberships of users for ACL validation. To keep the group
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003603index in replicas up-to-date the Gerrit replica periodically scans the
Edwin Kempin0f0de862018-02-08 16:24:11 +01003604group refs in the All-Users repository to reindex groups if they are
3605stale.
3606
3607The scheduled reindexer is not able to detect group deletions that
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003608happened while the replica was offline, but since group deletions are not
Edwin Kempin0f0de862018-02-08 16:24:11 +01003609supported this should never happen. If nevertheless groups refs were
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003610deleted while a replica was offline a full offline link:pgm-reindex.html[
Edwin Kempin0f0de862018-02-08 16:24:11 +01003611reindex] must be performed.
3612
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003613This section is only used if Gerrit runs in replica mode, otherwise it is
Edwin Kempin0f0de862018-02-08 16:24:11 +01003614ignored.
3615
Edwin Kempina32d4432018-02-16 17:18:31 +01003616[[index.scheduledIndexer.runOnStartup]]index.scheduledIndexer.runOnStartup::
3617+
3618Whether the scheduled indexer should run once immediately on startup.
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003619If set to `true` the replica startup is blocked until all stale groups
3620were reindexed. Enabling this allows to prevent that replicas that were
Edwin Kempina32d4432018-02-16 17:18:31 +01003621offline for a longer period of time run with outdated group information
3622until the first scheduled indexing is done.
3623+
3624Defaults to `true`.
3625
Edwin Kempin0f0de862018-02-08 16:24:11 +01003626[[index.scheduledIndexer.enabled]]index.scheduledIndexer.enabled::
3627+
3628Whether the scheduled indexer is enabled. If the scheduled indexer is
3629disabled you must implement other means to keep the group index for the
Luca Milanesio0b6d3d82021-11-13 19:48:47 -08003630replica up-to-date.
Edwin Kempin0f0de862018-02-08 16:24:11 +01003631+
3632Defaults to `true`.
3633
3634[[index.scheduledIndexer.startTime]]index.scheduledIndexer.startTime::
3635+
3636The link:#schedule-configuration-startTime[start time] for running
3637the scheduled indexer.
3638+
3639Defaults to `00:00`.
3640
3641[[index.scheduledIndexer.interval]]index.scheduledIndexer.interval::
3642+
3643The link:#schedule-configuration-interval[interval] for running
3644the scheduled indexer.
3645+
3646Defaults to `5m`.
3647
3648link:#schedule-configuration-examples[Schedule examples] can be found
3649in the link:#schedule-configuration[Schedule Configuration] section.
3650
David Pursehouse902b3ee2014-07-09 16:17:49 +09003651==== Lucene configuration
3652
3653Open and closed changes are indexed in separate indexes named
3654'open' and 'closed' respectively.
3655
3656The following settings are only used when the index type is `LUCENE`.
David Pursehouseac88c362014-02-06 12:01:34 +09003657
David Pursehouse00c82142014-01-22 17:41:09 +09003658[[index.name.ramBufferSize]]index.name.ramBufferSize::
3659+
David Pursehouse00c82142014-01-22 17:41:09 +09003660Determines the amount of RAM that may be used for buffering added documents
3661and deletions before they are flushed to the index. See the
3662link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
Marian Harbach34253372019-12-10 18:01:31 +01003663Lucene documentation,role=external,window=_blank] for further details.
David Pursehouse00c82142014-01-22 17:41:09 +09003664+
3665Defaults to 16M.
3666
3667[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
3668+
David Pursehouse00c82142014-01-22 17:41:09 +09003669Determines the minimal number of documents required before the buffered
3670in-memory documents are flushed to the index. Large values generally
3671give faster indexing. See the
3672link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
Marian Harbach34253372019-12-10 18:01:31 +01003673Lucene documentation,role=external,window=_blank] for further details.
David Pursehouse00c82142014-01-22 17:41:09 +09003674+
3675Defaults to -1, meaning no maximum is set and the writer will flush
3676according to RAM usage.
3677
Dave Borowitzd08b0452014-02-13 11:56:03 -08003678[[index.name.commitWithin]]index.name.commitWithin::
3679+
Dave Borowitzd08b0452014-02-13 11:56:03 -08003680Determines the period at which changes are automatically committed to
3681stable store on disk. This is a costly operation and may block
3682additional index writes, so lower with caution.
3683+
Bruce Zuaf058e62014-03-21 10:03:05 +08003684If zero, changes are committed after every write. This is very costly
3685but may be useful if offline reindexing is infeasible, or for development
3686servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08003687+
Bruce Zuaf058e62014-03-21 10:03:05 +08003688Values can be specified using standard time unit abbreviations (`ms`, `sec`,
3689`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07003690+
Bruce Zuaf058e62014-03-21 10:03:05 +08003691If negative, `commitWithin` is disabled. Changes are flushed to disk when
3692the in-memory buffer fills, but only committed and guaranteed to be synced
3693to disk when the process finishes.
David Pursehouse902b3ee2014-07-09 16:17:49 +09003694+
Dave Borowitzd08b0452014-02-13 11:56:03 -08003695Defaults to 300000 ms (5 minutes).
3696
Trevor Getty8fb5db52019-08-26 14:33:19 +02003697
3698[[index.name.maxMergeCount]]index.name.maxMergeCount::
3699+
3700Determines the max number of simultaneous merges that are allowed. If a merge
3701is necessary yet we already have this many threads running, the incoming thread
3702(that is calling add/updateDocument) will block until a merge thread has
3703completed. Note that Lucene will only run the smallest maxThreadCount merges
3704at a time. See the
3705link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Marian Harbach34253372019-12-10 18:01:31 +01003706Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003707+
3708Defaults to -1 for (auto detection).
3709
3710
3711[[index.name.maxThreadCount]]index.name.maxThreadCount::
3712+
3713Determines the max number of simultaneous Lucene merge threads that should be running at
3714once. This must be less than or equal to maxMergeCount. See the
3715link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Marian Harbach34253372019-12-10 18:01:31 +01003716Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003717+
3718For further details on Lucene index configuration (auto detection) which
3719affects maxThreadCount and maxMergeCount settings.
3720See the
3721link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#AUTO_DETECT_MERGES_AND_THREADS[
Marian Harbach34253372019-12-10 18:01:31 +01003722Lucene documentation,role=external,window=_blank]
Trevor Getty8fb5db52019-08-26 14:33:19 +02003723+
3724Defaults to -1 for (auto detection).
3725
3726[[index.name.enableAutoIOThrottle]]index.name.enableAutoIOThrottle::
3727+
3728Allows the control of whether automatic IO throttling is enabled and used by
3729default in the lucene merge queue. Automatic dynamic IO throttling, which when
3730on is used to adaptively rate limit writes bytes/sec to the minimal rate necessary
3731so merges do not fall behind. See the
3732link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#enableAutoIOThrottle()[
Marian Harbach34253372019-12-10 18:01:31 +01003733Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003734+
3735Defaults to true (throttling enabled).
3736
Adithya Chakilam2fd651a2021-10-20 14:04:49 -05003737During offline reindexing, setting ramBufferSize greater than the size
3738of index (size of specific index folder under <site_dir>/index) and
3739maxBufferedDocs as -1 avoids unnecessary flushes and triggers only a
3740single flush at the end of the process.
3741
David Pursehouse902b3ee2014-07-09 16:17:49 +09003742Sample Lucene index configuration:
David Pursehouse00c82142014-01-22 17:41:09 +09003743----
3744[index]
3745 type = LUCENE
3746
3747[index "changes_open"]
3748 ramBufferSize = 60 m
3749 maxBufferedDocs = 3000
Trevor Getty8fb5db52019-08-26 14:33:19 +02003750 maxThreadCount = 5
3751 maxMergeCount = 50
3752
David Pursehouse00c82142014-01-22 17:41:09 +09003753
3754[index "changes_closed"]
3755 ramBufferSize = 20 m
3756 maxBufferedDocs = 500
Trevor Getty8fb5db52019-08-26 14:33:19 +02003757 maxThreadCount = 10
3758 maxMergeCount = 100
3759 enableIOThrottle = false
3760
David Pursehouse00c82142014-01-22 17:41:09 +09003761----
3762
Patrick Hieselda692472019-10-07 16:03:23 +02003763[[event]]
3764=== Section event
3765
3766[[event.payload.listChangeOptions]]events.payload.listChangeOptions::
3767+
3768List of options that Gerrit applies when rendering the payload of an
3769internal event. This is the same set of options that are documented
3770link:rest-api-changes.html#query-options[here].
3771+
3772Depending on the setup, these events might get serialized using stream
3773events.
3774+
3775This can be set to the set of minimal options that consumers of Gerrit's
Patrick Hiesela4824db2019-12-20 10:55:26 +01003776events need. A minimal set would be (`SKIP_DIFFSTAT`).
Patrick Hieselda692472019-10-07 16:03:23 +02003777+
3778Every option that gets added here will have a performance impact. The
3779general recommendation is therefore to set this to a minimal set of
3780required options.
3781+
3782Defaults to all available options minus `CHANGE_ACTIONS`,
3783`CURRENT_ACTIONS` and `CHECK`. This is a rich default to make sure the
3784config is backwards compatible with what the default was before the config
3785was added.
3786
David Ostrovsky0e4db922021-02-13 10:06:43 +01003787[[event.comment-added.publishPatchSetLevelComment]]event.comment-added.publishPatchSetLevelComment::
David Ostrovskyd14db1f2020-12-09 19:59:55 +01003788+
3789Add patch set level comment as event comment. Without this option, patch set
3790level comment will not be included in the event comment attribute. Given that
3791currently patch set level, file and robot comments are not exposed in the
3792`comment-added` event type, those comments will be lost. One particular use
3793case is to re-trigger CI build from the change screen by adding a comment with
3794specific content, e.g.: `recheck`. Jenkins Gerrit Trigger plugin and Zuul CI
3795depend on this feature to trigger change verification.
3796+
3797By default, true.
3798
Marcin Czeche8a73552023-06-06 15:14:17 +02003799[[event.stream-events.enableRefUpdatedEvents]]event.stream-events.enableRefUpdatedEvents::
3800+
3801Enable streaming of `ref-updated` event which represents a single ref update operation.
3802Batch ref updates are represented as a series of `ref-updated` events.
3803This allows event listeners to react on a ref update.
3804Please consider switching to `batch-ref-updated` event which provides better control on grouping and
3805preserving order of the ref updates.
3806+
3807By default, true.
3808
3809[[event.stream-events.enableBatchRefUpdatedEvents]]event.stream-events.enableBatchRefUpdatedEvents::
3810+
3811Enable streaming of `batch-ref-updated` event which represents group of
3812refs updated during a single batch ref update operation.
3813Single ref updates are also streamed as a `batch-ref-updated` events with a single ref specified.
3814This allows event listeners to react on all ref updated events and disable individual `ref-updated`
3815events by setting <<event.stream-events.enableRefUpdatedEvents, event.stream-events.enableRefUpdatedEvents>> to false.
3816+
3817By default, false.
3818
Fabio Ponciroli5d5c1592023-09-08 11:46:03 +02003819[[event.stream-events.enableDraftCommentEvents]]event.stream-events.enableDraftCommentEvents::
3820+
3821Enable streaming of `ref-updated` events for `refs/draft-comments` refs.
3822Enable this flag in case listeners in your system are supposed to react on draft operations.
3823+
3824NOTE: Due to the nature of drafts, the amount of `ref-updated` events created on draft operations could be high.
3825The extra amount of events depends on the usage pattern of the installation. It is worth evaluating
3826the amount of extra events produced before enabling this flag by counting the calls to the draft APIs.
3827+
3828By default, false.
3829
Patrick Hieselbe98d8c2020-12-07 14:59:55 +01003830[[experiments]]
3831=== Section experiments
3832
Marija Savtchoukb062da32021-02-05 09:35:04 +00003833This section covers experimental new features. Gerrit uses experiments
3834to research new behavior in frontend and core backend. Once the research is done, the experimental
3835feature either stays and the experimentation flag gets removed, or the feature as a whole
Patrick Hieselbe98d8c2020-12-07 14:59:55 +01003836gets removed
3837
3838[[experiments.enabled]]experiments.enabled::
3839+
3840List of experiments that are currently enabled. The release notes contain currently
3841available experiments.
3842+
3843We will not remove experiments in stable patch releases. They are likely to be
3844removed in the next stable version.
3845
3846----
3847[experiments]
3848 enabled = ExperimentKey
3849----
Patrick Hieselda692472019-10-07 16:03:23 +02003850
Patrick Hiesel17142dc2020-12-07 15:17:24 +01003851[[experiments.disabled]]experiments.disabled::
3852+
3853List of experiments that are currently disabled. The release notes contain currently
3854available experiments. This list disables experiments with the given key that are
3855either enabled by default or explicitly in the config.
3856
3857----
3858[experiments]
3859 disabled = ExperimentKey
3860----
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003861
3862[[ldap]]
3863=== Section ldap
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003864
Luca Milanesioa05d42b2018-12-19 01:13:06 +00003865LDAP integration is only enabled if `auth.type` is set to
3866`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
3867detailed description of the `auth.type` settings and their
3868implications.
3869
3870An example LDAP configuration follows, and then discussion of
3871the parameters introduced here. Suitable defaults for most
3872parameters are automatically guessed based on the type of server
3873detected during startup. The guessed defaults support
Marian Harbach34253372019-12-10 18:01:31 +01003874link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307,role=external,window=_blank], Active
3875Directory and link:https://www.freeipa.org[FreeIPA,role=external,window=_blank].
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003876
3877----
3878[ldap]
3879 server = ldap://ldap.example.com
3880
3881 accountBase = ou=people,dc=example,dc=com
3882 accountPattern = (&(objectClass=person)(uid=${username}))
3883 accountFullName = displayName
3884 accountEmailAddress = mail
3885
3886 groupBase = ou=groups,dc=example,dc=com
3887 groupMemberPattern = (&(objectClass=group)(member=${dn}))
3888----
3889
Luca Milanesioa05d42b2018-12-19 01:13:06 +00003890[[ldap.guessRelevantGroups]]ldap.guessRelevantGroups::
3891+
3892Filter the groups found in LDAP by guessing the ones relevant to
3893Gerrit and removing the others from list completions and ACL evaluations.
3894The guess is based on two elements: the projects most recently
3895accessed in the cache and the list of LDAP groups included in their ACLs.
3896+
3897Please note that projects rarely used and thus not cached may be
3898temporarily inaccessible by users even with LDAP membership and grants
3899referenced in the ACLs.
3900+
3901By default, true.
3902
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003903[[ldap.server]]ldap.server::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003904+
3905URL of the organization's LDAP server to query for user information
3906and group membership from. Must be of the form `ldap://host` or
3907`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003908+
David Pursehouse42f42042013-08-01 14:02:25 +09003909If `auth.type` is `LDAP` this setting should use `ldaps://` to
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003910ensure the end user's plaintext password is transmitted only over
3911an encrypted connection.
Matthias Sohn1e2ec072020-10-16 13:57:11 +02003912+
3913If you want to configure multiple ldap servers you can try to put
3914multiple ldap urls separated by a space:
3915`server = ldaps://ldap1 ldaps://ldap2`
Edwin Kempin6d99fb62023-06-21 10:08:28 +00003916See https://issues.gerritcodereview.com/issues/40010644[issue 40010644].
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003917
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003918[[ldap.startTls]]ldap.startTls::
3919+
3920If true, Gerrit will perform StartTLS extended operation.
3921+
3922By default, false, StartTLS will not be enabled.
3923
Alon Bar-Leve39c35c2019-06-10 12:59:55 +03003924[[ldap.supportAnonymous]]ldap.supportAnonymous::
3925+
3926If false, Gerrit will provide credentials only at connection open, this is
3927required for some `LDAP` implementations that do not allow anonymous bind
3928for StartTLS or for reauthentication.
3929+
3930By default, true.
3931
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003932[[ldap.sslVerify]]ldap.sslVerify::
3933+
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003934If false and ldap.server is an `ldaps://` style URL or `ldap.startTls`
3935is true, Gerrit will not verify the server certificate when it connects
3936to perform a query.
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003937+
3938By default, true, requiring the certificate to be verified.
3939
Olga Grinbergcf1b06a2015-02-03 15:54:48 -05003940[[ldap.groupsVisibleToAll]]ldap.groupsVisibleToAll::
3941+
3942If true, LDAP groups are visible to all registered users.
3943+
3944By default, false, LDAP groups are visible only to administrators and
3945group members.
3946
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003947[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003948+
3949_(Optional)_ Username to bind to the LDAP server with. If not set,
3950an anonymous connection to the LDAP server is attempted.
3951
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003952[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003953+
3954_(Optional)_ Password for the user identified by `ldap.username`.
3955If not set, an anonymous (or passwordless) connection to the LDAP
3956server is attempted.
3957
Ben Wu0410a152010-06-04 16:17:24 +08003958[[ldap.referral]]ldap.referral::
3959+
3960_(Optional)_ How an LDAP referral should be handled if it is
3961encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05003962automatically follow any referrals, or `ignore` to ignore the
3963referrals.
Ben Wu0410a152010-06-04 16:17:24 +08003964+
3965By default, `ignore`.
3966
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003967[[ldap.readTimeout]]ldap.readTimeout::
3968+
3969_(Optional)_ The read timeout for an LDAP operation. The value is
3970in the usual time-unit format like "1 s", "100 ms", etc...
3971A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09003972threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003973+
3974By default there is no timeout and Gerrit will wait for the LDAP
3975server to respond until the TCP connection times out.
3976
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003977[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003978+
3979Root of the tree containing all user accounts. This is typically
3980of the form `ou=people,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003981+
3982This setting may be added multiple times to specify more than
3983one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003984
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003985[[ldap.accountScope]]ldap.accountScope::
3986+
3987Scope of the search performed for accounts. Must be one of:
3988+
3989* `one`: Search only one level below accountBase, but not recursive
3990* `sub` or `subtree`: Search recursively below accountBase
3991* `base` or `object`: Search exactly accountBase; probably not desired
3992
3993+
3994Default is `subtree` as many directories have several levels.
3995
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003996[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003997+
3998Query pattern to use when searching for a user account. This may be
3999any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09004000`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02004001`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09004002that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02004003the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07004004the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004005+
4006This pattern is used to search the objects contained directly under
4007the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02004008is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004009setting depends on the LDAP schema used by the directory server.
4010+
Michal Pasierb3e262742017-01-23 12:50:48 +01004011Default is `(uid=${username})` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07004012and `(&(objectClass=user)(sAMAccountName=${username}))`
4013for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004014
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07004015[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004016+
4017_(Optional)_ Name of an attribute on the user account object which
4018contains the initial value for the user's full name field in Gerrit.
4019Typically this is the `displayName` property in LDAP, but could
4020also be `legalName` or `cn`.
4021+
David Pursehouse221d4f62012-06-08 17:38:08 +09004022Attribute values may be concatenated with literal strings. For
4023example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02004024`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07004025+
Michal Pasierb3e262742017-01-23 12:50:48 +01004026Default is `displayName` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07004027and `${givenName} ${sn}` for Active Directory.
James Muirce09ebd2023-08-14 22:30:14 -04004028+
4029A non-empty or default value prevents users from modifying their full
4030name field. To allow edits to the full name field, set to the empty
4031string.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004032
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004033[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004034+
4035_(Optional)_ Name of an attribute on the user account object which
4036contains the user's Internet email address, as defined by this
4037LDAP server.
4038+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07004039Attribute values may be concatenated with literal strings,
4040for example to set the email address to the lowercase form
4041of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02004042`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07004043+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07004044If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09004045but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07004046and select a different preferred email address.
4047+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07004048Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004049
Shawn O. Pearce59e09222009-08-19 09:04:49 -07004050[[ldap.accountSshUserName]]ldap.accountSshUserName::
4051+
4052_(Optional)_ Name of an attribute on the user account object which
4053contains the initial value for the user's SSH username field in
4054Gerrit. Typically this is the `uid` property in LDAP, but could
4055also be `cn`. Administrators should prefer to match the attribute
4056corresponding to the user's workstation username, as this is what
4057SSH clients will default to.
4058+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07004059Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02004060an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07004061force the value of sAMAccountName, if defined, to be all lowercase.
4062The suffix `.toUpperCase` can be used for the other direction.
4063The suffix `.localPart` can be used to split attribute values of
4064the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02004065example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07004066+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07004067If set, users will be unable to modify their SSH username field, as
David Pursehousec12da502016-08-11 20:45:03 +09004068Gerrit will populate it only from the LDAP data. Note that once the
4069username has been set it cannot be changed, therefore it is
4070recommended not to make changes to this setting that would cause the
4071value to differ, as this will prevent users from logging in.
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07004072+
Michal Pasierb3e262742017-01-23 12:50:48 +01004073Default is `uid` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07004074and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07004075
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07004076[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04004077+
4078_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07004079contains the groups the user is part of. Typically used for Active
Michal Pasierb3e262742017-01-23 12:50:48 +01004080Directory and FreeIPA servers.
Anthony93de7db2009-10-03 10:01:50 -04004081+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07004082Default is unset for RFC 2307 servers (disabled)
Michal Pasierb3e262742017-01-23 12:50:48 +01004083and `memberOf` for Active Directory and FreeIPA.
4084
4085[[ldap.accountMemberExpandGroups]]ldap.accountMemberExpandGroups::
4086+
4087_(Optional)_ Whether to expand nested groups recursively. This
4088setting is used only if `ldap.accountMemberField` is set.
4089+
4090Default is unset for FreeIPA and `true` for RFC 2307 servers
4091and Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04004092
Saša Živkovc81291f2015-02-04 17:19:20 +01004093[[ldap.fetchMemberOfEagerly]]ldap.fetchMemberOfEagerly::
4094+
4095_(Optional)_ Whether to fetch the `memberOf` account attribute on
4096login. Setups which use LDAP for user authentication but don't make
4097use of the LDAP groups may benefit from setting this option to `false`
4098as this will result in a much faster LDAP login.
4099+
4100Default is unset for RFC 2307 servers (disabled) and `true` for
Michal Pasierb3e262742017-01-23 12:50:48 +01004101Active Directory and FreeIPA.
Saša Živkovc81291f2015-02-04 17:19:20 +01004102
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004103[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004104+
4105Root of the tree containing all group objects. This is typically
4106of the form `ou=groups,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00004107+
4108This setting may be added multiple times to specify more than
4109one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004110
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07004111[[ldap.groupScope]]ldap.groupScope::
4112+
4113Scope of the search performed for group objects. Must be one of:
4114+
4115* `one`: Search only one level below groupBase, but not recursive
4116* `sub` or `subtree`: Search recursively below groupBase
4117* `base` or `object`: Search exactly groupBase; probably not desired
4118
4119+
4120Default is `subtree` as many directories have several levels.
4121
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07004122[[ldap.groupPattern]]ldap.groupPattern::
4123+
4124Query pattern used when searching for an LDAP group to connect
4125to a Gerrit group. This may be any valid LDAP query expression,
4126including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02004127`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07004128group owner.
4129+
Michal Pasierb3e262742017-01-23 12:50:48 +01004130Default is `(cn=${groupname})` for FreeIPA and RFC 2307 servers,
Edwin Kempincdb0e002011-09-08 14:23:30 +02004131and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07004132
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004133[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004134+
4135Query pattern to use when searching for the groups that a user
4136account is currently a member of. This may be any valid LDAP query
4137expression, including the standard `(&...)` and `(|...)` operators.
4138+
David Pursehouse42f42042013-08-01 14:02:25 +09004139If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004140replaced with a parameter set to the username that was supplied
4141by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02004142such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004143corresponding attribute (in this case, `fooBarAttribute`) as read
4144from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02004145Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004146+
Scott Dial50457502013-08-11 16:52:51 -04004147Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
Michal Pasierb3e262742017-01-23 12:50:48 +01004148RFC 2307, and unset (disabled) for Active Directory and FreeIPA.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004149
Auke Schrijnen57809132012-09-26 21:05:39 +02004150[[ldap.groupName]]ldap.groupName::
4151+
David Pursehouse39489ae2012-10-12 13:50:04 +09004152_(Optional)_ Name of the attribute on the group object which contains
4153the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02004154+
David Pursehouse39489ae2012-10-12 13:50:04 +09004155Typically the attribute name is `cn` for RFC 2307 and Active Directory
4156servers. For other servers the attribute name may differ, for example
4157`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02004158+
David Pursehouse39489ae2012-10-12 13:50:04 +09004159It is also possible to specify a literal string containing a pattern of
4160attribute values. For example to create a Gerrit group name consisting of
4161LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
4162+
4163Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02004164
Gustaf Lundhdaf41af2016-12-05 19:05:09 +01004165[[ldap.mandatoryGroup]]ldap.mandatoryGroup::
4166+
4167All users must be a member of this group to allow account creation or
4168authentication.
4169+
James Muir86d32412023-05-04 14:23:40 -04004170For example, setting to `ldap/gerritaccess` limits account creation or
4171authentication to members of the ldap group `gerritaccess`.
4172+
Gustaf Lundhdaf41af2016-12-05 19:05:09 +01004173Setting mandatoryGroup implies enabling of `ldap.fetchMemberOfEagerly`
4174+
4175By default, unset.
4176
Edwin Kempinb3b0d292011-09-14 14:17:34 +02004177[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
4178+
4179Converts the local username, that is used to login into the Gerrit
David Pursehousea1d633b2014-05-02 17:21:02 +09004180Web UI, to lower case before doing the LDAP authentication. By setting
4181this parameter to true, a case insensitive login to the Gerrit Web UI
Edwin Kempinb3b0d292011-09-14 14:17:34 +02004182can be achieved.
4183+
4184If set, it must be ensured that the local usernames for all existing
4185accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09004186local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02004187anymore. The local usernames for the existing accounts can be
4188converted to lower case by running the server program
4189link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
4190Please be aware that the conversion of the local usernames to lower
4191case can't be undone. For newly created accounts the local username
4192will be directly stored in lower case.
4193+
4194By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07004195
Robin Rosenberga3baed02012-10-14 14:09:32 +02004196[[ldap.authentication]]ldap.authentication::
4197+
4198Defines how Gerrit authenticates with the server. When set to `GSSAPI`
4199Gerrit will use Kerberos. To use kerberos the
4200`java.security.auth.login.config` system property must point to a
4201login to a JAAS configuration file and, if Java 6 is used, the system
4202property `java.security.krb5.conf` must point to the appropriate
4203krb5.ini file with references to the KDC.
4204
4205Typical jaas.conf.
4206
4207----
4208KerberosLogin {
4209 com.sun.security.auth.module.Krb5LoginModule
4210 required
4211 useTicketCache=true
4212 doNotPrompt=true
4213 renewTGT=true;
4214};
4215----
4216
4217See Java documentation on how to create the krb5.ini file.
4218
4219Note the `renewTGT` property to make sure the TGT does not expire,
4220and `useTicketCache` to use the TGT supplied by the operating system. As
4221the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09004222to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02004223
4224On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
4225must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
4226have local administrator privileges.
4227
Bruce Zucd04bbc2014-07-25 15:48:09 +08004228[[ldap.useConnectionPooling]]ldap.useConnectionPooling::
4229+
4230_(Optional)_ Enable the LDAP connection pooling or not.
4231+
4232If it is true, the LDAP service provider maintains a pool of (possibly)
4233previously used connections and assigns them to a Context instance as
4234needed. When a Context instance is done with a connection (closed or
4235garbage collected), the connection is returned to the pool for future use.
4236+
4237For details, see link:http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html[
Marian Harbach34253372019-12-10 18:01:31 +01004238LDAP connection management (Pool),role=external,window=_blank] and link:http://docs.oracle.com/javase/tutorial/jndi/ldap/config.html[
4239LDAP connection management (Configuration),role=external,window=_blank]
Bruce Zucd04bbc2014-07-25 15:48:09 +08004240+
4241By default, false.
4242
4243[[ldap.connectTimeout]]ldap.connectTimeout::
4244+
Saša Živkov303701a2015-01-19 16:24:44 +01004245_(Optional)_ Timeout period for establishment of an LDAP connection.
Bruce Zucd04bbc2014-07-25 15:48:09 +08004246+
4247The value is in the usual time-unit format like "1 s", "100 ms",
4248etc...
4249+
4250By default there is no timeout and Gerrit will wait indefinitely.
4251
Saša Živkov5049f512015-01-19 17:04:43 +01004252[[ldap-connection-pooling]]
4253==== LDAP Connection Pooling
4254Once LDAP connection pooling is enabled by setting the link:#ldap.useConnectionPooling[
4255ldap.useConnectionPooling] configuration property to `true`, the connection pool
4256can be configured using JVM system properties as explained in the
4257link:http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-ldap.html#POOL[
Marian Harbach34253372019-12-10 18:01:31 +01004258Java SE Documentation,role=external,window=_blank].
Bruce Zucd04bbc2014-07-25 15:48:09 +08004259
Saša Živkov5049f512015-01-19 17:04:43 +01004260For standalone Gerrit (running with the embedded Jetty), JVM system properties
4261are specified in the link:#container[container section]:
Bruce Zucd04bbc2014-07-25 15:48:09 +08004262
Saša Živkov5049f512015-01-19 17:04:43 +01004263----
4264 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.maxsize=20
4265 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.prefsize=10
4266 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.timeout=300000
4267----
Bruce Zucd04bbc2014-07-25 15:48:09 +08004268
Saša Živkovca7a67e2015-12-01 14:25:10 +01004269[[lfs]]
4270=== Section lfs
4271
4272[[lfs.plugin]]lfs.plugin::
4273+
David Pursehouse2463c542016-08-02 16:04:58 +09004274The name of a plugin which serves the
4275link:https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md[
Marian Harbach34253372019-12-10 18:01:31 +01004276LFS protocol,role=external,window=_blank] on the `<project-name>/info/lfs/objects/batch` endpoint. When
David Pursehouse2463c542016-08-02 16:04:58 +09004277not configured Gerrit will respond with `501 Not Implemented` on LFS protocol
4278requests.
Saša Živkovca7a67e2015-12-01 14:25:10 +01004279+
4280By default unset.
4281
Gustaf Lundhaef90122015-04-27 16:48:19 +02004282[[log]]
4283=== Section log
4284
4285[[log.jsonLogging]]log.jsonLogging::
4286+
Antoine Musso9ed4b4f2020-11-17 16:52:35 +01004287If set to true, enables error, ssh and http logging in JSON format (file names:
4288`logs/error_log.json`, `logs/sshd_log.json` and `logs/httpd_log.json`).
4289+
4290The option only applies to Gerrit built-in loggers. It is ignored when a log4j
4291configuration is specified via
4292link:#container.javaOptions[container.javaOptions], for example
4293`-Dlog4j.configuration=file://etc/log4j.properties`.
Gustaf Lundhaef90122015-04-27 16:48:19 +02004294+
4295Defaults to false.
4296
4297[[log.textLogging]]log.textLogging::
4298+
4299If set to true, enables error logging in regular plain text format. Can only be disabled
4300if `jsonLogging` is enabled.
4301+
Antoine Musso9ed4b4f2020-11-17 16:52:35 +01004302The option only applies to Gerrit built-in loggers. It is ignored when a log4j
4303configuration is specified via
4304link:#container.javaOptions[container.javaOptions], for example
4305`-Dlog4j.configuration=file://etc/log4j.properties`.
4306+
Gustaf Lundhaef90122015-04-27 16:48:19 +02004307Defaults to true.
4308
David Pursehouse2281fef2017-11-21 21:27:17 +09004309[[log.compress]]log.compress::
4310+
4311If set to true, log files are compressed at server startup and then daily at 11pm
4312(in the server's local time zone).
4313+
4314Defaults to true.
4315
David Pursehouse633fff32017-11-21 22:08:12 +09004316[[log.rotate]]log.rotate::
4317+
4318If set to true, log files are rotated daily at midnight (GMT).
4319+
4320Defaults to true.
4321
Luca Milanesio4015d342022-07-13 01:26:08 +01004322[[metrics]]
4323=== Section metrics
4324
4325[[metrics.reservoir]]metrics.reservoir::
4326+
4327The type of data reservoir used by the metrics system to calculate the percentile
4328values for timers and histograms.
4329It can be set to one of the following values:
4330+
4331* ExponentiallyDecaying: An exponentially-decaying random reservoir based on
4332 Cormode et al's forward-decaying priority reservoir sampling method to produce
4333 a statistically representative sampling reservoir, exponentially biased towards
4334 newer entries.
4335* SlidingTimeWindowArray: A sliding window that stores only the measurements made
4336 in the last window using chunks of 512 samples.
4337* SlidingTimeWindow: A sliding window that stores only the measurements made in
4338 the last window using a skip list.
4339* SlidingWindow: A sliding window that stores only the last measurements.
4340* Uniform: A random sampling reservoir that uses Vitter's Algorithm R to produce
4341 a statistically representative sample.
4342+
4343Defaults to ExponentiallyDecaying.
4344
4345[[metrics.ExponentiallyDecaying.alpha]]metrics.ExponentiallyDecaying.alpha::
4346+
4347The exponential decay factor; the higher this is, the more biased the reservoir
4348will be towards newer values.
4349
4350[[metrics.reservoirType.size]]metrics.<reservoirType>.size::
4351+
4352The number of samples to keep in the reservoir. Applies to all reservoir types
4353except the sliding time-based ones.
4354+
4355Defaults to 1028.
4356
4357[[metrics.reservoirType.window]]metrics.<reservoirType>.window::
4358+
4359The window of time for keeping data in the reservoir. It only applies to sliding
4360time-based reservoir types.
4361
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004362[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004363=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07004364
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004365[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07004366+
4367If set to true, files with the MIME type `<name>` will be sent as
4368direct downloads to the user's browser, rather than being wrapped up
4369inside of zipped archives. The type name may be a complete type
Jonathan Nieder5758f182015-03-30 11:28:55 -07004370name, e.g. `image/gif`, a generic media type, e.g. `+image/*+`,
4371or the wildcard `+*/*+` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07004372+
4373By default, false for all MIME types.
4374
4375Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08004376----
4377[mimetype "image/*"]
4378 safe = true
4379
4380[mimetype "application/pdf"]
4381 safe = true
4382
4383[mimetype "application/msword"]
4384 safe = true
4385
4386[mimetype "application/vnd.ms-excel"]
4387 safe = true
4388----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07004389
Dave Borowitzbc314912017-03-21 14:23:35 -07004390[[note-db]]
4391=== Section noteDb
4392
Dave Borowitzada289c2018-12-18 13:24:14 -08004393NoteDb is the Git-based database storage backend for Gerrit. For more
4394information, including how to migrate data from an older Gerrit version, see the
4395link:note-db.html[documentation].
Dave Borowitzbc314912017-03-21 14:23:35 -07004396
Edwin Kempin5be9c312017-07-07 10:40:55 +02004397[[notedb.accounts.sequenceBatchSize]]notedb.accounts.sequenceBatchSize::
4398+
Edwin Kempin311d5702017-07-28 15:10:24 +02004399The next available account sequence number is stored as UTF-8 text in a
4400blob pointed to by the `refs/sequences/accounts` ref in the `All-Users`
Edwin Kempin5be9c312017-07-07 10:40:55 +02004401repository. Multiple processes share the same sequence by incrementing
4402the counter using normal git ref updates. To amortize the cost of these
4403ref updates, processes increment the counter by a larger number and
4404hand out numbers from that range in memory until they run out. This
4405configuration parameter controls the size of the account ID batch that
4406each process retrieves at once.
4407+
Edwin Kempin5be9c312017-07-07 10:40:55 +02004408By default, 1.
4409
David Pursehouse05eaefe2020-06-02 15:42:46 +09004410[[notedb.changes.sequenceBatchSize]]notedb.changes.sequenceBatchSize::
4411+
4412The next available change sequence number is stored as UTF-8 text in a
4413blob pointed to by the `refs/sequences/changes` ref in the `All-Projects`
4414repository. Multiple processes share the same sequence by incrementing
4415the counter using normal git ref updates. To amortize the cost of these
4416ref updates, processes increment the counter by a larger number and
4417hand out numbers from that range in memory until they run out. This
4418configuration parameter controls the size of the change ID batch that
4419each process retrieves at once.
4420+
4421By default, 20.
Han-Wen Nienhuyse5ca19c2017-11-08 13:33:33 +01004422
Michael Ochmann69813262016-01-27 17:53:55 +01004423[[oauth]]
4424=== Section oauth
4425
4426OAuth integration is only enabled if `auth.type` is set to `OAUTH`. See
4427link:#auth.type[above] for a detailed description of the `auth.type` settings
4428and their implications.
4429
4430By default, contact information, like the full name and email address,
4431is retrieved from the selected OAuth provider when a user account is created,
4432or when a user requests to reload that information in the settings UI. If
4433that is not supported by the OAuth provider, users can be allowed to edit
4434their contact information manually.
4435
4436[[oauth.allowEditFullName]]oauth.allowEditFullName::
4437+
4438If true, the full name can be edited in the contact information.
4439+
4440Default is false.
4441
4442[[oauth.allowRegisterNewEmail]]oauth.allowRegisterNewEmail::
4443+
4444If true, additional email addresses can be registered in the contact
4445information.
4446+
4447Default is false.
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07004448
Zac Livingston70a16102018-11-20 15:07:34 -07004449[[operator-alias]]
4450=== Section operator alias
4451
4452Operator aliasing allows global aliases to be defined for query operators.
4453Currently only change queries are supported. The alias name is the git
4454config key name, and the operator being aliased is the git config value.
4455
4456For example:
4457
4458----
4459[operator-alias "change"]
4460 oldage = age
4461 number = change
4462----
4463
4464This section is particularly useful to alias operator names which may be
4465long and clunky because they include a plugin name in them to a shorter
4466name without the plugin name.
4467
4468Aliases are resolved dynamically at invocation time to any currently
4469loaded versions of plugins. If the alias points to an operator provided
4470by a plugin which is not currently loaded, or the plugin does not define
4471the operator, then "unsupported operator" is returned to the user.
4472
4473Aliases will override existing operators. In the case of multiple aliases
4474with the same name, the last one defined will be used.
4475
4476When the target of an alias doesn't exist, the operator with the name
4477of the alias will be used (if present). This enables an admin to config
4478the system to override a core operator with an operator provided by a
4479plugin when present and otherwise fall back to the operator provided by
4480core.
4481
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004482[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004483=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004484
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07004485Global settings controlling how Gerrit Code Review creates pack
4486streams for Git clients running clone, fetch, or pull. Most of these
4487variables are per-client request, and thus should be carefully set
4488given the expected concurrent request load and available CPU and
4489memory resources.
4490
4491[[pack.deltacompression]]pack.deltacompression::
4492+
4493If true, delta compression between objects is enabled. This may
4494result in a smaller overall transfer for the client, but requires
4495more server memory and CPU time.
4496+
4497False (off) by default, matching Gerrit Code Review 2.1.4.
4498
4499[[pack.threads]]pack.threads::
4500+
4501Maximum number of threads to use for delta compression (if enabled).
4502This is per-client request. If set to 0 then the number of CPUs is
4503auto-detected and one thread per CPU is used, per client request.
4504+
4505By default, 1.
4506
4507
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004508[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004509=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07004510
4511[[plugins.checkFrequency]]plugins.checkFrequency::
4512+
4513How often plugins should be examined for new plugins to load, removed
4514plugins to be unloaded, or updated plugins to be reloaded. Values can
4515be specified using standard time unit abbreviations ('ms', 'sec',
4516'min', etc.).
4517+
4518If set to 0, automatic plugin reloading is disabled. Administrators
Christian Aistleitner8ce1a4e2015-06-05 01:54:15 +02004519may force reloading with link:cmd-plugin-reload.html[gerrit plugin reload].
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07004520+
4521Default is 1 minute.
4522
Shawn Pearcefd033502014-02-14 16:42:35 -08004523[[plugins.allowRemoteAdmin]]plugins.allowRemoteAdmin::
4524+
4525Enable remote installation, enable and disable of plugins over HTTP
4526and SSH. If set to true Administrators can install new plugins
4527remotely, or disable existing plugins. Defaults to false.
4528
Saša Živkov350fc682019-05-13 14:13:51 +02004529[[plugins.mandatory]]plugins.mandatory::
4530+
4531List of mandatory plugins. If a plugin from this list does not load,
David Pursehousef06aefb2019-10-18 20:39:53 +09004532Gerrit will fail to start.
4533+
4534Disabling and restarting of a mandatory plugin is rejected, but reloading
4535of a mandatory plugin is still possible.
Saša Živkov350fc682019-05-13 14:13:51 +02004536
Dariusz Luksza98f23522015-03-11 11:41:41 +01004537[[plugins.jsLoadTimeout]]plugins.jsLoadTimeout::
4538+
4539Set the timeout value for loading JavaScript plugins in Gerrit UI.
4540Values can be specified using standard time unit abbreviations ('ms',
4541'sec', 'min', etc.).
4542+
4543Default is 5 seconds. Negative values will be converted to 0.
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07004544
Dmitrii Filippov2ccf5072022-10-25 21:37:39 +02004545[[plugins.transitionalPushOptions]]plugins.transitionalPushOptions::
4546+
4547Additional push options which should be accepted by gerrit as valid
4548options even if they are not registered by any plugin(e.g. "myplugin~foo").
4549+
4550This config can be used when gerrit migrates from a deprecated plugin to the new one. The new plugin
4551can (temporary) accept push options of the old plugin without registering such options.
4552
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004553[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004554=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004555
Dave Borowitzff243892015-08-31 15:35:28 -04004556This section is used to configure behavior of the 'receive-pack'
4557handler, which responds to 'git push' requests.
lincoln2be11602010-07-05 10:53:25 -03004558
Dave Borowitzff243892015-08-31 15:35:28 -04004559[[receive.allowGroup]]receive.allowGroup::
Dave Borowitz532342bf2015-06-18 20:28:22 -04004560+
Dave Borowitzff243892015-08-31 15:35:28 -04004561Name of the groups of users that are allowed to execute
4562'receive-pack' on the server. One or more groups can be set.
Dave Borowitz532342bf2015-06-18 20:28:22 -04004563+
Dave Borowitzff243892015-08-31 15:35:28 -04004564If no groups are added, any user will be allowed to execute
4565'receive-pack' on the server.
Dave Borowitz532342bf2015-06-18 20:28:22 -04004566
4567[[receive.certNonceSeed]]receive.certNonceSeed::
4568+
4569If set to a non-empty value and server-side signed push validation is
4570link:#receive.enableSignedPush[enabled], use this value as the seed to
4571the HMAC SHA-1 nonce generator. If unset, a 64-byte random seed will be
4572generated at server startup.
4573+
4574As this is used as the seed of a cryptographic algorithm, it is
4575recommended to be placed in link:#secure-config[`secure.config`].
4576+
4577Defaults to unset.
4578
4579[[receive.certNonceSlop]]receive.certNonceSlop::
4580+
4581When validating the nonce passed as part of the signed push protocol,
4582accept valid nonces up to this many seconds old. This allows
4583certificate verification to work over HTTP where there is a lag between
4584the HTTP response providing the nonce to sign and the next request
4585containing the signed nonce. This can be significant on large
4586repositories, since the lag also includes the time to count objects on
4587the client.
4588+
4589Default is 5 minutes.
4590
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08004591[[receive.checkMagicRefs]]receive.checkMagicRefs::
4592+
4593If true, Gerrit will verify the destination repository has
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01004594no references under the magic 'refs/for' branch namespace. Names under
4595these locations confuse clients when trying to upload code reviews so
4596Gerrit requires them to be empty.
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08004597+
4598If false Gerrit skips the sanity check and assumes administrators
4599have ensured the repository does not contain any magic references.
4600Setting to false to skip the check can decrease latency during push.
4601+
4602Default is true.
4603
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02004604[[receive.allowProjectOwnersToChangeParent]]receive.allowProjectOwnersToChangeParent::
4605+
4606If true, Gerrit will allow project owners to change the parent of a project.
4607+
4608By default only Gerrit administrators are allowed to change the parent
4609of a project. By allowing project owners to change parents, it may
4610allow the owner to circumvent certain enforced rules (like important
4611BLOCK rules).
4612+
4613Default is false.
Rikard Almgrene9221be2018-09-18 11:12:03 +02004614+
4615This value supports configuration reloads:
4616link:cmd-reload-config.html[reload-config]
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02004617
Gustaf Lundh9062fd62013-02-14 17:23:11 +01004618[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
4619+
4620If set to true, Gerrit will validate that all referenced objects that
4621are not included in the received pack are reachable by the user.
4622+
4623Carrying out this check on gits with many refs and commits can be a
4624very CPU-heavy operation. For non public Gerrit-servers this check may
4625be overkill.
4626+
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02004627Only disable this check if you trust the clients not to forge SHA-1
Gustaf Lundh9062fd62013-02-14 17:23:11 +01004628references to access commits intended to be hidden from the user.
4629+
4630Default is true.
4631
Patrick Hiesel24653be2019-10-22 09:47:32 +02004632[[receive.enableInMemoryRefCache]]receive.enableInMemoryRefCache::
4633+
4634If true, Gerrit will cache all refs advertised during push in memory and
4635base later receive operations on that cache.
4636+
4637Turning this cache off is considered experimental.
4638+
4639This cache provides value when the ref database is slow and/or does not
4640offer an inverse lookup of object ID to ref name. When RefTable is used,
4641this cache can be turned off (experimental) to get speed improvements.
4642+
4643Default is true.
4644
Dave Borowitzff243892015-08-31 15:35:28 -04004645[[receive.enableSignedPush]]receive.enableSignedPush::
lincoln2be11602010-07-05 10:53:25 -03004646+
Dave Borowitzff243892015-08-31 15:35:28 -04004647If true, server-side signed push validation is enabled.
lincoln2be11602010-07-05 10:53:25 -03004648+
Dave Borowitzff243892015-08-31 15:35:28 -04004649When a client pushes with `git push --signed`, this ensures that the
4650push certificate is valid and signed with a valid public key stored in
David Pursehouse6117a472016-07-26 08:02:49 +00004651the `refs/meta/gpg-keys` branch of `All-Users`.
Dave Borowitzff243892015-08-31 15:35:28 -04004652+
4653Defaults to false.
4654
4655[[receive.maxBatchChanges]]receive.maxBatchChanges::
4656+
4657The maximum number of changes that Gerrit allows to be pushed
4658in a batch for review. When this number is exceeded Gerrit rejects
4659the push with an error message.
4660+
4661May be overridden for certain groups by specifying a limit in the
4662link:access-control.html#capability_batchChangesLimit['Batch Changes Limit']
4663global capability.
4664+
4665This setting can be used to prevent users from uploading large
4666number of changes for review by mistake.
4667+
4668Default is zero, no limit.
lincoln2be11602010-07-05 10:53:25 -03004669
Dave Borowitz78542192017-08-31 10:45:47 -04004670[[receive.maxBatchCommits]]receive.maxBatchCommits::
4671+
4672The maximum number of commits that Gerrit allows to be pushed in a batch
4673directly to a branch when link:user-upload.html#bypass_review[bypassing review].
4674This limit can be bypassed if a user link:user-upload.html#skip_validation[skips
4675validation].
4676+
4677Default is 10000.
4678
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004679[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
4680+
4681Maximum allowed Git object size that 'receive-pack' will accept.
4682If an object is larger than the given size the pack-parsing will abort
4683and the push operation will fail. If set to zero then there is no
4684limit.
4685+
David Pursehouse221d4f62012-06-08 17:38:08 +09004686Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004687from pushing objects which are too large to Gerrit.
4688+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07004689This setting can also be set in the `project.config`
David Pursehouse2e548682018-08-01 15:12:47 +02004690(link:config-project-config.html[receive.maxObjectSizeLimit]) in order
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07004691to further reduce the global setting. The project specific setting is
4692only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02004693+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004694Default is zero.
4695+
4696Common unit suffixes of 'k', 'm', or 'g' are supported.
4697
David Pursehouse3f9c7402018-09-05 18:43:03 +09004698[[receive.inheritProjectMaxObjectSizeLimit]]receive.inheritProjectMaxObjectSizeLimit::
4699+
4700Controls whether the project-level link:config-project-config.html[`receive.maxObjectSizeLimit`]
4701value is inherited from the parent project. When `true`, the value is
4702inherited, otherwise it is not inherited.
4703+
4704Default is false, the value is not inherited.
4705
Dave Borowitz1bb49492015-08-31 15:36:59 -04004706[[receive.maxTrustDepth]]receive.maxTrustDepth::
4707+
4708If signed push validation is link:#receive.enableSignedPush[enabled],
4709set to the maximum depth to search when checking if a key is
4710link:#receive.trustedKey[trusted].
4711+
4712Default is 0, meaning only explicitly trusted keys are allowed.
4713
Dave Borowitz234734a2012-03-01 14:22:29 -08004714[[receive.threadPoolSize]]receive.threadPoolSize::
4715+
4716Maximum size of the thread pool in which the change data in received packs is
4717processed.
4718+
4719Defaults to the number of available CPUs according to the Java runtime.
4720
Dave Borowitz1c401362012-03-02 17:39:17 -08004721[[receive.timeout]]receive.timeout::
4722+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07004723Overall timeout on the time taken to process the change data in
4724received packs. Only includes the time processing Gerrit changes
4725and updating references, not the time to index the pack. Values can
4726be specified using standard time unit abbreviations ('ms', 'sec',
4727'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08004728+
Edwin Kempin66354122021-08-05 11:20:27 +02004729After the timeout is exceeded the task processing the receive gets a
4730cancellation signal that allows the tast to finish gracefully.
4731link:#receive.cancellationTimeout[receive.cancellationTimeout]
4732defines how much time the task has to react to the cancellation signal
4733before it is focefully cancelled.
4734+
Edwin Kempin77bbd8a2021-07-29 10:36:42 +02004735The receive timeout cannot be overriden by setting a higher
Fabio Ponciroli03f23d62021-10-20 09:15:48 +02004736link:user-upload.html#deadline[deadline] on the git push request.
Edwin Kempin77bbd8a2021-07-29 10:36:42 +02004737+
Dariusz Lukszade482b02015-11-09 18:25:04 +01004738Default is 4 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07004739is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08004740
Edwin Kempin66354122021-08-05 11:20:27 +02004741[[receive.cancellationTimeout]]receive.cancellationTimeout::
4742+
4743Defines the time that a receive task has to react to a cancellation
4744signal and finish gracefully after link:#receive.timeout[receive.timeout]
4745is exceeded. If the receive task is still not terminated after the
4746cancellation timeout is exceeded the task is forcefully cancelled.
4747Values can be specified using standard time unit abbreviations ('ms',
4748'sec', 'min', etc.).
4749+
4750Default is 5 seconds. If no unit is specified, milliseconds is assumed.
4751
Dave Borowitz1bb49492015-08-31 15:36:59 -04004752[[receive.trustedKey]]receive.trustedKey::
4753+
4754List of GPG key fingerprints that should be considered trust roots by
4755the server when signed push validation is
4756link:#receive.enableSignedPush[enabled]. A key is trusted by the server
4757if it is either in this list, or a path of trust signatures leads from
4758the key to a configured trust root. The maximum length of the path is
4759determined by link:#receive.maxTrustDepth[`receive.maxTrustDepth`].
4760+
4761Key fingerprints can be displayed with `gpg --list-keys
4762--with-fingerprint`.
4763+
4764Trust signatures can be added to a key using the `tsign` command to
4765link:https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html[
Marian Harbach34253372019-12-10 18:01:31 +01004766`gpg --edit-key`,role=external,window=_blank], after which the signed key should be re-uploaded.
Dave Borowitz1bb49492015-08-31 15:36:59 -04004767+
4768If no keys are specified, web-of-trust checks are disabled. This is the
4769default behavior.
4770
Edwin Kempin423c2262023-06-30 08:33:04 +00004771[[receive.enableChangeIdLinkFooters]]receive.enableChangeIdLinkFooters::
4772+
4773Enables a `Link` footer to be used as an alternative change ID footer.
4774+
4775In some projects it may be desirable for the footer to contain a link to
4776the Gerrit review page so that it is convenient to access the review
4777page starting from the commit message. The `Link` footer is a standard
4778footer used for inserting links in the commit message (e.g. used by the
4779Linux kernel).
4780+
4781This option makes Gerrit interoperate well with `Link` footers. If
4782change ID `Link` footers are enabled Gerrit recognizes footers of the
4783form:
4784+
4785----
4786 Link: https://<host>/id/<change-ID>
4787----
4788+
4789Example:
4790----
4791 Link: https://gerrit-review.googlesource.com/id/I78e884a944cedb5144f661a057e4829c8f84e933
4792----
4793+
4794For Gerrit to recognize the change ID, the part of the URL before the
4795'/id/' part must match with the link:#gerrit.canonicalWebUrl[canonical
4796web URL].
4797+
4798Default is `true`.
4799
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004800[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004801=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004802
Hugo Josefson072b4702010-04-21 19:27:11 +02004803Repositories in this sense are the same as projects.
4804
Shawn O. Pearce897d9212011-06-16 16:59:59 -07004805In the following example configuration `Registered Users` is set
4806to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02004807
4808----
4809[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02004810 ownerGroup = Registered Users
4811----
4812
Hugo Arès7d2b9422014-11-25 15:33:42 -05004813The only matching patterns supported are exact match or wildcard matching which
4814can be specified by ending the name with a `*`. If a project matches more than one
4815repository configuration, then the configuration from the more precise match
4816will be used. In the following example, the default submit type for a project
4817named `project/plugins/a` would be `CHERRY_PICK`.
4818
4819----
4820[repository "project/*"]
4821 defaultSubmitType = MERGE_IF_NECESSARY
4822[repository "project/plugins/*"]
4823 defaultSubmitType = CHERRY_PICK
4824----
4825
Michael Ochmann8129ece2016-07-08 11:25:25 +02004826[NOTE]
4827All properties are used from the matching repository configuration. In
Hugo Arès7d2b9422014-11-25 15:33:42 -05004828the previous example, all properties will be used from `project/plugins/\*`
4829section and no properties will be inherited nor overridden from `project/*`.
Hugo Josefson072b4702010-04-21 19:27:11 +02004830
Hugo Arès218bb3b2015-04-22 15:05:14 -04004831[[repository.name.basePath]]repository.<name>.basePath::
4832+
4833Alternate to <<gerrit.basePath,gerrit.basePath>>. The repository will be created
4834and used from this location instead: ${alternateBasePath}/${projectName}.git.
4835+
4836If configuring the basePath for an existing project in gerrit, make sure to stop
4837gerrit, move the repository in the alternate basePath, configure basePath for
4838this repository and then start Gerrit.
4839+
4840Path must be absolute.
4841
Edwin Kempina79ea552013-11-19 11:24:37 +01004842[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
4843+
4844The default submit type for newly created projects. Supported values
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004845are `INHERIT`, `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02004846`REBASE_ALWAYS`, `MERGE_ALWAYS` and `CHERRY_PICK`.
4847+
Changcheng Xiao21885982019-01-15 18:16:51 +01004848For more details see link:config-project-config.html#submit-type[Submit Types].
Edwin Kempina79ea552013-11-19 11:24:37 +01004849+
Changcheng Xiao21885982019-01-15 18:16:51 +01004850Default is link:config-project-config.html#submit_type_inherit[`INHERIT`].
Dave Borowitzcad4d262018-01-22 10:02:22 -05004851+
Dave Borowitz03e51742018-01-09 07:57:01 -05004852This submit type is only applied at project creation time if a submit type is
4853omitted from the link:rest-api-projects.html#project-input[ProjectInput]. If the
Dave Borowitzcad4d262018-01-22 10:02:22 -05004854submit type is unset in the project config at runtime, for backwards
4855compatibility purposes, it defaults to
4856link:project-configuration.html#merge_if_necessary[`MERGE_IF_NECESSARY`] rather
4857than `INHERIT`.
Edwin Kempina79ea552013-11-19 11:24:37 +01004858
Hugo Josefson072b4702010-04-21 19:27:11 +02004859[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
4860+
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -07004861A name of a link:config-groups.html[group] which exists. Zero, one or many
4862groups are allowed. Each on its own line. Groups which don't exist are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02004863
Edwin Kempin22687fa2018-01-22 11:55:07 +01004864[[retry]]
4865=== Section retry
4866
4867[[retry.maxWait]]retry.maxWait::
4868+
4869Maximum time to wait between attempts to retry an operations when one attempt
4870fails (e.g. on NoteDb updates due to contention, aka lock failure, on the
4871underlying ref storage). Operations are retried with exponential backoff, plus
4872some random jitter, until the interval reaches this limit. After that, retries
4873continue to occur after a fixed timeout (plus jitter), up to
4874link:#retry.timeout[`retry.timeout`].
4875+
4876Defaults to 5 seconds; unit suffixes are supported, and assumes milliseconds if
4877not specified.
4878
4879[[retry.timeout]]retry.timeout::
4880+
4881Total timeout for retrying operations when one attempt fails.
4882+
4883It is possible to overwrite this default timeout based on operation types by
4884setting link:#retry.operationType.timeout[`retry.<operationType>.timeout`].
4885+
4886Defaults to 20 seconds; unit suffixes are supported, and assumes milliseconds if
4887not specified.
4888
4889[[retry.operationType.timeout]]retry.<operationType>.timeout::
4890+
4891Total timeout for retrying operations of type `<operationType>` when one
4892attempt fails. `<operationType>` can be `ACCOUNT_UPDATE`, `CHANGE_UPDATE`,
4893`GROUP_UPDATE` and `INDEX_QUERY`.
4894+
4895Defaults to link:#retry.timeout[`retry.timeout`]; unit suffixes are supported,
4896and assumes milliseconds if not specified.
4897
Edwin Kempindd837ae2019-06-18 11:42:14 +02004898[[retry.retryWithTraceOnFailure]]retry.retryWithTraceOnFailure::
4899+
4900Whether Gerrit should automatically retry operations on failure with tracing
Edwin Kempinf7e03072021-09-14 09:00:16 +02004901enabled. The automatically generated traces can help with debugging.
Edwin Kempindd837ae2019-06-18 11:42:14 +02004902+
4903By default this is set to false.
4904
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004905[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004906=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004907
4908[[rules.enable]]rules.enable::
4909+
Matt Baker8ce12fc2013-11-26 21:43:12 -07004910If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004911project's refs/meta/config branch, if present. When set to false,
4912only the default internal rules will be used.
4913+
4914Default is true, to execute project specific rules.
4915
Shawn Pearceed001d72014-12-17 14:25:55 -08004916[[rules.reductionLimit]]rules.reductionLimit::
4917+
4918Maximum number of Prolog reductions that can be performed when
4919evaluating rules for a single change. Each function call made
4920in user rule code, internal Gerrit Prolog code, or the Prolog
4921interpreter counts against this limit.
4922+
4923Sites using very complex rules that need many reductions should
4924compile Prolog to Java bytecode with link:pgm-rulec.html[rulec].
4925This eliminates the dynamic Prolog interpreter from charging its
4926own reductions against the limit, enabling more logic to execute
4927within the same bounds.
4928+
4929A reductionLimit of 0 is nearly infinite, implemented by setting
4930the internal limit to 2^31-1.
4931+
4932Default is 100,000 reductions (about 14 ms on Intel Core i7 CPU).
4933
4934[[rules.compileReductionLimit]]rules.compileReductionLimit::
4935+
4936Maximum number of Prolog reductions that can be performed when
4937compiling source code to internal Prolog machine code.
4938+
4939Default is 10x reductionLimit (1,000,000).
4940
Shawn Pearcea2b98522015-11-21 09:47:32 -08004941[[rules.maxSourceBytes]]rules.maxSourceBytes::
4942+
4943Maximum input size (in bytes) of a Prolog rules.pl file. Larger
4944source files may need a larger rules.compileReductionLimit. Consider
4945using link:pgm-rulec.html[rulec] to precompile larger rule files.
4946+
4947A size of 0 bytes disables rules, same as rules.enable = false.
4948+
David Pursehouse0c1dadf2015-11-24 09:14:21 +00004949Common unit suffixes of 'k', 'm', or 'g' are supported.
4950+
Shawn Pearcea2b98522015-11-21 09:47:32 -08004951Default is 128 KiB.
4952
4953[[rules.maxPrologDatabaseSize]]rules.maxPrologDatabaseSize::
4954+
4955Number of predicate clauses allowed to be defined in the Prolog
4956database by project rules. Very complex rules may need more than the
4957default 256 limit, but cost more memory and may need more time to
4958evaluate. Consider using link:pgm-rulec.html[rulec] to precompile
4959larger rule files.
4960+
4961Default is 256.
4962
David Pursehouse511a35b2014-04-04 10:27:13 +09004963[[execution]]
4964=== Section execution
Bruce Zua7e34312014-04-01 17:35:41 +08004965
4966[[execution.defaultThreadPoolSize]]execution.defaultThreadPoolSize::
4967+
4968The default size of the background execution thread pool in
4969which miscellaneous tasks are handled.
4970+
Jacek Centkowskice5510d2019-11-13 16:27:25 -08004971Default and minimum is 2 so that a single, potentially longer executing
4972task (e.g. GC), is not blocking the entire execution.
Bruce Zua7e34312014-04-01 17:35:41 +08004973
Patrick Hiesel2ed39822018-04-16 12:04:02 +02004974[[execution.fanOutThreadPoolSize]]execution.fanOutThreadPoolSize::
4975+
4976Maximum size of thread pool to on which a serving thread can fan-out
4977work to parallelize it.
4978+
4979When set to 0, a direct executor will be used.
4980+
4981By default, 25 which means that formatting happens in the caller thread.
4982
Patrick Hiesel328b7612016-10-21 16:43:13 +02004983[[receiveemail]]
4984=== Section receiveemail
4985
4986[[receiveemail.protocol]]receiveemail.protocol::
4987+
4988Specifies the protocol used for receiving emails. Valid options are
4989'POP3', 'IMAP' and 'NONE'. Note that Gerrit will automatically switch between
4990POP3 and POP3s as well as IMAP and IMAPS depending on the specified
4991link:#receiveemail.encryption[encryption].
4992+
4993Defaults to 'NONE' which means that receiving emails is disabled.
4994
4995[[receiveemail.host]]receiveemail.host::
4996+
4997The hostname of the mailserver. Example: 'imap.gmail.com'.
4998+
4999Defaults to an empty string which means that receiving emails is disabled.
5000
5001[[receiveemail.port]]receiveemail.port::
5002+
David Pursehouse4b067752017-03-03 15:54:53 +09005003The port the email server exposes for receiving emails.
Patrick Hiesel328b7612016-10-21 16:43:13 +02005004+
5005Defaults to the industry standard for a given protocol and encryption:
David Pursehouse34907442017-04-04 09:55:38 +09005006POP3: 110; POP3S: 995; IMAP: 143; IMAPS: 993.
Patrick Hiesel328b7612016-10-21 16:43:13 +02005007
5008[[receiveemail.username]]receiveemail.username::
5009+
5010Username used for authenticating with the email server.
5011+
5012Defaults to an empty string.
5013
5014[[receiveemail.password]]receiveemail.password::
5015+
5016Password used for authenticating with the email server.
5017+
5018Defaults to an empty string.
5019
5020[[receiveemail.encryption]]receiveemail.encryption::
5021+
5022Encryption standard used for transport layer security between Gerrit and the
5023email server. Possible values include 'NONE', 'SSL' and 'TLS'.
5024+
5025Defaults to 'NONE'.
5026
5027[[receiveemail.fetchInterval]]receiveemail.fetchInterval::
5028+
5029Time between two consecutive fetches from the email server. Communication with
5030the email server is not kept alive. Examples: 60s, 10m, 1h.
5031+
5032Defaults to 60 seconds.
5033
5034[[receiveemail.enableImapIdle]]receiveemail.enableImapIdle::
5035+
5036If the IMAP protocol is used for retrieving emails, IMAPv4 IDLE can be used to
5037keep the connection with the email server alive and receive a push when a new
5038email is delivered to the inbox. In this case, Gerrit will process the email
5039immediately and will not have a fetch delay.
Patrick Hiesel328b7612016-10-21 16:43:13 +02005040+
5041Defaults to false.
5042
Patrick Hiesel4266cf72017-02-03 08:18:19 +01005043[[receiveemail.filter.mode]]receiveemail.filter.mode::
5044+
Gal Paikin166e4432020-09-22 19:09:45 +03005045An allow and block filter to filter incoming emails.
Patrick Hiesel4266cf72017-02-03 08:18:19 +01005046+
5047If `OFF`, emails are not filtered by the list filter.
5048+
Gal Paikin166e4432020-09-22 19:09:45 +03005049If `ALLOW`, only emails where a pattern from
Patrick Hiesel4266cf72017-02-03 08:18:19 +01005050<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
5051matches 'From' will be processed.
5052+
Gal Paikin166e4432020-09-22 19:09:45 +03005053If `BLOCK`, only emails where no pattern from
Patrick Hiesel4266cf72017-02-03 08:18:19 +01005054<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
5055matches 'From' will be processed.
5056+
5057Defaults to `OFF`.
Gal Paikin166e4432020-09-22 19:09:45 +03005058+
5059The previous filter-names 'BLACKLIST' and 'WHITELIST' have been deprecated
5060since they may be considered disrespectful and there's no technical or
5061practical reason to use these exact terms for the filters.
5062For backwards compatibility they are still supported but support for these
5063deprecated terms will be removed in future releases.
Patrick Hiesel4266cf72017-02-03 08:18:19 +01005064
5065[[receiveemail.filter.patterns]]receiveemail.filter.patterns::
5066+
5067A list of regular expressions to match the email sender against. This can also
5068be a list of addresses when regular expression characters are escaped.
5069
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005070[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005071=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07005072
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005073[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07005074+
5075If false Gerrit will not send email messages, for any reason,
5076and all other properties of section sendemail are ignored.
5077+
5078By default, true, allowing notifications to be sent.
5079
Jonathan Niederdabd8c22016-09-20 14:10:11 -07005080[[sendemail.html]]sendemail.html::
5081+
5082If false, Gerrit will only send plain-text emails.
5083If true, Gerrit will send multi-part emails with an HTML and
5084plain text part.
5085+
5086By default, true, allowing HTML in the emails Gerrit sends.
5087
Bruce Zua7e34312014-04-01 17:35:41 +08005088[[sendemail.connectTimeout]]sendemail.connectTimeout::
5089+
5090The connection timeout of opening a socket connected to a
5091remote SMTP server.
5092+
5093Values can be specified using standard time unit abbreviations
5094('ms', 'sec', 'min', etc.).
5095If no unit is specified, milliseconds is assumed.
5096+
5097Default is 0. A timeout of zero is interpreted as an infinite
5098timeout. The connection will then block until established or
5099an error occurs.
5100
5101[[sendemail.threadPoolSize]]sendemail.threadPoolSize::
Alice Kober-Sotzekda0559e2020-09-18 09:25:15 +00005102+
5103Maximum size of thread pool in which the review comments
5104notifications are sent out asynchronously.
5105+
5106By default, 1.
Bruce Zua7e34312014-04-01 17:35:41 +08005107
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07005108[[sendemail.from]]sendemail.from::
5109+
5110Designates what name and address Gerrit will place in the From
5111field of any generated email messages. The supported values are:
5112+
5113* `USER`
5114+
5115Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09005116Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07005117classified as spam if the user's domain has SPF or DKIM enabled
5118and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
Zhen Chenae765aa2016-08-08 15:49:44 -07005119relay for that domain. You can specify
5120<<sendemail.allowedDomain,sendemail.allowedDomain>> to instruct Gerrit to only
5121send as USER if USER is from those domains.
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07005122+
5123* `MIXED`
5124+
Edwin Kempincdb0e002011-09-08 14:23:30 +02005125Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07005126`review@example.com` is the same as <<user.email,user.email>>.
5127See below for a description of how the replacement is handled.
5128+
5129* `SERVER`
5130+
5131Gerrit will set the From header to the same name and address
5132it records in any commits Gerrit creates. This is set by
5133<<user.name,user.name>> and <<user.email,user.email>>, or guessed
5134from the local operating system.
5135+
Edwin Kempinebfbbac2015-07-01 16:02:39 +02005136* `Code Review <review@example.com>`
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07005137+
5138If set to a name and email address in brackets, Gerrit will use
5139this name and email address for any messages, overriding the name
5140that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02005141Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07005142which is replaced by the Full Name of the current user.
5143
5144+
5145By default, MIXED.
5146
Zhen Chenae765aa2016-08-08 15:49:44 -07005147[[sendemail.allowedDomain]]sendemail.allowedDomain::
5148+
5149Only used when `sendemail.from` is set to `USER`.
5150List of allowed domains. If user's email matches one of the domains, emails will
5151be sent as USER, otherwise as MIXED mode. Wildcards may be specified by
Maxime Guerreiroebac2d42018-03-21 13:54:51 +01005152including `\*` to match any number of characters, for example `*.example.com`
Zhen Chenae765aa2016-08-08 15:49:44 -07005153matches any subdomain of `example.com`.
5154+
5155By default, `*`.
5156
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005157[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07005158+
5159Hostname (or IP address) of a SMTP server that will relay
5160messages generated by Gerrit to end users.
5161+
5162By default, 127.0.0.1 (aka localhost).
5163
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005164[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07005165+
5166Port number of the SMTP server in sendemail.smtpserver.
5167+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08005168By default, 25, or 465 if smtpEncryption is 'ssl'.
5169
5170[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
5171+
5172Specify the encryption to use, either 'ssl' or 'tls'.
5173+
5174By default, 'none', indicating no encryption is used.
5175
5176[[sendemail.sslVerify]]sendemail.sslVerify::
5177+
5178If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
5179will not verify the server certificate when it connects to send
5180an email message.
5181+
5182By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07005183
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005184[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07005185+
5186User name to authenticate with, if required for relay.
5187
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005188[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07005189+
5190Password for the account named by sendemail.smtpUser.
5191
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005192[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07005193+
Gal Paikin166e4432020-09-22 19:09:45 +03005194If present, each value adds one entry to the list of allowed email
5195addresses that Gerrit can send emails to. If set to a complete
5196email address, that one address is added to the list of allowed
5197emails.
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07005198If set to a domain name, any address at that domain can receive
5199email from Gerrit.
5200+
Rikard Almgren5b9de1c2019-03-12 17:55:16 +01005201If allowrcpt is configured, The set of allowed recipients is:
5202`allowrcpt - denyrcpt`.
5203+
5204By default, unset, permitting delivery to any email address.
5205
5206[[sendemail.denyrcpt]]sendemail.denyrcpt::
5207+
Gal Paikin166e4432020-09-22 19:09:45 +03005208If present, each value adds one entry to the list of email
5209addresses that Gerrit can't send emails to. If set to a complete
5210email address, that one address is added to the list of blocked
5211emails.
Rikard Almgren5b9de1c2019-03-12 17:55:16 +01005212If set to a domain name, any address at that domain can *not* receive
5213email from Gerrit.
5214+
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07005215By default, unset, permitting delivery to any email address.
5216
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07005217[[sendemail.includeDiff]]sendemail.includeDiff::
5218+
Bruce Zueb00ff32012-11-27 17:38:10 +08005219If true, new change emails and merged change emails from Gerrit
5220will include the complete unified diff of the change.
5221Variable maxmimumDiffSize places an upper limit on how large the
5222email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07005223+
5224By default, false.
5225
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07005226[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
5227+
5228Largest size of unified diff output to include in an email. When
5229the diff exceeds this size the file paths will be listed instead.
5230Standard byte unit suffixes are supported.
5231+
5232By default, 256 KiB.
5233
Alex Blewitt9cca7402011-02-11 01:39:30 +00005234[[sendemail.importance]]sendemail.importance::
5235+
5236If present, emails sent from Gerrit will have the given level
5237of importance. Valid values include 'high' and 'low', which
5238email clients will render in different ways.
5239+
5240By default, unset, so no Importance header is generated.
5241
5242[[sendemail.expiryDays]]sendemail.expiryDays::
5243+
5244If present, emails sent from Gerrit will expire after the given
5245number of days. This will add the Expiry-Date header and
5246email clients may expire or expunge mails whose Expiry-Date
5247header is in the past. This should be a positive non-zero
5248number indicating how many days in the future the mails
5249should expire.
5250+
5251By default, unset, so no Expiry-Date header is generated.
5252
Patrick Hiesel31d60f02017-02-09 17:38:40 +01005253[[sendemail.replyToAddress]]sendemail.replyToAddress::
5254+
5255A custom Reply-To address should only be provided if Gerrit is set up to
5256receive emails and the inbound address differs from
5257<<sendemail.from,sendemail.from>>.
5258It will be set as Reply-To header on all types of outgoing email where
5259Gerrit can parse back a user's reply.
5260+
5261Defaults to an empty string which adds <<sendemail.from,sendemail.from>> as
5262Reply-To if inbound email is enabled and the review's author otherwise.
Shawn O. Pearcedba97642011-09-07 20:12:31 -07005263
David Pursehouse917b7262017-04-21 18:18:52 +02005264[[sendemail.allowTLD]]sendemail.allowTLD::
5265+
5266List of custom TLDs to allow sending emails to in addition to those specified
Marian Harbach34253372019-12-10 18:01:31 +01005267in the link:http://data.iana.org/TLD/[IANA list,role=external,window=_blank].
David Pursehouse917b7262017-04-21 18:18:52 +02005268+
5269Defaults to an empty list, meaning no additional TLDs are allowed.
5270
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01005271
5272[[sendemail.addInstanceNameInSubject]]sendemail.addInstanceNameInSubject::
5273+
5274When set to true, Gerrit will add its short name to the email subject, allowing recipients to quickly identify
5275what Gerrit instance the email came from.
5276+
5277The short name can be customized via the gerrit.instanceName option.
5278+
Luca Milanesiofdfca772018-04-04 23:42:32 +01005279Defaults to false.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01005280
5281
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005282[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005283=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07005284
Shawn Pearcec896eaa2016-08-23 19:38:58 -07005285[[site.allowOriginRegex]]site.allowOriginRegex::
5286+
5287List of regular expressions matching origins that should be permitted
Shawn Pearce53ebad42017-06-10 11:14:20 -07005288to use the full Gerrit REST API. These should be trusted applications,
5289as the sites may be able to use the user's credentials. Applies to
5290all requests, including state changing methods (PUT, DELETE, POST).
5291+
5292Expressions should not require trailing slash. For example a valid
5293pattern might be `https://build-status[.]example[.]com`.
Shawn Pearcec896eaa2016-08-23 19:38:58 -07005294+
5295By default, unset, denying all cross-origin requests.
5296
Shawn O. Pearcedba97642011-09-07 20:12:31 -07005297[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
5298+
5299If true the server checks the site header, footer and CSS files for
5300updated versions. If false, a server restart is required to change
5301any of these resources. Default is true, allowing automatic reloads.
5302
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005303[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005304=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07005305
5306Variables in section ssh-alias permit the site administrator to alias
5307another command from Gerrit or a plugin into the `gerrit` command
5308namespace. To alias `replication start` to `gerrit replicate`:
5309
5310----
5311[ssh-alias]
5312 replicate = replication start
5313----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07005314
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005315[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005316=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07005317
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02005318[[sshd.enableCompression]]sshd.enableCompression::
5319+
5320In the general case, we want to disable transparent compression, since
5321the majority of our data transfer is highly compressed Git pack files
5322and we cannot make them any smaller than they already are.
5323+
5324However, if there are CPU in abundance and the server is reachable
5325through slow networks, gits with huge amount of refs can benefit from
5326SSH-compression since git does not compress the ref announcement during
5327handshake.
5328+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02005329Compression can be especially useful when Gerrit replicas are being used
Matthias Sohnd8182ba2019-12-09 14:50:23 +01005330for the larger clones and fetches and the primary server mostly takes
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02005331small receive-packs.
5332+
5333By default, `false`.
5334
David Ostrovskye2921b62015-03-04 22:36:10 +01005335[[sshd.backend]]sshd.backend::
5336+
5337Starting from version 0.9.0 Apache SSHD project added support for NIO2
Orgad Shanehb7bb7352019-09-19 10:26:19 +03005338IoSession. To use the old MINA session the `backend` option must be set
5339to `MINA`.
David Ostrovskye2921b62015-03-04 22:36:10 +01005340+
Luca Milanesiofc1ed9c2016-03-01 18:28:36 +00005341By default, `NIO2`.
David Ostrovskye2921b62015-03-04 22:36:10 +01005342
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005343[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07005344+
5345Specifies the local addresses the internal SSHD should listen
5346for connections on. The following forms may be used to specify
5347an address. In any form, `:'port'` may be omitted to use the
David Pursehousea3af2552016-08-02 14:04:44 +09005348default of `29418`.
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07005349+
David Pursehousea3af2552016-08-02 14:04:44 +09005350* `'hostname':'port'` (for example `review.example.com:29418`)
5351* `'IPv4':'port'` (for example `10.0.0.1:29418`)
5352* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
5353* `+*:'port'+` (for example `+*:29418+`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07005354
5355+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005356--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07005357If multiple values are supplied, the daemon will listen on all
5358of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005359
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07005360To disable the internal SSHD, set listenAddress to `off`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005361
David Pursehousea3af2552016-08-02 14:04:44 +09005362By default, `*:29418`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005363--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07005364
James Y Knight910bd862011-01-11 20:05:56 -05005365[[sshd.advertisedAddress]]sshd.advertisedAddress::
5366+
5367Specifies the addresses clients should be told to connect to.
5368This may differ from sshd.listenAddress if a firewall based port
5369redirector is being used, making Gerrit appear to answer on port
537022. The following forms may be used to specify an address. In any
5371form, `:'port'` may be omitted to use the default SSH port of 22.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005372
David Pursehousea3af2552016-08-02 14:04:44 +09005373* `'hostname':'port'` (for example `review.example.com:22`)
5374* `'IPv4':'port'` (for example `10.0.0.1:29418`)
5375* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
James Y Knight910bd862011-01-11 20:05:56 -05005376
5377+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005378--
James Y Knight910bd862011-01-11 20:05:56 -05005379If multiple values are supplied, the daemon will advertise all
5380of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005381
David Pursehousea3af2552016-08-02 14:04:44 +09005382By default uses the value of `sshd.listenAddress`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005383--
James Y Knight910bd862011-01-11 20:05:56 -05005384
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005385[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07005386+
5387If true, enables TCP keepalive messages to the other side, so
5388the daemon can terminate connections if the peer disappears.
5389+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02005390Only effective when `sshd.backend` is set to `MINA`.
5391+
David Pursehousea3af2552016-08-02 14:04:44 +09005392By default, `true`.
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07005393
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08005394[[sshd.threads]]sshd.threads::
5395+
5396Number of threads to use when executing SSH command requests.
5397If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09005398are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08005399+
Florian Klink2a389462019-07-23 14:14:32 +02005400By default, 2x the number of CPUs available to the JVM (but at least 4
5401threads).
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02005402+
5403[NOTE]
5404When SSH daemon is enabled then this setting also defines the max number of
5405concurrent Git requests for interactive users over SSH and HTTP together.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08005406
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005407[[sshd.batchThreads]]sshd.batchThreads::
5408+
5409Number of threads to allocate for SSH command requests from
Patrick Hiesele587c402020-08-07 16:11:29 +02005410link:access-control.html#service_users[service users].
Fredrik Luthander46843022012-03-13 16:11:02 +01005411If equals to 0, then all non-interactive requests are executed in the same
5412queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005413+
5414Any other value will remove the number of threads from the queue
5415allocated to interactive users, and create a separate thread pool
5416of the requested size, which will be used to run commands from
Patrick Hiesele587c402020-08-07 16:11:29 +02005417service users.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005418+
Patrick Hiesele587c402020-08-07 16:11:29 +02005419If the number of threads requested for service users is larger
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005420than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09005421value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005422+
Dariusz Luksza145de472015-11-09 18:44:35 +01005423By default is 1 on single core node, 2 otherwise.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02005424+
5425[NOTE]
5426When SSH daemon is enabled then this setting also defines the max number of
5427concurrent Git requests for batch users over SSH and HTTP together.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005428
Kenny Root15ac1b82010-02-24 00:29:20 -08005429[[sshd.streamThreads]]sshd.streamThreads::
5430+
5431Number of threads to use when formatting events to asynchronous
5432streaming clients. Event formatting is multiplexed onto this thread
5433pool by a simple FIFO scheduling system.
5434+
5435By default, 1 plus the number of CPUs available to the JVM.
5436
Edwin Kempinb5df3b82011-10-10 11:31:14 +02005437[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07005438+
5439Number of threads used to parse a command line submitted by a client
5440over SSH for execution, create the internal data structures used by
5441that command, and schedule it for execution on another thread.
5442+
5443By default, 2.
5444
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07005445[[sshd.maxAuthTries]]sshd.maxAuthTries::
5446+
5447Maximum number of authentication attempts before the server
5448disconnects the client. Each public key that a client has loaded
5449into its local agent counts as one auth request. Users can work
5450around the server's limit by loading less keys into their agent,
5451or selecting a specific key in their `~/.ssh/config` file with
5452the `IdentityFile` option.
5453+
5454By default, 6.
5455
5456[[sshd.loginGraceTime]]sshd.loginGraceTime::
5457+
5458Time in seconds that a client has to authenticate before the server
5459automatically terminates their connection. Values should use common
5460unit suffixes to express their setting:
5461+
5462* s, sec, second, seconds
5463* m, min, minute, minutes
5464* h, hr, hour, hours
5465* d, day, days
5466
5467+
5468By default, 2 minutes.
5469
Christian Aistleitner3d794592013-04-08 00:19:40 +02005470[[sshd.idleTimeout]]sshd.idleTimeout::
5471+
5472Time in seconds after which the server automatically terminates idle
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00005473connections (or 0 to disable closing of idle connections) not waiting for
5474any server operation to complete.
5475Values should use common unit suffixes to express their setting:
Christian Aistleitner3d794592013-04-08 00:19:40 +02005476+
5477* s, sec, second, seconds
5478* m, min, minute, minutes
5479* h, hr, hour, hours
5480* d, day, days
5481
5482+
5483By default, 0.
5484
Paladox nonedaafdb62017-10-14 16:18:42 +00005485[[sshd.waitTimeout]]sshd.waitTimeout::
5486+
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00005487Time in seconds after which the server automatically terminates
5488connections waiting for a server operation to complete, like for instance
5489cloning a very large repo with lots of refs.
Paladox nonedaafdb62017-10-14 16:18:42 +00005490Values should use common unit suffixes to express their setting:
5491+
5492* s, sec, second, seconds
5493* m, min, minute, minutes
5494* h, hr, hour, hours
5495* d, day, days
5496
5497+
5498By default, 30s.
5499
Thomas Draebing2c7346a2020-08-03 17:51:15 +02005500[[sshd.gracefulStopTimeout]]sshd.gracefulStopTimeout::
5501+
5502Set a graceful stop time. If set, Gerrit ensures that all open SSH
5503sessions are preserved for a maximum period of time, before forcing the
5504shutdown of the SSH daemon. During this period, no new requests
5505will be accepted. This option is meant to be used in setups performing
5506rolling restarts.
5507+
5508Values should use common unit suffixes to express their setting:
5509+
5510* s, sec, second, seconds
5511* m, min, minute, minutes
5512+
5513By default, 0 seconds (immediate shutdown).
5514
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07005515[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
5516+
5517Maximum number of concurrent SSH sessions that a user account
5518may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09005519that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07005520the number of commands a user may issue over a single connection.
5521If set to 0, there is no limit.
5522+
5523By default, 64.
5524
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005525[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005526+
5527Available ciphers. To permit multiple ciphers, specify multiple
5528`sshd.cipher` keys in the configuration file, one cipher name
5529per key. Cipher names starting with `+` are enabled in addition
5530to the default ciphers, cipher names starting with `-` are removed
5531from the default cipher set.
5532+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005533Supported ciphers:
5534+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005535* `aes128-cbc`
David Ostrovskye77996f2022-06-25 13:20:39 +02005536* `aes128-ctr`
5537* `aes128-gcm@openssh.com`
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005538* `aes192-cbc`
David Ostrovskye77996f2022-06-25 13:20:39 +02005539* `aes192-ctr`
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005540* `aes256-cbc`
David Ostrovskye77996f2022-06-25 13:20:39 +02005541* `aes256-ctr`
5542* `aes256-gcm@openssh.com`
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005543* `arcfour128`
5544* `arcfour256`
David Ostrovskye77996f2022-06-25 13:20:39 +02005545* `blowfish-cbc`
5546* `chacha20-poly1305@openssh.com`
5547* `3des-cbc`
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005548* `none`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005549+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005550If your setup allows for it, it's recommended to disable all ciphers except
5551the AES-CTR modes.
David Ostrovskybcbf70d2022-06-29 13:27:03 +02005552+
5553See also link:https://github.com/apache/mina-sshd/tree/master#ciphers[ciphers,role=external,window=_blank].
5554+
5555By default, all supported ciphers except `none` are available.
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005556
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005557[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005558+
5559Available MAC (message authentication code) algorithms. To permit
5560multiple algorithms, specify multiple `sshd.mac` keys in the
5561configuration file, one MAC per key. MAC names starting with `+`
5562are enabled in addition to the default MACs, MAC names starting with
5563`-` are removed from the default MACs.
5564+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005565Supported MACs:
5566+
5567* `hmac-md5`
5568* `hmac-md5-96`
5569* `hmac-sha1`
5570* `hmac-sha1-96`
5571* `hmac-sha2-256`
5572* `hmac-sha2-512`
David Ostrovskybd0e6bb2022-06-26 09:19:29 +02005573* `hmac-sha1-etm@openssh.com`
5574* `hmac-sha2-256-etm@openssh.com`
5575* `hmac-sha2-512-etm@openssh.com`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005576+
David Ostrovskybcbf70d2022-06-29 13:27:03 +02005577See also link:https://github.com/apache/mina-sshd/tree/master#macs[macs,role=external,window=_blank].
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005578+
5579By default, all supported MACs are available.
5580
David Ostrovskya0f77df2021-06-07 23:04:35 +02005581[[sshd.enableDeprecatedKexAlgorithms]]sshd.enableDeprecatedKexAlgorithms::
5582+
5583Enable deprecated kex algorithms:
5584+
5585* `diffie-hellman-group1-sha1`
5586* `diffie-hellman-group14-sha1`
5587* `diffie-hellman-group-exchange-sha1`
5588
5589By default, the deprecated kex algorithms are disabled.
5590
Scott Dialb4a04fa2016-03-15 09:44:11 -04005591[[sshd.kex]]sshd.kex::
5592+
5593--
5594Available key exchange algorithms. To permit multiple algorithms,
5595specify multiple `sshd.kex` keys in the configuration file, one key
5596exchange algorithm per key. Key exchange algorithm names starting
5597with `+` are enabled in addition to the default key exchange
5598algorithms, key exchange algorithm names starting with `-` are
5599removed from the default key exchange algorithms.
5600
Scott Dialb4a04fa2016-03-15 09:44:11 -04005601Supported key exchange algorithms:
5602
5603* `ecdh-sha2-nistp521`
5604* `ecdh-sha2-nistp384`
5605* `ecdh-sha2-nistp256`
David Ostrovskyd4e08c32022-06-26 09:40:05 +02005606* `curve25519-sha256`
5607* `curve25519-sha256@libssh.org`
5608* `curve448-sha512`
Scott Dialb4a04fa2016-03-15 09:44:11 -04005609* `diffie-hellman-group-exchange-sha256`
David Ostrovskya0f77df2021-06-07 23:04:35 +02005610* `diffie-hellman-group18-sha512`
5611* `diffie-hellman-group17-sha512`
5612* `diffie-hellman-group16-sha512`
5613* `diffie-hellman-group15-sha512`
5614* `diffie-hellman-group14-sha256`
5615
5616See link:#sshd.enableDeprecatedKexAlgorithms[sshd.enableDeprecatedKexAlgorithms]
5617for deprecated key algorithms and how to enable them.
Scott Dialb4a04fa2016-03-15 09:44:11 -04005618
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005619It is strongly recommended to disable at least `diffie-hellman-group1-sha1`
5620as it's known to be vulnerable (logjam attack). Additionally, if your setup
5621allows for it, it is recommended to disable the remaining two `sha1` key
5622exchange algorithms.
David Ostrovskybcbf70d2022-06-29 13:27:03 +02005623
5624See also link:https://github.com/apache/mina-sshd/tree/master#key-exchange[key exchange,role=external,window=_blank].
5625
5626By default, all supported key exchange algorithms are available.
Scott Dialb4a04fa2016-03-15 09:44:11 -04005627--
5628
Alex Blewitt7efb06f2013-04-01 12:46:48 -04005629[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
5630+
5631Enable kerberos authentication for SSH connections. To permit
5632kerberos authentication, the server must have a host principal
5633(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
5634This must be provisioned by the kerberos administrators, and is
5635typically installed into `/etc/krb5.keytab` on host machines.
5636+
5637The keytab must contain at least one `host/` principal, typically
5638using the host's canonical name. If it does not use the
5639canonical name, the `sshd.kerberosPrincipal` should be configured
5640with the correct name.
5641+
5642By default, not set and so kerberos authentication is not enabled.
5643
5644[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
5645+
5646If kerberos authentication is enabled with `sshd.kerberosKeytab`,
5647instead use the given principal name instead of the default.
5648If the principal does not begin with `host/` a warning message is
5649printed and may prevent successful authentication.
5650+
5651This may be useful if the host is behind an IP load balancer or
5652other SSH forwarding systems, since the principal name is constructed
5653by the client and must match for kerberos authentication to work.
5654+
5655By default, `host/canonical.host.name`
5656
Shawn Pearce318bfca2013-10-17 22:15:38 -07005657[[sshd.requestLog]]sshd.requestLog::
5658+
5659Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
5660If enabled, a request log file is written out by the SSH daemon.
Matthias Sohn450bc202020-08-20 14:40:32 +02005661The sshd log format is documented link:logs.html#_sshd_log[here].
Shawn Pearce318bfca2013-10-17 22:15:38 -07005662+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01005663`log4j.appender` with the name `sshd_log` can be configured to overwrite
5664programmatic configuration.
5665+
David Pursehousea3af2552016-08-02 14:04:44 +09005666By default, `true`.
Gustaf Lundh4e859932018-04-16 10:56:31 +02005667+
Sven Selberg2a0beab2018-04-20 14:49:20 +02005668This value supports link:#reloadConfig[configuration reloads].
Shawn Pearce318bfca2013-10-17 22:15:38 -07005669
David Ostrovsky985201b2015-03-04 22:37:33 +01005670[[sshd.rekeyBytesLimit]]sshd.rekeyBytesLimit::
5671+
5672The SSH daemon will issue a rekeying after a certain amount of data.
5673This configuration option allows you to tweak that setting.
5674+
5675By default, 1073741824 (bytes, 1GB).
5676+
David Pursehousea3af2552016-08-02 14:04:44 +09005677The `rekeyBytesLimit` cannot be set to lower than 32.
David Ostrovsky985201b2015-03-04 22:37:33 +01005678
5679[[sshd.rekeyTimeLimit]]sshd.rekeyTimeLimit::
5680+
5681The SSH daemon will issue a rekeying after a certain amount of time.
5682This configuration option allows you to tweak that setting.
5683+
5684By default, 1h.
5685+
5686Set to 0 to disable this check.
5687
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005688[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005689=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07005690
Sven Selberg42d9d292014-08-13 11:20:11 +02005691[[suggest.maxSuggestedReviewers]]suggest.maxSuggestedReviewers::
5692+
5693The maximum numbers of reviewers suggested.
5694+
5695By default 10.
Gustaf Lundh25e608f2018-04-16 10:54:53 +02005696+
Sven Selberg2a0beab2018-04-20 14:49:20 +02005697This value supports link:#reloadConfig[configuration reloads].
Sven Selberg42d9d292014-08-13 11:20:11 +02005698
Edwin Kempinf957dc22012-10-19 20:41:18 +02005699[[suggest.from]]suggest.from::
5700+
5701The number of characters that a user must have typed before suggestions
Patrick Hiesel87880b02016-05-03 18:15:08 +02005702are provided. If set to 0, suggestions are always provided. This is only
5703used for suggesting accounts when adding members to a group.
Edwin Kempinf957dc22012-10-19 20:41:18 +02005704+
5705By default 0.
Nasser Grainawic3b05342022-02-25 16:58:13 -07005706
Gal Paikin0d07c542020-01-08 17:11:53 +02005707[[suggest.relevantChanges]]suggest.relevantChanges::
5708+
5709When suggesting reviewers, we go over recent changes of the user, and
5710give priority to users that are present as reviewers in any of those
5711changes. The number of changes we go over is `sugggest.relevantChanges`.
5712+
Gal Paikincb5a7ca2020-02-18 09:44:28 +01005713This nubmer is a tradeoff between speed and accuracy.
Gal Paikin0d07c542020-01-08 17:11:53 +02005714A high number would be accurate but slow, and a low number would be
5715fast but inaccurate.
Gal Paikincb5a7ca2020-02-18 09:44:28 +01005716+
5717By default 50.
Edwin Kempinf957dc22012-10-19 20:41:18 +02005718
Matthias Sohn21b652c2021-02-22 22:51:18 +01005719[[suggest.skipServiceUsers]]suggest.skipServiceUsers::
5720+
5721If link:access-control.html#service_users[service users] should be skipped when
5722suggesting reviewers.
5723+
5724By default true.
5725
Edwin Kempin0a49eca2019-06-21 09:38:46 +02005726[[tracing]]
5727=== Section tracing
5728
5729[[tracing.performanceLogging]]tracing.performanceLogging::
5730+
5731Whether performance logging is enabled.
5732+
5733When performance logging is enabled, performance events for some
5734operations are collected in memory while a request is running. At the
5735end of the request the performance events are handed over to the
5736link:dev-plugins.html#performance-logger[PerformanceLogger] plugins.
5737This means if performance logging is enabled, the memory footprint of
Sven Selbergc5fcca02022-04-22 13:37:53 +02005738requests can be markedly increased.
5739In one recorded case the impact was an overall heap increase of 40%
5740(using the metrics-reporter-graphite plugin), in other instances the
5741heap increase wasn't nearly as dramatic and the impact is most likely
5742dependent on which plugin is used.
Edwin Kempin0a49eca2019-06-21 09:38:46 +02005743+
Sven Selbergc5fcca02022-04-22 13:37:53 +02005744By default, false.
Edwin Kempin0a49eca2019-06-21 09:38:46 +02005745
Edwin Kempin2cba2982019-07-05 13:19:43 +02005746[[tracing.traceid]]
5747==== Subsection tracing.<trace-id>
5748
5749There can be multiple `tracing.<trace-id>` subsections to configure
5750automatic tracing of requests. To be traced a request must match all
5751conditions of one `tracing.<trace-id>` subsection. The subsection name
5752is used as trace ID. Using this trace ID administrators can find
5753matching log entries.
5754
5755[[tracing.traceid.requestType]]tracing.<trace-id>.requestType::
5756+
5757Type of request for which request tracing should be always enabled (can
5758be `GIT_RECEIVE`, `GIT_UPLOAD`, `REST` and `SSH`).
5759+
5760May be specified multiple times.
5761+
5762By default, unset (all request types are matched).
5763
Edwin Kempinb0ddb0b2019-07-08 12:11:32 +02005764[[tracing.traceid.requestUriPattern]]tracing.<trace-id>.requestUriPattern::
5765+
5766Regular expression to match request URIs for which request tracing
Edwin Kempin764dec82021-09-22 10:45:01 +02005767should be enabled except if they match
5768link:tracing.traceid.excludedRequestUriPattern[excludedRequestUriPattern].
5769Request URIs are only available for REST requests. Request URIs never include
5770the '/a' prefix.
Edwin Kempinb0ddb0b2019-07-08 12:11:32 +02005771+
5772May be specified multiple times.
5773+
5774By default, unset (all request URIs are matched).
5775
Edwin Kempin764dec82021-09-22 10:45:01 +02005776[[tracing.traceid.excludedRequestUriPattern]]tracing.<trace-id>.excludedRequestUriPattern::
5777+
5778Regular expression to match request URIs for which request tracing
5779should not be enabled even if they match
5780link:#tracing.traceid.requestUriPattern[requestUriPattern].
5781Request URIs are only available for REST requests. Request URIs never include
Edwin Kempin631abf12023-09-01 09:01:58 +00005782the '/a' prefix and don't contain the query string with the request parameters.
Edwin Kempin764dec82021-09-22 10:45:01 +02005783+
5784May be specified multiple times.
5785+
5786By default, unset (no request URIs are excluded).
5787
Edwin Kempin631abf12023-09-01 09:01:58 +00005788[[tracing.traceid.requestQueryStringPattern]]tracing.<trace-id>.requestQueryStringPattern::
5789+
5790Regular expression to match request query strings for which request tracing
5791should be enabled. The query string is the portion of the URL that contains
5792the request parameters.
5793+
5794May be specified multiple times.
5795+
5796Example:
5797----
5798 requestQueryStringPattern = .*limit=.*
5799----
5800+
5801By default, unset (all request query strings are matched).
5802
Edwin Kempin24434fe2023-11-03 12:41:19 +00005803[[tracing.traceid.headerPattern]]tracing.<trace-id>.headerPattern::
5804+
5805Regular expression to match headers for which request tracing should be
5806enabled. The regular expression is matched against the headers in the
5807format '<header-name>=<header-value>'.
5808+
5809May be specified multiple times.
5810+
5811Example:
5812----
5813 requestQueryStringPattern = User-Agent=foo-.*
5814----
5815+
5816By default, unset (all headers are matched).
5817
Edwin Kempin2cba2982019-07-05 13:19:43 +02005818[[tracing.traceid.account]]tracing.<trace-id>.account::
5819+
5820Account ID of an account for which request tracing should be always
5821enabled.
5822+
5823May be specified multiple times.
5824+
5825By default, unset (all accounts are matched).
5826
5827[[tracing.traceid.projectPattern]]tracing.<trace-id>.projectPattern::
5828+
5829Regular expression to match project names for which request tracing
5830should be always enabled.
5831+
5832May be specified multiple times.
5833+
5834By default, unset (all projects are matched).
5835
Edwin Kempin927ff822021-08-03 15:46:34 +02005836[[deadline.id]]
5837==== Subsection deadline.<id>
5838
5839There can be multiple `deadline.<id>` subsections to configure deadlines for
5840request executions. For a deadline to apply all conditions of the
5841`deadline.<id>` subsection must match. The subsection name is the ID of the
5842deadline configuration and allows to track back an applied deadline to its
5843configuration.
5844
5845Clients can override the deadlines that are configured here by setting a
5846deadline on the request.
5847
5848Deadlines are only supported for `REST`, `SSH` and `GIT_RECEIVE` requests, but
5849not for `GIT_UPLOAD` requests.
5850
5851[[deadline.id.timeout]]deadline.<id>.timeout::
5852+
5853Timeout after which matching requests should be cancelled.
5854+
5855Values must be specified using standard time unit abbreviations ('ms', 'sec',
5856'min', etc.).
5857+
5858For some requests additional timeout configurations may apply, e.g.
5859link:#receive.timeout[receive.timeout] for git pushes.
5860+
5861By default, unset.
5862
Edwin Kempin0fecade2021-08-04 11:14:44 +02005863[[deadline.id.isAdvisory]]deadline.<id>.isAdvisory::
5864+
5865Whether this deadline is an advisory deadline. Advisory deadlines do not cause
5866requests to be aborted when they are exceeded. Instead, if an advisory deadline
Edwin Kempin0bc9df92021-08-05 16:15:09 +02005867is exceeded, only the `cancellation/advisory_deadline_count` metrics is
5868incremented and a log is written. This is useful to test how many requests would
5869be affected by a new deadline configuration.
Edwin Kempin0fecade2021-08-04 11:14:44 +02005870+
5871By default, `false`.
5872
Edwin Kempin927ff822021-08-03 15:46:34 +02005873[[deadline.id.requestType]]deadline.<id>.requestType::
5874+
5875Type of request to which the deadline applies (can be `GIT_RECEIVE`, `REST` and
5876`SSH`).
5877+
5878May be specified multiple times.
5879+
5880By default, unset (all request types are matched).
5881
5882[[deadline.id.requestUriPattern]]deadline.<id>.requestUriPattern::
5883+
Edwin Kempin764dec82021-09-22 10:45:01 +02005884Regular expression to match request URIs to which the deadline applies except if
5885they match
5886link:#deadline.id.excludedRequestUriPattern[excludedRequestUriPattern]. Request
Edwin Kempin927ff822021-08-03 15:46:34 +02005887URIs are only available for REST requests. Request URIs never include the '/a'
5888prefix.
5889+
5890May be specified multiple times.
5891+
5892By default, unset (all request URIs are matched).
5893
Edwin Kempin764dec82021-09-22 10:45:01 +02005894[[deadline.id.excludedRequestUriPattern]]deadline.<id>.excludedRequestUriPattern::
5895+
5896Regular expression to match request URIs to which the deadline should not be
5897applied even if they match
5898link:#deadline.id.requestUriPattern[requestUriPattern]. Request URIs are only
5899available for REST requests. Request URIs never include the '/a' prefix.
5900+
5901May be specified multiple times.
5902+
5903By default, unset (no request URIs are excluded).
5904
Edwin Kempin927ff822021-08-03 15:46:34 +02005905[[deadline.id.account]]deadline.<id>.account::
5906+
5907Account ID of an account to which the deadline applies.
5908+
5909May be specified multiple times.
5910+
5911By default, unset (all accounts are matched).
5912
5913[[deadline.id.projectPattern]]deadline.<id>.projectPattern::
5914+
5915Regular expression to match project names to which the deadline applies.
5916+
5917May be specified multiple times.
5918+
5919By default, unset (all projects are matched).
5920
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005921[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005922=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07005923
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07005924Tagged footer lines containing references to external
5925tracking systems, parsed out of the commit message and
David Pursehoused55a6b62015-02-27 17:39:38 +09005926saved in Gerrit's secondary index.
Shawn Pearceff61c8a2013-10-07 19:35:53 -07005927
5928After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08005929must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07005930
Edwin Kempinbb421f12011-08-25 11:19:00 +02005931The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07005932bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07005933
5934----
5935[trackingid "jira-bug"]
5936 footer = Bugfix:
David Pursehousece7f6862015-02-19 14:52:45 +09005937 footer = Bug:
Goran Lungberg04132a12010-06-15 17:20:37 -07005938 match = JRA\\d{2,8}
5939 system = JIRA
5940
5941[trackingid "jira-feature"]
5942 footer = Feature
5943 match = JRA(\\d{2,8})
5944 system = JIRA
5945----
5946
5947[[trackingid.name.footer]]trackingid.<name>.footer::
5948+
David Pursehousece7f6862015-02-19 14:52:45 +09005949A prefix tag that identifies the footer line to parse for tracking ids.
5950+
5951Several trackingid entries can have the same footer tag, and a single trackingid
5952entry can have multiple footer tags.
5953+
5954If multiple footer tags are specified, each tag will be parsed separately and
5955duplicates will be ignored.
5956+
5957The trailing ":" is optional.
Goran Lungberg04132a12010-06-15 17:20:37 -07005958
5959[[trackingid.name.match]]trackingid.<name>.match::
5960+
Magnus Bäcke5611832011-02-02 08:57:15 +01005961A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +01005962Java regular expression (java.util.regex),role=external,window=_blank] used to match the
Magnus Bäcke5611832011-02-02 08:57:15 +01005963external tracking id part of the footer line. The match can
5964result in several entries in the DB. If grouping is used in the
5965regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01005966Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07005967+
5968The configuration file parser eats one level of backslashes, so the
5969character class `\s` requires `\\s` in the configuration file. The
5970parser also terminates the line at the first `#`, so a match
5971expression containing # must be wrapped in double quotes.
5972
5973[[trackingid.name.system]]trackingid.<name>.system::
5974+
Marija Savtchouk957b17a2022-06-29 16:22:50 +01005975The name of the external tracking system (maximum 20 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07005976It is possible to have several trackingid entries for the same
5977tracking system.
5978
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005979[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005980=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07005981
5982[[transfer.timeout]]transfer.timeout::
5983+
5984Number of seconds to wait for a single network read or write
5985to complete before giving up and declaring the remote side is
5986not responding. If 0, there is no timeout, and this server will
5987wait indefinitely for a transfer to finish.
5988+
5989A timeout should be large enough to mostly transfer the objects to
5990the other side. 1 second may be too small for larger projects,
5991especially over a WAN link, while 10-30 seconds is a much more
5992reasonable timeout value.
5993+
5994Defaults to 0 seconds, wait indefinitely.
5995
lincoln2be11602010-07-05 10:53:25 -03005996
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005997[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005998=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005999
Dave Borowitzb1795142017-10-12 07:13:37 -07006000Options to control the behavior of `upload-pack` on the server side,
6001which handles a user's fetch, clone, or repo sync command.
lincoln2be11602010-07-05 10:53:25 -03006002
6003----
6004[upload]
6005 allowGroup = GROUP_ALLOWED_TO_EXECUTE
6006 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
6007----
6008
6009[[upload.allowGroup]]upload.allowGroup::
6010+
Dave Borowitzb1795142017-10-12 07:13:37 -07006011Name of the groups of users that are allowed to execute 'upload-pack'.
6012One or more groups can be set.
lincoln2be11602010-07-05 10:53:25 -03006013+
6014If no groups are added, any user will be allowed to execute
6015'upload-pack' on the server.
6016
Owen Lie2877bb2017-07-14 09:11:20 -04006017[[accountDeactivation]]
6018=== Section accountDeactivation
6019
6020Configures the parameters for the scheduled task to sweep and deactivate Gerrit
6021accounts according to their status reported by the auth backend. Currently only
6022supported for LDAP backends.
6023
6024[[accountDeactivation.startTime]]accountDeactivation.startTime::
6025+
Edwin Kempind33d95a2018-02-16 11:44:04 +01006026The link:#schedule-configuration-startTime[start time] for running
6027account deactivations.
Owen Lie2877bb2017-07-14 09:11:20 -04006028
6029[[accountDeactivation.interval]]accountDeactivation.interval::
6030+
Edwin Kempind33d95a2018-02-16 11:44:04 +01006031The link:#schedule-configuration-interval[interval] for running
6032account deactivations.
6033
Saša Živkovf0966112020-03-17 12:20:31 +01006034Note that the task will only be scheduled if the
6035link:#autoUpdateAccountActiveStatus[auth.autoUpdateAccountActiveStatus]
6036is set to true.
6037
Edwin Kempind33d95a2018-02-16 11:44:04 +01006038link:#schedule-configuration-examples[Schedule examples] can be found
6039in the link:#schedule-configuration[Schedule Configuration] section.
Owen Lie2877bb2017-07-14 09:11:20 -04006040
Stefan Beller0f724ff2015-07-17 10:17:51 -07006041[[submodule]]
6042=== Section submodule
6043
Shawn Pearcedc477cd2016-03-24 19:56:18 -07006044[[submodule.verbosesuperprojectupdate]]submodule.verboseSuperprojectUpdate::
Stefan Beller0f724ff2015-07-17 10:17:51 -07006045+
6046When using link:user-submodules.html#automatic_update[automatic superproject updates]
Zhen Chenc877ca92016-07-27 14:22:37 -07006047this option will determine how the submodule commit messages are included into
Stefan Beller0f724ff2015-07-17 10:17:51 -07006048the commit message of the superproject update.
6049+
Zhen Chenc877ca92016-07-27 14:22:37 -07006050If `FALSE`, will not include any commit messages for the gitlink update.
6051+
6052If `SUBJECT_ONLY`, will include only the commit subjects.
6053+
6054If `TRUE`, will include full commit messages.
6055+
6056By default this is `TRUE`.
Stefan Beller0f724ff2015-07-17 10:17:51 -07006057
Shawn Pearcedc477cd2016-03-24 19:56:18 -07006058[[submodule.enableSuperProjectSubscriptions]]submodule.enableSuperProjectSubscriptions::
Stefan Beller8cc252e2016-03-10 10:06:53 -08006059+
6060This allows to enable the superproject subscription mechanism.
6061+
6062By default this is true.
Stefan Beller0f724ff2015-07-17 10:17:51 -07006063
Patrick Hiesel44e5d6e2017-08-24 16:07:26 +02006064[[submodule.maxCombinedCommitMessageSize]]submodule.maxCombinedCommitMessageSize::
6065+
6066This allows to limit the length of the commit message for a submodule.
6067+
6068By default this is 262144 (256 KiB).
6069+
6070Common unit suffixes of k, m, or g are supported.
6071
6072[[submodule.maxCommitMessages]]submodule.maxCommitMessages::
6073+
6074This allows to limit the number of commit messages that should be combined when creating
6075a commit message for a submodule.
6076+
6077By default this is 1000.
6078
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08006079[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006080=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07006081
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07006082[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07006083+
6084Name that Gerrit calls itself in Git when it creates a new Git
6085commit, such as a merge during change submission.
6086+
6087By default this is "Gerrit Code Review".
6088
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07006089[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07006090+
6091Email address that Gerrit refers to itself as when it creates a
6092new Git commit, such as a merge commit during change submission.
6093+
Kenyon Ralph5d1deb02021-10-05 14:55:32 -07006094If not set, Gerrit generates this as "gerrit@``hostname``", where
Shawn O. Pearce0a351912009-06-01 08:14:46 -07006095`hostname` is the hostname of the system Gerrit is running on.
6096+
6097By default, not set, generating the value at startup.
6098
Edwin Kempin0e02ded2011-09-16 15:10:14 +02006099[[user.anonymousCoward]]user.anonymousCoward::
6100+
David Pursehousea1d633b2014-05-02 17:21:02 +09006101Username that is displayed in the Gerrit Web UI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02006102notifications if the full name of the user is not set.
6103+
Han-Wen Nienhuys3fb723d2017-11-20 19:21:13 +01006104By default "Name of user not set" is used.
Edwin Kempin0e02ded2011-09-16 15:10:14 +02006105
Edwin Kempind33d95a2018-02-16 11:44:04 +01006106[[schedule-configuration]]
6107=== Schedule Configuration
6108
6109Schedule configurations are used for running periodic background jobs.
6110
6111A schedule configuration consists of two parameters:
6112
6113[[schedule-configuration-interval]]
6114* `interval`:
6115Interval for running the periodic background job. The interval must be
6116larger than zero. The following suffixes are supported to define the
6117time unit for the interval:
6118** `s`, `sec`, `second`, `seconds`
6119** `m`, `min`, `minute`, `minutes`
6120** `h`, `hr`, `hour`, `hours`
6121** `d`, `day`, `days`
6122** `w`, `week`, `weeks` (`1 week` is treated as `7 days`)
6123** `mon`, `month`, `months` (`1 month` is treated as `30 days`)
6124** `y`, `year`, `years` (`1 year` is treated as `365 days`)
6125
6126[[schedule-configuration-startTime]]
6127* `startTime`:
6128The start time defines the first execution of the periodic background
6129job. If the configured `interval` is shorter than `startTime - now` the
6130start time will be preponed by the maximum integral multiple of
6131`interval` so that the start time is still in the future. `startTime`
6132must have one of the following formats:
6133
6134** `<day of week> <hours>:<minutes>`
6135** `<hours>:<minutes>`
6136
6137+
6138The placeholders can have the following values:
6139
6140*** `<day of week>`:
6141`Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`
6142*** `<hours>`:
6143`00`-`23`
6144*** `<minutes>`:
6145`00`-`59`
6146
6147+
6148The time zone cannot be specified but is always the system default
David Pursehouse18f388a2019-04-10 09:36:18 +09006149time zone. Hours must be zero-padded, i.e. `06:00` rather than `6:00`.
Edwin Kempind33d95a2018-02-16 11:44:04 +01006150
6151The section (and optionally the subsection) in which the `interval` and
6152`startTime` keys must be set depends on the background job for which a
6153schedule should be configured. E.g. for the change cleanup job the keys
6154must be set in the link:#changeCleanup[changeCleanup] section:
6155
6156----
6157 [changeCleanup]
6158 startTime = Fri 10:30
6159 interval = 2 days
6160----
6161
6162[[schedule-configuration-examples]]
6163Examples for a schedule configuration:
6164
6165* Example 1:
6166+
6167----
6168 startTime = Fri 10:30
6169 interval = 2 days
6170----
6171+
6172Assuming that the server is started on `Mon 07:00` then
6173`startTime - now` is `4 days 3:30 hours`. This is larger than the
6174interval hence the start time is preponed by the maximum integral
6175multiple of the interval so that start time is still in the future,
6176i.e. preponed by 4 days. This yields a start time of `Mon 10:30`, next
6177executions are `Wed 10:30`, `Fri 10:30`. etc.
6178
6179* Example 2:
6180+
6181----
6182 startTime = 06:00
6183 interval = 1 day
6184----
6185+
6186Assuming that the server is started on `Mon 07:00` then this yields the
6187first run on Tuesday at 06:00 and a repetition interval of 1 day.
6188
Dave Borowitzd4fdc932018-11-02 15:06:25 -07006189[[All-Projects-project.config]]
6190== File `etc/All-Projects/project.config`
6191
6192The optional file `'$site_path'/etc/All-Projects/project.config` provides
6193defaults for configuration read from
6194link:config-project-config.html[`project.config`] in the
6195`All-Projects` repo. Unlike `gerrit.config`, this file contains project-type
6196configuration rather than server-type configuration.
6197
6198Most administrators will not need this file, and should instead make commits to
6199`All-Projects` to modify global config. However, a separate file can be useful
6200when managing multiple Gerrit servers, since pushing changes to defaults using
6201Puppet or a similar tool can be easier than scripting git updates to
6202`All-Projects`.
6203
6204The contents of the file are loaded each time the `All-Projects` project is
6205reloaded. Updating the file requires either evicting the project cache or
6206restarting the server.
6207
6208Caveats:
6209
6210* The path from which the file is read corresponds to the name of the repo,
6211 which is link:#gerrit.allProjects[configurable].
6212* Although the file lives in a directory that shares a name with a repository,
6213 this directory is not a Git repository.
6214* Only the file `project.config` is read from this directory to provide
6215 defaults; any other files in this directory, such as `rules.pl`, are ignored.
6216 (This behavior may change in the future.)
6217* Group names listed in the access config in this file are resolved to UUIDs
6218 using the `groups` file in the repository, not in the config directory. As a
6219 result, setting ACLs in this file is not recommended.
6220
Hector Oswaldo Caballero98952b02017-08-24 06:31:28 -04006221[[secure.config]]
6222== File `etc/secure.config`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07006223
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08006224The optional file `'$site_path'/etc/secure.config` overrides (or
6225supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08006226The file should be readable only by the daemon process and can be
6227used to contain private configuration entries that wouldn't normally
6228be exposed to everyone.
6229
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08006230Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08006231----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07006232[auth]
6233 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
6234
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08006235[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08006236 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08006237
6238[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08006239 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08006240
6241[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08006242 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07006243
6244[remote "bar"]
6245 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08006246----
6247
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006248== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01006249
6250The optional file `'$site_path'/etc/peer_keys` controls who can
6251login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
6252command.
6253
David Pursehouse90bed3f2020-06-09 22:07:19 +02006254The format is one Base-64 encoded public key per line with optional comment, e.g.:
6255----
6256# Comments allowed at start of line
6257AAAAC3...51R== john@example.net
6258# Another comment
6259AAAAB5...21S== jane@example.net
6260----
Johan Bjork3e5ee302012-01-27 17:59:54 +01006261
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006262=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08006263
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07006264site_path::
6265+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08006266Local filesystem directory holding the site customization assets.
6267Placing this directory under version control and/or backup is a
6268good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07006269+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08006270Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07006271+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08006272Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07006273+
Dave Borowitz1e49e142013-04-09 12:14:57 -07006274* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08006275
Saša Živkovd34dfe32017-11-20 11:14:35 +01006276[[jgitConfig]]
6277== File `etc/jgit.config`
6278
6279Gerrit uses the `$site_path/etc/jgit.config` file instead of the
6280system-wide and user-global Git configuration for its runtime JGit
6281configuration.
6282
6283Sample `etc/jgit.config` file:
6284----
6285[core]
6286 trustFolderStat = false
6287----
6288
Matthias Sohn85c18792020-09-08 01:42:03 +02006289[[jgit-gc]]
6290=== Section gc
6291
6292Options in section gc are used when command link:cmd-gc.html[gerrit gc] is used
6293or scheduled via options link:cmd-gc.html#gc.startTime[gc.startTime] and
6294link:cmd-gc.html#gc.interval[gc.interval].
6295
6296[[gc.auto]]gc.auto::
6297+
6298When there are approximately more than this many loose objects in the repository,
6299auto gc will pack them. Some commands use this command to perform a light-weight
6300garbage collection from time to time. The default value is 6700.
6301+
6302Setting this to 0 disables not only automatic packing based on the number of
6303loose objects, but any other heuristic auto gc will otherwise use to determine
6304if there’s work to do, such as link:#gc.autoPackLimit[gc.autoPackLimit].
6305
6306[[gc.autodetach]]gc.autodetach::
6307+
6308Makes auto gc run in a background thread. Default is `true`.
6309
6310[[gc.autopacklimit]]gc.autopacklimit::
6311+
6312When there are more than this many packs that are not marked with `*.keep` file
6313in the repository, auto gc consolidates them into one larger pack. The
6314default value is 50. Setting this to 0 disables it. Setting `gc.auto` to 0 will
6315also disable this.
6316
6317[[gc.packRefs]]gc.packRefs::
6318+
6319This variable determines whether gc runs git pack-refs. The default is `true`.
6320
6321[[gc.reflogExpire]]gc.reflogExpire::
6322+
6323Removes reflog entries older than this time; defaults to 90 days. The value "now"
6324expires all entries immediately, and "never" suppresses expiration altogether.
6325
6326[[gc.reflogExpireUnreachable]]gc.reflogExpireUnreachable::
6327+
6328Removes reflog entries older than this time and not reachable from the
6329current tip; defaults to 30 days. The value "now" expires all entries immediately,
6330and "never" suppresses expiration altogether.
6331
Matthias Sohnbf7ca5a2020-09-08 00:57:20 +02006332[[jgit-protocol]]
6333=== Section protocol
6334
6335[[protocol.version]]protocol.version::
6336+
6337If set, the server will accept requests from a client attempting to communicate
David Ostrovskydafac1c2021-01-04 09:26:52 +01006338using the specified protocol version. Default is `2`. If set in file
6339`etc/jgit.config` this option will be used for all repositories of the site.
6340It can be overridden for a given repository by configuring a different value in
6341the repository's `config` file.
Matthias Sohnbf7ca5a2020-09-08 00:57:20 +02006342+
6343Supported versions:
63440:: the original wire protocol.
63451:: the original wire protocol with the addition of a version string in the initial response from the server.
63462:: wire protocol version 2. Speeds up fetches from repositories with many refs by allowing the client
6347 to specify which refs to list before the server lists them.
6348
Matthias Sohn85c18792020-09-08 01:42:03 +02006349[[jgit-receive]]
6350=== Section receive
6351
6352[[receive.autogc]]receive.autogc::
6353+
Matthias Sohn53528f42020-11-23 16:23:50 +01006354By default, up to Gerrit 3.2 `git-receive-pack` will run auto gc after receiving data from git-push and updating refs.
Matthias Sohn85c18792020-09-08 01:42:03 +02006355You can stop it by setting this variable to `false`. This is recommended in gerrit to avoid the
6356additional load this creates. Instead schedule gc using link:cmd-gc.html#gc.startTime[gc.startTime]
6357and link:cmd-gc.html#gc.interval[gc.interval] or e.g. in a cron job that runs gc in a separate process.
Matthias Sohn53528f42020-11-23 16:23:50 +01006358Since Gerrit 3.3 the init command will auto-configure `git-receive-pack = false` in `etc/jgit.config` if
6359it wasn't set manually and show a warning if it was set to `true` manually.
Matthias Sohn85c18792020-09-08 01:42:03 +02006360
Shawn O. Pearce5500e692009-05-28 15:55:01 -07006361GERRIT
6362------
6363Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07006364
6365SEARCHBOX
6366---------