blob: 95d78de9ba5ea37ffa218f6ea727b373df494a41 [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+
687Whether to skip the full ref visibility checks as a performance shortcut when all refs are
688visible to a user. Full ref filtering would filter out things like pending edits.
689+
690By default, true.
691
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800692[[cache]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800693=== Section cache
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700694
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700695[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700696+
697Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700698future lookup. This local disk cache is used to retain potentially
699expensive to compute information across restarts. If the location
700does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700701+
David Pursehousea61ee502016-09-06 16:27:09 +0900702Technically, cached entities are persisted as a set of H2 databases
Saša Živkove607d6c2016-02-24 10:46:46 +0000703inside this directory.
704+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700705If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700706+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700707Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700708
Saša Živkovf3134572016-02-09 11:42:46 +0100709[[cache.h2CacheSize]]cache.h2CacheSize::
710+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200711The size of the in-memory cache for each opened H2 cache database, in bytes.
Saša Živkove607d6c2016-02-24 10:46:46 +0000712+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200713Some caches of Gerrit are persistent and are backed by an H2 database.
Saša Živkove607d6c2016-02-24 10:46:46 +0000714H2 uses memory to cache its database content. The parameter `h2CacheSize`
715allows to limit the memory used by H2 and thus prevent out-of-memory
Saša Živkovf3134572016-02-09 11:42:46 +0100716caused by the H2 database using too much memory.
717+
Dave Borowitz3d1f85c2018-11-16 15:36:04 -0800718Technically the H2 cache size is configured using the CACHE_SIZE parameter in
719the H2 JDBC connection URL, as described
Marian Harbach34253372019-12-10 18:01:31 +0100720link:http://www.h2database.com/html/features.html#cache_settings[here,role=external,window=_blank]
Saša Živkovf3134572016-02-09 11:42:46 +0100721+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200722Default is unset, using up to half of the available memory.
David Pursehousee6976dc2017-06-30 16:33:44 +0900723+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200724H2 will persist this value in the database, so to unset explicitly specify 0.
Saša Živkovf3134572016-02-09 11:42:46 +0100725+
726Common unit suffixes of 'k', 'm', or 'g' are supported.
727
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200728[[cache.h2AutoServer]]cache.h2AutoServer::
729+
730If set to true, enable H2 autoserver mode for the H2-backed persistent cache
731databases.
732+
Marian Harbach34253372019-12-10 18:01:31 +0100733See link:http://www.h2database.com/html/features.html#auto_mixed_mode[here,role=external,window=_blank]
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200734for detail.
735+
736Default is false.
737
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700738[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700739+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700740Maximum age to keep an entry in the cache. Entries are removed from
741the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700742Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700743+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700744* s, sec, second, seconds
745* m, min, minute, minutes
746* h, hr, hour, hours
747* d, day, days
748* w, week, weeks (`1 week` is treated as `7 days`)
749* mon, month, months (`1 month` is treated as `30 days`)
750* y, year, years (`1 year` is treated as `365 days`)
751
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700752+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200753--
Edwin Kempinabcd5042013-03-12 16:04:37 +0100754If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700755supplied, the maximum age is infinite and items are never purged
756except when the cache is full.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200757
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700758Default is `0`, meaning store forever with no expire, except:
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200759
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400760* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700761* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700762* `"web_sessions"`: default is `12 hours`
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200763--
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700764
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700765[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700766+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700767The total cost of entries to retain in memory. The cost computation
768varies by the cache. For most caches where the in-memory size of each
769entry is relatively the same, memoryLimit is currently defined to be
770the number of entries held by the cache (each entry costs 1).
771+
772For caches where the size of an entry can vary significantly between
773individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
774is an approximation of the total number of bytes stored by the cache.
775Larger entries that represent bigger patch sets or longer source files
776will consume a bigger portion of the memoryLimit. For these caches the
777memoryLimit should be set to roughly the amount of RAM (in bytes) the
778administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700779+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700780Default is 1024 for most caches, except:
781+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400782* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700783* `"diff"`: default is `10m` (10 MiB of memory)
784* `"diff_intraline"`: default is `10m` (10 MiB of memory)
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200785* `"diff_summary"`: default is `10m` (10 MiB of memory)
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400786* `"external_ids_map"`: default is `2` and should not be changed
Edwin Kempind967ec42017-11-13 15:14:41 +0100787* `"groups"`: default is unlimited
788* `"groups_byname"`: default is unlimited
789* `"groups_byuuid"`: default is unlimited
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700790* `"plugin_resources"`: default is 2m (2 MiB of memory)
791
792+
793If set to 0 the cache is disabled. Entries are removed immediately
794after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700795
Dave Borowitz08bac5ca2018-06-05 14:58:28 -0400796[[cache.name.expireFromMemoryAfterAccess]]cache.<name>.expireFromMemoryAfterAccess::
797+
798Time after last access to automatically expire entries from an in-memory
799cache. If 0 or not specified, entries are never expired in this manner.
800Values may use unit suffixes as in link:#cache.name.maxAge[maxAge].
801+
802This option only applies to in-memory caches; persistent cache values are
803not expired in this manner, and are only pruned via
804link:#cache.name.diskLimit[diskLimit].
805
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700806[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700807+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700808Total size in bytes of the keys and values stored on disk. Caches that
809have grown bigger than this size are scanned daily at 1 AM local
810server time to trim the cache. Entries are removed in least recently
811accessed order until the cache fits within this limit. Caches may
812grow larger than this during the day, as the size check is only
813performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700814+
Saša Živkove789f2e2016-09-22 10:37:34 +0200815Default is 128 MiB per cache, except:
816+
Dave Borowitzbab45862018-05-01 12:31:48 -0400817* `"change_notes"`: disk storage is disabled by default
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200818* `"diff_summary"`: default is `1g` (1 GiB of disk space)
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700819* `"external_ids_map"`: disk storage is disabled by default
Saša Živkove789f2e2016-09-22 10:37:34 +0200820
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700821+
Dave Borowitzdab51552018-05-14 16:35:37 -0700822If 0 or negative, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700823
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800824==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700825
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700826cache `"accounts"`::
827+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700828Cache entries contain important details of an active user, including
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +0200829their display name, preferences, and known email addresses. Entry
Dave Borowitzada289c2018-12-18 13:24:14 -0800830information is obtained from NoteDb data in the `All-Users` repo.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700831
832+
Dave Borowitzada289c2018-12-18 13:24:14 -0800833If direct updates are made to `All-Users`, this cache should be flushed.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700834
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400835cache `"adv_bases"`::
836+
837Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900838are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400839for the client to use as potential delta bases. Push over smart HTTP
840requires two HTTP requests, and this cache tries to carry state from
841the first request into the second to ensure it can complete.
842
Patrick Hieselace3dc92019-01-15 14:08:13 +0000843cache `"changes"`::
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200844+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200845The size of `memoryLimit` determines the number of projects for which
846all changes will be cached. If the cache is set to 1024, this means all
Patrick Hieselace3dc92019-01-15 14:08:13 +0000847changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800848+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000849Default value is 0 (disabled). It is disabled by default due to the fact
850that change updates are not communicated between Gerrit servers. Hence
Matthias Sohnd8182ba2019-12-09 14:50:23 +0100851this cache should be disabled in a cluster setup using multiple primary
852or multiple replica nodes.
Gustaf Lundh53493772012-11-18 18:41:15 -0800853+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000854The cache should be flushed whenever the database changes table is modified
855outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200856
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700857cache `"diff"`::
858+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700859Each item caches the differences between two commits, at both the
860directory and file levels. Gerrit uses this cache to accelerate
861the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700862+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700863Entries in this cache are relatively large, so memoryLimit is an
864estimate in bytes of memory used. Administrators should try to target
865cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
866day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700867
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400868cache `"diff_intraline"`::
869+
870Each item caches the intraline difference of one file, when compared
871between two commits. Gerrit uses this cache to accelerate display of
872intraline differences when viewing a file.
873+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700874Entries in this cache are relatively large, so memoryLimit is an
875estimate in bytes of memory used. Administrators should try to target
876cache.diff.memoryLimit to fit all files users will view in a 1 or 2
877day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400878
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200879cache `"diff_summary"`::
Saša Živkove789f2e2016-09-22 10:37:34 +0200880+
881Each item caches list of file paths which are different between two
882commits. Gerrit uses this cache to accelerate computing of the list
883of paths of changed files.
884+
885Ideally, disk limit of this cache is large enough to cover all changes.
886This should significantly speed up change reindexing, especially
887full offline reindexing.
888
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400889cache `"external_ids_map"`::
890+
891A singleton cache whose sole entry is a map of the parsed representation
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400892of link:config-accounts.html#external-ids[all current external IDs]. The
893cache may temporarily contain 2 entries, but the second one is promptly
894expired.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400895+
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700896It is not recommended to change the in-memory attributes of this cache
897away from the defaults. The cache may be persisted by setting
898`diskLimit`, which is only recommended if cold start performance is
899problematic.
Patrick Hiesel42b47b12019-07-22 09:32:37 +0200900+
901`external_ids_map` supports computing the new cache value based on a
902previously cached state. This applies modifications based on the Git
903diff and is almost always faster.
904`cache.external_ids_map.enablePartialReloads` turns this behavior on
Patrick Hieselc486edf2019-08-19 15:55:17 +0200905or off. The default is `true`.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400906
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700907cache `"git_tags"`::
908+
909If branch or reference level READ access controls are used, this
910cache tracks which tags are reachable from the branch tips of a
911repository. Gerrit uses this information to determine the set
912of tags that a client may access, derived from which tags are
913part of the history of a visible branch.
914+
915The cache is persisted to disk across server restarts as it can
916be expensive to compute (60 or more seconds for a large history
917like the Linux kernel repository).
918
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700919cache `"groups"`::
920+
Edwin Kempin3091e112017-11-13 15:23:58 +0100921Caches the basic group information of internal groups by group ID,
922including the group owner, name, and description.
923+
Edwin Kempind967ec42017-11-13 15:14:41 +0100924For this cache it is important to configure a size that is larger than
925the number of internal Gerrit groups, otherwise general Gerrit
926performance may be poor. This is why by default this cache is
927unlimited.
928+
Edwin Kempin3091e112017-11-13 15:23:58 +0100929External group membership obtained from LDAP is cached under
930`"ldap_groups"`.
931
932cache `"groups_byname"`::
933+
934Caches the basic group information of internal groups by group name,
935including the group owner, name, and description.
936+
Edwin Kempind967ec42017-11-13 15:14:41 +0100937For this cache it is important to configure a size that is larger than
938the number of internal Gerrit groups, otherwise general Gerrit
939performance may be poor. This is why by default this cache is
940unlimited.
941+
Edwin Kempin3091e112017-11-13 15:23:58 +0100942External group membership obtained from LDAP is cached under
943`"ldap_groups"`.
944
945cache `"groups_byuuid"`::
946+
947Caches the basic group information of internal groups by group UUID,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700948including the group owner, name, and description.
949+
Edwin Kempind967ec42017-11-13 15:14:41 +0100950For this cache it is important to configure a size that is larger than
951the number of internal Gerrit groups, otherwise general Gerrit
952performance may be poor. This is why by default this cache is
953unlimited.
954+
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +0200955External group membership obtained from LDAP is cached under
956`"ldap_groups"`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700957
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +0200958cache `"groups_bymember"`::
Matt Fischer620255a2011-03-22 14:28:23 -0500959+
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +0200960Caches the groups which contain a specific member (account). If direct
961updates are made to the `account_group_members` table, this cache should
962be flushed.
963
Alice Kober-Sotzek3e1fe1b2017-10-12 14:44:17 +0200964cache `"groups_bysubgroups"`::
965+
966Caches the parent groups of a subgroup. If direct updates are made
Matt Fischer620255a2011-03-22 14:28:23 -0500967to the `account_group_includes` table, this cache should be flushed.
968
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700969cache `"ldap_groups"`::
970+
971Caches the LDAP groups that a user belongs to, if LDAP has been
972configured on this server. This cache should be configured with a
973low maxAge setting, to ensure LDAP modifications are picked up in
974a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700975
Gustaf Lundh0919a492012-10-19 15:29:23 +0200976cache `"ldap_groups_byinclude"`::
977+
978Caches the hierarchical structure of LDAP groups.
979
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -0700980cache `"ldap_usernames"`::
981+
982Caches a mapping of LDAP username to Gerrit account identity. The
983cache automatically updates when a user first creates their account
984within Gerrit, so the cache expire time is largely irrelevant.
985
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700986cache `"permission_sort"`::
987+
David Pursehouse221d4f62012-06-08 17:38:08 +0900988Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700989reference. Sorting the sections can be expensive when regular
990expressions are used, so this cache remembers the ordering for
991each branch.
992
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700993cache `"plugin_resources"`::
994+
995Caches formatted plugin resources, such as plugin documentation that
996has been converted from Markdown to HTML. The memoryLimit refers to
997the bytes of memory dedicated to storing the documentation.
998
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700999cache `"projects"`::
1000+
1001Caches the project description records, from the `projects` table
1002in the database. If a project record is updated or deleted, this
1003cache should be flushed. Newly inserted projects do not require
1004a cache flush, as they will be read upon first reference.
1005
Dave Borowitz08aa8bb2018-04-05 12:01:06 -04001006cache `"prolog_rules"`::
1007+
1008Caches parsed `rules.pl` contents for each project. This cache uses the same
1009size as the `projects` cache, and cannot be configured independently.
1010
Patrick Hiesela57c0d62019-02-19 09:09:22 +01001011cache `"pure_revert"`::
1012+
1013Result of checking if one change or commit is a pure/clean revert of
1014another.
1015
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001016cache `"sshkeys"`::
1017+
1018Caches unpacked versions of user SSH keys, so the internal SSH daemon
1019can match against them during authentication. The unit of storage
1020is per-user, so 1024 items translates to 1024 unique user accounts.
1021As each individual user account may configure multiple SSH keys,
1022the total number of keys may be larger than the item count.
1023
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001024cache `"web_sessions"`::
1025+
1026Tracks the live user sessions coming in over HTTP. Flushing this
1027cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -07001028them to sign-in again. To avoid breaking active users, this cache
1029is not flushed automatically by `gerrit flush-caches --all`, but
1030instead must be explicitly requested.
1031+
1032If no disk cache is configured (or `cache.web_sessions.diskLimit`
1033is set to 0) a server restart will force all users to sign-out,
1034and need to sign-in again after the restart, as the cache was
1035unable to persist the session information. Enabling a disk cache
1036is strongly recommended.
1037+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001038Session storage is relatively inexpensive. The average entry in
1039this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001040
Shawn O. Pearce4016a932009-05-28 15:12:40 -07001041See also link:cmd-flush-caches.html[gerrit flush-caches].
1042
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001043==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001044
Hugo Arès2bc86812015-03-09 15:20:28 -04001045[[cache.diff.timeout]]cache.diff.timeout::
1046+
1047Maximum number of milliseconds to wait for diff data before giving up and
1048falling back on a simpler diff algorithm that will not be able to break down
1049modified regions into smaller ones. This is a work around for an infinite loop
1050bug in the default difference algorithm implementation.
1051+
1052Values should use common unit suffixes to express their setting:
1053+
1054* ms, milliseconds
1055* s, sec, second, seconds
1056* m, min, minute, minutes
1057* h, hr, hour, hours
1058
1059+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001060--
Hugo Arès2bc86812015-03-09 15:20:28 -04001061If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001062
Hugo Arès2bc86812015-03-09 15:20:28 -04001063Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001064--
Hugo Arès2bc86812015-03-09 15:20:28 -04001065
Edwin Kempin42d27432013-11-24 17:06:24 +01001066[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001067+
1068Maximum number of milliseconds to wait for intraline difference data
1069before giving up and disabling it for a particular file pair. This is
1070a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +09001071implementation.
1072+
1073If computation takes longer than the timeout, the worker thread is
1074terminated, an error message is shown, and no intraline difference is
1075displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001076+
1077Values should use common unit suffixes to express their setting:
1078+
1079* ms, milliseconds
1080* s, sec, second, seconds
1081* m, min, minute, minutes
1082* h, hr, hour, hours
1083
1084+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001085--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001086If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001087
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001088Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001089--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001090
Edwin Kempin42d27432013-11-24 17:06:24 +01001091[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001092+
1093Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001094when populating a diff cache entry. This flag is provided primarily
1095as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +09001096necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001097this setting will fallback to `cache.diff.intraline` if not set in the
1098configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001099+
1100Default is true, enabled.
1101
Edwin Kempin42d27432013-11-24 17:06:24 +01001102[[cache.projects.checkFrequency]]cache.projects.checkFrequency::
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -07001103+
1104How often project configuration should be checked for update from Git.
1105Gerrit Code Review caches project access rules and configuration in
1106memory, checking the refs/meta/config branch every checkFrequency
1107minutes to see if a new revision should be loaded and used for future
1108access. Values can be specified using standard time unit abbreviations
1109('ms', 'sec', 'min', etc.).
1110+
1111If set to 0, checks occur every time, which may slow down operations.
Shawn Pearcec825ef12013-02-20 11:29:46 -08001112If set to 'disabled' or 'off', no check will ever be done.
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -07001113Administrators may force the cache to flush with
1114link:cmd-flush-caches.html[gerrit flush-caches].
1115+
1116Default is 5 minutes.
1117
Simon Leifc19ff12014-10-02 13:36:00 -04001118[[cache.projects.loadOnStartup]]cache.projects.loadOnStartup::
1119+
1120If the project cache should be loaded during server startup.
1121+
1122The cache is loaded concurrently. Admins should ensure that the cache
1123size set under <<cache.name.memoryLimit,cache.projects.memoryLimit>>
1124is not smaller than the number of repos.
1125+
1126Default is false, disabled.
1127
1128[[cache.projects.loadThreads]]cache.projects.loadThreads::
1129+
1130Only relevant if <<cache.projects.loadOnStartup,cache.projects.loadOnStartup>>
1131is true.
1132+
1133The number of threads to allocate for loading the cache at startup. These
1134threads will die out after the cache is loaded.
1135+
1136Default is the number of CPUs.
1137
Shawn Pearce67a33302016-08-11 11:51:59 -07001138
1139[[capability]]
1140=== Section capability
1141
1142[[capability.administrateServer]]capability.administrateServer::
1143+
1144Names of groups of users that are allowed to exercise the
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001145`administrateServer` capability, in addition to those listed in
Shawn Pearce67a33302016-08-11 11:51:59 -07001146All-Projects. Configuring this option can be a useful fail-safe
1147to recover a server in the event an administrator removed all
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001148groups from the `administrateServer` capability, or to ensure that
Shawn Pearce67a33302016-08-11 11:51:59 -07001149specific groups always have administration capabilities.
1150+
1151----
1152[capability]
1153 administrateServer = group Fail Safe Admins
1154----
1155+
1156The configuration file uses group names, not UUIDs. If a group is
1157renamed the gerrit.config file must be updated to reflect the new
1158name. If a group cannot be found for the configured name a warning
1159is logged and the server will continue normal startup.
1160+
1161If not specified (default), only the groups listed by All-Projects
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001162may use the `administrateServer` capability.
1163
1164[[capability.makeFirstUserAdmin]]capability.makeFirstUserAdmin::
1165+
1166Whether the first user that logs in to the Gerrit server should
1167automatically be added to the administrator group and hence get the
1168`administrateServer` capability assigned. This is useful to bootstrap
1169the authentication database.
1170+
1171Default is true.
Shawn Pearce67a33302016-08-11 11:51:59 -07001172
1173
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001174[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001175=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -07001176
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001177[[change.allowBlame]]change.allowBlame::
1178+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001179Allow blame on side by side diff. If set to false, blame cannot be used.
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001180+
1181Default is true.
1182
Patrick Hieselca6384d2017-12-21 11:51:11 +01001183[[change.api.allowedIdentifier]]change.api.allowedIdentifier::
1184+
1185Change identifier(s) that are allowed on the API. See
1186link:rest-api-changes.html#change-id[Change Id] for more information.
1187+
1188Possible values are `ALL`, `TRIPLET`, `NUMERIC_ID`, `I_HASH`, and
1189`COMMIT_HASH` or any combination of those as a string list.
1190`PROJECT_NUMERIC_ID` is always allowed and doesn't need to be listed
1191explicitly.
1192+
1193Default is `ALL`.
1194
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001195[[change.cacheAutomerge]]change.cacheAutomerge::
1196+
1197When reviewing diff commits, the left-hand side shows the output of the
1198result of JGit's automatic merge algorithm. This option controls whether
1199this output is cached in the change repository, or if only the diff is
1200cached in the persistent `diff` cache.
1201+
1202If true, automerge results are stored in the repository under
1203`refs/cache-automerge/*`; the results of diffing the change against its
1204automerge base are stored in the diff cache. If false, no extra data is
1205stored in the repository, only the diff cache. This can result in slight
1206performance improvements by reducing the number of refs in the repo.
1207+
1208Default is true.
1209
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001210[[change.commentSizeLimit]]change.commentSizeLimit::
1211+
1212Maximum allowed size in characters of a regular (non-robot) comment. Comments
1213which exceed this size will be rejected. Size computation is approximate and may
1214be off by roughly 1%. Common unit suffixes of 'k', 'm', or 'g' are supported.
1215The value must be positive.
1216+
1217The default limit is 16kB.
1218
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001219[[change.disablePrivateChanges]]change.disablePrivateChanges::
Patrick Hieseldb8df482019-01-24 10:11:23 +01001220+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001221If set to true, users are not allowed to create private changes.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001222+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001223The default is false.
1224
1225[[change.largeChange]]change.largeChange::
1226+
1227Number of changed lines from which on a change is considered as a large
1228change. The number of changed lines of a change is the sum of the lines
1229that were inserted and deleted in the change.
1230+
1231The specified value is used to visualize the change sizes in the Web UI
1232in change tables and user dashboards.
1233+
1234By default 500.
1235
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001236[[change.maxComments]]change.maxComments::
1237+
1238Maximum number of comments (regular plus robot) allowed per change. Additional
1239comments are rejected.
1240+
1241By default 5,000.
1242
Dave Borowitzca614bc2019-04-15 15:29:15 -07001243[[change.maxUpdates]]change.maxUpdates::
1244+
1245Maximum number of updates to a change. Counts only updates to the main NoteDb
1246meta ref; draft comments, robot comments, stars, etc. do not count towards the
1247total.
1248+
1249Many NoteDb operations require walking the entire change meta ref and loading
1250its contents into memory, so changes with arbitrarily many updates may cause
1251high CPU usage, memory pressure, persistent cache bloat, and other problems.
1252+
Dave Borowitz18e7b552019-04-17 07:53:38 -07001253The following operations are allowed even when a change is at the limit:
Edwin Kempinf2f815b2020-01-22 17:09:16 +01001254
Dave Borowitz18e7b552019-04-17 07:53:38 -07001255* Abandon
1256* Submit
1257* Submit by push with `%submit`
1258* Auto-close by pushing directly to the branch
1259* Fix with link:rest-api-changes.html#fix-input[`expect_merged_as`]
Edwin Kempinf2f815b2020-01-22 17:09:16 +01001260
Dave Borowitzca614bc2019-04-15 15:29:15 -07001261By default 1000.
1262
Patrick Hiesela4824db2019-12-20 10:55:26 +01001263[[change.mergeabilityComputationBehavior]]change.mergeabilityComputationBehavior::
1264+
1265This setting determines when Gerrit computes if a change is mergeable or not.
1266This computation is expensive, especially when the repository is large or when
1267there are many open changes.
1268+
1269This config can have the following states:
1270+
1271* `API_REF_UPDATED_AND_CHANGE_REINDEX`: Gerrit indexes `mergeability` enabling
1272 the `is:mergeable` predicate in change search and allowing fast retrieval of
1273 this bit in query responses. Gerrit will always serve `mergeable` in
1274 link:rest-api-changes.html#change-info[ChangeInfo] objects.
1275 Gerrit will reindex all open changes when the target ref advances (expensive).
1276* `REF_UPDATED_AND_CHANGE_REINDEX`: Gerrit indexes `mergeability` enabling the
1277 `is:mergeable` predicate in change search and allowing fast retrieval of this
1278 bit in query responses. Gerrit will never serve `mergeable` in
1279 link:rest-api-changes.html#change-info[ChangeInfo]
1280 objects. This state can be a final state for instances that only want to
1281 optimize the read path, but not the write path for speed or serve as an
1282 intermediary step for instances that want to optimize both and need to migrate
1283 callers of their API.
1284 Gerrit will reindex all open changes when the target ref advances (expensive).
1285* `NEVER`: Gerrit does not index `mergeable`, so `is:mergeable` is disabled as
1286 query operator. Gerrit does not serve `mergeable` in
1287 link:rest-api-changes.html#change-info[ChangeInfo].
1288
1289Default is `REF_UPDATED_AND_CHANGE_REINDEX`.
1290
Edwin Kempin67229a42019-10-08 09:13:34 +02001291[[change.move]]change.move::
1292+
1293Whether the link:rest-api-changes.html#move-change[Move Change] REST
1294endpoint is enabled.
1295+
1296The move change functionality has some corner cases with undesired side
1297effects. Hence administrators may decide to disable this functionality.
1298In particular, if a change that has dependencies on other changes is
1299moved to a new branch, and the moved change gets submitted to the new
1300branch, the changes on which the change depends are silently merged
1301into the new branch, although these changes have not been moved to that
1302branch (see details in
1303link:https://bugs.chromium.org/p/gerrit/issues/detail?id=9877[issue
13049877]).
1305+
1306By default true.
1307
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001308[[change.replyLabel]]change.replyLabel::
1309+
1310Label name for the reply button. In the user interface an ellipsis (…)
1311is appended.
1312+
1313Default is "Reply". In the user interface it becomes "Reply…".
1314
1315[[change.replyTooltip]]change.replyTooltip::
1316+
1317Tooltip for the reply button. In the user interface a note about the
1318keyboard shortcut is appended.
1319+
1320Default is "Reply and score". In the user interface it becomes "Reply
1321and score (Shortcut: a)".
1322
1323[[change.robotCommentSizeLimit]]change.robotCommentSizeLimit::
1324+
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001325Maximum allowed size in characters of a robot comment. Robot comments which
1326exceed this size will be rejected on addition. Size computation is approximate
1327and may be off by roughly 1%. Common unit suffixes of 'k', 'm', or 'g' are
1328supported. Zero or negative values allow robot comments of unlimited size.
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001329+
1330The default limit is 1024kB.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001331
Luca Milanesiof2a275b2017-04-10 10:59:34 +01001332[[change.showAssigneeInChangesTable]]change.showAssigneeInChangesTable::
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001333+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001334Show assignee field in changes table. If set to false, assignees will
1335not be visible in changes table.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001336+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001337Default is false.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001338
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001339[[change.strictLabels]]change.strictLabels::
1340+
1341Reject invalid label votes: invalid labels or invalid values. This
David Pursehouse33495ab2019-10-31 09:38:43 +09001342configuration option is provided for backwards compatibility and may
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001343be removed in future gerrit versions.
1344+
1345Default is false.
1346
David Ostrovsky9933eb32014-05-20 16:08:20 +02001347[[change.submitLabel]]change.submitLabel::
1348+
1349Label name for the submit button.
1350+
1351Default is "Submit".
1352
Stefan Beller7c380d512015-08-21 10:55:21 -07001353[[change.submitLabelWithParents]]change.submitLabelWithParents::
1354+
1355Label name for the submit button if the change has parents which will
1356be submitted together with this change.
1357+
1358Default is "Submit including parents".
1359
David Ostrovsky9933eb32014-05-20 16:08:20 +02001360[[change.submitTooltip]]change.submitTooltip::
1361+
1362Tooltip for the submit button. Variables available for replacement
1363include `${patchSet}` for the current patch set number (1, 2, 3),
1364`${branch}` for the branch name ("master") and `${commit}` for the
1365abbreviated commit SHA-1 (`c9c0edb`).
1366+
1367Default is "Submit patch set ${patchSet} into ${branch}".
1368
Stefan Beller0e655542015-07-20 21:14:38 -07001369[[change.submitTooltipAncestors]]change.submitTooltipAncestors::
1370+
1371Tooltip for the submit button if there are ancestors which would
1372also be submitted by submitting the change. Additionally to the variables
1373as in link:#change.submitTooltip[change.submitTooltip], there is the
1374variable `${submitSize}` indicating the number of changes which are
1375submitted.
1376+
1377Default is "Submit all ${topicSize} changes of the same topic (${submitSize}
1378changes including ancestors and other changes related by topic)".
1379
Stefan Bellera038cf72015-01-13 16:25:10 -08001380[[change.submitTopicLabel]]change.submitTopicLabel::
1381+
1382If `change.submitWholeTopic` is set and a change has a topic,
1383the label name for the submit button is given here instead of
1384the configuration `change.submitLabel`.
1385+
1386Defaults to "Submit whole topic"
1387
1388[[change.submitTopicTooltip]]change.submitTopicTooltip::
1389+
David Pursehousea61ee502016-09-06 16:27:09 +09001390If `change.submitWholeTopic` is configured to true and a change has a
Stefan Bellera038cf72015-01-13 16:25:10 -08001391topic, this configuration determines the tooltip for the submit button
1392instead of `change.submitTooltip`. The variable `${topicSize}` is available
Stefan Beller7c380d512015-08-21 10:55:21 -07001393for the number of changes in the same topic to be submitted. The number of
1394all changes to be submitted is in the variable `${submitSize}`.
Stefan Bellera038cf72015-01-13 16:25:10 -08001395+
Stefan Beller7c380d512015-08-21 10:55:21 -07001396Defaults to "Submit all ${topicSize} changes of the same topic
1397(${submitSize} changes including ancestors and other
1398changes related by topic)".
Stefan Bellera038cf72015-01-13 16:25:10 -08001399
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001400[[change.submitWholeTopic]]change.submitWholeTopic::
Richard Möhne4abe9a2014-11-13 20:05:13 +01001401+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001402Determines if the submit button submits the whole topic instead of
1403just the current change.
David Ostrovskya304aff2018-04-05 23:07:51 +02001404+
1405Default is false.
1406
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001407[[change.updateDelay]]change.updateDelay::
Changcheng Xiao16095352017-12-18 10:03:08 +01001408+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001409How often in seconds the web interface should poll for updates to the
1410currently open change. The poller relies on the client's browser
1411cache to use If-Modified-Since and respect `304 Not Modified` HTTP
1412responses. This allows for fast polls, often under 8 milliseconds.
Changcheng Xiao16095352017-12-18 10:03:08 +01001413+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001414With a configured 30 second delay a server with 4900 active users will
1415typically need to dedicate 1 CPU to the update check. 4900 users
1416divided by an average delay of 30 seconds is 163 requests arriving per
1417second. If requests are served at \~6 ms response time, 1 CPU is
1418necessary to keep up with the update request traffic. On a smaller
1419user base of 500 active users, the default 30 second delay is only 17
1420requests per second and requires ~10% CPU.
1421+
1422If 0 the update polling is disabled.
1423+
1424Default is 5 minutes.
Changcheng Xiao16095352017-12-18 10:03:08 +01001425
Edwin Kempine326a1d2015-06-03 10:27:39 +02001426[[changeCleanup]]
1427=== Section changeCleanup
1428
1429This section allows to configure change cleanups and schedules them to
1430run periodically.
1431
1432[[changeCleanup.abandonAfter]]changeCleanup.abandonAfter::
1433+
1434Period of inactivity after which open changes should be abandoned
1435automatically.
1436+
1437By default `0`, never abandon open changes.
1438+
1439[WARNING] Auto-Abandoning changes may confuse/annoy users. When
1440enabling this, make sure to choose a reasonably large grace period and
1441inform users in advance.
1442+
1443The following suffixes are supported to define the time unit:
1444+
1445* `d, day, days`
1446* `w, week, weeks` (`1 week` is treated as `7 days`)
1447* `mon, month, months` (`1 month` is treated as `30 days`)
1448* `y, year, years` (`1 year` is treated as `365 days`)
1449
Edwin Kempin7080ef12015-06-10 15:03:09 +02001450[[changeCleanup.abandonIfMergeable]]changeCleanup.abandonIfMergeable::
1451+
David Pursehousef4bc2562019-12-04 09:55:40 +09001452Whether changes which are mergeable should be auto-abandoned. When set
1453to `false`, `-is:mergeable` is appended to the query used to find
1454the changes to auto-abandon.
Edwin Kempin7080ef12015-06-10 15:03:09 +02001455+
David Pursehousef4bc2562019-12-04 09:55:40 +09001456By default `true`, meaning mergeable changes are auto-abandoned.
1457+
Patrick Hiesela4824db2019-12-20 10:55:26 +01001458If
1459link:#change.mergeabilityComputationBehavior[`change.mergeabilityComputationBehavior`]
1460is set to `NEVER`, setting this option to `false` has no effect and it behaves
1461as though it were set to `true`.
Edwin Kempin7080ef12015-06-10 15:03:09 +02001462
Jacek Centkowski36d35212019-05-13 14:32:00 +02001463[[changeCleanup.cleanupAccountPatchReview]]changeCleanup.cleanupAccountPatchReview::
1464+
1465Whether accountPatchReview data should be also removed when change
1466gets auto-abandoned.
1467+
1468By default `false`.
1469
Edwin Kempine326a1d2015-06-03 10:27:39 +02001470[[changeCleanup.abandonMessage]]changeCleanup.abandonMessage::
1471+
1472Change message that should be posted when a change is abandoned.
1473+
1474'${URL}' can be used as a placeholder for the Gerrit web URL.
1475+
1476By default "Auto-Abandoned due to inactivity, see
1477${URL}Documentation/user-change-cleanup.html#auto-abandon\n\n
1478If this change is still wanted it should be restored.".
1479
1480[[changeCleanup.startTime]]changeCleanup.startTime::
1481+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001482The link:#schedule-configuration-startTime[start time] for running
1483change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001484
1485[[changeCleanup.interval]]changeCleanup.interval::
1486+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001487The link:#schedule-configuration-interval[interval] for running
1488change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001489
Edwin Kempind33d95a2018-02-16 11:44:04 +01001490link:#schedule-configuration-examples[Schedule examples] can be found
1491in the link:#schedule-configuration[Schedule Configuration] section.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001492
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001493[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001494=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001495
Brad Larson991a31b2009-11-03 14:30:26 -06001496Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -05001497patch comments, in-line code comments and approval category value descriptions
1498to turn set strings into hyperlinks. One common use is for linking to
1499bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -06001500
1501In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001502will match typical Gerrit Change-Id values and create a hyperlink
1503to changes which reference it. The second configuration 'bugzilla'
1504will hyperlink terms such as 'bug 42' to an external bug tracker,
1505supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +09001506configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001507how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -06001508
Sven Selberg2a0beab2018-04-20 14:49:20 +02001509commentlinks supports link:#reloadConfig[configuration reloads]. Though a
Gustaf Lundhca7eb792018-04-16 10:56:03 +02001510link:cmd-flush-caches.html[flush-caches] of "projects" is needed for the
1511commentlinks to be immediately available in the UI.
1512
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001513----
1514[commentlink "changeid"]
1515 match = (I[0-9a-f]{8,40})
David Pursehouse9f68e1a2016-01-28 09:21:03 +00001516 link = "#/q/$1"
Brad Larson991a31b2009-11-03 14:30:26 -06001517
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001518[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001519 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001520 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -06001521
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001522[commentlink "tracker"]
1523 match = ([Bb]ug:\\s+)(\\d+)
1524 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
1525----
1526
Dave Borowitz13b38002013-04-08 12:03:29 -07001527Comment links can also be specified in `project.config` and sections in
1528children override those in parents. The only restriction is that to
1529avoid injecting arbitrary user-supplied HTML in the page, comment links
1530defined in `project.config` may only supply `link`, not `html`.
1531
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001532[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -06001533+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001534A JavaScript regular expression to match positions to be replaced
1535with a hyperlink. Subexpressions of the matched string can be
1536stored using groups and accessed with `$'n'` syntax, where 'n'
1537is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -06001538+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001539The configuration file parser eats one level of backslashes, so the
1540character class `\s` requires `\\s` in the configuration file. The
1541parser also terminates the line at the first `#`, so a match
1542expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001543+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -08001544To match case insensitive strings, a character class with both the
1545upper and lower case character for each position must be used. For
1546example, to match the string `bug` in a case insensitive way the match
1547pattern `[bB][uU][gG]` needs to be used.
1548+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001549The commentlink.name.match regular expressions are applied to the raw,
1550unformatted and unescaped text form. Regex matching against HTML is not
1551supported. Comment link patterns that are written in this style should
1552be updated to match text formats.
Matthew Webbercd7d2bf2015-10-14 15:54:06 +01001553+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001554A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -06001555
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001556[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -06001557+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001558The URL to direct the user to whenever the regular expression is
1559matched. Groups in the match expression may be accessed as `$'n'`.
1560+
1561The link property is used only when the html property is not present.
1562
1563[[commentlink.name.html]]commentlink.<name>.html::
1564+
1565HTML to replace the entire matched string with. If present,
1566this property overrides the link property above. Groups in the
1567match expression may be accessed as `$'n'`.
1568+
1569The configuration file eats double quotes, so escaping them as
1570`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -06001571
Dave Borowitz82d79c02013-04-08 15:45:12 -07001572[[commentlink.name.enabled]]commentlink.<name>.enabled::
1573+
1574Whether the comment link is enabled. A child project may override a
1575section in a parent or the site-wide config that is disabled by
1576specifying `enabled = true`.
1577+
1578Disabling sections in `gerrit.config` can be used by site administrators
1579to create a library of comment links with `html` set that are not
1580user-supplied and thus can be verified to be XSS-free, but are only
1581enabled for a subset of projects.
1582+
David Pursehouse6f1af472013-12-11 19:23:33 +09001583By default, true.
1584+
Dave Borowitz82d79c02013-04-08 15:45:12 -07001585Note that the names and contents of disabled sections are visible even
1586to anonymous users via the
1587link:rest-api-projects.html#get-config[REST API].
1588
Brad Larson991a31b2009-11-03 14:30:26 -06001589
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001590[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001591=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001592
1593These settings are applied only if Gerrit is started as the container
1594process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
1595
1596[[container.heapLimit]]container.heapLimit::
1597+
1598Maximum heap size of the Java process running Gerrit, in bytes.
1599This property is translated into the '-Xmx' flag for the JVM.
1600+
1601Default is platform and JVM specific.
1602+
1603Common unit suffixes of 'k', 'm', or 'g' are supported.
1604
1605[[container.javaHome]]container.javaHome::
1606+
1607Path of the JRE/JDK installation to run Gerrit with. If not set, the
1608Gerrit startup script will attempt to search your system and guess
1609a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
1610
1611[[container.javaOptions]]container.javaOptions::
1612+
David Pursehousea13052b2020-02-10 14:26:08 +09001613Additional options to pass along to the Java runtime. May be specified
1614multiple times to configure multiple values. If multiple values are
1615configured, they are passed in order on the command line, separated by
1616spaces. These options are appended onto 'JAVA_OPTIONS'.
David Pursehousea70a60c2020-02-10 14:22:43 +09001617+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001618For example, it is possible to overwrite Gerrit's default log4j
1619configuration:
David Pursehousea70a60c2020-02-10 14:22:43 +09001620+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001621----
1622 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
1623----
1624
Hugo Arès6710f0a2014-11-04 10:28:42 -05001625[[container.daemonOpt]]container.daemonOpt::
1626+
1627Additional options to pass to the daemon (e.g. '--enable-httpd'). If
1628multiple values are configured, they are passed in that order to the command
1629line, separated by spaces.
1630+
1631Execute `java -jar gerrit.war daemon --help` to see all possible
1632options.
1633
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001634[[container.replica]]container.replica::
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001635+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02001636Used on Gerrit replica installations. If set to true the Gerrit JVM is
1637called with the '--replica' switch, enabling replica mode. If no value is
Matthias Sohnd8182ba2019-12-09 14:50:23 +01001638set (or any other value), Gerrit defaults to primary mode enabling write
1639operations.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001640
David Ostrovsky21fca752019-10-18 08:50:29 +02001641[[container.slave]]container.slave::
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001642+
1643Backward compatibility for 'container.slave' config setting.
1644
Khai Do6168beb2016-12-19 17:26:28 -08001645[[container.startupTimeout]]container.startupTimeout::
1646+
1647The maximum time (in seconds) to wait for a gerrit.sh start command
1648to run a new Gerrit daemon successfully. If not set, defaults to
164990 seconds.
1650
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001651[[container.user]]container.user::
1652+
1653Login name (or UID) of the operating system user the Gerrit JVM
1654will execute as. If not set, defaults to the user who launched
1655the 'gerrit.sh' wrapper script.
1656
1657[[container.war]]container.war::
1658+
1659Path of the JAR file to start daemon execution with. This should
1660be the path of the local 'gerrit.war' archive. Overrides the
1661environment variable 'GERRIT_WAR'.
1662+
1663If not set, defaults to '$site_path/bin/gerrit.war', or to
1664'$HOME/gerrit.war'.
1665
1666
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001667[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001668=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001669
Saša Živkovd34dfe32017-11-20 11:14:35 +01001670[NOTE]
1671The link:#jgitConfig[etc/jgit.config] file supports configuration of all JGit
1672options.
1673
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001674[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001675+
1676Number of bytes of a pack file to load into memory in a single
1677read operation. This is the "page size" of the JGit buffer cache,
1678used for all pack access operations. All disk IO occurs as single
1679window reads. Setting this too large may cause the process to load
1680more data than is required; setting this too small may increase
1681the frequency of `read()` system calls.
1682+
1683Default on JGit is 8 KiB on all platforms.
1684+
1685Common unit suffixes of 'k', 'm', or 'g' are supported.
1686
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001687[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001688+
1689Maximum number of bytes to load and cache in memory from pack files.
1690If JGit needs to access more than this many bytes it will unload less
1691frequently used windows to reclaim memory space within the process.
1692As this buffer must be shared with the rest of the JVM heap, it
1693should be a fraction of the total memory available.
1694+
1695Default on JGit is 10 MiB on all platforms.
1696+
1697Common unit suffixes of 'k', 'm', or 'g' are supported.
1698
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001699[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001700+
1701Maximum number of bytes to reserve for caching base objects
1702that multiple deltafied objects reference. By storing the entire
1703decompressed base object in a cache Git is able to avoid unpacking
1704and decompressing frequently used base objects multiple times.
1705+
1706Default on JGit is 10 MiB on all platforms. You probably do not
1707need to adjust this value.
1708+
1709Common unit suffixes of 'k', 'm', or 'g' are supported.
1710
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001711[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001712+
1713Maximum number of pack files to have open at once. A pack file
1714must be opened in order for any of its data to be available in
1715a cached window.
1716+
1717If you increase this to a larger setting you may need to also adjust
1718the ulimit on file descriptors for the host JVM, as Gerrit needs
1719additional file descriptors available for network sockets and other
1720repository data manipulation.
1721+
1722Default on JGit is 128 file descriptors on all platforms.
1723
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001724[[core.streamFileThreshold]]core.streamFileThreshold::
1725+
1726Largest object size, in bytes, that JGit will allocate as a
1727contiguous byte array. Any file revision larger than this threshold
1728will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001729files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001730during delta decompression.
1731+
1732Servers with very high traffic should set this to be larger than
1733the size of their common big files. For example a server managing
1734the Android platform typically has to deal with ~10-12 MiB XML
1735files, so `15 m` would be a reasonable setting in that environment.
1736Setting this too high may cause the JVM to run out of heap space
1737when handling very big binary files, such as device firmware or
1738CD-ROM ISO images.
1739+
Luca Milanesiob104a552019-11-18 17:28:56 -08001740Defaults to 25% of the available JVM heap, limited to 2g.
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001741+
1742Common unit suffixes of 'k', 'm', or 'g' are supported.
1743
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001744[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001745+
1746When true, JGit will use `mmap()` rather than `malloc()+read()`
1747to load data from pack files. The use of mmap can be problematic
1748on some JVMs as the garbage collector must deduce that a memory
1749mapped segment is no longer in use before a call to `munmap()`
1750can be made by the JVM native code.
1751+
1752In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001753pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001754of virtual address space, as the garbage collector cannot reclaim
1755unused mapped spaces fast enough.
1756+
1757Default on JGit is false. Although potentially slower, it yields
1758much more predictable behavior.
1759
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001760[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1761+
1762Size of the buffer to store logging events for asynchronous logging.
1763Putting a larger value can protect threads from stalling when the
1764AsyncAppender threads are not fast enough to consume the logging events
David Pursehouse1ff91c02015-05-19 15:05:26 +09001765from the buffer. It also protects from losing log entries in this case.
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001766+
1767Default is 64 entries.
1768
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001769[[core.useRecursiveMerge]]core.useRecursiveMerge::
1770+
Edwin Kempin71831d22014-07-15 08:54:29 +02001771Use JGit's recursive merger for three-way merges. This only affects
Sebastian Schuberth774aac92015-04-16 13:21:04 +02001772projects that allow content merges.
Edwin Kempin71831d22014-07-15 08:54:29 +02001773+
1774As explained in this
1775link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[
Marian Harbach34253372019-12-10 18:01:31 +01001776blog,role=external,window=_blank], the recursive merge produces better results if the two commits
Edwin Kempin71831d22014-07-15 08:54:29 +02001777that are merged have more than one common predecessor.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001778+
Edwin Kempin7853c5b2014-07-15 08:57:17 +02001779Default is true.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001780
Hugo Arès47344372016-06-27 10:23:17 -04001781[[core.repositoryCacheCleanupDelay]]core.repositoryCacheCleanupDelay::
1782+
1783Delay between each periodic cleanup of expired repositories.
1784+
1785Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1786`min`, etc.).
1787+
1788Set it to 0 in order to switch off cache expiration. If cache expiration is
1789switched off, the JVM can still evict cache entries when it is running low
1790on available heap memory.
1791+
1792Set it to -1 to automatically derive cleanup delay from
1793`core.repositoryCacheExpireAfter` (lowest value between 1/10 of
1794`core.repositoryCacheExpireAfter` and 10 minutes).
1795+
1796Default is -1.
1797
1798[[core.repositoryCacheExpireAfter]]core.repositoryCacheExpireAfter::
1799+
1800Time an unused repository should expire and be evicted from the repository
1801cache.
1802+
1803Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1804`min`, etc.).
1805+
1806Default is 1 hour.
1807
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001808[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001809=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03001810
1811----
1812[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001813 command = checkout
1814 command = cherry_pick
1815 command = pull
1816 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001817 scheme = ssh
1818 scheme = http
1819 scheme = anon_http
1820 scheme = anon_git
1821 scheme = repo_download
1822----
1823
1824The download section configures the allowed download methods.
1825
Edwin Kempin08b03a22012-09-14 16:32:57 +02001826[[download.command]]download.command::
1827+
1828Commands that should be offered to download changes.
1829+
1830Multiple commands are supported:
1831+
1832* `checkout`
1833+
1834Command to fetch and checkout the patch set.
1835+
1836* `cherry_pick`
1837+
1838Command to fetch the patch set and to cherry-pick it onto the current
1839commit.
1840+
1841* `pull`
1842+
1843Command to pull the patch set.
1844+
1845* `format_patch`
1846+
1847Command to fetch the patch set and to feed it into the `format-patch`
1848command.
1849
1850+
1851If `download.command` is not specified, all download commands are
1852offered.
1853
monica.dionisio3f630442010-06-29 15:42:57 -03001854[[download.scheme]]download.scheme::
1855+
1856Schemes that should be used to download changes.
1857+
1858Multiple schemes are supported:
1859+
1860* `http`
1861+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001862Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001863+
1864* `ssh`
1865+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001866Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001867+
1868* `anon_http`
1869+
1870Anonymous HTTP download is allowed.
1871+
1872* `anon_git`
1873+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001874Anonymous Git download is allowed. This is not default, it is also
1875necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1876variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001877+
1878* `repo_download`
1879+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001880Gerrit advertises patch set downloads with the `repo download`
1881command, assuming that all projects managed by this instance are
1882generally worked on with the repo multi-repository tool. This is
1883not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001884
1885+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001886If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001887downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001888
Edwin Kempin322db672015-07-03 08:50:46 +02001889[[download.checkForHiddenChangeRefs]]download.checkForHiddenChangeRefs::
1890+
1891Whether the download commands should be adapted when the change refs
1892are hidden.
1893+
1894Git has a configuration option to hide refs from the initial
1895advertisement (`uploadpack.hideRefs`). This option can be used to hide
1896the change refs from the client. As consequence fetching changes by
1897change ref does not work anymore. However by setting
1898`uploadpack.allowTipSha1InWant` to `true` fetching changes by commit ID
1899is possible. If `download.checkForHiddenChangeRefs` is set to `true`
1900the git download commands use the commit ID instead of the change ref
1901when a project is configured like this.
1902+
1903Example git configuration on a project:
1904+
1905----
1906[uploadpack]
1907 hideRefs = refs/changes/
1908 hideRefs = refs/cache-automerge/
1909 allowTipSha1InWant = true
1910----
1911+
1912By default `false`.
1913
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001914[[download.archive]]download.archive::
1915+
1916Specifies which archive formats, if any, should be offered on the change
Francois Ferrand1e933882014-09-25 11:19:08 +02001917screen and supported for `git-upload-archive` operation:
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001918+
1919----
1920[download]
1921 archive = tar
1922 archive = tbz2
1923 archive = tgz
1924 archive = txz
Francois Ferrand1e933882014-09-25 11:19:08 +02001925 archive = zip
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001926----
1927
Shawn Pearce6edde312014-03-26 22:00:26 -07001928If `download.archive` is not specified defaults to all archive
1929commands. Set to `off` or empty string to disable.
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001930
Francois Ferrand1e933882014-09-25 11:19:08 +02001931Zip is not supported because it may be interpreted by a Java plugin as a
1932valid JAR file, whose code would have access to cookies on the domain.
1933For this reason `zip` format is always excluded from formats offered
1934through the `Download` drop down or accessible in the REST API.
1935
Stefan Bellere1b2ad32016-11-29 14:54:13 -08001936[[download.maxBundleSize]]download.maxBundleSize::
1937+
1938Specifies the maximum size of a bundle in bytes that can be downloaded.
1939As bundles are kept in memory this setting is to protect the server
1940from a single request consuming too much heap when generating
1941a bundle and thereby impacting other users.
1942+
1943Defaults to 100MB.
1944
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001945[[gc]]
1946=== Section gc
1947
1948This section allows to configure the git garbage collection and schedules it
1949to run periodically. It will be triggered and executed sequentially for all
1950projects.
1951
Christian Halstricke6c68322015-03-11 15:21:42 +01001952[[gc.aggressive]]gc.aggressive::
1953+
1954Determines if scheduled garbage collections and garbage collections triggered
1955through Web-UI should run in aggressive mode or not. Aggressive garbage
1956collections are more expensive but may lead to significantly smaller
1957repositories.
1958+
1959Valid values are "true" and "false," default is "false".
1960
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001961[[gc.startTime]]gc.startTime::
1962+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001963The link:#schedule-configuration-startTime[start time] for running the
1964git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001965
1966[[gc.interval]]gc.interval::
1967+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001968The link:#schedule-configuration-interval[interval] for running the
1969git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001970
Edwin Kempind33d95a2018-02-16 11:44:04 +01001971link:#schedule-configuration-examples[Schedule examples] can be found
1972in the link:#schedule-configuration[Schedule Configuration] section.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001973
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001974[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001975=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001976
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001977[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001978+
1979Local filesystem directory holding all Git repositories that
1980Gerrit knows about and can process changes for. A project
1981entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02001982the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001983+
1984If relative, the path is resolved relative to `'$site_path'`.
1985
Shawn O. Pearce897d9212011-06-16 16:59:59 -07001986[[gerrit.allProjects]]gerrit.allProjects::
1987+
1988Name of the permissions-only project defining global server
1989access controls and settings. These are inherited into every
1990other project managed by the running server. The name is
1991relative to `gerrit.basePath`.
1992+
1993Defaults to `All-Projects` if not set.
1994
Edwin Kempin2bf5edd2014-03-25 22:21:23 +01001995[[gerrit.allUsers]]gerrit.allUsers::
1996+
1997Name of the project in which meta data of all users is stored.
1998The name is relative to `gerrit.basePath`.
1999+
2000Defaults to `All-Users` if not set.
2001
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002002[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002003+
2004The default URL for Gerrit to be accessed through.
2005+
Sebastian Schuberth64037132016-07-28 13:40:16 +02002006Typically this would be set to something like "http://review.example.com/"
2007or "http://example.com:8080/gerrit/" so Gerrit can output links that point
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002008back to itself.
2009+
2010Setting this is highly recommended, as its necessary for the upload
2011code invoked by "git push" or "repo upload" to output hyperlinks
2012to the newly uploaded changes.
2013
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002014[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002015+
2016Optional base URL for repositories available over the anonymous git
2017protocol. For example, set this to `git://mirror.example.com/base/`
2018to have Gerrit display patch set download URLs in the UI. Gerrit
2019automatically appends the project name onto the end of the URL.
2020+
2021By default unset, as the git daemon must be configured externally
2022by the system administrator, and might not even be running on the
2023same host as Gerrit.
2024
Dave Borowitza5d3fec2015-07-09 14:24:02 -07002025[[gerrit.docUrl]]gerrit.docUrl::
2026+
2027Optional base URL for documentation, under which one can find
2028"index.html", "rest-api.html", etc. Used as the base for the fixed set
2029of links in the "Documentation" tab. A slash is implicitly appended.
2030(For finer control over the top menu, consider writing a
2031link:dev-plugins.html#top-menu-extensions[plugin].)
2032+
2033If unset or empty, the documentation tab will only be shown if
2034`/Documentation/index.html` can be reached by the browser at app load
2035time.
2036
Dave Borowitza17a9842015-09-15 09:58:17 -04002037[[gerrit.editGpgKeys]]gerrit.editGpgKeys::
2038+
2039If enabled and server-side signed push validation is also
2040link:#receive.enableSignedPush[enabled], enable the
2041link:rest-api-accounts.html#list-gpg-keys[REST API endpoints] and web UI
2042for editing GPG keys. If disabled, GPG keys can only be added by
2043administrators with direct git access to All-Users.
2044+
2045Defaults to true.
2046
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002047[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
2048+
2049Optional command to install the `commit-msg` hook. Typically of the
2050form:
David Pursehouse05588e52015-01-07 14:25:11 +09002051+
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002052----
2053fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
2054----
2055+
2056By default unset; falls back to using scp from the canonical SSH host,
2057or curl from the canonical HTTP URL for the server. Only necessary if a
2058proxy or other server/network configuration prevents clients from
2059fetching from the default location.
2060
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07002061[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
2062+
2063Optional base URL for repositories available over the HTTP
2064protocol. For example, set this to `http://mirror.example.com/base/`
2065to have Gerrit display URLs from this server, rather than itself.
2066+
2067By default unset, as the HTTP daemon must be configured externally
2068by the system administrator, and might not even be running on the
2069same host as Gerrit.
2070
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002071[[gerrit.installDbModule]]gerrit.installDbModule::
2072+
2073Repeatable list of class name of additional Guice modules to load at
2074Gerrit startup as part of the dbInjector and during the init phases.
2075Classes are resolved using the primary Gerrit class loader, hence the
2076class needs to be either declared in Gerrit or an additional JAR
2077located under the `/lib` directory.
2078+
2079By default unset.
2080
Luca Milanesio62cc3502016-11-15 10:22:38 -08002081[[gerrit.installModule]]gerrit.installModule::
2082+
2083Repeatable list of class name of additional Guice modules to load at
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002084Gerrit startup as part of the sysInjector and during the init phases.
Luca Milanesio62cc3502016-11-15 10:22:38 -08002085Classes are resolved using the primary Gerrit class loader, hence the
2086class needs to be either declared in Gerrit or an additional JAR
2087located under the `/lib` directory.
2088+
2089By default unset.
2090+
2091Example:
2092----
2093[gerrit]
2094 installModule = com.googlesource.gerrit.libmodule.MyModule
2095 installModule = com.example.abc.OurSpecialSauceModule
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002096 installDbModule = com.example.def.OurCustomProvider
Luca Milanesio62cc3502016-11-15 10:22:38 -08002097----
2098
Luca Milanesio92254852019-02-14 01:33:14 +00002099[[gerrit.listProjectsFromIndex]]gerrit.listProjectsFromIndex::
2100+
2101Enable rendering of project list from the secondary index instead
2102of purely relying on the in-memory cache.
2103+
2104By default false.
2105+
2106[NOTE]
2107The in-memory cache (set to false) rendering provides an **unlimited list** as a result
2108of the list project API, causing the full list of projects to be
2109returned as a result of the link:rest-api-projects.html[/projects/] REST API
2110or the link:cmd-ls-projects.html[gerrit ls-projects] SSH command.
2111When the rendering from the secondary index (set to true),
2112the **list is limited** by the global capability
2113link:access-control.html#capability_queryLimit[queryLimit]
2114which is defaulted to 500 entries.
2115
Sven Selberge63e92d2019-01-22 18:19:19 +01002116[[gerrit.primaryWeblinkName]]gerrit.primaryWeblinkName::
2117+
2118Name of the link:dev-plugins.html#links-to-external-tools[Weblink] that should
2119be chosen in cases where only one Weblink can be used in the UI, for example in
2120inline links.
2121+
2122By default unset, meaning that the UI is responsible for trying to identify
2123a weblink to be used in these cases, most likely weblinks that links to code
2124browsers with known integrations with Gerrit (like Gitiles and Gitweb).
2125+
2126Example:
2127----
2128[gerrit]
2129 primaryWeblinkName = gitiles
2130----
2131
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002132[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
2133+
David Pursehouse214ab862014-12-01 11:48:26 +09002134URL to direct users to when they need to report a bug.
2135+
2136By default unset, meaning no bug report URL will be displayed. Administrators
2137should set this to the URL of their issue tracker, if necessary.
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002138
David Pursehouse46a2f6c2018-11-30 11:12:19 +09002139[[gerrit.enableReverseDnsLookup]]gerrit.enableReverseDnsLookup::
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002140+
David Pursehouse793525f2018-11-30 11:20:02 +09002141Enable reverse DNS lookup during computing ref log entry for identified user,
2142to record the actual hostname of the user's host in the ref log.
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002143+
David Pursehouse793525f2018-11-30 11:20:02 +09002144Enabling reverse DNS lookup can cause performance issues on git push when
2145the reverse DNS lookup is slow.
2146+
2147Defaults to false, reverse DNS lookup is disabled. The user's IP address
2148will be recorded in the ref log rather than their hostname.
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002149
David Pursehouse962e1182014-12-03 17:17:52 +09002150[[gerrit.secureStoreClass]]gerrit.secureStoreClass::
2151+
2152Use the secure store implementation from a specified class.
2153+
2154If specified, must be the fully qualified class name of a class that implements
2155the `com.google.gerrit.server.securestore.SecureStore` interface, and the jar
2156file containing the class must be placed in the `$site_path/lib` folder.
2157+
2158If not specified, the default no-op implementation is used.
2159
Dariusz Luksza7a046da2014-04-03 17:05:47 +02002160[[gerrit.canLoadInIFrame]]gerrit.canLoadInIFrame::
2161+
2162For security reasons Gerrit will always jump out of iframe.
2163Setting this option to true will prevent this behavior.
2164+
2165By default false.
2166
Wyatt Allen414659c2017-03-15 09:55:31 -07002167[[gerrit.cdnPath]]gerrit.cdnPath::
2168+
2169Path prefix for PolyGerrit's static resources if using a CDN.
2170
Viktar Donich65ae7482017-10-20 14:13:31 -07002171[[gerrit.faviconPath]]gerrit.faviconPath::
2172+
2173Path for PolyGerrit's favicon after link:#gerrit.canonicalWebUrl[default URL],
2174including icon name and extension (.ico should be used).
2175
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002176
2177[[gerrit.instanceName]]gerrit.instanceName::
2178+
2179Short identifier for this Gerrit instance.
2180A good name should be short but precise enough so that users can identify the instance among others.
2181+
2182Defaults to the full hostname of the Gerrit server.
2183
2184
Sven Selberg327c2e42018-04-10 11:42:19 +02002185[[gerrit.serverId]]gerrit.serverId::
2186+
2187Used by NoteDb to, amongst other things, identify author identities from
2188per-server specific account IDs.
2189+
2190If this value is not set on startup it is automatically set to a random UUID.
2191+
2192[NOTE]
2193If this value doesn't match the serverId used when creating an already existing
2194NoteDb, Gerrit will not be able to use that instance of NoteDb. The serverId
2195used to create the NoteDb will show in the resulting exception message in case
2196the value differs.
2197
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002198[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002199=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002200
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002201Gerrit can forward requests to either an internally managed gitweb
2202(which allows Gerrit to enforce some access controls), or to an
2203externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002204See also link:config-gitweb.html[Gitweb Integration].
2205
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002206[[gitweb.cgi]]gitweb.cgi::
2207+
2208Path to the locally installed `gitweb.cgi` executable. This CGI will
2209be called by Gerrit Code Review when the URL `/gitweb` is accessed.
2210Project level access controls are enforced prior to calling the CGI.
2211+
David Pursehousea89dc982016-09-15 09:35:44 +02002212Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if `gitweb.url` is not set.
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002213
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002214[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002215+
2216Optional URL of an affiliated gitweb service. Defines the
2217web location where a `gitweb.cgi` is installed to browse
David Pursehousea89dc982016-09-15 09:35:44 +02002218`gerrit.basePath` and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002219+
2220Gerrit appends any necessary query arguments onto the end of this URL.
David Pursehousea89dc982016-09-15 09:35:44 +02002221For example, `?p=$project.git;h=$commit`.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002222
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002223[[gitweb.type]]gitweb.type::
2224+
2225Optional type of affiliated gitweb service. This allows using
David Pursehousea66f7ff2016-09-05 21:11:10 +09002226alternatives to gitweb, such as cgit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002227+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07002228Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
David Pursehousea66f7ff2016-09-05 21:11:10 +09002229+
2230If not set, or set to `disabled`, there is no gitweb hyperlinking
2231support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002232
Edwin Kempind86909c2012-03-26 10:36:29 +02002233[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002234+
2235Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002236at a specific commit when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002237+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002238Valid replacements are `${project}` for the project name in Gerrit
2239and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002240
Edwin Kempind86909c2012-03-26 10:36:29 +02002241[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002242+
2243Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002244at a specific project when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002245+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002246Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002247
Edwin Kempind86909c2012-03-26 10:36:29 +02002248[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002249+
2250Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002251at a specific branch when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002252+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002253Valid replacements are `${project}` for the project name in Gerrit
2254and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002255
Paladox none5759f2c2017-10-27 18:13:54 +00002256[[gitweb.tag]]gitweb.tag::
2257+
2258Optional pattern to use for constructing the gitweb URL when pointing
2259at a specific tag when `gitweb.type` is set to `custom`.
2260+
2261Valid replacements are `${project}` for the project name in Gerrit
2262and `${tag}` for the name of the tag.
2263
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002264[[gitweb.roottree]]gitweb.roottree::
2265+
2266Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002267at the contents of the root tree in a specific commit when `gitweb.type`
2268is set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002269+
2270Valid replacements are `${project}` for the project name in Gerrit
2271and `${commit}` for the SHA1 hash for the commit.
2272
2273[[gitweb.file]]gitweb.file::
2274+
2275Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002276at the contents of a file in a specific commit when `gitweb.type` is
2277set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002278+
2279Valid replacements are `${project}` for the project name in Gerrit,
2280`${file}` for the file name and `${commit}` for the SHA1 hash for
2281the commit.
2282
Edwin Kempin64011562012-03-26 10:50:12 +02002283[[gitweb.filehistory]]gitweb.filehistory::
2284+
2285Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002286at the history of a file in a specific branch when when `gitweb.type`
2287is set to `custom`.
Edwin Kempin64011562012-03-26 10:50:12 +02002288+
2289Valid replacements are `${project}` for the project name in Gerrit,
2290`${file}` for the file name and `${branch}` for the name of the
2291branch.
2292
Gustaf Lundha07d2e72011-10-27 15:26:35 -07002293[[gitweb.linkname]]gitweb.linkname::
2294+
2295Optional setting for modifying the link name presented to the user
2296in the Gerrit web-UI.
2297+
David Pursehousea89dc982016-09-15 09:35:44 +02002298The default linkname for custom type is `gitweb`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002299
Adrian Goerlerf2007072011-11-10 08:39:55 +01002300[[gitweb.pathSeparator]]gitweb.pathSeparator::
2301+
2302Optional character to substitute the standard path separator (slash) in
2303project names and branch names.
2304+
2305By default, Gerrit will use hexadecimal encoding for slashes in project and
2306branch names. Some web servers, such as Tomcat, reject this hexadecimal
2307encoding in the URL.
2308+
Marian Harbach34253372019-12-10 18:01:31 +01002309Some alternative gitweb services, such as link:http://gitblit.com[Gitblit,role=external,window=_blank],
Adrian Goerlerf2007072011-11-10 08:39:55 +01002310allow using an alternative path separator character. In Gitblit, this can be
Marian Harbach34253372019-12-10 18:01:31 +01002311configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter,role=external,window=_blank].
Adrian Goerlerf2007072011-11-10 08:39:55 +01002312In Gerrit, the alternative path separator can be configured correspondingly
David Pursehousea89dc982016-09-15 09:35:44 +02002313using the property `gitweb.pathSeparator`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002314+
David Pursehousea89dc982016-09-15 09:35:44 +02002315Valid values are the characters `*`, `(` and `)`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002316
David Pursehouse5d592e82016-06-09 05:12:26 +00002317[[gitweb.urlEncode]]gitweb.urlEncode::
Luca Milanesio25312032013-10-11 11:34:39 +01002318+
2319Whether or not Gerrit should encode the generated viewer URL.
2320+
2321Gerrit composes the viewer URL using information about the project, branch, file
2322or commit of the target object to be displayed. Typically viewers such as CGit
David Pursehousea89dc982016-09-15 09:35:44 +02002323and gitweb do need those parts to be encoded, including the `/` in project's name,
Luca Milanesio25312032013-10-11 11:34:39 +01002324for being correctly parsed.
2325However other viewers could instead require an unencoded URL (e.g. GitHub web
David Pursehousea89dc982016-09-15 09:35:44 +02002326based viewer).
Luca Milanesio25312032013-10-11 11:34:39 +01002327+
David Pursehousea89dc982016-09-15 09:35:44 +02002328Valid values are `true` and `false`. The default is `true`.
Luca Milanesio25312032013-10-11 11:34:39 +01002329
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002330[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002331=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01002332
2333[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
2334+
2335Controls whether newly created groups should be by default visible to
2336all registered users.
2337+
2338By default, false.
2339
Edwin Kempinf3eddd52017-01-20 14:05:47 +01002340[[groups.uuid.name]]groups.<uuid>.name::
2341+
2342Display name for group with the given UUID.
2343+
2344This option is only supported for system groups (scheme 'global').
2345+
2346E.g. this parameter can be used to configure another name for the
2347`Anonymous Users` group:
2348+
2349----
2350[groups "global:Anonymous-Users"]
2351 name = All Users
2352----
2353+
2354When setting this parameter it should be verified that there is no
2355existing group with the same name (case-insensitive). Configuring an
2356ambiguous name makes Gerrit fail on startup. Once set Gerrit ensures
2357that it is not possible to create a group with this name. Gerrit also
2358keeps the default name reserved so that it cannot be used for new
2359groups either. This means there is no danger of ambiguous group names
2360when this parameter is removed and the system group uses the default
2361name again.
2362
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002363[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002364=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002365
2366[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002367+
2368URL of the proxy server when making outgoing HTTP
2369connections for OpenID login transactions. Syntax
2370should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002371
2372[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002373+
2374Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002375This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002376appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002377
2378[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002379+
2380Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002381This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002382appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002383
Hugo Arès88e33ac2014-03-03 13:52:45 -05002384[[http.addUserAsRequestAttribute]]http.addUserAsRequestAttribute::
2385+
2386If true, 'User' attribute will be added to the request attributes so it
2387can be accessed outside the request scope (will be set to username or id
2388if username not configured).
2389+
2390This attribute can be used by the servlet container to log user in the
2391http access log.
2392+
2393When running the embedded servlet container, this attribute is used to
2394print user in the httpd_log.
2395+
2396* `%{User}r`
2397+
2398Pattern to print user in Tomcat AccessLog.
2399
2400+
2401Default value is true.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002402
Gustaf Lundhe45c3332018-05-02 10:52:11 +02002403[[http.addUserAsResponseHeader]]http.addUserAsResponseHeader::
2404+
2405If true, the header 'User' will be added to the list of response headers so it
2406can be accessed from a reverse proxy for logging purposes.
2407
2408+
2409Default value is false.
2410
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002411[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002412=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002413
2414The httpd section configures the embedded servlet container.
2415
2416[[httpd.listenUrl]]httpd.listenUrl::
2417+
Gert van Dijk70e26612019-09-29 16:20:25 +02002418Configuration for the listening sockets of the internal HTTP daemon.
2419Each entry of `listenUrl` combines the following options for a
2420listening socket: protocol, network address, port and context path.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002421+
Gert van Dijk70e26612019-09-29 16:20:25 +02002422_Protocol_ can be either `http://`, `https://`, `proxy-http://` or
2423`proxy-https://`. The latter two are special forms of `http://` with
2424awareness of a reverse proxy (see below). _Network address_ selects
2425the interface and/or scope of the listening socket. For notes
2426examples, see below. _Port_ is the TCP port number and is optional
2427(default value depends on the protocol). _Context path_ is the
2428optional "base URI" for the Gerrit Code Review as application to
2429serve on.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002430+
Gert van Dijk70e26612019-09-29 16:20:25 +02002431**Protocol** schemes:
2432+
2433* `http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002434+
2435Plain-text HTTP protocol. If port is not supplied, defaults to 80,
2436the standard HTTP port.
2437+
Gert van Dijk70e26612019-09-29 16:20:25 +02002438* `https://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002439+
2440SSL encrypted HTTP protocol. If port is not supplied, defaults to
2441443, the standard HTTPS port.
2442+
Gert van Dijk70e26612019-09-29 16:20:25 +02002443For configuration of the certificate and private key, see
2444<<httpd.sslKeyStore,httpd.sslKeyStore>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002445+
Gert van Dijk70e26612019-09-29 16:20:25 +02002446[NOTE]
2447SSL/TLS configuration capabilities of Gerrit internal HTTP daemon
2448are very limited. Externally facing production sites are strongly
2449encouraged to use a reverse proxy configuration to handle SSL/TLS
2450and use a `proxy-https://` scheme here (below) for security and
2451performance reasons.
2452+
2453* `proxy-http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002454+
2455Plain-text HTTP relayed from a reverse proxy. If port is not
2456supplied, defaults to 8080.
2457+
Gert van Dijk70e26612019-09-29 16:20:25 +02002458Like `http://`, but additional header parsing features are
2459enabled to honor `X-Forwarded-For`, `X-Forwarded-Host` and
2460`X-Forwarded-Server`. These headers are typically set by Apache's
Marian Harbach34253372019-12-10 18:01:31 +01002461link: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 -08002462+
Gert van Dijk70e26612019-09-29 16:20:25 +02002463[NOTE]
2464--
2465For secruity reasons, make sure to only allow connections from a
2466trusted reverse proxy in your network, as clients could otherwise
2467easily spoof these headers and thus spoof their originating IP
2468address effectively. If the reverse proxy is running on the same
2469machine as Gerrit daemon, the use of a _loopback_ network address
2470to bind to (see below) is strongly recommended to mitigate this.
2471
2472If not using Apache's mod_proxy, validate that your reverse proxy
2473sets these headers on all requests. If not, either configure it to
2474sanitize them from the origin, or use the `http://` scheme instead.
2475--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002476+
Gert van Dijk70e26612019-09-29 16:20:25 +02002477* `proxy-https://`
2478+
2479Plain-text HTTP relayed from a reverse proxy that has already
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002480handled the SSL encryption/decryption. If port is not supplied,
2481defaults to 8080.
2482+
Gert van Dijk70e26612019-09-29 16:20:25 +02002483Behaves exactly like `proxy-http://`, but also sets the scheme to
2484assume `https://` is the proper URL back to the server.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002485
2486+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002487--
Gert van Dijk70e26612019-09-29 16:20:25 +02002488**Network address** forms:
2489
2490* Loopback (localhost): `127.0.0.1` (IPv4) or `[::1]` (IPv6).
2491* All (unspecified): `0.0.0.0` (IPv4), `[::]` (IPv6) or `*`
2492 (IPv4 and IPv6)
2493* Interface IP address, e.g. `1.2.3.4` (IPv4) or
2494 `[2001:db8::a00:20ff:fea7:ccea]` (IPv6)
2495* Hostname, resolved at startup time to an address.
2496
2497**Context path** is the local part of the URL to be used to access
2498Gerrit on ('base URL'). E.g. `/gerrit/` to serve Gerrit on that URI
2499as base. If set, consider to align this with the
2500<<gerrit.canonicalWebUrl,gerrit.canonicalWebUrl>> setting. Correct
2501settings may depend on the reverse proxy configuration as well. By
2502default, this is `/` so that Gerrit serves requests on the root.
2503
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002504If multiple values are supplied, the daemon will listen on all
2505of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002506
Gert van Dijk70e26612019-09-29 16:20:25 +02002507Examples:
2508
2509----
2510[httpd]
2511 listenUrl = proxy-https://127.0.0.1:9999/gerrit/
2512[gerrit]
2513 # Reverse proxy is configured to serve with SSL/TLS on
2514 # example.com and to relay requests on /gerrit/ onto
2515 # http://127.0.0.1:9999/gerrit/
2516 canonicalWebUrl = https://example.com/gerrit/
2517----
2518
2519----
2520[httpd]
2521 # Listen on specific external interface with plaintext
2522 # HTTP on IPv6.
2523 listenUrl = http://[2001:db8::a00:20ff:fea7:ccea]
2524
2525 # Also listen on specific internal interface for use with
2526 # reverse proxy run on another host.
2527 listenUrl = proxy-https://192.168.100.123
2528----
2529
2530See also the page on link:config-reverseproxy.html[reverse proxy]
2531configuration.
2532
2533By default, `\http://*:8080`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002534--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002535
2536[[httpd.reuseAddress]]httpd.reuseAddress::
2537+
2538If true, permits the daemon to bind to the port even if the port
2539is already in use. If false, the daemon ensures the port is not
2540in use before starting. Busy sites may need to set this to true
2541to permit fast restarts.
2542+
2543By default, true.
2544
Luca Milanesio4e2bb452018-03-21 09:07:24 +00002545[[httpd.gracefulStopTimeout]]httpd.gracefulStopTimeout::
2546+
2547Set a graceful stop time. If set, the daemon ensures that all incoming
2548calls are preserved for a maximum period of time, before starting
2549the graceful shutdown process. Sites behind a workload balancer such as
2550HAProxy would need this to be set for avoiding serving errors during
2551rolling restarts.
2552+
2553Values should use common unit suffixes to express their setting:
2554+
2555* s, sec, second, seconds
2556* m, min, minute, minutes
2557+
2558By default, 0 seconds (immediate shutdown).
2559
Thomas Meyeraa93fdf2016-10-23 10:53:48 +02002560[[httpd.inheritChannel]]httpd.inheritChannel::
2561+
2562If true, permits the daemon to inherit its server socket channel
2563from fd0/1(stdin/stdout). When set to true, the server can be socket
2564activated via systemd or xinetd.
2565+
2566By default, false.
2567
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002568[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
2569+
2570Size, in bytes, of the buffer used to parse the HTTP headers of an
2571incoming HTTP request. The entire request headers, including any
2572cookies sent by the browser, must fit within this buffer, otherwise
2573the server aborts with the response '413 Request Entity Too Large'.
2574+
2575One buffer of this size is allocated per active connection.
2576Allocating a buffer that is too large wastes memory that cannot be
2577reclaimed, allocating a buffer that is too small may cause unexpected
2578errors caused by very long Referer URLs or large cookie values.
2579+
2580By default, 16384 (16 K), which is sufficient for most OpenID and
2581other web-based single-sign-on integrations.
2582
Chulho Yangb72ff8f2013-07-04 02:35:53 -04002583[[httpd.sslCrl]]httpd.sslCrl::
2584+
2585Path of the certificate revocation list file in PEM format. This
2586crl file is optional, and available for CLIENT_SSL_CERT_LDAP
2587authentication.
2588+
2589To create and view a crl using openssl:
2590+
2591----
2592openssl ca -gencrl -out crl.pem
2593openssl crl -in crl.pem -text
2594----
2595+
2596If not absolute, the path is resolved relative to `$site_path`.
2597+
2598By default, `$site_path/etc/crl.pem`.
2599
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002600[[httpd.sslKeyStore]]httpd.sslKeyStore::
2601+
2602Path of the Java keystore containing the server's SSL certificate
2603and private key. This keystore is required for `https://` in URL.
2604+
2605To create a self-signed certificate for simple internal usage:
2606+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002607----
2608keytool -keystore keystore -alias jetty -genkey -keyalg RSA
2609chmod 600 keystore
2610----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002611+
2612If not absolute, the path is resolved relative to `$site_path`.
2613+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002614By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002615
2616[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
2617+
2618Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09002619Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002620doesn't want to enable one.
2621+
2622If set to the empty string the embedded server will prompt for the
2623password during startup.
2624+
2625By default, `gerrit`.
2626
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002627[[httpd.requestLog]]httpd.requestLog::
2628+
2629Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
2630If enabled, an NCSA combined log format request log file is written
2631out by the internal HTTP daemon.
2632+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01002633`log4j.appender` with the name `httpd_log` can be configured to overwrite
2634programmatic configuration.
2635+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002636By default, true if httpd.listenUrl uses http:// or https://,
2637and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
2638
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002639[[httpd.acceptorThreads]]httpd.acceptorThreads::
2640+
2641Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09002642connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002643+
2644By default, 2, which should be suitable for most high-traffic sites.
2645
2646[[httpd.minThreads]]httpd.minThreads::
2647+
2648Minimum number of spare threads to keep in the worker thread pool.
2649This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09002650multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002651+
2652By default, 5, suitable for most lower-volume traffic sites.
2653
2654[[httpd.maxThreads]]httpd.maxThreads::
2655+
2656Maximum number of threads to permit in the worker thread pool.
2657+
2658By default 25, suitable for most lower-volume traffic sites.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02002659+
2660[NOTE]
2661Unless SSH daemon is disabled, see <<sshd.listenAddress, sshd.listenAddress>>,
2662the max number of concurrent Git requests over HTTP and SSH together is
2663defined by the <<sshd.threads, sshd.threads>> and
2664<<sshd.batchThreads, sshd.batchThreads>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002665
2666[[httpd.maxQueued]]httpd.maxQueued::
2667+
2668Maximum number of client connections which can enter the worker
2669thread pool waiting for a worker thread to become available.
David Ostrovsky14fe8bc2014-03-26 06:03:44 -070026700 sets the queue size to the Integer.MAX_VALUE.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002671+
Luca Milanesio0ae62fe2015-09-04 07:56:00 -07002672By default 200.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002673
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002674[[httpd.maxWait]]httpd.maxWait::
2675+
David Pursehouse221d4f62012-06-08 17:38:08 +09002676Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002677thread to handle a project clone, fetch or push request over the
2678smart HTTP transport.
2679+
2680Values should use common unit suffixes to express their setting:
2681+
2682* s, sec, second, seconds
2683* m, min, minute, minutes
2684* h, hr, hour, hours
2685* d, day, days
2686* w, week, weeks (`1 week` is treated as `7 days`)
2687* mon, month, months (`1 month` is treated as `30 days`)
2688* y, year, years (`1 year` is treated as `365 days`)
2689
2690+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002691--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002692If a unit suffix is not specified, `minutes` is assumed. If 0
2693is supplied, the maximum age is infinite and connections will not
2694abort until the client disconnects.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002695
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002696By default, 5 minutes.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002697--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002698
Luca Milanesioce7b7452013-06-18 11:40:49 +01002699[[httpd.filterClass]]httpd.filterClass::
2700+
2701Class that implements the javax.servlet.Filter interface
2702for filtering any HTTP related traffic going through the Gerrit
2703HTTP protocol.
2704Class is loaded and configured in the Gerrit Jetty container
2705and run in front of all Gerrit URL handlers, allowing the filter
2706to inspect, modify, allow or reject each request.
2707It needs to be provided as JAR library
2708under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
2709loader and cannot be dynamically loaded by a plugin.
2710+
2711Failing to load the Filter class would result in a Gerrit start-up
2712failure, as this class is supposed to provide mandatory filtering
2713in front of Gerrit HTTP protocol.
2714+
David Pursehouse42f42042013-08-01 14:02:25 +09002715Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01002716of an Apache HTTP proxy layer as security enforcement on top of Gerrit
2717by returning a trusted username as HTTP Header.
2718+
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002719Allow multiple values to install multiple servlet filters.
2720+
Luca Milanesioce7b7452013-06-18 11:40:49 +01002721Example of using a security library secure.jar under $GERRIT_SITE/lib
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002722that provides a org.anyorg.MySecureHeaderFilter Servlet Filter that enforces
2723a trusted username in the `TRUSTED_USER` HTTP Header and
2724org.anyorg.MySecureIPFilter that performs source IP security filtering:
Dyrone Teng14fc0832019-09-27 16:59:02 +08002725+
Luca Milanesioce7b7452013-06-18 11:40:49 +01002726----
2727[auth]
2728 type = HTTP
2729 httpHeader = TRUSTED_USER
2730
Dariusz Lukszaaac01132015-02-11 12:13:07 +01002731[httpd]
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002732 filterClass = org.anyorg.MySecureHeaderFilter
2733 filterClass = org.anyorg.MySecureIPFilter
Luca Milanesioce7b7452013-06-18 11:40:49 +01002734----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002735
Teng Longc192ca92019-09-23 11:22:03 +08002736[[filterClass.className.initParam]]filterClass.<className>.initParam::
2737+
2738Gerrit supports customized pluggable HTTP filters as `filterClass`. This
2739option allows to pass extra initialization parameters to the filter. It
2740allows for multiple key/value pairs to be passed in this pattern:
2741+
2742----
2743initParam = <key>=<value>
2744----
2745For a comprehensive example:
2746+
2747----
2748[httpd]
2749 filterClass = org.anyorg.AFilter
2750 filterClass = org.anyorg.BFilter
2751[filterClass "org.anyorg.AFilter"]
2752 key1 = value1
2753 key2 = value2
2754[filterClass "org.anyorg.BFilter"]
2755 key3 = value3
2756----
2757
Luca Milanesiodca95d52017-05-09 21:22:21 +01002758[[httpd.idleTimeout]]httpd.idleTimeout::
2759+
2760Maximum idle time for a connection, which roughly translates to the
2761TCP socket `SO_TIMEOUT`.
2762+
Luca Milanesiodca95d52017-05-09 21:22:21 +01002763This value is interpreted as the maximum time between some progress
2764being made on the connection. So if a single byte is read or written,
2765then the timeout is reset.
2766+
David Pursehouse9f0e5bc2017-06-30 16:16:53 +09002767The max idle time is applied:
2768+
2769* When waiting for a new message to be received on a connection
2770* When waiting for a new message to be sent on a connection
2771
2772+
Luca Milanesiodca95d52017-05-09 21:22:21 +01002773By default, 30 seconds.
2774
Juan Hernandezec512562013-08-06 16:30:50 +02002775[[httpd.robotsFile]]httpd.robotsFile::
2776+
2777Location of an external robots.txt file to be used instead of the one
2778bundled with the .war of the application.
2779+
2780If not absolute, the path is resolved relative to `$site_path`.
2781+
2782If the file doesn't exist or can't be read the default robots.txt file
2783bundled with the .war will be used instead.
2784
Dariusz Luksza011cfed2014-04-03 10:23:35 +02002785[[httpd.registerMBeans]]httpd.registerMBeans::
2786+
2787Enable (or disable) registration of Jetty MBeans for Java JMX.
2788+
2789By default, false.
2790
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002791[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002792=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09002793
2794The index section configures the secondary index.
2795
David Pursehouse3fc5ee32014-03-17 18:35:32 +09002796Note that after enabling the secondary index, the index must be built
2797using the link:pgm-reindex.html[reindex program] before restarting the
2798Gerrit server.
2799
David Pursehouse6d458432013-08-23 16:17:18 +09002800[[index.type]]index.type::
2801+
2802Type of secondary indexing employed by Gerrit. The supported
2803values are:
2804+
2805* `LUCENE`
2806+
2807A link:http://lucene.apache.org/[Lucene] index is used.
2808+
David Pursehouse8e72f532014-06-24 11:01:28 +09002809+
Dariusz Lukszaea529882017-04-25 15:11:31 +02002810* `ELASTICSEARCH` look into link:#elasticsearch[Elasticsearch section]
David Pursehouse8e72f532014-06-24 11:01:28 +09002811+
Marian Harbach34253372019-12-10 18:01:31 +01002812An link:https://www.elastic.co/products/elasticsearch[Elasticsearch,role=external,window=_blank] index is
David Pursehouse2e79e5b2018-04-20 10:23:29 +02002813used. Refer to the link:#elasticsearch[Elasticsearch section] for further
2814configuration details.
David Pursehouse6d458432013-08-23 16:17:18 +09002815
2816+
Shawn Pearced4ae3a162013-11-24 17:00:31 -08002817By default, `LUCENE`.
David Pursehouse6d458432013-08-23 16:17:18 +09002818
David Pursehouse904db302014-03-17 18:55:38 +09002819[[index.threads]]index.threads::
2820+
Hugo Arèsfab06702016-06-10 12:49:52 -04002821Number of threads to use for indexing in normal interactive operations. Setting
2822it to 0 disables the dedicated thread pool and indexing will be done in the same
2823thread as the operation.
David Pursehouse904db302014-03-17 18:55:38 +09002824+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02002825If not set or set to a zero, defaults to the number of logical CPUs as returned
2826by the JVM. If set to a negative value, defaults to a direct executor.
David Pursehouse00c82142014-01-22 17:41:09 +09002827
Dave Borowitz787af5f2014-10-22 16:26:00 -07002828[[index.batchThreads]]index.batchThreads::
2829+
2830Number of threads to use for indexing in background operations, such as
2831online schema upgrades.
2832+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02002833If not set or set to a zero, defaults to the number of logical CPUs as returned
2834by the JVM. If set to a negative value, defaults to a direct executor.
Dave Borowitz787af5f2014-10-22 16:26:00 -07002835
Dave Borowitzd80b9342015-03-25 10:32:21 -07002836[[index.onlineUpgrade]]index.onlineUpgrade::
2837+
2838Whether to upgrade to new index schema versions while the server is
2839running. This is recommended as it prevents additional downtime during
2840Gerrit version upgrades (avoiding the need for an offline reindex step
2841using Reindex), but can add additional server load during the upgrade.
2842+
2843If set to false, there is no way to upgrade the index schema to take
2844advantage of new search features without restarting the server.
2845+
2846Defaults to true.
2847
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07002848[[index.maxLimit]]index.maxLimit::
2849+
2850Maximum limit to allow for search queries. Requesting results above this
2851limit will truncate the list (but will still set `_more_changes` on
2852result lists). Set to 0 for no limit.
2853+
David Pursehouse7c1f4a42018-03-15 17:03:40 +09002854When `index.type` is set to `ELASTICSEARCH`, this value should not exceed
2855the `index.max_result_window` value configured on the Elasticsearch
David Pursehouse52c2b4a2018-04-10 23:38:57 +09002856server. If a value is not configured during site initialization, defaults to
285710000, which is the default value of `index.max_result_window` in Elasticsearch.
David Pursehouse7c1f4a42018-03-15 17:03:40 +09002858+
David Pursehouse52c2b4a2018-04-10 23:38:57 +09002859When `index.type` is set to `LUCENE`, defaults to no limit.
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07002860
Dave Borowitzf56d3652015-04-22 17:35:34 -07002861[[index.maxPages]]index.maxPages::
2862+
2863Maximum number of pages of search results to allow, as index
2864implementations may have to scan through large numbers of skipped
2865results when searching with an offset. Requesting results starting past
2866this threshold times the requested limit will result in an error. Set to
28670 for no limit.
2868+
2869Defaults to no limit.
2870
Dave Borowitzd034ca82015-10-15 11:20:30 -04002871[[index.maxTerms]]index.maxTerms::
2872+
2873Maximum number of leaf terms to allow in a query. Too-large queries may
2874perform poorly, so setting this option causes query parsing to fail fast
Dave Borowitzada289c2018-12-18 13:24:14 -08002875before attempting to send them to the secondary index.
Dave Borowitzd034ca82015-10-15 11:20:30 -04002876+
Marco Miller6da22822016-01-29 12:31:38 -05002877When the index type is `LUCENE`, also sets the maximum number of clauses
2878permitted per BooleanQuery. This is so that all enforced query limits
2879are the same.
2880+
2881Defaults to 1024.
Dave Borowitzd034ca82015-10-15 11:20:30 -04002882
Dave Borowitz3747f0f2017-06-23 14:29:31 -04002883[[index.autoReindexIfStale]]index.autoReindexIfStale::
2884+
2885Whether to automatically check if a document became stale in the index
2886immediately after indexing it. If false, there is a race condition during two
2887simultaneous writes that may cause one of the writes to not be reflected in the
2888index. The check to avoid this does consume some resources.
2889+
Dave Borowitzb7da0762018-03-19 09:08:45 -04002890Defaults to false.
Dave Borowitz3747f0f2017-06-23 14:29:31 -04002891
Edwin Kempin0f0de862018-02-08 16:24:11 +01002892[[index.scheduledIndexer]]
2893==== Subsection index.scheduledIndexer
2894
2895This section configures periodic indexing. Periodic indexing is
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002896intended to run only on replicas and only updates the group index.
2897Replication to replicas happens on Git level so that Gerrit is not aware
2898of incoming replication events. But replicas need an updated group index
Edwin Kempin0f0de862018-02-08 16:24:11 +01002899to resolve memberships of users for ACL validation. To keep the group
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002900index in replicas up-to-date the Gerrit replica periodically scans the
Edwin Kempin0f0de862018-02-08 16:24:11 +01002901group refs in the All-Users repository to reindex groups if they are
2902stale.
2903
2904The scheduled reindexer is not able to detect group deletions that
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002905happened while the replica was offline, but since group deletions are not
Edwin Kempin0f0de862018-02-08 16:24:11 +01002906supported this should never happen. If nevertheless groups refs were
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002907deleted while a replica was offline a full offline link:pgm-reindex.html[
Edwin Kempin0f0de862018-02-08 16:24:11 +01002908reindex] must be performed.
2909
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002910This section is only used if Gerrit runs in replica mode, otherwise it is
Edwin Kempin0f0de862018-02-08 16:24:11 +01002911ignored.
2912
Edwin Kempina32d4432018-02-16 17:18:31 +01002913[[index.scheduledIndexer.runOnStartup]]index.scheduledIndexer.runOnStartup::
2914+
2915Whether the scheduled indexer should run once immediately on startup.
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002916If set to `true` the replica startup is blocked until all stale groups
2917were reindexed. Enabling this allows to prevent that replicas that were
Edwin Kempina32d4432018-02-16 17:18:31 +01002918offline for a longer period of time run with outdated group information
2919until the first scheduled indexing is done.
2920+
2921Defaults to `true`.
2922
Edwin Kempin0f0de862018-02-08 16:24:11 +01002923[[index.scheduledIndexer.enabled]]index.scheduledIndexer.enabled::
2924+
2925Whether the scheduled indexer is enabled. If the scheduled indexer is
2926disabled you must implement other means to keep the group index for the
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02002927replica up-to-date (e.g. by using ElasticSearch for the indexes).
Edwin Kempin0f0de862018-02-08 16:24:11 +01002928+
2929Defaults to `true`.
2930
2931[[index.scheduledIndexer.startTime]]index.scheduledIndexer.startTime::
2932+
2933The link:#schedule-configuration-startTime[start time] for running
2934the scheduled indexer.
2935+
2936Defaults to `00:00`.
2937
2938[[index.scheduledIndexer.interval]]index.scheduledIndexer.interval::
2939+
2940The link:#schedule-configuration-interval[interval] for running
2941the scheduled indexer.
2942+
2943Defaults to `5m`.
2944
2945link:#schedule-configuration-examples[Schedule examples] can be found
2946in the link:#schedule-configuration[Schedule Configuration] section.
2947
David Pursehouse902b3ee2014-07-09 16:17:49 +09002948==== Lucene configuration
2949
2950Open and closed changes are indexed in separate indexes named
2951'open' and 'closed' respectively.
2952
2953The following settings are only used when the index type is `LUCENE`.
David Pursehouseac88c362014-02-06 12:01:34 +09002954
David Pursehouse00c82142014-01-22 17:41:09 +09002955[[index.name.ramBufferSize]]index.name.ramBufferSize::
2956+
David Pursehouse00c82142014-01-22 17:41:09 +09002957Determines the amount of RAM that may be used for buffering added documents
2958and deletions before they are flushed to the index. See the
2959link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
Marian Harbach34253372019-12-10 18:01:31 +01002960Lucene documentation,role=external,window=_blank] for further details.
David Pursehouse00c82142014-01-22 17:41:09 +09002961+
2962Defaults to 16M.
2963
2964[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
2965+
David Pursehouse00c82142014-01-22 17:41:09 +09002966Determines the minimal number of documents required before the buffered
2967in-memory documents are flushed to the index. Large values generally
2968give faster indexing. See the
2969link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
Marian Harbach34253372019-12-10 18:01:31 +01002970Lucene documentation,role=external,window=_blank] for further details.
David Pursehouse00c82142014-01-22 17:41:09 +09002971+
2972Defaults to -1, meaning no maximum is set and the writer will flush
2973according to RAM usage.
2974
Dave Borowitzd08b0452014-02-13 11:56:03 -08002975[[index.name.commitWithin]]index.name.commitWithin::
2976+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002977Determines the period at which changes are automatically committed to
2978stable store on disk. This is a costly operation and may block
2979additional index writes, so lower with caution.
2980+
Bruce Zuaf058e62014-03-21 10:03:05 +08002981If zero, changes are committed after every write. This is very costly
2982but may be useful if offline reindexing is infeasible, or for development
2983servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08002984+
Bruce Zuaf058e62014-03-21 10:03:05 +08002985Values can be specified using standard time unit abbreviations (`ms`, `sec`,
2986`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07002987+
Bruce Zuaf058e62014-03-21 10:03:05 +08002988If negative, `commitWithin` is disabled. Changes are flushed to disk when
2989the in-memory buffer fills, but only committed and guaranteed to be synced
2990to disk when the process finishes.
David Pursehouse902b3ee2014-07-09 16:17:49 +09002991+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002992Defaults to 300000 ms (5 minutes).
2993
Trevor Getty8fb5db52019-08-26 14:33:19 +02002994
2995[[index.name.maxMergeCount]]index.name.maxMergeCount::
2996+
2997Determines the max number of simultaneous merges that are allowed. If a merge
2998is necessary yet we already have this many threads running, the incoming thread
2999(that is calling add/updateDocument) will block until a merge thread has
3000completed. Note that Lucene will only run the smallest maxThreadCount merges
3001at a time. See the
3002link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Marian Harbach34253372019-12-10 18:01:31 +01003003Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003004+
3005Defaults to -1 for (auto detection).
3006
3007
3008[[index.name.maxThreadCount]]index.name.maxThreadCount::
3009+
3010Determines the max number of simultaneous Lucene merge threads that should be running at
3011once. This must be less than or equal to maxMergeCount. See the
3012link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Marian Harbach34253372019-12-10 18:01:31 +01003013Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003014+
3015For further details on Lucene index configuration (auto detection) which
3016affects maxThreadCount and maxMergeCount settings.
3017See the
3018link: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 +01003019Lucene documentation,role=external,window=_blank]
Trevor Getty8fb5db52019-08-26 14:33:19 +02003020+
3021Defaults to -1 for (auto detection).
3022
3023[[index.name.enableAutoIOThrottle]]index.name.enableAutoIOThrottle::
3024+
3025Allows the control of whether automatic IO throttling is enabled and used by
3026default in the lucene merge queue. Automatic dynamic IO throttling, which when
3027on is used to adaptively rate limit writes bytes/sec to the minimal rate necessary
3028so merges do not fall behind. See the
3029link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#enableAutoIOThrottle()[
Marian Harbach34253372019-12-10 18:01:31 +01003030Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003031+
3032Defaults to true (throttling enabled).
3033
David Pursehouse902b3ee2014-07-09 16:17:49 +09003034Sample Lucene index configuration:
David Pursehouse00c82142014-01-22 17:41:09 +09003035----
3036[index]
3037 type = LUCENE
3038
3039[index "changes_open"]
3040 ramBufferSize = 60 m
3041 maxBufferedDocs = 3000
Trevor Getty8fb5db52019-08-26 14:33:19 +02003042 maxThreadCount = 5
3043 maxMergeCount = 50
3044
David Pursehouse00c82142014-01-22 17:41:09 +09003045
3046[index "changes_closed"]
3047 ramBufferSize = 20 m
3048 maxBufferedDocs = 500
Trevor Getty8fb5db52019-08-26 14:33:19 +02003049 maxThreadCount = 10
3050 maxMergeCount = 100
3051 enableIOThrottle = false
3052
David Pursehouse00c82142014-01-22 17:41:09 +09003053----
3054
Dariusz Lukszaea529882017-04-25 15:11:31 +02003055[[elasticsearch]]
3056=== Section elasticsearch
David Pursehouse8e72f532014-06-24 11:01:28 +09003057
David Pursehouse1a82b372018-06-19 11:14:21 +09003058WARNING: Support for Elasticsearch is still experimental and is not recommended
David Pursehouse7e566dc2018-09-20 14:12:15 +09003059for production use. For compatibility information, please refer to the
Marian Harbach34253372019-12-10 18:01:31 +01003060link:https://www.gerritcodereview.com/elasticsearch.html[project homepage,role=external,window=_blank].
David Pursehouse8e72f532014-06-24 11:01:28 +09003061
David Pursehouse0e39a8d2018-11-27 20:25:43 +09003062When using Elasticsearch version 5.6, the open and closed changes are
David Pursehouse1a82b372018-06-19 11:14:21 +09003063indexed in a single index, separated into types `open_changes` and `closed_changes`
3064respectively. When using version 6.2 or later, the open and closed changes are
3065merged into the default `_doc` type. The latter is also used for the accounts and
3066groups indices starting with Elasticsearch 6.2.
David Pursehouse8e72f532014-06-24 11:01:28 +09003067
David Pursehouse6ea25322018-07-03 21:26:07 +09003068Note that when Gerrit is configured to use Elasticsearch, the Elasticsearch
3069server(s) must be reachable during the site initialization.
3070
Dariusz Lukszaea529882017-04-25 15:11:31 +02003071[[elasticsearch.prefix]]elasticsearch.prefix::
David Pursehouse8e72f532014-06-24 11:01:28 +09003072+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08003073This setting can be used to prefix index names to allow multiple Gerrit
David Pursehouse997cf2a2018-05-10 15:40:47 +09003074instances in a single Elasticsearch cluster. Prefix `gerrit1_` would result in a
3075change index named `gerrit1_changes_0001`.
David Pursehouse8e72f532014-06-24 11:01:28 +09003076+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08003077Not set by default.
David Pursehouse8e72f532014-06-24 11:01:28 +09003078
David Pursehouse479c50b2018-07-02 12:47:07 +09003079[[elasticsearch.server]]elasticsearch.server::
Dariusz Lukszaea529882017-04-25 15:11:31 +02003080+
David Pursehouse479c50b2018-07-02 12:47:07 +09003081Elasticsearch server URI in the form `http[s]://hostname:port`. The `port` is
3082optional and defaults to `9200` if not specified.
Dariusz Lukszaea529882017-04-25 15:11:31 +02003083+
David Pursehouse479c50b2018-07-02 12:47:07 +09003084At least one server must be specified. May be specified multiple times to
3085configure multiple Elasticsearch servers.
Dariusz Lukszaea529882017-04-25 15:11:31 +02003086+
David Pursehouse479c50b2018-07-02 12:47:07 +09003087Note that the site initialization program only allows to configure a single
3088server. To configure multiple servers the `gerrit.config` file must be edited
3089manually.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003090
David Pursehouse499f7fe2018-11-30 16:07:21 +09003091[[elasticsearch.numberOfShards]]elasticsearch.numberOfShards::
3092+
3093Sets the number of shards to use per index. Refer to the
Marco Miller13906f22019-06-17 14:56:10 -04003094link:https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-concepts.html#getting-started-shards-and-replicas[
Marian Harbach34253372019-12-10 18:01:31 +01003095Elasticsearch documentation,role=external,window=_blank] for details.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003096+
Marco Miller082139a2019-06-17 15:00:35 -04003097Defaults to 5 for Elasticsearch versions 5 and 6, and to 1 starting with Elasticsearch 7.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003098
3099[[elasticsearch.numberOfReplicas]]elasticsearch.numberOfReplicas::
3100+
3101Sets the number of replicas to use per index. Refer to the
Marco Miller13906f22019-06-17 14:56:10 -04003102link:https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-concepts.html#getting-started-shards-and-replicas[
Marian Harbach34253372019-12-10 18:01:31 +01003103Elasticsearch documentation,role=external,window=_blank] for details.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003104+
3105Defaults to 1.
3106
David Pursehouse13f1d632018-07-02 14:37:36 +09003107==== Elasticsearch Security
Dariusz Lukszaea529882017-04-25 15:11:31 +02003108
David Pursehouse13f1d632018-07-02 14:37:36 +09003109When security is enabled in Elasticsearch, the username and password must be provided.
3110Note that the same username and password are used for all servers.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003111
David Pursehouse13f1d632018-07-02 14:37:36 +09003112For further information about Elasticsearch security, please refer to the documentation:
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003113
Marian Harbach34253372019-12-10 18:01:31 +01003114* link:https://www.elastic.co/guide/en/x-pack/5.6/security-getting-started.html[Elasticsearch 5.6,role=external,window=_blank]
3115* link:https://www.elastic.co/guide/en/x-pack/6.2/security-getting-started.html[Elasticsearch 6.2,role=external,window=_blank]
3116* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.3/security-getting-started.html[Elasticsearch 6.3,role=external,window=_blank]
3117* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.4/security-getting-started.html[Elasticsearch 6.4,role=external,window=_blank]
3118* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.5/security-getting-started.html[Elasticsearch 6.5,role=external,window=_blank]
3119* link:https://www.elastic.co/guide/en/elastic-stack-overview/6.6/security-getting-started.html[Elasticsearch 6.6,role=external,window=_blank]
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003120
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003121[[elasticsearch.username]]elasticsearch.username::
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003122+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003123Username used to connect to Elasticsearch.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003124+
David Pursehouse975fdd22018-07-02 14:23:07 +09003125If a password is set, defaults to `elastic`, otherwise not set by default.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003126
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003127[[elasticsearch.password]]elasticsearch.password::
3128+
3129Password used to connect to Elasticsearch.
3130+
3131Not set by default.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003132
Patrick Hieselda692472019-10-07 16:03:23 +02003133[[event]]
3134=== Section event
3135
3136[[event.payload.listChangeOptions]]events.payload.listChangeOptions::
3137+
3138List of options that Gerrit applies when rendering the payload of an
3139internal event. This is the same set of options that are documented
3140link:rest-api-changes.html#query-options[here].
3141+
3142Depending on the setup, these events might get serialized using stream
3143events.
3144+
3145This can be set to the set of minimal options that consumers of Gerrit's
Patrick Hiesela4824db2019-12-20 10:55:26 +01003146events need. A minimal set would be (`SKIP_DIFFSTAT`).
Patrick Hieselda692472019-10-07 16:03:23 +02003147+
3148Every option that gets added here will have a performance impact. The
3149general recommendation is therefore to set this to a minimal set of
3150required options.
3151+
3152Defaults to all available options minus `CHANGE_ACTIONS`,
3153`CURRENT_ACTIONS` and `CHECK`. This is a rich default to make sure the
3154config is backwards compatible with what the default was before the config
3155was added.
3156
3157
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003158[[ldap]]
3159=== Section ldap
3160
3161LDAP integration is only enabled if `auth.type` is set to
3162`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
3163detailed description of the `auth.type` settings and their
3164implications.
3165
3166An example LDAP configuration follows, and then discussion of
3167the parameters introduced here. Suitable defaults for most
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003168parameters are automatically guessed based on the type of server
Michal Pasierb3e262742017-01-23 12:50:48 +01003169detected during startup. The guessed defaults support
Marian Harbach34253372019-12-10 18:01:31 +01003170link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307,role=external,window=_blank], Active
3171Directory and link:https://www.freeipa.org[FreeIPA,role=external,window=_blank].
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003172
3173----
3174[ldap]
3175 server = ldap://ldap.example.com
3176
3177 accountBase = ou=people,dc=example,dc=com
3178 accountPattern = (&(objectClass=person)(uid=${username}))
3179 accountFullName = displayName
3180 accountEmailAddress = mail
3181
3182 groupBase = ou=groups,dc=example,dc=com
3183 groupMemberPattern = (&(objectClass=group)(member=${dn}))
3184----
3185
Luca Milanesioa05d42b2018-12-19 01:13:06 +00003186[[ldap.guessRelevantGroups]]ldap.guessRelevantGroups::
3187+
3188Filter the groups found in LDAP by guessing the ones relevant to
3189Gerrit and removing the others from list completions and ACL evaluations.
3190The guess is based on two elements: the projects most recently
3191accessed in the cache and the list of LDAP groups included in their ACLs.
3192+
3193Please note that projects rarely used and thus not cached may be
3194temporarily inaccessible by users even with LDAP membership and grants
3195referenced in the ACLs.
3196+
3197By default, true.
3198
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003199[[ldap.server]]ldap.server::
3200+
3201URL of the organization's LDAP server to query for user information
3202and group membership from. Must be of the form `ldap://host` or
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003203`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003204+
3205If `auth.type` is `LDAP` this setting should use `ldaps://` to
3206ensure the end user's plaintext password is transmitted only over
3207an encrypted connection.
3208
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003209[[ldap.startTls]]ldap.startTls::
3210+
3211If true, Gerrit will perform StartTLS extended operation.
3212+
3213By default, false, StartTLS will not be enabled.
3214
Alon Bar-Leve39c35c2019-06-10 12:59:55 +03003215[[ldap.supportAnonymous]]ldap.supportAnonymous::
3216+
3217If false, Gerrit will provide credentials only at connection open, this is
3218required for some `LDAP` implementations that do not allow anonymous bind
3219for StartTLS or for reauthentication.
3220+
3221By default, true.
3222
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003223[[ldap.sslVerify]]ldap.sslVerify::
3224+
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003225If false and ldap.server is an `ldaps://` style URL or `ldap.startTls`
3226is true, Gerrit will not verify the server certificate when it connects
3227to perform a query.
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003228+
3229By default, true, requiring the certificate to be verified.
3230
Olga Grinbergcf1b06a2015-02-03 15:54:48 -05003231[[ldap.groupsVisibleToAll]]ldap.groupsVisibleToAll::
3232+
3233If true, LDAP groups are visible to all registered users.
3234+
3235By default, false, LDAP groups are visible only to administrators and
3236group members.
3237
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003238[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003239+
3240_(Optional)_ Username to bind to the LDAP server with. If not set,
3241an anonymous connection to the LDAP server is attempted.
3242
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003243[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003244+
3245_(Optional)_ Password for the user identified by `ldap.username`.
3246If not set, an anonymous (or passwordless) connection to the LDAP
3247server is attempted.
3248
Ben Wu0410a152010-06-04 16:17:24 +08003249[[ldap.referral]]ldap.referral::
3250+
3251_(Optional)_ How an LDAP referral should be handled if it is
3252encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05003253automatically follow any referrals, or `ignore` to ignore the
3254referrals.
Ben Wu0410a152010-06-04 16:17:24 +08003255+
3256By default, `ignore`.
3257
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003258[[ldap.readTimeout]]ldap.readTimeout::
3259+
3260_(Optional)_ The read timeout for an LDAP operation. The value is
3261in the usual time-unit format like "1 s", "100 ms", etc...
3262A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09003263threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003264+
3265By default there is no timeout and Gerrit will wait for the LDAP
3266server to respond until the TCP connection times out.
3267
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003268[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003269+
3270Root of the tree containing all user accounts. This is typically
3271of the form `ou=people,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003272+
3273This setting may be added multiple times to specify more than
3274one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003275
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003276[[ldap.accountScope]]ldap.accountScope::
3277+
3278Scope of the search performed for accounts. Must be one of:
3279+
3280* `one`: Search only one level below accountBase, but not recursive
3281* `sub` or `subtree`: Search recursively below accountBase
3282* `base` or `object`: Search exactly accountBase; probably not desired
3283
3284+
3285Default is `subtree` as many directories have several levels.
3286
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003287[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003288+
3289Query pattern to use when searching for a user account. This may be
3290any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09003291`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003292`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09003293that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02003294the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003295the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003296+
3297This pattern is used to search the objects contained directly under
3298the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02003299is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003300setting depends on the LDAP schema used by the directory server.
3301+
Michal Pasierb3e262742017-01-23 12:50:48 +01003302Default is `(uid=${username})` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003303and `(&(objectClass=user)(sAMAccountName=${username}))`
3304for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003305
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003306[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003307+
3308_(Optional)_ Name of an attribute on the user account object which
3309contains the initial value for the user's full name field in Gerrit.
3310Typically this is the `displayName` property in LDAP, but could
3311also be `legalName` or `cn`.
3312+
David Pursehouse221d4f62012-06-08 17:38:08 +09003313Attribute values may be concatenated with literal strings. For
3314example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02003315`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003316+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003317If set, users will be unable to modify their full name field, as
3318Gerrit will populate it only from the LDAP data.
3319+
Michal Pasierb3e262742017-01-23 12:50:48 +01003320Default is `displayName` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003321and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003322
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003323[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003324+
3325_(Optional)_ Name of an attribute on the user account object which
3326contains the user's Internet email address, as defined by this
3327LDAP server.
3328+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003329Attribute values may be concatenated with literal strings,
3330for example to set the email address to the lowercase form
3331of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02003332`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003333+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003334If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09003335but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003336and select a different preferred email address.
3337+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003338Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003339
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003340[[ldap.accountSshUserName]]ldap.accountSshUserName::
3341+
3342_(Optional)_ Name of an attribute on the user account object which
3343contains the initial value for the user's SSH username field in
3344Gerrit. Typically this is the `uid` property in LDAP, but could
3345also be `cn`. Administrators should prefer to match the attribute
3346corresponding to the user's workstation username, as this is what
3347SSH clients will default to.
3348+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003349Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02003350an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003351force the value of sAMAccountName, if defined, to be all lowercase.
3352The suffix `.toUpperCase` can be used for the other direction.
3353The suffix `.localPart` can be used to split attribute values of
3354the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02003355example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003356+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003357If set, users will be unable to modify their SSH username field, as
David Pursehousec12da502016-08-11 20:45:03 +09003358Gerrit will populate it only from the LDAP data. Note that once the
3359username has been set it cannot be changed, therefore it is
3360recommended not to make changes to this setting that would cause the
3361value to differ, as this will prevent users from logging in.
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003362+
Michal Pasierb3e262742017-01-23 12:50:48 +01003363Default is `uid` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003364and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003365
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003366[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04003367+
3368_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003369contains the groups the user is part of. Typically used for Active
Michal Pasierb3e262742017-01-23 12:50:48 +01003370Directory and FreeIPA servers.
Anthony93de7db2009-10-03 10:01:50 -04003371+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003372Default is unset for RFC 2307 servers (disabled)
Michal Pasierb3e262742017-01-23 12:50:48 +01003373and `memberOf` for Active Directory and FreeIPA.
3374
3375[[ldap.accountMemberExpandGroups]]ldap.accountMemberExpandGroups::
3376+
3377_(Optional)_ Whether to expand nested groups recursively. This
3378setting is used only if `ldap.accountMemberField` is set.
3379+
3380Default is unset for FreeIPA and `true` for RFC 2307 servers
3381and Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04003382
Saša Živkovc81291f2015-02-04 17:19:20 +01003383[[ldap.fetchMemberOfEagerly]]ldap.fetchMemberOfEagerly::
3384+
3385_(Optional)_ Whether to fetch the `memberOf` account attribute on
3386login. Setups which use LDAP for user authentication but don't make
3387use of the LDAP groups may benefit from setting this option to `false`
3388as this will result in a much faster LDAP login.
3389+
3390Default is unset for RFC 2307 servers (disabled) and `true` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003391Active Directory and FreeIPA.
Saša Živkovc81291f2015-02-04 17:19:20 +01003392
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003393[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003394+
3395Root of the tree containing all group objects. This is typically
3396of the form `ou=groups,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003397+
3398This setting may be added multiple times to specify more than
3399one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003400
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003401[[ldap.groupScope]]ldap.groupScope::
3402+
3403Scope of the search performed for group objects. Must be one of:
3404+
3405* `one`: Search only one level below groupBase, but not recursive
3406* `sub` or `subtree`: Search recursively below groupBase
3407* `base` or `object`: Search exactly groupBase; probably not desired
3408
3409+
3410Default is `subtree` as many directories have several levels.
3411
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003412[[ldap.groupPattern]]ldap.groupPattern::
3413+
3414Query pattern used when searching for an LDAP group to connect
3415to a Gerrit group. This may be any valid LDAP query expression,
3416including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003417`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003418group owner.
3419+
Michal Pasierb3e262742017-01-23 12:50:48 +01003420Default is `(cn=${groupname})` for FreeIPA and RFC 2307 servers,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003421and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003422
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003423[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003424+
3425Query pattern to use when searching for the groups that a user
3426account is currently a member of. This may be any valid LDAP query
3427expression, including the standard `(&...)` and `(|...)` operators.
3428+
David Pursehouse42f42042013-08-01 14:02:25 +09003429If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003430replaced with a parameter set to the username that was supplied
3431by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003432such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003433corresponding attribute (in this case, `fooBarAttribute`) as read
3434from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02003435Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003436+
Scott Dial50457502013-08-11 16:52:51 -04003437Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003438RFC 2307, and unset (disabled) for Active Directory and FreeIPA.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003439
Auke Schrijnen57809132012-09-26 21:05:39 +02003440[[ldap.groupName]]ldap.groupName::
3441+
David Pursehouse39489ae2012-10-12 13:50:04 +09003442_(Optional)_ Name of the attribute on the group object which contains
3443the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02003444+
David Pursehouse39489ae2012-10-12 13:50:04 +09003445Typically the attribute name is `cn` for RFC 2307 and Active Directory
3446servers. For other servers the attribute name may differ, for example
3447`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02003448+
David Pursehouse39489ae2012-10-12 13:50:04 +09003449It is also possible to specify a literal string containing a pattern of
3450attribute values. For example to create a Gerrit group name consisting of
3451LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
3452+
3453Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02003454
Gustaf Lundhdaf41af2016-12-05 19:05:09 +01003455[[ldap.mandatoryGroup]]ldap.mandatoryGroup::
3456+
3457All users must be a member of this group to allow account creation or
3458authentication.
3459+
3460Setting mandatoryGroup implies enabling of `ldap.fetchMemberOfEagerly`
3461+
3462By default, unset.
3463
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003464[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
3465+
3466Converts the local username, that is used to login into the Gerrit
David Pursehousea1d633b2014-05-02 17:21:02 +09003467Web UI, to lower case before doing the LDAP authentication. By setting
3468this parameter to true, a case insensitive login to the Gerrit Web UI
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003469can be achieved.
3470+
3471If set, it must be ensured that the local usernames for all existing
3472accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09003473local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003474anymore. The local usernames for the existing accounts can be
3475converted to lower case by running the server program
3476link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
3477Please be aware that the conversion of the local usernames to lower
3478case can't be undone. For newly created accounts the local username
3479will be directly stored in lower case.
3480+
3481By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003482
Robin Rosenberga3baed02012-10-14 14:09:32 +02003483[[ldap.authentication]]ldap.authentication::
3484+
3485Defines how Gerrit authenticates with the server. When set to `GSSAPI`
3486Gerrit will use Kerberos. To use kerberos the
3487`java.security.auth.login.config` system property must point to a
3488login to a JAAS configuration file and, if Java 6 is used, the system
3489property `java.security.krb5.conf` must point to the appropriate
3490krb5.ini file with references to the KDC.
3491
3492Typical jaas.conf.
3493
3494----
3495KerberosLogin {
3496 com.sun.security.auth.module.Krb5LoginModule
3497 required
3498 useTicketCache=true
3499 doNotPrompt=true
3500 renewTGT=true;
3501};
3502----
3503
3504See Java documentation on how to create the krb5.ini file.
3505
3506Note the `renewTGT` property to make sure the TGT does not expire,
3507and `useTicketCache` to use the TGT supplied by the operating system. As
3508the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09003509to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02003510
3511On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
3512must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
3513have local administrator privileges.
3514
Bruce Zucd04bbc2014-07-25 15:48:09 +08003515[[ldap.useConnectionPooling]]ldap.useConnectionPooling::
3516+
3517_(Optional)_ Enable the LDAP connection pooling or not.
3518+
3519If it is true, the LDAP service provider maintains a pool of (possibly)
3520previously used connections and assigns them to a Context instance as
3521needed. When a Context instance is done with a connection (closed or
3522garbage collected), the connection is returned to the pool for future use.
3523+
3524For details, see link:http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html[
Marian Harbach34253372019-12-10 18:01:31 +01003525LDAP connection management (Pool),role=external,window=_blank] and link:http://docs.oracle.com/javase/tutorial/jndi/ldap/config.html[
3526LDAP connection management (Configuration),role=external,window=_blank]
Bruce Zucd04bbc2014-07-25 15:48:09 +08003527+
3528By default, false.
3529
3530[[ldap.connectTimeout]]ldap.connectTimeout::
3531+
Saša Živkov303701a2015-01-19 16:24:44 +01003532_(Optional)_ Timeout period for establishment of an LDAP connection.
Bruce Zucd04bbc2014-07-25 15:48:09 +08003533+
3534The value is in the usual time-unit format like "1 s", "100 ms",
3535etc...
3536+
3537By default there is no timeout and Gerrit will wait indefinitely.
3538
Saša Živkov5049f512015-01-19 17:04:43 +01003539[[ldap-connection-pooling]]
3540==== LDAP Connection Pooling
3541Once LDAP connection pooling is enabled by setting the link:#ldap.useConnectionPooling[
3542ldap.useConnectionPooling] configuration property to `true`, the connection pool
3543can be configured using JVM system properties as explained in the
3544link:http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-ldap.html#POOL[
Marian Harbach34253372019-12-10 18:01:31 +01003545Java SE Documentation,role=external,window=_blank].
Bruce Zucd04bbc2014-07-25 15:48:09 +08003546
Saša Živkov5049f512015-01-19 17:04:43 +01003547For standalone Gerrit (running with the embedded Jetty), JVM system properties
3548are specified in the link:#container[container section]:
Bruce Zucd04bbc2014-07-25 15:48:09 +08003549
Saša Živkov5049f512015-01-19 17:04:43 +01003550----
3551 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.maxsize=20
3552 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.prefsize=10
3553 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.timeout=300000
3554----
Bruce Zucd04bbc2014-07-25 15:48:09 +08003555
Saša Živkovca7a67e2015-12-01 14:25:10 +01003556[[lfs]]
3557=== Section lfs
3558
3559[[lfs.plugin]]lfs.plugin::
3560+
David Pursehouse2463c542016-08-02 16:04:58 +09003561The name of a plugin which serves the
3562link:https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md[
Marian Harbach34253372019-12-10 18:01:31 +01003563LFS protocol,role=external,window=_blank] on the `<project-name>/info/lfs/objects/batch` endpoint. When
David Pursehouse2463c542016-08-02 16:04:58 +09003564not configured Gerrit will respond with `501 Not Implemented` on LFS protocol
3565requests.
Saša Živkovca7a67e2015-12-01 14:25:10 +01003566+
3567By default unset.
3568
Gustaf Lundhaef90122015-04-27 16:48:19 +02003569[[log]]
3570=== Section log
3571
3572[[log.jsonLogging]]log.jsonLogging::
3573+
3574If set to true, enables error logging in JSON format (file name: "logs/error_log.json").
3575+
3576Defaults to false.
3577
3578[[log.textLogging]]log.textLogging::
3579+
3580If set to true, enables error logging in regular plain text format. Can only be disabled
3581if `jsonLogging` is enabled.
3582+
3583Defaults to true.
3584
David Pursehouse2281fef2017-11-21 21:27:17 +09003585[[log.compress]]log.compress::
3586+
3587If set to true, log files are compressed at server startup and then daily at 11pm
3588(in the server's local time zone).
3589+
3590Defaults to true.
3591
David Pursehouse633fff32017-11-21 22:08:12 +09003592[[log.rotate]]log.rotate::
3593+
3594If set to true, log files are rotated daily at midnight (GMT).
3595+
3596Defaults to true.
3597
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003598[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003599=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003600
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003601[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003602+
3603If set to true, files with the MIME type `<name>` will be sent as
3604direct downloads to the user's browser, rather than being wrapped up
3605inside of zipped archives. The type name may be a complete type
Jonathan Nieder5758f182015-03-30 11:28:55 -07003606name, e.g. `image/gif`, a generic media type, e.g. `+image/*+`,
3607or the wildcard `+*/*+` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003608+
3609By default, false for all MIME types.
3610
3611Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003612----
3613[mimetype "image/*"]
3614 safe = true
3615
3616[mimetype "application/pdf"]
3617 safe = true
3618
3619[mimetype "application/msword"]
3620 safe = true
3621
3622[mimetype "application/vnd.ms-excel"]
3623 safe = true
3624----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003625
Dave Borowitzbc314912017-03-21 14:23:35 -07003626[[note-db]]
3627=== Section noteDb
3628
Dave Borowitzada289c2018-12-18 13:24:14 -08003629NoteDb is the Git-based database storage backend for Gerrit. For more
3630information, including how to migrate data from an older Gerrit version, see the
3631link:note-db.html[documentation].
Dave Borowitzbc314912017-03-21 14:23:35 -07003632
Edwin Kempin5be9c312017-07-07 10:40:55 +02003633[[notedb.accounts.sequenceBatchSize]]notedb.accounts.sequenceBatchSize::
3634+
Edwin Kempin311d5702017-07-28 15:10:24 +02003635The next available account sequence number is stored as UTF-8 text in a
3636blob pointed to by the `refs/sequences/accounts` ref in the `All-Users`
Edwin Kempin5be9c312017-07-07 10:40:55 +02003637repository. Multiple processes share the same sequence by incrementing
3638the counter using normal git ref updates. To amortize the cost of these
3639ref updates, processes increment the counter by a larger number and
3640hand out numbers from that range in memory until they run out. This
3641configuration parameter controls the size of the account ID batch that
3642each process retrieves at once.
3643+
Edwin Kempin5be9c312017-07-07 10:40:55 +02003644By default, 1.
3645
Han-Wen Nienhuyse5ca19c2017-11-08 13:33:33 +01003646
Michael Ochmann69813262016-01-27 17:53:55 +01003647[[oauth]]
3648=== Section oauth
3649
3650OAuth integration is only enabled if `auth.type` is set to `OAUTH`. See
3651link:#auth.type[above] for a detailed description of the `auth.type` settings
3652and their implications.
3653
3654By default, contact information, like the full name and email address,
3655is retrieved from the selected OAuth provider when a user account is created,
3656or when a user requests to reload that information in the settings UI. If
3657that is not supported by the OAuth provider, users can be allowed to edit
3658their contact information manually.
3659
3660[[oauth.allowEditFullName]]oauth.allowEditFullName::
3661+
3662If true, the full name can be edited in the contact information.
3663+
3664Default is false.
3665
3666[[oauth.allowRegisterNewEmail]]oauth.allowRegisterNewEmail::
3667+
3668If true, additional email addresses can be registered in the contact
3669information.
3670+
3671Default is false.
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003672
Zac Livingston70a16102018-11-20 15:07:34 -07003673[[operator-alias]]
3674=== Section operator alias
3675
3676Operator aliasing allows global aliases to be defined for query operators.
3677Currently only change queries are supported. The alias name is the git
3678config key name, and the operator being aliased is the git config value.
3679
3680For example:
3681
3682----
3683[operator-alias "change"]
3684 oldage = age
3685 number = change
3686----
3687
3688This section is particularly useful to alias operator names which may be
3689long and clunky because they include a plugin name in them to a shorter
3690name without the plugin name.
3691
3692Aliases are resolved dynamically at invocation time to any currently
3693loaded versions of plugins. If the alias points to an operator provided
3694by a plugin which is not currently loaded, or the plugin does not define
3695the operator, then "unsupported operator" is returned to the user.
3696
3697Aliases will override existing operators. In the case of multiple aliases
3698with the same name, the last one defined will be used.
3699
3700When the target of an alias doesn't exist, the operator with the name
3701of the alias will be used (if present). This enables an admin to config
3702the system to override a core operator with an operator provided by a
3703plugin when present and otherwise fall back to the operator provided by
3704core.
3705
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003706[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003707=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003708
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003709Global settings controlling how Gerrit Code Review creates pack
3710streams for Git clients running clone, fetch, or pull. Most of these
3711variables are per-client request, and thus should be carefully set
3712given the expected concurrent request load and available CPU and
3713memory resources.
3714
3715[[pack.deltacompression]]pack.deltacompression::
3716+
3717If true, delta compression between objects is enabled. This may
3718result in a smaller overall transfer for the client, but requires
3719more server memory and CPU time.
3720+
3721False (off) by default, matching Gerrit Code Review 2.1.4.
3722
3723[[pack.threads]]pack.threads::
3724+
3725Maximum number of threads to use for delta compression (if enabled).
3726This is per-client request. If set to 0 then the number of CPUs is
3727auto-detected and one thread per CPU is used, per client request.
3728+
3729By default, 1.
3730
3731
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003732[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003733=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003734
3735[[plugins.checkFrequency]]plugins.checkFrequency::
3736+
3737How often plugins should be examined for new plugins to load, removed
3738plugins to be unloaded, or updated plugins to be reloaded. Values can
3739be specified using standard time unit abbreviations ('ms', 'sec',
3740'min', etc.).
3741+
3742If set to 0, automatic plugin reloading is disabled. Administrators
Christian Aistleitner8ce1a4e2015-06-05 01:54:15 +02003743may force reloading with link:cmd-plugin-reload.html[gerrit plugin reload].
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003744+
3745Default is 1 minute.
3746
Shawn Pearcefd033502014-02-14 16:42:35 -08003747[[plugins.allowRemoteAdmin]]plugins.allowRemoteAdmin::
3748+
3749Enable remote installation, enable and disable of plugins over HTTP
3750and SSH. If set to true Administrators can install new plugins
3751remotely, or disable existing plugins. Defaults to false.
3752
Saša Živkov350fc682019-05-13 14:13:51 +02003753[[plugins.mandatory]]plugins.mandatory::
3754+
3755List of mandatory plugins. If a plugin from this list does not load,
David Pursehousef06aefb2019-10-18 20:39:53 +09003756Gerrit will fail to start.
3757+
3758Disabling and restarting of a mandatory plugin is rejected, but reloading
3759of a mandatory plugin is still possible.
Saša Živkov350fc682019-05-13 14:13:51 +02003760
Dariusz Luksza98f23522015-03-11 11:41:41 +01003761[[plugins.jsLoadTimeout]]plugins.jsLoadTimeout::
3762+
3763Set the timeout value for loading JavaScript plugins in Gerrit UI.
3764Values can be specified using standard time unit abbreviations ('ms',
3765'sec', 'min', etc.).
3766+
3767Default is 5 seconds. Negative values will be converted to 0.
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003768
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003769[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003770=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003771
Dave Borowitzff243892015-08-31 15:35:28 -04003772This section is used to configure behavior of the 'receive-pack'
3773handler, which responds to 'git push' requests.
lincoln2be11602010-07-05 10:53:25 -03003774
Dave Borowitzff243892015-08-31 15:35:28 -04003775[[receive.allowGroup]]receive.allowGroup::
Dave Borowitz532342bf2015-06-18 20:28:22 -04003776+
Dave Borowitzff243892015-08-31 15:35:28 -04003777Name of the groups of users that are allowed to execute
3778'receive-pack' on the server. One or more groups can be set.
Dave Borowitz532342bf2015-06-18 20:28:22 -04003779+
Dave Borowitzff243892015-08-31 15:35:28 -04003780If no groups are added, any user will be allowed to execute
3781'receive-pack' on the server.
Dave Borowitz532342bf2015-06-18 20:28:22 -04003782
3783[[receive.certNonceSeed]]receive.certNonceSeed::
3784+
3785If set to a non-empty value and server-side signed push validation is
3786link:#receive.enableSignedPush[enabled], use this value as the seed to
3787the HMAC SHA-1 nonce generator. If unset, a 64-byte random seed will be
3788generated at server startup.
3789+
3790As this is used as the seed of a cryptographic algorithm, it is
3791recommended to be placed in link:#secure-config[`secure.config`].
3792+
3793Defaults to unset.
3794
3795[[receive.certNonceSlop]]receive.certNonceSlop::
3796+
3797When validating the nonce passed as part of the signed push protocol,
3798accept valid nonces up to this many seconds old. This allows
3799certificate verification to work over HTTP where there is a lag between
3800the HTTP response providing the nonce to sign and the next request
3801containing the signed nonce. This can be significant on large
3802repositories, since the lag also includes the time to count objects on
3803the client.
3804+
3805Default is 5 minutes.
3806
Dave Borowitzff243892015-08-31 15:35:28 -04003807[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
3808+
3809Number of threads to perform change creation or patch set updates
3810concurrently. Each thread uses its own database connection from
3811the database connection pool, and if all threads are busy then
3812main receive thread will also perform a change creation or patch
3813set update.
3814+
3815Defaults to 1, using only the main receive thread. This feature is for
3816databases with very high latency that can benefit from concurrent
3817operations when multiple changes are impacted at once.
3818
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08003819[[receive.checkMagicRefs]]receive.checkMagicRefs::
3820+
3821If true, Gerrit will verify the destination repository has
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01003822no references under the magic 'refs/for' branch namespace. Names under
3823these locations confuse clients when trying to upload code reviews so
3824Gerrit requires them to be empty.
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08003825+
3826If false Gerrit skips the sanity check and assumes administrators
3827have ensured the repository does not contain any magic references.
3828Setting to false to skip the check can decrease latency during push.
3829+
3830Default is true.
3831
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02003832[[receive.allowProjectOwnersToChangeParent]]receive.allowProjectOwnersToChangeParent::
3833+
3834If true, Gerrit will allow project owners to change the parent of a project.
3835+
3836By default only Gerrit administrators are allowed to change the parent
3837of a project. By allowing project owners to change parents, it may
3838allow the owner to circumvent certain enforced rules (like important
3839BLOCK rules).
3840+
3841Default is false.
Rikard Almgrene9221be2018-09-18 11:12:03 +02003842+
3843This value supports configuration reloads:
3844link:cmd-reload-config.html[reload-config]
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02003845
Gustaf Lundh9062fd62013-02-14 17:23:11 +01003846[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
3847+
3848If set to true, Gerrit will validate that all referenced objects that
3849are not included in the received pack are reachable by the user.
3850+
3851Carrying out this check on gits with many refs and commits can be a
3852very CPU-heavy operation. For non public Gerrit-servers this check may
3853be overkill.
3854+
3855Only disable this check if you trust the clients not to forge SHA1
3856references to access commits intended to be hidden from the user.
3857+
3858Default is true.
3859
Patrick Hiesel24653be2019-10-22 09:47:32 +02003860[[receive.enableInMemoryRefCache]]receive.enableInMemoryRefCache::
3861+
3862If true, Gerrit will cache all refs advertised during push in memory and
3863base later receive operations on that cache.
3864+
3865Turning this cache off is considered experimental.
3866+
3867This cache provides value when the ref database is slow and/or does not
3868offer an inverse lookup of object ID to ref name. When RefTable is used,
3869this cache can be turned off (experimental) to get speed improvements.
3870+
3871Default is true.
3872
Dave Borowitzff243892015-08-31 15:35:28 -04003873[[receive.enableSignedPush]]receive.enableSignedPush::
lincoln2be11602010-07-05 10:53:25 -03003874+
Dave Borowitzff243892015-08-31 15:35:28 -04003875If true, server-side signed push validation is enabled.
lincoln2be11602010-07-05 10:53:25 -03003876+
Dave Borowitzff243892015-08-31 15:35:28 -04003877When a client pushes with `git push --signed`, this ensures that the
3878push certificate is valid and signed with a valid public key stored in
David Pursehouse6117a472016-07-26 08:02:49 +00003879the `refs/meta/gpg-keys` branch of `All-Users`.
Dave Borowitzff243892015-08-31 15:35:28 -04003880+
3881Defaults to false.
3882
3883[[receive.maxBatchChanges]]receive.maxBatchChanges::
3884+
3885The maximum number of changes that Gerrit allows to be pushed
3886in a batch for review. When this number is exceeded Gerrit rejects
3887the push with an error message.
3888+
3889May be overridden for certain groups by specifying a limit in the
3890link:access-control.html#capability_batchChangesLimit['Batch Changes Limit']
3891global capability.
3892+
3893This setting can be used to prevent users from uploading large
3894number of changes for review by mistake.
3895+
3896Default is zero, no limit.
lincoln2be11602010-07-05 10:53:25 -03003897
Dave Borowitz78542192017-08-31 10:45:47 -04003898[[receive.maxBatchCommits]]receive.maxBatchCommits::
3899+
3900The maximum number of commits that Gerrit allows to be pushed in a batch
3901directly to a branch when link:user-upload.html#bypass_review[bypassing review].
3902This limit can be bypassed if a user link:user-upload.html#skip_validation[skips
3903validation].
3904+
3905Default is 10000.
3906
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003907[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
3908+
3909Maximum allowed Git object size that 'receive-pack' will accept.
3910If an object is larger than the given size the pack-parsing will abort
3911and the push operation will fail. If set to zero then there is no
3912limit.
3913+
David Pursehouse221d4f62012-06-08 17:38:08 +09003914Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003915from pushing objects which are too large to Gerrit.
3916+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07003917This setting can also be set in the `project.config`
David Pursehouse2e548682018-08-01 15:12:47 +02003918(link:config-project-config.html[receive.maxObjectSizeLimit]) in order
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07003919to further reduce the global setting. The project specific setting is
3920only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02003921+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003922Default is zero.
3923+
3924Common unit suffixes of 'k', 'm', or 'g' are supported.
3925
David Pursehouse3f9c7402018-09-05 18:43:03 +09003926[[receive.inheritProjectMaxObjectSizeLimit]]receive.inheritProjectMaxObjectSizeLimit::
3927+
3928Controls whether the project-level link:config-project-config.html[`receive.maxObjectSizeLimit`]
3929value is inherited from the parent project. When `true`, the value is
3930inherited, otherwise it is not inherited.
3931+
3932Default is false, the value is not inherited.
3933
Dave Borowitz1bb49492015-08-31 15:36:59 -04003934[[receive.maxTrustDepth]]receive.maxTrustDepth::
3935+
3936If signed push validation is link:#receive.enableSignedPush[enabled],
3937set to the maximum depth to search when checking if a key is
3938link:#receive.trustedKey[trusted].
3939+
3940Default is 0, meaning only explicitly trusted keys are allowed.
3941
Dave Borowitz234734a2012-03-01 14:22:29 -08003942[[receive.threadPoolSize]]receive.threadPoolSize::
3943+
3944Maximum size of the thread pool in which the change data in received packs is
3945processed.
3946+
3947Defaults to the number of available CPUs according to the Java runtime.
3948
Dave Borowitz1c401362012-03-02 17:39:17 -08003949[[receive.timeout]]receive.timeout::
3950+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07003951Overall timeout on the time taken to process the change data in
3952received packs. Only includes the time processing Gerrit changes
3953and updating references, not the time to index the pack. Values can
3954be specified using standard time unit abbreviations ('ms', 'sec',
3955'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08003956+
Dariusz Lukszade482b02015-11-09 18:25:04 +01003957Default is 4 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07003958is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08003959
Dave Borowitz1bb49492015-08-31 15:36:59 -04003960[[receive.trustedKey]]receive.trustedKey::
3961+
3962List of GPG key fingerprints that should be considered trust roots by
3963the server when signed push validation is
3964link:#receive.enableSignedPush[enabled]. A key is trusted by the server
3965if it is either in this list, or a path of trust signatures leads from
3966the key to a configured trust root. The maximum length of the path is
3967determined by link:#receive.maxTrustDepth[`receive.maxTrustDepth`].
3968+
3969Key fingerprints can be displayed with `gpg --list-keys
3970--with-fingerprint`.
3971+
3972Trust signatures can be added to a key using the `tsign` command to
3973link:https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html[
Marian Harbach34253372019-12-10 18:01:31 +01003974`gpg --edit-key`,role=external,window=_blank], after which the signed key should be re-uploaded.
Dave Borowitz1bb49492015-08-31 15:36:59 -04003975+
3976If no keys are specified, web-of-trust checks are disabled. This is the
3977default behavior.
3978
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003979[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003980=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003981
Hugo Josefson072b4702010-04-21 19:27:11 +02003982Repositories in this sense are the same as projects.
3983
Shawn O. Pearce897d9212011-06-16 16:59:59 -07003984In the following example configuration `Registered Users` is set
3985to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02003986
3987----
3988[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02003989 ownerGroup = Registered Users
3990----
3991
Hugo Arès7d2b9422014-11-25 15:33:42 -05003992The only matching patterns supported are exact match or wildcard matching which
3993can be specified by ending the name with a `*`. If a project matches more than one
3994repository configuration, then the configuration from the more precise match
3995will be used. In the following example, the default submit type for a project
3996named `project/plugins/a` would be `CHERRY_PICK`.
3997
3998----
3999[repository "project/*"]
4000 defaultSubmitType = MERGE_IF_NECESSARY
4001[repository "project/plugins/*"]
4002 defaultSubmitType = CHERRY_PICK
4003----
4004
Michael Ochmann8129ece2016-07-08 11:25:25 +02004005[NOTE]
4006All properties are used from the matching repository configuration. In
Hugo Arès7d2b9422014-11-25 15:33:42 -05004007the previous example, all properties will be used from `project/plugins/\*`
4008section and no properties will be inherited nor overridden from `project/*`.
Hugo Josefson072b4702010-04-21 19:27:11 +02004009
Hugo Arès218bb3b2015-04-22 15:05:14 -04004010[[repository.name.basePath]]repository.<name>.basePath::
4011+
4012Alternate to <<gerrit.basePath,gerrit.basePath>>. The repository will be created
4013and used from this location instead: ${alternateBasePath}/${projectName}.git.
4014+
4015If configuring the basePath for an existing project in gerrit, make sure to stop
4016gerrit, move the repository in the alternate basePath, configure basePath for
4017this repository and then start Gerrit.
4018+
4019Path must be absolute.
4020
Edwin Kempina79ea552013-11-19 11:24:37 +01004021[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
4022+
4023The default submit type for newly created projects. Supported values
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004024are `INHERIT`, `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02004025`REBASE_ALWAYS`, `MERGE_ALWAYS` and `CHERRY_PICK`.
4026+
Changcheng Xiao21885982019-01-15 18:16:51 +01004027For more details see link:config-project-config.html#submit-type[Submit Types].
Edwin Kempina79ea552013-11-19 11:24:37 +01004028+
Changcheng Xiao21885982019-01-15 18:16:51 +01004029Default is link:config-project-config.html#submit_type_inherit[`INHERIT`].
Dave Borowitzcad4d262018-01-22 10:02:22 -05004030+
Dave Borowitz03e51742018-01-09 07:57:01 -05004031This submit type is only applied at project creation time if a submit type is
4032omitted from the link:rest-api-projects.html#project-input[ProjectInput]. If the
Dave Borowitzcad4d262018-01-22 10:02:22 -05004033submit type is unset in the project config at runtime, for backwards
4034compatibility purposes, it defaults to
4035link:project-configuration.html#merge_if_necessary[`MERGE_IF_NECESSARY`] rather
4036than `INHERIT`.
Edwin Kempina79ea552013-11-19 11:24:37 +01004037
Hugo Josefson072b4702010-04-21 19:27:11 +02004038[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
4039+
4040A name of a group which exists in the database. Zero, one or many
4041groups are allowed. Each on its own line. Groups which don't exist
4042in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02004043
Edwin Kempin22687fa2018-01-22 11:55:07 +01004044[[retry]]
4045=== Section retry
4046
4047[[retry.maxWait]]retry.maxWait::
4048+
4049Maximum time to wait between attempts to retry an operations when one attempt
4050fails (e.g. on NoteDb updates due to contention, aka lock failure, on the
4051underlying ref storage). Operations are retried with exponential backoff, plus
4052some random jitter, until the interval reaches this limit. After that, retries
4053continue to occur after a fixed timeout (plus jitter), up to
4054link:#retry.timeout[`retry.timeout`].
4055+
4056Defaults to 5 seconds; unit suffixes are supported, and assumes milliseconds if
4057not specified.
4058
4059[[retry.timeout]]retry.timeout::
4060+
4061Total timeout for retrying operations when one attempt fails.
4062+
4063It is possible to overwrite this default timeout based on operation types by
4064setting link:#retry.operationType.timeout[`retry.<operationType>.timeout`].
4065+
4066Defaults to 20 seconds; unit suffixes are supported, and assumes milliseconds if
4067not specified.
4068
4069[[retry.operationType.timeout]]retry.<operationType>.timeout::
4070+
4071Total timeout for retrying operations of type `<operationType>` when one
4072attempt fails. `<operationType>` can be `ACCOUNT_UPDATE`, `CHANGE_UPDATE`,
4073`GROUP_UPDATE` and `INDEX_QUERY`.
4074+
4075Defaults to link:#retry.timeout[`retry.timeout`]; unit suffixes are supported,
4076and assumes milliseconds if not specified.
4077
Edwin Kempindd837ae2019-06-18 11:42:14 +02004078[[retry.retryWithTraceOnFailure]]retry.retryWithTraceOnFailure::
4079+
4080Whether Gerrit should automatically retry operations on failure with tracing
4081enabled. The automatically generated traces can help with debugging. Please
4082note that only some of the REST endpoints support automatic retry.
4083+
4084By default this is set to false.
4085
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004086[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004087=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004088
4089[[rules.enable]]rules.enable::
4090+
Matt Baker8ce12fc2013-11-26 21:43:12 -07004091If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004092project's refs/meta/config branch, if present. When set to false,
4093only the default internal rules will be used.
4094+
4095Default is true, to execute project specific rules.
4096
Shawn Pearceed001d72014-12-17 14:25:55 -08004097[[rules.reductionLimit]]rules.reductionLimit::
4098+
4099Maximum number of Prolog reductions that can be performed when
4100evaluating rules for a single change. Each function call made
4101in user rule code, internal Gerrit Prolog code, or the Prolog
4102interpreter counts against this limit.
4103+
4104Sites using very complex rules that need many reductions should
4105compile Prolog to Java bytecode with link:pgm-rulec.html[rulec].
4106This eliminates the dynamic Prolog interpreter from charging its
4107own reductions against the limit, enabling more logic to execute
4108within the same bounds.
4109+
4110A reductionLimit of 0 is nearly infinite, implemented by setting
4111the internal limit to 2^31-1.
4112+
4113Default is 100,000 reductions (about 14 ms on Intel Core i7 CPU).
4114
4115[[rules.compileReductionLimit]]rules.compileReductionLimit::
4116+
4117Maximum number of Prolog reductions that can be performed when
4118compiling source code to internal Prolog machine code.
4119+
4120Default is 10x reductionLimit (1,000,000).
4121
Shawn Pearcea2b98522015-11-21 09:47:32 -08004122[[rules.maxSourceBytes]]rules.maxSourceBytes::
4123+
4124Maximum input size (in bytes) of a Prolog rules.pl file. Larger
4125source files may need a larger rules.compileReductionLimit. Consider
4126using link:pgm-rulec.html[rulec] to precompile larger rule files.
4127+
4128A size of 0 bytes disables rules, same as rules.enable = false.
4129+
David Pursehouse0c1dadf2015-11-24 09:14:21 +00004130Common unit suffixes of 'k', 'm', or 'g' are supported.
4131+
Shawn Pearcea2b98522015-11-21 09:47:32 -08004132Default is 128 KiB.
4133
4134[[rules.maxPrologDatabaseSize]]rules.maxPrologDatabaseSize::
4135+
4136Number of predicate clauses allowed to be defined in the Prolog
4137database by project rules. Very complex rules may need more than the
4138default 256 limit, but cost more memory and may need more time to
4139evaluate. Consider using link:pgm-rulec.html[rulec] to precompile
4140larger rule files.
4141+
4142Default is 256.
4143
David Pursehouse511a35b2014-04-04 10:27:13 +09004144[[execution]]
4145=== Section execution
Bruce Zua7e34312014-04-01 17:35:41 +08004146
4147[[execution.defaultThreadPoolSize]]execution.defaultThreadPoolSize::
4148+
4149The default size of the background execution thread pool in
4150which miscellaneous tasks are handled.
4151+
Jacek Centkowskice5510d2019-11-13 16:27:25 -08004152Default and minimum is 2 so that a single, potentially longer executing
4153task (e.g. GC), is not blocking the entire execution.
Bruce Zua7e34312014-04-01 17:35:41 +08004154
Patrick Hiesel2ed39822018-04-16 12:04:02 +02004155[[execution.fanOutThreadPoolSize]]execution.fanOutThreadPoolSize::
4156+
4157Maximum size of thread pool to on which a serving thread can fan-out
4158work to parallelize it.
4159+
4160When set to 0, a direct executor will be used.
4161+
4162By default, 25 which means that formatting happens in the caller thread.
4163
Patrick Hiesel328b7612016-10-21 16:43:13 +02004164[[receiveemail]]
4165=== Section receiveemail
4166
4167[[receiveemail.protocol]]receiveemail.protocol::
4168+
4169Specifies the protocol used for receiving emails. Valid options are
4170'POP3', 'IMAP' and 'NONE'. Note that Gerrit will automatically switch between
4171POP3 and POP3s as well as IMAP and IMAPS depending on the specified
4172link:#receiveemail.encryption[encryption].
4173+
4174Defaults to 'NONE' which means that receiving emails is disabled.
4175
4176[[receiveemail.host]]receiveemail.host::
4177+
4178The hostname of the mailserver. Example: 'imap.gmail.com'.
4179+
4180Defaults to an empty string which means that receiving emails is disabled.
4181
4182[[receiveemail.port]]receiveemail.port::
4183+
David Pursehouse4b067752017-03-03 15:54:53 +09004184The port the email server exposes for receiving emails.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004185+
4186Defaults to the industry standard for a given protocol and encryption:
David Pursehouse34907442017-04-04 09:55:38 +09004187POP3: 110; POP3S: 995; IMAP: 143; IMAPS: 993.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004188
4189[[receiveemail.username]]receiveemail.username::
4190+
4191Username used for authenticating with the email server.
4192+
4193Defaults to an empty string.
4194
4195[[receiveemail.password]]receiveemail.password::
4196+
4197Password used for authenticating with the email server.
4198+
4199Defaults to an empty string.
4200
4201[[receiveemail.encryption]]receiveemail.encryption::
4202+
4203Encryption standard used for transport layer security between Gerrit and the
4204email server. Possible values include 'NONE', 'SSL' and 'TLS'.
4205+
4206Defaults to 'NONE'.
4207
4208[[receiveemail.fetchInterval]]receiveemail.fetchInterval::
4209+
4210Time between two consecutive fetches from the email server. Communication with
4211the email server is not kept alive. Examples: 60s, 10m, 1h.
4212+
4213Defaults to 60 seconds.
4214
4215[[receiveemail.enableImapIdle]]receiveemail.enableImapIdle::
4216+
4217If the IMAP protocol is used for retrieving emails, IMAPv4 IDLE can be used to
4218keep the connection with the email server alive and receive a push when a new
4219email is delivered to the inbox. In this case, Gerrit will process the email
4220immediately and will not have a fetch delay.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004221+
4222Defaults to false.
4223
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004224[[receiveemail.filter.mode]]receiveemail.filter.mode::
4225+
4226A black- and whitelist filter to filter incoming emails.
4227+
4228If `OFF`, emails are not filtered by the list filter.
4229+
4230If `WHITELIST`, only emails where a pattern from
4231<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4232matches 'From' will be processed.
4233+
4234If `BLACKLIST`, only emails where no pattern from
4235<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4236matches 'From' will be processed.
4237+
4238Defaults to `OFF`.
4239
4240[[receiveemail.filter.patterns]]receiveemail.filter.patterns::
4241+
4242A list of regular expressions to match the email sender against. This can also
4243be a list of addresses when regular expression characters are escaped.
4244
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004245[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004246=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004247
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004248[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07004249+
4250If false Gerrit will not send email messages, for any reason,
4251and all other properties of section sendemail are ignored.
4252+
4253By default, true, allowing notifications to be sent.
4254
Jonathan Niederdabd8c22016-09-20 14:10:11 -07004255[[sendemail.html]]sendemail.html::
4256+
4257If false, Gerrit will only send plain-text emails.
4258If true, Gerrit will send multi-part emails with an HTML and
4259plain text part.
4260+
4261By default, true, allowing HTML in the emails Gerrit sends.
4262
Bruce Zua7e34312014-04-01 17:35:41 +08004263[[sendemail.connectTimeout]]sendemail.connectTimeout::
4264+
4265The connection timeout of opening a socket connected to a
4266remote SMTP server.
4267+
4268Values can be specified using standard time unit abbreviations
4269('ms', 'sec', 'min', etc.).
4270If no unit is specified, milliseconds is assumed.
4271+
4272Default is 0. A timeout of zero is interpreted as an infinite
4273timeout. The connection will then block until established or
4274an error occurs.
4275
4276[[sendemail.threadPoolSize]]sendemail.threadPoolSize::
4277+
4278Maximum size of thread pool in which the review comments
4279notifications are sent out asynchronously.
4280+
4281By default, 1.
4282
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004283[[sendemail.from]]sendemail.from::
4284+
4285Designates what name and address Gerrit will place in the From
4286field of any generated email messages. The supported values are:
4287+
4288* `USER`
4289+
4290Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09004291Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004292classified as spam if the user's domain has SPF or DKIM enabled
4293and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
Zhen Chenae765aa2016-08-08 15:49:44 -07004294relay for that domain. You can specify
4295<<sendemail.allowedDomain,sendemail.allowedDomain>> to instruct Gerrit to only
4296send as USER if USER is from those domains.
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004297+
4298* `MIXED`
4299+
Edwin Kempincdb0e002011-09-08 14:23:30 +02004300Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004301`review@example.com` is the same as <<user.email,user.email>>.
4302See below for a description of how the replacement is handled.
4303+
4304* `SERVER`
4305+
4306Gerrit will set the From header to the same name and address
4307it records in any commits Gerrit creates. This is set by
4308<<user.name,user.name>> and <<user.email,user.email>>, or guessed
4309from the local operating system.
4310+
Edwin Kempinebfbbac2015-07-01 16:02:39 +02004311* `Code Review <review@example.com>`
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004312+
4313If set to a name and email address in brackets, Gerrit will use
4314this name and email address for any messages, overriding the name
4315that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02004316Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004317which is replaced by the Full Name of the current user.
4318
4319+
4320By default, MIXED.
4321
Zhen Chenae765aa2016-08-08 15:49:44 -07004322[[sendemail.allowedDomain]]sendemail.allowedDomain::
4323+
4324Only used when `sendemail.from` is set to `USER`.
4325List of allowed domains. If user's email matches one of the domains, emails will
4326be sent as USER, otherwise as MIXED mode. Wildcards may be specified by
Maxime Guerreiroebac2d42018-03-21 13:54:51 +01004327including `\*` to match any number of characters, for example `*.example.com`
Zhen Chenae765aa2016-08-08 15:49:44 -07004328matches any subdomain of `example.com`.
4329+
4330By default, `*`.
4331
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004332[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004333+
4334Hostname (or IP address) of a SMTP server that will relay
4335messages generated by Gerrit to end users.
4336+
4337By default, 127.0.0.1 (aka localhost).
4338
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004339[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004340+
4341Port number of the SMTP server in sendemail.smtpserver.
4342+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08004343By default, 25, or 465 if smtpEncryption is 'ssl'.
4344
4345[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
4346+
4347Specify the encryption to use, either 'ssl' or 'tls'.
4348+
4349By default, 'none', indicating no encryption is used.
4350
4351[[sendemail.sslVerify]]sendemail.sslVerify::
4352+
4353If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
4354will not verify the server certificate when it connects to send
4355an email message.
4356+
4357By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004358
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004359[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004360+
4361User name to authenticate with, if required for relay.
4362
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004363[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004364+
4365Password for the account named by sendemail.smtpUser.
4366
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004367[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004368+
4369If present, each value adds one entry to the whitelist of email
4370addresses that Gerrit can send email to. If set to a complete
4371email address, that one address is added to the white list.
4372If set to a domain name, any address at that domain can receive
4373email from Gerrit.
4374+
4375By default, unset, permitting delivery to any email address.
4376
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004377[[sendemail.includeDiff]]sendemail.includeDiff::
4378+
Bruce Zueb00ff32012-11-27 17:38:10 +08004379If true, new change emails and merged change emails from Gerrit
4380will include the complete unified diff of the change.
4381Variable maxmimumDiffSize places an upper limit on how large the
4382email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004383+
4384By default, false.
4385
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07004386[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
4387+
4388Largest size of unified diff output to include in an email. When
4389the diff exceeds this size the file paths will be listed instead.
4390Standard byte unit suffixes are supported.
4391+
4392By default, 256 KiB.
4393
Alex Blewitt9cca7402011-02-11 01:39:30 +00004394[[sendemail.importance]]sendemail.importance::
4395+
4396If present, emails sent from Gerrit will have the given level
4397of importance. Valid values include 'high' and 'low', which
4398email clients will render in different ways.
4399+
4400By default, unset, so no Importance header is generated.
4401
4402[[sendemail.expiryDays]]sendemail.expiryDays::
4403+
4404If present, emails sent from Gerrit will expire after the given
4405number of days. This will add the Expiry-Date header and
4406email clients may expire or expunge mails whose Expiry-Date
4407header is in the past. This should be a positive non-zero
4408number indicating how many days in the future the mails
4409should expire.
4410+
4411By default, unset, so no Expiry-Date header is generated.
4412
Patrick Hiesel31d60f02017-02-09 17:38:40 +01004413[[sendemail.replyToAddress]]sendemail.replyToAddress::
4414+
4415A custom Reply-To address should only be provided if Gerrit is set up to
4416receive emails and the inbound address differs from
4417<<sendemail.from,sendemail.from>>.
4418It will be set as Reply-To header on all types of outgoing email where
4419Gerrit can parse back a user's reply.
4420+
4421Defaults to an empty string which adds <<sendemail.from,sendemail.from>> as
4422Reply-To if inbound email is enabled and the review's author otherwise.
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004423
David Pursehouse917b7262017-04-21 18:18:52 +02004424[[sendemail.allowTLD]]sendemail.allowTLD::
4425+
4426List of custom TLDs to allow sending emails to in addition to those specified
Marian Harbach34253372019-12-10 18:01:31 +01004427in the link:http://data.iana.org/TLD/[IANA list,role=external,window=_blank].
David Pursehouse917b7262017-04-21 18:18:52 +02004428+
4429Defaults to an empty list, meaning no additional TLDs are allowed.
4430
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004431
4432[[sendemail.addInstanceNameInSubject]]sendemail.addInstanceNameInSubject::
4433+
4434When set to true, Gerrit will add its short name to the email subject, allowing recipients to quickly identify
4435what Gerrit instance the email came from.
4436+
4437The short name can be customized via the gerrit.instanceName option.
4438+
Luca Milanesiofdfca772018-04-04 23:42:32 +01004439Defaults to false.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004440
4441
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004442[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004443=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004444
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004445[[site.allowOriginRegex]]site.allowOriginRegex::
4446+
4447List of regular expressions matching origins that should be permitted
Shawn Pearce53ebad42017-06-10 11:14:20 -07004448to use the full Gerrit REST API. These should be trusted applications,
4449as the sites may be able to use the user's credentials. Applies to
4450all requests, including state changing methods (PUT, DELETE, POST).
4451+
4452Expressions should not require trailing slash. For example a valid
4453pattern might be `https://build-status[.]example[.]com`.
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004454+
4455By default, unset, denying all cross-origin requests.
4456
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004457[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
4458+
4459If true the server checks the site header, footer and CSS files for
4460updated versions. If false, a server restart is required to change
4461any of these resources. Default is true, allowing automatic reloads.
4462
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004463[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004464=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07004465
4466Variables in section ssh-alias permit the site administrator to alias
4467another command from Gerrit or a plugin into the `gerrit` command
4468namespace. To alias `replication start` to `gerrit replicate`:
4469
4470----
4471[ssh-alias]
4472 replicate = replication start
4473----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004474
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004475[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004476=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07004477
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02004478[[sshd.enableCompression]]sshd.enableCompression::
4479+
4480In the general case, we want to disable transparent compression, since
4481the majority of our data transfer is highly compressed Git pack files
4482and we cannot make them any smaller than they already are.
4483+
4484However, if there are CPU in abundance and the server is reachable
4485through slow networks, gits with huge amount of refs can benefit from
4486SSH-compression since git does not compress the ref announcement during
4487handshake.
4488+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02004489Compression can be especially useful when Gerrit replicas are being used
Matthias Sohnd8182ba2019-12-09 14:50:23 +01004490for the larger clones and fetches and the primary server mostly takes
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02004491small receive-packs.
4492+
4493By default, `false`.
4494
David Ostrovskye2921b62015-03-04 22:36:10 +01004495[[sshd.backend]]sshd.backend::
4496+
4497Starting from version 0.9.0 Apache SSHD project added support for NIO2
Orgad Shanehb7bb7352019-09-19 10:26:19 +03004498IoSession. To use the old MINA session the `backend` option must be set
4499to `MINA`.
David Ostrovskye2921b62015-03-04 22:36:10 +01004500+
Luca Milanesiofc1ed9c2016-03-01 18:28:36 +00004501By default, `NIO2`.
David Ostrovskye2921b62015-03-04 22:36:10 +01004502
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004503[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004504+
4505Specifies the local addresses the internal SSHD should listen
4506for connections on. The following forms may be used to specify
4507an address. In any form, `:'port'` may be omitted to use the
David Pursehousea3af2552016-08-02 14:04:44 +09004508default of `29418`.
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004509+
David Pursehousea3af2552016-08-02 14:04:44 +09004510* `'hostname':'port'` (for example `review.example.com:29418`)
4511* `'IPv4':'port'` (for example `10.0.0.1:29418`)
4512* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
4513* `+*:'port'+` (for example `+*:29418+`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004514
4515+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004516--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004517If multiple values are supplied, the daemon will listen on all
4518of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004519
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07004520To disable the internal SSHD, set listenAddress to `off`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004521
David Pursehousea3af2552016-08-02 14:04:44 +09004522By default, `*:29418`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004523--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004524
James Y Knight910bd862011-01-11 20:05:56 -05004525[[sshd.advertisedAddress]]sshd.advertisedAddress::
4526+
4527Specifies the addresses clients should be told to connect to.
4528This may differ from sshd.listenAddress if a firewall based port
4529redirector is being used, making Gerrit appear to answer on port
453022. The following forms may be used to specify an address. In any
4531form, `:'port'` may be omitted to use the default SSH port of 22.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004532
David Pursehousea3af2552016-08-02 14:04:44 +09004533* `'hostname':'port'` (for example `review.example.com:22`)
4534* `'IPv4':'port'` (for example `10.0.0.1:29418`)
4535* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
James Y Knight910bd862011-01-11 20:05:56 -05004536
4537+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004538--
James Y Knight910bd862011-01-11 20:05:56 -05004539If multiple values are supplied, the daemon will advertise all
4540of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004541
David Pursehousea3af2552016-08-02 14:04:44 +09004542By default uses the value of `sshd.listenAddress`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004543--
James Y Knight910bd862011-01-11 20:05:56 -05004544
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004545[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07004546+
4547If true, enables TCP keepalive messages to the other side, so
4548the daemon can terminate connections if the peer disappears.
4549+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02004550Only effective when `sshd.backend` is set to `MINA`.
4551+
David Pursehousea3af2552016-08-02 14:04:44 +09004552By default, `true`.
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07004553
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004554[[sshd.threads]]sshd.threads::
4555+
4556Number of threads to use when executing SSH command requests.
4557If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09004558are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004559+
Florian Klink2a389462019-07-23 14:14:32 +02004560By default, 2x the number of CPUs available to the JVM (but at least 4
4561threads).
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02004562+
4563[NOTE]
4564When SSH daemon is enabled then this setting also defines the max number of
4565concurrent Git requests for interactive users over SSH and HTTP together.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004566
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004567[[sshd.batchThreads]]sshd.batchThreads::
4568+
4569Number of threads to allocate for SSH command requests from
Fredrik Luthander46843022012-03-13 16:11:02 +01004570link:access-control.html#non-interactive_users[non-interactive users].
4571If equals to 0, then all non-interactive requests are executed in the same
4572queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004573+
4574Any other value will remove the number of threads from the queue
4575allocated to interactive users, and create a separate thread pool
4576of the requested size, which will be used to run commands from
4577non-interactive users.
4578+
4579If the number of threads requested for non-interactive users is larger
4580than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09004581value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004582+
Dariusz Luksza145de472015-11-09 18:44:35 +01004583By default is 1 on single core node, 2 otherwise.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02004584+
4585[NOTE]
4586When SSH daemon is enabled then this setting also defines the max number of
4587concurrent Git requests for batch users over SSH and HTTP together.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004588
Kenny Root15ac1b82010-02-24 00:29:20 -08004589[[sshd.streamThreads]]sshd.streamThreads::
4590+
4591Number of threads to use when formatting events to asynchronous
4592streaming clients. Event formatting is multiplexed onto this thread
4593pool by a simple FIFO scheduling system.
4594+
4595By default, 1 plus the number of CPUs available to the JVM.
4596
Edwin Kempinb5df3b82011-10-10 11:31:14 +02004597[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07004598+
4599Number of threads used to parse a command line submitted by a client
4600over SSH for execution, create the internal data structures used by
4601that command, and schedule it for execution on another thread.
4602+
4603By default, 2.
4604
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004605[[sshd.maxAuthTries]]sshd.maxAuthTries::
4606+
4607Maximum number of authentication attempts before the server
4608disconnects the client. Each public key that a client has loaded
4609into its local agent counts as one auth request. Users can work
4610around the server's limit by loading less keys into their agent,
4611or selecting a specific key in their `~/.ssh/config` file with
4612the `IdentityFile` option.
4613+
4614By default, 6.
4615
4616[[sshd.loginGraceTime]]sshd.loginGraceTime::
4617+
4618Time in seconds that a client has to authenticate before the server
4619automatically terminates their connection. Values should use common
4620unit suffixes to express their setting:
4621+
4622* s, sec, second, seconds
4623* m, min, minute, minutes
4624* h, hr, hour, hours
4625* d, day, days
4626
4627+
4628By default, 2 minutes.
4629
Christian Aistleitner3d794592013-04-08 00:19:40 +02004630[[sshd.idleTimeout]]sshd.idleTimeout::
4631+
4632Time in seconds after which the server automatically terminates idle
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00004633connections (or 0 to disable closing of idle connections) not waiting for
4634any server operation to complete.
4635Values should use common unit suffixes to express their setting:
Christian Aistleitner3d794592013-04-08 00:19:40 +02004636+
4637* s, sec, second, seconds
4638* m, min, minute, minutes
4639* h, hr, hour, hours
4640* d, day, days
4641
4642+
4643By default, 0.
4644
Paladox nonedaafdb62017-10-14 16:18:42 +00004645[[sshd.waitTimeout]]sshd.waitTimeout::
4646+
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00004647Time in seconds after which the server automatically terminates
4648connections waiting for a server operation to complete, like for instance
4649cloning a very large repo with lots of refs.
Paladox nonedaafdb62017-10-14 16:18:42 +00004650Values should use common unit suffixes to express their setting:
4651+
4652* s, sec, second, seconds
4653* m, min, minute, minutes
4654* h, hr, hour, hours
4655* d, day, days
4656
4657+
4658By default, 30s.
4659
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004660[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
4661+
4662Maximum number of concurrent SSH sessions that a user account
4663may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09004664that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004665the number of commands a user may issue over a single connection.
4666If set to 0, there is no limit.
4667+
4668By default, 64.
4669
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004670[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004671+
4672Available ciphers. To permit multiple ciphers, specify multiple
4673`sshd.cipher` keys in the configuration file, one cipher name
4674per key. Cipher names starting with `+` are enabled in addition
4675to the default ciphers, cipher names starting with `-` are removed
4676from the default cipher set.
4677+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004678Supported ciphers:
4679+
4680* `aes128-ctr`
4681* `aes192-ctr`
4682* `aes256-ctr`
4683* `aes128-cbc`
4684* `aes192-cbc`
4685* `aes256-cbc`
4686* `blowfish-cbc`
4687* `3des-cbc`
4688* `arcfour128`
4689* `arcfour256`
4690* `none`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004691+
4692By default, all supported ciphers except `none` are available.
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004693+
4694If your setup allows for it, it's recommended to disable all ciphers except
4695the AES-CTR modes.
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004696
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004697[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004698+
4699Available MAC (message authentication code) algorithms. To permit
4700multiple algorithms, specify multiple `sshd.mac` keys in the
4701configuration file, one MAC per key. MAC names starting with `+`
4702are enabled in addition to the default MACs, MAC names starting with
4703`-` are removed from the default MACs.
4704+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004705Supported MACs:
4706+
4707* `hmac-md5`
4708* `hmac-md5-96`
4709* `hmac-sha1`
4710* `hmac-sha1-96`
4711* `hmac-sha2-256`
4712* `hmac-sha2-512`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004713+
4714By default, all supported MACs are available.
4715
Scott Dialb4a04fa2016-03-15 09:44:11 -04004716[[sshd.kex]]sshd.kex::
4717+
4718--
4719Available key exchange algorithms. To permit multiple algorithms,
4720specify multiple `sshd.kex` keys in the configuration file, one key
4721exchange algorithm per key. Key exchange algorithm names starting
4722with `+` are enabled in addition to the default key exchange
4723algorithms, key exchange algorithm names starting with `-` are
4724removed from the default key exchange algorithms.
4725
4726In the following example configuration, support for the 1024-bit
4727`diffie-hellman-group1-sha1` key exchange is disabled while leaving
4728all of the other default algorithms enabled:
4729
4730----
4731[sshd]
4732 kex = -diffie-hellman-group1-sha1
4733----
4734
4735Supported key exchange algorithms:
4736
4737* `ecdh-sha2-nistp521`
4738* `ecdh-sha2-nistp384`
4739* `ecdh-sha2-nistp256`
4740* `diffie-hellman-group-exchange-sha256`
4741* `diffie-hellman-group-exchange-sha1`
4742* `diffie-hellman-group14-sha1`
4743* `diffie-hellman-group1-sha1`
4744
4745By default, all supported key exchange algorithms are available.
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004746
4747It is strongly recommended to disable at least `diffie-hellman-group1-sha1`
4748as it's known to be vulnerable (logjam attack). Additionally, if your setup
4749allows for it, it is recommended to disable the remaining two `sha1` key
4750exchange algorithms.
Scott Dialb4a04fa2016-03-15 09:44:11 -04004751--
4752
Alex Blewitt7efb06f2013-04-01 12:46:48 -04004753[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
4754+
4755Enable kerberos authentication for SSH connections. To permit
4756kerberos authentication, the server must have a host principal
4757(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
4758This must be provisioned by the kerberos administrators, and is
4759typically installed into `/etc/krb5.keytab` on host machines.
4760+
4761The keytab must contain at least one `host/` principal, typically
4762using the host's canonical name. If it does not use the
4763canonical name, the `sshd.kerberosPrincipal` should be configured
4764with the correct name.
4765+
4766By default, not set and so kerberos authentication is not enabled.
4767
4768[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
4769+
4770If kerberos authentication is enabled with `sshd.kerberosKeytab`,
4771instead use the given principal name instead of the default.
4772If the principal does not begin with `host/` a warning message is
4773printed and may prevent successful authentication.
4774+
4775This may be useful if the host is behind an IP load balancer or
4776other SSH forwarding systems, since the principal name is constructed
4777by the client and must match for kerberos authentication to work.
4778+
4779By default, `host/canonical.host.name`
4780
Shawn Pearce318bfca2013-10-17 22:15:38 -07004781[[sshd.requestLog]]sshd.requestLog::
4782+
4783Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
4784If enabled, a request log file is written out by the SSH daemon.
4785+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01004786`log4j.appender` with the name `sshd_log` can be configured to overwrite
4787programmatic configuration.
4788+
David Pursehousea3af2552016-08-02 14:04:44 +09004789By default, `true`.
Gustaf Lundh4e859932018-04-16 10:56:31 +02004790+
Sven Selberg2a0beab2018-04-20 14:49:20 +02004791This value supports link:#reloadConfig[configuration reloads].
Shawn Pearce318bfca2013-10-17 22:15:38 -07004792
David Ostrovsky985201b2015-03-04 22:37:33 +01004793[[sshd.rekeyBytesLimit]]sshd.rekeyBytesLimit::
4794+
4795The SSH daemon will issue a rekeying after a certain amount of data.
4796This configuration option allows you to tweak that setting.
4797+
4798By default, 1073741824 (bytes, 1GB).
4799+
David Pursehousea3af2552016-08-02 14:04:44 +09004800The `rekeyBytesLimit` cannot be set to lower than 32.
David Ostrovsky985201b2015-03-04 22:37:33 +01004801
4802[[sshd.rekeyTimeLimit]]sshd.rekeyTimeLimit::
4803+
4804The SSH daemon will issue a rekeying after a certain amount of time.
4805This configuration option allows you to tweak that setting.
4806+
4807By default, 1h.
4808+
4809Set to 0 to disable this check.
4810
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004811[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004812=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07004813
Sven Selberg42d9d292014-08-13 11:20:11 +02004814[[suggest.maxSuggestedReviewers]]suggest.maxSuggestedReviewers::
4815+
4816The maximum numbers of reviewers suggested.
4817+
4818By default 10.
Gustaf Lundh25e608f2018-04-16 10:54:53 +02004819+
Sven Selberg2a0beab2018-04-20 14:49:20 +02004820This value supports link:#reloadConfig[configuration reloads].
Sven Selberg42d9d292014-08-13 11:20:11 +02004821
Edwin Kempinf957dc22012-10-19 20:41:18 +02004822[[suggest.from]]suggest.from::
4823+
4824The number of characters that a user must have typed before suggestions
Patrick Hiesel87880b02016-05-03 18:15:08 +02004825are provided. If set to 0, suggestions are always provided. This is only
4826used for suggesting accounts when adding members to a group.
Edwin Kempinf957dc22012-10-19 20:41:18 +02004827+
4828By default 0.
Gal Paikin0d07c542020-01-08 17:11:53 +02004829[[suggest.relevantChanges]]suggest.relevantChanges::
4830+
4831When suggesting reviewers, we go over recent changes of the user, and
4832give priority to users that are present as reviewers in any of those
4833changes. The number of changes we go over is `sugggest.relevantChanges`.
4834+
Gal Paikincb5a7ca2020-02-18 09:44:28 +01004835This nubmer is a tradeoff between speed and accuracy.
Gal Paikin0d07c542020-01-08 17:11:53 +02004836A high number would be accurate but slow, and a low number would be
4837fast but inaccurate.
Gal Paikincb5a7ca2020-02-18 09:44:28 +01004838+
4839By default 50.
Edwin Kempinf957dc22012-10-19 20:41:18 +02004840
Edwin Kempin0a49eca2019-06-21 09:38:46 +02004841[[tracing]]
4842=== Section tracing
4843
4844[[tracing.performanceLogging]]tracing.performanceLogging::
4845+
4846Whether performance logging is enabled.
4847+
4848When performance logging is enabled, performance events for some
4849operations are collected in memory while a request is running. At the
4850end of the request the performance events are handed over to the
4851link:dev-plugins.html#performance-logger[PerformanceLogger] plugins.
4852This means if performance logging is enabled, the memory footprint of
4853requests is slightly increased.
4854+
4855This setting has no effect if no
4856link:dev-plugins.html#performance-logger[PerformanceLogger] plugins are
4857installed, because then performance logging is always disabled.
4858+
4859By default, true.
4860
Edwin Kempin2cba2982019-07-05 13:19:43 +02004861[[tracing.traceid]]
4862==== Subsection tracing.<trace-id>
4863
4864There can be multiple `tracing.<trace-id>` subsections to configure
4865automatic tracing of requests. To be traced a request must match all
4866conditions of one `tracing.<trace-id>` subsection. The subsection name
4867is used as trace ID. Using this trace ID administrators can find
4868matching log entries.
4869
4870[[tracing.traceid.requestType]]tracing.<trace-id>.requestType::
4871+
4872Type of request for which request tracing should be always enabled (can
4873be `GIT_RECEIVE`, `GIT_UPLOAD`, `REST` and `SSH`).
4874+
4875May be specified multiple times.
4876+
4877By default, unset (all request types are matched).
4878
Edwin Kempinb0ddb0b2019-07-08 12:11:32 +02004879[[tracing.traceid.requestUriPattern]]tracing.<trace-id>.requestUriPattern::
4880+
4881Regular expression to match request URIs for which request tracing
4882should be always enabled. Request URIs are only available for REST
4883requests. Request URIs never include the '/a' prefix.
4884+
4885May be specified multiple times.
4886+
4887By default, unset (all request URIs are matched).
4888
Edwin Kempin2cba2982019-07-05 13:19:43 +02004889[[tracing.traceid.account]]tracing.<trace-id>.account::
4890+
4891Account ID of an account for which request tracing should be always
4892enabled.
4893+
4894May be specified multiple times.
4895+
4896By default, unset (all accounts are matched).
4897
4898[[tracing.traceid.projectPattern]]tracing.<trace-id>.projectPattern::
4899+
4900Regular expression to match project names for which request tracing
4901should be always enabled.
4902+
4903May be specified multiple times.
4904+
4905By default, unset (all projects are matched).
4906
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004907[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004908=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07004909
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07004910Tagged footer lines containing references to external
4911tracking systems, parsed out of the commit message and
David Pursehoused55a6b62015-02-27 17:39:38 +09004912saved in Gerrit's secondary index.
Shawn Pearceff61c8a2013-10-07 19:35:53 -07004913
4914After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08004915must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07004916
Edwin Kempinbb421f12011-08-25 11:19:00 +02004917The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07004918bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07004919
4920----
4921[trackingid "jira-bug"]
4922 footer = Bugfix:
David Pursehousece7f6862015-02-19 14:52:45 +09004923 footer = Bug:
Goran Lungberg04132a12010-06-15 17:20:37 -07004924 match = JRA\\d{2,8}
4925 system = JIRA
4926
4927[trackingid "jira-feature"]
4928 footer = Feature
4929 match = JRA(\\d{2,8})
4930 system = JIRA
4931----
4932
4933[[trackingid.name.footer]]trackingid.<name>.footer::
4934+
David Pursehousece7f6862015-02-19 14:52:45 +09004935A prefix tag that identifies the footer line to parse for tracking ids.
4936+
4937Several trackingid entries can have the same footer tag, and a single trackingid
4938entry can have multiple footer tags.
4939+
4940If multiple footer tags are specified, each tag will be parsed separately and
4941duplicates will be ignored.
4942+
4943The trailing ":" is optional.
Goran Lungberg04132a12010-06-15 17:20:37 -07004944
4945[[trackingid.name.match]]trackingid.<name>.match::
4946+
Magnus Bäcke5611832011-02-02 08:57:15 +01004947A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +01004948Java regular expression (java.util.regex),role=external,window=_blank] used to match the
Magnus Bäcke5611832011-02-02 08:57:15 +01004949external tracking id part of the footer line. The match can
4950result in several entries in the DB. If grouping is used in the
4951regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01004952Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07004953+
4954The configuration file parser eats one level of backslashes, so the
4955character class `\s` requires `\\s` in the configuration file. The
4956parser also terminates the line at the first `#`, so a match
4957expression containing # must be wrapped in double quotes.
4958
4959[[trackingid.name.system]]trackingid.<name>.system::
4960+
David Pursehouse221d4f62012-06-08 17:38:08 +09004961The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07004962It is possible to have several trackingid entries for the same
4963tracking system.
4964
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004965[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004966=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07004967
4968[[transfer.timeout]]transfer.timeout::
4969+
4970Number of seconds to wait for a single network read or write
4971to complete before giving up and declaring the remote side is
4972not responding. If 0, there is no timeout, and this server will
4973wait indefinitely for a transfer to finish.
4974+
4975A timeout should be large enough to mostly transfer the objects to
4976the other side. 1 second may be too small for larger projects,
4977especially over a WAN link, while 10-30 seconds is a much more
4978reasonable timeout value.
4979+
4980Defaults to 0 seconds, wait indefinitely.
4981
lincoln2be11602010-07-05 10:53:25 -03004982
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004983[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004984=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004985
Dave Borowitzb1795142017-10-12 07:13:37 -07004986Options to control the behavior of `upload-pack` on the server side,
4987which handles a user's fetch, clone, or repo sync command.
lincoln2be11602010-07-05 10:53:25 -03004988
4989----
4990[upload]
4991 allowGroup = GROUP_ALLOWED_TO_EXECUTE
4992 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
4993----
4994
4995[[upload.allowGroup]]upload.allowGroup::
4996+
Dave Borowitzb1795142017-10-12 07:13:37 -07004997Name of the groups of users that are allowed to execute 'upload-pack'.
4998One or more groups can be set.
lincoln2be11602010-07-05 10:53:25 -03004999+
5000If no groups are added, any user will be allowed to execute
5001'upload-pack' on the server.
5002
Owen Lie2877bb2017-07-14 09:11:20 -04005003[[accountDeactivation]]
5004=== Section accountDeactivation
5005
5006Configures the parameters for the scheduled task to sweep and deactivate Gerrit
5007accounts according to their status reported by the auth backend. Currently only
5008supported for LDAP backends.
5009
5010[[accountDeactivation.startTime]]accountDeactivation.startTime::
5011+
Edwin Kempind33d95a2018-02-16 11:44:04 +01005012The link:#schedule-configuration-startTime[start time] for running
5013account deactivations.
Owen Lie2877bb2017-07-14 09:11:20 -04005014
5015[[accountDeactivation.interval]]accountDeactivation.interval::
5016+
Edwin Kempind33d95a2018-02-16 11:44:04 +01005017The link:#schedule-configuration-interval[interval] for running
5018account deactivations.
5019
5020link:#schedule-configuration-examples[Schedule examples] can be found
5021in the link:#schedule-configuration[Schedule Configuration] section.
Owen Lie2877bb2017-07-14 09:11:20 -04005022
Stefan Beller0f724ff2015-07-17 10:17:51 -07005023[[submodule]]
5024=== Section submodule
5025
Shawn Pearcedc477cd2016-03-24 19:56:18 -07005026[[submodule.verbosesuperprojectupdate]]submodule.verboseSuperprojectUpdate::
Stefan Beller0f724ff2015-07-17 10:17:51 -07005027+
5028When using link:user-submodules.html#automatic_update[automatic superproject updates]
Zhen Chenc877ca92016-07-27 14:22:37 -07005029this option will determine how the submodule commit messages are included into
Stefan Beller0f724ff2015-07-17 10:17:51 -07005030the commit message of the superproject update.
5031+
Zhen Chenc877ca92016-07-27 14:22:37 -07005032If `FALSE`, will not include any commit messages for the gitlink update.
5033+
5034If `SUBJECT_ONLY`, will include only the commit subjects.
5035+
5036If `TRUE`, will include full commit messages.
5037+
5038By default this is `TRUE`.
Stefan Beller0f724ff2015-07-17 10:17:51 -07005039
Shawn Pearcedc477cd2016-03-24 19:56:18 -07005040[[submodule.enableSuperProjectSubscriptions]]submodule.enableSuperProjectSubscriptions::
Stefan Beller8cc252e2016-03-10 10:06:53 -08005041+
5042This allows to enable the superproject subscription mechanism.
5043+
5044By default this is true.
Stefan Beller0f724ff2015-07-17 10:17:51 -07005045
Patrick Hiesel44e5d6e2017-08-24 16:07:26 +02005046[[submodule.maxCombinedCommitMessageSize]]submodule.maxCombinedCommitMessageSize::
5047+
5048This allows to limit the length of the commit message for a submodule.
5049+
5050By default this is 262144 (256 KiB).
5051+
5052Common unit suffixes of k, m, or g are supported.
5053
5054[[submodule.maxCommitMessages]]submodule.maxCommitMessages::
5055+
5056This allows to limit the number of commit messages that should be combined when creating
5057a commit message for a submodule.
5058+
5059By default this is 1000.
5060
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005061[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005062=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005063
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005064[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005065+
5066Name that Gerrit calls itself in Git when it creates a new Git
5067commit, such as a merge during change submission.
5068+
5069By default this is "Gerrit Code Review".
5070
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005071[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005072+
5073Email address that Gerrit refers to itself as when it creates a
5074new Git commit, such as a merge commit during change submission.
5075+
5076If not set, Gerrit generates this as "gerrit@`hostname`", where
5077`hostname` is the hostname of the system Gerrit is running on.
5078+
5079By default, not set, generating the value at startup.
5080
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005081[[user.anonymousCoward]]user.anonymousCoward::
5082+
David Pursehousea1d633b2014-05-02 17:21:02 +09005083Username that is displayed in the Gerrit Web UI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005084notifications if the full name of the user is not set.
5085+
Han-Wen Nienhuys3fb723d2017-11-20 19:21:13 +01005086By default "Name of user not set" is used.
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005087
Edwin Kempind33d95a2018-02-16 11:44:04 +01005088[[schedule-configuration]]
5089=== Schedule Configuration
5090
5091Schedule configurations are used for running periodic background jobs.
5092
5093A schedule configuration consists of two parameters:
5094
5095[[schedule-configuration-interval]]
5096* `interval`:
5097Interval for running the periodic background job. The interval must be
5098larger than zero. The following suffixes are supported to define the
5099time unit for the interval:
5100** `s`, `sec`, `second`, `seconds`
5101** `m`, `min`, `minute`, `minutes`
5102** `h`, `hr`, `hour`, `hours`
5103** `d`, `day`, `days`
5104** `w`, `week`, `weeks` (`1 week` is treated as `7 days`)
5105** `mon`, `month`, `months` (`1 month` is treated as `30 days`)
5106** `y`, `year`, `years` (`1 year` is treated as `365 days`)
5107
5108[[schedule-configuration-startTime]]
5109* `startTime`:
5110The start time defines the first execution of the periodic background
5111job. If the configured `interval` is shorter than `startTime - now` the
5112start time will be preponed by the maximum integral multiple of
5113`interval` so that the start time is still in the future. `startTime`
5114must have one of the following formats:
5115
5116** `<day of week> <hours>:<minutes>`
5117** `<hours>:<minutes>`
5118
5119+
5120The placeholders can have the following values:
5121
5122*** `<day of week>`:
5123`Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`
5124*** `<hours>`:
5125`00`-`23`
5126*** `<minutes>`:
5127`00`-`59`
5128
5129+
5130The time zone cannot be specified but is always the system default
David Pursehouse18f388a2019-04-10 09:36:18 +09005131time zone. Hours must be zero-padded, i.e. `06:00` rather than `6:00`.
Edwin Kempind33d95a2018-02-16 11:44:04 +01005132
5133The section (and optionally the subsection) in which the `interval` and
5134`startTime` keys must be set depends on the background job for which a
5135schedule should be configured. E.g. for the change cleanup job the keys
5136must be set in the link:#changeCleanup[changeCleanup] section:
5137
5138----
5139 [changeCleanup]
5140 startTime = Fri 10:30
5141 interval = 2 days
5142----
5143
5144[[schedule-configuration-examples]]
5145Examples for a schedule configuration:
5146
5147* Example 1:
5148+
5149----
5150 startTime = Fri 10:30
5151 interval = 2 days
5152----
5153+
5154Assuming that the server is started on `Mon 07:00` then
5155`startTime - now` is `4 days 3:30 hours`. This is larger than the
5156interval hence the start time is preponed by the maximum integral
5157multiple of the interval so that start time is still in the future,
5158i.e. preponed by 4 days. This yields a start time of `Mon 10:30`, next
5159executions are `Wed 10:30`, `Fri 10:30`. etc.
5160
5161* Example 2:
5162+
5163----
5164 startTime = 06:00
5165 interval = 1 day
5166----
5167+
5168Assuming that the server is started on `Mon 07:00` then this yields the
5169first run on Tuesday at 06:00 and a repetition interval of 1 day.
5170
Dave Borowitzd4fdc932018-11-02 15:06:25 -07005171[[All-Projects-project.config]]
5172== File `etc/All-Projects/project.config`
5173
5174The optional file `'$site_path'/etc/All-Projects/project.config` provides
5175defaults for configuration read from
5176link:config-project-config.html[`project.config`] in the
5177`All-Projects` repo. Unlike `gerrit.config`, this file contains project-type
5178configuration rather than server-type configuration.
5179
5180Most administrators will not need this file, and should instead make commits to
5181`All-Projects` to modify global config. However, a separate file can be useful
5182when managing multiple Gerrit servers, since pushing changes to defaults using
5183Puppet or a similar tool can be easier than scripting git updates to
5184`All-Projects`.
5185
5186The contents of the file are loaded each time the `All-Projects` project is
5187reloaded. Updating the file requires either evicting the project cache or
5188restarting the server.
5189
5190Caveats:
5191
5192* The path from which the file is read corresponds to the name of the repo,
5193 which is link:#gerrit.allProjects[configurable].
5194* Although the file lives in a directory that shares a name with a repository,
5195 this directory is not a Git repository.
5196* Only the file `project.config` is read from this directory to provide
5197 defaults; any other files in this directory, such as `rules.pl`, are ignored.
5198 (This behavior may change in the future.)
5199* Group names listed in the access config in this file are resolved to UUIDs
5200 using the `groups` file in the repository, not in the config directory. As a
5201 result, setting ACLs in this file is not recommended.
5202
Hector Oswaldo Caballero98952b02017-08-24 06:31:28 -04005203[[secure.config]]
5204== File `etc/secure.config`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005205
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005206The optional file `'$site_path'/etc/secure.config` overrides (or
5207supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005208The file should be readable only by the daemon process and can be
5209used to contain private configuration entries that wouldn't normally
5210be exposed to everyone.
5211
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005212Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005213----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07005214[auth]
5215 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
5216
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005217[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005218 username = webuser
5219 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005220
5221[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005222 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005223
5224[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005225 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005226
5227[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005228 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07005229
5230[remote "bar"]
5231 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005232----
5233
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005234== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01005235
5236The optional file `'$site_path'/etc/peer_keys` controls who can
5237login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
5238command.
5239
5240The format is one Base-64 encoded public key per line.
5241
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005242=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005243
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005244site_path::
5245+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005246Local filesystem directory holding the site customization assets.
5247Placing this directory under version control and/or backup is a
5248good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005249+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005250Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005251+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005252Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005253+
Dave Borowitz1e49e142013-04-09 12:14:57 -07005254* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005255
Saša Živkovd34dfe32017-11-20 11:14:35 +01005256[[jgitConfig]]
5257== File `etc/jgit.config`
5258
5259Gerrit uses the `$site_path/etc/jgit.config` file instead of the
5260system-wide and user-global Git configuration for its runtime JGit
5261configuration.
5262
5263Sample `etc/jgit.config` file:
5264----
5265[core]
5266 trustFolderStat = false
5267----
5268
Shawn O. Pearce5500e692009-05-28 15:55:01 -07005269GERRIT
5270------
5271Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07005272
5273SEARCHBOX
5274---------