blob: 2a6d8f32519c4f07d20545dfc79932c7f345696e [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+
Paladox nonee3a9dd72017-04-26 12:45:56 +000040The url of accountPatchReviewDb. Supported types are `H2`, `POSTGRESQL`,
41`MARIADB`, and `MYSQL`. Drop the driver jar in the lib folder of the site path
42if the Jdbc driver of the corresponding Database is not yet in the class path.
Hongkai Liu49799b22017-04-07 16:54:25 -040043+
44Default is to create H2 database in the db folder of the site path.
45+
46Changing this parameter requires to migrate database using the
Hugo Arès3e1d4cd2017-04-26 12:02:53 +020047link:pgm-MigrateAccountPatchReviewDb.html[MigrateAccountPatchReviewDb] program.
48Migration cannot be done while the server is running.
Paladox none1a4c01f2017-04-29 18:19:37 +000049+
Dave Borowitzada289c2018-12-18 13:24:14 -080050Also note that the db_name has to be a new db and not reusing an old ReviewDb
51database from a former 2.x site, otherwise gerrit's init will remove the table.
Hongkai Liu49799b22017-04-07 16:54:25 -040052
53----
54[accountPatchReviewDb]
55 url = jdbc:postgresql://<host>:<port>/<db_name>?user=<user>&password=<password>
56----
57
Hector Oswaldo Caballero8dead962017-08-08 05:30:06 -040058[[accountPatchReviewDb.poolLimit]]accountPatchReviewDb.poolLimit::
59+
60Maximum number of open database connections. If the server needs
61more than this number, request processing threads will wait up
62to <<accountPatchReviewDb.poolMaxWait, poolMaxWait>> seconds for a
63connection to be released before they abort with an exception.
64This limit must be several units higher than the total number of
65httpd and sshd threads as some request processing code paths may
66need multiple connections.
67+
68Default is <<sshd.threads, sshd.threads>>
69 + <<httpd.maxThreads, httpd.maxThreads>> + 2.
70+
71
72[[accountPatchReviewDb.poolMinIdle]]database.poolMinIdle::
73+
74Minimum number of connections to keep idle in the pool.
75Default is 4.
76+
77
78[[accountPatchReviewDb.poolMaxIdle]]accountPatchReviewDb.poolMaxIdle::
79+
80Maximum number of connections to keep idle in the pool. If there
81are more idle connections, connections will be closed instead of
82being returned back to the pool.
83Default is min(<<accountPatchReviewDb.poolLimit, accountPatchReviewDb.poolLimit>>, 16).
84+
85
86[[accountPatchReviewDb.poolMaxWait]]accountPatchReviewDb.poolMaxWait::
87+
88Maximum amount of time a request processing thread will wait to
89acquire a database connection from the pool. If no connection is
90released within this time period, the processing thread will abort
91its current operations and return an error to the client.
92Values should use common unit suffixes to express their setting:
93+
94* ms, milliseconds
95* s, sec, second, seconds
96* m, min, minute, minutes
97* h, hr, hour, hours
98
99+
Hector Oswaldo Caballero8dead962017-08-08 05:30:06 -0400100If a unit suffix is not specified, `milliseconds` is assumed.
Hector Oswaldo Caballero8dead962017-08-08 05:30:06 -0400101Default is `30 seconds`.
102
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800103[[accounts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800104=== Section accounts
Dave Borowitz45baa892012-02-23 16:43:05 -0800105
Matthias Sohnf3360662012-04-05 15:42:52 +0200106[[accounts.visibility]]accounts.visibility::
Dave Borowitz45baa892012-02-23 16:43:05 -0800107+
108Controls visibility of other users' dashboard pages and
109completion suggestions to web users.
110+
111If `ALL`, all users are visible to all other users, even
112anonymous users.
113+
114If `SAME_GROUP`, only users who are also members of a group the
115current user is a member of are visible.
116+
117If `VISIBLE_GROUP`, only users who are members of at least one group
118that is visible to the current user are visible.
119+
120If `NONE`, no users other than the current user are visible.
121+
122Default is `ALL`.
123
Ben Rohlfs99f16a12020-02-11 19:44:17 +0100124[[accounts.defaultDisplayName]]accounts.defaultDisplayName::
125+
126If a user account does not have a display name set, which is the normal
127case, then this configuration value chooses the strategy how to choose
128the display name. Note that this strategy is not applied by the backend.
129If the AccountInfo has the display name unset, then the client has to
130apply this strategy.
131+
132If `FULL_NAME`, then the (full) name of the user is chosen from
133link:rest-api-accounts.html#account-info[AccountInfo].
134+
135If `FIRST_NAME`, then the first word (i.e. everything until first
136whitespace character) of the (full) name of the user is chosen from
137link:rest-api-accounts.html#account-info[AccountInfo].
138+
139If `USERNAME`, then the username of the user is chosen from
140link:rest-api-accounts.html#account-info[AccountInfo]. If that is not
141set, then the (full) name will be used.
142+
143Default is `FULL_NAME`.
144
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800145[[addreviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800146=== Section addreviewer
Edwin Kempin49cb3e12011-06-29 14:35:14 +0200147
148[[addreviewer.maxWithoutConfirmation]]addreviewer.maxWithoutConfirmation::
149+
150The maximum number of reviewers a user can add at once by adding a
151group as reviewer without being asked to confirm the operation.
152+
153If set to 0, the user will never be asked to confirm adding a group
154as reviewer.
155+
156Default is 10.
Edwin Kempin5e65d9b2011-07-08 07:35:48 +0200157+
David Pursehousea1d633b2014-05-02 17:21:02 +0900158This setting only applies for adding reviewers in the Gerrit Web UI,
Edwin Kempin5e65d9b2011-07-08 07:35:48 +0200159but is ignored when adding reviewers with the
Edwin Kempin33e92d02011-07-11 22:00:57 +0200160link:cmd-set-reviewers.html[set-reviewers] command.
Gustaf Lundh25e608f2018-04-16 10:54:53 +0200161+
Sven Selberg2a0beab2018-04-20 14:49:20 +0200162This value supports link:#reloadConfig[configuration reloads].
Edwin Kempin49cb3e12011-06-29 14:35:14 +0200163
164[[addreviewer.maxAllowed]]addreviewer.maxAllowed::
165+
166The maximum number of reviewers a user can add at once by adding a
167group as reviewer.
168+
169If set to 0, there is no limit for the number of reviewers that can
170be added at once by adding a group as reviewer.
171+
172Default is 20.
Gustaf Lundh25e608f2018-04-16 10:54:53 +0200173+
Sven Selberg2a0beab2018-04-20 14:49:20 +0200174This value supports link:#reloadConfig[configuration reloads].
Edwin Kempin49cb3e12011-06-29 14:35:14 +0200175
Patrick Hiesel87880b02016-05-03 18:15:08 +0200176[[addReviewer.baseWeight]]addReviewer.baseWeight::
177+
178The weight that will be applied in the default reviewer ranking algorithm.
179This can be increased or decreased to give more or less influence to plugins.
180If set to zero, the base ranking will not have any effect. Reviewers will then
181be ordered as ranked by the plugins (if there are any).
182+
183By default 1.
184
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800185[[auth]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800186=== Section auth
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700187
188See also link:config-sso.html[SSO configuration].
189
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700190[[auth.type]]auth.type::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700191+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700192Type of user authentication employed by Gerrit. The supported
193values are:
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700194+
195* `OpenID`
196+
197The default setting. Gerrit uses any valid OpenID
198provider chosen by the end-user. For more information see
Marian Harbach34253372019-12-10 18:01:31 +0100199http://openid.net/[openid.net,role=external,window=_blank].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700200+
James E. Blairca8bc3b2011-12-21 18:12:26 +0000201* `OpenID_SSO`
202+
203Supports OpenID from a single provider. There is no registration
204link, and the "Sign In" link sends the user directly to the provider's
205SSO entry point.
206+
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700207* `HTTP`
208+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700209Gerrit relies upon data presented in the HTTP request. This includes
Edwin Kempinf1acbb82011-09-15 12:49:42 +0200210HTTP basic authentication, or some types of commercial single-sign-on
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700211solutions. With this setting enabled the authentication must
212take place in the web server or servlet container, and not from
213within Gerrit.
214+
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700215* `HTTP_LDAP`
216+
217Exactly like `HTTP` (above), but additionally Gerrit pre-populates
218a user's full name and email address based on information obtained
219from the user's account object in LDAP. The user's group membership
220is also pulled from LDAP, making any LDAP groups that a user is a
David Pursehouseef92bec2017-08-25 18:45:02 +0900221member of available as groups in Gerrit. Hence the `_LDAP` suffix in
222the name of this authentication type. Gerrit does NOT authenticate
223the user via LDAP.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700224+
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200225* `CLIENT_SSL_CERT_LDAP`
226+
227This authentication type is actually kind of SSO. Gerrit will configure
David Pursehouse221d4f62012-06-08 17:38:08 +0900228Jetty's SSL channel to request the client's SSL certificate. For this
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200229authentication to work a Gerrit administrator has to import the root
230certificate of the trust chain used to issue the client's certificate
231into the <review-site>/etc/keystore.
232After the authentication is done Gerrit will obtain basic user
233registration (name and email) from LDAP, and some group memberships.
David Pursehouseef92bec2017-08-25 18:45:02 +0900234Hence the `_LDAP` suffix in the name of this authentication type.
235Gerrit does NOT authenticate the user via LDAP.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200236This authentication type can only be used under hosted daemon mode, and
237the httpd.listenUrl must use https:// as the protocol.
Chulho Yangb72ff8f2013-07-04 02:35:53 -0400238Optionally, certificate revocation list file can be used
239at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200240+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700241* `LDAP`
242+
243Gerrit prompts the user to enter a username and a password, which
244it then verifies by performing a simple bind against the configured
245<<ldap.server,ldap.server>>. In this configuration the web server
246is not involved in the user authentication process.
247+
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800248The actual username used in the LDAP simple bind request is the
249account's full DN, which is discovered by first querying the
250directory using either an anonymous request, or the configured
Robin Rosenberga3baed02012-10-14 14:09:32 +0200251<<ldap.username,ldap.username>> identity. Gerrit can also use kerberos if
252<<ldap.authentication,ldap.authentication>> is set to `GSSAPI`.
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100253+
254If link:#auth.gitBasicAuthPolicy[`auth.gitBasicAuthPolicy`] is set to `HTTP`,
255the randomly generated HTTP password is used for authentication. On the other hand,
256if link:#auth.gitBasicAuthPolicy[`auth.gitBasicAuthPolicy`] is set to `HTTP_LDAP`,
257the password in the request is first checked against the HTTP password and, if
258it does not match, it is then validated against the LDAP password.
259Service users that only exist in the Gerrit database are authenticated by their
260HTTP passwords.
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800261
262* `LDAP_BIND`
263+
264Gerrit prompts the user to enter a username and a password, which
265it then verifies by performing a simple bind against the configured
266<<ldap.server,ldap.server>>. In this configuration the web server
267is not involved in the user authentication process.
268+
David Pursehouse42f42042013-08-01 14:02:25 +0900269Unlike `LDAP` above, the username used to perform the LDAP simple bind
David Pursehouse1344f5b2013-08-09 17:35:47 +0900270request is the exact string supplied in the dialog by the user.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200271The configured <<ldap.username,ldap.username>> identity is not used to obtain
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800272account information.
273+
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200274* `OAUTH`
David Ostrovskye9707d82015-02-22 01:14:02 +0100275+
276OAuth is a protocol that lets external apps request authorization to private
277details in a user's account without getting their password. This is
278preferred over Basic Authentication because tokens can be limited to specific
279types of data, and can be revoked by users at any time.
280+
281Site owners have to register their application before getting started. Note
282that provider specific plugins must be used with this authentication scheme.
283+
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100284Git clients may send OAuth 2 access tokens instead of passwords in the Basic
285authentication header. Note that provider specific plugins must be installed to
286facilitate this authentication scheme. If multiple OAuth 2 provider plugins are
287installed one of them must be selected as default with the
288`auth.gitOAuthProvider` option.
289+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700290* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
291+
292*DO NOT USE*. Only for use in a development environment.
293+
294When this is the configured authentication method a hyperlink titled
295`Become` appears in the top right corner of the page, taking the
296user to a form where they can enter the username of any existing
297user account, and immediately login as that account, without any
David Ostrovsky7163dac2017-07-29 06:49:38 +0200298authentication taking place.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700299
300+
301By default, OpenID.
302
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700303[[auth.allowedOpenID]]auth.allowedOpenID::
304+
305List of permitted OpenID providers. A user may only authenticate
306with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse42f42042013-08-01 14:02:25 +0900307is set to `OpenID` (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700308+
Magnus Bäcke5611832011-02-02 08:57:15 +0100309Patterns may be either a
310link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +0100311Java regular expression (java.util.regex),role=external,window=_blank] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700312end with `$`) or be a simple prefix (any other string).
313+
314By default, the list contains two values, `http://` and `https://`,
315allowing users to authenticate with any OpenID provider.
316
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700317[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700318+
David Pursehouse221d4f62012-06-08 17:38:08 +0900319List of trusted OpenID providers. Only used if `auth.type` is
David Pursehouse42f42042013-08-01 14:02:25 +0900320set to `OpenID` (the default).
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700321+
322In order for a user to take advantage of permissions beyond those
323granted to the `Anonymous Users` and `Registered Users` groups,
324the user account must only have OpenIDs which match at least one
325pattern from this list.
326+
Magnus Bäcke5611832011-02-02 08:57:15 +0100327Patterns may be either a
328link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +0100329Java regular expression (java.util.regex),role=external,window=_blank] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700330end with `$`) or be a simple prefix (any other string).
331+
332By default, the list contains two values, `http://` and `https://`,
333allowing Gerrit to trust any OpenID it receives.
334
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100335[[auth.openIdDomain]]auth.openIdDomain::
336+
337List of allowed OpenID email address domains. Only used if
David Pursehouse42f42042013-08-01 14:02:25 +0900338`auth.type` is set to `OPENID` or `OPENID_SSO`.
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100339+
340Domain is case insensitive and must be in the same form as it
341appears in the email address, for example, "example.com".
342+
343By default, any domain is accepted.
344
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700345[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
346+
347Time in seconds before an OpenID provider must force the user
348to authenticate themselves again before authentication to this
349Gerrit server. Currently this is only a polite request, and users
350coming from providers that don't support the PAPE extension will
351be accepted anyway. In the future it may be enforced, rejecting
352users coming from providers that don't honor the max session age.
353+
354If set to 0, the provider will always force the user to authenticate
355(e.g. supply their password). Values should use common unit suffixes
356to express their setting:
357+
358* s, sec, second, seconds
359* m, min, minute, minutes
360* h, hr, hour, hours
361* d, day, days
362* w, week, weeks (`1 week` is treated as `7 days`)
363* mon, month, months (`1 month` is treated as `30 days`)
364* y, year, years (`1 year` is treated as `365 days`)
365
366+
367Default is -1, permitting infinite time between authentications.
368
David Pursehouse5be35a32015-09-09 17:35:32 +0900369[[auth.registerEmailPrivateKey]]auth.registerEmailPrivateKey::
370+
371Private key to use when generating an email verification token.
372+
373If not set, a random key is generated when running the
374link:pgm-init.html[site initialization].
375
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700376[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
377+
378Time in seconds before an email verification token sent to a user in
379order to validate their email address expires.
380+
381* s, sec, second, seconds
382* m, min, minute, minutes
383* h, hr, hour, hours
384* d, day, days
385* w, week, weeks (`1 week` is treated as `7 days`)
386* mon, month, months (`1 month` is treated as `30 days`)
387* y, year, years (`1 year` is treated as `365 days`)
388
389+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800390Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700391
James E. Blairca8bc3b2011-12-21 18:12:26 +0000392[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
393+
David Pursehouse42f42042013-08-01 14:02:25 +0900394The SSO entry point URL. Only used if `auth.type` is set to
395`OpenID_SSO`.
James E. Blairca8bc3b2011-12-21 18:12:26 +0000396+
397The "Sign In" link will send users directly to this URL.
398
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700399[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700400+
401HTTP header to trust the username from, or unset to select HTTP basic
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100402authentication. Only used if `auth.type` is set to `HTTP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700403
Luca Milanesio384ed6c2013-07-30 09:10:07 +0100404[[auth.httpDisplaynameHeader]]auth.httpDisplaynameHeader::
405+
406HTTP header to retrieve the user's display name from. Only used if `auth.type`
407is set to `HTTP`.
408+
409If set, Gerrit trusts and enforces the user's full name using the HTTP header
410and disables the ability to manually modify the user's full name
411from the contact information page.
412
413[[auth.httpEmailHeader]]auth.httpEmailHeader::
414+
415HTTP header to retrieve the user's e-mail from. Only used if `auth.type`
416is set to `HTTP`.
417+
418If set, Gerrit trusts and enforces the user's e-mail using the HTTP header
419and disables the ability to manually modify or register other e-mails
420from the contact information page.
421
Luca Milanesio97d07352014-07-17 08:31:06 +0100422[[auth.httpExternalIdHeader]]auth.httpExternalIdHeader::
423+
424HTTP header to retrieve the user's external identification token.
425Only used if `auth.type` is set to `HTTP`.
426+
427If set, Gerrit adds the value contained in the HTTP header to the
428user's identity. Typical use is with a federated identity token from
429an external system (e.g. GitHub OAuth 2.0 authentication) where
430the user's auth token exchanged during authentication handshake
431needs to be used for authenticated communication to the external
432system later on.
433+
434Example: `auth.httpExternalIdHeader: X-GitHub-OTP`
435
Luca Milanesio5185b042013-07-27 22:03:06 +0100436[[auth.loginUrl]]auth.loginUrl::
437+
438URL to redirect a browser to after the end-user has clicked on the
David Pursehouse42f42042013-08-01 14:02:25 +0900439login link in the upper right corner. Only used if `auth.type` is set
440to `HTTP` or `HTTP_LDAP`.
Luca Milanesio5185b042013-07-27 22:03:06 +0100441Organizations using an enterprise single-sign-on solution may want to
442redirect the browser to the SSO product's sign-in page for completing the
443login process and validate their credentials.
444+
David Pursehouse42f42042013-08-01 14:02:25 +0900445If set, Gerrit allows anonymous access until the end-user performs the login
446and provides a trusted identity through the HTTP header.
Luca Milanesio5185b042013-07-27 22:03:06 +0100447If not set, Gerrit requires the HTTP header with a trusted identity
David Pursehouse42f42042013-08-01 14:02:25 +0900448and returns the error page 'LoginRedirect.html' if such a header is not
449present.
Luca Milanesio5185b042013-07-27 22:03:06 +0100450
451[[auth.loginText]]auth.loginText::
452+
David Pursehouse42f42042013-08-01 14:02:25 +0900453Text displayed in the loginUrl link. Only used if `auth.loginUrl` is set.
Luca Milanesio5185b042013-07-27 22:03:06 +0100454+
David Pursehouse42f42042013-08-01 14:02:25 +0900455If not set, the "Sign In" text is used.
Luca Milanesio5185b042013-07-27 22:03:06 +0100456
Luca Milanesio111e0b72013-08-15 18:56:42 +0100457[[auth.registerPageUrl]]auth.registerPageUrl::
458+
David Pursehouse268744b2013-08-17 15:32:11 +0900459URL of the registration page to use when a new user logs in to Gerrit for
460the first time. Used only when `auth.type` is set to `HTTP`.
Luca Milanesio111e0b72013-08-15 18:56:42 +0100461+
462If not set, the standard Gerrit registration page `/#/register/` is displayed.
463
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700464[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700465+
466URL to redirect a browser to after the end-user has clicked on the
467"Sign Out" link in the upper right corner. Organizations using an
468enterprise single-sign-on solution may want to redirect the browser
469to the SSO product's sign-out page.
470+
471If not set, the redirect returns to the list of all open changes.
472
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800473[[auth.registerUrl]]auth.registerUrl::
474+
475Target for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200476when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800477+
478If not set, no "Register" link is displayed.
479
Chad Horohoe65897082012-11-10 10:26:25 -0800480[[auth.registerText]]auth.registerText::
481+
482Text for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200483when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Chad Horohoe65897082012-11-10 10:26:25 -0800484+
485If not set, defaults to "Register".
486
David Pursehouse3d604492013-01-25 17:41:53 +0900487[[auth.editFullNameUrl]]auth.editFullNameUrl::
488+
489Target for the "Edit" button when the user is allowed to edit their
Edwin Kempin54093152015-05-08 10:50:35 +0200490full name. Used only when `auth.type` is `LDAP`, `LDAP_BIND` or
491`CUSTOM_EXTENSION`.
David Pursehouse3d604492013-01-25 17:41:53 +0900492
493[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
494+
David Pursehouse42f42042013-08-01 14:02:25 +0900495Target for the "Obtain Password" link. Used only when `auth.type` is
Edwin Kempin54093152015-05-08 10:50:35 +0200496`CUSTOM_EXTENSION`.
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700497
498[[auth.switchAccountUrl]]auth.switchAccountUrl::
David Pursehouse3d604492013-01-25 17:41:53 +0900499+
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700500URL to switch user identities and login as a different account than
501the currently active account. This is disabled by default except when
502`auth.type` is `OPENID` and `DEVELOPMENT_BECOME_ANY_ACCOUNT`. If set
503the "Switch Account" link is displayed next to "Sign Out".
504+
505When `auth.type` does not normally enable this URL administrators may
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700506set this to `login/`, allowing users to begin a new web session. This value
David Ostrovsky7163dac2017-07-29 06:49:38 +0200507is used as an href in PolyGerrit, so absolute URLs like
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700508`https://someotherhost/login` work as well.
509+
510If a ${path} parameter is included, then PolyGerrit will substitute the
511currently viewed path in the link. Be aware that this path will include
512a leading slash, so a value like this might be appropriate: `/login${path}`.
David Pursehouse3d604492013-01-25 17:41:53 +0900513
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000514[[auth.cookiePath]]auth.cookiePath::
515+
516Sets "path" attribute of the authentication cookie.
517+
518If not set, HTTP request's path is used.
519
Sammy Gillespie26873c02016-02-11 14:39:43 +0000520[[auth.cookieDomain]]auth.cookieDomain::
521+
522Sets "domain" attribute of the authentication cookie.
523+
524If not set, HTTP request's domain is used.
525
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000526[[auth.cookieSecure]]auth.cookieSecure::
527+
528Sets "secure" flag of the authentication cookie. If true, cookies
529will be transmitted only over HTTPS protocol.
530+
531By default, false.
532
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700533[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700534+
535Optional format string to construct user email addresses out of
David Pursehouse42f42042013-08-01 14:02:25 +0900536user login names. Only used if `auth.type` is `HTTP`, `HTTP_LDAP`
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700537or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700538+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700539This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700540with the login name. E.g. "\{0\}+gerrit@example.com" with a user
541login name of "foo" will produce "foo+gerrit@example.com" during
542the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700543+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700544If the site is using `HTTP_LDAP` or `LDAP`, using this option is
545discouraged. Setting `ldap.accountEmailAddress` and importing the
546email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700547
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700548[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700549+
550Controls whether or not the contributor agreement features are
551enabled for the Gerrit site. If enabled a user must complete a
552contributor agreement before they can upload changes.
553+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800554If enabled, the admin must also add one or more
555link:config-cla.html[contributor-agreement sections]
556in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700557`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700558more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700559+
560By default this is false (no agreements are used).
Fredrik Luthandera3cf3542012-07-04 16:55:35 -0700561+
562To enable the actual usage of contributor agreement the project
563specific config option in the `project.config` must be set:
564link:config-project-config.html[receive.requireContributorAgreement].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700565
Christian Halstricka3d88a52011-08-31 09:21:41 +0200566[[auth.trustContainerAuth]]auth.trustContainerAuth::
567+
568If true then it is the responsibility of the container hosting
569Gerrit to authenticate users. In this case Gerrit will blindly trust
570the container.
571+
572This parameter only affects git over http traffic. If set to false
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100573then Gerrit will do the authentication (using Basic authentication).
Christian Halstricka3d88a52011-08-31 09:21:41 +0200574+
575By default this is set to false.
576
Luca Milanesio42058842012-01-05 21:25:38 +0000577
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400578[[auth.gitBasicAuthPolicy]]auth.gitBasicAuthPolicy::
579+
David Pursehousef7a1c2a2017-08-25 19:12:54 +0900580When `auth.type` is `LDAP`, `LDAP_BIND` or `OAUTH`, it allows using either the generated
Luca Milanesio51edcb72017-03-06 11:59:55 +0000581HTTP password, the LDAP or OAUTH password, or a combination of HTTP and LDAP
582authentication, to authenticate Git over HTTP and REST API requests.
583The supported values are:
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400584+
585*`HTTP`
586+
David Pursehousee2920032017-08-25 19:12:21 +0900587Only the HTTP password is accepted when doing Git over HTTP and REST API requests.
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400588+
589*`LDAP`
590+
591Only the `LDAP` password is allowed when doing Git over HTTP and REST API
592requests.
593+
Luca Milanesio51edcb72017-03-06 11:59:55 +0000594*`OAUTH`
595+
David Pursehousee2920032017-08-25 19:12:21 +0900596Only the `OAUTH` authentication is allowed when doing Git over HTTP and REST API
Luca Milanesio51edcb72017-03-06 11:59:55 +0000597requests.
598+
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400599*`HTTP_LDAP`
600+
601The password in the request is first checked against the HTTP password and, if
602it does not match, it is then validated against the `LDAP` password.
603+
Luca Milanesio51edcb72017-03-06 11:59:55 +0000604By default this is set to `LDAP` when link:#auth.type[`auth.type`] is `LDAP`
605and `OAUTH` when link:#auth.type[`auth.type`] is `OAUTH`.
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400606Otherwise, the default value is `HTTP`.
607
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200608[[auth.gitOAuthProvider]]auth.gitOAuthProvider::
609+
610Selects the OAuth 2 provider to authenticate git over HTTP traffic with.
611+
612In general there is no way to determine from an access token alone, which
613OAuth 2 provider to address to verify that token, and the BasicAuth
614scheme does not support amending such details. If multiple OAuth provider
615plugins in a system offer support for git over HTTP authentication site
616administrators must configure, which one to use as default provider.
617In case the provider cannot be determined from a request the access token
618will be sent to the default provider for verification.
619+
620The value of this parameter must be the identifier of an OAuth 2 provider
621in the form `plugin-name:provider-name`. Consult the respective plugin
622documentation for details.
623
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200624[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
625+
626If set the username that is received to authenticate a git operation
627is converted to lower case for looking up the user account in Gerrit.
628+
629By setting this parameter a case insensitive authentication for the
630git operations can be achieved, if it is ensured that the usernames in
631Gerrit (scheme `username`) are stored in lower case (e.g. if the
632parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
633set to `${sAMAccountName.toLowerCase}`). It is important that for all
634existing accounts this username is already in lower case. It is not
635possible to convert the usernames of the existing accounts to lower
636case because this would break the access to existing per-user
Edwin Kempine7ae45c2018-09-20 09:57:15 +0200637branches and Gerrit provides no tool to do such a conversion.
638+
639Setting this parameter to `true` will prevent all users from login that
640have a non-lower-case username.
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200641+
642This parameter only affects git over http and git over SSH traffic.
643+
644By default this is set to false.
645
Shawn Pearcea931fe12013-06-11 12:29:17 -0700646[[auth.enableRunAs]]auth.enableRunAs::
647+
648If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
649header from any users granted the link:access-control.html#capability_runAs[Run As]
650capability. The header and capability permit the authenticated user
651to impersonate another account.
652+
653If false the feature is disabled and cannot be re-enabled without
654editing gerrit.config and restarting the server.
655+
656Default is true.
657
David Pursehouse21bd07b2015-11-27 00:15:42 +0900658[[auth.allowRegisterNewEmail]]auth.allowRegisterNewEmail::
659+
660Whether users are allowed to register new email addresses.
661+
662In addition for the HTTP authentication type
663link:#auth.httpemailheader[auth.httpemailheader] must *not* be set to
664enable registration of new email addresses.
665+
666By default, true.
667
Owen Lic24f7242017-06-14 10:04:00 -0400668[[auth.autoUpdateAccountActiveStatus]]auth.autoUpdateAccountActiveStatus::
669+
670Whether to allow automatic synchronization of an account's inactive flag upon login.
671If set to true, upon login, if the authentication back-end reports the account as active,
672the account's inactive flag in the internal Gerrit database will be updated to be active.
673If the authentication back-end reports the account as inactive, the account's flag will be
674updated to be inactive and the login attempt will be blocked. Users enabling this feature
675should ensure that their authentication back-end is supported. Currently, only
676strict 'LDAP' authentication is supported.
677+
Owen Lie2877bb2017-07-14 09:11:20 -0400678In addition, if this parameter is not set, or false, the corresponding scheduled
679task to deactivate inactive Gerrit accounts will also be disabled. If this
680parameter is set to true, users should also consider configuring the
681link:#accountDeactivation[accountDeactivation] section appropriately.
682+
Owen Lic24f7242017-06-14 10:04:00 -0400683By default, false.
684
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200685[[auth.skipFullRefEvaluationIfAllRefsAreVisible]]auth.skipFullRefEvaluationIfAllRefsAreVisible::
686+
Edwin Kempin3e856b22020-11-04 14:45:21 +0100687Whether to skip the full ref visibility checks as a performance shortcut when a
688user has READ permission for all refs.
689+
690The full ref filtering would filter out refs for pending edits, private changes
691and auto merge commits.
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200692+
693By default, true.
694
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800695[[cache]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800696=== Section cache
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700697
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700698[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700699+
700Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700701future lookup. This local disk cache is used to retain potentially
702expensive to compute information across restarts. If the location
703does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700704+
David Pursehousea61ee502016-09-06 16:27:09 +0900705Technically, cached entities are persisted as a set of H2 databases
Saša Živkove607d6c2016-02-24 10:46:46 +0000706inside this directory.
707+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700708If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700709+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700710Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700711
Thomas Draebinge5dcc602020-04-20 15:40:54 +0200712[[cache.enableDiskStatMetrics]]cache.enableDiskStatMetrics::
713+
714Whether to enable the computation of disk statistics of persistent caches.
715This computation is expensive and requires a long time on larger installations.
716+
717By default, false.
718
Saša Živkovf3134572016-02-09 11:42:46 +0100719[[cache.h2CacheSize]]cache.h2CacheSize::
720+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200721The size of the in-memory cache for each opened H2 cache database, in bytes.
Saša Živkove607d6c2016-02-24 10:46:46 +0000722+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200723Some caches of Gerrit are persistent and are backed by an H2 database.
Saša Živkove607d6c2016-02-24 10:46:46 +0000724H2 uses memory to cache its database content. The parameter `h2CacheSize`
725allows to limit the memory used by H2 and thus prevent out-of-memory
Saša Živkovf3134572016-02-09 11:42:46 +0100726caused by the H2 database using too much memory.
727+
Dave Borowitz3d1f85c2018-11-16 15:36:04 -0800728Technically the H2 cache size is configured using the CACHE_SIZE parameter in
729the H2 JDBC connection URL, as described
Marian Harbach34253372019-12-10 18:01:31 +0100730link:http://www.h2database.com/html/features.html#cache_settings[here,role=external,window=_blank]
Saša Živkovf3134572016-02-09 11:42:46 +0100731+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200732Default is unset, using up to half of the available memory.
David Pursehousee6976dc2017-06-30 16:33:44 +0900733+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200734H2 will persist this value in the database, so to unset explicitly specify 0.
Saša Živkovf3134572016-02-09 11:42:46 +0100735+
736Common unit suffixes of 'k', 'm', or 'g' are supported.
737
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200738[[cache.h2AutoServer]]cache.h2AutoServer::
739+
740If set to true, enable H2 autoserver mode for the H2-backed persistent cache
741databases.
742+
Marian Harbach34253372019-12-10 18:01:31 +0100743See link:http://www.h2database.com/html/features.html#auto_mixed_mode[here,role=external,window=_blank]
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200744for detail.
745+
746Default is false.
747
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700748[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700749+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700750Maximum age to keep an entry in the cache. Entries are removed from
751the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700752Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700753+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700754* s, sec, second, seconds
755* m, min, minute, minutes
756* h, hr, hour, hours
757* d, day, days
758* w, week, weeks (`1 week` is treated as `7 days`)
759* mon, month, months (`1 month` is treated as `30 days`)
760* y, year, years (`1 year` is treated as `365 days`)
761
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700762+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200763--
Edwin Kempinabcd5042013-03-12 16:04:37 +0100764If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700765supplied, the maximum age is infinite and items are never purged
766except when the cache is full.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200767
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700768Default is `0`, meaning store forever with no expire, except:
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200769
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400770* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700771* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700772* `"web_sessions"`: default is `12 hours`
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200773--
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700774
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700775[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700776+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700777The total cost of entries to retain in memory. The cost computation
778varies by the cache. For most caches where the in-memory size of each
779entry is relatively the same, memoryLimit is currently defined to be
780the number of entries held by the cache (each entry costs 1).
781+
782For caches where the size of an entry can vary significantly between
783individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
784is an approximation of the total number of bytes stored by the cache.
785Larger entries that represent bigger patch sets or longer source files
786will consume a bigger portion of the memoryLimit. For these caches the
787memoryLimit should be set to roughly the amount of RAM (in bytes) the
788administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700789+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700790Default is 1024 for most caches, except:
791+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400792* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700793* `"diff"`: default is `10m` (10 MiB of memory)
794* `"diff_intraline"`: default is `10m` (10 MiB of memory)
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200795* `"diff_summary"`: default is `10m` (10 MiB of memory)
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400796* `"external_ids_map"`: default is `2` and should not be changed
Edwin Kempind967ec42017-11-13 15:14:41 +0100797* `"groups"`: default is unlimited
798* `"groups_byname"`: default is unlimited
799* `"groups_byuuid"`: default is unlimited
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700800* `"plugin_resources"`: default is 2m (2 MiB of memory)
801
802+
803If set to 0 the cache is disabled. Entries are removed immediately
804after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700805
Dave Borowitz08bac5ca2018-06-05 14:58:28 -0400806[[cache.name.expireFromMemoryAfterAccess]]cache.<name>.expireFromMemoryAfterAccess::
807+
808Time after last access to automatically expire entries from an in-memory
809cache. If 0 or not specified, entries are never expired in this manner.
810Values may use unit suffixes as in link:#cache.name.maxAge[maxAge].
811+
812This option only applies to in-memory caches; persistent cache values are
813not expired in this manner, and are only pruned via
814link:#cache.name.diskLimit[diskLimit].
815
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700816[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700817+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700818Total size in bytes of the keys and values stored on disk. Caches that
819have grown bigger than this size are scanned daily at 1 AM local
820server time to trim the cache. Entries are removed in least recently
821accessed order until the cache fits within this limit. Caches may
822grow larger than this during the day, as the size check is only
823performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700824+
Saša Živkove789f2e2016-09-22 10:37:34 +0200825Default is 128 MiB per cache, except:
826+
Dave Borowitzbab45862018-05-01 12:31:48 -0400827* `"change_notes"`: disk storage is disabled by default
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200828* `"diff_summary"`: default is `1g` (1 GiB of disk space)
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700829* `"external_ids_map"`: disk storage is disabled by default
Patrick Hieselc2c108c2020-07-23 09:54:22 +0200830* `"persisted_projects"`: default is `1g` (1 GiB of disk space)
Saša Živkove789f2e2016-09-22 10:37:34 +0200831
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700832+
Dave Borowitzdab51552018-05-14 16:35:37 -0700833If 0 or negative, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700834
Patrick Hieseld70f37f2020-04-16 14:12:31 +0200835[[cache.name.expireAfterWrite]]cache.<name>.expireAfterWrite::
836+
837Duration after which a cached value will be evicted and not
838read anymore.
839+
840Values should use common unit suffixes to express their setting:
841+
842* ms, milliseconds
843* s, sec, second, seconds
844* m, min, minute, minutes
845* h, hr, hour, hours
846+
847Disabled by default.
848
849[[cache.name.refreshAfterWrite]]cache.<name>.refreshAfterWrite::
850+
851Duration after which we asynchronously refresh the cached value.
852+
853Values should use common unit suffixes to express their setting:
854+
855* ms, milliseconds
856* s, sec, second, seconds
857* m, min, minute, minutes
858* h, hr, hour, hours
859+
860This applies only to these caches that support refreshing:
861+
862* `"projects"`: Caching project information in-memory. Defaults to 15 minutes.
863
864[[cache.refreshThreadPoolSize]]cache.refreshThreadPoolSize::
865+
866Number of threads that are available to refresh cached values that became
867out of date. This applies only to these caches that support refreshing:
868+
869* `"projects"`: Caching project information in-memory
870+
871Refreshes will only be scheduled on this executor if the values are
872out of sync.
873The check if they are is cheap and always happens on the thread that
874inquires for a cached value.
875+
876Defaults to 2.
877
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800878==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700879
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700880cache `"accounts"`::
881+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700882Cache entries contain important details of an active user, including
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +0200883their display name, preferences, and known email addresses. Entry
Dave Borowitzada289c2018-12-18 13:24:14 -0800884information is obtained from NoteDb data in the `All-Users` repo.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700885
886+
Dave Borowitzada289c2018-12-18 13:24:14 -0800887If direct updates are made to `All-Users`, this cache should be flushed.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700888
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400889cache `"adv_bases"`::
890+
891Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900892are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400893for the client to use as potential delta bases. Push over smart HTTP
894requires two HTTP requests, and this cache tries to carry state from
895the first request into the second to ensure it can complete.
896
Patrick Hiesel7575e882020-04-06 14:09:32 +0200897cache `"default_preferences"`::
898+
899Caches the server's default general, edit and diff preferences.
900+
901Default value is 1 to hold only the most current version in-memory.
902
Patrick Hieselace3dc92019-01-15 14:08:13 +0000903cache `"changes"`::
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200904+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200905The size of `memoryLimit` determines the number of projects for which
906all changes will be cached. If the cache is set to 1024, this means all
Patrick Hieselace3dc92019-01-15 14:08:13 +0000907changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800908+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000909Default value is 0 (disabled). It is disabled by default due to the fact
910that change updates are not communicated between Gerrit servers. Hence
Matthias Sohnd8182ba2019-12-09 14:50:23 +0100911this cache should be disabled in a cluster setup using multiple primary
912or multiple replica nodes.
Gustaf Lundh53493772012-11-18 18:41:15 -0800913+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000914The cache should be flushed whenever the database changes table is modified
915outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200916
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700917cache `"diff"`::
918+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700919Each item caches the differences between two commits, at both the
920directory and file levels. Gerrit uses this cache to accelerate
921the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700922+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700923Entries in this cache are relatively large, so memoryLimit is an
924estimate in bytes of memory used. Administrators should try to target
925cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
926day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700927
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400928cache `"diff_intraline"`::
929+
930Each item caches the intraline difference of one file, when compared
931between two commits. Gerrit uses this cache to accelerate display of
932intraline differences when viewing a file.
933+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700934Entries in this cache are relatively large, so memoryLimit is an
935estimate in bytes of memory used. Administrators should try to target
936cache.diff.memoryLimit to fit all files users will view in a 1 or 2
937day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400938
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200939cache `"diff_summary"`::
Saša Živkove789f2e2016-09-22 10:37:34 +0200940+
941Each item caches list of file paths which are different between two
942commits. Gerrit uses this cache to accelerate computing of the list
943of paths of changed files.
944+
945Ideally, disk limit of this cache is large enough to cover all changes.
946This should significantly speed up change reindexing, especially
947full offline reindexing.
948
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400949cache `"external_ids_map"`::
950+
951A singleton cache whose sole entry is a map of the parsed representation
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400952of link:config-accounts.html#external-ids[all current external IDs]. The
953cache may temporarily contain 2 entries, but the second one is promptly
954expired.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400955+
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700956It is not recommended to change the in-memory attributes of this cache
957away from the defaults. The cache may be persisted by setting
958`diskLimit`, which is only recommended if cold start performance is
959problematic.
Patrick Hiesel42b47b12019-07-22 09:32:37 +0200960+
961`external_ids_map` supports computing the new cache value based on a
962previously cached state. This applies modifications based on the Git
963diff and is almost always faster.
964`cache.external_ids_map.enablePartialReloads` turns this behavior on
Patrick Hieselc486edf2019-08-19 15:55:17 +0200965or off. The default is `true`.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400966
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700967cache `"git_tags"`::
968+
969If branch or reference level READ access controls are used, this
970cache tracks which tags are reachable from the branch tips of a
971repository. Gerrit uses this information to determine the set
972of tags that a client may access, derived from which tags are
973part of the history of a visible branch.
974+
975The cache is persisted to disk across server restarts as it can
976be expensive to compute (60 or more seconds for a large history
977like the Linux kernel repository).
978
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700979cache `"groups"`::
980+
Edwin Kempin3091e112017-11-13 15:23:58 +0100981Caches the basic group information of internal groups by group ID,
982including the group owner, name, and description.
983+
Edwin Kempind967ec42017-11-13 15:14:41 +0100984For this cache it is important to configure a size that is larger than
985the number of internal Gerrit groups, otherwise general Gerrit
986performance may be poor. This is why by default this cache is
987unlimited.
988+
Edwin Kempin3091e112017-11-13 15:23:58 +0100989External group membership obtained from LDAP is cached under
990`"ldap_groups"`.
991
992cache `"groups_byname"`::
993+
994Caches the basic group information of internal groups by group name,
995including the group owner, name, and description.
996+
Edwin Kempind967ec42017-11-13 15:14:41 +0100997For this cache it is important to configure a size that is larger than
998the number of internal Gerrit groups, otherwise general Gerrit
999performance may be poor. This is why by default this cache is
1000unlimited.
1001+
Edwin Kempin3091e112017-11-13 15:23:58 +01001002External group membership obtained from LDAP is cached under
1003`"ldap_groups"`.
1004
1005cache `"groups_byuuid"`::
1006+
1007Caches the basic group information of internal groups by group UUID,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001008including the group owner, name, and description.
1009+
Edwin Kempind967ec42017-11-13 15:14:41 +01001010For this cache it is important to configure a size that is larger than
1011the number of internal Gerrit groups, otherwise general Gerrit
1012performance may be poor. This is why by default this cache is
1013unlimited.
1014+
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +02001015External group membership obtained from LDAP is cached under
1016`"ldap_groups"`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001017
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +02001018cache `"groups_bymember"`::
Matt Fischer620255a2011-03-22 14:28:23 -05001019+
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +02001020Caches the groups which contain a specific member (account). If direct
1021updates are made to the `account_group_members` table, this cache should
1022be flushed.
1023
Alice Kober-Sotzek3e1fe1b2017-10-12 14:44:17 +02001024cache `"groups_bysubgroups"`::
1025+
1026Caches the parent groups of a subgroup. If direct updates are made
Matt Fischer620255a2011-03-22 14:28:23 -05001027to the `account_group_includes` table, this cache should be flushed.
1028
Youssef Elghareebf08d4b32020-03-26 18:02:15 +01001029cache `"groups_external"`::
1030+
1031Caches all the external groups available to Gerrit. The cache holds a
1032single entry which maps to the latest available of all external groups'
1033UUIDs. This cache uses "groups_external_persisted" to load its value.
1034
1035cache `"groups_external_persisted"`::
1036+
1037Caches all external groups available to Gerrit at some point in history.
1038The cache key is representation of a specific groups state in NoteDb and
1039the value is the list of all external groups.
1040The cache is persisted to enhance performance.
1041
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001042cache `"ldap_groups"`::
1043+
1044Caches the LDAP groups that a user belongs to, if LDAP has been
1045configured on this server. This cache should be configured with a
1046low maxAge setting, to ensure LDAP modifications are picked up in
1047a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001048
Gustaf Lundh0919a492012-10-19 15:29:23 +02001049cache `"ldap_groups_byinclude"`::
1050+
1051Caches the hierarchical structure of LDAP groups.
1052
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -07001053cache `"ldap_usernames"`::
1054+
1055Caches a mapping of LDAP username to Gerrit account identity. The
1056cache automatically updates when a user first creates their account
1057within Gerrit, so the cache expire time is largely irrelevant.
1058
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -07001059cache `"permission_sort"`::
1060+
David Pursehouse221d4f62012-06-08 17:38:08 +09001061Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -07001062reference. Sorting the sections can be expensive when regular
1063expressions are used, so this cache remembers the ordering for
1064each branch.
1065
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001066cache `"plugin_resources"`::
1067+
1068Caches formatted plugin resources, such as plugin documentation that
1069has been converted from Markdown to HTML. The memoryLimit refers to
1070the bytes of memory dedicated to storing the documentation.
1071
Patrick Hieselc2c108c2020-07-23 09:54:22 +02001072cache `"persisted_projects"`::
1073+
1074Caches the project description records, from the `refs/meta/config`
1075branch of each project. This is the persisted variant of the
1076`projects` cache. The intention is for this cache to have an in-memory
1077size of 0.
1078
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001079cache `"projects"`::
1080+
Patrick Hieselc2c108c2020-07-23 09:54:22 +02001081Caches the project description records, from the `refs/meta/config`
1082branch of each project. If a project record is updated or deleted, this
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001083cache should be flushed. Newly inserted projects do not require
1084a cache flush, as they will be read upon first reference.
1085
Dave Borowitz08aa8bb2018-04-05 12:01:06 -04001086cache `"prolog_rules"`::
1087+
1088Caches parsed `rules.pl` contents for each project. This cache uses the same
1089size as the `projects` cache, and cannot be configured independently.
1090
Patrick Hiesela57c0d62019-02-19 09:09:22 +01001091cache `"pure_revert"`::
1092+
1093Result of checking if one change or commit is a pure/clean revert of
1094another.
1095
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001096cache `"sshkeys"`::
1097+
1098Caches unpacked versions of user SSH keys, so the internal SSH daemon
1099can match against them during authentication. The unit of storage
1100is per-user, so 1024 items translates to 1024 unique user accounts.
1101As each individual user account may configure multiple SSH keys,
1102the total number of keys may be larger than the item count.
1103
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001104cache `"web_sessions"`::
1105+
1106Tracks the live user sessions coming in over HTTP. Flushing this
1107cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -07001108them to sign-in again. To avoid breaking active users, this cache
1109is not flushed automatically by `gerrit flush-caches --all`, but
1110instead must be explicitly requested.
1111+
1112If no disk cache is configured (or `cache.web_sessions.diskLimit`
1113is set to 0) a server restart will force all users to sign-out,
1114and need to sign-in again after the restart, as the cache was
1115unable to persist the session information. Enabling a disk cache
1116is strongly recommended.
1117+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001118Session storage is relatively inexpensive. The average entry in
1119this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001120
Shawn O. Pearce4016a932009-05-28 15:12:40 -07001121See also link:cmd-flush-caches.html[gerrit flush-caches].
1122
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001123==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001124
Hugo Arès2bc86812015-03-09 15:20:28 -04001125[[cache.diff.timeout]]cache.diff.timeout::
1126+
1127Maximum number of milliseconds to wait for diff data before giving up and
1128falling back on a simpler diff algorithm that will not be able to break down
1129modified regions into smaller ones. This is a work around for an infinite loop
1130bug in the default difference algorithm implementation.
1131+
1132Values should use common unit suffixes to express their setting:
1133+
1134* ms, milliseconds
1135* s, sec, second, seconds
1136* m, min, minute, minutes
1137* h, hr, hour, hours
1138
1139+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001140--
Hugo Arès2bc86812015-03-09 15:20:28 -04001141If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001142
Hugo Arès2bc86812015-03-09 15:20:28 -04001143Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001144--
Hugo Arès2bc86812015-03-09 15:20:28 -04001145
Edwin Kempin42d27432013-11-24 17:06:24 +01001146[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001147+
1148Maximum number of milliseconds to wait for intraline difference data
1149before giving up and disabling it for a particular file pair. This is
1150a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +09001151implementation.
1152+
1153If computation takes longer than the timeout, the worker thread is
1154terminated, an error message is shown, and no intraline difference is
1155displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001156+
1157Values should use common unit suffixes to express their setting:
1158+
1159* ms, milliseconds
1160* s, sec, second, seconds
1161* m, min, minute, minutes
1162* h, hr, hour, hours
1163
1164+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001165--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001166If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001167
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001168Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001169--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001170
Edwin Kempin42d27432013-11-24 17:06:24 +01001171[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001172+
1173Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001174when populating a diff cache entry. This flag is provided primarily
1175as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +09001176necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001177this setting will fallback to `cache.diff.intraline` if not set in the
1178configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001179+
1180Default is true, enabled.
1181
Simon Leifc19ff12014-10-02 13:36:00 -04001182[[cache.projects.loadOnStartup]]cache.projects.loadOnStartup::
1183+
1184If the project cache should be loaded during server startup.
1185+
1186The cache is loaded concurrently. Admins should ensure that the cache
1187size set under <<cache.name.memoryLimit,cache.projects.memoryLimit>>
1188is not smaller than the number of repos.
1189+
1190Default is false, disabled.
1191
1192[[cache.projects.loadThreads]]cache.projects.loadThreads::
1193+
1194Only relevant if <<cache.projects.loadOnStartup,cache.projects.loadOnStartup>>
1195is true.
1196+
1197The number of threads to allocate for loading the cache at startup. These
1198threads will die out after the cache is loaded.
1199+
1200Default is the number of CPUs.
1201
Shawn Pearce67a33302016-08-11 11:51:59 -07001202
1203[[capability]]
1204=== Section capability
1205
1206[[capability.administrateServer]]capability.administrateServer::
1207+
1208Names of groups of users that are allowed to exercise the
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001209`administrateServer` capability, in addition to those listed in
Shawn Pearce67a33302016-08-11 11:51:59 -07001210All-Projects. Configuring this option can be a useful fail-safe
1211to recover a server in the event an administrator removed all
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001212groups from the `administrateServer` capability, or to ensure that
Shawn Pearce67a33302016-08-11 11:51:59 -07001213specific groups always have administration capabilities.
1214+
1215----
1216[capability]
1217 administrateServer = group Fail Safe Admins
1218----
1219+
1220The configuration file uses group names, not UUIDs. If a group is
1221renamed the gerrit.config file must be updated to reflect the new
1222name. If a group cannot be found for the configured name a warning
1223is logged and the server will continue normal startup.
1224+
1225If not specified (default), only the groups listed by All-Projects
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001226may use the `administrateServer` capability.
1227
1228[[capability.makeFirstUserAdmin]]capability.makeFirstUserAdmin::
1229+
1230Whether the first user that logs in to the Gerrit server should
1231automatically be added to the administrator group and hence get the
1232`administrateServer` capability assigned. This is useful to bootstrap
1233the authentication database.
1234+
1235Default is true.
Shawn Pearce67a33302016-08-11 11:51:59 -07001236
1237
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001238[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001239=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -07001240
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001241[[change.allowBlame]]change.allowBlame::
1242+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001243Allow blame on side by side diff. If set to false, blame cannot be used.
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001244+
1245Default is true.
1246
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001247[[change.cacheAutomerge]]change.cacheAutomerge::
1248+
Sven Selberg0299e252020-05-05 16:16:41 +02001249When reviewing merge commits, the left-hand side shows the output of the
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001250result of JGit's automatic merge algorithm. This option controls whether
1251this output is cached in the change repository, or if only the diff is
1252cached in the persistent `diff` cache.
1253+
1254If true, automerge results are stored in the repository under
1255`refs/cache-automerge/*`; the results of diffing the change against its
1256automerge base are stored in the diff cache. If false, no extra data is
1257stored in the repository, only the diff cache. This can result in slight
1258performance improvements by reducing the number of refs in the repo.
1259+
1260Default is true.
1261
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001262[[change.commentSizeLimit]]change.commentSizeLimit::
1263+
1264Maximum allowed size in characters of a regular (non-robot) comment. Comments
1265which exceed this size will be rejected. Size computation is approximate and may
1266be off by roughly 1%. Common unit suffixes of 'k', 'm', or 'g' are supported.
1267The value must be positive.
1268+
Joerg Zierenfaea7e12020-04-06 10:44:46 +02001269The default limit is 16kiB.
1270
1271[[change.cumulativeCommentSizeLimit]]change.cumulativeCommentSizeLimit::
1272+
1273Maximum allowed size in characters of all comments (including robot comments)
1274and change messages. Size computation is approximate and may be off by roughly
12751%. Common unit suffixes of 'k', 'm', or 'g' are supported.
1276+
1277The default limit is 3MiB.
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001278
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001279[[change.disablePrivateChanges]]change.disablePrivateChanges::
Patrick Hieseldb8df482019-01-24 10:11:23 +01001280+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001281If set to true, users are not allowed to create private changes.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001282+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001283The default is false.
1284
Ben Rohlfs2cc33542020-02-28 12:44:09 +01001285[[change.enableAttentionSet]]change.enableAttentionSet::
1286+
1287If set to true, then all UI features for using and interacting with the
1288attention set are enabled.
1289+
Ben Rohlfs848ad1a2020-10-28 09:14:10 +01001290The default is true.
Ben Rohlfs2cc33542020-02-28 12:44:09 +01001291
1292[[change.enableAssignee]]change.enableAssignee::
1293+
1294If set to true, then all UI features for using and interacting with the
1295assignee are enabled.
1296+
Ben Rohlfs848ad1a2020-10-28 09:14:10 +01001297The default is false.
Ben Rohlfs2cc33542020-02-28 12:44:09 +01001298
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001299[[change.largeChange]]change.largeChange::
1300+
1301Number of changed lines from which on a change is considered as a large
1302change. The number of changed lines of a change is the sum of the lines
1303that were inserted and deleted in the change.
1304+
1305The specified value is used to visualize the change sizes in the Web UI
1306in change tables and user dashboards.
1307+
1308By default 500.
1309
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001310[[change.maxComments]]change.maxComments::
1311+
1312Maximum number of comments (regular plus robot) allowed per change. Additional
1313comments are rejected.
1314+
1315By default 5,000.
1316
Dave Borowitzca614bc2019-04-15 15:29:15 -07001317[[change.maxUpdates]]change.maxUpdates::
1318+
1319Maximum number of updates to a change. Counts only updates to the main NoteDb
1320meta ref; draft comments, robot comments, stars, etc. do not count towards the
1321total.
1322+
1323Many NoteDb operations require walking the entire change meta ref and loading
1324its contents into memory, so changes with arbitrarily many updates may cause
1325high CPU usage, memory pressure, persistent cache bloat, and other problems.
1326+
Dave Borowitz18e7b552019-04-17 07:53:38 -07001327The following operations are allowed even when a change is at the limit:
Edwin Kempinf2f815b2020-01-22 17:09:16 +01001328
Dave Borowitz18e7b552019-04-17 07:53:38 -07001329* Abandon
1330* Submit
1331* Submit by push with `%submit`
1332* Auto-close by pushing directly to the branch
1333* Fix with link:rest-api-changes.html#fix-input[`expect_merged_as`]
Edwin Kempinf2f815b2020-01-22 17:09:16 +01001334
Dave Borowitzca614bc2019-04-15 15:29:15 -07001335By default 1000.
1336
Patrick Hiesela4824db2019-12-20 10:55:26 +01001337[[change.mergeabilityComputationBehavior]]change.mergeabilityComputationBehavior::
1338+
1339This setting determines when Gerrit computes if a change is mergeable or not.
1340This computation is expensive, especially when the repository is large or when
1341there are many open changes.
1342+
1343This config can have the following states:
1344+
1345* `API_REF_UPDATED_AND_CHANGE_REINDEX`: Gerrit indexes `mergeability` enabling
1346 the `is:mergeable` predicate in change search and allowing fast retrieval of
1347 this bit in query responses. Gerrit will always serve `mergeable` in
1348 link:rest-api-changes.html#change-info[ChangeInfo] objects.
1349 Gerrit will reindex all open changes when the target ref advances (expensive).
1350* `REF_UPDATED_AND_CHANGE_REINDEX`: Gerrit indexes `mergeability` enabling the
1351 `is:mergeable` predicate in change search and allowing fast retrieval of this
1352 bit in query responses. Gerrit will never serve `mergeable` in
1353 link:rest-api-changes.html#change-info[ChangeInfo]
1354 objects. This state can be a final state for instances that only want to
1355 optimize the read path, but not the write path for speed or serve as an
1356 intermediary step for instances that want to optimize both and need to migrate
1357 callers of their API.
1358 Gerrit will reindex all open changes when the target ref advances (expensive).
1359* `NEVER`: Gerrit does not index `mergeable`, so `is:mergeable` is disabled as
1360 query operator. Gerrit does not serve `mergeable` in
1361 link:rest-api-changes.html#change-info[ChangeInfo].
1362
1363Default is `REF_UPDATED_AND_CHANGE_REINDEX`.
1364
Edwin Kempin67229a42019-10-08 09:13:34 +02001365[[change.move]]change.move::
1366+
1367Whether the link:rest-api-changes.html#move-change[Move Change] REST
1368endpoint is enabled.
1369+
1370The move change functionality has some corner cases with undesired side
1371effects. Hence administrators may decide to disable this functionality.
1372In particular, if a change that has dependencies on other changes is
1373moved to a new branch, and the moved change gets submitted to the new
1374branch, the changes on which the change depends are silently merged
1375into the new branch, although these changes have not been moved to that
1376branch (see details in
1377link:https://bugs.chromium.org/p/gerrit/issues/detail?id=9877[issue
13789877]).
1379+
1380By default true.
1381
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001382[[change.replyLabel]]change.replyLabel::
1383+
1384Label name for the reply button. In the user interface an ellipsis (…)
1385is appended.
1386+
1387Default is "Reply". In the user interface it becomes "Reply…".
1388
1389[[change.replyTooltip]]change.replyTooltip::
1390+
1391Tooltip for the reply button. In the user interface a note about the
1392keyboard shortcut is appended.
1393+
1394Default is "Reply and score". In the user interface it becomes "Reply
1395and score (Shortcut: a)".
1396
1397[[change.robotCommentSizeLimit]]change.robotCommentSizeLimit::
1398+
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001399Maximum allowed size in characters of a robot comment. Robot comments which
1400exceed this size will be rejected on addition. Size computation is approximate
1401and may be off by roughly 1%. Common unit suffixes of 'k', 'm', or 'g' are
1402supported. Zero or negative values allow robot comments of unlimited size.
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001403+
Joerg Zierenfaea7e12020-04-06 10:44:46 +02001404The default limit is 1MiB.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001405
Gal Paikin02d6ba62020-07-13 23:49:24 +03001406[[change.sendNewPatchsetEmails]]change.sendNewPatchsetEmails::
1407+
1408When false, emails will not be sent to owners, reviewers, and cc for
1409creating a new patchset unless they are project watchers or have starred
1410the change.
1411+
1412Default is true.
1413
Luca Milanesiof2a275b2017-04-10 10:59:34 +01001414[[change.showAssigneeInChangesTable]]change.showAssigneeInChangesTable::
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001415+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001416Show assignee field in changes table. If set to false, assignees will
1417not be visible in changes table.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001418+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001419Default is false.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001420
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001421[[change.strictLabels]]change.strictLabels::
1422+
1423Reject invalid label votes: invalid labels or invalid values. This
David Pursehouse33495ab2019-10-31 09:38:43 +09001424configuration option is provided for backwards compatibility and may
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001425be removed in future gerrit versions.
1426+
1427Default is false.
1428
David Ostrovsky9933eb32014-05-20 16:08:20 +02001429[[change.submitLabel]]change.submitLabel::
1430+
1431Label name for the submit button.
1432+
1433Default is "Submit".
1434
Stefan Beller7c380d512015-08-21 10:55:21 -07001435[[change.submitLabelWithParents]]change.submitLabelWithParents::
1436+
1437Label name for the submit button if the change has parents which will
1438be submitted together with this change.
1439+
1440Default is "Submit including parents".
1441
David Ostrovsky9933eb32014-05-20 16:08:20 +02001442[[change.submitTooltip]]change.submitTooltip::
1443+
1444Tooltip for the submit button. Variables available for replacement
1445include `${patchSet}` for the current patch set number (1, 2, 3),
1446`${branch}` for the branch name ("master") and `${commit}` for the
1447abbreviated commit SHA-1 (`c9c0edb`).
1448+
1449Default is "Submit patch set ${patchSet} into ${branch}".
1450
Stefan Beller0e655542015-07-20 21:14:38 -07001451[[change.submitTooltipAncestors]]change.submitTooltipAncestors::
1452+
1453Tooltip for the submit button if there are ancestors which would
1454also be submitted by submitting the change. Additionally to the variables
1455as in link:#change.submitTooltip[change.submitTooltip], there is the
1456variable `${submitSize}` indicating the number of changes which are
1457submitted.
1458+
1459Default is "Submit all ${topicSize} changes of the same topic (${submitSize}
1460changes including ancestors and other changes related by topic)".
1461
Stefan Bellera038cf72015-01-13 16:25:10 -08001462[[change.submitTopicLabel]]change.submitTopicLabel::
1463+
1464If `change.submitWholeTopic` is set and a change has a topic,
1465the label name for the submit button is given here instead of
1466the configuration `change.submitLabel`.
1467+
1468Defaults to "Submit whole topic"
1469
1470[[change.submitTopicTooltip]]change.submitTopicTooltip::
1471+
David Pursehousea61ee502016-09-06 16:27:09 +09001472If `change.submitWholeTopic` is configured to true and a change has a
Stefan Bellera038cf72015-01-13 16:25:10 -08001473topic, this configuration determines the tooltip for the submit button
1474instead of `change.submitTooltip`. The variable `${topicSize}` is available
Stefan Beller7c380d512015-08-21 10:55:21 -07001475for the number of changes in the same topic to be submitted. The number of
1476all changes to be submitted is in the variable `${submitSize}`.
Stefan Bellera038cf72015-01-13 16:25:10 -08001477+
Stefan Beller7c380d512015-08-21 10:55:21 -07001478Defaults to "Submit all ${topicSize} changes of the same topic
1479(${submitSize} changes including ancestors and other
1480changes related by topic)".
Stefan Bellera038cf72015-01-13 16:25:10 -08001481
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001482[[change.submitWholeTopic]]change.submitWholeTopic::
Richard Möhne4abe9a2014-11-13 20:05:13 +01001483+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001484Determines if the submit button submits the whole topic instead of
1485just the current change.
David Ostrovskya304aff2018-04-05 23:07:51 +02001486+
1487Default is false.
1488
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001489[[change.updateDelay]]change.updateDelay::
Changcheng Xiao16095352017-12-18 10:03:08 +01001490+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001491How often in seconds the web interface should poll for updates to the
1492currently open change. The poller relies on the client's browser
1493cache to use If-Modified-Since and respect `304 Not Modified` HTTP
1494responses. This allows for fast polls, often under 8 milliseconds.
Changcheng Xiao16095352017-12-18 10:03:08 +01001495+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001496With a configured 30 second delay a server with 4900 active users will
1497typically need to dedicate 1 CPU to the update check. 4900 users
1498divided by an average delay of 30 seconds is 163 requests arriving per
1499second. If requests are served at \~6 ms response time, 1 CPU is
1500necessary to keep up with the update request traffic. On a smaller
1501user base of 500 active users, the default 30 second delay is only 17
1502requests per second and requires ~10% CPU.
1503+
1504If 0 the update polling is disabled.
1505+
1506Default is 5 minutes.
Changcheng Xiao16095352017-12-18 10:03:08 +01001507
Edwin Kempine326a1d2015-06-03 10:27:39 +02001508[[changeCleanup]]
1509=== Section changeCleanup
1510
1511This section allows to configure change cleanups and schedules them to
1512run periodically.
1513
1514[[changeCleanup.abandonAfter]]changeCleanup.abandonAfter::
1515+
1516Period of inactivity after which open changes should be abandoned
1517automatically.
1518+
1519By default `0`, never abandon open changes.
1520+
1521[WARNING] Auto-Abandoning changes may confuse/annoy users. When
1522enabling this, make sure to choose a reasonably large grace period and
1523inform users in advance.
1524+
1525The following suffixes are supported to define the time unit:
1526+
1527* `d, day, days`
1528* `w, week, weeks` (`1 week` is treated as `7 days`)
1529* `mon, month, months` (`1 month` is treated as `30 days`)
1530* `y, year, years` (`1 year` is treated as `365 days`)
1531
Edwin Kempin7080ef12015-06-10 15:03:09 +02001532[[changeCleanup.abandonIfMergeable]]changeCleanup.abandonIfMergeable::
1533+
David Pursehousef4bc2562019-12-04 09:55:40 +09001534Whether changes which are mergeable should be auto-abandoned. When set
1535to `false`, `-is:mergeable` is appended to the query used to find
1536the changes to auto-abandon.
Edwin Kempin7080ef12015-06-10 15:03:09 +02001537+
David Pursehousef4bc2562019-12-04 09:55:40 +09001538By default `true`, meaning mergeable changes are auto-abandoned.
1539+
Patrick Hiesela4824db2019-12-20 10:55:26 +01001540If
1541link:#change.mergeabilityComputationBehavior[`change.mergeabilityComputationBehavior`]
1542is set to `NEVER`, setting this option to `false` has no effect and it behaves
1543as though it were set to `true`.
Edwin Kempin7080ef12015-06-10 15:03:09 +02001544
Jacek Centkowski36d35212019-05-13 14:32:00 +02001545[[changeCleanup.cleanupAccountPatchReview]]changeCleanup.cleanupAccountPatchReview::
1546+
1547Whether accountPatchReview data should be also removed when change
1548gets auto-abandoned.
1549+
1550By default `false`.
1551
Edwin Kempine326a1d2015-06-03 10:27:39 +02001552[[changeCleanup.abandonMessage]]changeCleanup.abandonMessage::
1553+
1554Change message that should be posted when a change is abandoned.
1555+
1556'${URL}' can be used as a placeholder for the Gerrit web URL.
1557+
1558By default "Auto-Abandoned due to inactivity, see
1559${URL}Documentation/user-change-cleanup.html#auto-abandon\n\n
1560If this change is still wanted it should be restored.".
1561
1562[[changeCleanup.startTime]]changeCleanup.startTime::
1563+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001564The link:#schedule-configuration-startTime[start time] for running
1565change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001566
1567[[changeCleanup.interval]]changeCleanup.interval::
1568+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001569The link:#schedule-configuration-interval[interval] for running
1570change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001571
Edwin Kempind33d95a2018-02-16 11:44:04 +01001572link:#schedule-configuration-examples[Schedule examples] can be found
1573in the link:#schedule-configuration[Schedule Configuration] section.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001574
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001575[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001576=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001577
Brad Larson991a31b2009-11-03 14:30:26 -06001578Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -05001579patch comments, in-line code comments and approval category value descriptions
1580to turn set strings into hyperlinks. One common use is for linking to
1581bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -06001582
1583In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001584will match typical Gerrit Change-Id values and create a hyperlink
1585to changes which reference it. The second configuration 'bugzilla'
1586will hyperlink terms such as 'bug 42' to an external bug tracker,
1587supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +09001588configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001589how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -06001590
Sven Selberg2a0beab2018-04-20 14:49:20 +02001591commentlinks supports link:#reloadConfig[configuration reloads]. Though a
Gustaf Lundhca7eb792018-04-16 10:56:03 +02001592link:cmd-flush-caches.html[flush-caches] of "projects" is needed for the
1593commentlinks to be immediately available in the UI.
1594
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001595----
1596[commentlink "changeid"]
1597 match = (I[0-9a-f]{8,40})
David Pursehouse9f68e1a2016-01-28 09:21:03 +00001598 link = "#/q/$1"
Brad Larson991a31b2009-11-03 14:30:26 -06001599
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001600[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001601 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001602 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -06001603
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001604[commentlink "tracker"]
1605 match = ([Bb]ug:\\s+)(\\d+)
1606 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
1607----
1608
Dave Borowitz13b38002013-04-08 12:03:29 -07001609Comment links can also be specified in `project.config` and sections in
1610children override those in parents. The only restriction is that to
1611avoid injecting arbitrary user-supplied HTML in the page, comment links
1612defined in `project.config` may only supply `link`, not `html`.
1613
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001614[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -06001615+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001616A JavaScript regular expression to match positions to be replaced
1617with a hyperlink. Subexpressions of the matched string can be
1618stored using groups and accessed with `$'n'` syntax, where 'n'
1619is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -06001620+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001621The configuration file parser eats one level of backslashes, so the
1622character class `\s` requires `\\s` in the configuration file. The
1623parser also terminates the line at the first `#`, so a match
1624expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001625+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -08001626To match case insensitive strings, a character class with both the
1627upper and lower case character for each position must be used. For
1628example, to match the string `bug` in a case insensitive way the match
1629pattern `[bB][uU][gG]` needs to be used.
1630+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001631The commentlink.name.match regular expressions are applied to the raw,
1632unformatted and unescaped text form. Regex matching against HTML is not
1633supported. Comment link patterns that are written in this style should
1634be updated to match text formats.
Matthew Webbercd7d2bf2015-10-14 15:54:06 +01001635+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001636A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -06001637
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001638[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -06001639+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001640The URL to direct the user to whenever the regular expression is
1641matched. Groups in the match expression may be accessed as `$'n'`.
1642+
1643The link property is used only when the html property is not present.
1644
1645[[commentlink.name.html]]commentlink.<name>.html::
1646+
1647HTML to replace the entire matched string with. If present,
1648this property overrides the link property above. Groups in the
1649match expression may be accessed as `$'n'`.
1650+
1651The configuration file eats double quotes, so escaping them as
1652`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -06001653
Dave Borowitz82d79c02013-04-08 15:45:12 -07001654[[commentlink.name.enabled]]commentlink.<name>.enabled::
1655+
1656Whether the comment link is enabled. A child project may override a
1657section in a parent or the site-wide config that is disabled by
1658specifying `enabled = true`.
1659+
1660Disabling sections in `gerrit.config` can be used by site administrators
1661to create a library of comment links with `html` set that are not
1662user-supplied and thus can be verified to be XSS-free, but are only
1663enabled for a subset of projects.
1664+
David Pursehouse6f1af472013-12-11 19:23:33 +09001665By default, true.
1666+
Dave Borowitz82d79c02013-04-08 15:45:12 -07001667Note that the names and contents of disabled sections are visible even
1668to anonymous users via the
1669link:rest-api-projects.html#get-config[REST API].
1670
Brad Larson991a31b2009-11-03 14:30:26 -06001671
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001672[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001673=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001674
1675These settings are applied only if Gerrit is started as the container
1676process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
1677
1678[[container.heapLimit]]container.heapLimit::
1679+
1680Maximum heap size of the Java process running Gerrit, in bytes.
1681This property is translated into the '-Xmx' flag for the JVM.
1682+
1683Default is platform and JVM specific.
1684+
1685Common unit suffixes of 'k', 'm', or 'g' are supported.
1686
1687[[container.javaHome]]container.javaHome::
1688+
1689Path of the JRE/JDK installation to run Gerrit with. If not set, the
1690Gerrit startup script will attempt to search your system and guess
1691a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
1692
1693[[container.javaOptions]]container.javaOptions::
1694+
David Pursehousea13052b2020-02-10 14:26:08 +09001695Additional options to pass along to the Java runtime. May be specified
1696multiple times to configure multiple values. If multiple values are
1697configured, they are passed in order on the command line, separated by
1698spaces. These options are appended onto 'JAVA_OPTIONS'.
David Pursehousea70a60c2020-02-10 14:22:43 +09001699+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001700For example, it is possible to overwrite Gerrit's default log4j
1701configuration:
David Pursehousea70a60c2020-02-10 14:22:43 +09001702+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001703----
1704 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
1705----
1706
Hugo Arès6710f0a2014-11-04 10:28:42 -05001707[[container.daemonOpt]]container.daemonOpt::
1708+
1709Additional options to pass to the daemon (e.g. '--enable-httpd'). If
1710multiple values are configured, they are passed in that order to the command
1711line, separated by spaces.
1712+
1713Execute `java -jar gerrit.war daemon --help` to see all possible
1714options.
1715
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001716[[container.replica]]container.replica::
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001717+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02001718Used on Gerrit replica installations. If set to true the Gerrit JVM is
1719called with the '--replica' switch, enabling replica mode. If no value is
Matthias Sohnd8182ba2019-12-09 14:50:23 +01001720set (or any other value), Gerrit defaults to primary mode enabling write
1721operations.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001722
David Ostrovsky21fca752019-10-18 08:50:29 +02001723[[container.slave]]container.slave::
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001724+
Christian Aistleitnerde8b0722020-06-20 22:17:23 +02001725Backward compatibility for link:#container.replica[`container.replica`]
1726config setting.
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001727
Khai Do6168beb2016-12-19 17:26:28 -08001728[[container.startupTimeout]]container.startupTimeout::
1729+
1730The maximum time (in seconds) to wait for a gerrit.sh start command
1731to run a new Gerrit daemon successfully. If not set, defaults to
173290 seconds.
1733
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001734[[container.user]]container.user::
1735+
1736Login name (or UID) of the operating system user the Gerrit JVM
1737will execute as. If not set, defaults to the user who launched
1738the 'gerrit.sh' wrapper script.
1739
1740[[container.war]]container.war::
1741+
1742Path of the JAR file to start daemon execution with. This should
1743be the path of the local 'gerrit.war' archive. Overrides the
1744environment variable 'GERRIT_WAR'.
1745+
1746If not set, defaults to '$site_path/bin/gerrit.war', or to
1747'$HOME/gerrit.war'.
1748
1749
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001750[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001751=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001752
Saša Živkovd34dfe32017-11-20 11:14:35 +01001753[NOTE]
1754The link:#jgitConfig[etc/jgit.config] file supports configuration of all JGit
1755options.
1756
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001757[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001758+
1759Number of bytes of a pack file to load into memory in a single
1760read operation. This is the "page size" of the JGit buffer cache,
1761used for all pack access operations. All disk IO occurs as single
1762window reads. Setting this too large may cause the process to load
1763more data than is required; setting this too small may increase
1764the frequency of `read()` system calls.
1765+
1766Default on JGit is 8 KiB on all platforms.
1767+
1768Common unit suffixes of 'k', 'm', or 'g' are supported.
1769
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001770[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001771+
1772Maximum number of bytes to load and cache in memory from pack files.
1773If JGit needs to access more than this many bytes it will unload less
1774frequently used windows to reclaim memory space within the process.
1775As this buffer must be shared with the rest of the JVM heap, it
1776should be a fraction of the total memory available.
1777+
1778Default on JGit is 10 MiB on all platforms.
1779+
1780Common unit suffixes of 'k', 'm', or 'g' are supported.
1781
Matthias Sohn79bec412020-02-12 01:00:31 +01001782[[core.packedGitUseStrongRefs]]core.packedGitUseStrongRefs::
1783+
1784Set to `true` in order to use strong references to reference packfile
1785pages cached in the WindowCache. Otherwise SoftReferences are used.
1786If this option is set to `false`, the Java garbage collector will
1787flush the WindowCache to free memory if the used heap comes close to
1788the maximum heap size. This has the advantage that it can quickly
1789reclaim memory which was used by the WindowCache but comes at the
1790price that the previously cached pack file content needs to be again
1791copied from the file system cache to the Gerrit process.
1792Setting this option to `true` prevents flushing the WindowCache
1793which provides more predictable performance.
1794+
1795Default is `false`.
1796
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001797[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001798+
1799Maximum number of bytes to reserve for caching base objects
1800that multiple deltafied objects reference. By storing the entire
1801decompressed base object in a cache Git is able to avoid unpacking
1802and decompressing frequently used base objects multiple times.
1803+
1804Default on JGit is 10 MiB on all platforms. You probably do not
1805need to adjust this value.
1806+
1807Common unit suffixes of 'k', 'm', or 'g' are supported.
1808
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001809[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001810+
1811Maximum number of pack files to have open at once. A pack file
1812must be opened in order for any of its data to be available in
1813a cached window.
1814+
1815If you increase this to a larger setting you may need to also adjust
1816the ulimit on file descriptors for the host JVM, as Gerrit needs
1817additional file descriptors available for network sockets and other
1818repository data manipulation.
1819+
1820Default on JGit is 128 file descriptors on all platforms.
1821
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001822[[core.streamFileThreshold]]core.streamFileThreshold::
1823+
1824Largest object size, in bytes, that JGit will allocate as a
1825contiguous byte array. Any file revision larger than this threshold
1826will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001827files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001828during delta decompression.
1829+
1830Servers with very high traffic should set this to be larger than
1831the size of their common big files. For example a server managing
1832the Android platform typically has to deal with ~10-12 MiB XML
1833files, so `15 m` would be a reasonable setting in that environment.
1834Setting this too high may cause the JVM to run out of heap space
1835when handling very big binary files, such as device firmware or
1836CD-ROM ISO images.
1837+
Luca Milanesiob104a552019-11-18 17:28:56 -08001838Defaults to 25% of the available JVM heap, limited to 2g.
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001839+
1840Common unit suffixes of 'k', 'm', or 'g' are supported.
1841
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001842[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001843+
1844When true, JGit will use `mmap()` rather than `malloc()+read()`
1845to load data from pack files. The use of mmap can be problematic
1846on some JVMs as the garbage collector must deduce that a memory
1847mapped segment is no longer in use before a call to `munmap()`
1848can be made by the JVM native code.
1849+
1850In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001851pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001852of virtual address space, as the garbage collector cannot reclaim
1853unused mapped spaces fast enough.
1854+
1855Default on JGit is false. Although potentially slower, it yields
1856much more predictable behavior.
1857
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001858[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1859+
1860Size of the buffer to store logging events for asynchronous logging.
1861Putting a larger value can protect threads from stalling when the
1862AsyncAppender threads are not fast enough to consume the logging events
David Pursehouse1ff91c02015-05-19 15:05:26 +09001863from the buffer. It also protects from losing log entries in this case.
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001864+
1865Default is 64 entries.
1866
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001867[[core.useRecursiveMerge]]core.useRecursiveMerge::
1868+
Edwin Kempin71831d22014-07-15 08:54:29 +02001869Use JGit's recursive merger for three-way merges. This only affects
Sebastian Schuberth774aac92015-04-16 13:21:04 +02001870projects that allow content merges.
Edwin Kempin71831d22014-07-15 08:54:29 +02001871+
1872As explained in this
1873link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[
Marian Harbach34253372019-12-10 18:01:31 +01001874blog,role=external,window=_blank], the recursive merge produces better results if the two commits
Edwin Kempin71831d22014-07-15 08:54:29 +02001875that are merged have more than one common predecessor.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001876+
Edwin Kempin7853c5b2014-07-15 08:57:17 +02001877Default is true.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001878
Hugo Arès47344372016-06-27 10:23:17 -04001879[[core.repositoryCacheCleanupDelay]]core.repositoryCacheCleanupDelay::
1880+
1881Delay between each periodic cleanup of expired repositories.
1882+
1883Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1884`min`, etc.).
1885+
1886Set it to 0 in order to switch off cache expiration. If cache expiration is
1887switched off, the JVM can still evict cache entries when it is running low
1888on available heap memory.
1889+
1890Set it to -1 to automatically derive cleanup delay from
1891`core.repositoryCacheExpireAfter` (lowest value between 1/10 of
1892`core.repositoryCacheExpireAfter` and 10 minutes).
1893+
1894Default is -1.
1895
1896[[core.repositoryCacheExpireAfter]]core.repositoryCacheExpireAfter::
1897+
1898Time an unused repository should expire and be evicted from the repository
1899cache.
1900+
1901Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1902`min`, etc.).
1903+
1904Default is 1 hour.
1905
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001906[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001907=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03001908
1909----
1910[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001911 command = checkout
1912 command = cherry_pick
1913 command = pull
1914 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001915 scheme = ssh
1916 scheme = http
1917 scheme = anon_http
1918 scheme = anon_git
1919 scheme = repo_download
1920----
1921
1922The download section configures the allowed download methods.
1923
Edwin Kempin08b03a22012-09-14 16:32:57 +02001924[[download.command]]download.command::
1925+
1926Commands that should be offered to download changes.
1927+
1928Multiple commands are supported:
1929+
1930* `checkout`
1931+
1932Command to fetch and checkout the patch set.
1933+
1934* `cherry_pick`
1935+
1936Command to fetch the patch set and to cherry-pick it onto the current
1937commit.
1938+
1939* `pull`
1940+
1941Command to pull the patch set.
1942+
1943* `format_patch`
1944+
1945Command to fetch the patch set and to feed it into the `format-patch`
1946command.
1947
1948+
1949If `download.command` is not specified, all download commands are
1950offered.
1951
monica.dionisio3f630442010-06-29 15:42:57 -03001952[[download.scheme]]download.scheme::
1953+
1954Schemes that should be used to download changes.
1955+
1956Multiple schemes are supported:
1957+
1958* `http`
1959+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001960Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001961+
1962* `ssh`
1963+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001964Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001965+
1966* `anon_http`
1967+
1968Anonymous HTTP download is allowed.
1969+
1970* `anon_git`
1971+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001972Anonymous Git download is allowed. This is not default, it is also
1973necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1974variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001975+
1976* `repo_download`
1977+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001978Gerrit advertises patch set downloads with the `repo download`
1979command, assuming that all projects managed by this instance are
1980generally worked on with the repo multi-repository tool. This is
1981not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001982
1983+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001984If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001985downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001986
Edwin Kempin322db672015-07-03 08:50:46 +02001987[[download.checkForHiddenChangeRefs]]download.checkForHiddenChangeRefs::
1988+
1989Whether the download commands should be adapted when the change refs
1990are hidden.
1991+
1992Git has a configuration option to hide refs from the initial
1993advertisement (`uploadpack.hideRefs`). This option can be used to hide
1994the change refs from the client. As consequence fetching changes by
1995change ref does not work anymore. However by setting
1996`uploadpack.allowTipSha1InWant` to `true` fetching changes by commit ID
1997is possible. If `download.checkForHiddenChangeRefs` is set to `true`
1998the git download commands use the commit ID instead of the change ref
1999when a project is configured like this.
2000+
2001Example git configuration on a project:
2002+
2003----
2004[uploadpack]
2005 hideRefs = refs/changes/
2006 hideRefs = refs/cache-automerge/
2007 allowTipSha1InWant = true
2008----
2009+
2010By default `false`.
2011
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002012[[download.archive]]download.archive::
2013+
2014Specifies which archive formats, if any, should be offered on the change
Francois Ferrand1e933882014-09-25 11:19:08 +02002015screen and supported for `git-upload-archive` operation:
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002016+
2017----
2018[download]
2019 archive = tar
2020 archive = tbz2
2021 archive = tgz
2022 archive = txz
Francois Ferrand1e933882014-09-25 11:19:08 +02002023 archive = zip
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002024----
2025
Shawn Pearce6edde312014-03-26 22:00:26 -07002026If `download.archive` is not specified defaults to all archive
2027commands. Set to `off` or empty string to disable.
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002028
Francois Ferrand1e933882014-09-25 11:19:08 +02002029Zip is not supported because it may be interpreted by a Java plugin as a
2030valid JAR file, whose code would have access to cookies on the domain.
2031For this reason `zip` format is always excluded from formats offered
2032through the `Download` drop down or accessible in the REST API.
2033
Stefan Bellere1b2ad32016-11-29 14:54:13 -08002034[[download.maxBundleSize]]download.maxBundleSize::
2035+
2036Specifies the maximum size of a bundle in bytes that can be downloaded.
2037As bundles are kept in memory this setting is to protect the server
2038from a single request consuming too much heap when generating
2039a bundle and thereby impacting other users.
2040+
2041Defaults to 100MB.
2042
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002043[[gc]]
2044=== Section gc
2045
2046This section allows to configure the git garbage collection and schedules it
2047to run periodically. It will be triggered and executed sequentially for all
2048projects.
2049
Christian Halstricke6c68322015-03-11 15:21:42 +01002050[[gc.aggressive]]gc.aggressive::
2051+
2052Determines if scheduled garbage collections and garbage collections triggered
2053through Web-UI should run in aggressive mode or not. Aggressive garbage
2054collections are more expensive but may lead to significantly smaller
2055repositories.
2056+
2057Valid values are "true" and "false," default is "false".
2058
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002059[[gc.startTime]]gc.startTime::
2060+
Edwin Kempind33d95a2018-02-16 11:44:04 +01002061The link:#schedule-configuration-startTime[start time] for running the
2062git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002063
2064[[gc.interval]]gc.interval::
2065+
Edwin Kempind33d95a2018-02-16 11:44:04 +01002066The link:#schedule-configuration-interval[interval] for running the
2067git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002068
Edwin Kempind33d95a2018-02-16 11:44:04 +01002069link:#schedule-configuration-examples[Schedule examples] can be found
2070in the link:#schedule-configuration[Schedule Configuration] section.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002071
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002072[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002073=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002074
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002075[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07002076+
2077Local filesystem directory holding all Git repositories that
2078Gerrit knows about and can process changes for. A project
2079entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02002080the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07002081+
2082If relative, the path is resolved relative to `'$site_path'`.
2083
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002084[[gerrit.allProjects]]gerrit.allProjects::
2085+
2086Name of the permissions-only project defining global server
2087access controls and settings. These are inherited into every
2088other project managed by the running server. The name is
2089relative to `gerrit.basePath`.
2090+
2091Defaults to `All-Projects` if not set.
2092
Edwin Kempin2bf5edd2014-03-25 22:21:23 +01002093[[gerrit.allUsers]]gerrit.allUsers::
2094+
2095Name of the project in which meta data of all users is stored.
2096The name is relative to `gerrit.basePath`.
2097+
2098Defaults to `All-Users` if not set.
2099
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002100[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002101+
2102The default URL for Gerrit to be accessed through.
2103+
Sebastian Schuberth64037132016-07-28 13:40:16 +02002104Typically this would be set to something like "http://review.example.com/"
2105or "http://example.com:8080/gerrit/" so Gerrit can output links that point
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002106back to itself.
2107+
2108Setting this is highly recommended, as its necessary for the upload
2109code invoked by "git push" or "repo upload" to output hyperlinks
2110to the newly uploaded changes.
2111
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002112[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002113+
2114Optional base URL for repositories available over the anonymous git
2115protocol. For example, set this to `git://mirror.example.com/base/`
2116to have Gerrit display patch set download URLs in the UI. Gerrit
2117automatically appends the project name onto the end of the URL.
2118+
2119By default unset, as the git daemon must be configured externally
2120by the system administrator, and might not even be running on the
2121same host as Gerrit.
2122
Dave Borowitza5d3fec2015-07-09 14:24:02 -07002123[[gerrit.docUrl]]gerrit.docUrl::
2124+
2125Optional base URL for documentation, under which one can find
2126"index.html", "rest-api.html", etc. Used as the base for the fixed set
2127of links in the "Documentation" tab. A slash is implicitly appended.
2128(For finer control over the top menu, consider writing a
2129link:dev-plugins.html#top-menu-extensions[plugin].)
2130+
2131If unset or empty, the documentation tab will only be shown if
2132`/Documentation/index.html` can be reached by the browser at app load
2133time.
2134
Dave Borowitza17a9842015-09-15 09:58:17 -04002135[[gerrit.editGpgKeys]]gerrit.editGpgKeys::
2136+
2137If enabled and server-side signed push validation is also
2138link:#receive.enableSignedPush[enabled], enable the
2139link:rest-api-accounts.html#list-gpg-keys[REST API endpoints] and web UI
2140for editing GPG keys. If disabled, GPG keys can only be added by
2141administrators with direct git access to All-Users.
2142+
2143Defaults to true.
2144
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002145[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
2146+
2147Optional command to install the `commit-msg` hook. Typically of the
2148form:
David Pursehouse05588e52015-01-07 14:25:11 +09002149+
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002150----
2151fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
2152----
2153+
2154By default unset; falls back to using scp from the canonical SSH host,
2155or curl from the canonical HTTP URL for the server. Only necessary if a
2156proxy or other server/network configuration prevents clients from
2157fetching from the default location.
2158
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07002159[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
2160+
2161Optional base URL for repositories available over the HTTP
2162protocol. For example, set this to `http://mirror.example.com/base/`
2163to have Gerrit display URLs from this server, rather than itself.
2164+
2165By default unset, as the HTTP daemon must be configured externally
2166by the system administrator, and might not even be running on the
2167same host as Gerrit.
2168
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002169[[gerrit.installDbModule]]gerrit.installDbModule::
2170+
2171Repeatable list of class name of additional Guice modules to load at
2172Gerrit startup as part of the dbInjector and during the init phases.
2173Classes are resolved using the primary Gerrit class loader, hence the
2174class needs to be either declared in Gerrit or an additional JAR
2175located under the `/lib` directory.
2176+
2177By default unset.
2178
Luca Milanesio62cc3502016-11-15 10:22:38 -08002179[[gerrit.installModule]]gerrit.installModule::
2180+
2181Repeatable list of class name of additional Guice modules to load at
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002182Gerrit startup as part of the sysInjector and during the init phases.
Luca Milanesio62cc3502016-11-15 10:22:38 -08002183Classes are resolved using the primary Gerrit class loader, hence the
2184class needs to be either declared in Gerrit or an additional JAR
2185located under the `/lib` directory.
2186+
2187By default unset.
2188+
2189Example:
2190----
2191[gerrit]
2192 installModule = com.googlesource.gerrit.libmodule.MyModule
2193 installModule = com.example.abc.OurSpecialSauceModule
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002194 installDbModule = com.example.def.OurCustomProvider
Luca Milanesio62cc3502016-11-15 10:22:38 -08002195----
2196
Luca Milanesio92254852019-02-14 01:33:14 +00002197[[gerrit.listProjectsFromIndex]]gerrit.listProjectsFromIndex::
2198+
2199Enable rendering of project list from the secondary index instead
2200of purely relying on the in-memory cache.
2201+
2202By default false.
2203+
2204[NOTE]
2205The in-memory cache (set to false) rendering provides an **unlimited list** as a result
2206of the list project API, causing the full list of projects to be
2207returned as a result of the link:rest-api-projects.html[/projects/] REST API
2208or the link:cmd-ls-projects.html[gerrit ls-projects] SSH command.
2209When the rendering from the secondary index (set to true),
2210the **list is limited** by the global capability
2211link:access-control.html#capability_queryLimit[queryLimit]
2212which is defaulted to 500 entries.
2213
Sven Selberge63e92d2019-01-22 18:19:19 +01002214[[gerrit.primaryWeblinkName]]gerrit.primaryWeblinkName::
2215+
2216Name of the link:dev-plugins.html#links-to-external-tools[Weblink] that should
2217be chosen in cases where only one Weblink can be used in the UI, for example in
2218inline links.
2219+
2220By default unset, meaning that the UI is responsible for trying to identify
2221a weblink to be used in these cases, most likely weblinks that links to code
2222browsers with known integrations with Gerrit (like Gitiles and Gitweb).
2223+
2224Example:
2225----
2226[gerrit]
2227 primaryWeblinkName = gitiles
2228----
2229
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002230[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
2231+
David Pursehouse214ab862014-12-01 11:48:26 +09002232URL to direct users to when they need to report a bug.
2233+
2234By default unset, meaning no bug report URL will be displayed. Administrators
2235should set this to the URL of their issue tracker, if necessary.
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002236
David Pursehouse46a2f6c2018-11-30 11:12:19 +09002237[[gerrit.enableReverseDnsLookup]]gerrit.enableReverseDnsLookup::
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002238+
David Pursehouse793525f2018-11-30 11:20:02 +09002239Enable reverse DNS lookup during computing ref log entry for identified user,
2240to record the actual hostname of the user's host in the ref log.
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002241+
David Pursehouse793525f2018-11-30 11:20:02 +09002242Enabling reverse DNS lookup can cause performance issues on git push when
2243the reverse DNS lookup is slow.
2244+
2245Defaults to false, reverse DNS lookup is disabled. The user's IP address
2246will be recorded in the ref log rather than their hostname.
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002247
David Pursehouse962e1182014-12-03 17:17:52 +09002248[[gerrit.secureStoreClass]]gerrit.secureStoreClass::
2249+
2250Use the secure store implementation from a specified class.
2251+
2252If specified, must be the fully qualified class name of a class that implements
2253the `com.google.gerrit.server.securestore.SecureStore` interface, and the jar
2254file containing the class must be placed in the `$site_path/lib` folder.
2255+
2256If not specified, the default no-op implementation is used.
2257
Dariusz Luksza7a046da2014-04-03 17:05:47 +02002258[[gerrit.canLoadInIFrame]]gerrit.canLoadInIFrame::
2259+
2260For security reasons Gerrit will always jump out of iframe.
2261Setting this option to true will prevent this behavior.
2262+
2263By default false.
2264
Marcin Czech559ea2b2020-06-15 17:36:18 +02002265[[gerrit.xframeOption]]gerrit.xframeOption::
2266+
2267Add link:https://tools.ietf.org/html/rfc7034[`X-Frame-Options`] header to all HTTP
2268responses. The `X-Frame-Options` HTTP response header can be used to indicate
2269whether or not a browser should be allowed to render a page in a
2270`<frame>`, `<iframe>`, `<embed>` or `<object>`.
2271+
2272Available values:
2273+
22741. ALLOW - The page can be displayed in a frame.
22752. SAMEORIGIN - The page can only be displayed in a frame on the same origin as the page itself.
2276+
2277If link:#gerrit.canLoadInIFrame is set to false this option is ignored and the
2278`X-Frame-Options` header is always set to `DENY`.
2279Setting this option to `ALLOW` will cause the `X-Frame-Options` header to be omitted
2280the the page can be displayed in a frame.
2281+
2282By default SAMEORIGIN.
2283
Wyatt Allen414659c2017-03-15 09:55:31 -07002284[[gerrit.cdnPath]]gerrit.cdnPath::
2285+
2286Path prefix for PolyGerrit's static resources if using a CDN.
2287
Viktar Donich65ae7482017-10-20 14:13:31 -07002288[[gerrit.faviconPath]]gerrit.faviconPath::
2289+
2290Path for PolyGerrit's favicon after link:#gerrit.canonicalWebUrl[default URL],
2291including icon name and extension (.ico should be used).
2292
Fabio Ponciroli829be0d2020-05-06 13:59:20 +02002293[[gerrit.instanceId]]gerrit.instanceId::
2294+
2295Optional identifier for this Gerrit instance.
2296Used to identify a specific instance within a group of Gerrit instances with the
2297same `serverId` (i.e.: a Gerrit cluster).
2298Unlike `instanceName` this value is not available in the email templates.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002299
2300[[gerrit.instanceName]]gerrit.instanceName::
2301+
2302Short identifier for this Gerrit instance.
2303A good name should be short but precise enough so that users can identify the instance among others.
2304+
2305Defaults to the full hostname of the Gerrit server.
2306
Luca Milanesio1a3d84f2020-05-04 17:14:12 +01002307[[gerrit.experimentalRollingUpgrade]]gerrit.experimentalRollingUpgrade::
2308+
2309Enable Gerrit rolling upgrade to the next version.
2310For example if Gerrit v3.1 is version N (All-Projects:refs/meta/version=181)
2311then its next version N+1 is v3.2 (All-Projects:refs/meta/version=183).
2312Allow Gerrit to start even if the underlying schema version has been bumped to
2313the next Gerrit version.
2314+
2315Set to true if Gerrit is installed in
2316[high-availability configuration](https://gerrit.googlesource.com/plugins/high-availability/+/refs/heads/master/README.md)
2317during the rolling upgrade to the next version.
2318+
2319By default false.
2320+
2321The rolling upgrade process, at high level, assumes that Gerrit is installed
2322on two or more nodes sharing the repositories over NFS. The upgrade is composed
2323of the following steps:
2324+
23251. Set gerrit.experimentalRollingUpgrade to true on all Gerrit masters
23262. Set the first master unhealthy
23273. Shutdown the first master and [upgrade](install.html#init) to the next version
23284. Startup the first master, wait for the online reindex to complete
23295. Verify the the first master upgrade is successful and online reindex is complete
23306. Set the first master healthy
23317. Repeat steps 2. to 6. for all the other Gerrit nodes
2332+
2333[WARNING]
2334Rolling upgrade may or may not be possible depending on the changes introduced
2335by the target version of the upgrade. Refer to the release notes and check whether
2336the rolling upgrade is possible or not and the associated constraints.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002337
Sven Selberg327c2e42018-04-10 11:42:19 +02002338[[gerrit.serverId]]gerrit.serverId::
2339+
2340Used by NoteDb to, amongst other things, identify author identities from
2341per-server specific account IDs.
2342+
2343If this value is not set on startup it is automatically set to a random UUID.
2344+
2345[NOTE]
2346If this value doesn't match the serverId used when creating an already existing
2347NoteDb, Gerrit will not be able to use that instance of NoteDb. The serverId
2348used to create the NoteDb will show in the resulting exception message in case
2349the value differs.
2350
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002351[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002352=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002353
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002354Gerrit can forward requests to either an internally managed gitweb
2355(which allows Gerrit to enforce some access controls), or to an
2356externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002357See also link:config-gitweb.html[Gitweb Integration].
2358
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002359[[gitweb.cgi]]gitweb.cgi::
2360+
2361Path to the locally installed `gitweb.cgi` executable. This CGI will
2362be called by Gerrit Code Review when the URL `/gitweb` is accessed.
2363Project level access controls are enforced prior to calling the CGI.
2364+
David Pursehousea89dc982016-09-15 09:35:44 +02002365Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if `gitweb.url` is not set.
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002366
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002367[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002368+
2369Optional URL of an affiliated gitweb service. Defines the
2370web location where a `gitweb.cgi` is installed to browse
David Pursehousea89dc982016-09-15 09:35:44 +02002371`gerrit.basePath` and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002372+
2373Gerrit appends any necessary query arguments onto the end of this URL.
David Pursehousea89dc982016-09-15 09:35:44 +02002374For example, `?p=$project.git;h=$commit`.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002375
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002376[[gitweb.type]]gitweb.type::
2377+
2378Optional type of affiliated gitweb service. This allows using
David Pursehousea66f7ff2016-09-05 21:11:10 +09002379alternatives to gitweb, such as cgit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002380+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07002381Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
David Pursehousea66f7ff2016-09-05 21:11:10 +09002382+
2383If not set, or set to `disabled`, there is no gitweb hyperlinking
2384support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002385
Edwin Kempind86909c2012-03-26 10:36:29 +02002386[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002387+
2388Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002389at a specific commit when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002390+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002391Valid replacements are `${project}` for the project name in Gerrit
2392and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002393
Edwin Kempind86909c2012-03-26 10:36:29 +02002394[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002395+
2396Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002397at a specific project when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002398+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002399Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002400
Edwin Kempind86909c2012-03-26 10:36:29 +02002401[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002402+
2403Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002404at a specific branch when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002405+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002406Valid replacements are `${project}` for the project name in Gerrit
2407and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002408
Paladox none5759f2c2017-10-27 18:13:54 +00002409[[gitweb.tag]]gitweb.tag::
2410+
2411Optional pattern to use for constructing the gitweb URL when pointing
2412at a specific tag when `gitweb.type` is set to `custom`.
2413+
2414Valid replacements are `${project}` for the project name in Gerrit
2415and `${tag}` for the name of the tag.
2416
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002417[[gitweb.roottree]]gitweb.roottree::
2418+
2419Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002420at the contents of the root tree in a specific commit when `gitweb.type`
2421is set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002422+
2423Valid replacements are `${project}` for the project name in Gerrit
2424and `${commit}` for the SHA1 hash for the commit.
2425
2426[[gitweb.file]]gitweb.file::
2427+
2428Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002429at the contents of a file in a specific commit when `gitweb.type` is
2430set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002431+
2432Valid replacements are `${project}` for the project name in Gerrit,
2433`${file}` for the file name and `${commit}` for the SHA1 hash for
2434the commit.
2435
Edwin Kempin64011562012-03-26 10:50:12 +02002436[[gitweb.filehistory]]gitweb.filehistory::
2437+
2438Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002439at the history of a file in a specific branch when when `gitweb.type`
2440is set to `custom`.
Edwin Kempin64011562012-03-26 10:50:12 +02002441+
2442Valid replacements are `${project}` for the project name in Gerrit,
2443`${file}` for the file name and `${branch}` for the name of the
2444branch.
2445
Gustaf Lundha07d2e72011-10-27 15:26:35 -07002446[[gitweb.linkname]]gitweb.linkname::
2447+
2448Optional setting for modifying the link name presented to the user
2449in the Gerrit web-UI.
2450+
David Pursehousea89dc982016-09-15 09:35:44 +02002451The default linkname for custom type is `gitweb`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002452
Adrian Goerlerf2007072011-11-10 08:39:55 +01002453[[gitweb.pathSeparator]]gitweb.pathSeparator::
2454+
2455Optional character to substitute the standard path separator (slash) in
2456project names and branch names.
2457+
2458By default, Gerrit will use hexadecimal encoding for slashes in project and
2459branch names. Some web servers, such as Tomcat, reject this hexadecimal
2460encoding in the URL.
2461+
Marian Harbach34253372019-12-10 18:01:31 +01002462Some alternative gitweb services, such as link:http://gitblit.com[Gitblit,role=external,window=_blank],
Adrian Goerlerf2007072011-11-10 08:39:55 +01002463allow using an alternative path separator character. In Gitblit, this can be
Marian Harbach34253372019-12-10 18:01:31 +01002464configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter,role=external,window=_blank].
Adrian Goerlerf2007072011-11-10 08:39:55 +01002465In Gerrit, the alternative path separator can be configured correspondingly
David Pursehousea89dc982016-09-15 09:35:44 +02002466using the property `gitweb.pathSeparator`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002467+
David Pursehousea89dc982016-09-15 09:35:44 +02002468Valid values are the characters `*`, `(` and `)`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002469
David Pursehouse5d592e82016-06-09 05:12:26 +00002470[[gitweb.urlEncode]]gitweb.urlEncode::
Luca Milanesio25312032013-10-11 11:34:39 +01002471+
2472Whether or not Gerrit should encode the generated viewer URL.
2473+
2474Gerrit composes the viewer URL using information about the project, branch, file
2475or commit of the target object to be displayed. Typically viewers such as CGit
David Pursehousea89dc982016-09-15 09:35:44 +02002476and gitweb do need those parts to be encoded, including the `/` in project's name,
Luca Milanesio25312032013-10-11 11:34:39 +01002477for being correctly parsed.
2478However other viewers could instead require an unencoded URL (e.g. GitHub web
David Pursehousea89dc982016-09-15 09:35:44 +02002479based viewer).
Luca Milanesio25312032013-10-11 11:34:39 +01002480+
David Pursehousea89dc982016-09-15 09:35:44 +02002481Valid values are `true` and `false`. The default is `true`.
Luca Milanesio25312032013-10-11 11:34:39 +01002482
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002483[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002484=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01002485
2486[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
2487+
2488Controls whether newly created groups should be by default visible to
2489all registered users.
2490+
2491By default, false.
2492
Edwin Kempinf3eddd52017-01-20 14:05:47 +01002493[[groups.uuid.name]]groups.<uuid>.name::
2494+
2495Display name for group with the given UUID.
2496+
2497This option is only supported for system groups (scheme 'global').
2498+
2499E.g. this parameter can be used to configure another name for the
2500`Anonymous Users` group:
2501+
2502----
2503[groups "global:Anonymous-Users"]
2504 name = All Users
2505----
2506+
2507When setting this parameter it should be verified that there is no
2508existing group with the same name (case-insensitive). Configuring an
2509ambiguous name makes Gerrit fail on startup. Once set Gerrit ensures
2510that it is not possible to create a group with this name. Gerrit also
2511keeps the default name reserved so that it cannot be used for new
2512groups either. This means there is no danger of ambiguous group names
2513when this parameter is removed and the system group uses the default
2514name again.
2515
Prakash Aswala6d49fb2020-02-27 15:09:30 +05302516[[has-operand-alias]]
2517=== Section has operand alias
2518
2519'has' operand aliasing allows global aliases to be defined for query
2520'has' operands. Currently only change queries are supported. The alias
2521name is the git config key name, and the 'has' operand being aliased
2522is the git config value.
2523
2524For example:
2525
2526----
2527[has-operand-alias "change"]
2528 oldtopic = topic
2529----
2530
2531This section is particularly useful to alias 'has' operands (which may
2532be long and clunky as they include a plugin name in them) to shorter
2533operands without the plugin name. Admins should take care to choose
2534shorter operands that are unique and unlikely to conflict in the future.
2535
2536Aliases are resolved dynamically at invocation time to the currently
2537loaded version of plugins. If a referenced plugin is not loaded, or
2538does not define the command, "unsupported operand" is returned to the
2539user.
2540
2541Aliases will override existing 'has' operands. In case of multiple
2542aliases with same name, the last one defined will be used.
2543
2544When the target of an alias does not exist, the 'has' operand with the
2545name of the alias will be used (if present). This enables an admin to
2546configure the system to override a core 'has' operand with an operand
2547provided by a plugin when present and otherwise fall back to the 'has'
2548operand provided by core.
2549
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002550[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002551=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002552
2553[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002554+
2555URL of the proxy server when making outgoing HTTP
2556connections for OpenID login transactions. Syntax
2557should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002558
2559[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002560+
2561Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002562This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002563appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002564
2565[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002566+
2567Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002568This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002569appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002570
Hugo Arès88e33ac2014-03-03 13:52:45 -05002571[[http.addUserAsRequestAttribute]]http.addUserAsRequestAttribute::
2572+
2573If true, 'User' attribute will be added to the request attributes so it
2574can be accessed outside the request scope (will be set to username or id
2575if username not configured).
2576+
2577This attribute can be used by the servlet container to log user in the
2578http access log.
2579+
2580When running the embedded servlet container, this attribute is used to
2581print user in the httpd_log.
2582+
2583* `%{User}r`
2584+
2585Pattern to print user in Tomcat AccessLog.
2586
2587+
2588Default value is true.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002589
Gustaf Lundhe45c3332018-05-02 10:52:11 +02002590[[http.addUserAsResponseHeader]]http.addUserAsResponseHeader::
2591+
2592If true, the header 'User' will be added to the list of response headers so it
2593can be accessed from a reverse proxy for logging purposes.
2594
2595+
2596Default value is false.
2597
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002598[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002599=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002600
2601The httpd section configures the embedded servlet container.
2602
2603[[httpd.listenUrl]]httpd.listenUrl::
2604+
Gert van Dijk70e26612019-09-29 16:20:25 +02002605Configuration for the listening sockets of the internal HTTP daemon.
2606Each entry of `listenUrl` combines the following options for a
2607listening socket: protocol, network address, port and context path.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002608+
Gert van Dijk70e26612019-09-29 16:20:25 +02002609_Protocol_ can be either `http://`, `https://`, `proxy-http://` or
2610`proxy-https://`. The latter two are special forms of `http://` with
2611awareness of a reverse proxy (see below). _Network address_ selects
2612the interface and/or scope of the listening socket. For notes
2613examples, see below. _Port_ is the TCP port number and is optional
2614(default value depends on the protocol). _Context path_ is the
2615optional "base URI" for the Gerrit Code Review as application to
2616serve on.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002617+
Gert van Dijk70e26612019-09-29 16:20:25 +02002618**Protocol** schemes:
2619+
2620* `http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002621+
2622Plain-text HTTP protocol. If port is not supplied, defaults to 80,
2623the standard HTTP port.
2624+
Gert van Dijk70e26612019-09-29 16:20:25 +02002625* `https://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002626+
2627SSL encrypted HTTP protocol. If port is not supplied, defaults to
2628443, the standard HTTPS port.
2629+
Gert van Dijk70e26612019-09-29 16:20:25 +02002630For configuration of the certificate and private key, see
2631<<httpd.sslKeyStore,httpd.sslKeyStore>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002632+
Gert van Dijk70e26612019-09-29 16:20:25 +02002633[NOTE]
2634SSL/TLS configuration capabilities of Gerrit internal HTTP daemon
2635are very limited. Externally facing production sites are strongly
2636encouraged to use a reverse proxy configuration to handle SSL/TLS
2637and use a `proxy-https://` scheme here (below) for security and
2638performance reasons.
2639+
2640* `proxy-http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002641+
2642Plain-text HTTP relayed from a reverse proxy. If port is not
2643supplied, defaults to 8080.
2644+
Gert van Dijk70e26612019-09-29 16:20:25 +02002645Like `http://`, but additional header parsing features are
2646enabled to honor `X-Forwarded-For`, `X-Forwarded-Host` and
2647`X-Forwarded-Server`. These headers are typically set by Apache's
Marian Harbach34253372019-12-10 18:01:31 +01002648link: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 -08002649+
Gert van Dijk70e26612019-09-29 16:20:25 +02002650[NOTE]
2651--
2652For secruity reasons, make sure to only allow connections from a
2653trusted reverse proxy in your network, as clients could otherwise
2654easily spoof these headers and thus spoof their originating IP
2655address effectively. If the reverse proxy is running on the same
2656machine as Gerrit daemon, the use of a _loopback_ network address
2657to bind to (see below) is strongly recommended to mitigate this.
2658
2659If not using Apache's mod_proxy, validate that your reverse proxy
2660sets these headers on all requests. If not, either configure it to
2661sanitize them from the origin, or use the `http://` scheme instead.
2662--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002663+
Gert van Dijk70e26612019-09-29 16:20:25 +02002664* `proxy-https://`
2665+
2666Plain-text HTTP relayed from a reverse proxy that has already
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002667handled the SSL encryption/decryption. If port is not supplied,
2668defaults to 8080.
2669+
Gert van Dijk70e26612019-09-29 16:20:25 +02002670Behaves exactly like `proxy-http://`, but also sets the scheme to
2671assume `https://` is the proper URL back to the server.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002672
2673+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002674--
Gert van Dijk70e26612019-09-29 16:20:25 +02002675**Network address** forms:
2676
2677* Loopback (localhost): `127.0.0.1` (IPv4) or `[::1]` (IPv6).
2678* All (unspecified): `0.0.0.0` (IPv4), `[::]` (IPv6) or `*`
2679 (IPv4 and IPv6)
2680* Interface IP address, e.g. `1.2.3.4` (IPv4) or
2681 `[2001:db8::a00:20ff:fea7:ccea]` (IPv6)
2682* Hostname, resolved at startup time to an address.
2683
2684**Context path** is the local part of the URL to be used to access
2685Gerrit on ('base URL'). E.g. `/gerrit/` to serve Gerrit on that URI
2686as base. If set, consider to align this with the
2687<<gerrit.canonicalWebUrl,gerrit.canonicalWebUrl>> setting. Correct
2688settings may depend on the reverse proxy configuration as well. By
2689default, this is `/` so that Gerrit serves requests on the root.
2690
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002691If multiple values are supplied, the daemon will listen on all
2692of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002693
Gert van Dijk70e26612019-09-29 16:20:25 +02002694Examples:
2695
2696----
2697[httpd]
2698 listenUrl = proxy-https://127.0.0.1:9999/gerrit/
2699[gerrit]
2700 # Reverse proxy is configured to serve with SSL/TLS on
2701 # example.com and to relay requests on /gerrit/ onto
2702 # http://127.0.0.1:9999/gerrit/
2703 canonicalWebUrl = https://example.com/gerrit/
2704----
2705
2706----
2707[httpd]
2708 # Listen on specific external interface with plaintext
2709 # HTTP on IPv6.
2710 listenUrl = http://[2001:db8::a00:20ff:fea7:ccea]
2711
2712 # Also listen on specific internal interface for use with
2713 # reverse proxy run on another host.
2714 listenUrl = proxy-https://192.168.100.123
2715----
2716
2717See also the page on link:config-reverseproxy.html[reverse proxy]
2718configuration.
2719
2720By default, `\http://*:8080`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002721--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002722
2723[[httpd.reuseAddress]]httpd.reuseAddress::
2724+
2725If true, permits the daemon to bind to the port even if the port
2726is already in use. If false, the daemon ensures the port is not
2727in use before starting. Busy sites may need to set this to true
2728to permit fast restarts.
2729+
2730By default, true.
2731
Luca Milanesio4e2bb452018-03-21 09:07:24 +00002732[[httpd.gracefulStopTimeout]]httpd.gracefulStopTimeout::
2733+
2734Set a graceful stop time. If set, the daemon ensures that all incoming
2735calls are preserved for a maximum period of time, before starting
2736the graceful shutdown process. Sites behind a workload balancer such as
2737HAProxy would need this to be set for avoiding serving errors during
2738rolling restarts.
2739+
2740Values should use common unit suffixes to express their setting:
2741+
2742* s, sec, second, seconds
2743* m, min, minute, minutes
2744+
2745By default, 0 seconds (immediate shutdown).
2746
Thomas Meyeraa93fdf2016-10-23 10:53:48 +02002747[[httpd.inheritChannel]]httpd.inheritChannel::
2748+
2749If true, permits the daemon to inherit its server socket channel
2750from fd0/1(stdin/stdout). When set to true, the server can be socket
2751activated via systemd or xinetd.
2752+
2753By default, false.
2754
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002755[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
2756+
2757Size, in bytes, of the buffer used to parse the HTTP headers of an
2758incoming HTTP request. The entire request headers, including any
2759cookies sent by the browser, must fit within this buffer, otherwise
2760the server aborts with the response '413 Request Entity Too Large'.
2761+
2762One buffer of this size is allocated per active connection.
2763Allocating a buffer that is too large wastes memory that cannot be
2764reclaimed, allocating a buffer that is too small may cause unexpected
2765errors caused by very long Referer URLs or large cookie values.
2766+
2767By default, 16384 (16 K), which is sufficient for most OpenID and
2768other web-based single-sign-on integrations.
2769
Chulho Yangb72ff8f2013-07-04 02:35:53 -04002770[[httpd.sslCrl]]httpd.sslCrl::
2771+
2772Path of the certificate revocation list file in PEM format. This
2773crl file is optional, and available for CLIENT_SSL_CERT_LDAP
2774authentication.
2775+
2776To create and view a crl using openssl:
2777+
2778----
2779openssl ca -gencrl -out crl.pem
2780openssl crl -in crl.pem -text
2781----
2782+
2783If not absolute, the path is resolved relative to `$site_path`.
2784+
2785By default, `$site_path/etc/crl.pem`.
2786
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002787[[httpd.sslKeyStore]]httpd.sslKeyStore::
2788+
2789Path of the Java keystore containing the server's SSL certificate
2790and private key. This keystore is required for `https://` in URL.
2791+
2792To create a self-signed certificate for simple internal usage:
2793+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002794----
2795keytool -keystore keystore -alias jetty -genkey -keyalg RSA
2796chmod 600 keystore
2797----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002798+
2799If not absolute, the path is resolved relative to `$site_path`.
2800+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002801By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002802
2803[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
2804+
2805Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09002806Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002807doesn't want to enable one.
2808+
2809If set to the empty string the embedded server will prompt for the
2810password during startup.
2811+
2812By default, `gerrit`.
2813
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002814[[httpd.requestLog]]httpd.requestLog::
2815+
2816Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
2817If enabled, an NCSA combined log format request log file is written
Matthias Sohn450bc202020-08-20 14:40:32 +02002818out by the internal HTTP daemon. The httpd log format is documented
2819link:logs.html#_httpd_log[here].
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002820+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01002821`log4j.appender` with the name `httpd_log` can be configured to overwrite
2822programmatic configuration.
2823+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002824By default, true if httpd.listenUrl uses http:// or https://,
2825and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
2826
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002827[[httpd.acceptorThreads]]httpd.acceptorThreads::
2828+
2829Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09002830connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002831+
2832By default, 2, which should be suitable for most high-traffic sites.
2833
2834[[httpd.minThreads]]httpd.minThreads::
2835+
2836Minimum number of spare threads to keep in the worker thread pool.
2837This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09002838multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002839+
2840By default, 5, suitable for most lower-volume traffic sites.
2841
2842[[httpd.maxThreads]]httpd.maxThreads::
2843+
2844Maximum number of threads to permit in the worker thread pool.
2845+
2846By default 25, suitable for most lower-volume traffic sites.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02002847+
2848[NOTE]
2849Unless SSH daemon is disabled, see <<sshd.listenAddress, sshd.listenAddress>>,
2850the max number of concurrent Git requests over HTTP and SSH together is
2851defined by the <<sshd.threads, sshd.threads>> and
2852<<sshd.batchThreads, sshd.batchThreads>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002853
2854[[httpd.maxQueued]]httpd.maxQueued::
2855+
2856Maximum number of client connections which can enter the worker
2857thread pool waiting for a worker thread to become available.
David Ostrovsky14fe8bc2014-03-26 06:03:44 -070028580 sets the queue size to the Integer.MAX_VALUE.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002859+
Luca Milanesio0ae62fe2015-09-04 07:56:00 -07002860By default 200.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002861
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002862[[httpd.maxWait]]httpd.maxWait::
2863+
David Pursehouse221d4f62012-06-08 17:38:08 +09002864Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002865thread to handle a project clone, fetch or push request over the
2866smart HTTP transport.
2867+
2868Values should use common unit suffixes to express their setting:
2869+
2870* s, sec, second, seconds
2871* m, min, minute, minutes
2872* h, hr, hour, hours
2873* d, day, days
2874* w, week, weeks (`1 week` is treated as `7 days`)
2875* mon, month, months (`1 month` is treated as `30 days`)
2876* y, year, years (`1 year` is treated as `365 days`)
2877
2878+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002879--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002880If a unit suffix is not specified, `minutes` is assumed. If 0
2881is supplied, the maximum age is infinite and connections will not
2882abort until the client disconnects.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002883
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002884By default, 5 minutes.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002885--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002886
Luca Milanesioce7b7452013-06-18 11:40:49 +01002887[[httpd.filterClass]]httpd.filterClass::
2888+
2889Class that implements the javax.servlet.Filter interface
2890for filtering any HTTP related traffic going through the Gerrit
2891HTTP protocol.
2892Class is loaded and configured in the Gerrit Jetty container
2893and run in front of all Gerrit URL handlers, allowing the filter
2894to inspect, modify, allow or reject each request.
2895It needs to be provided as JAR library
2896under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
2897loader and cannot be dynamically loaded by a plugin.
2898+
2899Failing to load the Filter class would result in a Gerrit start-up
2900failure, as this class is supposed to provide mandatory filtering
2901in front of Gerrit HTTP protocol.
2902+
David Pursehouse42f42042013-08-01 14:02:25 +09002903Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01002904of an Apache HTTP proxy layer as security enforcement on top of Gerrit
2905by returning a trusted username as HTTP Header.
2906+
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002907Allow multiple values to install multiple servlet filters.
2908+
Luca Milanesioce7b7452013-06-18 11:40:49 +01002909Example of using a security library secure.jar under $GERRIT_SITE/lib
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002910that provides a org.anyorg.MySecureHeaderFilter Servlet Filter that enforces
2911a trusted username in the `TRUSTED_USER` HTTP Header and
2912org.anyorg.MySecureIPFilter that performs source IP security filtering:
Dyrone Teng14fc0832019-09-27 16:59:02 +08002913+
Luca Milanesioce7b7452013-06-18 11:40:49 +01002914----
2915[auth]
2916 type = HTTP
2917 httpHeader = TRUSTED_USER
2918
Dariusz Lukszaaac01132015-02-11 12:13:07 +01002919[httpd]
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002920 filterClass = org.anyorg.MySecureHeaderFilter
2921 filterClass = org.anyorg.MySecureIPFilter
Luca Milanesioce7b7452013-06-18 11:40:49 +01002922----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002923
Teng Longc192ca92019-09-23 11:22:03 +08002924[[filterClass.className.initParam]]filterClass.<className>.initParam::
2925+
2926Gerrit supports customized pluggable HTTP filters as `filterClass`. This
2927option allows to pass extra initialization parameters to the filter. It
2928allows for multiple key/value pairs to be passed in this pattern:
2929+
2930----
2931initParam = <key>=<value>
2932----
2933For a comprehensive example:
2934+
2935----
2936[httpd]
2937 filterClass = org.anyorg.AFilter
2938 filterClass = org.anyorg.BFilter
2939[filterClass "org.anyorg.AFilter"]
2940 key1 = value1
2941 key2 = value2
2942[filterClass "org.anyorg.BFilter"]
2943 key3 = value3
2944----
2945
Luca Milanesiodca95d52017-05-09 21:22:21 +01002946[[httpd.idleTimeout]]httpd.idleTimeout::
2947+
2948Maximum idle time for a connection, which roughly translates to the
2949TCP socket `SO_TIMEOUT`.
2950+
Luca Milanesiodca95d52017-05-09 21:22:21 +01002951This value is interpreted as the maximum time between some progress
2952being made on the connection. So if a single byte is read or written,
2953then the timeout is reset.
2954+
David Pursehouse9f0e5bc2017-06-30 16:16:53 +09002955The max idle time is applied:
2956+
2957* When waiting for a new message to be received on a connection
2958* When waiting for a new message to be sent on a connection
2959
2960+
Luca Milanesiodca95d52017-05-09 21:22:21 +01002961By default, 30 seconds.
2962
Juan Hernandezec512562013-08-06 16:30:50 +02002963[[httpd.robotsFile]]httpd.robotsFile::
2964+
2965Location of an external robots.txt file to be used instead of the one
2966bundled with the .war of the application.
2967+
2968If not absolute, the path is resolved relative to `$site_path`.
2969+
2970If the file doesn't exist or can't be read the default robots.txt file
2971bundled with the .war will be used instead.
2972
Dariusz Luksza011cfed2014-04-03 10:23:35 +02002973[[httpd.registerMBeans]]httpd.registerMBeans::
2974+
2975Enable (or disable) registration of Jetty MBeans for Java JMX.
2976+
2977By default, false.
2978
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002979[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002980=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09002981
2982The index section configures the secondary index.
2983
David Pursehouse3fc5ee32014-03-17 18:35:32 +09002984Note that after enabling the secondary index, the index must be built
2985using the link:pgm-reindex.html[reindex program] before restarting the
2986Gerrit server.
2987
David Pursehouse6d458432013-08-23 16:17:18 +09002988[[index.type]]index.type::
2989+
2990Type of secondary indexing employed by Gerrit. The supported
2991values are:
2992+
2993* `LUCENE`
2994+
2995A link:http://lucene.apache.org/[Lucene] index is used.
2996+
David Pursehouse8e72f532014-06-24 11:01:28 +09002997+
Dariusz Lukszaea529882017-04-25 15:11:31 +02002998* `ELASTICSEARCH` look into link:#elasticsearch[Elasticsearch section]
David Pursehouse8e72f532014-06-24 11:01:28 +09002999+
Marian Harbach34253372019-12-10 18:01:31 +01003000An link:https://www.elastic.co/products/elasticsearch[Elasticsearch,role=external,window=_blank] index is
David Pursehouse2e79e5b2018-04-20 10:23:29 +02003001used. Refer to the link:#elasticsearch[Elasticsearch section] for further
3002configuration details.
David Pursehouse6d458432013-08-23 16:17:18 +09003003
3004+
Shawn Pearced4ae3a162013-11-24 17:00:31 -08003005By default, `LUCENE`.
David Pursehouse6d458432013-08-23 16:17:18 +09003006
David Pursehouse904db302014-03-17 18:55:38 +09003007[[index.threads]]index.threads::
3008+
Hugo Arèsfab06702016-06-10 12:49:52 -04003009Number of threads to use for indexing in normal interactive operations. Setting
3010it to 0 disables the dedicated thread pool and indexing will be done in the same
3011thread as the operation.
David Pursehouse904db302014-03-17 18:55:38 +09003012+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02003013If not set or set to a zero, defaults to the number of logical CPUs as returned
3014by the JVM. If set to a negative value, defaults to a direct executor.
David Pursehouse00c82142014-01-22 17:41:09 +09003015
Dave Borowitz787af5f2014-10-22 16:26:00 -07003016[[index.batchThreads]]index.batchThreads::
3017+
3018Number of threads to use for indexing in background operations, such as
Christian Aistleitner6e3c1a12020-06-14 20:57:00 +02003019online schema upgrades, and also for offline reindexing.
Dave Borowitz787af5f2014-10-22 16:26:00 -07003020+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02003021If not set or set to a zero, defaults to the number of logical CPUs as returned
3022by the JVM. If set to a negative value, defaults to a direct executor.
Dave Borowitz787af5f2014-10-22 16:26:00 -07003023
Dave Borowitzd80b9342015-03-25 10:32:21 -07003024[[index.onlineUpgrade]]index.onlineUpgrade::
3025+
3026Whether to upgrade to new index schema versions while the server is
3027running. This is recommended as it prevents additional downtime during
3028Gerrit version upgrades (avoiding the need for an offline reindex step
3029using Reindex), but can add additional server load during the upgrade.
3030+
3031If set to false, there is no way to upgrade the index schema to take
3032advantage of new search features without restarting the server.
3033+
3034Defaults to true.
3035
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07003036[[index.maxLimit]]index.maxLimit::
3037+
3038Maximum limit to allow for search queries. Requesting results above this
3039limit will truncate the list (but will still set `_more_changes` on
3040result lists). Set to 0 for no limit.
3041+
David Pursehouse7c1f4a42018-03-15 17:03:40 +09003042When `index.type` is set to `ELASTICSEARCH`, this value should not exceed
3043the `index.max_result_window` value configured on the Elasticsearch
David Pursehouse52c2b4a2018-04-10 23:38:57 +09003044server. If a value is not configured during site initialization, defaults to
304510000, which is the default value of `index.max_result_window` in Elasticsearch.
David Pursehouse7c1f4a42018-03-15 17:03:40 +09003046+
David Pursehouse52c2b4a2018-04-10 23:38:57 +09003047When `index.type` is set to `LUCENE`, defaults to no limit.
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07003048
Dave Borowitzf56d3652015-04-22 17:35:34 -07003049[[index.maxPages]]index.maxPages::
3050+
3051Maximum number of pages of search results to allow, as index
3052implementations may have to scan through large numbers of skipped
3053results when searching with an offset. Requesting results starting past
3054this threshold times the requested limit will result in an error. Set to
30550 for no limit.
3056+
3057Defaults to no limit.
3058
Dave Borowitzd034ca82015-10-15 11:20:30 -04003059[[index.maxTerms]]index.maxTerms::
3060+
3061Maximum number of leaf terms to allow in a query. Too-large queries may
3062perform poorly, so setting this option causes query parsing to fail fast
Dave Borowitzada289c2018-12-18 13:24:14 -08003063before attempting to send them to the secondary index.
Dave Borowitzd034ca82015-10-15 11:20:30 -04003064+
Marco Miller6da22822016-01-29 12:31:38 -05003065When the index type is `LUCENE`, also sets the maximum number of clauses
3066permitted per BooleanQuery. This is so that all enforced query limits
3067are the same.
3068+
3069Defaults to 1024.
Dave Borowitzd034ca82015-10-15 11:20:30 -04003070
Dave Borowitz3747f0f2017-06-23 14:29:31 -04003071[[index.autoReindexIfStale]]index.autoReindexIfStale::
3072+
3073Whether to automatically check if a document became stale in the index
3074immediately after indexing it. If false, there is a race condition during two
3075simultaneous writes that may cause one of the writes to not be reflected in the
3076index. The check to avoid this does consume some resources.
3077+
Dave Borowitzb7da0762018-03-19 09:08:45 -04003078Defaults to false.
Dave Borowitz3747f0f2017-06-23 14:29:31 -04003079
Edwin Kempin0f0de862018-02-08 16:24:11 +01003080[[index.scheduledIndexer]]
3081==== Subsection index.scheduledIndexer
3082
3083This section configures periodic indexing. Periodic indexing is
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003084intended to run only on replicas and only updates the group index.
3085Replication to replicas happens on Git level so that Gerrit is not aware
3086of incoming replication events. But replicas need an updated group index
Edwin Kempin0f0de862018-02-08 16:24:11 +01003087to resolve memberships of users for ACL validation. To keep the group
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003088index in replicas up-to-date the Gerrit replica periodically scans the
Edwin Kempin0f0de862018-02-08 16:24:11 +01003089group refs in the All-Users repository to reindex groups if they are
3090stale.
3091
3092The scheduled reindexer is not able to detect group deletions that
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003093happened while the replica was offline, but since group deletions are not
Edwin Kempin0f0de862018-02-08 16:24:11 +01003094supported this should never happen. If nevertheless groups refs were
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003095deleted while a replica was offline a full offline link:pgm-reindex.html[
Edwin Kempin0f0de862018-02-08 16:24:11 +01003096reindex] must be performed.
3097
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003098This section is only used if Gerrit runs in replica mode, otherwise it is
Edwin Kempin0f0de862018-02-08 16:24:11 +01003099ignored.
3100
Edwin Kempina32d4432018-02-16 17:18:31 +01003101[[index.scheduledIndexer.runOnStartup]]index.scheduledIndexer.runOnStartup::
3102+
3103Whether the scheduled indexer should run once immediately on startup.
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003104If set to `true` the replica startup is blocked until all stale groups
3105were reindexed. Enabling this allows to prevent that replicas that were
Edwin Kempina32d4432018-02-16 17:18:31 +01003106offline for a longer period of time run with outdated group information
3107until the first scheduled indexing is done.
3108+
3109Defaults to `true`.
3110
Edwin Kempin0f0de862018-02-08 16:24:11 +01003111[[index.scheduledIndexer.enabled]]index.scheduledIndexer.enabled::
3112+
3113Whether the scheduled indexer is enabled. If the scheduled indexer is
3114disabled you must implement other means to keep the group index for the
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003115replica up-to-date (e.g. by using ElasticSearch for the indexes).
Edwin Kempin0f0de862018-02-08 16:24:11 +01003116+
3117Defaults to `true`.
3118
3119[[index.scheduledIndexer.startTime]]index.scheduledIndexer.startTime::
3120+
3121The link:#schedule-configuration-startTime[start time] for running
3122the scheduled indexer.
3123+
3124Defaults to `00:00`.
3125
3126[[index.scheduledIndexer.interval]]index.scheduledIndexer.interval::
3127+
3128The link:#schedule-configuration-interval[interval] for running
3129the scheduled indexer.
3130+
3131Defaults to `5m`.
3132
3133link:#schedule-configuration-examples[Schedule examples] can be found
3134in the link:#schedule-configuration[Schedule Configuration] section.
3135
David Pursehouse902b3ee2014-07-09 16:17:49 +09003136==== Lucene configuration
3137
3138Open and closed changes are indexed in separate indexes named
3139'open' and 'closed' respectively.
3140
3141The following settings are only used when the index type is `LUCENE`.
David Pursehouseac88c362014-02-06 12:01:34 +09003142
David Pursehouse00c82142014-01-22 17:41:09 +09003143[[index.name.ramBufferSize]]index.name.ramBufferSize::
3144+
David Pursehouse00c82142014-01-22 17:41:09 +09003145Determines the amount of RAM that may be used for buffering added documents
3146and deletions before they are flushed to the index. See the
3147link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
Marian Harbach34253372019-12-10 18:01:31 +01003148Lucene documentation,role=external,window=_blank] for further details.
David Pursehouse00c82142014-01-22 17:41:09 +09003149+
3150Defaults to 16M.
3151
3152[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
3153+
David Pursehouse00c82142014-01-22 17:41:09 +09003154Determines the minimal number of documents required before the buffered
3155in-memory documents are flushed to the index. Large values generally
3156give faster indexing. See the
3157link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
Marian Harbach34253372019-12-10 18:01:31 +01003158Lucene documentation,role=external,window=_blank] for further details.
David Pursehouse00c82142014-01-22 17:41:09 +09003159+
3160Defaults to -1, meaning no maximum is set and the writer will flush
3161according to RAM usage.
3162
Dave Borowitzd08b0452014-02-13 11:56:03 -08003163[[index.name.commitWithin]]index.name.commitWithin::
3164+
Dave Borowitzd08b0452014-02-13 11:56:03 -08003165Determines the period at which changes are automatically committed to
3166stable store on disk. This is a costly operation and may block
3167additional index writes, so lower with caution.
3168+
Bruce Zuaf058e62014-03-21 10:03:05 +08003169If zero, changes are committed after every write. This is very costly
3170but may be useful if offline reindexing is infeasible, or for development
3171servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08003172+
Bruce Zuaf058e62014-03-21 10:03:05 +08003173Values can be specified using standard time unit abbreviations (`ms`, `sec`,
3174`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07003175+
Bruce Zuaf058e62014-03-21 10:03:05 +08003176If negative, `commitWithin` is disabled. Changes are flushed to disk when
3177the in-memory buffer fills, but only committed and guaranteed to be synced
3178to disk when the process finishes.
David Pursehouse902b3ee2014-07-09 16:17:49 +09003179+
Dave Borowitzd08b0452014-02-13 11:56:03 -08003180Defaults to 300000 ms (5 minutes).
3181
Trevor Getty8fb5db52019-08-26 14:33:19 +02003182
3183[[index.name.maxMergeCount]]index.name.maxMergeCount::
3184+
3185Determines the max number of simultaneous merges that are allowed. If a merge
3186is necessary yet we already have this many threads running, the incoming thread
3187(that is calling add/updateDocument) will block until a merge thread has
3188completed. Note that Lucene will only run the smallest maxThreadCount merges
3189at a time. See the
3190link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Marian Harbach34253372019-12-10 18:01:31 +01003191Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003192+
3193Defaults to -1 for (auto detection).
3194
3195
3196[[index.name.maxThreadCount]]index.name.maxThreadCount::
3197+
3198Determines the max number of simultaneous Lucene merge threads that should be running at
3199once. This must be less than or equal to maxMergeCount. See the
3200link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Marian Harbach34253372019-12-10 18:01:31 +01003201Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003202+
3203For further details on Lucene index configuration (auto detection) which
3204affects maxThreadCount and maxMergeCount settings.
3205See the
3206link: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 +01003207Lucene documentation,role=external,window=_blank]
Trevor Getty8fb5db52019-08-26 14:33:19 +02003208+
3209Defaults to -1 for (auto detection).
3210
3211[[index.name.enableAutoIOThrottle]]index.name.enableAutoIOThrottle::
3212+
3213Allows the control of whether automatic IO throttling is enabled and used by
3214default in the lucene merge queue. Automatic dynamic IO throttling, which when
3215on is used to adaptively rate limit writes bytes/sec to the minimal rate necessary
3216so merges do not fall behind. See the
3217link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#enableAutoIOThrottle()[
Marian Harbach34253372019-12-10 18:01:31 +01003218Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003219+
3220Defaults to true (throttling enabled).
3221
David Pursehouse902b3ee2014-07-09 16:17:49 +09003222Sample Lucene index configuration:
David Pursehouse00c82142014-01-22 17:41:09 +09003223----
3224[index]
3225 type = LUCENE
3226
3227[index "changes_open"]
3228 ramBufferSize = 60 m
3229 maxBufferedDocs = 3000
Trevor Getty8fb5db52019-08-26 14:33:19 +02003230 maxThreadCount = 5
3231 maxMergeCount = 50
3232
David Pursehouse00c82142014-01-22 17:41:09 +09003233
3234[index "changes_closed"]
3235 ramBufferSize = 20 m
3236 maxBufferedDocs = 500
Trevor Getty8fb5db52019-08-26 14:33:19 +02003237 maxThreadCount = 10
3238 maxMergeCount = 100
3239 enableIOThrottle = false
3240
David Pursehouse00c82142014-01-22 17:41:09 +09003241----
3242
Dariusz Lukszaea529882017-04-25 15:11:31 +02003243[[elasticsearch]]
3244=== Section elasticsearch
David Pursehouse8e72f532014-06-24 11:01:28 +09003245
David Pursehouse1a82b372018-06-19 11:14:21 +09003246WARNING: Support for Elasticsearch is still experimental and is not recommended
David Pursehouse7e566dc2018-09-20 14:12:15 +09003247for production use. For compatibility information, please refer to the
Marian Harbach34253372019-12-10 18:01:31 +01003248link:https://www.gerritcodereview.com/elasticsearch.html[project homepage,role=external,window=_blank].
David Pursehouse8e72f532014-06-24 11:01:28 +09003249
David Ostrovsky81d2b5e2020-04-04 15:09:32 +02003250In Elasticsearch version 6.2 or later, the open and closed changes are merged
3251into the default `_doc` type. The latter is also used for the accounts and groups
3252indices starting with Elasticsearch 6.2.
David Pursehouse8e72f532014-06-24 11:01:28 +09003253
David Pursehouse6ea25322018-07-03 21:26:07 +09003254Note that when Gerrit is configured to use Elasticsearch, the Elasticsearch
3255server(s) must be reachable during the site initialization.
3256
Dariusz Lukszaea529882017-04-25 15:11:31 +02003257[[elasticsearch.prefix]]elasticsearch.prefix::
David Pursehouse8e72f532014-06-24 11:01:28 +09003258+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08003259This setting can be used to prefix index names to allow multiple Gerrit
David Pursehouse997cf2a2018-05-10 15:40:47 +09003260instances in a single Elasticsearch cluster. Prefix `gerrit1_` would result in a
3261change index named `gerrit1_changes_0001`.
David Pursehouse8e72f532014-06-24 11:01:28 +09003262+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08003263Not set by default.
David Pursehouse8e72f532014-06-24 11:01:28 +09003264
David Pursehouse479c50b2018-07-02 12:47:07 +09003265[[elasticsearch.server]]elasticsearch.server::
Dariusz Lukszaea529882017-04-25 15:11:31 +02003266+
David Pursehouse479c50b2018-07-02 12:47:07 +09003267Elasticsearch server URI in the form `http[s]://hostname:port`. The `port` is
3268optional and defaults to `9200` if not specified.
Dariusz Lukszaea529882017-04-25 15:11:31 +02003269+
David Pursehouse479c50b2018-07-02 12:47:07 +09003270At least one server must be specified. May be specified multiple times to
3271configure multiple Elasticsearch servers.
Dariusz Lukszaea529882017-04-25 15:11:31 +02003272+
David Pursehouse479c50b2018-07-02 12:47:07 +09003273Note that the site initialization program only allows to configure a single
3274server. To configure multiple servers the `gerrit.config` file must be edited
3275manually.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003276
David Pursehouse499f7fe2018-11-30 16:07:21 +09003277[[elasticsearch.numberOfShards]]elasticsearch.numberOfShards::
3278+
3279Sets the number of shards to use per index. Refer to the
Dyrone Tengae8babd2020-03-18 16:06:29 +08003280link:https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#_static_index_settings[
Marian Harbach34253372019-12-10 18:01:31 +01003281Elasticsearch documentation,role=external,window=_blank] for details.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003282+
Marco Miller082139a2019-06-17 15:00:35 -04003283Defaults to 5 for Elasticsearch versions 5 and 6, and to 1 starting with Elasticsearch 7.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003284
3285[[elasticsearch.numberOfReplicas]]elasticsearch.numberOfReplicas::
3286+
3287Sets the number of replicas to use per index. Refer to the
Dyrone Tengae8babd2020-03-18 16:06:29 +08003288link:https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings[
Marian Harbach34253372019-12-10 18:01:31 +01003289Elasticsearch documentation,role=external,window=_blank] for details.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003290+
3291Defaults to 1.
3292
Dyrone Teng76fed532020-03-18 11:20:03 +08003293[[elasticsearch.maxResultWindow]]elasticsearch.maxResultWindow::
3294+
3295Sets the maximum value of `from + size` for searches to use per index. Refer to the
3296link:https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings[
David Pursehoused9aa6b02020-03-19 13:33:17 +09003297Elasticsearch documentation,role=external,window=_blank] for details.
Dyrone Teng76fed532020-03-18 11:20:03 +08003298+
3299Defaults to 10000.
3300
David Pursehouse13f1d632018-07-02 14:37:36 +09003301==== Elasticsearch Security
Dariusz Lukszaea529882017-04-25 15:11:31 +02003302
David Pursehouse13f1d632018-07-02 14:37:36 +09003303When security is enabled in Elasticsearch, the username and password must be provided.
3304Note that the same username and password are used for all servers.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003305
Marco Milleree4eefc2020-07-29 16:24:59 -04003306For further information about Elasticsearch security, please refer to
Marco Miller527d2d02020-07-31 13:06:58 -04003307link:https://www.elastic.co/guide/en/elasticsearch/reference/current/security-getting-started.html[the documentation,role=external,window=_blank].
Marco Milleree4eefc2020-07-29 16:24:59 -04003308This is the current documentation link. Select another Elasticsearch version
3309from the dropdown menu available on that page if need be.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003310
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003311[[elasticsearch.username]]elasticsearch.username::
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003312+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003313Username used to connect to Elasticsearch.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003314+
David Pursehouse975fdd22018-07-02 14:23:07 +09003315If a password is set, defaults to `elastic`, otherwise not set by default.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003316
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003317[[elasticsearch.password]]elasticsearch.password::
3318+
3319Password used to connect to Elasticsearch.
3320+
3321Not set by default.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003322
Patrick Hieselda692472019-10-07 16:03:23 +02003323[[event]]
3324=== Section event
3325
3326[[event.payload.listChangeOptions]]events.payload.listChangeOptions::
3327+
3328List of options that Gerrit applies when rendering the payload of an
3329internal event. This is the same set of options that are documented
3330link:rest-api-changes.html#query-options[here].
3331+
3332Depending on the setup, these events might get serialized using stream
3333events.
3334+
3335This can be set to the set of minimal options that consumers of Gerrit's
Patrick Hiesela4824db2019-12-20 10:55:26 +01003336events need. A minimal set would be (`SKIP_DIFFSTAT`).
Patrick Hieselda692472019-10-07 16:03:23 +02003337+
3338Every option that gets added here will have a performance impact. The
3339general recommendation is therefore to set this to a minimal set of
3340required options.
3341+
3342Defaults to all available options minus `CHANGE_ACTIONS`,
3343`CURRENT_ACTIONS` and `CHECK`. This is a rich default to make sure the
3344config is backwards compatible with what the default was before the config
3345was added.
3346
3347
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003348[[ldap]]
3349=== Section ldap
3350
3351LDAP integration is only enabled if `auth.type` is set to
3352`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
3353detailed description of the `auth.type` settings and their
3354implications.
3355
3356An example LDAP configuration follows, and then discussion of
3357the parameters introduced here. Suitable defaults for most
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003358parameters are automatically guessed based on the type of server
Michal Pasierb3e262742017-01-23 12:50:48 +01003359detected during startup. The guessed defaults support
Marian Harbach34253372019-12-10 18:01:31 +01003360link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307,role=external,window=_blank], Active
3361Directory and link:https://www.freeipa.org[FreeIPA,role=external,window=_blank].
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003362
3363----
3364[ldap]
3365 server = ldap://ldap.example.com
3366
3367 accountBase = ou=people,dc=example,dc=com
3368 accountPattern = (&(objectClass=person)(uid=${username}))
3369 accountFullName = displayName
3370 accountEmailAddress = mail
3371
3372 groupBase = ou=groups,dc=example,dc=com
3373 groupMemberPattern = (&(objectClass=group)(member=${dn}))
3374----
3375
Luca Milanesioa05d42b2018-12-19 01:13:06 +00003376[[ldap.guessRelevantGroups]]ldap.guessRelevantGroups::
3377+
3378Filter the groups found in LDAP by guessing the ones relevant to
3379Gerrit and removing the others from list completions and ACL evaluations.
3380The guess is based on two elements: the projects most recently
3381accessed in the cache and the list of LDAP groups included in their ACLs.
3382+
3383Please note that projects rarely used and thus not cached may be
3384temporarily inaccessible by users even with LDAP membership and grants
3385referenced in the ACLs.
3386+
3387By default, true.
3388
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003389[[ldap.server]]ldap.server::
3390+
3391URL of the organization's LDAP server to query for user information
3392and group membership from. Must be of the form `ldap://host` or
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003393`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003394+
3395If `auth.type` is `LDAP` this setting should use `ldaps://` to
3396ensure the end user's plaintext password is transmitted only over
3397an encrypted connection.
Matthias Sohn1e2ec072020-10-16 13:57:11 +02003398+
3399If you want to configure multiple ldap servers you can try to put
3400multiple ldap urls separated by a space:
3401`server = ldaps://ldap1 ldaps://ldap2`
3402See https://bugs.chromium.org/p/gerrit/issues/detail?id=10841[issue 10841].
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003403
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003404[[ldap.startTls]]ldap.startTls::
3405+
3406If true, Gerrit will perform StartTLS extended operation.
3407+
3408By default, false, StartTLS will not be enabled.
3409
Alon Bar-Leve39c35c2019-06-10 12:59:55 +03003410[[ldap.supportAnonymous]]ldap.supportAnonymous::
3411+
3412If false, Gerrit will provide credentials only at connection open, this is
3413required for some `LDAP` implementations that do not allow anonymous bind
3414for StartTLS or for reauthentication.
3415+
3416By default, true.
3417
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003418[[ldap.sslVerify]]ldap.sslVerify::
3419+
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003420If false and ldap.server is an `ldaps://` style URL or `ldap.startTls`
3421is true, Gerrit will not verify the server certificate when it connects
3422to perform a query.
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003423+
3424By default, true, requiring the certificate to be verified.
3425
Olga Grinbergcf1b06a2015-02-03 15:54:48 -05003426[[ldap.groupsVisibleToAll]]ldap.groupsVisibleToAll::
3427+
3428If true, LDAP groups are visible to all registered users.
3429+
3430By default, false, LDAP groups are visible only to administrators and
3431group members.
3432
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003433[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003434+
3435_(Optional)_ Username to bind to the LDAP server with. If not set,
3436an anonymous connection to the LDAP server is attempted.
3437
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003438[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003439+
3440_(Optional)_ Password for the user identified by `ldap.username`.
3441If not set, an anonymous (or passwordless) connection to the LDAP
3442server is attempted.
3443
Ben Wu0410a152010-06-04 16:17:24 +08003444[[ldap.referral]]ldap.referral::
3445+
3446_(Optional)_ How an LDAP referral should be handled if it is
3447encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05003448automatically follow any referrals, or `ignore` to ignore the
3449referrals.
Ben Wu0410a152010-06-04 16:17:24 +08003450+
3451By default, `ignore`.
3452
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003453[[ldap.readTimeout]]ldap.readTimeout::
3454+
3455_(Optional)_ The read timeout for an LDAP operation. The value is
3456in the usual time-unit format like "1 s", "100 ms", etc...
3457A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09003458threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003459+
3460By default there is no timeout and Gerrit will wait for the LDAP
3461server to respond until the TCP connection times out.
3462
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003463[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003464+
3465Root of the tree containing all user accounts. This is typically
3466of the form `ou=people,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003467+
3468This setting may be added multiple times to specify more than
3469one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003470
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003471[[ldap.accountScope]]ldap.accountScope::
3472+
3473Scope of the search performed for accounts. Must be one of:
3474+
3475* `one`: Search only one level below accountBase, but not recursive
3476* `sub` or `subtree`: Search recursively below accountBase
3477* `base` or `object`: Search exactly accountBase; probably not desired
3478
3479+
3480Default is `subtree` as many directories have several levels.
3481
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003482[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003483+
3484Query pattern to use when searching for a user account. This may be
3485any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09003486`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003487`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09003488that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02003489the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003490the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003491+
3492This pattern is used to search the objects contained directly under
3493the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02003494is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003495setting depends on the LDAP schema used by the directory server.
3496+
Michal Pasierb3e262742017-01-23 12:50:48 +01003497Default is `(uid=${username})` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003498and `(&(objectClass=user)(sAMAccountName=${username}))`
3499for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003500
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003501[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003502+
3503_(Optional)_ Name of an attribute on the user account object which
3504contains the initial value for the user's full name field in Gerrit.
3505Typically this is the `displayName` property in LDAP, but could
3506also be `legalName` or `cn`.
3507+
David Pursehouse221d4f62012-06-08 17:38:08 +09003508Attribute values may be concatenated with literal strings. For
3509example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02003510`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003511+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003512If set, users will be unable to modify their full name field, as
3513Gerrit will populate it only from the LDAP data.
3514+
Michal Pasierb3e262742017-01-23 12:50:48 +01003515Default is `displayName` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003516and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003517
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003518[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003519+
3520_(Optional)_ Name of an attribute on the user account object which
3521contains the user's Internet email address, as defined by this
3522LDAP server.
3523+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003524Attribute values may be concatenated with literal strings,
3525for example to set the email address to the lowercase form
3526of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02003527`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003528+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003529If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09003530but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003531and select a different preferred email address.
3532+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003533Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003534
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003535[[ldap.accountSshUserName]]ldap.accountSshUserName::
3536+
3537_(Optional)_ Name of an attribute on the user account object which
3538contains the initial value for the user's SSH username field in
3539Gerrit. Typically this is the `uid` property in LDAP, but could
3540also be `cn`. Administrators should prefer to match the attribute
3541corresponding to the user's workstation username, as this is what
3542SSH clients will default to.
3543+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003544Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02003545an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003546force the value of sAMAccountName, if defined, to be all lowercase.
3547The suffix `.toUpperCase` can be used for the other direction.
3548The suffix `.localPart` can be used to split attribute values of
3549the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02003550example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003551+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003552If set, users will be unable to modify their SSH username field, as
David Pursehousec12da502016-08-11 20:45:03 +09003553Gerrit will populate it only from the LDAP data. Note that once the
3554username has been set it cannot be changed, therefore it is
3555recommended not to make changes to this setting that would cause the
3556value to differ, as this will prevent users from logging in.
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003557+
Michal Pasierb3e262742017-01-23 12:50:48 +01003558Default is `uid` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003559and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003560
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003561[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04003562+
3563_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003564contains the groups the user is part of. Typically used for Active
Michal Pasierb3e262742017-01-23 12:50:48 +01003565Directory and FreeIPA servers.
Anthony93de7db2009-10-03 10:01:50 -04003566+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003567Default is unset for RFC 2307 servers (disabled)
Michal Pasierb3e262742017-01-23 12:50:48 +01003568and `memberOf` for Active Directory and FreeIPA.
3569
3570[[ldap.accountMemberExpandGroups]]ldap.accountMemberExpandGroups::
3571+
3572_(Optional)_ Whether to expand nested groups recursively. This
3573setting is used only if `ldap.accountMemberField` is set.
3574+
3575Default is unset for FreeIPA and `true` for RFC 2307 servers
3576and Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04003577
Saša Živkovc81291f2015-02-04 17:19:20 +01003578[[ldap.fetchMemberOfEagerly]]ldap.fetchMemberOfEagerly::
3579+
3580_(Optional)_ Whether to fetch the `memberOf` account attribute on
3581login. Setups which use LDAP for user authentication but don't make
3582use of the LDAP groups may benefit from setting this option to `false`
3583as this will result in a much faster LDAP login.
3584+
3585Default is unset for RFC 2307 servers (disabled) and `true` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003586Active Directory and FreeIPA.
Saša Živkovc81291f2015-02-04 17:19:20 +01003587
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003588[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003589+
3590Root of the tree containing all group objects. This is typically
3591of the form `ou=groups,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003592+
3593This setting may be added multiple times to specify more than
3594one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003595
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003596[[ldap.groupScope]]ldap.groupScope::
3597+
3598Scope of the search performed for group objects. Must be one of:
3599+
3600* `one`: Search only one level below groupBase, but not recursive
3601* `sub` or `subtree`: Search recursively below groupBase
3602* `base` or `object`: Search exactly groupBase; probably not desired
3603
3604+
3605Default is `subtree` as many directories have several levels.
3606
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003607[[ldap.groupPattern]]ldap.groupPattern::
3608+
3609Query pattern used when searching for an LDAP group to connect
3610to a Gerrit group. This may be any valid LDAP query expression,
3611including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003612`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003613group owner.
3614+
Michal Pasierb3e262742017-01-23 12:50:48 +01003615Default is `(cn=${groupname})` for FreeIPA and RFC 2307 servers,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003616and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003617
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003618[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003619+
3620Query pattern to use when searching for the groups that a user
3621account is currently a member of. This may be any valid LDAP query
3622expression, including the standard `(&...)` and `(|...)` operators.
3623+
David Pursehouse42f42042013-08-01 14:02:25 +09003624If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003625replaced with a parameter set to the username that was supplied
3626by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003627such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003628corresponding attribute (in this case, `fooBarAttribute`) as read
3629from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02003630Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003631+
Scott Dial50457502013-08-11 16:52:51 -04003632Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003633RFC 2307, and unset (disabled) for Active Directory and FreeIPA.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003634
Auke Schrijnen57809132012-09-26 21:05:39 +02003635[[ldap.groupName]]ldap.groupName::
3636+
David Pursehouse39489ae2012-10-12 13:50:04 +09003637_(Optional)_ Name of the attribute on the group object which contains
3638the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02003639+
David Pursehouse39489ae2012-10-12 13:50:04 +09003640Typically the attribute name is `cn` for RFC 2307 and Active Directory
3641servers. For other servers the attribute name may differ, for example
3642`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02003643+
David Pursehouse39489ae2012-10-12 13:50:04 +09003644It is also possible to specify a literal string containing a pattern of
3645attribute values. For example to create a Gerrit group name consisting of
3646LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
3647+
3648Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02003649
Gustaf Lundhdaf41af2016-12-05 19:05:09 +01003650[[ldap.mandatoryGroup]]ldap.mandatoryGroup::
3651+
3652All users must be a member of this group to allow account creation or
3653authentication.
3654+
3655Setting mandatoryGroup implies enabling of `ldap.fetchMemberOfEagerly`
3656+
3657By default, unset.
3658
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003659[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
3660+
3661Converts the local username, that is used to login into the Gerrit
David Pursehousea1d633b2014-05-02 17:21:02 +09003662Web UI, to lower case before doing the LDAP authentication. By setting
3663this parameter to true, a case insensitive login to the Gerrit Web UI
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003664can be achieved.
3665+
3666If set, it must be ensured that the local usernames for all existing
3667accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09003668local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003669anymore. The local usernames for the existing accounts can be
3670converted to lower case by running the server program
3671link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
3672Please be aware that the conversion of the local usernames to lower
3673case can't be undone. For newly created accounts the local username
3674will be directly stored in lower case.
3675+
3676By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003677
Robin Rosenberga3baed02012-10-14 14:09:32 +02003678[[ldap.authentication]]ldap.authentication::
3679+
3680Defines how Gerrit authenticates with the server. When set to `GSSAPI`
3681Gerrit will use Kerberos. To use kerberos the
3682`java.security.auth.login.config` system property must point to a
3683login to a JAAS configuration file and, if Java 6 is used, the system
3684property `java.security.krb5.conf` must point to the appropriate
3685krb5.ini file with references to the KDC.
3686
3687Typical jaas.conf.
3688
3689----
3690KerberosLogin {
3691 com.sun.security.auth.module.Krb5LoginModule
3692 required
3693 useTicketCache=true
3694 doNotPrompt=true
3695 renewTGT=true;
3696};
3697----
3698
3699See Java documentation on how to create the krb5.ini file.
3700
3701Note the `renewTGT` property to make sure the TGT does not expire,
3702and `useTicketCache` to use the TGT supplied by the operating system. As
3703the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09003704to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02003705
3706On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
3707must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
3708have local administrator privileges.
3709
Bruce Zucd04bbc2014-07-25 15:48:09 +08003710[[ldap.useConnectionPooling]]ldap.useConnectionPooling::
3711+
3712_(Optional)_ Enable the LDAP connection pooling or not.
3713+
3714If it is true, the LDAP service provider maintains a pool of (possibly)
3715previously used connections and assigns them to a Context instance as
3716needed. When a Context instance is done with a connection (closed or
3717garbage collected), the connection is returned to the pool for future use.
3718+
3719For details, see link:http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html[
Marian Harbach34253372019-12-10 18:01:31 +01003720LDAP connection management (Pool),role=external,window=_blank] and link:http://docs.oracle.com/javase/tutorial/jndi/ldap/config.html[
3721LDAP connection management (Configuration),role=external,window=_blank]
Bruce Zucd04bbc2014-07-25 15:48:09 +08003722+
3723By default, false.
3724
3725[[ldap.connectTimeout]]ldap.connectTimeout::
3726+
Saša Živkov303701a2015-01-19 16:24:44 +01003727_(Optional)_ Timeout period for establishment of an LDAP connection.
Bruce Zucd04bbc2014-07-25 15:48:09 +08003728+
3729The value is in the usual time-unit format like "1 s", "100 ms",
3730etc...
3731+
3732By default there is no timeout and Gerrit will wait indefinitely.
3733
Saša Živkov5049f512015-01-19 17:04:43 +01003734[[ldap-connection-pooling]]
3735==== LDAP Connection Pooling
3736Once LDAP connection pooling is enabled by setting the link:#ldap.useConnectionPooling[
3737ldap.useConnectionPooling] configuration property to `true`, the connection pool
3738can be configured using JVM system properties as explained in the
3739link:http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-ldap.html#POOL[
Marian Harbach34253372019-12-10 18:01:31 +01003740Java SE Documentation,role=external,window=_blank].
Bruce Zucd04bbc2014-07-25 15:48:09 +08003741
Saša Živkov5049f512015-01-19 17:04:43 +01003742For standalone Gerrit (running with the embedded Jetty), JVM system properties
3743are specified in the link:#container[container section]:
Bruce Zucd04bbc2014-07-25 15:48:09 +08003744
Saša Živkov5049f512015-01-19 17:04:43 +01003745----
3746 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.maxsize=20
3747 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.prefsize=10
3748 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.timeout=300000
3749----
Bruce Zucd04bbc2014-07-25 15:48:09 +08003750
Saša Živkovca7a67e2015-12-01 14:25:10 +01003751[[lfs]]
3752=== Section lfs
3753
3754[[lfs.plugin]]lfs.plugin::
3755+
David Pursehouse2463c542016-08-02 16:04:58 +09003756The name of a plugin which serves the
3757link:https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md[
Marian Harbach34253372019-12-10 18:01:31 +01003758LFS protocol,role=external,window=_blank] on the `<project-name>/info/lfs/objects/batch` endpoint. When
David Pursehouse2463c542016-08-02 16:04:58 +09003759not configured Gerrit will respond with `501 Not Implemented` on LFS protocol
3760requests.
Saša Živkovca7a67e2015-12-01 14:25:10 +01003761+
3762By default unset.
3763
Gustaf Lundhaef90122015-04-27 16:48:19 +02003764[[log]]
3765=== Section log
3766
3767[[log.jsonLogging]]log.jsonLogging::
3768+
Thomas Draebing6930b212020-02-13 17:51:42 +01003769If set to true, enables error, ssh and http logging in JSON format (file name:
3770"logs/{error|sshd|httpd}_log.json").
Gustaf Lundhaef90122015-04-27 16:48:19 +02003771+
3772Defaults to false.
3773
3774[[log.textLogging]]log.textLogging::
3775+
3776If set to true, enables error logging in regular plain text format. Can only be disabled
3777if `jsonLogging` is enabled.
3778+
3779Defaults to true.
3780
David Pursehouse2281fef2017-11-21 21:27:17 +09003781[[log.compress]]log.compress::
3782+
3783If set to true, log files are compressed at server startup and then daily at 11pm
3784(in the server's local time zone).
3785+
3786Defaults to true.
3787
David Pursehouse633fff32017-11-21 22:08:12 +09003788[[log.rotate]]log.rotate::
3789+
3790If set to true, log files are rotated daily at midnight (GMT).
3791+
3792Defaults to true.
3793
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003794[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003795=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003796
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003797[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003798+
3799If set to true, files with the MIME type `<name>` will be sent as
3800direct downloads to the user's browser, rather than being wrapped up
3801inside of zipped archives. The type name may be a complete type
Jonathan Nieder5758f182015-03-30 11:28:55 -07003802name, e.g. `image/gif`, a generic media type, e.g. `+image/*+`,
3803or the wildcard `+*/*+` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003804+
3805By default, false for all MIME types.
3806
3807Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003808----
3809[mimetype "image/*"]
3810 safe = true
3811
3812[mimetype "application/pdf"]
3813 safe = true
3814
3815[mimetype "application/msword"]
3816 safe = true
3817
3818[mimetype "application/vnd.ms-excel"]
3819 safe = true
3820----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003821
Dave Borowitzbc314912017-03-21 14:23:35 -07003822[[note-db]]
3823=== Section noteDb
3824
Dave Borowitzada289c2018-12-18 13:24:14 -08003825NoteDb is the Git-based database storage backend for Gerrit. For more
3826information, including how to migrate data from an older Gerrit version, see the
3827link:note-db.html[documentation].
Dave Borowitzbc314912017-03-21 14:23:35 -07003828
Edwin Kempin5be9c312017-07-07 10:40:55 +02003829[[notedb.accounts.sequenceBatchSize]]notedb.accounts.sequenceBatchSize::
3830+
Edwin Kempin311d5702017-07-28 15:10:24 +02003831The next available account sequence number is stored as UTF-8 text in a
3832blob pointed to by the `refs/sequences/accounts` ref in the `All-Users`
Edwin Kempin5be9c312017-07-07 10:40:55 +02003833repository. Multiple processes share the same sequence by incrementing
3834the counter using normal git ref updates. To amortize the cost of these
3835ref updates, processes increment the counter by a larger number and
3836hand out numbers from that range in memory until they run out. This
3837configuration parameter controls the size of the account ID batch that
3838each process retrieves at once.
3839+
Edwin Kempin5be9c312017-07-07 10:40:55 +02003840By default, 1.
3841
David Pursehouse05eaefe2020-06-02 15:42:46 +09003842[[notedb.changes.sequenceBatchSize]]notedb.changes.sequenceBatchSize::
3843+
3844The next available change sequence number is stored as UTF-8 text in a
3845blob pointed to by the `refs/sequences/changes` ref in the `All-Projects`
3846repository. Multiple processes share the same sequence by incrementing
3847the counter using normal git ref updates. To amortize the cost of these
3848ref updates, processes increment the counter by a larger number and
3849hand out numbers from that range in memory until they run out. This
3850configuration parameter controls the size of the change ID batch that
3851each process retrieves at once.
3852+
3853By default, 20.
Han-Wen Nienhuyse5ca19c2017-11-08 13:33:33 +01003854
Michael Ochmann69813262016-01-27 17:53:55 +01003855[[oauth]]
3856=== Section oauth
3857
3858OAuth integration is only enabled if `auth.type` is set to `OAUTH`. See
3859link:#auth.type[above] for a detailed description of the `auth.type` settings
3860and their implications.
3861
3862By default, contact information, like the full name and email address,
3863is retrieved from the selected OAuth provider when a user account is created,
3864or when a user requests to reload that information in the settings UI. If
3865that is not supported by the OAuth provider, users can be allowed to edit
3866their contact information manually.
3867
3868[[oauth.allowEditFullName]]oauth.allowEditFullName::
3869+
3870If true, the full name can be edited in the contact information.
3871+
3872Default is false.
3873
3874[[oauth.allowRegisterNewEmail]]oauth.allowRegisterNewEmail::
3875+
3876If true, additional email addresses can be registered in the contact
3877information.
3878+
3879Default is false.
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003880
Zac Livingston70a16102018-11-20 15:07:34 -07003881[[operator-alias]]
3882=== Section operator alias
3883
3884Operator aliasing allows global aliases to be defined for query operators.
3885Currently only change queries are supported. The alias name is the git
3886config key name, and the operator being aliased is the git config value.
3887
3888For example:
3889
3890----
3891[operator-alias "change"]
3892 oldage = age
3893 number = change
3894----
3895
3896This section is particularly useful to alias operator names which may be
3897long and clunky because they include a plugin name in them to a shorter
3898name without the plugin name.
3899
3900Aliases are resolved dynamically at invocation time to any currently
3901loaded versions of plugins. If the alias points to an operator provided
3902by a plugin which is not currently loaded, or the plugin does not define
3903the operator, then "unsupported operator" is returned to the user.
3904
3905Aliases will override existing operators. In the case of multiple aliases
3906with the same name, the last one defined will be used.
3907
3908When the target of an alias doesn't exist, the operator with the name
3909of the alias will be used (if present). This enables an admin to config
3910the system to override a core operator with an operator provided by a
3911plugin when present and otherwise fall back to the operator provided by
3912core.
3913
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003914[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003915=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003916
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003917Global settings controlling how Gerrit Code Review creates pack
3918streams for Git clients running clone, fetch, or pull. Most of these
3919variables are per-client request, and thus should be carefully set
3920given the expected concurrent request load and available CPU and
3921memory resources.
3922
3923[[pack.deltacompression]]pack.deltacompression::
3924+
3925If true, delta compression between objects is enabled. This may
3926result in a smaller overall transfer for the client, but requires
3927more server memory and CPU time.
3928+
3929False (off) by default, matching Gerrit Code Review 2.1.4.
3930
3931[[pack.threads]]pack.threads::
3932+
3933Maximum number of threads to use for delta compression (if enabled).
3934This is per-client request. If set to 0 then the number of CPUs is
3935auto-detected and one thread per CPU is used, per client request.
3936+
3937By default, 1.
3938
3939
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003940[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003941=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003942
3943[[plugins.checkFrequency]]plugins.checkFrequency::
3944+
3945How often plugins should be examined for new plugins to load, removed
3946plugins to be unloaded, or updated plugins to be reloaded. Values can
3947be specified using standard time unit abbreviations ('ms', 'sec',
3948'min', etc.).
3949+
3950If set to 0, automatic plugin reloading is disabled. Administrators
Christian Aistleitner8ce1a4e2015-06-05 01:54:15 +02003951may force reloading with link:cmd-plugin-reload.html[gerrit plugin reload].
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003952+
3953Default is 1 minute.
3954
Shawn Pearcefd033502014-02-14 16:42:35 -08003955[[plugins.allowRemoteAdmin]]plugins.allowRemoteAdmin::
3956+
3957Enable remote installation, enable and disable of plugins over HTTP
3958and SSH. If set to true Administrators can install new plugins
3959remotely, or disable existing plugins. Defaults to false.
3960
Saša Živkov350fc682019-05-13 14:13:51 +02003961[[plugins.mandatory]]plugins.mandatory::
3962+
3963List of mandatory plugins. If a plugin from this list does not load,
David Pursehousef06aefb2019-10-18 20:39:53 +09003964Gerrit will fail to start.
3965+
3966Disabling and restarting of a mandatory plugin is rejected, but reloading
3967of a mandatory plugin is still possible.
Saša Živkov350fc682019-05-13 14:13:51 +02003968
Dariusz Luksza98f23522015-03-11 11:41:41 +01003969[[plugins.jsLoadTimeout]]plugins.jsLoadTimeout::
3970+
3971Set the timeout value for loading JavaScript plugins in Gerrit UI.
3972Values can be specified using standard time unit abbreviations ('ms',
3973'sec', 'min', etc.).
3974+
3975Default is 5 seconds. Negative values will be converted to 0.
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003976
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003977[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003978=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003979
Dave Borowitzff243892015-08-31 15:35:28 -04003980This section is used to configure behavior of the 'receive-pack'
3981handler, which responds to 'git push' requests.
lincoln2be11602010-07-05 10:53:25 -03003982
Dave Borowitzff243892015-08-31 15:35:28 -04003983[[receive.allowGroup]]receive.allowGroup::
Dave Borowitz532342bf2015-06-18 20:28:22 -04003984+
Dave Borowitzff243892015-08-31 15:35:28 -04003985Name of the groups of users that are allowed to execute
3986'receive-pack' on the server. One or more groups can be set.
Dave Borowitz532342bf2015-06-18 20:28:22 -04003987+
Dave Borowitzff243892015-08-31 15:35:28 -04003988If no groups are added, any user will be allowed to execute
3989'receive-pack' on the server.
Dave Borowitz532342bf2015-06-18 20:28:22 -04003990
3991[[receive.certNonceSeed]]receive.certNonceSeed::
3992+
3993If set to a non-empty value and server-side signed push validation is
3994link:#receive.enableSignedPush[enabled], use this value as the seed to
3995the HMAC SHA-1 nonce generator. If unset, a 64-byte random seed will be
3996generated at server startup.
3997+
3998As this is used as the seed of a cryptographic algorithm, it is
3999recommended to be placed in link:#secure-config[`secure.config`].
4000+
4001Defaults to unset.
4002
4003[[receive.certNonceSlop]]receive.certNonceSlop::
4004+
4005When validating the nonce passed as part of the signed push protocol,
4006accept valid nonces up to this many seconds old. This allows
4007certificate verification to work over HTTP where there is a lag between
4008the HTTP response providing the nonce to sign and the next request
4009containing the signed nonce. This can be significant on large
4010repositories, since the lag also includes the time to count objects on
4011the client.
4012+
4013Default is 5 minutes.
4014
Dave Borowitzff243892015-08-31 15:35:28 -04004015[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
4016+
4017Number of threads to perform change creation or patch set updates
4018concurrently. Each thread uses its own database connection from
4019the database connection pool, and if all threads are busy then
4020main receive thread will also perform a change creation or patch
4021set update.
4022+
4023Defaults to 1, using only the main receive thread. This feature is for
4024databases with very high latency that can benefit from concurrent
4025operations when multiple changes are impacted at once.
4026
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08004027[[receive.checkMagicRefs]]receive.checkMagicRefs::
4028+
4029If true, Gerrit will verify the destination repository has
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01004030no references under the magic 'refs/for' branch namespace. Names under
4031these locations confuse clients when trying to upload code reviews so
4032Gerrit requires them to be empty.
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08004033+
4034If false Gerrit skips the sanity check and assumes administrators
4035have ensured the repository does not contain any magic references.
4036Setting to false to skip the check can decrease latency during push.
4037+
4038Default is true.
4039
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02004040[[receive.allowProjectOwnersToChangeParent]]receive.allowProjectOwnersToChangeParent::
4041+
4042If true, Gerrit will allow project owners to change the parent of a project.
4043+
4044By default only Gerrit administrators are allowed to change the parent
4045of a project. By allowing project owners to change parents, it may
4046allow the owner to circumvent certain enforced rules (like important
4047BLOCK rules).
4048+
4049Default is false.
Rikard Almgrene9221be2018-09-18 11:12:03 +02004050+
4051This value supports configuration reloads:
4052link:cmd-reload-config.html[reload-config]
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02004053
Gustaf Lundh9062fd62013-02-14 17:23:11 +01004054[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
4055+
4056If set to true, Gerrit will validate that all referenced objects that
4057are not included in the received pack are reachable by the user.
4058+
4059Carrying out this check on gits with many refs and commits can be a
4060very CPU-heavy operation. For non public Gerrit-servers this check may
4061be overkill.
4062+
4063Only disable this check if you trust the clients not to forge SHA1
4064references to access commits intended to be hidden from the user.
4065+
4066Default is true.
4067
Patrick Hiesel24653be2019-10-22 09:47:32 +02004068[[receive.enableInMemoryRefCache]]receive.enableInMemoryRefCache::
4069+
4070If true, Gerrit will cache all refs advertised during push in memory and
4071base later receive operations on that cache.
4072+
4073Turning this cache off is considered experimental.
4074+
4075This cache provides value when the ref database is slow and/or does not
4076offer an inverse lookup of object ID to ref name. When RefTable is used,
4077this cache can be turned off (experimental) to get speed improvements.
4078+
4079Default is true.
4080
Dave Borowitzff243892015-08-31 15:35:28 -04004081[[receive.enableSignedPush]]receive.enableSignedPush::
lincoln2be11602010-07-05 10:53:25 -03004082+
Dave Borowitzff243892015-08-31 15:35:28 -04004083If true, server-side signed push validation is enabled.
lincoln2be11602010-07-05 10:53:25 -03004084+
Dave Borowitzff243892015-08-31 15:35:28 -04004085When a client pushes with `git push --signed`, this ensures that the
4086push certificate is valid and signed with a valid public key stored in
David Pursehouse6117a472016-07-26 08:02:49 +00004087the `refs/meta/gpg-keys` branch of `All-Users`.
Dave Borowitzff243892015-08-31 15:35:28 -04004088+
4089Defaults to false.
4090
4091[[receive.maxBatchChanges]]receive.maxBatchChanges::
4092+
4093The maximum number of changes that Gerrit allows to be pushed
4094in a batch for review. When this number is exceeded Gerrit rejects
4095the push with an error message.
4096+
4097May be overridden for certain groups by specifying a limit in the
4098link:access-control.html#capability_batchChangesLimit['Batch Changes Limit']
4099global capability.
4100+
4101This setting can be used to prevent users from uploading large
4102number of changes for review by mistake.
4103+
4104Default is zero, no limit.
lincoln2be11602010-07-05 10:53:25 -03004105
Dave Borowitz78542192017-08-31 10:45:47 -04004106[[receive.maxBatchCommits]]receive.maxBatchCommits::
4107+
4108The maximum number of commits that Gerrit allows to be pushed in a batch
4109directly to a branch when link:user-upload.html#bypass_review[bypassing review].
4110This limit can be bypassed if a user link:user-upload.html#skip_validation[skips
4111validation].
4112+
4113Default is 10000.
4114
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004115[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
4116+
4117Maximum allowed Git object size that 'receive-pack' will accept.
4118If an object is larger than the given size the pack-parsing will abort
4119and the push operation will fail. If set to zero then there is no
4120limit.
4121+
David Pursehouse221d4f62012-06-08 17:38:08 +09004122Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004123from pushing objects which are too large to Gerrit.
4124+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07004125This setting can also be set in the `project.config`
David Pursehouse2e548682018-08-01 15:12:47 +02004126(link:config-project-config.html[receive.maxObjectSizeLimit]) in order
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07004127to further reduce the global setting. The project specific setting is
4128only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02004129+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004130Default is zero.
4131+
4132Common unit suffixes of 'k', 'm', or 'g' are supported.
4133
David Pursehouse3f9c7402018-09-05 18:43:03 +09004134[[receive.inheritProjectMaxObjectSizeLimit]]receive.inheritProjectMaxObjectSizeLimit::
4135+
4136Controls whether the project-level link:config-project-config.html[`receive.maxObjectSizeLimit`]
4137value is inherited from the parent project. When `true`, the value is
4138inherited, otherwise it is not inherited.
4139+
4140Default is false, the value is not inherited.
4141
Dave Borowitz1bb49492015-08-31 15:36:59 -04004142[[receive.maxTrustDepth]]receive.maxTrustDepth::
4143+
4144If signed push validation is link:#receive.enableSignedPush[enabled],
4145set to the maximum depth to search when checking if a key is
4146link:#receive.trustedKey[trusted].
4147+
4148Default is 0, meaning only explicitly trusted keys are allowed.
4149
Dave Borowitz234734a2012-03-01 14:22:29 -08004150[[receive.threadPoolSize]]receive.threadPoolSize::
4151+
4152Maximum size of the thread pool in which the change data in received packs is
4153processed.
4154+
4155Defaults to the number of available CPUs according to the Java runtime.
4156
Dave Borowitz1c401362012-03-02 17:39:17 -08004157[[receive.timeout]]receive.timeout::
4158+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07004159Overall timeout on the time taken to process the change data in
4160received packs. Only includes the time processing Gerrit changes
4161and updating references, not the time to index the pack. Values can
4162be specified using standard time unit abbreviations ('ms', 'sec',
4163'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08004164+
Dariusz Lukszade482b02015-11-09 18:25:04 +01004165Default is 4 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07004166is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08004167
Dave Borowitz1bb49492015-08-31 15:36:59 -04004168[[receive.trustedKey]]receive.trustedKey::
4169+
4170List of GPG key fingerprints that should be considered trust roots by
4171the server when signed push validation is
4172link:#receive.enableSignedPush[enabled]. A key is trusted by the server
4173if it is either in this list, or a path of trust signatures leads from
4174the key to a configured trust root. The maximum length of the path is
4175determined by link:#receive.maxTrustDepth[`receive.maxTrustDepth`].
4176+
4177Key fingerprints can be displayed with `gpg --list-keys
4178--with-fingerprint`.
4179+
4180Trust signatures can be added to a key using the `tsign` command to
4181link:https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html[
Marian Harbach34253372019-12-10 18:01:31 +01004182`gpg --edit-key`,role=external,window=_blank], after which the signed key should be re-uploaded.
Dave Borowitz1bb49492015-08-31 15:36:59 -04004183+
4184If no keys are specified, web-of-trust checks are disabled. This is the
4185default behavior.
4186
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004187[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004188=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004189
Hugo Josefson072b4702010-04-21 19:27:11 +02004190Repositories in this sense are the same as projects.
4191
Shawn O. Pearce897d9212011-06-16 16:59:59 -07004192In the following example configuration `Registered Users` is set
4193to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02004194
4195----
4196[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02004197 ownerGroup = Registered Users
4198----
4199
Hugo Arès7d2b9422014-11-25 15:33:42 -05004200The only matching patterns supported are exact match or wildcard matching which
4201can be specified by ending the name with a `*`. If a project matches more than one
4202repository configuration, then the configuration from the more precise match
4203will be used. In the following example, the default submit type for a project
4204named `project/plugins/a` would be `CHERRY_PICK`.
4205
4206----
4207[repository "project/*"]
4208 defaultSubmitType = MERGE_IF_NECESSARY
4209[repository "project/plugins/*"]
4210 defaultSubmitType = CHERRY_PICK
4211----
4212
Michael Ochmann8129ece2016-07-08 11:25:25 +02004213[NOTE]
4214All properties are used from the matching repository configuration. In
Hugo Arès7d2b9422014-11-25 15:33:42 -05004215the previous example, all properties will be used from `project/plugins/\*`
4216section and no properties will be inherited nor overridden from `project/*`.
Hugo Josefson072b4702010-04-21 19:27:11 +02004217
Hugo Arès218bb3b2015-04-22 15:05:14 -04004218[[repository.name.basePath]]repository.<name>.basePath::
4219+
4220Alternate to <<gerrit.basePath,gerrit.basePath>>. The repository will be created
4221and used from this location instead: ${alternateBasePath}/${projectName}.git.
4222+
4223If configuring the basePath for an existing project in gerrit, make sure to stop
4224gerrit, move the repository in the alternate basePath, configure basePath for
4225this repository and then start Gerrit.
4226+
4227Path must be absolute.
4228
Edwin Kempina79ea552013-11-19 11:24:37 +01004229[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
4230+
4231The default submit type for newly created projects. Supported values
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004232are `INHERIT`, `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02004233`REBASE_ALWAYS`, `MERGE_ALWAYS` and `CHERRY_PICK`.
4234+
Changcheng Xiao21885982019-01-15 18:16:51 +01004235For more details see link:config-project-config.html#submit-type[Submit Types].
Edwin Kempina79ea552013-11-19 11:24:37 +01004236+
Changcheng Xiao21885982019-01-15 18:16:51 +01004237Default is link:config-project-config.html#submit_type_inherit[`INHERIT`].
Dave Borowitzcad4d262018-01-22 10:02:22 -05004238+
Dave Borowitz03e51742018-01-09 07:57:01 -05004239This submit type is only applied at project creation time if a submit type is
4240omitted from the link:rest-api-projects.html#project-input[ProjectInput]. If the
Dave Borowitzcad4d262018-01-22 10:02:22 -05004241submit type is unset in the project config at runtime, for backwards
4242compatibility purposes, it defaults to
4243link:project-configuration.html#merge_if_necessary[`MERGE_IF_NECESSARY`] rather
4244than `INHERIT`.
Edwin Kempina79ea552013-11-19 11:24:37 +01004245
Hugo Josefson072b4702010-04-21 19:27:11 +02004246[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
4247+
4248A name of a group which exists in the database. Zero, one or many
4249groups are allowed. Each on its own line. Groups which don't exist
4250in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02004251
Edwin Kempin22687fa2018-01-22 11:55:07 +01004252[[retry]]
4253=== Section retry
4254
4255[[retry.maxWait]]retry.maxWait::
4256+
4257Maximum time to wait between attempts to retry an operations when one attempt
4258fails (e.g. on NoteDb updates due to contention, aka lock failure, on the
4259underlying ref storage). Operations are retried with exponential backoff, plus
4260some random jitter, until the interval reaches this limit. After that, retries
4261continue to occur after a fixed timeout (plus jitter), up to
4262link:#retry.timeout[`retry.timeout`].
4263+
4264Defaults to 5 seconds; unit suffixes are supported, and assumes milliseconds if
4265not specified.
4266
4267[[retry.timeout]]retry.timeout::
4268+
4269Total timeout for retrying operations when one attempt fails.
4270+
4271It is possible to overwrite this default timeout based on operation types by
4272setting link:#retry.operationType.timeout[`retry.<operationType>.timeout`].
4273+
4274Defaults to 20 seconds; unit suffixes are supported, and assumes milliseconds if
4275not specified.
4276
4277[[retry.operationType.timeout]]retry.<operationType>.timeout::
4278+
4279Total timeout for retrying operations of type `<operationType>` when one
4280attempt fails. `<operationType>` can be `ACCOUNT_UPDATE`, `CHANGE_UPDATE`,
4281`GROUP_UPDATE` and `INDEX_QUERY`.
4282+
4283Defaults to link:#retry.timeout[`retry.timeout`]; unit suffixes are supported,
4284and assumes milliseconds if not specified.
4285
Edwin Kempindd837ae2019-06-18 11:42:14 +02004286[[retry.retryWithTraceOnFailure]]retry.retryWithTraceOnFailure::
4287+
4288Whether Gerrit should automatically retry operations on failure with tracing
4289enabled. The automatically generated traces can help with debugging. Please
4290note that only some of the REST endpoints support automatic retry.
4291+
4292By default this is set to false.
4293
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004294[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004295=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004296
4297[[rules.enable]]rules.enable::
4298+
Matt Baker8ce12fc2013-11-26 21:43:12 -07004299If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004300project's refs/meta/config branch, if present. When set to false,
4301only the default internal rules will be used.
4302+
4303Default is true, to execute project specific rules.
4304
Shawn Pearceed001d72014-12-17 14:25:55 -08004305[[rules.reductionLimit]]rules.reductionLimit::
4306+
4307Maximum number of Prolog reductions that can be performed when
4308evaluating rules for a single change. Each function call made
4309in user rule code, internal Gerrit Prolog code, or the Prolog
4310interpreter counts against this limit.
4311+
4312Sites using very complex rules that need many reductions should
4313compile Prolog to Java bytecode with link:pgm-rulec.html[rulec].
4314This eliminates the dynamic Prolog interpreter from charging its
4315own reductions against the limit, enabling more logic to execute
4316within the same bounds.
4317+
4318A reductionLimit of 0 is nearly infinite, implemented by setting
4319the internal limit to 2^31-1.
4320+
4321Default is 100,000 reductions (about 14 ms on Intel Core i7 CPU).
4322
4323[[rules.compileReductionLimit]]rules.compileReductionLimit::
4324+
4325Maximum number of Prolog reductions that can be performed when
4326compiling source code to internal Prolog machine code.
4327+
4328Default is 10x reductionLimit (1,000,000).
4329
Shawn Pearcea2b98522015-11-21 09:47:32 -08004330[[rules.maxSourceBytes]]rules.maxSourceBytes::
4331+
4332Maximum input size (in bytes) of a Prolog rules.pl file. Larger
4333source files may need a larger rules.compileReductionLimit. Consider
4334using link:pgm-rulec.html[rulec] to precompile larger rule files.
4335+
4336A size of 0 bytes disables rules, same as rules.enable = false.
4337+
David Pursehouse0c1dadf2015-11-24 09:14:21 +00004338Common unit suffixes of 'k', 'm', or 'g' are supported.
4339+
Shawn Pearcea2b98522015-11-21 09:47:32 -08004340Default is 128 KiB.
4341
4342[[rules.maxPrologDatabaseSize]]rules.maxPrologDatabaseSize::
4343+
4344Number of predicate clauses allowed to be defined in the Prolog
4345database by project rules. Very complex rules may need more than the
4346default 256 limit, but cost more memory and may need more time to
4347evaluate. Consider using link:pgm-rulec.html[rulec] to precompile
4348larger rule files.
4349+
4350Default is 256.
4351
David Pursehouse511a35b2014-04-04 10:27:13 +09004352[[execution]]
4353=== Section execution
Bruce Zua7e34312014-04-01 17:35:41 +08004354
4355[[execution.defaultThreadPoolSize]]execution.defaultThreadPoolSize::
4356+
4357The default size of the background execution thread pool in
4358which miscellaneous tasks are handled.
4359+
Jacek Centkowskice5510d2019-11-13 16:27:25 -08004360Default and minimum is 2 so that a single, potentially longer executing
4361task (e.g. GC), is not blocking the entire execution.
Bruce Zua7e34312014-04-01 17:35:41 +08004362
Patrick Hiesel2ed39822018-04-16 12:04:02 +02004363[[execution.fanOutThreadPoolSize]]execution.fanOutThreadPoolSize::
4364+
4365Maximum size of thread pool to on which a serving thread can fan-out
4366work to parallelize it.
4367+
4368When set to 0, a direct executor will be used.
4369+
4370By default, 25 which means that formatting happens in the caller thread.
4371
Patrick Hiesel328b7612016-10-21 16:43:13 +02004372[[receiveemail]]
4373=== Section receiveemail
4374
4375[[receiveemail.protocol]]receiveemail.protocol::
4376+
4377Specifies the protocol used for receiving emails. Valid options are
4378'POP3', 'IMAP' and 'NONE'. Note that Gerrit will automatically switch between
4379POP3 and POP3s as well as IMAP and IMAPS depending on the specified
4380link:#receiveemail.encryption[encryption].
4381+
4382Defaults to 'NONE' which means that receiving emails is disabled.
4383
4384[[receiveemail.host]]receiveemail.host::
4385+
4386The hostname of the mailserver. Example: 'imap.gmail.com'.
4387+
4388Defaults to an empty string which means that receiving emails is disabled.
4389
4390[[receiveemail.port]]receiveemail.port::
4391+
David Pursehouse4b067752017-03-03 15:54:53 +09004392The port the email server exposes for receiving emails.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004393+
4394Defaults to the industry standard for a given protocol and encryption:
David Pursehouse34907442017-04-04 09:55:38 +09004395POP3: 110; POP3S: 995; IMAP: 143; IMAPS: 993.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004396
4397[[receiveemail.username]]receiveemail.username::
4398+
4399Username used for authenticating with the email server.
4400+
4401Defaults to an empty string.
4402
4403[[receiveemail.password]]receiveemail.password::
4404+
4405Password used for authenticating with the email server.
4406+
4407Defaults to an empty string.
4408
4409[[receiveemail.encryption]]receiveemail.encryption::
4410+
4411Encryption standard used for transport layer security between Gerrit and the
4412email server. Possible values include 'NONE', 'SSL' and 'TLS'.
4413+
4414Defaults to 'NONE'.
4415
4416[[receiveemail.fetchInterval]]receiveemail.fetchInterval::
4417+
4418Time between two consecutive fetches from the email server. Communication with
4419the email server is not kept alive. Examples: 60s, 10m, 1h.
4420+
4421Defaults to 60 seconds.
4422
4423[[receiveemail.enableImapIdle]]receiveemail.enableImapIdle::
4424+
4425If the IMAP protocol is used for retrieving emails, IMAPv4 IDLE can be used to
4426keep the connection with the email server alive and receive a push when a new
4427email is delivered to the inbox. In this case, Gerrit will process the email
4428immediately and will not have a fetch delay.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004429+
4430Defaults to false.
4431
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004432[[receiveemail.filter.mode]]receiveemail.filter.mode::
4433+
Gal Paikin166e4432020-09-22 19:09:45 +03004434An allow and block filter to filter incoming emails.
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004435+
4436If `OFF`, emails are not filtered by the list filter.
4437+
Gal Paikin166e4432020-09-22 19:09:45 +03004438If `ALLOW`, only emails where a pattern from
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004439<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4440matches 'From' will be processed.
4441+
Gal Paikin166e4432020-09-22 19:09:45 +03004442If `BLOCK`, only emails where no pattern from
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004443<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4444matches 'From' will be processed.
4445+
4446Defaults to `OFF`.
Gal Paikin166e4432020-09-22 19:09:45 +03004447+
4448The previous filter-names 'BLACKLIST' and 'WHITELIST' have been deprecated
4449since they may be considered disrespectful and there's no technical or
4450practical reason to use these exact terms for the filters.
4451For backwards compatibility they are still supported but support for these
4452deprecated terms will be removed in future releases.
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004453
4454[[receiveemail.filter.patterns]]receiveemail.filter.patterns::
4455+
4456A list of regular expressions to match the email sender against. This can also
4457be a list of addresses when regular expression characters are escaped.
4458
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004459[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004460=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004461
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004462[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07004463+
4464If false Gerrit will not send email messages, for any reason,
4465and all other properties of section sendemail are ignored.
4466+
4467By default, true, allowing notifications to be sent.
4468
Jonathan Niederdabd8c22016-09-20 14:10:11 -07004469[[sendemail.html]]sendemail.html::
4470+
4471If false, Gerrit will only send plain-text emails.
4472If true, Gerrit will send multi-part emails with an HTML and
4473plain text part.
4474+
4475By default, true, allowing HTML in the emails Gerrit sends.
4476
Bruce Zua7e34312014-04-01 17:35:41 +08004477[[sendemail.connectTimeout]]sendemail.connectTimeout::
4478+
4479The connection timeout of opening a socket connected to a
4480remote SMTP server.
4481+
4482Values can be specified using standard time unit abbreviations
4483('ms', 'sec', 'min', etc.).
4484If no unit is specified, milliseconds is assumed.
4485+
4486Default is 0. A timeout of zero is interpreted as an infinite
4487timeout. The connection will then block until established or
4488an error occurs.
4489
4490[[sendemail.threadPoolSize]]sendemail.threadPoolSize::
Alice Kober-Sotzekda0559e2020-09-18 09:25:15 +00004491+
4492Maximum size of thread pool in which the review comments
4493notifications are sent out asynchronously.
4494+
4495By default, 1.
Bruce Zua7e34312014-04-01 17:35:41 +08004496
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004497[[sendemail.from]]sendemail.from::
4498+
4499Designates what name and address Gerrit will place in the From
4500field of any generated email messages. The supported values are:
4501+
4502* `USER`
4503+
4504Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09004505Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004506classified as spam if the user's domain has SPF or DKIM enabled
4507and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
Zhen Chenae765aa2016-08-08 15:49:44 -07004508relay for that domain. You can specify
4509<<sendemail.allowedDomain,sendemail.allowedDomain>> to instruct Gerrit to only
4510send as USER if USER is from those domains.
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004511+
4512* `MIXED`
4513+
Edwin Kempincdb0e002011-09-08 14:23:30 +02004514Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004515`review@example.com` is the same as <<user.email,user.email>>.
4516See below for a description of how the replacement is handled.
4517+
4518* `SERVER`
4519+
4520Gerrit will set the From header to the same name and address
4521it records in any commits Gerrit creates. This is set by
4522<<user.name,user.name>> and <<user.email,user.email>>, or guessed
4523from the local operating system.
4524+
Edwin Kempinebfbbac2015-07-01 16:02:39 +02004525* `Code Review <review@example.com>`
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004526+
4527If set to a name and email address in brackets, Gerrit will use
4528this name and email address for any messages, overriding the name
4529that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02004530Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004531which is replaced by the Full Name of the current user.
4532
4533+
4534By default, MIXED.
4535
Zhen Chenae765aa2016-08-08 15:49:44 -07004536[[sendemail.allowedDomain]]sendemail.allowedDomain::
4537+
4538Only used when `sendemail.from` is set to `USER`.
4539List of allowed domains. If user's email matches one of the domains, emails will
4540be sent as USER, otherwise as MIXED mode. Wildcards may be specified by
Maxime Guerreiroebac2d42018-03-21 13:54:51 +01004541including `\*` to match any number of characters, for example `*.example.com`
Zhen Chenae765aa2016-08-08 15:49:44 -07004542matches any subdomain of `example.com`.
4543+
4544By default, `*`.
4545
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004546[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004547+
4548Hostname (or IP address) of a SMTP server that will relay
4549messages generated by Gerrit to end users.
4550+
4551By default, 127.0.0.1 (aka localhost).
4552
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004553[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004554+
4555Port number of the SMTP server in sendemail.smtpserver.
4556+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08004557By default, 25, or 465 if smtpEncryption is 'ssl'.
4558
4559[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
4560+
4561Specify the encryption to use, either 'ssl' or 'tls'.
4562+
4563By default, 'none', indicating no encryption is used.
4564
4565[[sendemail.sslVerify]]sendemail.sslVerify::
4566+
4567If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
4568will not verify the server certificate when it connects to send
4569an email message.
4570+
4571By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004572
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004573[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004574+
4575User name to authenticate with, if required for relay.
4576
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004577[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004578+
4579Password for the account named by sendemail.smtpUser.
4580
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004581[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004582+
Gal Paikin166e4432020-09-22 19:09:45 +03004583If present, each value adds one entry to the list of allowed email
4584addresses that Gerrit can send emails to. If set to a complete
4585email address, that one address is added to the list of allowed
4586emails.
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004587If set to a domain name, any address at that domain can receive
4588email from Gerrit.
4589+
Rikard Almgren5b9de1c2019-03-12 17:55:16 +01004590If allowrcpt is configured, The set of allowed recipients is:
4591`allowrcpt - denyrcpt`.
4592+
4593By default, unset, permitting delivery to any email address.
4594
4595[[sendemail.denyrcpt]]sendemail.denyrcpt::
4596+
Gal Paikin166e4432020-09-22 19:09:45 +03004597If present, each value adds one entry to the list of email
4598addresses that Gerrit can't send emails to. If set to a complete
4599email address, that one address is added to the list of blocked
4600emails.
Rikard Almgren5b9de1c2019-03-12 17:55:16 +01004601If set to a domain name, any address at that domain can *not* receive
4602email from Gerrit.
4603+
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004604By default, unset, permitting delivery to any email address.
4605
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004606[[sendemail.includeDiff]]sendemail.includeDiff::
4607+
Bruce Zueb00ff32012-11-27 17:38:10 +08004608If true, new change emails and merged change emails from Gerrit
4609will include the complete unified diff of the change.
4610Variable maxmimumDiffSize places an upper limit on how large the
4611email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004612+
4613By default, false.
4614
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07004615[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
4616+
4617Largest size of unified diff output to include in an email. When
4618the diff exceeds this size the file paths will be listed instead.
4619Standard byte unit suffixes are supported.
4620+
4621By default, 256 KiB.
4622
Alex Blewitt9cca7402011-02-11 01:39:30 +00004623[[sendemail.importance]]sendemail.importance::
4624+
4625If present, emails sent from Gerrit will have the given level
4626of importance. Valid values include 'high' and 'low', which
4627email clients will render in different ways.
4628+
4629By default, unset, so no Importance header is generated.
4630
4631[[sendemail.expiryDays]]sendemail.expiryDays::
4632+
4633If present, emails sent from Gerrit will expire after the given
4634number of days. This will add the Expiry-Date header and
4635email clients may expire or expunge mails whose Expiry-Date
4636header is in the past. This should be a positive non-zero
4637number indicating how many days in the future the mails
4638should expire.
4639+
4640By default, unset, so no Expiry-Date header is generated.
4641
Patrick Hiesel31d60f02017-02-09 17:38:40 +01004642[[sendemail.replyToAddress]]sendemail.replyToAddress::
4643+
4644A custom Reply-To address should only be provided if Gerrit is set up to
4645receive emails and the inbound address differs from
4646<<sendemail.from,sendemail.from>>.
4647It will be set as Reply-To header on all types of outgoing email where
4648Gerrit can parse back a user's reply.
4649+
4650Defaults to an empty string which adds <<sendemail.from,sendemail.from>> as
4651Reply-To if inbound email is enabled and the review's author otherwise.
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004652
David Pursehouse917b7262017-04-21 18:18:52 +02004653[[sendemail.allowTLD]]sendemail.allowTLD::
4654+
4655List of custom TLDs to allow sending emails to in addition to those specified
Marian Harbach34253372019-12-10 18:01:31 +01004656in the link:http://data.iana.org/TLD/[IANA list,role=external,window=_blank].
David Pursehouse917b7262017-04-21 18:18:52 +02004657+
4658Defaults to an empty list, meaning no additional TLDs are allowed.
4659
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004660
4661[[sendemail.addInstanceNameInSubject]]sendemail.addInstanceNameInSubject::
4662+
4663When set to true, Gerrit will add its short name to the email subject, allowing recipients to quickly identify
4664what Gerrit instance the email came from.
4665+
4666The short name can be customized via the gerrit.instanceName option.
4667+
Luca Milanesiofdfca772018-04-04 23:42:32 +01004668Defaults to false.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004669
4670
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004671[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004672=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004673
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004674[[site.allowOriginRegex]]site.allowOriginRegex::
4675+
4676List of regular expressions matching origins that should be permitted
Shawn Pearce53ebad42017-06-10 11:14:20 -07004677to use the full Gerrit REST API. These should be trusted applications,
4678as the sites may be able to use the user's credentials. Applies to
4679all requests, including state changing methods (PUT, DELETE, POST).
4680+
4681Expressions should not require trailing slash. For example a valid
4682pattern might be `https://build-status[.]example[.]com`.
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004683+
4684By default, unset, denying all cross-origin requests.
4685
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004686[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
4687+
4688If true the server checks the site header, footer and CSS files for
4689updated versions. If false, a server restart is required to change
4690any of these resources. Default is true, allowing automatic reloads.
4691
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004692[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004693=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07004694
4695Variables in section ssh-alias permit the site administrator to alias
4696another command from Gerrit or a plugin into the `gerrit` command
4697namespace. To alias `replication start` to `gerrit replicate`:
4698
4699----
4700[ssh-alias]
4701 replicate = replication start
4702----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004703
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004704[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004705=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07004706
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02004707[[sshd.enableCompression]]sshd.enableCompression::
4708+
4709In the general case, we want to disable transparent compression, since
4710the majority of our data transfer is highly compressed Git pack files
4711and we cannot make them any smaller than they already are.
4712+
4713However, if there are CPU in abundance and the server is reachable
4714through slow networks, gits with huge amount of refs can benefit from
4715SSH-compression since git does not compress the ref announcement during
4716handshake.
4717+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02004718Compression can be especially useful when Gerrit replicas are being used
Matthias Sohnd8182ba2019-12-09 14:50:23 +01004719for the larger clones and fetches and the primary server mostly takes
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02004720small receive-packs.
4721+
4722By default, `false`.
4723
David Ostrovskye2921b62015-03-04 22:36:10 +01004724[[sshd.backend]]sshd.backend::
4725+
4726Starting from version 0.9.0 Apache SSHD project added support for NIO2
Orgad Shanehb7bb7352019-09-19 10:26:19 +03004727IoSession. To use the old MINA session the `backend` option must be set
4728to `MINA`.
David Ostrovskye2921b62015-03-04 22:36:10 +01004729+
Luca Milanesiofc1ed9c2016-03-01 18:28:36 +00004730By default, `NIO2`.
David Ostrovskye2921b62015-03-04 22:36:10 +01004731
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004732[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004733+
4734Specifies the local addresses the internal SSHD should listen
4735for connections on. The following forms may be used to specify
4736an address. In any form, `:'port'` may be omitted to use the
David Pursehousea3af2552016-08-02 14:04:44 +09004737default of `29418`.
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004738+
David Pursehousea3af2552016-08-02 14:04:44 +09004739* `'hostname':'port'` (for example `review.example.com:29418`)
4740* `'IPv4':'port'` (for example `10.0.0.1:29418`)
4741* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
4742* `+*:'port'+` (for example `+*:29418+`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004743
4744+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004745--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004746If multiple values are supplied, the daemon will listen on all
4747of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004748
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07004749To disable the internal SSHD, set listenAddress to `off`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004750
David Pursehousea3af2552016-08-02 14:04:44 +09004751By default, `*:29418`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004752--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004753
James Y Knight910bd862011-01-11 20:05:56 -05004754[[sshd.advertisedAddress]]sshd.advertisedAddress::
4755+
4756Specifies the addresses clients should be told to connect to.
4757This may differ from sshd.listenAddress if a firewall based port
4758redirector is being used, making Gerrit appear to answer on port
475922. The following forms may be used to specify an address. In any
4760form, `:'port'` may be omitted to use the default SSH port of 22.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004761
David Pursehousea3af2552016-08-02 14:04:44 +09004762* `'hostname':'port'` (for example `review.example.com:22`)
4763* `'IPv4':'port'` (for example `10.0.0.1:29418`)
4764* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
James Y Knight910bd862011-01-11 20:05:56 -05004765
4766+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004767--
James Y Knight910bd862011-01-11 20:05:56 -05004768If multiple values are supplied, the daemon will advertise all
4769of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004770
David Pursehousea3af2552016-08-02 14:04:44 +09004771By default uses the value of `sshd.listenAddress`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004772--
James Y Knight910bd862011-01-11 20:05:56 -05004773
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004774[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07004775+
4776If true, enables TCP keepalive messages to the other side, so
4777the daemon can terminate connections if the peer disappears.
4778+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02004779Only effective when `sshd.backend` is set to `MINA`.
4780+
David Pursehousea3af2552016-08-02 14:04:44 +09004781By default, `true`.
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07004782
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004783[[sshd.threads]]sshd.threads::
4784+
4785Number of threads to use when executing SSH command requests.
4786If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09004787are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004788+
Florian Klink2a389462019-07-23 14:14:32 +02004789By default, 2x the number of CPUs available to the JVM (but at least 4
4790threads).
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02004791+
4792[NOTE]
4793When SSH daemon is enabled then this setting also defines the max number of
4794concurrent Git requests for interactive users over SSH and HTTP together.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004795
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004796[[sshd.batchThreads]]sshd.batchThreads::
4797+
4798Number of threads to allocate for SSH command requests from
Patrick Hiesele587c402020-08-07 16:11:29 +02004799link:access-control.html#service_users[service users].
Fredrik Luthander46843022012-03-13 16:11:02 +01004800If equals to 0, then all non-interactive requests are executed in the same
4801queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004802+
4803Any other value will remove the number of threads from the queue
4804allocated to interactive users, and create a separate thread pool
4805of the requested size, which will be used to run commands from
Patrick Hiesele587c402020-08-07 16:11:29 +02004806service users.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004807+
Patrick Hiesele587c402020-08-07 16:11:29 +02004808If the number of threads requested for service users is larger
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004809than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09004810value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004811+
Dariusz Luksza145de472015-11-09 18:44:35 +01004812By default is 1 on single core node, 2 otherwise.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02004813+
4814[NOTE]
4815When SSH daemon is enabled then this setting also defines the max number of
4816concurrent Git requests for batch users over SSH and HTTP together.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004817
Kenny Root15ac1b82010-02-24 00:29:20 -08004818[[sshd.streamThreads]]sshd.streamThreads::
4819+
4820Number of threads to use when formatting events to asynchronous
4821streaming clients. Event formatting is multiplexed onto this thread
4822pool by a simple FIFO scheduling system.
4823+
4824By default, 1 plus the number of CPUs available to the JVM.
4825
Edwin Kempinb5df3b82011-10-10 11:31:14 +02004826[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07004827+
4828Number of threads used to parse a command line submitted by a client
4829over SSH for execution, create the internal data structures used by
4830that command, and schedule it for execution on another thread.
4831+
4832By default, 2.
4833
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004834[[sshd.maxAuthTries]]sshd.maxAuthTries::
4835+
4836Maximum number of authentication attempts before the server
4837disconnects the client. Each public key that a client has loaded
4838into its local agent counts as one auth request. Users can work
4839around the server's limit by loading less keys into their agent,
4840or selecting a specific key in their `~/.ssh/config` file with
4841the `IdentityFile` option.
4842+
4843By default, 6.
4844
4845[[sshd.loginGraceTime]]sshd.loginGraceTime::
4846+
4847Time in seconds that a client has to authenticate before the server
4848automatically terminates their connection. Values should use common
4849unit suffixes to express their setting:
4850+
4851* s, sec, second, seconds
4852* m, min, minute, minutes
4853* h, hr, hour, hours
4854* d, day, days
4855
4856+
4857By default, 2 minutes.
4858
Christian Aistleitner3d794592013-04-08 00:19:40 +02004859[[sshd.idleTimeout]]sshd.idleTimeout::
4860+
4861Time in seconds after which the server automatically terminates idle
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00004862connections (or 0 to disable closing of idle connections) not waiting for
4863any server operation to complete.
4864Values should use common unit suffixes to express their setting:
Christian Aistleitner3d794592013-04-08 00:19:40 +02004865+
4866* s, sec, second, seconds
4867* m, min, minute, minutes
4868* h, hr, hour, hours
4869* d, day, days
4870
4871+
4872By default, 0.
4873
Paladox nonedaafdb62017-10-14 16:18:42 +00004874[[sshd.waitTimeout]]sshd.waitTimeout::
4875+
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00004876Time in seconds after which the server automatically terminates
4877connections waiting for a server operation to complete, like for instance
4878cloning a very large repo with lots of refs.
Paladox nonedaafdb62017-10-14 16:18:42 +00004879Values should use common unit suffixes to express their setting:
4880+
4881* s, sec, second, seconds
4882* m, min, minute, minutes
4883* h, hr, hour, hours
4884* d, day, days
4885
4886+
4887By default, 30s.
4888
Thomas Draebing2c7346a2020-08-03 17:51:15 +02004889[[sshd.gracefulStopTimeout]]sshd.gracefulStopTimeout::
4890+
4891Set a graceful stop time. If set, Gerrit ensures that all open SSH
4892sessions are preserved for a maximum period of time, before forcing the
4893shutdown of the SSH daemon. During this period, no new requests
4894will be accepted. This option is meant to be used in setups performing
4895rolling restarts.
4896+
4897Values should use common unit suffixes to express their setting:
4898+
4899* s, sec, second, seconds
4900* m, min, minute, minutes
4901+
4902By default, 0 seconds (immediate shutdown).
4903
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004904[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
4905+
4906Maximum number of concurrent SSH sessions that a user account
4907may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09004908that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004909the number of commands a user may issue over a single connection.
4910If set to 0, there is no limit.
4911+
4912By default, 64.
4913
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004914[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004915+
4916Available ciphers. To permit multiple ciphers, specify multiple
4917`sshd.cipher` keys in the configuration file, one cipher name
4918per key. Cipher names starting with `+` are enabled in addition
4919to the default ciphers, cipher names starting with `-` are removed
4920from the default cipher set.
4921+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004922Supported ciphers:
4923+
4924* `aes128-ctr`
4925* `aes192-ctr`
4926* `aes256-ctr`
4927* `aes128-cbc`
4928* `aes192-cbc`
4929* `aes256-cbc`
4930* `blowfish-cbc`
4931* `3des-cbc`
4932* `arcfour128`
4933* `arcfour256`
4934* `none`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004935+
4936By default, all supported ciphers except `none` are available.
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004937+
4938If your setup allows for it, it's recommended to disable all ciphers except
4939the AES-CTR modes.
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004940
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004941[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004942+
4943Available MAC (message authentication code) algorithms. To permit
4944multiple algorithms, specify multiple `sshd.mac` keys in the
4945configuration file, one MAC per key. MAC names starting with `+`
4946are enabled in addition to the default MACs, MAC names starting with
4947`-` are removed from the default MACs.
4948+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004949Supported MACs:
4950+
4951* `hmac-md5`
4952* `hmac-md5-96`
4953* `hmac-sha1`
4954* `hmac-sha1-96`
4955* `hmac-sha2-256`
4956* `hmac-sha2-512`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004957+
4958By default, all supported MACs are available.
4959
Scott Dialb4a04fa2016-03-15 09:44:11 -04004960[[sshd.kex]]sshd.kex::
4961+
4962--
4963Available key exchange algorithms. To permit multiple algorithms,
4964specify multiple `sshd.kex` keys in the configuration file, one key
4965exchange algorithm per key. Key exchange algorithm names starting
4966with `+` are enabled in addition to the default key exchange
4967algorithms, key exchange algorithm names starting with `-` are
4968removed from the default key exchange algorithms.
4969
4970In the following example configuration, support for the 1024-bit
4971`diffie-hellman-group1-sha1` key exchange is disabled while leaving
4972all of the other default algorithms enabled:
4973
4974----
4975[sshd]
4976 kex = -diffie-hellman-group1-sha1
4977----
4978
4979Supported key exchange algorithms:
4980
4981* `ecdh-sha2-nistp521`
4982* `ecdh-sha2-nistp384`
4983* `ecdh-sha2-nistp256`
4984* `diffie-hellman-group-exchange-sha256`
4985* `diffie-hellman-group-exchange-sha1`
4986* `diffie-hellman-group14-sha1`
4987* `diffie-hellman-group1-sha1`
4988
4989By default, all supported key exchange algorithms are available.
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004990
4991It is strongly recommended to disable at least `diffie-hellman-group1-sha1`
4992as it's known to be vulnerable (logjam attack). Additionally, if your setup
4993allows for it, it is recommended to disable the remaining two `sha1` key
4994exchange algorithms.
Scott Dialb4a04fa2016-03-15 09:44:11 -04004995--
4996
Alex Blewitt7efb06f2013-04-01 12:46:48 -04004997[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
4998+
4999Enable kerberos authentication for SSH connections. To permit
5000kerberos authentication, the server must have a host principal
5001(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
5002This must be provisioned by the kerberos administrators, and is
5003typically installed into `/etc/krb5.keytab` on host machines.
5004+
5005The keytab must contain at least one `host/` principal, typically
5006using the host's canonical name. If it does not use the
5007canonical name, the `sshd.kerberosPrincipal` should be configured
5008with the correct name.
5009+
5010By default, not set and so kerberos authentication is not enabled.
5011
5012[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
5013+
5014If kerberos authentication is enabled with `sshd.kerberosKeytab`,
5015instead use the given principal name instead of the default.
5016If the principal does not begin with `host/` a warning message is
5017printed and may prevent successful authentication.
5018+
5019This may be useful if the host is behind an IP load balancer or
5020other SSH forwarding systems, since the principal name is constructed
5021by the client and must match for kerberos authentication to work.
5022+
5023By default, `host/canonical.host.name`
5024
Shawn Pearce318bfca2013-10-17 22:15:38 -07005025[[sshd.requestLog]]sshd.requestLog::
5026+
5027Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
5028If enabled, a request log file is written out by the SSH daemon.
Matthias Sohn450bc202020-08-20 14:40:32 +02005029The sshd log format is documented link:logs.html#_sshd_log[here].
Shawn Pearce318bfca2013-10-17 22:15:38 -07005030+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01005031`log4j.appender` with the name `sshd_log` can be configured to overwrite
5032programmatic configuration.
5033+
David Pursehousea3af2552016-08-02 14:04:44 +09005034By default, `true`.
Gustaf Lundh4e859932018-04-16 10:56:31 +02005035+
Sven Selberg2a0beab2018-04-20 14:49:20 +02005036This value supports link:#reloadConfig[configuration reloads].
Shawn Pearce318bfca2013-10-17 22:15:38 -07005037
David Ostrovsky985201b2015-03-04 22:37:33 +01005038[[sshd.rekeyBytesLimit]]sshd.rekeyBytesLimit::
5039+
5040The SSH daemon will issue a rekeying after a certain amount of data.
5041This configuration option allows you to tweak that setting.
5042+
5043By default, 1073741824 (bytes, 1GB).
5044+
David Pursehousea3af2552016-08-02 14:04:44 +09005045The `rekeyBytesLimit` cannot be set to lower than 32.
David Ostrovsky985201b2015-03-04 22:37:33 +01005046
5047[[sshd.rekeyTimeLimit]]sshd.rekeyTimeLimit::
5048+
5049The SSH daemon will issue a rekeying after a certain amount of time.
5050This configuration option allows you to tweak that setting.
5051+
5052By default, 1h.
5053+
5054Set to 0 to disable this check.
5055
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005056[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005057=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07005058
Sven Selberg42d9d292014-08-13 11:20:11 +02005059[[suggest.maxSuggestedReviewers]]suggest.maxSuggestedReviewers::
5060+
5061The maximum numbers of reviewers suggested.
5062+
5063By default 10.
Gustaf Lundh25e608f2018-04-16 10:54:53 +02005064+
Sven Selberg2a0beab2018-04-20 14:49:20 +02005065This value supports link:#reloadConfig[configuration reloads].
Sven Selberg42d9d292014-08-13 11:20:11 +02005066
Edwin Kempinf957dc22012-10-19 20:41:18 +02005067[[suggest.from]]suggest.from::
5068+
5069The number of characters that a user must have typed before suggestions
Patrick Hiesel87880b02016-05-03 18:15:08 +02005070are provided. If set to 0, suggestions are always provided. This is only
5071used for suggesting accounts when adding members to a group.
Edwin Kempinf957dc22012-10-19 20:41:18 +02005072+
5073By default 0.
Gal Paikin0d07c542020-01-08 17:11:53 +02005074[[suggest.relevantChanges]]suggest.relevantChanges::
5075+
5076When suggesting reviewers, we go over recent changes of the user, and
5077give priority to users that are present as reviewers in any of those
5078changes. The number of changes we go over is `sugggest.relevantChanges`.
5079+
Gal Paikincb5a7ca2020-02-18 09:44:28 +01005080This nubmer is a tradeoff between speed and accuracy.
Gal Paikin0d07c542020-01-08 17:11:53 +02005081A high number would be accurate but slow, and a low number would be
5082fast but inaccurate.
Gal Paikincb5a7ca2020-02-18 09:44:28 +01005083+
5084By default 50.
Edwin Kempinf957dc22012-10-19 20:41:18 +02005085
Edwin Kempin0a49eca2019-06-21 09:38:46 +02005086[[tracing]]
5087=== Section tracing
5088
5089[[tracing.performanceLogging]]tracing.performanceLogging::
5090+
5091Whether performance logging is enabled.
5092+
5093When performance logging is enabled, performance events for some
5094operations are collected in memory while a request is running. At the
5095end of the request the performance events are handed over to the
5096link:dev-plugins.html#performance-logger[PerformanceLogger] plugins.
5097This means if performance logging is enabled, the memory footprint of
5098requests is slightly increased.
5099+
5100This setting has no effect if no
5101link:dev-plugins.html#performance-logger[PerformanceLogger] plugins are
5102installed, because then performance logging is always disabled.
5103+
5104By default, true.
5105
Edwin Kempin2cba2982019-07-05 13:19:43 +02005106[[tracing.traceid]]
5107==== Subsection tracing.<trace-id>
5108
5109There can be multiple `tracing.<trace-id>` subsections to configure
5110automatic tracing of requests. To be traced a request must match all
5111conditions of one `tracing.<trace-id>` subsection. The subsection name
5112is used as trace ID. Using this trace ID administrators can find
5113matching log entries.
5114
5115[[tracing.traceid.requestType]]tracing.<trace-id>.requestType::
5116+
5117Type of request for which request tracing should be always enabled (can
5118be `GIT_RECEIVE`, `GIT_UPLOAD`, `REST` and `SSH`).
5119+
5120May be specified multiple times.
5121+
5122By default, unset (all request types are matched).
5123
Edwin Kempinb0ddb0b2019-07-08 12:11:32 +02005124[[tracing.traceid.requestUriPattern]]tracing.<trace-id>.requestUriPattern::
5125+
5126Regular expression to match request URIs for which request tracing
5127should be always enabled. Request URIs are only available for REST
5128requests. Request URIs never include the '/a' prefix.
5129+
5130May be specified multiple times.
5131+
5132By default, unset (all request URIs are matched).
5133
Edwin Kempin2cba2982019-07-05 13:19:43 +02005134[[tracing.traceid.account]]tracing.<trace-id>.account::
5135+
5136Account ID of an account for which request tracing should be always
5137enabled.
5138+
5139May be specified multiple times.
5140+
5141By default, unset (all accounts are matched).
5142
5143[[tracing.traceid.projectPattern]]tracing.<trace-id>.projectPattern::
5144+
5145Regular expression to match project names for which request tracing
5146should be always enabled.
5147+
5148May be specified multiple times.
5149+
5150By default, unset (all projects are matched).
5151
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005152[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005153=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07005154
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07005155Tagged footer lines containing references to external
5156tracking systems, parsed out of the commit message and
David Pursehoused55a6b62015-02-27 17:39:38 +09005157saved in Gerrit's secondary index.
Shawn Pearceff61c8a2013-10-07 19:35:53 -07005158
5159After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08005160must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07005161
Edwin Kempinbb421f12011-08-25 11:19:00 +02005162The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07005163bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07005164
5165----
5166[trackingid "jira-bug"]
5167 footer = Bugfix:
David Pursehousece7f6862015-02-19 14:52:45 +09005168 footer = Bug:
Goran Lungberg04132a12010-06-15 17:20:37 -07005169 match = JRA\\d{2,8}
5170 system = JIRA
5171
5172[trackingid "jira-feature"]
5173 footer = Feature
5174 match = JRA(\\d{2,8})
5175 system = JIRA
5176----
5177
5178[[trackingid.name.footer]]trackingid.<name>.footer::
5179+
David Pursehousece7f6862015-02-19 14:52:45 +09005180A prefix tag that identifies the footer line to parse for tracking ids.
5181+
5182Several trackingid entries can have the same footer tag, and a single trackingid
5183entry can have multiple footer tags.
5184+
5185If multiple footer tags are specified, each tag will be parsed separately and
5186duplicates will be ignored.
5187+
5188The trailing ":" is optional.
Goran Lungberg04132a12010-06-15 17:20:37 -07005189
5190[[trackingid.name.match]]trackingid.<name>.match::
5191+
Magnus Bäcke5611832011-02-02 08:57:15 +01005192A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +01005193Java regular expression (java.util.regex),role=external,window=_blank] used to match the
Magnus Bäcke5611832011-02-02 08:57:15 +01005194external tracking id part of the footer line. The match can
5195result in several entries in the DB. If grouping is used in the
5196regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01005197Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07005198+
5199The configuration file parser eats one level of backslashes, so the
5200character class `\s` requires `\\s` in the configuration file. The
5201parser also terminates the line at the first `#`, so a match
5202expression containing # must be wrapped in double quotes.
5203
5204[[trackingid.name.system]]trackingid.<name>.system::
5205+
David Pursehouse221d4f62012-06-08 17:38:08 +09005206The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07005207It is possible to have several trackingid entries for the same
5208tracking system.
5209
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005210[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005211=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07005212
5213[[transfer.timeout]]transfer.timeout::
5214+
5215Number of seconds to wait for a single network read or write
5216to complete before giving up and declaring the remote side is
5217not responding. If 0, there is no timeout, and this server will
5218wait indefinitely for a transfer to finish.
5219+
5220A timeout should be large enough to mostly transfer the objects to
5221the other side. 1 second may be too small for larger projects,
5222especially over a WAN link, while 10-30 seconds is a much more
5223reasonable timeout value.
5224+
5225Defaults to 0 seconds, wait indefinitely.
5226
lincoln2be11602010-07-05 10:53:25 -03005227
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005228[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005229=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005230
Dave Borowitzb1795142017-10-12 07:13:37 -07005231Options to control the behavior of `upload-pack` on the server side,
5232which handles a user's fetch, clone, or repo sync command.
lincoln2be11602010-07-05 10:53:25 -03005233
5234----
5235[upload]
5236 allowGroup = GROUP_ALLOWED_TO_EXECUTE
5237 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
5238----
5239
5240[[upload.allowGroup]]upload.allowGroup::
5241+
Dave Borowitzb1795142017-10-12 07:13:37 -07005242Name of the groups of users that are allowed to execute 'upload-pack'.
5243One or more groups can be set.
lincoln2be11602010-07-05 10:53:25 -03005244+
5245If no groups are added, any user will be allowed to execute
5246'upload-pack' on the server.
5247
Owen Lie2877bb2017-07-14 09:11:20 -04005248[[accountDeactivation]]
5249=== Section accountDeactivation
5250
5251Configures the parameters for the scheduled task to sweep and deactivate Gerrit
5252accounts according to their status reported by the auth backend. Currently only
5253supported for LDAP backends.
5254
5255[[accountDeactivation.startTime]]accountDeactivation.startTime::
5256+
Edwin Kempind33d95a2018-02-16 11:44:04 +01005257The link:#schedule-configuration-startTime[start time] for running
5258account deactivations.
Owen Lie2877bb2017-07-14 09:11:20 -04005259
5260[[accountDeactivation.interval]]accountDeactivation.interval::
5261+
Edwin Kempind33d95a2018-02-16 11:44:04 +01005262The link:#schedule-configuration-interval[interval] for running
5263account deactivations.
5264
Saša Živkovf0966112020-03-17 12:20:31 +01005265Note that the task will only be scheduled if the
5266link:#autoUpdateAccountActiveStatus[auth.autoUpdateAccountActiveStatus]
5267is set to true.
5268
Edwin Kempind33d95a2018-02-16 11:44:04 +01005269link:#schedule-configuration-examples[Schedule examples] can be found
5270in the link:#schedule-configuration[Schedule Configuration] section.
Owen Lie2877bb2017-07-14 09:11:20 -04005271
Stefan Beller0f724ff2015-07-17 10:17:51 -07005272[[submodule]]
5273=== Section submodule
5274
Shawn Pearcedc477cd2016-03-24 19:56:18 -07005275[[submodule.verbosesuperprojectupdate]]submodule.verboseSuperprojectUpdate::
Stefan Beller0f724ff2015-07-17 10:17:51 -07005276+
5277When using link:user-submodules.html#automatic_update[automatic superproject updates]
Zhen Chenc877ca92016-07-27 14:22:37 -07005278this option will determine how the submodule commit messages are included into
Stefan Beller0f724ff2015-07-17 10:17:51 -07005279the commit message of the superproject update.
5280+
Zhen Chenc877ca92016-07-27 14:22:37 -07005281If `FALSE`, will not include any commit messages for the gitlink update.
5282+
5283If `SUBJECT_ONLY`, will include only the commit subjects.
5284+
5285If `TRUE`, will include full commit messages.
5286+
5287By default this is `TRUE`.
Stefan Beller0f724ff2015-07-17 10:17:51 -07005288
Shawn Pearcedc477cd2016-03-24 19:56:18 -07005289[[submodule.enableSuperProjectSubscriptions]]submodule.enableSuperProjectSubscriptions::
Stefan Beller8cc252e2016-03-10 10:06:53 -08005290+
5291This allows to enable the superproject subscription mechanism.
5292+
5293By default this is true.
Stefan Beller0f724ff2015-07-17 10:17:51 -07005294
Patrick Hiesel44e5d6e2017-08-24 16:07:26 +02005295[[submodule.maxCombinedCommitMessageSize]]submodule.maxCombinedCommitMessageSize::
5296+
5297This allows to limit the length of the commit message for a submodule.
5298+
5299By default this is 262144 (256 KiB).
5300+
5301Common unit suffixes of k, m, or g are supported.
5302
5303[[submodule.maxCommitMessages]]submodule.maxCommitMessages::
5304+
5305This allows to limit the number of commit messages that should be combined when creating
5306a commit message for a submodule.
5307+
5308By default this is 1000.
5309
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005310[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005311=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005312
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005313[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005314+
5315Name that Gerrit calls itself in Git when it creates a new Git
5316commit, such as a merge during change submission.
5317+
5318By default this is "Gerrit Code Review".
5319
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005320[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005321+
5322Email address that Gerrit refers to itself as when it creates a
5323new Git commit, such as a merge commit during change submission.
5324+
5325If not set, Gerrit generates this as "gerrit@`hostname`", where
5326`hostname` is the hostname of the system Gerrit is running on.
5327+
5328By default, not set, generating the value at startup.
5329
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005330[[user.anonymousCoward]]user.anonymousCoward::
5331+
David Pursehousea1d633b2014-05-02 17:21:02 +09005332Username that is displayed in the Gerrit Web UI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005333notifications if the full name of the user is not set.
5334+
Han-Wen Nienhuys3fb723d2017-11-20 19:21:13 +01005335By default "Name of user not set" is used.
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005336
Edwin Kempind33d95a2018-02-16 11:44:04 +01005337[[schedule-configuration]]
5338=== Schedule Configuration
5339
5340Schedule configurations are used for running periodic background jobs.
5341
5342A schedule configuration consists of two parameters:
5343
5344[[schedule-configuration-interval]]
5345* `interval`:
5346Interval for running the periodic background job. The interval must be
5347larger than zero. The following suffixes are supported to define the
5348time unit for the interval:
5349** `s`, `sec`, `second`, `seconds`
5350** `m`, `min`, `minute`, `minutes`
5351** `h`, `hr`, `hour`, `hours`
5352** `d`, `day`, `days`
5353** `w`, `week`, `weeks` (`1 week` is treated as `7 days`)
5354** `mon`, `month`, `months` (`1 month` is treated as `30 days`)
5355** `y`, `year`, `years` (`1 year` is treated as `365 days`)
5356
5357[[schedule-configuration-startTime]]
5358* `startTime`:
5359The start time defines the first execution of the periodic background
5360job. If the configured `interval` is shorter than `startTime - now` the
5361start time will be preponed by the maximum integral multiple of
5362`interval` so that the start time is still in the future. `startTime`
5363must have one of the following formats:
5364
5365** `<day of week> <hours>:<minutes>`
5366** `<hours>:<minutes>`
5367
5368+
5369The placeholders can have the following values:
5370
5371*** `<day of week>`:
5372`Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`
5373*** `<hours>`:
5374`00`-`23`
5375*** `<minutes>`:
5376`00`-`59`
5377
5378+
5379The time zone cannot be specified but is always the system default
David Pursehouse18f388a2019-04-10 09:36:18 +09005380time zone. Hours must be zero-padded, i.e. `06:00` rather than `6:00`.
Edwin Kempind33d95a2018-02-16 11:44:04 +01005381
5382The section (and optionally the subsection) in which the `interval` and
5383`startTime` keys must be set depends on the background job for which a
5384schedule should be configured. E.g. for the change cleanup job the keys
5385must be set in the link:#changeCleanup[changeCleanup] section:
5386
5387----
5388 [changeCleanup]
5389 startTime = Fri 10:30
5390 interval = 2 days
5391----
5392
5393[[schedule-configuration-examples]]
5394Examples for a schedule configuration:
5395
5396* Example 1:
5397+
5398----
5399 startTime = Fri 10:30
5400 interval = 2 days
5401----
5402+
5403Assuming that the server is started on `Mon 07:00` then
5404`startTime - now` is `4 days 3:30 hours`. This is larger than the
5405interval hence the start time is preponed by the maximum integral
5406multiple of the interval so that start time is still in the future,
5407i.e. preponed by 4 days. This yields a start time of `Mon 10:30`, next
5408executions are `Wed 10:30`, `Fri 10:30`. etc.
5409
5410* Example 2:
5411+
5412----
5413 startTime = 06:00
5414 interval = 1 day
5415----
5416+
5417Assuming that the server is started on `Mon 07:00` then this yields the
5418first run on Tuesday at 06:00 and a repetition interval of 1 day.
5419
Dave Borowitzd4fdc932018-11-02 15:06:25 -07005420[[All-Projects-project.config]]
5421== File `etc/All-Projects/project.config`
5422
5423The optional file `'$site_path'/etc/All-Projects/project.config` provides
5424defaults for configuration read from
5425link:config-project-config.html[`project.config`] in the
5426`All-Projects` repo. Unlike `gerrit.config`, this file contains project-type
5427configuration rather than server-type configuration.
5428
5429Most administrators will not need this file, and should instead make commits to
5430`All-Projects` to modify global config. However, a separate file can be useful
5431when managing multiple Gerrit servers, since pushing changes to defaults using
5432Puppet or a similar tool can be easier than scripting git updates to
5433`All-Projects`.
5434
5435The contents of the file are loaded each time the `All-Projects` project is
5436reloaded. Updating the file requires either evicting the project cache or
5437restarting the server.
5438
5439Caveats:
5440
5441* The path from which the file is read corresponds to the name of the repo,
5442 which is link:#gerrit.allProjects[configurable].
5443* Although the file lives in a directory that shares a name with a repository,
5444 this directory is not a Git repository.
5445* Only the file `project.config` is read from this directory to provide
5446 defaults; any other files in this directory, such as `rules.pl`, are ignored.
5447 (This behavior may change in the future.)
5448* Group names listed in the access config in this file are resolved to UUIDs
5449 using the `groups` file in the repository, not in the config directory. As a
5450 result, setting ACLs in this file is not recommended.
5451
Hector Oswaldo Caballero98952b02017-08-24 06:31:28 -04005452[[secure.config]]
5453== File `etc/secure.config`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005454
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005455The optional file `'$site_path'/etc/secure.config` overrides (or
5456supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005457The file should be readable only by the daemon process and can be
5458used to contain private configuration entries that wouldn't normally
5459be exposed to everyone.
5460
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005461Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005462----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07005463[auth]
5464 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
5465
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005466[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005467 username = webuser
5468 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005469
5470[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005471 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005472
5473[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005474 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005475
5476[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005477 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07005478
5479[remote "bar"]
5480 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005481----
5482
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005483== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01005484
5485The optional file `'$site_path'/etc/peer_keys` controls who can
5486login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
5487command.
5488
David Pursehouse90bed3f2020-06-09 22:07:19 +02005489The format is one Base-64 encoded public key per line with optional comment, e.g.:
5490----
5491# Comments allowed at start of line
5492AAAAC3...51R== john@example.net
5493# Another comment
5494AAAAB5...21S== jane@example.net
5495----
Johan Bjork3e5ee302012-01-27 17:59:54 +01005496
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005497=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005498
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005499site_path::
5500+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005501Local filesystem directory holding the site customization assets.
5502Placing this directory under version control and/or backup is a
5503good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005504+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005505Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005506+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005507Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005508+
Dave Borowitz1e49e142013-04-09 12:14:57 -07005509* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005510
Saša Živkovd34dfe32017-11-20 11:14:35 +01005511[[jgitConfig]]
5512== File `etc/jgit.config`
5513
5514Gerrit uses the `$site_path/etc/jgit.config` file instead of the
5515system-wide and user-global Git configuration for its runtime JGit
5516configuration.
5517
5518Sample `etc/jgit.config` file:
5519----
5520[core]
5521 trustFolderStat = false
5522----
5523
Matthias Sohn85c18792020-09-08 01:42:03 +02005524[[jgit-gc]]
5525=== Section gc
5526
5527Options in section gc are used when command link:cmd-gc.html[gerrit gc] is used
5528or scheduled via options link:cmd-gc.html#gc.startTime[gc.startTime] and
5529link:cmd-gc.html#gc.interval[gc.interval].
5530
5531[[gc.auto]]gc.auto::
5532+
5533When there are approximately more than this many loose objects in the repository,
5534auto gc will pack them. Some commands use this command to perform a light-weight
5535garbage collection from time to time. The default value is 6700.
5536+
5537Setting this to 0 disables not only automatic packing based on the number of
5538loose objects, but any other heuristic auto gc will otherwise use to determine
5539if there’s work to do, such as link:#gc.autoPackLimit[gc.autoPackLimit].
5540
5541[[gc.autodetach]]gc.autodetach::
5542+
5543Makes auto gc run in a background thread. Default is `true`.
5544
5545[[gc.autopacklimit]]gc.autopacklimit::
5546+
5547When there are more than this many packs that are not marked with `*.keep` file
5548in the repository, auto gc consolidates them into one larger pack. The
5549default value is 50. Setting this to 0 disables it. Setting `gc.auto` to 0 will
5550also disable this.
5551
5552[[gc.packRefs]]gc.packRefs::
5553+
5554This variable determines whether gc runs git pack-refs. The default is `true`.
5555
5556[[gc.reflogExpire]]gc.reflogExpire::
5557+
5558Removes reflog entries older than this time; defaults to 90 days. The value "now"
5559expires all entries immediately, and "never" suppresses expiration altogether.
5560
5561[[gc.reflogExpireUnreachable]]gc.reflogExpireUnreachable::
5562+
5563Removes reflog entries older than this time and not reachable from the
5564current tip; defaults to 30 days. The value "now" expires all entries immediately,
5565and "never" suppresses expiration altogether.
5566
Matthias Sohnbf7ca5a2020-09-08 00:57:20 +02005567[[jgit-protocol]]
5568=== Section protocol
5569
5570[[protocol.version]]protocol.version::
5571+
5572If set, the server will accept requests from a client attempting to communicate
5573using the specified protocol version. Otherwise communication falls back to version 0.
5574If set in file `etc/jgit.config` this option will be used for all repositories of
5575the site. It can be overridden for a given repository by configuring a different
5576value in the repository's `config` file.
5577+
5578Supported versions:
55790:: the original wire protocol.
55801:: the original wire protocol with the addition of a version string in the initial response from the server.
55812:: wire protocol version 2. Speeds up fetches from repositories with many refs by allowing the client
5582 to specify which refs to list before the server lists them.
5583
Matthias Sohn85c18792020-09-08 01:42:03 +02005584[[jgit-receive]]
5585=== Section receive
5586
5587[[receive.autogc]]receive.autogc::
5588+
5589By default, `git-receive-pack` will run auto gc after receiving data from git-push and updating refs.
5590You can stop it by setting this variable to `false`. This is recommended in gerrit to avoid the
5591additional load this creates. Instead schedule gc using link:cmd-gc.html#gc.startTime[gc.startTime]
5592and link:cmd-gc.html#gc.interval[gc.interval] or e.g. in a cron job that runs gc in a separate process.
5593
Shawn O. Pearce5500e692009-05-28 15:55:01 -07005594GERRIT
5595------
5596Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07005597
5598SEARCHBOX
5599---------