blob: ffe5d0a8558a7924cc0fd141fbcffe5aafd3fa7d [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.
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -0700259Service users that are link:cmd-create-account.html[internal-only] are
260authenticated by their HTTP 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
Ben Rohlfsda0a62b2021-04-26 17:02:19 +0200507is used as an href in the Gerrit web app, so absolute URLs like
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700508`https://someotherhost/login` work as well.
509+
Ben Rohlfsda0a62b2021-04-26 17:02:19 +0200510If a ${path} parameter is included, then the Gerrit web app will substitute the
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700511currently 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`.
Luca Milanesio1a918712021-05-06 20:20:48 +0100607+
608When gitBasicAuthPolicy is set to `LDAP` or `HTTP_LDAP` and the user
609is authenticating with the LDAP username/password, the Git client config
610needs to have `http.cookieFile` set to a local file, otherwise every
611single call would trigger a full LDAP authentication and groups resolution
612which could introduce a noticeable latency on the overall execution
613and produce unwanted load to the LDAP server.
Nasser Grainawic3b05342022-02-25 16:58:13 -0700614
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200615[[auth.gitOAuthProvider]]auth.gitOAuthProvider::
616+
617Selects the OAuth 2 provider to authenticate git over HTTP traffic with.
618+
619In general there is no way to determine from an access token alone, which
620OAuth 2 provider to address to verify that token, and the BasicAuth
621scheme does not support amending such details. If multiple OAuth provider
622plugins in a system offer support for git over HTTP authentication site
623administrators must configure, which one to use as default provider.
624In case the provider cannot be determined from a request the access token
625will be sent to the default provider for verification.
626+
627The value of this parameter must be the identifier of an OAuth 2 provider
628in the form `plugin-name:provider-name`. Consult the respective plugin
629documentation for details.
630
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200631[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
632+
633If set the username that is received to authenticate a git operation
634is converted to lower case for looking up the user account in Gerrit.
635+
636By setting this parameter a case insensitive authentication for the
637git operations can be achieved, if it is ensured that the usernames in
638Gerrit (scheme `username`) are stored in lower case (e.g. if the
639parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
640set to `${sAMAccountName.toLowerCase}`). It is important that for all
641existing accounts this username is already in lower case. It is not
642possible to convert the usernames of the existing accounts to lower
643case because this would break the access to existing per-user
Thomas Draebing85510402021-03-15 08:03:00 +0100644branches and Gerrit provides no tool to do such a conversion. Accounts
645created using the REST API or the `create-account` SSH command will
646be created with all lowercase characters, when this option is set.
Edwin Kempine7ae45c2018-09-20 09:57:15 +0200647+
648Setting this parameter to `true` will prevent all users from login that
649have a non-lower-case username.
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200650+
651This parameter only affects git over http and git over SSH traffic.
652+
653By default this is set to false.
654
Thomas Draebing29595cd2021-03-24 15:23:35 +0100655[[auth.userNameCaseInsensitive]]auth.userNameCaseInsensitive::
656+
657If set the username will be handled case insensitively but case preserving,
658i.e. a user can login with `johndoe` or `JohnDoe` for the same account
659created for `JohnDoe`. The form of the username used during account creation
660will be used wherever the username is displayed. Sandbox branches created
661for a user can also only be created for this original form.
662+
663Note, that this does not work for all existing accounts, if they were
664not originally created with all lowercase, since the note keys of the
665external IDs will not match the new scheme. For more details refer to
666the link:config-accounts.html#external-ids[External ID documentation].
667+
Thomas Draebing585197a2021-03-31 09:50:52 +0200668Gerrit provides the
Marcin Czech62f989f2021-11-16 21:54:43 +0100669link:pgm-ChangeExternalIdCaseSensitivity.html[offline]
670and the online link:externalid-case-insensitivity.html#online-migration[online]
671tools to migrate existing accounts to match the new scheme.
Thomas Draebing585197a2021-03-31 09:50:52 +0200672+
Thomas Draebing29595cd2021-03-24 15:23:35 +0100673Naturally, if there were two accounts only different in capitalization,
674e.g. `johndoe` and `JohnDoe`, the account `JohnDoe` will not be able
Thomas Draebing585197a2021-03-31 09:50:52 +0200675to authenticate anymore after setting this option. If such duplicate
676accounts exist the migration tool will fail, since the newly computed
677note name would be identical and thus conflict. These duplicates thus
678have to be deleted manually by deleting the respective external ID.
Thomas Draebing29595cd2021-03-24 15:23:35 +0100679+
Thomas Draebing350d8e32021-11-19 13:16:53 +0100680For newly initialized sites this option defaults to true.
681+
Thomas Draebing29595cd2021-03-24 15:23:35 +0100682Default is false.
683
Marcin Czech540a7a32021-10-29 16:07:39 +0200684[[auth.userNameCaseInsensitiveMigrationMode]]auth.userNameCaseInsensitiveMigrationMode::
685+
686Setting migration mode to true allows to fallback to case sensitive
687behaviour if the migrated external ID cannot be found. This allows to
688trigger the migration while Gerrit process is running.
689+
David Pursehouse21bd07b2015-11-27 00:15:42 +0900690Default is false.
691
692[[auth.enableRunAs]]auth.enableRunAs::
693+
694If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
Owen Lic24f7242017-06-14 10:04:00 -0400695header from any users granted the link:access-control.html#capability_runAs[Run As]
696capability. The header and capability permit the authenticated user
697to impersonate another account.
698+
699If false the feature is disabled and cannot be re-enabled without
700editing gerrit.config and restarting the server.
701+
702Default is true.
703
704[[auth.allowRegisterNewEmail]]auth.allowRegisterNewEmail::
Owen Lie2877bb2017-07-14 09:11:20 -0400705+
706Whether users are allowed to register new email addresses.
707+
708In addition for the HTTP authentication type
709link:#auth.httpemailheader[auth.httpemailheader] must *not* be set to
Owen Lic24f7242017-06-14 10:04:00 -0400710enable registration of new email addresses.
711+
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200712By default, true.
713
Edwin Kempin3e856b22020-11-04 14:45:21 +0100714[[auth.autoUpdateAccountActiveStatus]]auth.autoUpdateAccountActiveStatus::
715+
716Whether to allow automatic synchronization of an account's inactive flag upon login.
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -0700717+
Shawn Pearcea931fe12013-06-11 12:29:17 -0700718If set to true, upon login, if the authentication back-end reports the account as active,
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -0700719the account's inactive flag in NoteDb will be updated to be active.
720+
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800721If the authentication back-end reports the account as inactive, the account's flag will be
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800722updated to be inactive and the login attempt will be blocked. Users enabling this feature
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700723should ensure that their authentication back-end is supported. Currently, only
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700724strict 'LDAP' authentication is supported.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700725+
726In addition, if this parameter is not set, or false, the corresponding scheduled
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700727task to deactivate inactive Gerrit accounts will also be disabled. If this
728parameter is set to true, users should also consider configuring the
729link:#accountDeactivation[accountDeactivation] section appropriately.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700730+
David Pursehousea61ee502016-09-06 16:27:09 +0900731By default, false.
Saša Živkove607d6c2016-02-24 10:46:46 +0000732
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200733[[auth.skipFullRefEvaluationIfAllRefsAreVisible]]auth.skipFullRefEvaluationIfAllRefsAreVisible::
734+
Edwin Kempin3e856b22020-11-04 14:45:21 +0100735Whether to skip the full ref visibility checks as a performance shortcut when a
736user has READ permission for all refs.
737+
738The full ref filtering would filter out refs for pending edits, private changes
739and auto merge commits.
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200740+
741By default, true.
742
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700743[[cache]]
744=== Section cache
745
Luca Milanesio82ea7302023-01-02 17:01:14 +0000746[[cache.threads]]cache.threads::
747+
748Number of threads to use when running asynchronous cache tasks.
749The threads executor is delegated to when sending removal notifications to listeners,
750when asynchronous computations like refresh, refreshAfterWrite are performed, or when
751performing periodic maintenance.
752+
753**NOTE**: Setting it to 0 disables the dedicated thread pool and indexing will be done in the
754same thread as the operation. This may result in evictions taking longer because the
755listeners are executed in the caller's thread.
756+
757By default, the JVM common ForkJoinPool is used.
758
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700759[[cache.directory]]cache.directory::
760+
761Path to a local directory where Gerrit can write cached entities for
762future lookup. This local disk cache is used to retain potentially
763expensive to compute information across restarts. If the location
764does not exist, Gerrit will try to create it.
765+
Saša Živkove607d6c2016-02-24 10:46:46 +0000766Technically, cached entities are persisted as a set of H2 databases
767inside this directory.
768+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700769If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700770+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700771Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700772
Thomas Draebinge5dcc602020-04-20 15:40:54 +0200773[[cache.enableDiskStatMetrics]]cache.enableDiskStatMetrics::
774+
775Whether to enable the computation of disk statistics of persistent caches.
776This computation is expensive and requires a long time on larger installations.
777+
778By default, false.
779
Saša Živkovf3134572016-02-09 11:42:46 +0100780[[cache.h2CacheSize]]cache.h2CacheSize::
781+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200782The size of the in-memory cache for each opened H2 cache database, in bytes.
Saša Živkove607d6c2016-02-24 10:46:46 +0000783+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200784Some caches of Gerrit are persistent and are backed by an H2 database.
Saša Živkove607d6c2016-02-24 10:46:46 +0000785H2 uses memory to cache its database content. The parameter `h2CacheSize`
786allows to limit the memory used by H2 and thus prevent out-of-memory
Saša Živkovf3134572016-02-09 11:42:46 +0100787caused by the H2 database using too much memory.
788+
Dave Borowitz3d1f85c2018-11-16 15:36:04 -0800789Technically the H2 cache size is configured using the CACHE_SIZE parameter in
790the H2 JDBC connection URL, as described
Marian Harbach34253372019-12-10 18:01:31 +0100791link:http://www.h2database.com/html/features.html#cache_settings[here,role=external,window=_blank]
Saša Živkovf3134572016-02-09 11:42:46 +0100792+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200793Default is unset, using up to half of the available memory.
David Pursehousee6976dc2017-06-30 16:33:44 +0900794+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200795H2 will persist this value in the database, so to unset explicitly specify 0.
Saša Živkovf3134572016-02-09 11:42:46 +0100796+
797Common unit suffixes of 'k', 'm', or 'g' are supported.
798
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200799[[cache.h2AutoServer]]cache.h2AutoServer::
800+
801If set to true, enable H2 autoserver mode for the H2-backed persistent cache
802databases.
803+
Marian Harbach34253372019-12-10 18:01:31 +0100804See link:http://www.h2database.com/html/features.html#auto_mixed_mode[here,role=external,window=_blank]
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200805for detail.
806+
807Default is false.
808
Antonio Barone09250812020-11-13 18:06:00 +0100809[[cache.openFiles]]cache.openFiles::
810+
811The number of file descriptors to add to the limit set by the Gerrit daemon.
812+
813Persistent caches are stored on the file system and as such participate in the
814file descriptors utilization. The number of file descriptors can vary depending
815on the cache configuration and the specific backend used.
816+
817The additional file descriptors required by the cache should be accounted for
818via this setting, so that the Gerrit daemon can adjust the ulimit accordingly.
819+
820If you increase this to a larger setting you may need to also adjust
821the ulimit on file descriptors for the host JVM, as Gerrit needs
822additional file descriptors available for network sockets and other
823repository data manipulation.
824+
825Default is 0.
826
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700827[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700828+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700829Maximum age to keep an entry in the cache. Entries are removed from
830the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700831Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700832+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700833* s, sec, second, seconds
834* m, min, minute, minutes
835* h, hr, hour, hours
836* d, day, days
837* w, week, weeks (`1 week` is treated as `7 days`)
838* mon, month, months (`1 month` is treated as `30 days`)
839* y, year, years (`1 year` is treated as `365 days`)
840
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700841+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200842--
Edwin Kempinabcd5042013-03-12 16:04:37 +0100843If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700844supplied, the maximum age is infinite and items are never purged
845except when the cache is full.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200846
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700847Default is `0`, meaning store forever with no expire, except:
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200848
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400849* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700850* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700851* `"web_sessions"`: default is `12 hours`
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200852--
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700853
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700854[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700855+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700856The total cost of entries to retain in memory. The cost computation
857varies by the cache. For most caches where the in-memory size of each
858entry is relatively the same, memoryLimit is currently defined to be
859the number of entries held by the cache (each entry costs 1).
860+
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +0200861For caches where the size of an entry can vary significantly between individual
862entries (notably `"git_modified_files"`, `"modified_files"`, `"git_file_diff"`,
863`"gerrit_file_diff"`, `"diff_intraline"`), memoryLimit is an approximation of
864the total number of bytes stored by the cache. Larger entries that represent
865bigger patch sets or longer source files will consume a bigger portion of the
866memoryLimit. For these caches the memoryLimit should be set to roughly the
867amount of RAM (in bytes) the administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700868+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700869Default is 1024 for most caches, except:
870+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400871* `"adv_bases"`: default is `4096`
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +0200872* `"git_modified_files"`: default is `10m` (10 MiB of memory)
873* `"modified_files"`: default is `10m` (10 MiB of memory)
874* `"git_file_diff"`: default is `10m` (10 MiB of memory)
875* `"gerrit_file_diff"`: default is `10m` (10 MiB of memory)
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700876* `"diff_intraline"`: default is `10m` (10 MiB of memory)
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200877* `"diff_summary"`: default is `10m` (10 MiB of memory)
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400878* `"external_ids_map"`: default is `2` and should not be changed
Edwin Kempind967ec42017-11-13 15:14:41 +0100879* `"groups"`: default is unlimited
880* `"groups_byname"`: default is unlimited
881* `"groups_byuuid"`: default is unlimited
Gal Paikinf74ee382021-03-22 16:00:25 +0100882* `"groups_byuuid_persisted"`: default is `1g` (1 GiB of disk space)
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700883* `"plugin_resources"`: default is 2m (2 MiB of memory)
884
885+
Luca Milanesio3bce5682022-11-03 19:41:01 +0000886If set to 0 the cache is disabled; entries are loaded but not stored
887in-memory.
888+
889**NOTE**: When the cache is disabled, there is no locking when accessing
890the same key/value, and therefore multiple threads may
891load the same value concurrently with a higher memory footprint.
892To keep a minimum caching and avoid concurrent loading of the same
893key/value, set `memoryLimit` to `1` and `maxAge` to `1`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700894
Dave Borowitz08bac5ca2018-06-05 14:58:28 -0400895[[cache.name.expireFromMemoryAfterAccess]]cache.<name>.expireFromMemoryAfterAccess::
896+
897Time after last access to automatically expire entries from an in-memory
898cache. If 0 or not specified, entries are never expired in this manner.
899Values may use unit suffixes as in link:#cache.name.maxAge[maxAge].
900+
901This option only applies to in-memory caches; persistent cache values are
902not expired in this manner, and are only pruned via
903link:#cache.name.diskLimit[diskLimit].
904
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700905[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700906+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700907Total size in bytes of the keys and values stored on disk. Caches that
908have grown bigger than this size are scanned daily at 1 AM local
909server time to trim the cache. Entries are removed in least recently
910accessed order until the cache fits within this limit. Caches may
911grow larger than this during the day, as the size check is only
912performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700913+
Saša Živkove789f2e2016-09-22 10:37:34 +0200914Default is 128 MiB per cache, except:
915+
Dave Borowitzbab45862018-05-01 12:31:48 -0400916* `"change_notes"`: disk storage is disabled by default
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200917* `"diff_summary"`: default is `1g` (1 GiB of disk space)
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700918* `"external_ids_map"`: disk storage is disabled by default
Patrick Hieselc2c108c2020-07-23 09:54:22 +0200919* `"persisted_projects"`: default is `1g` (1 GiB of disk space)
Saša Živkove789f2e2016-09-22 10:37:34 +0200920
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700921+
Dave Borowitzdab51552018-05-14 16:35:37 -0700922If 0 or negative, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700923
Patrick Hieseld70f37f2020-04-16 14:12:31 +0200924[[cache.name.expireAfterWrite]]cache.<name>.expireAfterWrite::
925+
926Duration after which a cached value will be evicted and not
927read anymore.
928+
929Values should use common unit suffixes to express their setting:
930+
931* ms, milliseconds
932* s, sec, second, seconds
933* m, min, minute, minutes
934* h, hr, hour, hours
935+
936Disabled by default.
937
938[[cache.name.refreshAfterWrite]]cache.<name>.refreshAfterWrite::
939+
940Duration after which we asynchronously refresh the cached value.
941+
942Values should use common unit suffixes to express their setting:
943+
944* ms, milliseconds
945* s, sec, second, seconds
946* m, min, minute, minutes
947* h, hr, hour, hours
948+
949This applies only to these caches that support refreshing:
950+
951* `"projects"`: Caching project information in-memory. Defaults to 15 minutes.
952
953[[cache.refreshThreadPoolSize]]cache.refreshThreadPoolSize::
954+
955Number of threads that are available to refresh cached values that became
956out of date. This applies only to these caches that support refreshing:
957+
958* `"projects"`: Caching project information in-memory
959+
960Refreshes will only be scheduled on this executor if the values are
961out of sync.
962The check if they are is cheap and always happens on the thread that
963inquires for a cached value.
964+
965Defaults to 2.
966
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800967==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700968
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700969cache `"accounts"`::
970+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700971Cache entries contain important details of an active user, including
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +0200972their display name, preferences, and known email addresses. Entry
Dave Borowitzada289c2018-12-18 13:24:14 -0800973information is obtained from NoteDb data in the `All-Users` repo.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700974
975+
Dave Borowitzada289c2018-12-18 13:24:14 -0800976If direct updates are made to `All-Users`, this cache should be flushed.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700977
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400978cache `"adv_bases"`::
979+
980Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900981are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400982for the client to use as potential delta bases. Push over smart HTTP
983requires two HTTP requests, and this cache tries to carry state from
984the first request into the second to ensure it can complete.
985
Patrick Hiesel7575e882020-04-06 14:09:32 +0200986cache `"default_preferences"`::
987+
988Caches the server's default general, edit and diff preferences.
989+
990Default value is 1 to hold only the most current version in-memory.
991
Patrick Hieselace3dc92019-01-15 14:08:13 +0000992cache `"changes"`::
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200993+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200994The size of `memoryLimit` determines the number of projects for which
995all changes will be cached. If the cache is set to 1024, this means all
Patrick Hieselace3dc92019-01-15 14:08:13 +0000996changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800997+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000998Default value is 0 (disabled). It is disabled by default due to the fact
999that change updates are not communicated between Gerrit servers. Hence
Matthias Sohnd8182ba2019-12-09 14:50:23 +01001000this cache should be disabled in a cluster setup using multiple primary
1001or multiple replica nodes.
Gustaf Lundh53493772012-11-18 18:41:15 -08001002+
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -07001003The cache should be flushed whenever NoteDb change metadata in a repository is
1004modified outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +02001005
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001006cache `"git_modified_files"`::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001007+
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001008Each item caches the list of git modified files between two git trees
1009corresponding to two different commits. This cache does not read the actual
1010file contents nor does it include the edits (modified regions) of the files.
1011
1012cache `"modified_files"`::
1013+
1014Each item caches the list of modified files between two commits. This cache
1015is similar to the `git_modified_files` cache but performs extra logic including
1016filtering out files that are untouched by both commits because they were purely
1017modified between the parent commits.
1018
1019cache `"git_file_diff"`::
1020+
1021Each item caches the pure git diff between two git trees for a specific file
1022path. The diff includes all the file attributes (old/new paths, change/patch
1023types) as well as the list of edits corresponding to the modified regions in
1024the file.
1025
1026cache `"gerrit_file_diff"`::
1027+
1028Each item caches the diff between two git commits for a specific file path.
1029This cache is similar to the `git_file_diff` cache but performs extra logic
1030including identifying the edits that are due to rebase. The diff for the
1031"commit message" and "merge list" can also be requested from this cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001032+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001033Entries in this cache are relatively large, so memoryLimit is an
1034estimate in bytes of memory used. Administrators should try to target
1035cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001036day span. The same applies for other diff caches: `"git_modified_files"`,
1037`"modified_files"` and `"git_file_diff"`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001038
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -04001039cache `"diff_intraline"`::
1040+
1041Each item caches the intraline difference of one file, when compared
1042between two commits. Gerrit uses this cache to accelerate display of
1043intraline differences when viewing a file.
1044+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001045Entries in this cache are relatively large, so memoryLimit is an
1046estimate in bytes of memory used. Administrators should try to target
1047cache.diff.memoryLimit to fit all files users will view in a 1 or 2
1048day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -04001049
Dave Borowitz7388e9e2016-09-23 13:20:29 +02001050cache `"diff_summary"`::
Saša Živkove789f2e2016-09-22 10:37:34 +02001051+
1052Each item caches list of file paths which are different between two
1053commits. Gerrit uses this cache to accelerate computing of the list
1054of paths of changed files.
1055+
1056Ideally, disk limit of this cache is large enough to cover all changes.
1057This should significantly speed up change reindexing, especially
1058full offline reindexing.
1059
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -04001060cache `"external_ids_map"`::
1061+
1062A singleton cache whose sole entry is a map of the parsed representation
Dave Borowitz70dfbd62018-06-05 13:30:48 -04001063of link:config-accounts.html#external-ids[all current external IDs]. The
1064cache may temporarily contain 2 entries, but the second one is promptly
1065expired.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -04001066+
Dave Borowitzb20d23a82018-08-21 13:43:10 -07001067It is not recommended to change the in-memory attributes of this cache
1068away from the defaults. The cache may be persisted by setting
1069`diskLimit`, which is only recommended if cold start performance is
1070problematic.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -04001071
Shawn O. Pearce2d65d292011-06-24 08:12:02 -07001072cache `"git_tags"`::
1073+
1074If branch or reference level READ access controls are used, this
1075cache tracks which tags are reachable from the branch tips of a
1076repository. Gerrit uses this information to determine the set
1077of tags that a client may access, derived from which tags are
1078part of the history of a visible branch.
1079+
1080The cache is persisted to disk across server restarts as it can
1081be expensive to compute (60 or more seconds for a large history
1082like the Linux kernel repository).
1083
Youssef Elghareeb3d549302020-07-15 17:08:28 +02001084cache `"comment_context"`::
1085+
1086Caches the context lines of comments, which are the lines of the source file
1087highlighted by the user when the comment was written.
1088
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001089cache `"groups"`::
1090+
Edwin Kempin3091e112017-11-13 15:23:58 +01001091Caches the basic group information of internal groups by group ID,
1092including the group owner, name, and description.
1093+
Edwin Kempind967ec42017-11-13 15:14:41 +01001094For this cache it is important to configure a size that is larger than
1095the number of internal Gerrit groups, otherwise general Gerrit
1096performance may be poor. This is why by default this cache is
1097unlimited.
1098+
Edwin Kempin3091e112017-11-13 15:23:58 +01001099External group membership obtained from LDAP is cached under
1100`"ldap_groups"`.
1101
1102cache `"groups_byname"`::
1103+
1104Caches the basic group information of internal groups by group name,
1105including the group owner, name, and description.
1106+
Edwin Kempind967ec42017-11-13 15:14:41 +01001107For this cache it is important to configure a size that is larger than
1108the number of internal Gerrit groups, otherwise general Gerrit
1109performance may be poor. This is why by default this cache is
1110unlimited.
1111+
Edwin Kempin3091e112017-11-13 15:23:58 +01001112External group membership obtained from LDAP is cached under
1113`"ldap_groups"`.
1114
1115cache `"groups_byuuid"`::
1116+
1117Caches the basic group information of internal groups by group UUID,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001118including the group owner, name, and description.
1119+
Edwin Kempind967ec42017-11-13 15:14:41 +01001120For this cache it is important to configure a size that is larger than
1121the number of internal Gerrit groups, otherwise general Gerrit
1122performance may be poor. This is why by default this cache is
1123unlimited.
1124+
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +02001125External group membership obtained from LDAP is cached under
1126`"ldap_groups"`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001127
Gal Paikinf74ee382021-03-22 16:00:25 +01001128cache `"groups_byuuid_persisted"`::
1129+
1130Caches the basic group information of internal groups by group UUID,
1131including the group owner, name, and description.
1132+
1133This is the persisted version of `groups_byuuid` cache. The intention of this
1134cache is to have an in-memory size of 0.
1135+
1136External group membership obtained from LDAP is cached under
1137`"ldap_groups"`.
1138
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +02001139cache `"groups_bymember"`::
Matt Fischer620255a2011-03-22 14:28:23 -05001140+
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +02001141Caches the groups which contain a specific member (account). If direct
1142updates are made to the `account_group_members` table, this cache should
1143be flushed.
1144
Alice Kober-Sotzek3e1fe1b2017-10-12 14:44:17 +02001145cache `"groups_bysubgroups"`::
1146+
1147Caches the parent groups of a subgroup. If direct updates are made
Matt Fischer620255a2011-03-22 14:28:23 -05001148to the `account_group_includes` table, this cache should be flushed.
1149
Youssef Elghareebf08d4b32020-03-26 18:02:15 +01001150cache `"groups_external"`::
1151+
1152Caches all the external groups available to Gerrit. The cache holds a
1153single entry which maps to the latest available of all external groups'
1154UUIDs. This cache uses "groups_external_persisted" to load its value.
1155
1156cache `"groups_external_persisted"`::
1157+
1158Caches all external groups available to Gerrit at some point in history.
1159The cache key is representation of a specific groups state in NoteDb and
1160the value is the list of all external groups.
1161The cache is persisted to enhance performance.
1162
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001163cache `"ldap_groups"`::
1164+
1165Caches the LDAP groups that a user belongs to, if LDAP has been
1166configured on this server. This cache should be configured with a
1167low maxAge setting, to ensure LDAP modifications are picked up in
1168a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001169
Gustaf Lundh0919a492012-10-19 15:29:23 +02001170cache `"ldap_groups_byinclude"`::
1171+
1172Caches the hierarchical structure of LDAP groups.
1173
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -07001174cache `"ldap_usernames"`::
1175+
1176Caches a mapping of LDAP username to Gerrit account identity. The
1177cache automatically updates when a user first creates their account
1178within Gerrit, so the cache expire time is largely irrelevant.
1179
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -07001180cache `"permission_sort"`::
1181+
David Pursehouse221d4f62012-06-08 17:38:08 +09001182Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -07001183reference. Sorting the sections can be expensive when regular
1184expressions are used, so this cache remembers the ordering for
1185each branch.
1186
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001187cache `"plugin_resources"`::
1188+
1189Caches formatted plugin resources, such as plugin documentation that
1190has been converted from Markdown to HTML. The memoryLimit refers to
1191the bytes of memory dedicated to storing the documentation.
1192
Patrick Hieselc2c108c2020-07-23 09:54:22 +02001193cache `"persisted_projects"`::
1194+
1195Caches the project description records, from the `refs/meta/config`
1196branch of each project. This is the persisted variant of the
1197`projects` cache. The intention is for this cache to have an in-memory
1198size of 0.
1199
Luca Milanesioe1e392f2023-07-19 21:52:59 +01001200NOTE: This cache should be disabled or set with a low refreshAfterWrite
1201in a cluster setup using multiple primary or multiple replica nodes.
1202
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001203cache `"projects"`::
1204+
Patrick Hieselc2c108c2020-07-23 09:54:22 +02001205Caches the project description records, from the `refs/meta/config`
1206branch of each project. If a project record is updated or deleted, this
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001207cache should be flushed. Newly inserted projects do not require
1208a cache flush, as they will be read upon first reference.
1209
Luca Milanesioe1e392f2023-07-19 21:52:59 +01001210NOTE: This cache should be disabled or set with a low refreshAfterWrite
1211in a cluster setup using multiple primary or multiple replica nodes.
1212
Dave Borowitz08aa8bb2018-04-05 12:01:06 -04001213cache `"prolog_rules"`::
1214+
1215Caches parsed `rules.pl` contents for each project. This cache uses the same
Prudhvi Akhil Alahari69bc0162022-10-05 23:05:13 +05301216size as the `projects` cache when `cache.prolog_rules.memoryLimit` is not set.
Dave Borowitz08aa8bb2018-04-05 12:01:06 -04001217
Patrick Hiesela57c0d62019-02-19 09:09:22 +01001218cache `"pure_revert"`::
1219+
1220Result of checking if one change or commit is a pure/clean revert of
1221another.
1222
Dmitrii Filippov4fe3b6e2021-10-19 10:21:09 +02001223cache `"soy_sauce_compiled_templates"`::
1224+
1225Caches compiled soy templates. Stores at most only one key-value pair with
1226a constant key value and the value is a compiled SoySauce templates. The value
1227is reloaded automatically every few seconds if there are reads from the cache.
1228If cache is not used for 1 minute, the item is removed (i.e. emails can be send
1229with templates which are max 1 minute old).
1230
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001231cache `"sshkeys"`::
1232+
1233Caches unpacked versions of user SSH keys, so the internal SSH daemon
1234can match against them during authentication. The unit of storage
1235is per-user, so 1024 items translates to 1024 unique user accounts.
1236As each individual user account may configure multiple SSH keys,
1237the total number of keys may be larger than the item count.
1238
Luca Milanesioe1e392f2023-07-19 21:52:59 +01001239NOTE: This cache should be disabled or set with a low refreshAfterWrite
1240in a cluster setup using multiple primary or multiple replica nodes.
1241
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001242cache `"web_sessions"`::
1243+
1244Tracks the live user sessions coming in over HTTP. Flushing this
1245cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -07001246them to sign-in again. To avoid breaking active users, this cache
1247is not flushed automatically by `gerrit flush-caches --all`, but
1248instead must be explicitly requested.
1249+
1250If no disk cache is configured (or `cache.web_sessions.diskLimit`
1251is set to 0) a server restart will force all users to sign-out,
1252and need to sign-in again after the restart, as the cache was
1253unable to persist the session information. Enabling a disk cache
1254is strongly recommended.
1255+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001256Session storage is relatively inexpensive. The average entry in
1257this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001258
Shawn O. Pearce4016a932009-05-28 15:12:40 -07001259See also link:cmd-flush-caches.html[gerrit flush-caches].
1260
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001261==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001262
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001263[[cache.git_file_diff.timeout]]cache.git_file_diff.timeout::
Hugo Arès2bc86812015-03-09 15:20:28 -04001264+
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001265Maximum number of milliseconds to wait for git diff data before giving up and
Hugo Arès2bc86812015-03-09 15:20:28 -04001266falling back on a simpler diff algorithm that will not be able to break down
1267modified regions into smaller ones. This is a work around for an infinite loop
1268bug in the default difference algorithm implementation.
1269+
1270Values should use common unit suffixes to express their setting:
1271+
1272* ms, milliseconds
1273* s, sec, second, seconds
1274* m, min, minute, minutes
1275* h, hr, hour, hours
1276
1277+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001278--
Hugo Arès2bc86812015-03-09 15:20:28 -04001279If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001280
Hugo Arès2bc86812015-03-09 15:20:28 -04001281Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001282--
Hugo Arès2bc86812015-03-09 15:20:28 -04001283
Edwin Kempin42d27432013-11-24 17:06:24 +01001284[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001285+
1286Maximum number of milliseconds to wait for intraline difference data
1287before giving up and disabling it for a particular file pair. This is
1288a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +09001289implementation.
1290+
1291If computation takes longer than the timeout, the worker thread is
1292terminated, an error message is shown, and no intraline difference is
1293displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001294+
1295Values should use common unit suffixes to express their setting:
1296+
1297* ms, milliseconds
1298* s, sec, second, seconds
1299* m, min, minute, minutes
1300* h, hr, hour, hours
1301
1302+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001303--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001304If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001305
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001306Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001307--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001308
Edwin Kempin42d27432013-11-24 17:06:24 +01001309[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001310+
1311Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001312when populating a diff cache entry. This flag is provided primarily
1313as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +09001314necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001315this setting will fallback to `cache.diff.intraline` if not set in the
1316configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001317+
1318Default is true, enabled.
1319
Simon Leifc19ff12014-10-02 13:36:00 -04001320[[cache.projects.loadOnStartup]]cache.projects.loadOnStartup::
1321+
1322If the project cache should be loaded during server startup.
1323+
1324The cache is loaded concurrently. Admins should ensure that the cache
1325size set under <<cache.name.memoryLimit,cache.projects.memoryLimit>>
1326is not smaller than the number of repos.
1327+
1328Default is false, disabled.
1329
1330[[cache.projects.loadThreads]]cache.projects.loadThreads::
1331+
1332Only relevant if <<cache.projects.loadOnStartup,cache.projects.loadOnStartup>>
1333is true.
1334+
1335The number of threads to allocate for loading the cache at startup. These
1336threads will die out after the cache is loaded.
1337+
1338Default is the number of CPUs.
1339
Prudhvi Akhil Alaharib60b15e2022-10-04 00:41:09 +05301340[[cache.project_list.interval]]cache.project_list.interval::
1341+
1342The link:#schedule-configuration-interval[interval] for running
1343the project_list cache warmer.
1344
1345By default, if `cache.project_list.maxAge` is set, `interval` will be set to
1346half its value. If `cache.project_list.maxAge` is not set or `interval` is set
1347to `-1`, it is disabled.
1348
1349[[cache.project_list.startTime]]cache.project_list.startTime::
1350+
1351The link:#schedule-configuration-startTime[start time] for running
1352the project_list cache warmer.
1353
1354Default is 00:00 if the project_list cache warmer is enabled.
Shawn Pearce67a33302016-08-11 11:51:59 -07001355
1356[[capability]]
1357=== Section capability
1358
1359[[capability.administrateServer]]capability.administrateServer::
1360+
1361Names of groups of users that are allowed to exercise the
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001362`administrateServer` capability, in addition to those listed in
Shawn Pearce67a33302016-08-11 11:51:59 -07001363All-Projects. Configuring this option can be a useful fail-safe
1364to recover a server in the event an administrator removed all
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001365groups from the `administrateServer` capability, or to ensure that
Shawn Pearce67a33302016-08-11 11:51:59 -07001366specific groups always have administration capabilities.
1367+
1368----
1369[capability]
1370 administrateServer = group Fail Safe Admins
1371----
1372+
1373The configuration file uses group names, not UUIDs. If a group is
1374renamed the gerrit.config file must be updated to reflect the new
1375name. If a group cannot be found for the configured name a warning
1376is logged and the server will continue normal startup.
1377+
1378If not specified (default), only the groups listed by All-Projects
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001379may use the `administrateServer` capability.
1380
1381[[capability.makeFirstUserAdmin]]capability.makeFirstUserAdmin::
1382+
1383Whether the first user that logs in to the Gerrit server should
1384automatically be added to the administrator group and hence get the
1385`administrateServer` capability assigned. This is useful to bootstrap
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -07001386the link:config-accounts.html[account data].
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001387+
1388Default is true.
Shawn Pearce67a33302016-08-11 11:51:59 -07001389
1390
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001391[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001392=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -07001393
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001394[[change.allowBlame]]change.allowBlame::
1395+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001396Allow blame on side by side diff. If set to false, blame cannot be used.
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001397+
1398Default is true.
1399
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001400[[change.cacheAutomerge]]change.cacheAutomerge::
1401+
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001402When reviewing merge commits, the left-hand side shows the output of the result
1403of JGit's automatic merge algorithm. This option controls whether this output is
1404cached in the change repository, or if only the diff is cached in the persistent
1405diff caches (`"git_modified_files"`, `modified_files`, `"git_file_diff"`,
1406`"file_diff"`).
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001407+
1408If true, automerge results are stored in the repository under
1409`refs/cache-automerge/*`; the results of diffing the change against its
Youssef Elghareeb1d1867d2021-10-27 13:11:38 +02001410automerge base are stored in the diff caches. If false, no extra data is
1411stored in the repository, only the diff caches. This can result in slight
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001412performance improvements by reducing the number of refs in the repo.
1413+
1414Default is true.
1415
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001416[[change.commentSizeLimit]]change.commentSizeLimit::
1417+
1418Maximum allowed size in characters of a regular (non-robot) comment. Comments
1419which exceed this size will be rejected. Size computation is approximate and may
1420be off by roughly 1%. Common unit suffixes of 'k', 'm', or 'g' are supported.
1421The value must be positive.
1422+
Joerg Zierenfaea7e12020-04-06 10:44:46 +02001423The default limit is 16kiB.
1424
1425[[change.cumulativeCommentSizeLimit]]change.cumulativeCommentSizeLimit::
1426+
1427Maximum allowed size in characters of all comments (including robot comments)
1428and change messages. Size computation is approximate and may be off by roughly
14291%. Common unit suffixes of 'k', 'm', or 'g' are supported.
1430+
1431The default limit is 3MiB.
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001432
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001433[[change.disablePrivateChanges]]change.disablePrivateChanges::
Patrick Hieseldb8df482019-01-24 10:11:23 +01001434+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001435If set to true, users are not allowed to create private changes.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001436+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001437The default is false.
1438
Ben Rohlfs2cc33542020-02-28 12:44:09 +01001439[[change.enableAttentionSet]]change.enableAttentionSet::
1440+
1441If set to true, then all UI features for using and interacting with the
1442attention set are enabled.
1443+
Ben Rohlfs4427d432020-10-28 09:14:10 +01001444The default is true.
Ben Rohlfs2cc33542020-02-28 12:44:09 +01001445
1446[[change.enableAssignee]]change.enableAssignee::
1447+
1448If set to true, then all UI features for using and interacting with the
1449assignee are enabled.
1450+
Ben Rohlfs4427d432020-10-28 09:14:10 +01001451The default is false.
Ben Rohlfs2cc33542020-02-28 12:44:09 +01001452
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001453[[change.maxComments]]change.maxComments::
1454+
1455Maximum number of comments (regular plus robot) allowed per change. Additional
1456comments are rejected.
1457+
1458By default 5,000.
1459
Joerg Zieren1ebe6872021-01-28 13:45:55 +01001460[[change.maxFiles]]change.maxFiles::
1461+
1462Maximum number of files allowed per change. Larger changes are rejected and must
1463be split up.
1464+
1465By default 100,000.
1466
1467[[change.maxPatchSets]]change.maxPatchSets::
1468+
1469Maximum number of patch sets allowed per change. If this is insufficient,
1470recreate the change with a new Change-Id, then abandon the old change.
1471+
1472By default 1,500.
1473
Dave Borowitzca614bc2019-04-15 15:29:15 -07001474[[change.maxUpdates]]change.maxUpdates::
1475+
1476Maximum number of updates to a change. Counts only updates to the main NoteDb
1477meta ref; draft comments, robot comments, stars, etc. do not count towards the
1478total.
1479+
1480Many NoteDb operations require walking the entire change meta ref and loading
1481its contents into memory, so changes with arbitrarily many updates may cause
1482high CPU usage, memory pressure, persistent cache bloat, and other problems.
1483+
Dave Borowitz18e7b552019-04-17 07:53:38 -07001484The following operations are allowed even when a change is at the limit:
Edwin Kempinf2f815b2020-01-22 17:09:16 +01001485
Dave Borowitz18e7b552019-04-17 07:53:38 -07001486* Abandon
1487* Submit
1488* Submit by push with `%submit`
1489* Auto-close by pushing directly to the branch
1490* Fix with link:rest-api-changes.html#fix-input[`expect_merged_as`]
Edwin Kempinf2f815b2020-01-22 17:09:16 +01001491
Dave Borowitzca614bc2019-04-15 15:29:15 -07001492By default 1000.
1493
Patrick Hiesela4824db2019-12-20 10:55:26 +01001494[[change.mergeabilityComputationBehavior]]change.mergeabilityComputationBehavior::
1495+
1496This setting determines when Gerrit computes if a change is mergeable or not.
1497This computation is expensive, especially when the repository is large or when
1498there are many open changes.
1499+
1500This config can have the following states:
1501+
1502* `API_REF_UPDATED_AND_CHANGE_REINDEX`: Gerrit indexes `mergeability` enabling
1503 the `is:mergeable` predicate in change search and allowing fast retrieval of
1504 this bit in query responses. Gerrit will always serve `mergeable` in
1505 link:rest-api-changes.html#change-info[ChangeInfo] objects.
1506 Gerrit will reindex all open changes when the target ref advances (expensive).
1507* `REF_UPDATED_AND_CHANGE_REINDEX`: Gerrit indexes `mergeability` enabling the
1508 `is:mergeable` predicate in change search and allowing fast retrieval of this
1509 bit in query responses. Gerrit will never serve `mergeable` in
1510 link:rest-api-changes.html#change-info[ChangeInfo]
1511 objects. This state can be a final state for instances that only want to
1512 optimize the read path, but not the write path for speed or serve as an
1513 intermediary step for instances that want to optimize both and need to migrate
1514 callers of their API.
1515 Gerrit will reindex all open changes when the target ref advances (expensive).
1516* `NEVER`: Gerrit does not index `mergeable`, so `is:mergeable` is disabled as
1517 query operator. Gerrit does not serve `mergeable` in
1518 link:rest-api-changes.html#change-info[ChangeInfo].
1519
Matthias Sohn1e2cd2902021-03-23 14:31:21 +01001520NOTE: Gerrit would only render conflict changes section on change
1521screen if `API_REF_UPDATED_AND_CHANGE_REINDEX` value is set.
1522
David Ostrovsky8aaace12021-05-12 12:27:54 +02001523Default is `NEVER`.
Patrick Hiesela4824db2019-12-20 10:55:26 +01001524
Matthias Sohn1e2cd2902021-03-23 14:31:21 +01001525[[change.conflictsPredicateEnabled]]change.conflictsPredicateEnabled::
1526
1527+
1528This setting determines when Gerrit renders conflict changes section on change
1529screen and also supports `conflicts` predicate. This computation is expensive,
1530computing ConflictsPredicate has a runtime complexity of O(nˆ2) with n number
1531of open changes on a branch. When set to false GUI will silently ignore the
1532error message and leave the conflict changes section on change screen empty.
1533See also implications on rendering of conflict changes section in configuration
1534section:link:#change.mergeabilityComputationBehavior[change.mergeabilityComputationBehavior].
1535
1536Default is true.
1537
Luca Milanesioeb903122022-06-01 22:56:17 -07001538[[change.maxSubmittableAtOnce]]change.maxSubmittableAtOnce::
1539+
1540Maximum number of changes that can be chained together in the same repository
1541to be submitted at once.
1542+
1543Default is 32767.
1544
Edwin Kempin67229a42019-10-08 09:13:34 +02001545[[change.move]]change.move::
1546+
1547Whether the link:rest-api-changes.html#move-change[Move Change] REST
1548endpoint is enabled.
1549+
1550The move change functionality has some corner cases with undesired side
1551effects. Hence administrators may decide to disable this functionality.
1552In particular, if a change that has dependencies on other changes is
1553moved to a new branch, and the moved change gets submitted to the new
1554branch, the changes on which the change depends are silently merged
1555into the new branch, although these changes have not been moved to that
1556branch (see details in
Edwin Kempin41659372023-06-21 10:08:28 +00001557link:https://issues.gerritcodereview.com/issues/40009784[issue 40009784]).
Edwin Kempin67229a42019-10-08 09:13:34 +02001558+
1559By default true.
1560
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001561[[change.robotCommentSizeLimit]]change.robotCommentSizeLimit::
1562+
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001563Maximum allowed size in characters of a robot comment. Robot comments which
1564exceed this size will be rejected on addition. Size computation is approximate
1565and may be off by roughly 1%. Common unit suffixes of 'k', 'm', or 'g' are
1566supported. Zero or negative values allow robot comments of unlimited size.
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001567+
Joerg Zierenfaea7e12020-04-06 10:44:46 +02001568The default limit is 1MiB.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001569
Gal Paikin02d6ba62020-07-13 23:49:24 +03001570[[change.sendNewPatchsetEmails]]change.sendNewPatchsetEmails::
1571+
1572When false, emails will not be sent to owners, reviewers, and cc for
1573creating a new patchset unless they are project watchers or have starred
1574the change.
1575+
1576Default is true.
1577
Luca Milanesiof2a275b2017-04-10 10:59:34 +01001578[[change.showAssigneeInChangesTable]]change.showAssigneeInChangesTable::
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001579+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001580Show assignee field in changes table. If set to false, assignees will
1581not be visible in changes table.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001582+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001583Default is false.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001584
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001585[[change.strictLabels]]change.strictLabels::
1586+
1587Reject invalid label votes: invalid labels or invalid values. This
David Pursehouse33495ab2019-10-31 09:38:43 +09001588configuration option is provided for backwards compatibility and may
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001589be removed in future gerrit versions.
1590+
1591Default is false.
1592
David Ostrovsky9933eb32014-05-20 16:08:20 +02001593[[change.submitLabel]]change.submitLabel::
1594+
1595Label name for the submit button.
1596+
1597Default is "Submit".
1598
Stefan Beller7c380d512015-08-21 10:55:21 -07001599[[change.submitLabelWithParents]]change.submitLabelWithParents::
1600+
1601Label name for the submit button if the change has parents which will
1602be submitted together with this change.
1603+
1604Default is "Submit including parents".
1605
David Ostrovsky9933eb32014-05-20 16:08:20 +02001606[[change.submitTooltip]]change.submitTooltip::
1607+
1608Tooltip for the submit button. Variables available for replacement
1609include `${patchSet}` for the current patch set number (1, 2, 3),
1610`${branch}` for the branch name ("master") and `${commit}` for the
1611abbreviated commit SHA-1 (`c9c0edb`).
1612+
1613Default is "Submit patch set ${patchSet} into ${branch}".
1614
Stefan Beller0e655542015-07-20 21:14:38 -07001615[[change.submitTooltipAncestors]]change.submitTooltipAncestors::
1616+
1617Tooltip for the submit button if there are ancestors which would
1618also be submitted by submitting the change. Additionally to the variables
1619as in link:#change.submitTooltip[change.submitTooltip], there is the
1620variable `${submitSize}` indicating the number of changes which are
1621submitted.
1622+
1623Default is "Submit all ${topicSize} changes of the same topic (${submitSize}
1624changes including ancestors and other changes related by topic)".
1625
Stefan Bellera038cf72015-01-13 16:25:10 -08001626[[change.submitTopicLabel]]change.submitTopicLabel::
1627+
1628If `change.submitWholeTopic` is set and a change has a topic,
1629the label name for the submit button is given here instead of
1630the configuration `change.submitLabel`.
1631+
1632Defaults to "Submit whole topic"
1633
1634[[change.submitTopicTooltip]]change.submitTopicTooltip::
1635+
David Pursehousea61ee502016-09-06 16:27:09 +09001636If `change.submitWholeTopic` is configured to true and a change has a
Stefan Bellera038cf72015-01-13 16:25:10 -08001637topic, this configuration determines the tooltip for the submit button
1638instead of `change.submitTooltip`. The variable `${topicSize}` is available
Stefan Beller7c380d512015-08-21 10:55:21 -07001639for the number of changes in the same topic to be submitted. The number of
1640all changes to be submitted is in the variable `${submitSize}`.
Stefan Bellera038cf72015-01-13 16:25:10 -08001641+
Stefan Beller7c380d512015-08-21 10:55:21 -07001642Defaults to "Submit all ${topicSize} changes of the same topic
1643(${submitSize} changes including ancestors and other
1644changes related by topic)".
Stefan Bellera038cf72015-01-13 16:25:10 -08001645
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001646[[change.submitWholeTopic]]change.submitWholeTopic::
Richard Möhne4abe9a2014-11-13 20:05:13 +01001647+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001648Determines if the submit button submits the whole topic instead of
1649just the current change.
David Ostrovskya304aff2018-04-05 23:07:51 +02001650+
1651Default is false.
1652
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001653[[change.updateDelay]]change.updateDelay::
Changcheng Xiao16095352017-12-18 10:03:08 +01001654+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001655How often in seconds the web interface should poll for updates to the
1656currently open change. The poller relies on the client's browser
1657cache to use If-Modified-Since and respect `304 Not Modified` HTTP
1658responses. This allows for fast polls, often under 8 milliseconds.
Changcheng Xiao16095352017-12-18 10:03:08 +01001659+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001660With a configured 30 second delay a server with 4900 active users will
1661typically need to dedicate 1 CPU to the update check. 4900 users
1662divided by an average delay of 30 seconds is 163 requests arriving per
1663second. If requests are served at \~6 ms response time, 1 CPU is
1664necessary to keep up with the update request traffic. On a smaller
1665user base of 500 active users, the default 30 second delay is only 17
1666requests per second and requires ~10% CPU.
1667+
1668If 0 the update polling is disabled.
1669+
1670Default is 5 minutes.
Changcheng Xiao16095352017-12-18 10:03:08 +01001671
Edwin Kempine326a1d2015-06-03 10:27:39 +02001672[[changeCleanup]]
1673=== Section changeCleanup
1674
1675This section allows to configure change cleanups and schedules them to
1676run periodically.
1677
1678[[changeCleanup.abandonAfter]]changeCleanup.abandonAfter::
1679+
1680Period of inactivity after which open changes should be abandoned
1681automatically.
1682+
1683By default `0`, never abandon open changes.
1684+
1685[WARNING] Auto-Abandoning changes may confuse/annoy users. When
1686enabling this, make sure to choose a reasonably large grace period and
1687inform users in advance.
1688+
1689The following suffixes are supported to define the time unit:
1690+
1691* `d, day, days`
1692* `w, week, weeks` (`1 week` is treated as `7 days`)
1693* `mon, month, months` (`1 month` is treated as `30 days`)
1694* `y, year, years` (`1 year` is treated as `365 days`)
1695
Edwin Kempin7080ef12015-06-10 15:03:09 +02001696[[changeCleanup.abandonIfMergeable]]changeCleanup.abandonIfMergeable::
1697+
David Pursehousef4bc2562019-12-04 09:55:40 +09001698Whether changes which are mergeable should be auto-abandoned. When set
1699to `false`, `-is:mergeable` is appended to the query used to find
1700the changes to auto-abandon.
Edwin Kempin7080ef12015-06-10 15:03:09 +02001701+
David Pursehousef4bc2562019-12-04 09:55:40 +09001702By default `true`, meaning mergeable changes are auto-abandoned.
1703+
Patrick Hiesela4824db2019-12-20 10:55:26 +01001704If
1705link:#change.mergeabilityComputationBehavior[`change.mergeabilityComputationBehavior`]
1706is set to `NEVER`, setting this option to `false` has no effect and it behaves
1707as though it were set to `true`.
Edwin Kempin7080ef12015-06-10 15:03:09 +02001708
Jacek Centkowski36d35212019-05-13 14:32:00 +02001709[[changeCleanup.cleanupAccountPatchReview]]changeCleanup.cleanupAccountPatchReview::
1710+
1711Whether accountPatchReview data should be also removed when change
1712gets auto-abandoned.
1713+
1714By default `false`.
1715
Edwin Kempine326a1d2015-06-03 10:27:39 +02001716[[changeCleanup.abandonMessage]]changeCleanup.abandonMessage::
1717+
1718Change message that should be posted when a change is abandoned.
1719+
1720'${URL}' can be used as a placeholder for the Gerrit web URL.
1721+
1722By default "Auto-Abandoned due to inactivity, see
1723${URL}Documentation/user-change-cleanup.html#auto-abandon\n\n
1724If this change is still wanted it should be restored.".
1725
1726[[changeCleanup.startTime]]changeCleanup.startTime::
1727+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001728The link:#schedule-configuration-startTime[start time] for running
1729change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001730
1731[[changeCleanup.interval]]changeCleanup.interval::
1732+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001733The link:#schedule-configuration-interval[interval] for running
1734change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001735
Edwin Kempind33d95a2018-02-16 11:44:04 +01001736link:#schedule-configuration-examples[Schedule examples] can be found
1737in the link:#schedule-configuration[Schedule Configuration] section.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001738
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001739[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001740=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001741
Brad Larson991a31b2009-11-03 14:30:26 -06001742Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -05001743patch comments, in-line code comments and approval category value descriptions
1744to turn set strings into hyperlinks. One common use is for linking to
1745bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -06001746
1747In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001748will match typical Gerrit Change-Id values and create a hyperlink
1749to changes which reference it. The second configuration 'bugzilla'
1750will hyperlink terms such as 'bug 42' to an external bug tracker,
1751supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +09001752configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001753how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -06001754
Sven Selberg2a0beab2018-04-20 14:49:20 +02001755commentlinks supports link:#reloadConfig[configuration reloads]. Though a
Gustaf Lundhca7eb792018-04-16 10:56:03 +02001756link:cmd-flush-caches.html[flush-caches] of "projects" is needed for the
1757commentlinks to be immediately available in the UI.
1758
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001759----
1760[commentlink "changeid"]
1761 match = (I[0-9a-f]{8,40})
David Pursehouse9f68e1a2016-01-28 09:21:03 +00001762 link = "#/q/$1"
Brad Larson991a31b2009-11-03 14:30:26 -06001763
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001764[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001765 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001766 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -06001767
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001768[commentlink "tracker"]
1769 match = ([Bb]ug:\\s+)(\\d+)
1770 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
1771----
1772
Dave Borowitz13b38002013-04-08 12:03:29 -07001773Comment links can also be specified in `project.config` and sections in
1774children override those in parents. The only restriction is that to
1775avoid injecting arbitrary user-supplied HTML in the page, comment links
1776defined in `project.config` may only supply `link`, not `html`.
1777
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001778[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -06001779+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001780A JavaScript regular expression to match positions to be replaced
1781with a hyperlink. Subexpressions of the matched string can be
1782stored using groups and accessed with `$'n'` syntax, where 'n'
1783is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -06001784+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001785The configuration file parser eats one level of backslashes, so the
1786character class `\s` requires `\\s` in the configuration file. The
1787parser also terminates the line at the first `#`, so a match
1788expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001789+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -08001790To match case insensitive strings, a character class with both the
1791upper and lower case character for each position must be used. For
1792example, to match the string `bug` in a case insensitive way the match
1793pattern `[bB][uU][gG]` needs to be used.
1794+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001795The commentlink.name.match regular expressions are applied to the raw,
1796unformatted and unescaped text form. Regex matching against HTML is not
1797supported. Comment link patterns that are written in this style should
1798be updated to match text formats.
Matthew Webbercd7d2bf2015-10-14 15:54:06 +01001799+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001800A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -06001801
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001802[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -06001803+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001804The URL to direct the user to whenever the regular expression is
1805matched. Groups in the match expression may be accessed as `$'n'`.
1806+
1807The link property is used only when the html property is not present.
1808
1809[[commentlink.name.html]]commentlink.<name>.html::
1810+
1811HTML to replace the entire matched string with. If present,
1812this property overrides the link property above. Groups in the
1813match expression may be accessed as `$'n'`.
1814+
1815The configuration file eats double quotes, so escaping them as
1816`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -06001817
Dave Borowitz82d79c02013-04-08 15:45:12 -07001818[[commentlink.name.enabled]]commentlink.<name>.enabled::
1819+
1820Whether the comment link is enabled. A child project may override a
1821section in a parent or the site-wide config that is disabled by
1822specifying `enabled = true`.
1823+
1824Disabling sections in `gerrit.config` can be used by site administrators
1825to create a library of comment links with `html` set that are not
1826user-supplied and thus can be verified to be XSS-free, but are only
1827enabled for a subset of projects.
1828+
David Pursehouse6f1af472013-12-11 19:23:33 +09001829By default, true.
1830+
Dave Borowitz82d79c02013-04-08 15:45:12 -07001831Note that the names and contents of disabled sections are visible even
1832to anonymous users via the
1833link:rest-api-projects.html#get-config[REST API].
1834
Brad Larson991a31b2009-11-03 14:30:26 -06001835
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001836[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001837=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001838
1839These settings are applied only if Gerrit is started as the container
1840process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
1841
1842[[container.heapLimit]]container.heapLimit::
1843+
1844Maximum heap size of the Java process running Gerrit, in bytes.
1845This property is translated into the '-Xmx' flag for the JVM.
1846+
1847Default is platform and JVM specific.
1848+
1849Common unit suffixes of 'k', 'm', or 'g' are supported.
1850
1851[[container.javaHome]]container.javaHome::
1852+
1853Path of the JRE/JDK installation to run Gerrit with. If not set, the
1854Gerrit startup script will attempt to search your system and guess
1855a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
1856
1857[[container.javaOptions]]container.javaOptions::
1858+
David Pursehousea13052b2020-02-10 14:26:08 +09001859Additional options to pass along to the Java runtime. May be specified
1860multiple times to configure multiple values. If multiple values are
1861configured, they are passed in order on the command line, separated by
1862spaces. These options are appended onto 'JAVA_OPTIONS'.
David Pursehousea70a60c2020-02-10 14:22:43 +09001863+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001864For example, it is possible to overwrite Gerrit's default log4j
1865configuration:
David Pursehousea70a60c2020-02-10 14:22:43 +09001866+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001867----
1868 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
1869----
Antoine Musso9ed4b4f2020-11-17 16:52:35 +01001870+
1871Gerrit built-in loggers are then ignored: error logger (`error_log` file),
1872link:#httpd.requestLog[httpd.requestLog] and
1873link:#sshd.requestLog[sshd.requestLog]. The
1874link:#log.jsonLogging[log.jsonLogging] and
1875link:#log.textLogging[log.textLogging] options are also ignored.
David Ostrovskyc772bd82013-10-03 10:37:51 +02001876
Hugo Arès6710f0a2014-11-04 10:28:42 -05001877[[container.daemonOpt]]container.daemonOpt::
1878+
1879Additional options to pass to the daemon (e.g. '--enable-httpd'). If
1880multiple values are configured, they are passed in that order to the command
1881line, separated by spaces.
1882+
1883Execute `java -jar gerrit.war daemon --help` to see all possible
1884options.
1885
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001886[[container.replica]]container.replica::
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001887+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02001888Used on Gerrit replica installations. If set to true the Gerrit JVM is
1889called with the '--replica' switch, enabling replica mode. If no value is
Matthias Sohnd8182ba2019-12-09 14:50:23 +01001890set (or any other value), Gerrit defaults to primary mode enabling write
1891operations.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001892
David Ostrovsky21fca752019-10-18 08:50:29 +02001893[[container.slave]]container.slave::
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001894+
Christian Aistleitnerde8b0722020-06-20 22:17:23 +02001895Backward compatibility for link:#container.replica[`container.replica`]
1896config setting.
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001897
Khai Do6168beb2016-12-19 17:26:28 -08001898[[container.startupTimeout]]container.startupTimeout::
1899+
1900The maximum time (in seconds) to wait for a gerrit.sh start command
1901to run a new Gerrit daemon successfully. If not set, defaults to
190290 seconds.
1903
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001904[[container.user]]container.user::
1905+
1906Login name (or UID) of the operating system user the Gerrit JVM
1907will execute as. If not set, defaults to the user who launched
1908the 'gerrit.sh' wrapper script.
1909
1910[[container.war]]container.war::
1911+
1912Path of the JAR file to start daemon execution with. This should
1913be the path of the local 'gerrit.war' archive. Overrides the
1914environment variable 'GERRIT_WAR'.
1915+
1916If not set, defaults to '$site_path/bin/gerrit.war', or to
1917'$HOME/gerrit.war'.
1918
1919
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001920[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001921=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001922
Saša Živkovd34dfe32017-11-20 11:14:35 +01001923[NOTE]
1924The link:#jgitConfig[etc/jgit.config] file supports configuration of all JGit
1925options.
1926
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001927[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001928+
1929Number of bytes of a pack file to load into memory in a single
1930read operation. This is the "page size" of the JGit buffer cache,
1931used for all pack access operations. All disk IO occurs as single
1932window reads. Setting this too large may cause the process to load
1933more data than is required; setting this too small may increase
1934the frequency of `read()` system calls.
1935+
1936Default on JGit is 8 KiB on all platforms.
1937+
1938Common unit suffixes of 'k', 'm', or 'g' are supported.
1939
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001940[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001941+
1942Maximum number of bytes to load and cache in memory from pack files.
1943If JGit needs to access more than this many bytes it will unload less
1944frequently used windows to reclaim memory space within the process.
1945As this buffer must be shared with the rest of the JVM heap, it
1946should be a fraction of the total memory available.
1947+
1948Default on JGit is 10 MiB on all platforms.
1949+
1950Common unit suffixes of 'k', 'm', or 'g' are supported.
1951
Matthias Sohn79bec412020-02-12 01:00:31 +01001952[[core.packedGitUseStrongRefs]]core.packedGitUseStrongRefs::
1953+
1954Set to `true` in order to use strong references to reference packfile
1955pages cached in the WindowCache. Otherwise SoftReferences are used.
1956If this option is set to `false`, the Java garbage collector will
1957flush the WindowCache to free memory if the used heap comes close to
1958the maximum heap size. This has the advantage that it can quickly
1959reclaim memory which was used by the WindowCache but comes at the
1960price that the previously cached pack file content needs to be again
1961copied from the file system cache to the Gerrit process.
1962Setting this option to `true` prevents flushing the WindowCache
1963which provides more predictable performance.
1964+
1965Default is `false`.
1966
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001967[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001968+
1969Maximum number of bytes to reserve for caching base objects
1970that multiple deltafied objects reference. By storing the entire
1971decompressed base object in a cache Git is able to avoid unpacking
1972and decompressing frequently used base objects multiple times.
1973+
1974Default on JGit is 10 MiB on all platforms. You probably do not
1975need to adjust this value.
1976+
1977Common unit suffixes of 'k', 'm', or 'g' are supported.
1978
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001979[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001980+
1981Maximum number of pack files to have open at once. A pack file
1982must be opened in order for any of its data to be available in
1983a cached window.
1984+
1985If you increase this to a larger setting you may need to also adjust
1986the ulimit on file descriptors for the host JVM, as Gerrit needs
1987additional file descriptors available for network sockets and other
1988repository data manipulation.
1989+
1990Default on JGit is 128 file descriptors on all platforms.
1991
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001992[[core.streamFileThreshold]]core.streamFileThreshold::
1993+
1994Largest object size, in bytes, that JGit will allocate as a
1995contiguous byte array. Any file revision larger than this threshold
1996will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001997files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001998during delta decompression.
1999+
2000Servers with very high traffic should set this to be larger than
2001the size of their common big files. For example a server managing
2002the Android platform typically has to deal with ~10-12 MiB XML
2003files, so `15 m` would be a reasonable setting in that environment.
2004Setting this too high may cause the JVM to run out of heap space
2005when handling very big binary files, such as device firmware or
2006CD-ROM ISO images.
2007+
Luca Milanesiob104a552019-11-18 17:28:56 -08002008Defaults to 25% of the available JVM heap, limited to 2g.
Shawn O. Pearce329fe792010-09-03 15:44:23 -07002009+
2010Common unit suffixes of 'k', 'm', or 'g' are supported.
2011
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002012[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07002013+
2014When true, JGit will use `mmap()` rather than `malloc()+read()`
2015to load data from pack files. The use of mmap can be problematic
2016on some JVMs as the garbage collector must deduce that a memory
2017mapped segment is no longer in use before a call to `munmap()`
2018can be made by the JVM native code.
2019+
2020In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09002021pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07002022of virtual address space, as the garbage collector cannot reclaim
2023unused mapped spaces fast enough.
2024+
2025Default on JGit is false. Although potentially slower, it yields
2026much more predictable behavior.
2027
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02002028[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
2029+
2030Size of the buffer to store logging events for asynchronous logging.
2031Putting a larger value can protect threads from stalling when the
2032AsyncAppender threads are not fast enough to consume the logging events
David Pursehouse1ff91c02015-05-19 15:05:26 +09002033from the buffer. It also protects from losing log entries in this case.
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02002034+
2035Default is 64 entries.
2036
Dave Borowitz1bec65a2013-03-13 10:59:01 -07002037[[core.useRecursiveMerge]]core.useRecursiveMerge::
2038+
Edwin Kempin71831d22014-07-15 08:54:29 +02002039Use JGit's recursive merger for three-way merges. This only affects
Sebastian Schuberth774aac92015-04-16 13:21:04 +02002040projects that allow content merges.
Edwin Kempin71831d22014-07-15 08:54:29 +02002041+
2042As explained in this
2043link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[
Marian Harbach34253372019-12-10 18:01:31 +01002044blog,role=external,window=_blank], the recursive merge produces better results if the two commits
Edwin Kempin71831d22014-07-15 08:54:29 +02002045that are merged have more than one common predecessor.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07002046+
Edwin Kempin7853c5b2014-07-15 08:57:17 +02002047Default is true.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07002048
Hugo Arès47344372016-06-27 10:23:17 -04002049[[core.repositoryCacheCleanupDelay]]core.repositoryCacheCleanupDelay::
2050+
2051Delay between each periodic cleanup of expired repositories.
2052+
2053Values can be specified using standard time unit abbreviations (`ms`, `sec`,
2054`min`, etc.).
2055+
2056Set it to 0 in order to switch off cache expiration. If cache expiration is
2057switched off, the JVM can still evict cache entries when it is running low
2058on available heap memory.
2059+
2060Set it to -1 to automatically derive cleanup delay from
2061`core.repositoryCacheExpireAfter` (lowest value between 1/10 of
2062`core.repositoryCacheExpireAfter` and 10 minutes).
2063+
2064Default is -1.
2065
2066[[core.repositoryCacheExpireAfter]]core.repositoryCacheExpireAfter::
2067+
2068Time an unused repository should expire and be evicted from the repository
2069cache.
2070+
2071Values can be specified using standard time unit abbreviations (`ms`, `sec`,
2072`min`, etc.).
2073+
2074Default is 1 hour.
2075
Youssef Elghareeb3fa84312022-01-14 15:25:05 +01002076[[dashboard]]
2077=== Section dashboard
2078
2079[[dashboard.submitRequirementColumns]]dashboard.submitRequirementColumns::
2080+
2081The list of submit requirement names that should be displayed as separate
2082columns in the dashboard.
2083
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002084[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002085=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03002086
2087----
2088[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02002089 command = checkout
2090 command = cherry_pick
2091 command = pull
2092 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03002093 scheme = ssh
2094 scheme = http
2095 scheme = anon_http
2096 scheme = anon_git
Mike Frysingerde097a92021-04-29 10:55:15 -04002097 scheme = repo
Thomas Draebingee305192023-03-08 16:40:11 +01002098 hide = ssh
monica.dionisio3f630442010-06-29 15:42:57 -03002099----
2100
2101The download section configures the allowed download methods.
2102
Edwin Kempin08b03a22012-09-14 16:32:57 +02002103[[download.command]]download.command::
2104+
2105Commands that should be offered to download changes.
2106+
2107Multiple commands are supported:
2108+
2109* `checkout`
2110+
2111Command to fetch and checkout the patch set.
2112+
2113* `cherry_pick`
2114+
2115Command to fetch the patch set and to cherry-pick it onto the current
2116commit.
2117+
2118* `pull`
2119+
2120Command to pull the patch set.
2121+
2122* `format_patch`
2123+
2124Command to fetch the patch set and to feed it into the `format-patch`
2125command.
2126
2127+
2128If `download.command` is not specified, all download commands are
2129offered.
2130
monica.dionisio3f630442010-06-29 15:42:57 -03002131[[download.scheme]]download.scheme::
2132+
2133Schemes that should be used to download changes.
2134+
2135Multiple schemes are supported:
2136+
2137* `http`
2138+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002139Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03002140+
2141* `ssh`
2142+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002143Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03002144+
2145* `anon_http`
2146+
2147Anonymous HTTP download is allowed.
2148+
2149* `anon_git`
2150+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002151Anonymous Git download is allowed. This is not default, it is also
2152necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
2153variable.
monica.dionisio3f630442010-06-29 15:42:57 -03002154+
Mike Frysingerde097a92021-04-29 10:55:15 -04002155* `repo`
monica.dionisio3f630442010-06-29 15:42:57 -03002156+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002157Gerrit advertises patch set downloads with the `repo download`
2158command, assuming that all projects managed by this instance are
Mike Frysingerde097a92021-04-29 10:55:15 -04002159generally worked on with the
Kenyon Ralphce209b62022-01-07 00:52:02 -08002160https://gerrit.googlesource.com/git-repo[repo multi-repository tool].
Mike Frysingerde097a92021-04-29 10:55:15 -04002161This is not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03002162
2163+
Edwin Kempin08b03a22012-09-14 16:32:57 +02002164If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002165downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08002166
Thomas Draebingee305192023-03-08 16:40:11 +01002167[[download.hide]]download.hide::
2168+
2169Schemes that can be used to download changes, but will not be advertised
2170in the UI. This can be any scheme that can be configured in <<download.scheme>>.
2171+
2172This is mostly useful in a deprecation scenario during a time where using
2173a scheme is discouraged, but has to be supported until all clients have
2174migrated to use a different scheme.
2175+
2176By default, no scheme will be hidden in the UI.
2177
Edwin Kempin322db672015-07-03 08:50:46 +02002178[[download.checkForHiddenChangeRefs]]download.checkForHiddenChangeRefs::
2179+
2180Whether the download commands should be adapted when the change refs
2181are hidden.
2182+
2183Git has a configuration option to hide refs from the initial
2184advertisement (`uploadpack.hideRefs`). This option can be used to hide
2185the change refs from the client. As consequence fetching changes by
2186change ref does not work anymore. However by setting
2187`uploadpack.allowTipSha1InWant` to `true` fetching changes by commit ID
2188is possible. If `download.checkForHiddenChangeRefs` is set to `true`
2189the git download commands use the commit ID instead of the change ref
2190when a project is configured like this.
2191+
2192Example git configuration on a project:
2193+
2194----
2195[uploadpack]
2196 hideRefs = refs/changes/
2197 hideRefs = refs/cache-automerge/
2198 allowTipSha1InWant = true
2199----
2200+
2201By default `false`.
2202
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002203[[download.archive]]download.archive::
2204+
2205Specifies which archive formats, if any, should be offered on the change
Francois Ferrand1e933882014-09-25 11:19:08 +02002206screen and supported for `git-upload-archive` operation:
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002207+
2208----
2209[download]
2210 archive = tar
2211 archive = tbz2
2212 archive = tgz
2213 archive = txz
Francois Ferrand1e933882014-09-25 11:19:08 +02002214 archive = zip
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002215----
2216
Shawn Pearce6edde312014-03-26 22:00:26 -07002217If `download.archive` is not specified defaults to all archive
2218commands. Set to `off` or empty string to disable.
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002219
Francois Ferrand1e933882014-09-25 11:19:08 +02002220Zip is not supported because it may be interpreted by a Java plugin as a
2221valid JAR file, whose code would have access to cookies on the domain.
2222For this reason `zip` format is always excluded from formats offered
2223through the `Download` drop down or accessible in the REST API.
2224
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002225[[gc]]
2226=== Section gc
2227
2228This section allows to configure the git garbage collection and schedules it
2229to run periodically. It will be triggered and executed sequentially for all
2230projects.
2231
Christian Halstricke6c68322015-03-11 15:21:42 +01002232[[gc.aggressive]]gc.aggressive::
2233+
2234Determines if scheduled garbage collections and garbage collections triggered
2235through Web-UI should run in aggressive mode or not. Aggressive garbage
2236collections are more expensive but may lead to significantly smaller
2237repositories.
2238+
2239Valid values are "true" and "false," default is "false".
2240
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002241[[gc.startTime]]gc.startTime::
2242+
Edwin Kempind33d95a2018-02-16 11:44:04 +01002243The link:#schedule-configuration-startTime[start time] for running the
2244git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002245
2246[[gc.interval]]gc.interval::
2247+
Edwin Kempind33d95a2018-02-16 11:44:04 +01002248The link:#schedule-configuration-interval[interval] for running the
2249git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002250
Edwin Kempind33d95a2018-02-16 11:44:04 +01002251link:#schedule-configuration-examples[Schedule examples] can be found
2252in the link:#schedule-configuration[Schedule Configuration] section.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002253
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002254[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002255=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002256
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002257[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07002258+
2259Local filesystem directory holding all Git repositories that
2260Gerrit knows about and can process changes for. A project
2261entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02002262the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07002263+
2264If relative, the path is resolved relative to `'$site_path'`.
2265
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002266[[gerrit.allProjects]]gerrit.allProjects::
2267+
2268Name of the permissions-only project defining global server
2269access controls and settings. These are inherited into every
2270other project managed by the running server. The name is
2271relative to `gerrit.basePath`.
2272+
Patrick Hiesel8622fa8b2022-01-27 14:09:55 +01002273The link:#cache_names[persisted_projects cache] must be
2274flushed after this setting is changed.
2275+
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002276Defaults to `All-Projects` if not set.
2277
Marija Savtchouk714fbff2021-03-12 16:02:12 +00002278[[gerrit.defaultBranch]]gerrit.defaultBranch::
2279+
2280Name of the link:project-configuration.html#default-branch[default branch]
2281to use on the project creation, if no other branches were specified in the input.
2282+
2283Defaults to `refs/heads/master` if not set.
2284
Edwin Kempin2bf5edd2014-03-25 22:21:23 +01002285[[gerrit.allUsers]]gerrit.allUsers::
2286+
2287Name of the project in which meta data of all users is stored.
2288The name is relative to `gerrit.basePath`.
2289+
2290Defaults to `All-Users` if not set.
2291
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002292[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002293+
2294The default URL for Gerrit to be accessed through.
2295+
Sebastian Schuberth64037132016-07-28 13:40:16 +02002296Typically this would be set to something like "http://review.example.com/"
2297or "http://example.com:8080/gerrit/" so Gerrit can output links that point
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002298back to itself.
2299+
Kenyon Ralph9536ac92022-01-05 17:15:41 -08002300Setting this is highly recommended, as it is necessary for the upload
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002301code invoked by "git push" or "repo upload" to output hyperlinks
2302to the newly uploaded changes.
2303
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002304[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002305+
2306Optional base URL for repositories available over the anonymous git
2307protocol. For example, set this to `git://mirror.example.com/base/`
2308to have Gerrit display patch set download URLs in the UI. Gerrit
2309automatically appends the project name onto the end of the URL.
2310+
2311By default unset, as the git daemon must be configured externally
2312by the system administrator, and might not even be running on the
2313same host as Gerrit.
2314
Dave Borowitza5d3fec2015-07-09 14:24:02 -07002315[[gerrit.docUrl]]gerrit.docUrl::
2316+
2317Optional base URL for documentation, under which one can find
2318"index.html", "rest-api.html", etc. Used as the base for the fixed set
2319of links in the "Documentation" tab. A slash is implicitly appended.
2320(For finer control over the top menu, consider writing a
2321link:dev-plugins.html#top-menu-extensions[plugin].)
2322+
2323If unset or empty, the documentation tab will only be shown if
2324`/Documentation/index.html` can be reached by the browser at app load
2325time.
2326
Dave Borowitza17a9842015-09-15 09:58:17 -04002327[[gerrit.editGpgKeys]]gerrit.editGpgKeys::
2328+
2329If enabled and server-side signed push validation is also
2330link:#receive.enableSignedPush[enabled], enable the
2331link:rest-api-accounts.html#list-gpg-keys[REST API endpoints] and web UI
2332for editing GPG keys. If disabled, GPG keys can only be added by
2333administrators with direct git access to All-Users.
2334+
2335Defaults to true.
2336
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002337[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
2338+
2339Optional command to install the `commit-msg` hook. Typically of the
2340form:
David Pursehouse05588e52015-01-07 14:25:11 +09002341+
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002342----
2343fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
2344----
2345+
2346By default unset; falls back to using scp from the canonical SSH host,
2347or curl from the canonical HTTP URL for the server. Only necessary if a
2348proxy or other server/network configuration prevents clients from
2349fetching from the default location.
2350
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07002351[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
2352+
2353Optional base URL for repositories available over the HTTP
2354protocol. For example, set this to `http://mirror.example.com/base/`
2355to have Gerrit display URLs from this server, rather than itself.
2356+
2357By default unset, as the HTTP daemon must be configured externally
2358by the system administrator, and might not even be running on the
2359same host as Gerrit.
Nasser Grainawic3b05342022-02-25 16:58:13 -07002360
Luca Milanesio2c7ff592021-02-15 23:53:09 +00002361[[gerrit.installBatchModule]]gerrit.installBatchModule::
2362+
2363Repeatable list of class name of additional Guice modules to load as
2364override to the batchInjector's modules during the init phases.
2365Classes are resolved using the primary Gerrit class loader, hence the
2366class needs to be either declared in Gerrit or an additional JAR
2367located under the `/lib` directory.
2368+
2369By default unset.
Nasser Grainawic3b05342022-02-25 16:58:13 -07002370
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002371[[gerrit.installDbModule]]gerrit.installDbModule::
2372+
2373Repeatable list of class name of additional Guice modules to load at
Luca Milanesio2c7ff592021-02-15 23:53:09 +00002374Gerrit startup as part of the dbInjector.
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002375Classes are resolved using the primary Gerrit class loader, hence the
2376class needs to be either declared in Gerrit or an additional JAR
2377located under the `/lib` directory.
2378+
2379By default unset.
2380
Luca Milanesioc336ce92021-11-16 01:10:49 +00002381[[gerrit.installIndexModule]]gerrit.installIndexModule::
2382+
2383Class name of the Guice modules to load as alternate implementation
2384for the Gerrit indexes backend.
2385Classes are resolved using the primary Gerrit class loader, hence the
2386class needs to be either declared in Gerrit or an additional JAR
2387located under the `/lib` directory.
2388+
2389NOTE: The `gerrit.installIndexModule` has precedence over the
2390`index.type`.
2391+
2392By default unset.
2393+
2394Example:
2395----
2396[gerrit]
2397 installIndexModule = com.google.gerrit.elasticsearch.ElasticIndexModule
2398----
2399+
Luca Milanesio62cc3502016-11-15 10:22:38 -08002400[[gerrit.installModule]]gerrit.installModule::
2401+
2402Repeatable list of class name of additional Guice modules to load at
Luca Milanesio2c7ff592021-02-15 23:53:09 +00002403Gerrit startup as part of the sysInjector.
Luca Milanesio62cc3502016-11-15 10:22:38 -08002404Classes are resolved using the primary Gerrit class loader, hence the
2405class needs to be either declared in Gerrit or an additional JAR
2406located under the `/lib` directory.
2407+
2408By default unset.
2409+
2410Example:
2411----
2412[gerrit]
2413 installModule = com.googlesource.gerrit.libmodule.MyModule
2414 installModule = com.example.abc.OurSpecialSauceModule
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002415 installDbModule = com.example.def.OurCustomProvider
Luca Milanesio2c7ff592021-02-15 23:53:09 +00002416 installBatchModule = com.example.ghi.CustomBatchInitModule
Luca Milanesio62cc3502016-11-15 10:22:38 -08002417----
2418
Luca Milanesio92254852019-02-14 01:33:14 +00002419[[gerrit.listProjectsFromIndex]]gerrit.listProjectsFromIndex::
2420+
2421Enable rendering of project list from the secondary index instead
2422of purely relying on the in-memory cache.
2423+
2424By default false.
2425+
2426[NOTE]
2427The in-memory cache (set to false) rendering provides an **unlimited list** as a result
2428of the list project API, causing the full list of projects to be
2429returned as a result of the link:rest-api-projects.html[/projects/] REST API
2430or the link:cmd-ls-projects.html[gerrit ls-projects] SSH command.
2431When the rendering from the secondary index (set to true),
2432the **list is limited** by the global capability
2433link:access-control.html#capability_queryLimit[queryLimit]
2434which is defaulted to 500 entries.
2435
Sven Selberge63e92d2019-01-22 18:19:19 +01002436[[gerrit.primaryWeblinkName]]gerrit.primaryWeblinkName::
2437+
2438Name of the link:dev-plugins.html#links-to-external-tools[Weblink] that should
2439be chosen in cases where only one Weblink can be used in the UI, for example in
2440inline links.
2441+
2442By default unset, meaning that the UI is responsible for trying to identify
2443a weblink to be used in these cases, most likely weblinks that links to code
2444browsers with known integrations with Gerrit (like Gitiles and Gitweb).
2445+
2446Example:
2447----
2448[gerrit]
2449 primaryWeblinkName = gitiles
2450----
2451
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002452[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
2453+
David Pursehouse214ab862014-12-01 11:48:26 +09002454URL to direct users to when they need to report a bug.
2455+
2456By default unset, meaning no bug report URL will be displayed. Administrators
2457should set this to the URL of their issue tracker, if necessary.
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002458
David Ostrovsky8e6acc92021-04-14 20:00:37 +02002459[[gerrit.enablePeerIPInReflogRecord]]gerrit.enablePeerIPInReflogRecord::
2460
2461Record actual peer IP address in ref log entry for identified user.
2462
David Ostrovsky9f200d22021-04-17 14:06:12 +02002463Defaults to false.
David Ostrovsky8e6acc92021-04-14 20:00:37 +02002464
David Pursehouse962e1182014-12-03 17:17:52 +09002465[[gerrit.secureStoreClass]]gerrit.secureStoreClass::
2466+
2467Use the secure store implementation from a specified class.
2468+
2469If specified, must be the fully qualified class name of a class that implements
2470the `com.google.gerrit.server.securestore.SecureStore` interface, and the jar
2471file containing the class must be placed in the `$site_path/lib` folder.
2472+
2473If not specified, the default no-op implementation is used.
2474
Dariusz Luksza7a046da2014-04-03 17:05:47 +02002475[[gerrit.canLoadInIFrame]]gerrit.canLoadInIFrame::
2476+
2477For security reasons Gerrit will always jump out of iframe.
2478Setting this option to true will prevent this behavior.
2479+
2480By default false.
2481
Marcin Czech559ea2b2020-06-15 17:36:18 +02002482[[gerrit.xframeOption]]gerrit.xframeOption::
2483+
2484Add link:https://tools.ietf.org/html/rfc7034[`X-Frame-Options`] header to all HTTP
2485responses. The `X-Frame-Options` HTTP response header can be used to indicate
2486whether or not a browser should be allowed to render a page in a
2487`<frame>`, `<iframe>`, `<embed>` or `<object>`.
2488+
2489Available values:
2490+
24911. ALLOW - The page can be displayed in a frame.
24922. SAMEORIGIN - The page can only be displayed in a frame on the same origin as the page itself.
2493+
2494If link:#gerrit.canLoadInIFrame is set to false this option is ignored and the
2495`X-Frame-Options` header is always set to `DENY`.
2496Setting this option to `ALLOW` will cause the `X-Frame-Options` header to be omitted
2497the the page can be displayed in a frame.
2498+
2499By default SAMEORIGIN.
2500
Wyatt Allen414659c2017-03-15 09:55:31 -07002501[[gerrit.cdnPath]]gerrit.cdnPath::
2502+
Ben Rohlfsda0a62b2021-04-26 17:02:19 +02002503Path prefix for Gerrit's static resources if using a CDN.
Wyatt Allen414659c2017-03-15 09:55:31 -07002504
Viktar Donich65ae7482017-10-20 14:13:31 -07002505[[gerrit.faviconPath]]gerrit.faviconPath::
2506+
Ben Rohlfsda0a62b2021-04-26 17:02:19 +02002507Path for Gerrit's favicon after link:#gerrit.canonicalWebUrl[default URL],
Viktar Donich65ae7482017-10-20 14:13:31 -07002508including icon name and extension (.ico should be used).
2509
Fabio Ponciroli829be0d2020-05-06 13:59:20 +02002510[[gerrit.instanceId]]gerrit.instanceId::
2511+
2512Optional identifier for this Gerrit instance.
2513Used to identify a specific instance within a group of Gerrit instances with the
2514same `serverId` (i.e.: a Gerrit cluster).
2515Unlike `instanceName` this value is not available in the email templates.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002516
2517[[gerrit.instanceName]]gerrit.instanceName::
2518+
2519Short identifier for this Gerrit instance.
2520A good name should be short but precise enough so that users can identify the instance among others.
2521+
2522Defaults to the full hostname of the Gerrit server.
2523
Luca Milanesio1a3d84f2020-05-04 17:14:12 +01002524[[gerrit.experimentalRollingUpgrade]]gerrit.experimentalRollingUpgrade::
2525+
2526Enable Gerrit rolling upgrade to the next version.
Luca Milanesioba8dfad2020-11-27 12:59:07 +00002527For example if Gerrit v3.2 is version N (All-Projects:refs/meta/version=183)
2528then its next version N+1 is v3.3 (All-Projects:refs/meta/version=184).
Luca Milanesio1a3d84f2020-05-04 17:14:12 +01002529Allow Gerrit to start even if the underlying schema version has been bumped to
2530the next Gerrit version.
2531+
2532Set to true if Gerrit is installed in
2533[high-availability configuration](https://gerrit.googlesource.com/plugins/high-availability/+/refs/heads/master/README.md)
2534during the rolling upgrade to the next version.
2535+
2536By default false.
2537+
2538The rolling upgrade process, at high level, assumes that Gerrit is installed
2539on two or more nodes sharing the repositories over NFS. The upgrade is composed
2540of the following steps:
2541+
25421. Set gerrit.experimentalRollingUpgrade to true on all Gerrit masters
25432. Set the first master unhealthy
25443. Shutdown the first master and [upgrade](install.html#init) to the next version
Luca Milanesioba8dfad2020-11-27 12:59:07 +000025454. Startup the first master, wait for the online reindex to complete (where applicable)
Luca Milanesio1a3d84f2020-05-04 17:14:12 +010025465. Verify the the first master upgrade is successful and online reindex is complete
25476. Set the first master healthy
25487. Repeat steps 2. to 6. for all the other Gerrit nodes
2549+
2550[WARNING]
2551Rolling upgrade may or may not be possible depending on the changes introduced
2552by the target version of the upgrade. Refer to the release notes and check whether
2553the rolling upgrade is possible or not and the associated constraints.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002554
Sven Selberg327c2e42018-04-10 11:42:19 +02002555[[gerrit.serverId]]gerrit.serverId::
2556+
2557Used by NoteDb to, amongst other things, identify author identities from
2558per-server specific account IDs.
2559+
2560If this value is not set on startup it is automatically set to a random UUID.
2561+
2562[NOTE]
2563If this value doesn't match the serverId used when creating an already existing
2564NoteDb, Gerrit will not be able to use that instance of NoteDb. The serverId
2565used to create the NoteDb will show in the resulting exception message in case
2566the value differs.
2567
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002568[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002569=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002570
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002571Gerrit can forward requests to either an internally managed gitweb
2572(which allows Gerrit to enforce some access controls), or to an
2573externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002574See also link:config-gitweb.html[Gitweb Integration].
2575
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002576[[gitweb.cgi]]gitweb.cgi::
2577+
2578Path to the locally installed `gitweb.cgi` executable. This CGI will
2579be called by Gerrit Code Review when the URL `/gitweb` is accessed.
2580Project level access controls are enforced prior to calling the CGI.
2581+
David Pursehousea89dc982016-09-15 09:35:44 +02002582Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if `gitweb.url` is not set.
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002583
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002584[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002585+
2586Optional URL of an affiliated gitweb service. Defines the
2587web location where a `gitweb.cgi` is installed to browse
David Pursehousea89dc982016-09-15 09:35:44 +02002588`gerrit.basePath` and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002589+
2590Gerrit appends any necessary query arguments onto the end of this URL.
David Pursehousea89dc982016-09-15 09:35:44 +02002591For example, `?p=$project.git;h=$commit`.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002592
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002593[[gitweb.type]]gitweb.type::
2594+
2595Optional type of affiliated gitweb service. This allows using
David Pursehousea66f7ff2016-09-05 21:11:10 +09002596alternatives to gitweb, such as cgit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002597+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07002598Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
David Pursehousea66f7ff2016-09-05 21:11:10 +09002599+
2600If not set, or set to `disabled`, there is no gitweb hyperlinking
2601support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002602
Edwin Kempind86909c2012-03-26 10:36:29 +02002603[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002604+
2605Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002606at a specific commit when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002607+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002608Valid replacements are `${project}` for the project name in Gerrit
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02002609and `${commit}` for the SHA-1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002610
Edwin Kempind86909c2012-03-26 10:36:29 +02002611[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002612+
2613Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002614at a specific project when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002615+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002616Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002617
Edwin Kempind86909c2012-03-26 10:36:29 +02002618[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002619+
2620Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002621at a specific branch when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002622+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002623Valid replacements are `${project}` for the project name in Gerrit
2624and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002625
Paladox none5759f2c2017-10-27 18:13:54 +00002626[[gitweb.tag]]gitweb.tag::
2627+
2628Optional pattern to use for constructing the gitweb URL when pointing
2629at a specific tag when `gitweb.type` is set to `custom`.
2630+
2631Valid replacements are `${project}` for the project name in Gerrit
2632and `${tag}` for the name of the tag.
2633
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002634[[gitweb.roottree]]gitweb.roottree::
2635+
2636Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002637at the contents of the root tree in a specific commit when `gitweb.type`
2638is set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002639+
2640Valid replacements are `${project}` for the project name in Gerrit
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02002641and `${commit}` for the SHA-1 hash for the commit.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002642
2643[[gitweb.file]]gitweb.file::
2644+
2645Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002646at the contents of a file in a specific commit when `gitweb.type` is
2647set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002648+
2649Valid replacements are `${project}` for the project name in Gerrit,
Clark Boylan77f5a062022-02-14 10:55:30 -08002650`${file}` for the file name, `${hash}` for the SHA-1 hash for the commit,
2651and `${commit}` for the change ref or SHA-1 of the commit if no base
2652patch set.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002653
Edwin Kempin64011562012-03-26 10:50:12 +02002654[[gitweb.filehistory]]gitweb.filehistory::
2655+
2656Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002657at the history of a file in a specific branch when when `gitweb.type`
2658is set to `custom`.
Edwin Kempin64011562012-03-26 10:50:12 +02002659+
2660Valid replacements are `${project}` for the project name in Gerrit,
2661`${file}` for the file name and `${branch}` for the name of the
2662branch.
2663
Gustaf Lundha07d2e72011-10-27 15:26:35 -07002664[[gitweb.linkname]]gitweb.linkname::
2665+
2666Optional setting for modifying the link name presented to the user
2667in the Gerrit web-UI.
2668+
David Pursehousea89dc982016-09-15 09:35:44 +02002669The default linkname for custom type is `gitweb`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002670
Adrian Goerlerf2007072011-11-10 08:39:55 +01002671[[gitweb.pathSeparator]]gitweb.pathSeparator::
2672+
2673Optional character to substitute the standard path separator (slash) in
2674project names and branch names.
2675+
2676By default, Gerrit will use hexadecimal encoding for slashes in project and
2677branch names. Some web servers, such as Tomcat, reject this hexadecimal
2678encoding in the URL.
2679+
Marian Harbach34253372019-12-10 18:01:31 +01002680Some alternative gitweb services, such as link:http://gitblit.com[Gitblit,role=external,window=_blank],
Adrian Goerlerf2007072011-11-10 08:39:55 +01002681allow using an alternative path separator character. In Gitblit, this can be
Marian Harbach34253372019-12-10 18:01:31 +01002682configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter,role=external,window=_blank].
Adrian Goerlerf2007072011-11-10 08:39:55 +01002683In Gerrit, the alternative path separator can be configured correspondingly
David Pursehousea89dc982016-09-15 09:35:44 +02002684using the property `gitweb.pathSeparator`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002685+
David Pursehousea89dc982016-09-15 09:35:44 +02002686Valid values are the characters `*`, `(` and `)`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002687
David Pursehouse5d592e82016-06-09 05:12:26 +00002688[[gitweb.urlEncode]]gitweb.urlEncode::
Luca Milanesio25312032013-10-11 11:34:39 +01002689+
2690Whether or not Gerrit should encode the generated viewer URL.
2691+
2692Gerrit composes the viewer URL using information about the project, branch, file
2693or commit of the target object to be displayed. Typically viewers such as CGit
David Pursehousea89dc982016-09-15 09:35:44 +02002694and gitweb do need those parts to be encoded, including the `/` in project's name,
Luca Milanesio25312032013-10-11 11:34:39 +01002695for being correctly parsed.
2696However other viewers could instead require an unencoded URL (e.g. GitHub web
David Pursehousea89dc982016-09-15 09:35:44 +02002697based viewer).
Luca Milanesio25312032013-10-11 11:34:39 +01002698+
David Pursehousea89dc982016-09-15 09:35:44 +02002699Valid values are `true` and `false`. The default is `true`.
Luca Milanesio25312032013-10-11 11:34:39 +01002700
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002701[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002702=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01002703
Patrick Hiesela0242422020-11-30 16:54:21 +01002704[[groups.includeExternalUsersInRegisteredUsersGroup]]groups.includeExternalUsersInRegisteredUsersGroup::
2705+
2706Controls whether external users (these are users we have sufficient
2707knowledge about but who don't yet have a Gerrit account) are considered
2708to be members of the `REGISTERED_USERS` group.
2709+
2710This setting only makes sense if you run custom code (e.g. from a plugin
2711or a custom authentication backend). By default, Gerrit core always requires
2712users to register and doesn't use external users.
2713+
2714By default, true.
2715
Edwin Kempin4bbff702013-01-11 09:59:53 +01002716[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
2717+
2718Controls whether newly created groups should be by default visible to
2719all registered users.
2720+
2721By default, false.
2722
Edwin Kempinf3eddd52017-01-20 14:05:47 +01002723[[groups.uuid.name]]groups.<uuid>.name::
2724+
2725Display name for group with the given UUID.
2726+
2727This option is only supported for system groups (scheme 'global').
2728+
2729E.g. this parameter can be used to configure another name for the
2730`Anonymous Users` group:
2731+
2732----
2733[groups "global:Anonymous-Users"]
2734 name = All Users
2735----
2736+
2737When setting this parameter it should be verified that there is no
2738existing group with the same name (case-insensitive). Configuring an
2739ambiguous name makes Gerrit fail on startup. Once set Gerrit ensures
2740that it is not possible to create a group with this name. Gerrit also
2741keeps the default name reserved so that it cannot be used for new
2742groups either. This means there is no danger of ambiguous group names
2743when this parameter is removed and the system group uses the default
2744name again.
2745
Prakash Aswala6d49fb2020-02-27 15:09:30 +05302746[[has-operand-alias]]
2747=== Section has operand alias
2748
2749'has' operand aliasing allows global aliases to be defined for query
2750'has' operands. Currently only change queries are supported. The alias
2751name is the git config key name, and the 'has' operand being aliased
2752is the git config value.
2753
2754For example:
2755
2756----
2757[has-operand-alias "change"]
2758 oldtopic = topic
2759----
2760
2761This section is particularly useful to alias 'has' operands (which may
2762be long and clunky as they include a plugin name in them) to shorter
2763operands without the plugin name. Admins should take care to choose
2764shorter operands that are unique and unlikely to conflict in the future.
2765
2766Aliases are resolved dynamically at invocation time to the currently
2767loaded version of plugins. If a referenced plugin is not loaded, or
2768does not define the command, "unsupported operand" is returned to the
2769user.
2770
2771Aliases will override existing 'has' operands. In case of multiple
2772aliases with same name, the last one defined will be used.
2773
2774When the target of an alias does not exist, the 'has' operand with the
2775name of the alias will be used (if present). This enables an admin to
2776configure the system to override a core 'has' operand with an operand
2777provided by a plugin when present and otherwise fall back to the 'has'
2778operand provided by core.
2779
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002780[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002781=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002782
2783[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002784+
2785URL of the proxy server when making outgoing HTTP
2786connections for OpenID login transactions. Syntax
2787should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002788
2789[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002790+
2791Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002792This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002793appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002794
2795[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002796+
2797Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002798This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002799appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002800
Hugo Arès88e33ac2014-03-03 13:52:45 -05002801[[http.addUserAsRequestAttribute]]http.addUserAsRequestAttribute::
2802+
2803If true, 'User' attribute will be added to the request attributes so it
2804can be accessed outside the request scope (will be set to username or id
2805if username not configured).
2806+
2807This attribute can be used by the servlet container to log user in the
2808http access log.
2809+
2810When running the embedded servlet container, this attribute is used to
2811print user in the httpd_log.
2812+
2813* `%{User}r`
2814+
2815Pattern to print user in Tomcat AccessLog.
2816
2817+
2818Default value is true.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002819
Gustaf Lundhe45c3332018-05-02 10:52:11 +02002820[[http.addUserAsResponseHeader]]http.addUserAsResponseHeader::
2821+
2822If true, the header 'User' will be added to the list of response headers so it
2823can be accessed from a reverse proxy for logging purposes.
2824
2825+
2826Default value is false.
2827
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002828[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002829=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002830
2831The httpd section configures the embedded servlet container.
2832
2833[[httpd.listenUrl]]httpd.listenUrl::
2834+
Gert van Dijk70e26612019-09-29 16:20:25 +02002835Configuration for the listening sockets of the internal HTTP daemon.
2836Each entry of `listenUrl` combines the following options for a
2837listening socket: protocol, network address, port and context path.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002838+
Gert van Dijk70e26612019-09-29 16:20:25 +02002839_Protocol_ can be either `http://`, `https://`, `proxy-http://` or
2840`proxy-https://`. The latter two are special forms of `http://` with
2841awareness of a reverse proxy (see below). _Network address_ selects
2842the interface and/or scope of the listening socket. For notes
2843examples, see below. _Port_ is the TCP port number and is optional
2844(default value depends on the protocol). _Context path_ is the
2845optional "base URI" for the Gerrit Code Review as application to
2846serve on.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002847+
Gert van Dijk70e26612019-09-29 16:20:25 +02002848**Protocol** schemes:
2849+
2850* `http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002851+
2852Plain-text HTTP protocol. If port is not supplied, defaults to 80,
2853the standard HTTP port.
2854+
Gert van Dijk70e26612019-09-29 16:20:25 +02002855* `https://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002856+
2857SSL encrypted HTTP protocol. If port is not supplied, defaults to
2858443, the standard HTTPS port.
2859+
Gert van Dijk70e26612019-09-29 16:20:25 +02002860For configuration of the certificate and private key, see
2861<<httpd.sslKeyStore,httpd.sslKeyStore>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002862+
Gert van Dijk70e26612019-09-29 16:20:25 +02002863[NOTE]
2864SSL/TLS configuration capabilities of Gerrit internal HTTP daemon
2865are very limited. Externally facing production sites are strongly
2866encouraged to use a reverse proxy configuration to handle SSL/TLS
2867and use a `proxy-https://` scheme here (below) for security and
2868performance reasons.
2869+
2870* `proxy-http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002871+
2872Plain-text HTTP relayed from a reverse proxy. If port is not
2873supplied, defaults to 8080.
2874+
Gert van Dijk70e26612019-09-29 16:20:25 +02002875Like `http://`, but additional header parsing features are
2876enabled to honor `X-Forwarded-For`, `X-Forwarded-Host` and
2877`X-Forwarded-Server`. These headers are typically set by Apache's
Marian Harbach34253372019-12-10 18:01:31 +01002878link: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 -08002879+
Gert van Dijk70e26612019-09-29 16:20:25 +02002880[NOTE]
2881--
2882For secruity reasons, make sure to only allow connections from a
2883trusted reverse proxy in your network, as clients could otherwise
2884easily spoof these headers and thus spoof their originating IP
2885address effectively. If the reverse proxy is running on the same
2886machine as Gerrit daemon, the use of a _loopback_ network address
2887to bind to (see below) is strongly recommended to mitigate this.
2888
2889If not using Apache's mod_proxy, validate that your reverse proxy
2890sets these headers on all requests. If not, either configure it to
2891sanitize them from the origin, or use the `http://` scheme instead.
2892--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002893+
Gert van Dijk70e26612019-09-29 16:20:25 +02002894* `proxy-https://`
2895+
2896Plain-text HTTP relayed from a reverse proxy that has already
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002897handled the SSL encryption/decryption. If port is not supplied,
2898defaults to 8080.
2899+
Gert van Dijk70e26612019-09-29 16:20:25 +02002900Behaves exactly like `proxy-http://`, but also sets the scheme to
2901assume `https://` is the proper URL back to the server.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002902
2903+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002904--
Gert van Dijk70e26612019-09-29 16:20:25 +02002905**Network address** forms:
2906
2907* Loopback (localhost): `127.0.0.1` (IPv4) or `[::1]` (IPv6).
2908* All (unspecified): `0.0.0.0` (IPv4), `[::]` (IPv6) or `*`
2909 (IPv4 and IPv6)
2910* Interface IP address, e.g. `1.2.3.4` (IPv4) or
2911 `[2001:db8::a00:20ff:fea7:ccea]` (IPv6)
2912* Hostname, resolved at startup time to an address.
2913
2914**Context path** is the local part of the URL to be used to access
2915Gerrit on ('base URL'). E.g. `/gerrit/` to serve Gerrit on that URI
2916as base. If set, consider to align this with the
2917<<gerrit.canonicalWebUrl,gerrit.canonicalWebUrl>> setting. Correct
2918settings may depend on the reverse proxy configuration as well. By
2919default, this is `/` so that Gerrit serves requests on the root.
2920
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002921If multiple values are supplied, the daemon will listen on all
2922of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002923
Gert van Dijk70e26612019-09-29 16:20:25 +02002924Examples:
2925
2926----
2927[httpd]
2928 listenUrl = proxy-https://127.0.0.1:9999/gerrit/
2929[gerrit]
2930 # Reverse proxy is configured to serve with SSL/TLS on
2931 # example.com and to relay requests on /gerrit/ onto
2932 # http://127.0.0.1:9999/gerrit/
2933 canonicalWebUrl = https://example.com/gerrit/
2934----
2935
2936----
2937[httpd]
2938 # Listen on specific external interface with plaintext
2939 # HTTP on IPv6.
2940 listenUrl = http://[2001:db8::a00:20ff:fea7:ccea]
2941
2942 # Also listen on specific internal interface for use with
2943 # reverse proxy run on another host.
2944 listenUrl = proxy-https://192.168.100.123
2945----
2946
2947See also the page on link:config-reverseproxy.html[reverse proxy]
2948configuration.
2949
2950By default, `\http://*:8080`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002951--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002952
2953[[httpd.reuseAddress]]httpd.reuseAddress::
2954+
2955If true, permits the daemon to bind to the port even if the port
2956is already in use. If false, the daemon ensures the port is not
2957in use before starting. Busy sites may need to set this to true
2958to permit fast restarts.
2959+
2960By default, true.
2961
Luca Milanesio4e2bb452018-03-21 09:07:24 +00002962[[httpd.gracefulStopTimeout]]httpd.gracefulStopTimeout::
2963+
2964Set a graceful stop time. If set, the daemon ensures that all incoming
2965calls are preserved for a maximum period of time, before starting
2966the graceful shutdown process. Sites behind a workload balancer such as
2967HAProxy would need this to be set for avoiding serving errors during
2968rolling restarts.
2969+
2970Values should use common unit suffixes to express their setting:
2971+
2972* s, sec, second, seconds
2973* m, min, minute, minutes
2974+
2975By default, 0 seconds (immediate shutdown).
2976
Thomas Meyeraa93fdf2016-10-23 10:53:48 +02002977[[httpd.inheritChannel]]httpd.inheritChannel::
2978+
2979If true, permits the daemon to inherit its server socket channel
2980from fd0/1(stdin/stdout). When set to true, the server can be socket
2981activated via systemd or xinetd.
2982+
2983By default, false.
2984
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002985[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
2986+
2987Size, in bytes, of the buffer used to parse the HTTP headers of an
2988incoming HTTP request. The entire request headers, including any
2989cookies sent by the browser, must fit within this buffer, otherwise
2990the server aborts with the response '413 Request Entity Too Large'.
2991+
2992One buffer of this size is allocated per active connection.
2993Allocating a buffer that is too large wastes memory that cannot be
2994reclaimed, allocating a buffer that is too small may cause unexpected
2995errors caused by very long Referer URLs or large cookie values.
2996+
2997By default, 16384 (16 K), which is sufficient for most OpenID and
2998other web-based single-sign-on integrations.
2999
Chulho Yangb72ff8f2013-07-04 02:35:53 -04003000[[httpd.sslCrl]]httpd.sslCrl::
3001+
3002Path of the certificate revocation list file in PEM format. This
3003crl file is optional, and available for CLIENT_SSL_CERT_LDAP
3004authentication.
3005+
3006To create and view a crl using openssl:
3007+
3008----
3009openssl ca -gencrl -out crl.pem
3010openssl crl -in crl.pem -text
3011----
3012+
3013If not absolute, the path is resolved relative to `$site_path`.
3014+
3015By default, `$site_path/etc/crl.pem`.
3016
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003017[[httpd.sslKeyStore]]httpd.sslKeyStore::
3018+
3019Path of the Java keystore containing the server's SSL certificate
3020and private key. This keystore is required for `https://` in URL.
3021+
3022To create a self-signed certificate for simple internal usage:
3023+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003024----
3025keytool -keystore keystore -alias jetty -genkey -keyalg RSA
3026chmod 600 keystore
3027----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003028+
3029If not absolute, the path is resolved relative to `$site_path`.
3030+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08003031By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003032
3033[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
3034+
3035Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09003036Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003037doesn't want to enable one.
3038+
3039If set to the empty string the embedded server will prompt for the
3040password during startup.
3041+
3042By default, `gerrit`.
3043
Shawn O. Pearce1766f502010-01-15 10:49:46 -08003044[[httpd.requestLog]]httpd.requestLog::
3045+
3046Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
3047If enabled, an NCSA combined log format request log file is written
Matthias Sohn450bc202020-08-20 14:40:32 +02003048out by the internal HTTP daemon. The httpd log format is documented
3049link:logs.html#_httpd_log[here].
Shawn O. Pearce1766f502010-01-15 10:49:46 -08003050+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01003051`log4j.appender` with the name `httpd_log` can be configured to overwrite
3052programmatic configuration.
3053+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08003054By default, true if httpd.listenUrl uses http:// or https://,
3055and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
3056
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003057[[httpd.acceptorThreads]]httpd.acceptorThreads::
3058+
3059Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09003060connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003061+
3062By default, 2, which should be suitable for most high-traffic sites.
3063
3064[[httpd.minThreads]]httpd.minThreads::
3065+
3066Minimum number of spare threads to keep in the worker thread pool.
3067This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09003068multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003069+
3070By default, 5, suitable for most lower-volume traffic sites.
3071
3072[[httpd.maxThreads]]httpd.maxThreads::
3073+
3074Maximum number of threads to permit in the worker thread pool.
3075+
3076By default 25, suitable for most lower-volume traffic sites.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02003077+
3078[NOTE]
3079Unless SSH daemon is disabled, see <<sshd.listenAddress, sshd.listenAddress>>,
3080the max number of concurrent Git requests over HTTP and SSH together is
3081defined by the <<sshd.threads, sshd.threads>> and
3082<<sshd.batchThreads, sshd.batchThreads>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003083
3084[[httpd.maxQueued]]httpd.maxQueued::
3085+
3086Maximum number of client connections which can enter the worker
3087thread pool waiting for a worker thread to become available.
David Ostrovsky14fe8bc2014-03-26 06:03:44 -070030880 sets the queue size to the Integer.MAX_VALUE.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003089+
Luca Milanesio0ae62fe2015-09-04 07:56:00 -07003090By default 200.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003091
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08003092[[httpd.maxWait]]httpd.maxWait::
3093+
David Pursehouse221d4f62012-06-08 17:38:08 +09003094Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08003095thread to handle a project clone, fetch or push request over the
3096smart HTTP transport.
3097+
3098Values should use common unit suffixes to express their setting:
3099+
3100* s, sec, second, seconds
3101* m, min, minute, minutes
3102* h, hr, hour, hours
3103* d, day, days
3104* w, week, weeks (`1 week` is treated as `7 days`)
3105* mon, month, months (`1 month` is treated as `30 days`)
3106* y, year, years (`1 year` is treated as `365 days`)
3107
3108+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003109--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08003110If a unit suffix is not specified, `minutes` is assumed. If 0
3111is supplied, the maximum age is infinite and connections will not
3112abort until the client disconnects.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003113
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08003114By default, 5 minutes.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003115--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08003116
Luca Milanesioce7b7452013-06-18 11:40:49 +01003117[[httpd.filterClass]]httpd.filterClass::
3118+
3119Class that implements the javax.servlet.Filter interface
3120for filtering any HTTP related traffic going through the Gerrit
3121HTTP protocol.
3122Class is loaded and configured in the Gerrit Jetty container
3123and run in front of all Gerrit URL handlers, allowing the filter
3124to inspect, modify, allow or reject each request.
3125It needs to be provided as JAR library
3126under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
3127loader and cannot be dynamically loaded by a plugin.
3128+
3129Failing to load the Filter class would result in a Gerrit start-up
3130failure, as this class is supposed to provide mandatory filtering
3131in front of Gerrit HTTP protocol.
3132+
David Pursehouse42f42042013-08-01 14:02:25 +09003133Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01003134of an Apache HTTP proxy layer as security enforcement on top of Gerrit
3135by returning a trusted username as HTTP Header.
3136+
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01003137Allow multiple values to install multiple servlet filters.
3138+
Luca Milanesioce7b7452013-06-18 11:40:49 +01003139Example of using a security library secure.jar under $GERRIT_SITE/lib
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01003140that provides a org.anyorg.MySecureHeaderFilter Servlet Filter that enforces
3141a trusted username in the `TRUSTED_USER` HTTP Header and
3142org.anyorg.MySecureIPFilter that performs source IP security filtering:
Dyrone Teng14fc0832019-09-27 16:59:02 +08003143+
Luca Milanesioce7b7452013-06-18 11:40:49 +01003144----
3145[auth]
3146 type = HTTP
3147 httpHeader = TRUSTED_USER
3148
Dariusz Lukszaaac01132015-02-11 12:13:07 +01003149[httpd]
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01003150 filterClass = org.anyorg.MySecureHeaderFilter
3151 filterClass = org.anyorg.MySecureIPFilter
Luca Milanesioce7b7452013-06-18 11:40:49 +01003152----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08003153
Teng Longc192ca92019-09-23 11:22:03 +08003154[[filterClass.className.initParam]]filterClass.<className>.initParam::
3155+
3156Gerrit supports customized pluggable HTTP filters as `filterClass`. This
3157option allows to pass extra initialization parameters to the filter. It
3158allows for multiple key/value pairs to be passed in this pattern:
3159+
3160----
3161initParam = <key>=<value>
3162----
3163For a comprehensive example:
3164+
3165----
3166[httpd]
3167 filterClass = org.anyorg.AFilter
3168 filterClass = org.anyorg.BFilter
3169[filterClass "org.anyorg.AFilter"]
3170 key1 = value1
3171 key2 = value2
3172[filterClass "org.anyorg.BFilter"]
3173 key3 = value3
3174----
3175
Luca Milanesiodca95d52017-05-09 21:22:21 +01003176[[httpd.idleTimeout]]httpd.idleTimeout::
3177+
3178Maximum idle time for a connection, which roughly translates to the
3179TCP socket `SO_TIMEOUT`.
3180+
Luca Milanesiodca95d52017-05-09 21:22:21 +01003181This value is interpreted as the maximum time between some progress
3182being made on the connection. So if a single byte is read or written,
3183then the timeout is reset.
3184+
David Pursehouse9f0e5bc2017-06-30 16:16:53 +09003185The max idle time is applied:
3186+
3187* When waiting for a new message to be received on a connection
3188* When waiting for a new message to be sent on a connection
3189
3190+
Luca Milanesiodca95d52017-05-09 21:22:21 +01003191By default, 30 seconds.
3192
Juan Hernandezec512562013-08-06 16:30:50 +02003193[[httpd.robotsFile]]httpd.robotsFile::
3194+
3195Location of an external robots.txt file to be used instead of the one
3196bundled with the .war of the application.
3197+
3198If not absolute, the path is resolved relative to `$site_path`.
3199+
3200If the file doesn't exist or can't be read the default robots.txt file
3201bundled with the .war will be used instead.
3202
Dariusz Luksza011cfed2014-04-03 10:23:35 +02003203[[httpd.registerMBeans]]httpd.registerMBeans::
3204+
3205Enable (or disable) registration of Jetty MBeans for Java JMX.
3206+
3207By default, false.
3208
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003209[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003210=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09003211
3212The index section configures the secondary index.
3213
David Pursehouse3fc5ee32014-03-17 18:35:32 +09003214Note that after enabling the secondary index, the index must be built
3215using the link:pgm-reindex.html[reindex program] before restarting the
3216Gerrit server.
3217
David Pursehouse6d458432013-08-23 16:17:18 +09003218[[index.type]]index.type::
3219+
Luca Milanesioc336ce92021-11-16 01:10:49 +00003220*(DEPRECATED)* The only supported value is `LUCENE`, which is the default,
3221that means a link:http://lucene.apache.org/[Lucene]
3222index is used.
David Pursehouse6d458432013-08-23 16:17:18 +09003223+
Luca Milanesioc336ce92021-11-16 01:10:49 +00003224For using other indexing backends (e.g. ElasticSearch), refer to
3225`gerrit.installIndexModule` setting.
David Pursehouse6d458432013-08-23 16:17:18 +09003226+
David Pursehouse904db302014-03-17 18:55:38 +09003227[[index.threads]]index.threads::
3228+
Hugo Arèsfab06702016-06-10 12:49:52 -04003229Number of threads to use for indexing in normal interactive operations. Setting
3230it to 0 disables the dedicated thread pool and indexing will be done in the same
3231thread as the operation.
David Pursehouse904db302014-03-17 18:55:38 +09003232+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02003233If not set or set to a zero, defaults to the number of logical CPUs as returned
3234by the JVM. If set to a negative value, defaults to a direct executor.
David Pursehouse00c82142014-01-22 17:41:09 +09003235
Dave Borowitz787af5f2014-10-22 16:26:00 -07003236[[index.batchThreads]]index.batchThreads::
3237+
3238Number of threads to use for indexing in background operations, such as
Adithya Chakilam963727c2021-11-04 10:15:43 -07003239online schema upgrades, and also the default for offline reindexing.
Dave Borowitz787af5f2014-10-22 16:26:00 -07003240+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02003241If not set or set to a zero, defaults to the number of logical CPUs as returned
3242by the JVM. If set to a negative value, defaults to a direct executor.
Dave Borowitz787af5f2014-10-22 16:26:00 -07003243
Dave Borowitzd80b9342015-03-25 10:32:21 -07003244[[index.onlineUpgrade]]index.onlineUpgrade::
3245+
3246Whether to upgrade to new index schema versions while the server is
3247running. This is recommended as it prevents additional downtime during
3248Gerrit version upgrades (avoiding the need for an offline reindex step
3249using Reindex), but can add additional server load during the upgrade.
3250+
3251If set to false, there is no way to upgrade the index schema to take
3252advantage of new search features without restarting the server.
3253+
3254Defaults to true.
3255
Kaushik Lingarkar7fdf4142022-08-17 13:57:27 -07003256[[index.paginationType]]index.paginationType::
3257+
3258The pagination type to use when index queries are repeated to
3259obtain the next set of results. Supported values are:
3260+
3261* `OFFSET`
3262+
3263Index queries are repeated with a non-zero offset to obtain the
3264next set of results.
Diego Zambelli Sessonaa0da7232023-07-10 14:22:29 +01003265_Note: Results may be inaccurate if the data-set is changing during the query
3266execution._
Kaushik Lingarkar7fdf4142022-08-17 13:57:27 -07003267+
3268* `SEARCH_AFTER`
3269+
Kaushik Lingarkar75096ad2022-09-13 10:16:15 -07003270Index queries are repeated using a search-after object. Index
3271backends can provide their custom implementations for search-after.
3272Note that, `SEARCH_AFTER` does not impact using offsets in Gerrit
3273query APIs.
Diego Zambelli Sessonaa0da7232023-07-10 14:22:29 +01003274_Note: Depending on the index backend and its settings, results may be
3275inaccurate if the data-set is changing during the query execution._
3276+
3277* `NONE`
3278+
3279Index queries are executed returning all results, without internal
3280pagination.
3281_Note: Since the entire set of indexing results is kept in memory
3282during the API execution, this option may lead to higher memory utilisation
3283and overall reduced performance.
3284Bear in mind that some indexing backends may not support unbounded queries;
3285therefore, the NONE option is unavailable._
Kaushik Lingarkar7fdf4142022-08-17 13:57:27 -07003286+
3287Defaults to `OFFSET`.
3288
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07003289[[index.maxLimit]]index.maxLimit::
3290+
3291Maximum limit to allow for search queries. Requesting results above this
3292limit will truncate the list (but will still set `_more_changes` on
3293result lists). Set to 0 for no limit.
3294+
David Pursehouse52c2b4a2018-04-10 23:38:57 +09003295When `index.type` is set to `LUCENE`, defaults to no limit.
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07003296
Dave Borowitzf56d3652015-04-22 17:35:34 -07003297[[index.maxPages]]index.maxPages::
3298+
3299Maximum number of pages of search results to allow, as index
3300implementations may have to scan through large numbers of skipped
3301results when searching with an offset. Requesting results starting past
3302this threshold times the requested limit will result in an error. Set to
33030 for no limit.
3304+
3305Defaults to no limit.
3306
Kaushik Lingarkarf84e5182022-08-12 13:27:37 -07003307[[index.pageSizeMultiplier]]index.pageSizeMultiplier::
3308+
3309When index queries are repeated to obtain more results, this multiplier
3310will be used to determine the limit for the next query. Using a page
3311multiplier allows queries to start off small and thus provide good
3312latency for queries which may end up only having very few results, and
3313then scaling up to have better throughput to handle queries with larger
3314result sets without incurring the overhead of making as many queries as
3315would be required with a smaller limit. This strategy of using a multiplier
3316attempts to create a balance between latency and throughput by dynamically
3317adjusting the query size to the number of results being returned by each
3318query in the pagination.
3319+
3320The larger the multiplier, the better the throughput on large queries, and
3321it also improves latency on large queries by scaling up quickly. However, a
3322larger multiplier can hurt latencies a bit by making the "last" query in a
3323series longer than needed. The impact of this depends on how much the backend
3324latency goes up when specifying a large limit and few results are returned.
3325Setting link:#index.maxPageSize[index.maxPageSize] that isn't too large, can
3326likely help reduce the impacts of this.
3327+
Kaushik Lingarkarf84e5182022-08-12 13:27:37 -07003328For example, if the limit of the previous query was 500 and pageSizeMultiplier
3329is configured to 5, the next query will have a limit of 2500.
3330+
Diego Zambelli Sessonaa0da7232023-07-10 14:22:29 +01003331_Note: ignored when paginationType is `NONE`_
3332+
Kaushik Lingarkarf84e5182022-08-12 13:27:37 -07003333Defaults to 1 which effectively turns this feature off.
3334
3335[[index.maxPageSize]]index.maxPageSize::
3336+
3337Maximum size to allow when index queries are repeated to obtain more results. Note
3338that, link:#index.maxLimit[index.maxLimit] will be used to limit page size if it
3339is configured to a value lower than maxPageSize.
3340+
3341For example, if the limit of previous query was 500, pageSizeMultiplier is
3342configured to 5 and maxPageSize to 2000, the next query will have a limit of
33432000 (instead of 2500).
3344+
Diego Zambelli Sessonaa0da7232023-07-10 14:22:29 +01003345_Note: ignored when paginationType is `NONE`_
3346+
Kaushik Lingarkarf84e5182022-08-12 13:27:37 -07003347Defaults to no limit.
3348
Dave Borowitzd034ca82015-10-15 11:20:30 -04003349[[index.maxTerms]]index.maxTerms::
3350+
3351Maximum number of leaf terms to allow in a query. Too-large queries may
3352perform poorly, so setting this option causes query parsing to fail fast
Dave Borowitzada289c2018-12-18 13:24:14 -08003353before attempting to send them to the secondary index.
Dave Borowitzd034ca82015-10-15 11:20:30 -04003354+
Marco Miller6da22822016-01-29 12:31:38 -05003355When the index type is `LUCENE`, also sets the maximum number of clauses
3356permitted per BooleanQuery. This is so that all enforced query limits
3357are the same.
3358+
3359Defaults to 1024.
Dave Borowitzd034ca82015-10-15 11:20:30 -04003360
Dave Borowitz3747f0f2017-06-23 14:29:31 -04003361[[index.autoReindexIfStale]]index.autoReindexIfStale::
3362+
3363Whether to automatically check if a document became stale in the index
3364immediately after indexing it. If false, there is a race condition during two
3365simultaneous writes that may cause one of the writes to not be reflected in the
3366index. The check to avoid this does consume some resources.
3367+
Dave Borowitzb7da0762018-03-19 09:08:45 -04003368Defaults to false.
Dave Borowitz3747f0f2017-06-23 14:29:31 -04003369
Edwin Kempin0f0de862018-02-08 16:24:11 +01003370[[index.scheduledIndexer]]
3371==== Subsection index.scheduledIndexer
3372
3373This section configures periodic indexing. Periodic indexing is
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003374intended to run only on replicas and only updates the group index.
3375Replication to replicas happens on Git level so that Gerrit is not aware
3376of incoming replication events. But replicas need an updated group index
Edwin Kempin0f0de862018-02-08 16:24:11 +01003377to resolve memberships of users for ACL validation. To keep the group
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003378index in replicas up-to-date the Gerrit replica periodically scans the
Edwin Kempin0f0de862018-02-08 16:24:11 +01003379group refs in the All-Users repository to reindex groups if they are
3380stale.
3381
3382The scheduled reindexer is not able to detect group deletions that
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003383happened while the replica was offline, but since group deletions are not
Edwin Kempin0f0de862018-02-08 16:24:11 +01003384supported this should never happen. If nevertheless groups refs were
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003385deleted while a replica was offline a full offline link:pgm-reindex.html[
Edwin Kempin0f0de862018-02-08 16:24:11 +01003386reindex] must be performed.
3387
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003388This section is only used if Gerrit runs in replica mode, otherwise it is
Edwin Kempin0f0de862018-02-08 16:24:11 +01003389ignored.
3390
Edwin Kempina32d4432018-02-16 17:18:31 +01003391[[index.scheduledIndexer.runOnStartup]]index.scheduledIndexer.runOnStartup::
3392+
3393Whether the scheduled indexer should run once immediately on startup.
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003394If set to `true` the replica startup is blocked until all stale groups
3395were reindexed. Enabling this allows to prevent that replicas that were
Edwin Kempina32d4432018-02-16 17:18:31 +01003396offline for a longer period of time run with outdated group information
3397until the first scheduled indexing is done.
3398+
3399Defaults to `true`.
3400
Edwin Kempin0f0de862018-02-08 16:24:11 +01003401[[index.scheduledIndexer.enabled]]index.scheduledIndexer.enabled::
3402+
3403Whether the scheduled indexer is enabled. If the scheduled indexer is
3404disabled you must implement other means to keep the group index for the
Luca Milanesio0b6d3d82021-11-13 19:48:47 -08003405replica up-to-date.
Edwin Kempin0f0de862018-02-08 16:24:11 +01003406+
3407Defaults to `true`.
3408
3409[[index.scheduledIndexer.startTime]]index.scheduledIndexer.startTime::
3410+
3411The link:#schedule-configuration-startTime[start time] for running
3412the scheduled indexer.
3413+
3414Defaults to `00:00`.
3415
3416[[index.scheduledIndexer.interval]]index.scheduledIndexer.interval::
3417+
3418The link:#schedule-configuration-interval[interval] for running
3419the scheduled indexer.
3420+
3421Defaults to `5m`.
3422
3423link:#schedule-configuration-examples[Schedule examples] can be found
3424in the link:#schedule-configuration[Schedule Configuration] section.
3425
David Pursehouse902b3ee2014-07-09 16:17:49 +09003426==== Lucene configuration
3427
3428Open and closed changes are indexed in separate indexes named
3429'open' and 'closed' respectively.
3430
3431The following settings are only used when the index type is `LUCENE`.
David Pursehouseac88c362014-02-06 12:01:34 +09003432
David Pursehouse00c82142014-01-22 17:41:09 +09003433[[index.name.ramBufferSize]]index.name.ramBufferSize::
3434+
David Pursehouse00c82142014-01-22 17:41:09 +09003435Determines the amount of RAM that may be used for buffering added documents
3436and deletions before they are flushed to the index. See the
3437link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
Marian Harbach34253372019-12-10 18:01:31 +01003438Lucene documentation,role=external,window=_blank] for further details.
David Pursehouse00c82142014-01-22 17:41:09 +09003439+
3440Defaults to 16M.
3441
3442[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
3443+
David Pursehouse00c82142014-01-22 17:41:09 +09003444Determines the minimal number of documents required before the buffered
3445in-memory documents are flushed to the index. Large values generally
3446give faster indexing. See the
3447link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
Marian Harbach34253372019-12-10 18:01:31 +01003448Lucene documentation,role=external,window=_blank] for further details.
David Pursehouse00c82142014-01-22 17:41:09 +09003449+
3450Defaults to -1, meaning no maximum is set and the writer will flush
3451according to RAM usage.
3452
Dave Borowitzd08b0452014-02-13 11:56:03 -08003453[[index.name.commitWithin]]index.name.commitWithin::
3454+
Dave Borowitzd08b0452014-02-13 11:56:03 -08003455Determines the period at which changes are automatically committed to
3456stable store on disk. This is a costly operation and may block
3457additional index writes, so lower with caution.
3458+
Bruce Zuaf058e62014-03-21 10:03:05 +08003459If zero, changes are committed after every write. This is very costly
3460but may be useful if offline reindexing is infeasible, or for development
3461servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08003462+
Bruce Zuaf058e62014-03-21 10:03:05 +08003463Values can be specified using standard time unit abbreviations (`ms`, `sec`,
3464`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07003465+
Bruce Zuaf058e62014-03-21 10:03:05 +08003466If negative, `commitWithin` is disabled. Changes are flushed to disk when
3467the in-memory buffer fills, but only committed and guaranteed to be synced
3468to disk when the process finishes.
David Pursehouse902b3ee2014-07-09 16:17:49 +09003469+
Dave Borowitzd08b0452014-02-13 11:56:03 -08003470Defaults to 300000 ms (5 minutes).
3471
Trevor Getty8fb5db52019-08-26 14:33:19 +02003472
3473[[index.name.maxMergeCount]]index.name.maxMergeCount::
3474+
3475Determines the max number of simultaneous merges that are allowed. If a merge
3476is necessary yet we already have this many threads running, the incoming thread
3477(that is calling add/updateDocument) will block until a merge thread has
3478completed. Note that Lucene will only run the smallest maxThreadCount merges
3479at a time. See the
3480link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Marian Harbach34253372019-12-10 18:01:31 +01003481Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003482+
3483Defaults to -1 for (auto detection).
3484
3485
3486[[index.name.maxThreadCount]]index.name.maxThreadCount::
3487+
3488Determines the max number of simultaneous Lucene merge threads that should be running at
3489once. This must be less than or equal to maxMergeCount. See the
3490link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Marian Harbach34253372019-12-10 18:01:31 +01003491Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003492+
3493For further details on Lucene index configuration (auto detection) which
3494affects maxThreadCount and maxMergeCount settings.
3495See the
3496link: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 +01003497Lucene documentation,role=external,window=_blank]
Trevor Getty8fb5db52019-08-26 14:33:19 +02003498+
3499Defaults to -1 for (auto detection).
3500
3501[[index.name.enableAutoIOThrottle]]index.name.enableAutoIOThrottle::
3502+
3503Allows the control of whether automatic IO throttling is enabled and used by
3504default in the lucene merge queue. Automatic dynamic IO throttling, which when
3505on is used to adaptively rate limit writes bytes/sec to the minimal rate necessary
3506so merges do not fall behind. See the
3507link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#enableAutoIOThrottle()[
Marian Harbach34253372019-12-10 18:01:31 +01003508Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003509+
3510Defaults to true (throttling enabled).
3511
Adithya Chakilam2fd651a2021-10-20 14:04:49 -05003512During offline reindexing, setting ramBufferSize greater than the size
3513of index (size of specific index folder under <site_dir>/index) and
3514maxBufferedDocs as -1 avoids unnecessary flushes and triggers only a
3515single flush at the end of the process.
3516
David Pursehouse902b3ee2014-07-09 16:17:49 +09003517Sample Lucene index configuration:
David Pursehouse00c82142014-01-22 17:41:09 +09003518----
3519[index]
3520 type = LUCENE
3521
3522[index "changes_open"]
3523 ramBufferSize = 60 m
3524 maxBufferedDocs = 3000
Trevor Getty8fb5db52019-08-26 14:33:19 +02003525 maxThreadCount = 5
3526 maxMergeCount = 50
3527
David Pursehouse00c82142014-01-22 17:41:09 +09003528
3529[index "changes_closed"]
3530 ramBufferSize = 20 m
3531 maxBufferedDocs = 500
Trevor Getty8fb5db52019-08-26 14:33:19 +02003532 maxThreadCount = 10
3533 maxMergeCount = 100
3534 enableIOThrottle = false
3535
David Pursehouse00c82142014-01-22 17:41:09 +09003536----
3537
Patrick Hieselda692472019-10-07 16:03:23 +02003538[[event]]
3539=== Section event
3540
3541[[event.payload.listChangeOptions]]events.payload.listChangeOptions::
3542+
3543List of options that Gerrit applies when rendering the payload of an
3544internal event. This is the same set of options that are documented
3545link:rest-api-changes.html#query-options[here].
3546+
3547Depending on the setup, these events might get serialized using stream
3548events.
3549+
3550This can be set to the set of minimal options that consumers of Gerrit's
Patrick Hiesela4824db2019-12-20 10:55:26 +01003551events need. A minimal set would be (`SKIP_DIFFSTAT`).
Patrick Hieselda692472019-10-07 16:03:23 +02003552+
3553Every option that gets added here will have a performance impact. The
3554general recommendation is therefore to set this to a minimal set of
3555required options.
3556+
3557Defaults to all available options minus `CHANGE_ACTIONS`,
3558`CURRENT_ACTIONS` and `CHECK`. This is a rich default to make sure the
3559config is backwards compatible with what the default was before the config
3560was added.
3561
David Ostrovsky0e4db922021-02-13 10:06:43 +01003562[[event.comment-added.publishPatchSetLevelComment]]event.comment-added.publishPatchSetLevelComment::
David Ostrovskyd14db1f2020-12-09 19:59:55 +01003563+
3564Add patch set level comment as event comment. Without this option, patch set
3565level comment will not be included in the event comment attribute. Given that
3566currently patch set level, file and robot comments are not exposed in the
3567`comment-added` event type, those comments will be lost. One particular use
3568case is to re-trigger CI build from the change screen by adding a comment with
3569specific content, e.g.: `recheck`. Jenkins Gerrit Trigger plugin and Zuul CI
3570depend on this feature to trigger change verification.
3571+
3572By default, true.
3573
Patrick Hieselbe98d8c2020-12-07 14:59:55 +01003574[[experiments]]
3575=== Section experiments
3576
Marija Savtchoukb062da32021-02-05 09:35:04 +00003577This section covers experimental new features. Gerrit uses experiments
3578to research new behavior in frontend and core backend. Once the research is done, the experimental
3579feature either stays and the experimentation flag gets removed, or the feature as a whole
Patrick Hieselbe98d8c2020-12-07 14:59:55 +01003580gets removed
3581
3582[[experiments.enabled]]experiments.enabled::
3583+
3584List of experiments that are currently enabled. The release notes contain currently
3585available experiments.
3586+
3587We will not remove experiments in stable patch releases. They are likely to be
3588removed in the next stable version.
3589
3590----
3591[experiments]
3592 enabled = ExperimentKey
3593----
Patrick Hieselda692472019-10-07 16:03:23 +02003594
Patrick Hiesel17142dc2020-12-07 15:17:24 +01003595[[experiments.disabled]]experiments.disabled::
3596+
3597List of experiments that are currently disabled. The release notes contain currently
3598available experiments. This list disables experiments with the given key that are
3599either enabled by default or explicitly in the config.
3600
3601----
3602[experiments]
3603 disabled = ExperimentKey
3604----
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003605
3606[[ldap]]
3607=== Section ldap
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003608
Luca Milanesioa05d42b2018-12-19 01:13:06 +00003609LDAP integration is only enabled if `auth.type` is set to
3610`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
3611detailed description of the `auth.type` settings and their
3612implications.
3613
3614An example LDAP configuration follows, and then discussion of
3615the parameters introduced here. Suitable defaults for most
3616parameters are automatically guessed based on the type of server
3617detected during startup. The guessed defaults support
Marian Harbach34253372019-12-10 18:01:31 +01003618link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307,role=external,window=_blank], Active
3619Directory and link:https://www.freeipa.org[FreeIPA,role=external,window=_blank].
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003620
3621----
3622[ldap]
3623 server = ldap://ldap.example.com
3624
3625 accountBase = ou=people,dc=example,dc=com
3626 accountPattern = (&(objectClass=person)(uid=${username}))
3627 accountFullName = displayName
3628 accountEmailAddress = mail
3629
3630 groupBase = ou=groups,dc=example,dc=com
3631 groupMemberPattern = (&(objectClass=group)(member=${dn}))
3632----
3633
Luca Milanesioa05d42b2018-12-19 01:13:06 +00003634[[ldap.guessRelevantGroups]]ldap.guessRelevantGroups::
3635+
3636Filter the groups found in LDAP by guessing the ones relevant to
3637Gerrit and removing the others from list completions and ACL evaluations.
3638The guess is based on two elements: the projects most recently
3639accessed in the cache and the list of LDAP groups included in their ACLs.
3640+
3641Please note that projects rarely used and thus not cached may be
3642temporarily inaccessible by users even with LDAP membership and grants
3643referenced in the ACLs.
3644+
3645By default, true.
3646
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003647[[ldap.server]]ldap.server::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003648+
3649URL of the organization's LDAP server to query for user information
3650and group membership from. Must be of the form `ldap://host` or
3651`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003652+
David Pursehouse42f42042013-08-01 14:02:25 +09003653If `auth.type` is `LDAP` this setting should use `ldaps://` to
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003654ensure the end user's plaintext password is transmitted only over
3655an encrypted connection.
Matthias Sohn1e2ec072020-10-16 13:57:11 +02003656+
3657If you want to configure multiple ldap servers you can try to put
3658multiple ldap urls separated by a space:
3659`server = ldaps://ldap1 ldaps://ldap2`
Edwin Kempin41659372023-06-21 10:08:28 +00003660See https://issues.gerritcodereview.com/issues/40010644[issue 40010644].
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003661
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003662[[ldap.startTls]]ldap.startTls::
3663+
3664If true, Gerrit will perform StartTLS extended operation.
3665+
3666By default, false, StartTLS will not be enabled.
3667
Alon Bar-Leve39c35c2019-06-10 12:59:55 +03003668[[ldap.supportAnonymous]]ldap.supportAnonymous::
3669+
3670If false, Gerrit will provide credentials only at connection open, this is
3671required for some `LDAP` implementations that do not allow anonymous bind
3672for StartTLS or for reauthentication.
3673+
3674By default, true.
3675
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003676[[ldap.sslVerify]]ldap.sslVerify::
3677+
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003678If false and ldap.server is an `ldaps://` style URL or `ldap.startTls`
3679is true, Gerrit will not verify the server certificate when it connects
3680to perform a query.
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003681+
3682By default, true, requiring the certificate to be verified.
3683
Olga Grinbergcf1b06a2015-02-03 15:54:48 -05003684[[ldap.groupsVisibleToAll]]ldap.groupsVisibleToAll::
3685+
3686If true, LDAP groups are visible to all registered users.
3687+
3688By default, false, LDAP groups are visible only to administrators and
3689group members.
3690
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003691[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003692+
3693_(Optional)_ Username to bind to the LDAP server with. If not set,
3694an anonymous connection to the LDAP server is attempted.
3695
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003696[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003697+
3698_(Optional)_ Password for the user identified by `ldap.username`.
3699If not set, an anonymous (or passwordless) connection to the LDAP
3700server is attempted.
3701
Ben Wu0410a152010-06-04 16:17:24 +08003702[[ldap.referral]]ldap.referral::
3703+
3704_(Optional)_ How an LDAP referral should be handled if it is
3705encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05003706automatically follow any referrals, or `ignore` to ignore the
3707referrals.
Ben Wu0410a152010-06-04 16:17:24 +08003708+
3709By default, `ignore`.
3710
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003711[[ldap.readTimeout]]ldap.readTimeout::
3712+
3713_(Optional)_ The read timeout for an LDAP operation. The value is
3714in the usual time-unit format like "1 s", "100 ms", etc...
3715A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09003716threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003717+
3718By default there is no timeout and Gerrit will wait for the LDAP
3719server to respond until the TCP connection times out.
3720
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003721[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003722+
3723Root of the tree containing all user accounts. This is typically
3724of the form `ou=people,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003725+
3726This setting may be added multiple times to specify more than
3727one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003728
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003729[[ldap.accountScope]]ldap.accountScope::
3730+
3731Scope of the search performed for accounts. Must be one of:
3732+
3733* `one`: Search only one level below accountBase, but not recursive
3734* `sub` or `subtree`: Search recursively below accountBase
3735* `base` or `object`: Search exactly accountBase; probably not desired
3736
3737+
3738Default is `subtree` as many directories have several levels.
3739
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003740[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003741+
3742Query pattern to use when searching for a user account. This may be
3743any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09003744`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003745`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09003746that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02003747the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003748the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003749+
3750This pattern is used to search the objects contained directly under
3751the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02003752is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003753setting depends on the LDAP schema used by the directory server.
3754+
Michal Pasierb3e262742017-01-23 12:50:48 +01003755Default is `(uid=${username})` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003756and `(&(objectClass=user)(sAMAccountName=${username}))`
3757for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003758
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003759[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003760+
3761_(Optional)_ Name of an attribute on the user account object which
3762contains the initial value for the user's full name field in Gerrit.
3763Typically this is the `displayName` property in LDAP, but could
3764also be `legalName` or `cn`.
3765+
David Pursehouse221d4f62012-06-08 17:38:08 +09003766Attribute values may be concatenated with literal strings. For
3767example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02003768`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003769+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003770If set, users will be unable to modify their full name field, as
3771Gerrit will populate it only from the LDAP data.
3772+
Michal Pasierb3e262742017-01-23 12:50:48 +01003773Default is `displayName` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003774and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003775
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003776[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003777+
3778_(Optional)_ Name of an attribute on the user account object which
3779contains the user's Internet email address, as defined by this
3780LDAP server.
3781+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003782Attribute values may be concatenated with literal strings,
3783for example to set the email address to the lowercase form
3784of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02003785`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003786+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003787If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09003788but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003789and select a different preferred email address.
3790+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003791Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003792
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003793[[ldap.accountSshUserName]]ldap.accountSshUserName::
3794+
3795_(Optional)_ Name of an attribute on the user account object which
3796contains the initial value for the user's SSH username field in
3797Gerrit. Typically this is the `uid` property in LDAP, but could
3798also be `cn`. Administrators should prefer to match the attribute
3799corresponding to the user's workstation username, as this is what
3800SSH clients will default to.
3801+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003802Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02003803an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003804force the value of sAMAccountName, if defined, to be all lowercase.
3805The suffix `.toUpperCase` can be used for the other direction.
3806The suffix `.localPart` can be used to split attribute values of
3807the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02003808example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003809+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003810If set, users will be unable to modify their SSH username field, as
David Pursehousec12da502016-08-11 20:45:03 +09003811Gerrit will populate it only from the LDAP data. Note that once the
3812username has been set it cannot be changed, therefore it is
3813recommended not to make changes to this setting that would cause the
3814value to differ, as this will prevent users from logging in.
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003815+
Michal Pasierb3e262742017-01-23 12:50:48 +01003816Default is `uid` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003817and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003818
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003819[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04003820+
3821_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003822contains the groups the user is part of. Typically used for Active
Michal Pasierb3e262742017-01-23 12:50:48 +01003823Directory and FreeIPA servers.
Anthony93de7db2009-10-03 10:01:50 -04003824+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003825Default is unset for RFC 2307 servers (disabled)
Michal Pasierb3e262742017-01-23 12:50:48 +01003826and `memberOf` for Active Directory and FreeIPA.
3827
3828[[ldap.accountMemberExpandGroups]]ldap.accountMemberExpandGroups::
3829+
3830_(Optional)_ Whether to expand nested groups recursively. This
3831setting is used only if `ldap.accountMemberField` is set.
3832+
3833Default is unset for FreeIPA and `true` for RFC 2307 servers
3834and Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04003835
Saša Živkovc81291f2015-02-04 17:19:20 +01003836[[ldap.fetchMemberOfEagerly]]ldap.fetchMemberOfEagerly::
3837+
3838_(Optional)_ Whether to fetch the `memberOf` account attribute on
3839login. Setups which use LDAP for user authentication but don't make
3840use of the LDAP groups may benefit from setting this option to `false`
3841as this will result in a much faster LDAP login.
3842+
3843Default is unset for RFC 2307 servers (disabled) and `true` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003844Active Directory and FreeIPA.
Saša Živkovc81291f2015-02-04 17:19:20 +01003845
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003846[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003847+
3848Root of the tree containing all group objects. This is typically
3849of the form `ou=groups,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003850+
3851This setting may be added multiple times to specify more than
3852one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003853
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003854[[ldap.groupScope]]ldap.groupScope::
3855+
3856Scope of the search performed for group objects. Must be one of:
3857+
3858* `one`: Search only one level below groupBase, but not recursive
3859* `sub` or `subtree`: Search recursively below groupBase
3860* `base` or `object`: Search exactly groupBase; probably not desired
3861
3862+
3863Default is `subtree` as many directories have several levels.
3864
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003865[[ldap.groupPattern]]ldap.groupPattern::
3866+
3867Query pattern used when searching for an LDAP group to connect
3868to a Gerrit group. This may be any valid LDAP query expression,
3869including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003870`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003871group owner.
3872+
Michal Pasierb3e262742017-01-23 12:50:48 +01003873Default is `(cn=${groupname})` for FreeIPA and RFC 2307 servers,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003874and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003875
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003876[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003877+
3878Query pattern to use when searching for the groups that a user
3879account is currently a member of. This may be any valid LDAP query
3880expression, including the standard `(&...)` and `(|...)` operators.
3881+
David Pursehouse42f42042013-08-01 14:02:25 +09003882If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003883replaced with a parameter set to the username that was supplied
3884by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003885such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003886corresponding attribute (in this case, `fooBarAttribute`) as read
3887from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02003888Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003889+
Scott Dial50457502013-08-11 16:52:51 -04003890Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003891RFC 2307, and unset (disabled) for Active Directory and FreeIPA.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003892
Auke Schrijnen57809132012-09-26 21:05:39 +02003893[[ldap.groupName]]ldap.groupName::
3894+
David Pursehouse39489ae2012-10-12 13:50:04 +09003895_(Optional)_ Name of the attribute on the group object which contains
3896the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02003897+
David Pursehouse39489ae2012-10-12 13:50:04 +09003898Typically the attribute name is `cn` for RFC 2307 and Active Directory
3899servers. For other servers the attribute name may differ, for example
3900`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02003901+
David Pursehouse39489ae2012-10-12 13:50:04 +09003902It is also possible to specify a literal string containing a pattern of
3903attribute values. For example to create a Gerrit group name consisting of
3904LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
3905+
3906Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02003907
Gustaf Lundhdaf41af2016-12-05 19:05:09 +01003908[[ldap.mandatoryGroup]]ldap.mandatoryGroup::
3909+
3910All users must be a member of this group to allow account creation or
3911authentication.
3912+
3913Setting mandatoryGroup implies enabling of `ldap.fetchMemberOfEagerly`
3914+
3915By default, unset.
3916
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003917[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
3918+
3919Converts the local username, that is used to login into the Gerrit
David Pursehousea1d633b2014-05-02 17:21:02 +09003920Web UI, to lower case before doing the LDAP authentication. By setting
3921this parameter to true, a case insensitive login to the Gerrit Web UI
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003922can be achieved.
3923+
3924If set, it must be ensured that the local usernames for all existing
3925accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09003926local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003927anymore. The local usernames for the existing accounts can be
3928converted to lower case by running the server program
3929link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
3930Please be aware that the conversion of the local usernames to lower
3931case can't be undone. For newly created accounts the local username
3932will be directly stored in lower case.
3933+
3934By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003935
Robin Rosenberga3baed02012-10-14 14:09:32 +02003936[[ldap.authentication]]ldap.authentication::
3937+
3938Defines how Gerrit authenticates with the server. When set to `GSSAPI`
3939Gerrit will use Kerberos. To use kerberos the
3940`java.security.auth.login.config` system property must point to a
3941login to a JAAS configuration file and, if Java 6 is used, the system
3942property `java.security.krb5.conf` must point to the appropriate
3943krb5.ini file with references to the KDC.
3944
3945Typical jaas.conf.
3946
3947----
3948KerberosLogin {
3949 com.sun.security.auth.module.Krb5LoginModule
3950 required
3951 useTicketCache=true
3952 doNotPrompt=true
3953 renewTGT=true;
3954};
3955----
3956
3957See Java documentation on how to create the krb5.ini file.
3958
3959Note the `renewTGT` property to make sure the TGT does not expire,
3960and `useTicketCache` to use the TGT supplied by the operating system. As
3961the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09003962to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02003963
3964On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
3965must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
3966have local administrator privileges.
3967
Bruce Zucd04bbc2014-07-25 15:48:09 +08003968[[ldap.useConnectionPooling]]ldap.useConnectionPooling::
3969+
3970_(Optional)_ Enable the LDAP connection pooling or not.
3971+
3972If it is true, the LDAP service provider maintains a pool of (possibly)
3973previously used connections and assigns them to a Context instance as
3974needed. When a Context instance is done with a connection (closed or
3975garbage collected), the connection is returned to the pool for future use.
3976+
3977For details, see link:http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html[
Marian Harbach34253372019-12-10 18:01:31 +01003978LDAP connection management (Pool),role=external,window=_blank] and link:http://docs.oracle.com/javase/tutorial/jndi/ldap/config.html[
3979LDAP connection management (Configuration),role=external,window=_blank]
Bruce Zucd04bbc2014-07-25 15:48:09 +08003980+
3981By default, false.
3982
3983[[ldap.connectTimeout]]ldap.connectTimeout::
3984+
Saša Živkov303701a2015-01-19 16:24:44 +01003985_(Optional)_ Timeout period for establishment of an LDAP connection.
Bruce Zucd04bbc2014-07-25 15:48:09 +08003986+
3987The value is in the usual time-unit format like "1 s", "100 ms",
3988etc...
3989+
3990By default there is no timeout and Gerrit will wait indefinitely.
3991
Saša Živkov5049f512015-01-19 17:04:43 +01003992[[ldap-connection-pooling]]
3993==== LDAP Connection Pooling
3994Once LDAP connection pooling is enabled by setting the link:#ldap.useConnectionPooling[
3995ldap.useConnectionPooling] configuration property to `true`, the connection pool
3996can be configured using JVM system properties as explained in the
3997link:http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-ldap.html#POOL[
Marian Harbach34253372019-12-10 18:01:31 +01003998Java SE Documentation,role=external,window=_blank].
Bruce Zucd04bbc2014-07-25 15:48:09 +08003999
Saša Živkov5049f512015-01-19 17:04:43 +01004000For standalone Gerrit (running with the embedded Jetty), JVM system properties
4001are specified in the link:#container[container section]:
Bruce Zucd04bbc2014-07-25 15:48:09 +08004002
Saša Živkov5049f512015-01-19 17:04:43 +01004003----
4004 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.maxsize=20
4005 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.prefsize=10
4006 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.timeout=300000
4007----
Bruce Zucd04bbc2014-07-25 15:48:09 +08004008
Saša Živkovca7a67e2015-12-01 14:25:10 +01004009[[lfs]]
4010=== Section lfs
4011
4012[[lfs.plugin]]lfs.plugin::
4013+
David Pursehouse2463c542016-08-02 16:04:58 +09004014The name of a plugin which serves the
4015link:https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md[
Marian Harbach34253372019-12-10 18:01:31 +01004016LFS protocol,role=external,window=_blank] on the `<project-name>/info/lfs/objects/batch` endpoint. When
David Pursehouse2463c542016-08-02 16:04:58 +09004017not configured Gerrit will respond with `501 Not Implemented` on LFS protocol
4018requests.
Saša Živkovca7a67e2015-12-01 14:25:10 +01004019+
4020By default unset.
4021
Gustaf Lundhaef90122015-04-27 16:48:19 +02004022[[log]]
4023=== Section log
4024
4025[[log.jsonLogging]]log.jsonLogging::
4026+
Antoine Musso9ed4b4f2020-11-17 16:52:35 +01004027If set to true, enables error, ssh and http logging in JSON format (file names:
4028`logs/error_log.json`, `logs/sshd_log.json` and `logs/httpd_log.json`).
4029+
4030The option only applies to Gerrit built-in loggers. It is ignored when a log4j
4031configuration is specified via
4032link:#container.javaOptions[container.javaOptions], for example
4033`-Dlog4j.configuration=file://etc/log4j.properties`.
Gustaf Lundhaef90122015-04-27 16:48:19 +02004034+
4035Defaults to false.
4036
4037[[log.textLogging]]log.textLogging::
4038+
4039If set to true, enables error logging in regular plain text format. Can only be disabled
4040if `jsonLogging` is enabled.
4041+
Antoine Musso9ed4b4f2020-11-17 16:52:35 +01004042The option only applies to Gerrit built-in loggers. It is ignored when a log4j
4043configuration is specified via
4044link:#container.javaOptions[container.javaOptions], for example
4045`-Dlog4j.configuration=file://etc/log4j.properties`.
4046+
Gustaf Lundhaef90122015-04-27 16:48:19 +02004047Defaults to true.
4048
David Pursehouse2281fef2017-11-21 21:27:17 +09004049[[log.compress]]log.compress::
4050+
4051If set to true, log files are compressed at server startup and then daily at 11pm
4052(in the server's local time zone).
4053+
4054Defaults to true.
4055
David Pursehouse633fff32017-11-21 22:08:12 +09004056[[log.rotate]]log.rotate::
4057+
4058If set to true, log files are rotated daily at midnight (GMT).
4059+
4060Defaults to true.
4061
Luca Milanesio4015d342022-07-13 01:26:08 +01004062[[metrics]]
4063=== Section metrics
4064
4065[[metrics.reservoir]]metrics.reservoir::
4066+
4067The type of data reservoir used by the metrics system to calculate the percentile
4068values for timers and histograms.
4069It can be set to one of the following values:
4070+
4071* ExponentiallyDecaying: An exponentially-decaying random reservoir based on
4072 Cormode et al's forward-decaying priority reservoir sampling method to produce
4073 a statistically representative sampling reservoir, exponentially biased towards
4074 newer entries.
4075* SlidingTimeWindowArray: A sliding window that stores only the measurements made
4076 in the last window using chunks of 512 samples.
4077* SlidingTimeWindow: A sliding window that stores only the measurements made in
4078 the last window using a skip list.
4079* SlidingWindow: A sliding window that stores only the last measurements.
4080* Uniform: A random sampling reservoir that uses Vitter's Algorithm R to produce
4081 a statistically representative sample.
4082+
4083Defaults to ExponentiallyDecaying.
4084
4085[[metrics.ExponentiallyDecaying.alpha]]metrics.ExponentiallyDecaying.alpha::
4086+
4087The exponential decay factor; the higher this is, the more biased the reservoir
4088will be towards newer values.
4089
4090[[metrics.reservoirType.size]]metrics.<reservoirType>.size::
4091+
4092The number of samples to keep in the reservoir. Applies to all reservoir types
4093except the sliding time-based ones.
4094+
4095Defaults to 1028.
4096
4097[[metrics.reservoirType.window]]metrics.<reservoirType>.window::
4098+
4099The window of time for keeping data in the reservoir. It only applies to sliding
4100time-based reservoir types.
4101
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004102[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004103=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07004104
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004105[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07004106+
4107If set to true, files with the MIME type `<name>` will be sent as
4108direct downloads to the user's browser, rather than being wrapped up
4109inside of zipped archives. The type name may be a complete type
Jonathan Nieder5758f182015-03-30 11:28:55 -07004110name, e.g. `image/gif`, a generic media type, e.g. `+image/*+`,
4111or the wildcard `+*/*+` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07004112+
4113By default, false for all MIME types.
4114
4115Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08004116----
4117[mimetype "image/*"]
4118 safe = true
4119
4120[mimetype "application/pdf"]
4121 safe = true
4122
4123[mimetype "application/msword"]
4124 safe = true
4125
4126[mimetype "application/vnd.ms-excel"]
4127 safe = true
4128----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07004129
Dave Borowitzbc314912017-03-21 14:23:35 -07004130[[note-db]]
4131=== Section noteDb
4132
Dave Borowitzada289c2018-12-18 13:24:14 -08004133NoteDb is the Git-based database storage backend for Gerrit. For more
4134information, including how to migrate data from an older Gerrit version, see the
4135link:note-db.html[documentation].
Dave Borowitzbc314912017-03-21 14:23:35 -07004136
Edwin Kempin5be9c312017-07-07 10:40:55 +02004137[[notedb.accounts.sequenceBatchSize]]notedb.accounts.sequenceBatchSize::
4138+
Edwin Kempin311d5702017-07-28 15:10:24 +02004139The next available account sequence number is stored as UTF-8 text in a
4140blob pointed to by the `refs/sequences/accounts` ref in the `All-Users`
Edwin Kempin5be9c312017-07-07 10:40:55 +02004141repository. Multiple processes share the same sequence by incrementing
4142the counter using normal git ref updates. To amortize the cost of these
4143ref updates, processes increment the counter by a larger number and
4144hand out numbers from that range in memory until they run out. This
4145configuration parameter controls the size of the account ID batch that
4146each process retrieves at once.
4147+
Edwin Kempin5be9c312017-07-07 10:40:55 +02004148By default, 1.
4149
David Pursehouse05eaefe2020-06-02 15:42:46 +09004150[[notedb.changes.sequenceBatchSize]]notedb.changes.sequenceBatchSize::
4151+
4152The next available change sequence number is stored as UTF-8 text in a
4153blob pointed to by the `refs/sequences/changes` ref in the `All-Projects`
4154repository. Multiple processes share the same sequence by incrementing
4155the counter using normal git ref updates. To amortize the cost of these
4156ref updates, processes increment the counter by a larger number and
4157hand out numbers from that range in memory until they run out. This
4158configuration parameter controls the size of the change ID batch that
4159each process retrieves at once.
4160+
4161By default, 20.
Han-Wen Nienhuyse5ca19c2017-11-08 13:33:33 +01004162
Michael Ochmann69813262016-01-27 17:53:55 +01004163[[oauth]]
4164=== Section oauth
4165
4166OAuth integration is only enabled if `auth.type` is set to `OAUTH`. See
4167link:#auth.type[above] for a detailed description of the `auth.type` settings
4168and their implications.
4169
4170By default, contact information, like the full name and email address,
4171is retrieved from the selected OAuth provider when a user account is created,
4172or when a user requests to reload that information in the settings UI. If
4173that is not supported by the OAuth provider, users can be allowed to edit
4174their contact information manually.
4175
4176[[oauth.allowEditFullName]]oauth.allowEditFullName::
4177+
4178If true, the full name can be edited in the contact information.
4179+
4180Default is false.
4181
4182[[oauth.allowRegisterNewEmail]]oauth.allowRegisterNewEmail::
4183+
4184If true, additional email addresses can be registered in the contact
4185information.
4186+
4187Default is false.
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07004188
Zac Livingston70a16102018-11-20 15:07:34 -07004189[[operator-alias]]
4190=== Section operator alias
4191
4192Operator aliasing allows global aliases to be defined for query operators.
4193Currently only change queries are supported. The alias name is the git
4194config key name, and the operator being aliased is the git config value.
4195
4196For example:
4197
4198----
4199[operator-alias "change"]
4200 oldage = age
4201 number = change
4202----
4203
4204This section is particularly useful to alias operator names which may be
4205long and clunky because they include a plugin name in them to a shorter
4206name without the plugin name.
4207
4208Aliases are resolved dynamically at invocation time to any currently
4209loaded versions of plugins. If the alias points to an operator provided
4210by a plugin which is not currently loaded, or the plugin does not define
4211the operator, then "unsupported operator" is returned to the user.
4212
4213Aliases will override existing operators. In the case of multiple aliases
4214with the same name, the last one defined will be used.
4215
4216When the target of an alias doesn't exist, the operator with the name
4217of the alias will be used (if present). This enables an admin to config
4218the system to override a core operator with an operator provided by a
4219plugin when present and otherwise fall back to the operator provided by
4220core.
4221
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004222[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004223=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004224
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07004225Global settings controlling how Gerrit Code Review creates pack
4226streams for Git clients running clone, fetch, or pull. Most of these
4227variables are per-client request, and thus should be carefully set
4228given the expected concurrent request load and available CPU and
4229memory resources.
4230
4231[[pack.deltacompression]]pack.deltacompression::
4232+
4233If true, delta compression between objects is enabled. This may
4234result in a smaller overall transfer for the client, but requires
4235more server memory and CPU time.
4236+
4237False (off) by default, matching Gerrit Code Review 2.1.4.
4238
4239[[pack.threads]]pack.threads::
4240+
4241Maximum number of threads to use for delta compression (if enabled).
4242This is per-client request. If set to 0 then the number of CPUs is
4243auto-detected and one thread per CPU is used, per client request.
4244+
4245By default, 1.
4246
4247
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004248[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004249=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07004250
4251[[plugins.checkFrequency]]plugins.checkFrequency::
4252+
4253How often plugins should be examined for new plugins to load, removed
4254plugins to be unloaded, or updated plugins to be reloaded. Values can
4255be specified using standard time unit abbreviations ('ms', 'sec',
4256'min', etc.).
4257+
4258If set to 0, automatic plugin reloading is disabled. Administrators
Christian Aistleitner8ce1a4e2015-06-05 01:54:15 +02004259may force reloading with link:cmd-plugin-reload.html[gerrit plugin reload].
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07004260+
4261Default is 1 minute.
4262
Shawn Pearcefd033502014-02-14 16:42:35 -08004263[[plugins.allowRemoteAdmin]]plugins.allowRemoteAdmin::
4264+
4265Enable remote installation, enable and disable of plugins over HTTP
4266and SSH. If set to true Administrators can install new plugins
4267remotely, or disable existing plugins. Defaults to false.
4268
Saša Živkov350fc682019-05-13 14:13:51 +02004269[[plugins.mandatory]]plugins.mandatory::
4270+
4271List of mandatory plugins. If a plugin from this list does not load,
David Pursehousef06aefb2019-10-18 20:39:53 +09004272Gerrit will fail to start.
4273+
4274Disabling and restarting of a mandatory plugin is rejected, but reloading
4275of a mandatory plugin is still possible.
Saša Živkov350fc682019-05-13 14:13:51 +02004276
Dariusz Luksza98f23522015-03-11 11:41:41 +01004277[[plugins.jsLoadTimeout]]plugins.jsLoadTimeout::
4278+
4279Set the timeout value for loading JavaScript plugins in Gerrit UI.
4280Values can be specified using standard time unit abbreviations ('ms',
4281'sec', 'min', etc.).
4282+
4283Default is 5 seconds. Negative values will be converted to 0.
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07004284
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004285[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004286=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004287
Dave Borowitzff243892015-08-31 15:35:28 -04004288This section is used to configure behavior of the 'receive-pack'
4289handler, which responds to 'git push' requests.
lincoln2be11602010-07-05 10:53:25 -03004290
Dave Borowitzff243892015-08-31 15:35:28 -04004291[[receive.allowGroup]]receive.allowGroup::
Dave Borowitz532342bf2015-06-18 20:28:22 -04004292+
Dave Borowitzff243892015-08-31 15:35:28 -04004293Name of the groups of users that are allowed to execute
4294'receive-pack' on the server. One or more groups can be set.
Dave Borowitz532342bf2015-06-18 20:28:22 -04004295+
Dave Borowitzff243892015-08-31 15:35:28 -04004296If no groups are added, any user will be allowed to execute
4297'receive-pack' on the server.
Dave Borowitz532342bf2015-06-18 20:28:22 -04004298
4299[[receive.certNonceSeed]]receive.certNonceSeed::
4300+
4301If set to a non-empty value and server-side signed push validation is
4302link:#receive.enableSignedPush[enabled], use this value as the seed to
4303the HMAC SHA-1 nonce generator. If unset, a 64-byte random seed will be
4304generated at server startup.
4305+
4306As this is used as the seed of a cryptographic algorithm, it is
4307recommended to be placed in link:#secure-config[`secure.config`].
4308+
4309Defaults to unset.
4310
4311[[receive.certNonceSlop]]receive.certNonceSlop::
4312+
4313When validating the nonce passed as part of the signed push protocol,
4314accept valid nonces up to this many seconds old. This allows
4315certificate verification to work over HTTP where there is a lag between
4316the HTTP response providing the nonce to sign and the next request
4317containing the signed nonce. This can be significant on large
4318repositories, since the lag also includes the time to count objects on
4319the client.
4320+
4321Default is 5 minutes.
4322
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08004323[[receive.checkMagicRefs]]receive.checkMagicRefs::
4324+
4325If true, Gerrit will verify the destination repository has
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01004326no references under the magic 'refs/for' branch namespace. Names under
4327these locations confuse clients when trying to upload code reviews so
4328Gerrit requires them to be empty.
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08004329+
4330If false Gerrit skips the sanity check and assumes administrators
4331have ensured the repository does not contain any magic references.
4332Setting to false to skip the check can decrease latency during push.
4333+
4334Default is true.
4335
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02004336[[receive.allowProjectOwnersToChangeParent]]receive.allowProjectOwnersToChangeParent::
4337+
4338If true, Gerrit will allow project owners to change the parent of a project.
4339+
4340By default only Gerrit administrators are allowed to change the parent
4341of a project. By allowing project owners to change parents, it may
4342allow the owner to circumvent certain enforced rules (like important
4343BLOCK rules).
4344+
4345Default is false.
Rikard Almgrene9221be2018-09-18 11:12:03 +02004346+
4347This value supports configuration reloads:
4348link:cmd-reload-config.html[reload-config]
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02004349
Gustaf Lundh9062fd62013-02-14 17:23:11 +01004350[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
4351+
4352If set to true, Gerrit will validate that all referenced objects that
4353are not included in the received pack are reachable by the user.
4354+
4355Carrying out this check on gits with many refs and commits can be a
4356very CPU-heavy operation. For non public Gerrit-servers this check may
4357be overkill.
4358+
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02004359Only disable this check if you trust the clients not to forge SHA-1
Gustaf Lundh9062fd62013-02-14 17:23:11 +01004360references to access commits intended to be hidden from the user.
4361+
4362Default is true.
4363
Patrick Hiesel24653be2019-10-22 09:47:32 +02004364[[receive.enableInMemoryRefCache]]receive.enableInMemoryRefCache::
4365+
4366If true, Gerrit will cache all refs advertised during push in memory and
4367base later receive operations on that cache.
4368+
4369Turning this cache off is considered experimental.
4370+
4371This cache provides value when the ref database is slow and/or does not
4372offer an inverse lookup of object ID to ref name. When RefTable is used,
4373this cache can be turned off (experimental) to get speed improvements.
4374+
4375Default is true.
4376
Dave Borowitzff243892015-08-31 15:35:28 -04004377[[receive.enableSignedPush]]receive.enableSignedPush::
lincoln2be11602010-07-05 10:53:25 -03004378+
Dave Borowitzff243892015-08-31 15:35:28 -04004379If true, server-side signed push validation is enabled.
lincoln2be11602010-07-05 10:53:25 -03004380+
Dave Borowitzff243892015-08-31 15:35:28 -04004381When a client pushes with `git push --signed`, this ensures that the
4382push certificate is valid and signed with a valid public key stored in
David Pursehouse6117a472016-07-26 08:02:49 +00004383the `refs/meta/gpg-keys` branch of `All-Users`.
Dave Borowitzff243892015-08-31 15:35:28 -04004384+
4385Defaults to false.
4386
4387[[receive.maxBatchChanges]]receive.maxBatchChanges::
4388+
4389The maximum number of changes that Gerrit allows to be pushed
4390in a batch for review. When this number is exceeded Gerrit rejects
4391the push with an error message.
4392+
4393May be overridden for certain groups by specifying a limit in the
4394link:access-control.html#capability_batchChangesLimit['Batch Changes Limit']
4395global capability.
4396+
4397This setting can be used to prevent users from uploading large
4398number of changes for review by mistake.
4399+
4400Default is zero, no limit.
lincoln2be11602010-07-05 10:53:25 -03004401
Dave Borowitz78542192017-08-31 10:45:47 -04004402[[receive.maxBatchCommits]]receive.maxBatchCommits::
4403+
4404The maximum number of commits that Gerrit allows to be pushed in a batch
4405directly to a branch when link:user-upload.html#bypass_review[bypassing review].
4406This limit can be bypassed if a user link:user-upload.html#skip_validation[skips
4407validation].
4408+
4409Default is 10000.
4410
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004411[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
4412+
4413Maximum allowed Git object size that 'receive-pack' will accept.
4414If an object is larger than the given size the pack-parsing will abort
4415and the push operation will fail. If set to zero then there is no
4416limit.
4417+
David Pursehouse221d4f62012-06-08 17:38:08 +09004418Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004419from pushing objects which are too large to Gerrit.
4420+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07004421This setting can also be set in the `project.config`
David Pursehouse2e548682018-08-01 15:12:47 +02004422(link:config-project-config.html[receive.maxObjectSizeLimit]) in order
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07004423to further reduce the global setting. The project specific setting is
4424only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02004425+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004426Default is zero.
4427+
4428Common unit suffixes of 'k', 'm', or 'g' are supported.
4429
David Pursehouse3f9c7402018-09-05 18:43:03 +09004430[[receive.inheritProjectMaxObjectSizeLimit]]receive.inheritProjectMaxObjectSizeLimit::
4431+
4432Controls whether the project-level link:config-project-config.html[`receive.maxObjectSizeLimit`]
4433value is inherited from the parent project. When `true`, the value is
4434inherited, otherwise it is not inherited.
4435+
4436Default is false, the value is not inherited.
4437
Dave Borowitz1bb49492015-08-31 15:36:59 -04004438[[receive.maxTrustDepth]]receive.maxTrustDepth::
4439+
4440If signed push validation is link:#receive.enableSignedPush[enabled],
4441set to the maximum depth to search when checking if a key is
4442link:#receive.trustedKey[trusted].
4443+
4444Default is 0, meaning only explicitly trusted keys are allowed.
4445
Dave Borowitz234734a2012-03-01 14:22:29 -08004446[[receive.threadPoolSize]]receive.threadPoolSize::
4447+
4448Maximum size of the thread pool in which the change data in received packs is
4449processed.
4450+
4451Defaults to the number of available CPUs according to the Java runtime.
4452
Dave Borowitz1c401362012-03-02 17:39:17 -08004453[[receive.timeout]]receive.timeout::
4454+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07004455Overall timeout on the time taken to process the change data in
4456received packs. Only includes the time processing Gerrit changes
4457and updating references, not the time to index the pack. Values can
4458be specified using standard time unit abbreviations ('ms', 'sec',
4459'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08004460+
Edwin Kempin66354122021-08-05 11:20:27 +02004461After the timeout is exceeded the task processing the receive gets a
4462cancellation signal that allows the tast to finish gracefully.
4463link:#receive.cancellationTimeout[receive.cancellationTimeout]
4464defines how much time the task has to react to the cancellation signal
4465before it is focefully cancelled.
4466+
Edwin Kempin77bbd8a2021-07-29 10:36:42 +02004467The receive timeout cannot be overriden by setting a higher
Fabio Ponciroli03f23d62021-10-20 09:15:48 +02004468link:user-upload.html#deadline[deadline] on the git push request.
Edwin Kempin77bbd8a2021-07-29 10:36:42 +02004469+
Dariusz Lukszade482b02015-11-09 18:25:04 +01004470Default is 4 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07004471is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08004472
Edwin Kempin66354122021-08-05 11:20:27 +02004473[[receive.cancellationTimeout]]receive.cancellationTimeout::
4474+
4475Defines the time that a receive task has to react to a cancellation
4476signal and finish gracefully after link:#receive.timeout[receive.timeout]
4477is exceeded. If the receive task is still not terminated after the
4478cancellation timeout is exceeded the task is forcefully cancelled.
4479Values can be specified using standard time unit abbreviations ('ms',
4480'sec', 'min', etc.).
4481+
4482Default is 5 seconds. If no unit is specified, milliseconds is assumed.
4483
Dave Borowitz1bb49492015-08-31 15:36:59 -04004484[[receive.trustedKey]]receive.trustedKey::
4485+
4486List of GPG key fingerprints that should be considered trust roots by
4487the server when signed push validation is
4488link:#receive.enableSignedPush[enabled]. A key is trusted by the server
4489if it is either in this list, or a path of trust signatures leads from
4490the key to a configured trust root. The maximum length of the path is
4491determined by link:#receive.maxTrustDepth[`receive.maxTrustDepth`].
4492+
4493Key fingerprints can be displayed with `gpg --list-keys
4494--with-fingerprint`.
4495+
4496Trust signatures can be added to a key using the `tsign` command to
4497link:https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html[
Marian Harbach34253372019-12-10 18:01:31 +01004498`gpg --edit-key`,role=external,window=_blank], after which the signed key should be re-uploaded.
Dave Borowitz1bb49492015-08-31 15:36:59 -04004499+
4500If no keys are specified, web-of-trust checks are disabled. This is the
4501default behavior.
4502
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004503[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004504=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004505
Hugo Josefson072b4702010-04-21 19:27:11 +02004506Repositories in this sense are the same as projects.
4507
Shawn O. Pearce897d9212011-06-16 16:59:59 -07004508In the following example configuration `Registered Users` is set
4509to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02004510
4511----
4512[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02004513 ownerGroup = Registered Users
4514----
4515
Hugo Arès7d2b9422014-11-25 15:33:42 -05004516The only matching patterns supported are exact match or wildcard matching which
4517can be specified by ending the name with a `*`. If a project matches more than one
4518repository configuration, then the configuration from the more precise match
4519will be used. In the following example, the default submit type for a project
4520named `project/plugins/a` would be `CHERRY_PICK`.
4521
4522----
4523[repository "project/*"]
4524 defaultSubmitType = MERGE_IF_NECESSARY
4525[repository "project/plugins/*"]
4526 defaultSubmitType = CHERRY_PICK
4527----
4528
Michael Ochmann8129ece2016-07-08 11:25:25 +02004529[NOTE]
4530All properties are used from the matching repository configuration. In
Hugo Arès7d2b9422014-11-25 15:33:42 -05004531the previous example, all properties will be used from `project/plugins/\*`
4532section and no properties will be inherited nor overridden from `project/*`.
Hugo Josefson072b4702010-04-21 19:27:11 +02004533
Hugo Arès218bb3b2015-04-22 15:05:14 -04004534[[repository.name.basePath]]repository.<name>.basePath::
4535+
4536Alternate to <<gerrit.basePath,gerrit.basePath>>. The repository will be created
4537and used from this location instead: ${alternateBasePath}/${projectName}.git.
4538+
4539If configuring the basePath for an existing project in gerrit, make sure to stop
4540gerrit, move the repository in the alternate basePath, configure basePath for
4541this repository and then start Gerrit.
4542+
4543Path must be absolute.
4544
Edwin Kempina79ea552013-11-19 11:24:37 +01004545[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
4546+
4547The default submit type for newly created projects. Supported values
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004548are `INHERIT`, `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02004549`REBASE_ALWAYS`, `MERGE_ALWAYS` and `CHERRY_PICK`.
4550+
Changcheng Xiao21885982019-01-15 18:16:51 +01004551For more details see link:config-project-config.html#submit-type[Submit Types].
Edwin Kempina79ea552013-11-19 11:24:37 +01004552+
Changcheng Xiao21885982019-01-15 18:16:51 +01004553Default is link:config-project-config.html#submit_type_inherit[`INHERIT`].
Dave Borowitzcad4d262018-01-22 10:02:22 -05004554+
Dave Borowitz03e51742018-01-09 07:57:01 -05004555This submit type is only applied at project creation time if a submit type is
4556omitted from the link:rest-api-projects.html#project-input[ProjectInput]. If the
Dave Borowitzcad4d262018-01-22 10:02:22 -05004557submit type is unset in the project config at runtime, for backwards
4558compatibility purposes, it defaults to
4559link:project-configuration.html#merge_if_necessary[`MERGE_IF_NECESSARY`] rather
4560than `INHERIT`.
Edwin Kempina79ea552013-11-19 11:24:37 +01004561
Hugo Josefson072b4702010-04-21 19:27:11 +02004562[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
4563+
Nasser Grainawi8ea9fec2022-02-25 17:38:10 -07004564A name of a link:config-groups.html[group] which exists. Zero, one or many
4565groups are allowed. Each on its own line. Groups which don't exist are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02004566
Edwin Kempin22687fa2018-01-22 11:55:07 +01004567[[retry]]
4568=== Section retry
4569
4570[[retry.maxWait]]retry.maxWait::
4571+
4572Maximum time to wait between attempts to retry an operations when one attempt
4573fails (e.g. on NoteDb updates due to contention, aka lock failure, on the
4574underlying ref storage). Operations are retried with exponential backoff, plus
4575some random jitter, until the interval reaches this limit. After that, retries
4576continue to occur after a fixed timeout (plus jitter), up to
4577link:#retry.timeout[`retry.timeout`].
4578+
4579Defaults to 5 seconds; unit suffixes are supported, and assumes milliseconds if
4580not specified.
4581
4582[[retry.timeout]]retry.timeout::
4583+
4584Total timeout for retrying operations when one attempt fails.
4585+
4586It is possible to overwrite this default timeout based on operation types by
4587setting link:#retry.operationType.timeout[`retry.<operationType>.timeout`].
4588+
4589Defaults to 20 seconds; unit suffixes are supported, and assumes milliseconds if
4590not specified.
4591
4592[[retry.operationType.timeout]]retry.<operationType>.timeout::
4593+
4594Total timeout for retrying operations of type `<operationType>` when one
4595attempt fails. `<operationType>` can be `ACCOUNT_UPDATE`, `CHANGE_UPDATE`,
4596`GROUP_UPDATE` and `INDEX_QUERY`.
4597+
4598Defaults to link:#retry.timeout[`retry.timeout`]; unit suffixes are supported,
4599and assumes milliseconds if not specified.
4600
Edwin Kempindd837ae2019-06-18 11:42:14 +02004601[[retry.retryWithTraceOnFailure]]retry.retryWithTraceOnFailure::
4602+
4603Whether Gerrit should automatically retry operations on failure with tracing
Edwin Kempinf7e03072021-09-14 09:00:16 +02004604enabled. The automatically generated traces can help with debugging.
Edwin Kempindd837ae2019-06-18 11:42:14 +02004605+
4606By default this is set to false.
4607
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004608[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004609=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004610
4611[[rules.enable]]rules.enable::
4612+
Matt Baker8ce12fc2013-11-26 21:43:12 -07004613If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004614project's refs/meta/config branch, if present. When set to false,
4615only the default internal rules will be used.
4616+
4617Default is true, to execute project specific rules.
4618
Shawn Pearceed001d72014-12-17 14:25:55 -08004619[[rules.reductionLimit]]rules.reductionLimit::
4620+
4621Maximum number of Prolog reductions that can be performed when
4622evaluating rules for a single change. Each function call made
4623in user rule code, internal Gerrit Prolog code, or the Prolog
4624interpreter counts against this limit.
4625+
4626Sites using very complex rules that need many reductions should
4627compile Prolog to Java bytecode with link:pgm-rulec.html[rulec].
4628This eliminates the dynamic Prolog interpreter from charging its
4629own reductions against the limit, enabling more logic to execute
4630within the same bounds.
4631+
4632A reductionLimit of 0 is nearly infinite, implemented by setting
4633the internal limit to 2^31-1.
4634+
4635Default is 100,000 reductions (about 14 ms on Intel Core i7 CPU).
4636
4637[[rules.compileReductionLimit]]rules.compileReductionLimit::
4638+
4639Maximum number of Prolog reductions that can be performed when
4640compiling source code to internal Prolog machine code.
4641+
4642Default is 10x reductionLimit (1,000,000).
4643
Shawn Pearcea2b98522015-11-21 09:47:32 -08004644[[rules.maxSourceBytes]]rules.maxSourceBytes::
4645+
4646Maximum input size (in bytes) of a Prolog rules.pl file. Larger
4647source files may need a larger rules.compileReductionLimit. Consider
4648using link:pgm-rulec.html[rulec] to precompile larger rule files.
4649+
4650A size of 0 bytes disables rules, same as rules.enable = false.
4651+
David Pursehouse0c1dadf2015-11-24 09:14:21 +00004652Common unit suffixes of 'k', 'm', or 'g' are supported.
4653+
Shawn Pearcea2b98522015-11-21 09:47:32 -08004654Default is 128 KiB.
4655
4656[[rules.maxPrologDatabaseSize]]rules.maxPrologDatabaseSize::
4657+
4658Number of predicate clauses allowed to be defined in the Prolog
4659database by project rules. Very complex rules may need more than the
4660default 256 limit, but cost more memory and may need more time to
4661evaluate. Consider using link:pgm-rulec.html[rulec] to precompile
4662larger rule files.
4663+
4664Default is 256.
4665
David Pursehouse511a35b2014-04-04 10:27:13 +09004666[[execution]]
4667=== Section execution
Bruce Zua7e34312014-04-01 17:35:41 +08004668
4669[[execution.defaultThreadPoolSize]]execution.defaultThreadPoolSize::
4670+
4671The default size of the background execution thread pool in
4672which miscellaneous tasks are handled.
4673+
Jacek Centkowskice5510d2019-11-13 16:27:25 -08004674Default and minimum is 2 so that a single, potentially longer executing
4675task (e.g. GC), is not blocking the entire execution.
Bruce Zua7e34312014-04-01 17:35:41 +08004676
Patrick Hiesel2ed39822018-04-16 12:04:02 +02004677[[execution.fanOutThreadPoolSize]]execution.fanOutThreadPoolSize::
4678+
4679Maximum size of thread pool to on which a serving thread can fan-out
4680work to parallelize it.
4681+
4682When set to 0, a direct executor will be used.
4683+
4684By default, 25 which means that formatting happens in the caller thread.
4685
Patrick Hiesel328b7612016-10-21 16:43:13 +02004686[[receiveemail]]
4687=== Section receiveemail
4688
4689[[receiveemail.protocol]]receiveemail.protocol::
4690+
4691Specifies the protocol used for receiving emails. Valid options are
4692'POP3', 'IMAP' and 'NONE'. Note that Gerrit will automatically switch between
4693POP3 and POP3s as well as IMAP and IMAPS depending on the specified
4694link:#receiveemail.encryption[encryption].
4695+
4696Defaults to 'NONE' which means that receiving emails is disabled.
4697
4698[[receiveemail.host]]receiveemail.host::
4699+
4700The hostname of the mailserver. Example: 'imap.gmail.com'.
4701+
4702Defaults to an empty string which means that receiving emails is disabled.
4703
4704[[receiveemail.port]]receiveemail.port::
4705+
David Pursehouse4b067752017-03-03 15:54:53 +09004706The port the email server exposes for receiving emails.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004707+
4708Defaults to the industry standard for a given protocol and encryption:
David Pursehouse34907442017-04-04 09:55:38 +09004709POP3: 110; POP3S: 995; IMAP: 143; IMAPS: 993.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004710
4711[[receiveemail.username]]receiveemail.username::
4712+
4713Username used for authenticating with the email server.
4714+
4715Defaults to an empty string.
4716
4717[[receiveemail.password]]receiveemail.password::
4718+
4719Password used for authenticating with the email server.
4720+
4721Defaults to an empty string.
4722
4723[[receiveemail.encryption]]receiveemail.encryption::
4724+
4725Encryption standard used for transport layer security between Gerrit and the
4726email server. Possible values include 'NONE', 'SSL' and 'TLS'.
4727+
4728Defaults to 'NONE'.
4729
4730[[receiveemail.fetchInterval]]receiveemail.fetchInterval::
4731+
4732Time between two consecutive fetches from the email server. Communication with
4733the email server is not kept alive. Examples: 60s, 10m, 1h.
4734+
4735Defaults to 60 seconds.
4736
4737[[receiveemail.enableImapIdle]]receiveemail.enableImapIdle::
4738+
4739If the IMAP protocol is used for retrieving emails, IMAPv4 IDLE can be used to
4740keep the connection with the email server alive and receive a push when a new
4741email is delivered to the inbox. In this case, Gerrit will process the email
4742immediately and will not have a fetch delay.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004743+
4744Defaults to false.
4745
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004746[[receiveemail.filter.mode]]receiveemail.filter.mode::
4747+
Gal Paikin166e4432020-09-22 19:09:45 +03004748An allow and block filter to filter incoming emails.
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004749+
4750If `OFF`, emails are not filtered by the list filter.
4751+
Gal Paikin166e4432020-09-22 19:09:45 +03004752If `ALLOW`, only emails where a pattern from
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004753<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4754matches 'From' will be processed.
4755+
Gal Paikin166e4432020-09-22 19:09:45 +03004756If `BLOCK`, only emails where no pattern from
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004757<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4758matches 'From' will be processed.
4759+
4760Defaults to `OFF`.
Gal Paikin166e4432020-09-22 19:09:45 +03004761+
4762The previous filter-names 'BLACKLIST' and 'WHITELIST' have been deprecated
4763since they may be considered disrespectful and there's no technical or
4764practical reason to use these exact terms for the filters.
4765For backwards compatibility they are still supported but support for these
4766deprecated terms will be removed in future releases.
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004767
4768[[receiveemail.filter.patterns]]receiveemail.filter.patterns::
4769+
4770A list of regular expressions to match the email sender against. This can also
4771be a list of addresses when regular expression characters are escaped.
4772
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004773[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004774=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004775
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004776[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07004777+
4778If false Gerrit will not send email messages, for any reason,
4779and all other properties of section sendemail are ignored.
4780+
4781By default, true, allowing notifications to be sent.
4782
Jonathan Niederdabd8c22016-09-20 14:10:11 -07004783[[sendemail.html]]sendemail.html::
4784+
4785If false, Gerrit will only send plain-text emails.
4786If true, Gerrit will send multi-part emails with an HTML and
4787plain text part.
4788+
4789By default, true, allowing HTML in the emails Gerrit sends.
4790
Bruce Zua7e34312014-04-01 17:35:41 +08004791[[sendemail.connectTimeout]]sendemail.connectTimeout::
4792+
4793The connection timeout of opening a socket connected to a
4794remote SMTP server.
4795+
4796Values can be specified using standard time unit abbreviations
4797('ms', 'sec', 'min', etc.).
4798If no unit is specified, milliseconds is assumed.
4799+
4800Default is 0. A timeout of zero is interpreted as an infinite
4801timeout. The connection will then block until established or
4802an error occurs.
4803
4804[[sendemail.threadPoolSize]]sendemail.threadPoolSize::
Alice Kober-Sotzekda0559e2020-09-18 09:25:15 +00004805+
4806Maximum size of thread pool in which the review comments
4807notifications are sent out asynchronously.
4808+
4809By default, 1.
Bruce Zua7e34312014-04-01 17:35:41 +08004810
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004811[[sendemail.from]]sendemail.from::
4812+
4813Designates what name and address Gerrit will place in the From
4814field of any generated email messages. The supported values are:
4815+
4816* `USER`
4817+
4818Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09004819Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004820classified as spam if the user's domain has SPF or DKIM enabled
4821and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
Zhen Chenae765aa2016-08-08 15:49:44 -07004822relay for that domain. You can specify
4823<<sendemail.allowedDomain,sendemail.allowedDomain>> to instruct Gerrit to only
4824send as USER if USER is from those domains.
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004825+
4826* `MIXED`
4827+
Edwin Kempincdb0e002011-09-08 14:23:30 +02004828Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004829`review@example.com` is the same as <<user.email,user.email>>.
4830See below for a description of how the replacement is handled.
4831+
4832* `SERVER`
4833+
4834Gerrit will set the From header to the same name and address
4835it records in any commits Gerrit creates. This is set by
4836<<user.name,user.name>> and <<user.email,user.email>>, or guessed
4837from the local operating system.
4838+
Edwin Kempinebfbbac2015-07-01 16:02:39 +02004839* `Code Review <review@example.com>`
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004840+
4841If set to a name and email address in brackets, Gerrit will use
4842this name and email address for any messages, overriding the name
4843that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02004844Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004845which is replaced by the Full Name of the current user.
4846
4847+
4848By default, MIXED.
4849
Zhen Chenae765aa2016-08-08 15:49:44 -07004850[[sendemail.allowedDomain]]sendemail.allowedDomain::
4851+
4852Only used when `sendemail.from` is set to `USER`.
4853List of allowed domains. If user's email matches one of the domains, emails will
4854be sent as USER, otherwise as MIXED mode. Wildcards may be specified by
Maxime Guerreiroebac2d42018-03-21 13:54:51 +01004855including `\*` to match any number of characters, for example `*.example.com`
Zhen Chenae765aa2016-08-08 15:49:44 -07004856matches any subdomain of `example.com`.
4857+
4858By default, `*`.
4859
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004860[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004861+
4862Hostname (or IP address) of a SMTP server that will relay
4863messages generated by Gerrit to end users.
4864+
4865By default, 127.0.0.1 (aka localhost).
4866
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004867[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004868+
4869Port number of the SMTP server in sendemail.smtpserver.
4870+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08004871By default, 25, or 465 if smtpEncryption is 'ssl'.
4872
4873[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
4874+
4875Specify the encryption to use, either 'ssl' or 'tls'.
4876+
4877By default, 'none', indicating no encryption is used.
4878
4879[[sendemail.sslVerify]]sendemail.sslVerify::
4880+
4881If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
4882will not verify the server certificate when it connects to send
4883an email message.
4884+
4885By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004886
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004887[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004888+
4889User name to authenticate with, if required for relay.
4890
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004891[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004892+
4893Password for the account named by sendemail.smtpUser.
4894
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004895[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004896+
Gal Paikin166e4432020-09-22 19:09:45 +03004897If present, each value adds one entry to the list of allowed email
4898addresses that Gerrit can send emails to. If set to a complete
4899email address, that one address is added to the list of allowed
4900emails.
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004901If set to a domain name, any address at that domain can receive
4902email from Gerrit.
4903+
Rikard Almgren5b9de1c2019-03-12 17:55:16 +01004904If allowrcpt is configured, The set of allowed recipients is:
4905`allowrcpt - denyrcpt`.
4906+
4907By default, unset, permitting delivery to any email address.
4908
4909[[sendemail.denyrcpt]]sendemail.denyrcpt::
4910+
Gal Paikin166e4432020-09-22 19:09:45 +03004911If present, each value adds one entry to the list of email
4912addresses that Gerrit can't send emails to. If set to a complete
4913email address, that one address is added to the list of blocked
4914emails.
Rikard Almgren5b9de1c2019-03-12 17:55:16 +01004915If set to a domain name, any address at that domain can *not* receive
4916email from Gerrit.
4917+
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004918By default, unset, permitting delivery to any email address.
4919
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004920[[sendemail.includeDiff]]sendemail.includeDiff::
4921+
Bruce Zueb00ff32012-11-27 17:38:10 +08004922If true, new change emails and merged change emails from Gerrit
4923will include the complete unified diff of the change.
4924Variable maxmimumDiffSize places an upper limit on how large the
4925email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004926+
4927By default, false.
4928
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07004929[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
4930+
4931Largest size of unified diff output to include in an email. When
4932the diff exceeds this size the file paths will be listed instead.
4933Standard byte unit suffixes are supported.
4934+
4935By default, 256 KiB.
4936
Alex Blewitt9cca7402011-02-11 01:39:30 +00004937[[sendemail.importance]]sendemail.importance::
4938+
4939If present, emails sent from Gerrit will have the given level
4940of importance. Valid values include 'high' and 'low', which
4941email clients will render in different ways.
4942+
4943By default, unset, so no Importance header is generated.
4944
4945[[sendemail.expiryDays]]sendemail.expiryDays::
4946+
4947If present, emails sent from Gerrit will expire after the given
4948number of days. This will add the Expiry-Date header and
4949email clients may expire or expunge mails whose Expiry-Date
4950header is in the past. This should be a positive non-zero
4951number indicating how many days in the future the mails
4952should expire.
4953+
4954By default, unset, so no Expiry-Date header is generated.
4955
Patrick Hiesel31d60f02017-02-09 17:38:40 +01004956[[sendemail.replyToAddress]]sendemail.replyToAddress::
4957+
4958A custom Reply-To address should only be provided if Gerrit is set up to
4959receive emails and the inbound address differs from
4960<<sendemail.from,sendemail.from>>.
4961It will be set as Reply-To header on all types of outgoing email where
4962Gerrit can parse back a user's reply.
4963+
4964Defaults to an empty string which adds <<sendemail.from,sendemail.from>> as
4965Reply-To if inbound email is enabled and the review's author otherwise.
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004966
David Pursehouse917b7262017-04-21 18:18:52 +02004967[[sendemail.allowTLD]]sendemail.allowTLD::
4968+
4969List of custom TLDs to allow sending emails to in addition to those specified
Marian Harbach34253372019-12-10 18:01:31 +01004970in the link:http://data.iana.org/TLD/[IANA list,role=external,window=_blank].
David Pursehouse917b7262017-04-21 18:18:52 +02004971+
4972Defaults to an empty list, meaning no additional TLDs are allowed.
4973
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004974
4975[[sendemail.addInstanceNameInSubject]]sendemail.addInstanceNameInSubject::
4976+
4977When set to true, Gerrit will add its short name to the email subject, allowing recipients to quickly identify
4978what Gerrit instance the email came from.
4979+
4980The short name can be customized via the gerrit.instanceName option.
4981+
Luca Milanesiofdfca772018-04-04 23:42:32 +01004982Defaults to false.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004983
4984
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004985[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004986=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004987
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004988[[site.allowOriginRegex]]site.allowOriginRegex::
4989+
4990List of regular expressions matching origins that should be permitted
Shawn Pearce53ebad42017-06-10 11:14:20 -07004991to use the full Gerrit REST API. These should be trusted applications,
4992as the sites may be able to use the user's credentials. Applies to
4993all requests, including state changing methods (PUT, DELETE, POST).
4994+
4995Expressions should not require trailing slash. For example a valid
4996pattern might be `https://build-status[.]example[.]com`.
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004997+
4998By default, unset, denying all cross-origin requests.
4999
Shawn O. Pearcedba97642011-09-07 20:12:31 -07005000[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
5001+
5002If true the server checks the site header, footer and CSS files for
5003updated versions. If false, a server restart is required to change
5004any of these resources. Default is true, allowing automatic reloads.
5005
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005006[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005007=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07005008
5009Variables in section ssh-alias permit the site administrator to alias
5010another command from Gerrit or a plugin into the `gerrit` command
5011namespace. To alias `replication start` to `gerrit replicate`:
5012
5013----
5014[ssh-alias]
5015 replicate = replication start
5016----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07005017
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005018[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005019=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07005020
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02005021[[sshd.enableCompression]]sshd.enableCompression::
5022+
5023In the general case, we want to disable transparent compression, since
5024the majority of our data transfer is highly compressed Git pack files
5025and we cannot make them any smaller than they already are.
5026+
5027However, if there are CPU in abundance and the server is reachable
5028through slow networks, gits with huge amount of refs can benefit from
5029SSH-compression since git does not compress the ref announcement during
5030handshake.
5031+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02005032Compression can be especially useful when Gerrit replicas are being used
Matthias Sohnd8182ba2019-12-09 14:50:23 +01005033for the larger clones and fetches and the primary server mostly takes
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02005034small receive-packs.
5035+
5036By default, `false`.
5037
David Ostrovskye2921b62015-03-04 22:36:10 +01005038[[sshd.backend]]sshd.backend::
5039+
5040Starting from version 0.9.0 Apache SSHD project added support for NIO2
Orgad Shanehb7bb7352019-09-19 10:26:19 +03005041IoSession. To use the old MINA session the `backend` option must be set
5042to `MINA`.
David Ostrovskye2921b62015-03-04 22:36:10 +01005043+
Luca Milanesiofc1ed9c2016-03-01 18:28:36 +00005044By default, `NIO2`.
David Ostrovskye2921b62015-03-04 22:36:10 +01005045
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005046[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07005047+
5048Specifies the local addresses the internal SSHD should listen
5049for connections on. The following forms may be used to specify
5050an address. In any form, `:'port'` may be omitted to use the
David Pursehousea3af2552016-08-02 14:04:44 +09005051default of `29418`.
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07005052+
David Pursehousea3af2552016-08-02 14:04:44 +09005053* `'hostname':'port'` (for example `review.example.com:29418`)
5054* `'IPv4':'port'` (for example `10.0.0.1:29418`)
5055* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
5056* `+*:'port'+` (for example `+*:29418+`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07005057
5058+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005059--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07005060If multiple values are supplied, the daemon will listen on all
5061of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005062
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07005063To disable the internal SSHD, set listenAddress to `off`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005064
David Pursehousea3af2552016-08-02 14:04:44 +09005065By default, `*:29418`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005066--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07005067
James Y Knight910bd862011-01-11 20:05:56 -05005068[[sshd.advertisedAddress]]sshd.advertisedAddress::
5069+
5070Specifies the addresses clients should be told to connect to.
5071This may differ from sshd.listenAddress if a firewall based port
5072redirector is being used, making Gerrit appear to answer on port
507322. The following forms may be used to specify an address. In any
5074form, `:'port'` may be omitted to use the default SSH port of 22.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005075
David Pursehousea3af2552016-08-02 14:04:44 +09005076* `'hostname':'port'` (for example `review.example.com:22`)
5077* `'IPv4':'port'` (for example `10.0.0.1:29418`)
5078* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
James Y Knight910bd862011-01-11 20:05:56 -05005079
5080+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005081--
James Y Knight910bd862011-01-11 20:05:56 -05005082If multiple values are supplied, the daemon will advertise all
5083of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005084
David Pursehousea3af2552016-08-02 14:04:44 +09005085By default uses the value of `sshd.listenAddress`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02005086--
James Y Knight910bd862011-01-11 20:05:56 -05005087
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005088[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07005089+
5090If true, enables TCP keepalive messages to the other side, so
5091the daemon can terminate connections if the peer disappears.
5092+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02005093Only effective when `sshd.backend` is set to `MINA`.
5094+
David Pursehousea3af2552016-08-02 14:04:44 +09005095By default, `true`.
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07005096
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08005097[[sshd.threads]]sshd.threads::
5098+
5099Number of threads to use when executing SSH command requests.
5100If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09005101are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08005102+
Florian Klink2a389462019-07-23 14:14:32 +02005103By default, 2x the number of CPUs available to the JVM (but at least 4
5104threads).
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02005105+
5106[NOTE]
5107When SSH daemon is enabled then this setting also defines the max number of
5108concurrent Git requests for interactive users over SSH and HTTP together.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08005109
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005110[[sshd.batchThreads]]sshd.batchThreads::
5111+
5112Number of threads to allocate for SSH command requests from
Patrick Hiesele587c402020-08-07 16:11:29 +02005113link:access-control.html#service_users[service users].
Fredrik Luthander46843022012-03-13 16:11:02 +01005114If equals to 0, then all non-interactive requests are executed in the same
5115queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005116+
5117Any other value will remove the number of threads from the queue
5118allocated to interactive users, and create a separate thread pool
5119of the requested size, which will be used to run commands from
Patrick Hiesele587c402020-08-07 16:11:29 +02005120service users.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005121+
Patrick Hiesele587c402020-08-07 16:11:29 +02005122If the number of threads requested for service users is larger
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005123than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09005124value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005125+
Dariusz Luksza145de472015-11-09 18:44:35 +01005126By default is 1 on single core node, 2 otherwise.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02005127+
5128[NOTE]
5129When SSH daemon is enabled then this setting also defines the max number of
5130concurrent Git requests for batch users over SSH and HTTP together.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07005131
Kenny Root15ac1b82010-02-24 00:29:20 -08005132[[sshd.streamThreads]]sshd.streamThreads::
5133+
5134Number of threads to use when formatting events to asynchronous
5135streaming clients. Event formatting is multiplexed onto this thread
5136pool by a simple FIFO scheduling system.
5137+
5138By default, 1 plus the number of CPUs available to the JVM.
5139
Edwin Kempinb5df3b82011-10-10 11:31:14 +02005140[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07005141+
5142Number of threads used to parse a command line submitted by a client
5143over SSH for execution, create the internal data structures used by
5144that command, and schedule it for execution on another thread.
5145+
5146By default, 2.
5147
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07005148[[sshd.maxAuthTries]]sshd.maxAuthTries::
5149+
5150Maximum number of authentication attempts before the server
5151disconnects the client. Each public key that a client has loaded
5152into its local agent counts as one auth request. Users can work
5153around the server's limit by loading less keys into their agent,
5154or selecting a specific key in their `~/.ssh/config` file with
5155the `IdentityFile` option.
5156+
5157By default, 6.
5158
5159[[sshd.loginGraceTime]]sshd.loginGraceTime::
5160+
5161Time in seconds that a client has to authenticate before the server
5162automatically terminates their connection. Values should use common
5163unit suffixes to express their setting:
5164+
5165* s, sec, second, seconds
5166* m, min, minute, minutes
5167* h, hr, hour, hours
5168* d, day, days
5169
5170+
5171By default, 2 minutes.
5172
Christian Aistleitner3d794592013-04-08 00:19:40 +02005173[[sshd.idleTimeout]]sshd.idleTimeout::
5174+
5175Time in seconds after which the server automatically terminates idle
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00005176connections (or 0 to disable closing of idle connections) not waiting for
5177any server operation to complete.
5178Values should use common unit suffixes to express their setting:
Christian Aistleitner3d794592013-04-08 00:19:40 +02005179+
5180* s, sec, second, seconds
5181* m, min, minute, minutes
5182* h, hr, hour, hours
5183* d, day, days
5184
5185+
5186By default, 0.
5187
Paladox nonedaafdb62017-10-14 16:18:42 +00005188[[sshd.waitTimeout]]sshd.waitTimeout::
5189+
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00005190Time in seconds after which the server automatically terminates
5191connections waiting for a server operation to complete, like for instance
5192cloning a very large repo with lots of refs.
Paladox nonedaafdb62017-10-14 16:18:42 +00005193Values should use common unit suffixes to express their setting:
5194+
5195* s, sec, second, seconds
5196* m, min, minute, minutes
5197* h, hr, hour, hours
5198* d, day, days
5199
5200+
5201By default, 30s.
5202
Thomas Draebing2c7346a2020-08-03 17:51:15 +02005203[[sshd.gracefulStopTimeout]]sshd.gracefulStopTimeout::
5204+
5205Set a graceful stop time. If set, Gerrit ensures that all open SSH
5206sessions are preserved for a maximum period of time, before forcing the
5207shutdown of the SSH daemon. During this period, no new requests
5208will be accepted. This option is meant to be used in setups performing
5209rolling restarts.
5210+
5211Values should use common unit suffixes to express their setting:
5212+
5213* s, sec, second, seconds
5214* m, min, minute, minutes
5215+
5216By default, 0 seconds (immediate shutdown).
5217
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07005218[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
5219+
5220Maximum number of concurrent SSH sessions that a user account
5221may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09005222that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07005223the number of commands a user may issue over a single connection.
5224If set to 0, there is no limit.
5225+
5226By default, 64.
5227
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005228[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005229+
5230Available ciphers. To permit multiple ciphers, specify multiple
5231`sshd.cipher` keys in the configuration file, one cipher name
5232per key. Cipher names starting with `+` are enabled in addition
5233to the default ciphers, cipher names starting with `-` are removed
5234from the default cipher set.
5235+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005236Supported ciphers:
5237+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005238* `aes128-cbc`
David Ostrovskye77996f2022-06-25 13:20:39 +02005239* `aes128-ctr`
5240* `aes128-gcm@openssh.com`
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005241* `aes192-cbc`
David Ostrovskye77996f2022-06-25 13:20:39 +02005242* `aes192-ctr`
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005243* `aes256-cbc`
David Ostrovskye77996f2022-06-25 13:20:39 +02005244* `aes256-ctr`
5245* `aes256-gcm@openssh.com`
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005246* `arcfour128`
5247* `arcfour256`
David Ostrovskye77996f2022-06-25 13:20:39 +02005248* `blowfish-cbc`
5249* `chacha20-poly1305@openssh.com`
5250* `3des-cbc`
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005251* `none`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005252+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005253If your setup allows for it, it's recommended to disable all ciphers except
5254the AES-CTR modes.
David Ostrovskybcbf70d2022-06-29 13:27:03 +02005255+
5256See also link:https://github.com/apache/mina-sshd/tree/master#ciphers[ciphers,role=external,window=_blank].
5257+
5258By default, all supported ciphers except `none` are available.
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005259
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005260[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005261+
5262Available MAC (message authentication code) algorithms. To permit
5263multiple algorithms, specify multiple `sshd.mac` keys in the
5264configuration file, one MAC per key. MAC names starting with `+`
5265are enabled in addition to the default MACs, MAC names starting with
5266`-` are removed from the default MACs.
5267+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005268Supported MACs:
5269+
5270* `hmac-md5`
5271* `hmac-md5-96`
5272* `hmac-sha1`
5273* `hmac-sha1-96`
5274* `hmac-sha2-256`
5275* `hmac-sha2-512`
David Ostrovskybd0e6bb2022-06-26 09:19:29 +02005276* `hmac-sha1-etm@openssh.com`
5277* `hmac-sha2-256-etm@openssh.com`
5278* `hmac-sha2-512-etm@openssh.com`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005279+
David Ostrovskybcbf70d2022-06-29 13:27:03 +02005280See also link:https://github.com/apache/mina-sshd/tree/master#macs[macs,role=external,window=_blank].
5281+
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005282By default, all supported MACs are available.
5283
David Ostrovskya0f77df2021-06-07 23:04:35 +02005284[[sshd.enableDeprecatedKexAlgorithms]]sshd.enableDeprecatedKexAlgorithms::
5285+
5286Enable deprecated kex algorithms:
5287+
5288* `diffie-hellman-group1-sha1`
5289* `diffie-hellman-group14-sha1`
5290* `diffie-hellman-group-exchange-sha1`
5291
5292By default, the deprecated kex algorithms are disabled.
5293
Scott Dialb4a04fa2016-03-15 09:44:11 -04005294[[sshd.kex]]sshd.kex::
5295+
5296--
5297Available key exchange algorithms. To permit multiple algorithms,
5298specify multiple `sshd.kex` keys in the configuration file, one key
5299exchange algorithm per key. Key exchange algorithm names starting
5300with `+` are enabled in addition to the default key exchange
5301algorithms, key exchange algorithm names starting with `-` are
5302removed from the default key exchange algorithms.
5303
Scott Dialb4a04fa2016-03-15 09:44:11 -04005304Supported key exchange algorithms:
5305
5306* `ecdh-sha2-nistp521`
5307* `ecdh-sha2-nistp384`
5308* `ecdh-sha2-nistp256`
David Ostrovskyd4e08c32022-06-26 09:40:05 +02005309* `curve25519-sha256`
5310* `curve25519-sha256@libssh.org`
5311* `curve448-sha512`
Scott Dialb4a04fa2016-03-15 09:44:11 -04005312* `diffie-hellman-group-exchange-sha256`
David Ostrovskya0f77df2021-06-07 23:04:35 +02005313* `diffie-hellman-group18-sha512`
5314* `diffie-hellman-group17-sha512`
5315* `diffie-hellman-group16-sha512`
5316* `diffie-hellman-group15-sha512`
5317* `diffie-hellman-group14-sha256`
5318
5319See link:#sshd.enableDeprecatedKexAlgorithms[sshd.enableDeprecatedKexAlgorithms]
5320for deprecated key algorithms and how to enable them.
Scott Dialb4a04fa2016-03-15 09:44:11 -04005321
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02005322It is strongly recommended to disable at least `diffie-hellman-group1-sha1`
5323as it's known to be vulnerable (logjam attack). Additionally, if your setup
5324allows for it, it is recommended to disable the remaining two `sha1` key
5325exchange algorithms.
David Ostrovskybcbf70d2022-06-29 13:27:03 +02005326
5327See also link:https://github.com/apache/mina-sshd/tree/master#key-exchange[key exchange,role=external,window=_blank].
5328
5329By default, all supported key exchange algorithms are available.
Scott Dialb4a04fa2016-03-15 09:44:11 -04005330--
5331
Alex Blewitt7efb06f2013-04-01 12:46:48 -04005332[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
5333+
5334Enable kerberos authentication for SSH connections. To permit
5335kerberos authentication, the server must have a host principal
5336(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
5337This must be provisioned by the kerberos administrators, and is
5338typically installed into `/etc/krb5.keytab` on host machines.
5339+
5340The keytab must contain at least one `host/` principal, typically
5341using the host's canonical name. If it does not use the
5342canonical name, the `sshd.kerberosPrincipal` should be configured
5343with the correct name.
5344+
5345By default, not set and so kerberos authentication is not enabled.
5346
5347[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
5348+
5349If kerberos authentication is enabled with `sshd.kerberosKeytab`,
5350instead use the given principal name instead of the default.
5351If the principal does not begin with `host/` a warning message is
5352printed and may prevent successful authentication.
5353+
5354This may be useful if the host is behind an IP load balancer or
5355other SSH forwarding systems, since the principal name is constructed
5356by the client and must match for kerberos authentication to work.
5357+
5358By default, `host/canonical.host.name`
5359
Shawn Pearce318bfca2013-10-17 22:15:38 -07005360[[sshd.requestLog]]sshd.requestLog::
5361+
5362Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
5363If enabled, a request log file is written out by the SSH daemon.
Matthias Sohn450bc202020-08-20 14:40:32 +02005364The sshd log format is documented link:logs.html#_sshd_log[here].
Shawn Pearce318bfca2013-10-17 22:15:38 -07005365+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01005366`log4j.appender` with the name `sshd_log` can be configured to overwrite
5367programmatic configuration.
5368+
David Pursehousea3af2552016-08-02 14:04:44 +09005369By default, `true`.
Gustaf Lundh4e859932018-04-16 10:56:31 +02005370+
Sven Selberg2a0beab2018-04-20 14:49:20 +02005371This value supports link:#reloadConfig[configuration reloads].
Shawn Pearce318bfca2013-10-17 22:15:38 -07005372
David Ostrovsky985201b2015-03-04 22:37:33 +01005373[[sshd.rekeyBytesLimit]]sshd.rekeyBytesLimit::
5374+
5375The SSH daemon will issue a rekeying after a certain amount of data.
5376This configuration option allows you to tweak that setting.
5377+
5378By default, 1073741824 (bytes, 1GB).
5379+
David Pursehousea3af2552016-08-02 14:04:44 +09005380The `rekeyBytesLimit` cannot be set to lower than 32.
David Ostrovsky985201b2015-03-04 22:37:33 +01005381
5382[[sshd.rekeyTimeLimit]]sshd.rekeyTimeLimit::
5383+
5384The SSH daemon will issue a rekeying after a certain amount of time.
5385This configuration option allows you to tweak that setting.
5386+
5387By default, 1h.
5388+
5389Set to 0 to disable this check.
5390
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005391[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005392=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07005393
Sven Selberg42d9d292014-08-13 11:20:11 +02005394[[suggest.maxSuggestedReviewers]]suggest.maxSuggestedReviewers::
5395+
5396The maximum numbers of reviewers suggested.
5397+
5398By default 10.
Gustaf Lundh25e608f2018-04-16 10:54:53 +02005399+
Sven Selberg2a0beab2018-04-20 14:49:20 +02005400This value supports link:#reloadConfig[configuration reloads].
Sven Selberg42d9d292014-08-13 11:20:11 +02005401
Edwin Kempinf957dc22012-10-19 20:41:18 +02005402[[suggest.from]]suggest.from::
5403+
5404The number of characters that a user must have typed before suggestions
Patrick Hiesel87880b02016-05-03 18:15:08 +02005405are provided. If set to 0, suggestions are always provided. This is only
5406used for suggesting accounts when adding members to a group.
Edwin Kempinf957dc22012-10-19 20:41:18 +02005407+
5408By default 0.
Nasser Grainawic3b05342022-02-25 16:58:13 -07005409
Gal Paikin0d07c542020-01-08 17:11:53 +02005410[[suggest.relevantChanges]]suggest.relevantChanges::
5411+
5412When suggesting reviewers, we go over recent changes of the user, and
5413give priority to users that are present as reviewers in any of those
5414changes. The number of changes we go over is `sugggest.relevantChanges`.
5415+
Gal Paikincb5a7ca2020-02-18 09:44:28 +01005416This nubmer is a tradeoff between speed and accuracy.
Gal Paikin0d07c542020-01-08 17:11:53 +02005417A high number would be accurate but slow, and a low number would be
5418fast but inaccurate.
Gal Paikincb5a7ca2020-02-18 09:44:28 +01005419+
5420By default 50.
Edwin Kempinf957dc22012-10-19 20:41:18 +02005421
Matthias Sohn21b652c2021-02-22 22:51:18 +01005422[[suggest.skipServiceUsers]]suggest.skipServiceUsers::
5423+
5424If link:access-control.html#service_users[service users] should be skipped when
5425suggesting reviewers.
5426+
5427By default true.
5428
Edwin Kempin0a49eca2019-06-21 09:38:46 +02005429[[tracing]]
5430=== Section tracing
5431
5432[[tracing.performanceLogging]]tracing.performanceLogging::
5433+
5434Whether performance logging is enabled.
5435+
5436When performance logging is enabled, performance events for some
5437operations are collected in memory while a request is running. At the
5438end of the request the performance events are handed over to the
5439link:dev-plugins.html#performance-logger[PerformanceLogger] plugins.
5440This means if performance logging is enabled, the memory footprint of
Sven Selbergc5fcca02022-04-22 13:37:53 +02005441requests can be markedly increased.
5442In one recorded case the impact was an overall heap increase of 40%
5443(using the metrics-reporter-graphite plugin), in other instances the
5444heap increase wasn't nearly as dramatic and the impact is most likely
5445dependent on which plugin is used.
Edwin Kempin0a49eca2019-06-21 09:38:46 +02005446+
Sven Selbergc5fcca02022-04-22 13:37:53 +02005447By default, false.
Edwin Kempin0a49eca2019-06-21 09:38:46 +02005448
Fabio Ponciroli05bb4032022-01-18 14:37:26 +01005449[[tracing.exportPerformanceMetrics]]tracing.exportPerformanceMetrics::
5450+
5451Whether to export performance metrics.
5452+
5453Performace logged when link:#tracing.performanceLogging[`performanceLogging`] is
5454enabled, can be exported as metrics.
5455+
5456NOTE: Since the payload returned could be of tens of thousands metrics,
5457assess the latency of the metrics endpoint before enabling this option.
5458+
5459By default, false.
5460
Edwin Kempin2cba2982019-07-05 13:19:43 +02005461[[tracing.traceid]]
5462==== Subsection tracing.<trace-id>
5463
5464There can be multiple `tracing.<trace-id>` subsections to configure
5465automatic tracing of requests. To be traced a request must match all
5466conditions of one `tracing.<trace-id>` subsection. The subsection name
5467is used as trace ID. Using this trace ID administrators can find
5468matching log entries.
5469
5470[[tracing.traceid.requestType]]tracing.<trace-id>.requestType::
5471+
5472Type of request for which request tracing should be always enabled (can
5473be `GIT_RECEIVE`, `GIT_UPLOAD`, `REST` and `SSH`).
5474+
5475May be specified multiple times.
5476+
5477By default, unset (all request types are matched).
5478
Edwin Kempinb0ddb0b2019-07-08 12:11:32 +02005479[[tracing.traceid.requestUriPattern]]tracing.<trace-id>.requestUriPattern::
5480+
5481Regular expression to match request URIs for which request tracing
Edwin Kempin764dec82021-09-22 10:45:01 +02005482should be enabled except if they match
5483link:tracing.traceid.excludedRequestUriPattern[excludedRequestUriPattern].
5484Request URIs are only available for REST requests. Request URIs never include
5485the '/a' prefix.
Edwin Kempinb0ddb0b2019-07-08 12:11:32 +02005486+
5487May be specified multiple times.
5488+
5489By default, unset (all request URIs are matched).
5490
Edwin Kempin764dec82021-09-22 10:45:01 +02005491[[tracing.traceid.excludedRequestUriPattern]]tracing.<trace-id>.excludedRequestUriPattern::
5492+
5493Regular expression to match request URIs for which request tracing
5494should not be enabled even if they match
5495link:#tracing.traceid.requestUriPattern[requestUriPattern].
5496Request URIs are only available for REST requests. Request URIs never include
5497the '/a' prefix.
5498+
5499May be specified multiple times.
5500+
5501By default, unset (no request URIs are excluded).
5502
Edwin Kempin2cba2982019-07-05 13:19:43 +02005503[[tracing.traceid.account]]tracing.<trace-id>.account::
5504+
5505Account ID of an account for which request tracing should be always
5506enabled.
5507+
5508May be specified multiple times.
5509+
5510By default, unset (all accounts are matched).
5511
5512[[tracing.traceid.projectPattern]]tracing.<trace-id>.projectPattern::
5513+
5514Regular expression to match project names for which request tracing
5515should be always enabled.
5516+
5517May be specified multiple times.
5518+
5519By default, unset (all projects are matched).
5520
Edwin Kempin927ff822021-08-03 15:46:34 +02005521[[deadline.id]]
5522==== Subsection deadline.<id>
5523
5524There can be multiple `deadline.<id>` subsections to configure deadlines for
5525request executions. For a deadline to apply all conditions of the
5526`deadline.<id>` subsection must match. The subsection name is the ID of the
5527deadline configuration and allows to track back an applied deadline to its
5528configuration.
5529
5530Clients can override the deadlines that are configured here by setting a
5531deadline on the request.
5532
5533Deadlines are only supported for `REST`, `SSH` and `GIT_RECEIVE` requests, but
5534not for `GIT_UPLOAD` requests.
5535
5536[[deadline.id.timeout]]deadline.<id>.timeout::
5537+
5538Timeout after which matching requests should be cancelled.
5539+
5540Values must be specified using standard time unit abbreviations ('ms', 'sec',
5541'min', etc.).
5542+
5543For some requests additional timeout configurations may apply, e.g.
5544link:#receive.timeout[receive.timeout] for git pushes.
5545+
5546By default, unset.
5547
Edwin Kempin0fecade2021-08-04 11:14:44 +02005548[[deadline.id.isAdvisory]]deadline.<id>.isAdvisory::
5549+
5550Whether this deadline is an advisory deadline. Advisory deadlines do not cause
5551requests to be aborted when they are exceeded. Instead, if an advisory deadline
Edwin Kempin0bc9df92021-08-05 16:15:09 +02005552is exceeded, only the `cancellation/advisory_deadline_count` metrics is
5553incremented and a log is written. This is useful to test how many requests would
5554be affected by a new deadline configuration.
Edwin Kempin0fecade2021-08-04 11:14:44 +02005555+
5556By default, `false`.
5557
Edwin Kempin927ff822021-08-03 15:46:34 +02005558[[deadline.id.requestType]]deadline.<id>.requestType::
5559+
5560Type of request to which the deadline applies (can be `GIT_RECEIVE`, `REST` and
5561`SSH`).
5562+
5563May be specified multiple times.
5564+
5565By default, unset (all request types are matched).
5566
5567[[deadline.id.requestUriPattern]]deadline.<id>.requestUriPattern::
5568+
Edwin Kempin764dec82021-09-22 10:45:01 +02005569Regular expression to match request URIs to which the deadline applies except if
5570they match
5571link:#deadline.id.excludedRequestUriPattern[excludedRequestUriPattern]. Request
Edwin Kempin927ff822021-08-03 15:46:34 +02005572URIs are only available for REST requests. Request URIs never include the '/a'
5573prefix.
5574+
5575May be specified multiple times.
5576+
5577By default, unset (all request URIs are matched).
5578
Edwin Kempin764dec82021-09-22 10:45:01 +02005579[[deadline.id.excludedRequestUriPattern]]deadline.<id>.excludedRequestUriPattern::
5580+
5581Regular expression to match request URIs to which the deadline should not be
5582applied even if they match
5583link:#deadline.id.requestUriPattern[requestUriPattern]. Request URIs are only
5584available for REST requests. Request URIs never include the '/a' prefix.
5585+
5586May be specified multiple times.
5587+
5588By default, unset (no request URIs are excluded).
5589
Edwin Kempin927ff822021-08-03 15:46:34 +02005590[[deadline.id.account]]deadline.<id>.account::
5591+
5592Account ID of an account to which the deadline applies.
5593+
5594May be specified multiple times.
5595+
5596By default, unset (all accounts are matched).
5597
5598[[deadline.id.projectPattern]]deadline.<id>.projectPattern::
5599+
5600Regular expression to match project names to which the deadline applies.
5601+
5602May be specified multiple times.
5603+
5604By default, unset (all projects are matched).
5605
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005606[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005607=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07005608
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07005609Tagged footer lines containing references to external
5610tracking systems, parsed out of the commit message and
David Pursehoused55a6b62015-02-27 17:39:38 +09005611saved in Gerrit's secondary index.
Shawn Pearceff61c8a2013-10-07 19:35:53 -07005612
5613After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08005614must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07005615
Edwin Kempinbb421f12011-08-25 11:19:00 +02005616The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07005617bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07005618
5619----
5620[trackingid "jira-bug"]
5621 footer = Bugfix:
David Pursehousece7f6862015-02-19 14:52:45 +09005622 footer = Bug:
Goran Lungberg04132a12010-06-15 17:20:37 -07005623 match = JRA\\d{2,8}
5624 system = JIRA
5625
5626[trackingid "jira-feature"]
5627 footer = Feature
5628 match = JRA(\\d{2,8})
5629 system = JIRA
5630----
5631
5632[[trackingid.name.footer]]trackingid.<name>.footer::
5633+
David Pursehousece7f6862015-02-19 14:52:45 +09005634A prefix tag that identifies the footer line to parse for tracking ids.
5635+
5636Several trackingid entries can have the same footer tag, and a single trackingid
5637entry can have multiple footer tags.
5638+
5639If multiple footer tags are specified, each tag will be parsed separately and
5640duplicates will be ignored.
5641+
5642The trailing ":" is optional.
Goran Lungberg04132a12010-06-15 17:20:37 -07005643
5644[[trackingid.name.match]]trackingid.<name>.match::
5645+
Magnus Bäcke5611832011-02-02 08:57:15 +01005646A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +01005647Java regular expression (java.util.regex),role=external,window=_blank] used to match the
Magnus Bäcke5611832011-02-02 08:57:15 +01005648external tracking id part of the footer line. The match can
5649result in several entries in the DB. If grouping is used in the
5650regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01005651Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07005652+
5653The configuration file parser eats one level of backslashes, so the
5654character class `\s` requires `\\s` in the configuration file. The
5655parser also terminates the line at the first `#`, so a match
5656expression containing # must be wrapped in double quotes.
5657
5658[[trackingid.name.system]]trackingid.<name>.system::
5659+
David Pursehouse221d4f62012-06-08 17:38:08 +09005660The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07005661It is possible to have several trackingid entries for the same
5662tracking system.
5663
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005664[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005665=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07005666
5667[[transfer.timeout]]transfer.timeout::
5668+
5669Number of seconds to wait for a single network read or write
5670to complete before giving up and declaring the remote side is
5671not responding. If 0, there is no timeout, and this server will
5672wait indefinitely for a transfer to finish.
5673+
5674A timeout should be large enough to mostly transfer the objects to
5675the other side. 1 second may be too small for larger projects,
5676especially over a WAN link, while 10-30 seconds is a much more
5677reasonable timeout value.
5678+
5679Defaults to 0 seconds, wait indefinitely.
5680
lincoln2be11602010-07-05 10:53:25 -03005681
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005682[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005683=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005684
Dave Borowitzb1795142017-10-12 07:13:37 -07005685Options to control the behavior of `upload-pack` on the server side,
5686which handles a user's fetch, clone, or repo sync command.
lincoln2be11602010-07-05 10:53:25 -03005687
5688----
5689[upload]
5690 allowGroup = GROUP_ALLOWED_TO_EXECUTE
5691 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
5692----
5693
5694[[upload.allowGroup]]upload.allowGroup::
5695+
Dave Borowitzb1795142017-10-12 07:13:37 -07005696Name of the groups of users that are allowed to execute 'upload-pack'.
5697One or more groups can be set.
lincoln2be11602010-07-05 10:53:25 -03005698+
5699If no groups are added, any user will be allowed to execute
5700'upload-pack' on the server.
5701
Owen Lie2877bb2017-07-14 09:11:20 -04005702[[accountDeactivation]]
5703=== Section accountDeactivation
5704
5705Configures the parameters for the scheduled task to sweep and deactivate Gerrit
5706accounts according to their status reported by the auth backend. Currently only
5707supported for LDAP backends.
5708
5709[[accountDeactivation.startTime]]accountDeactivation.startTime::
5710+
Edwin Kempind33d95a2018-02-16 11:44:04 +01005711The link:#schedule-configuration-startTime[start time] for running
5712account deactivations.
Owen Lie2877bb2017-07-14 09:11:20 -04005713
5714[[accountDeactivation.interval]]accountDeactivation.interval::
5715+
Edwin Kempind33d95a2018-02-16 11:44:04 +01005716The link:#schedule-configuration-interval[interval] for running
5717account deactivations.
5718
Saša Živkovf0966112020-03-17 12:20:31 +01005719Note that the task will only be scheduled if the
5720link:#autoUpdateAccountActiveStatus[auth.autoUpdateAccountActiveStatus]
5721is set to true.
5722
Edwin Kempind33d95a2018-02-16 11:44:04 +01005723link:#schedule-configuration-examples[Schedule examples] can be found
5724in the link:#schedule-configuration[Schedule Configuration] section.
Owen Lie2877bb2017-07-14 09:11:20 -04005725
Stefan Beller0f724ff2015-07-17 10:17:51 -07005726[[submodule]]
5727=== Section submodule
5728
Shawn Pearcedc477cd2016-03-24 19:56:18 -07005729[[submodule.verbosesuperprojectupdate]]submodule.verboseSuperprojectUpdate::
Stefan Beller0f724ff2015-07-17 10:17:51 -07005730+
5731When using link:user-submodules.html#automatic_update[automatic superproject updates]
Zhen Chenc877ca92016-07-27 14:22:37 -07005732this option will determine how the submodule commit messages are included into
Stefan Beller0f724ff2015-07-17 10:17:51 -07005733the commit message of the superproject update.
5734+
Zhen Chenc877ca92016-07-27 14:22:37 -07005735If `FALSE`, will not include any commit messages for the gitlink update.
5736+
5737If `SUBJECT_ONLY`, will include only the commit subjects.
5738+
5739If `TRUE`, will include full commit messages.
5740+
5741By default this is `TRUE`.
Stefan Beller0f724ff2015-07-17 10:17:51 -07005742
Shawn Pearcedc477cd2016-03-24 19:56:18 -07005743[[submodule.enableSuperProjectSubscriptions]]submodule.enableSuperProjectSubscriptions::
Stefan Beller8cc252e2016-03-10 10:06:53 -08005744+
5745This allows to enable the superproject subscription mechanism.
5746+
5747By default this is true.
Stefan Beller0f724ff2015-07-17 10:17:51 -07005748
Patrick Hiesel44e5d6e2017-08-24 16:07:26 +02005749[[submodule.maxCombinedCommitMessageSize]]submodule.maxCombinedCommitMessageSize::
5750+
5751This allows to limit the length of the commit message for a submodule.
5752+
5753By default this is 262144 (256 KiB).
5754+
5755Common unit suffixes of k, m, or g are supported.
5756
5757[[submodule.maxCommitMessages]]submodule.maxCommitMessages::
5758+
5759This allows to limit the number of commit messages that should be combined when creating
5760a commit message for a submodule.
5761+
5762By default this is 1000.
5763
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005764[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005765=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005766
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005767[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005768+
5769Name that Gerrit calls itself in Git when it creates a new Git
5770commit, such as a merge during change submission.
5771+
5772By default this is "Gerrit Code Review".
5773
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005774[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005775+
5776Email address that Gerrit refers to itself as when it creates a
5777new Git commit, such as a merge commit during change submission.
5778+
Kenyon Ralph5d1deb02021-10-05 14:55:32 -07005779If not set, Gerrit generates this as "gerrit@``hostname``", where
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005780`hostname` is the hostname of the system Gerrit is running on.
5781+
5782By default, not set, generating the value at startup.
5783
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005784[[user.anonymousCoward]]user.anonymousCoward::
5785+
David Pursehousea1d633b2014-05-02 17:21:02 +09005786Username that is displayed in the Gerrit Web UI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005787notifications if the full name of the user is not set.
5788+
Han-Wen Nienhuys3fb723d2017-11-20 19:21:13 +01005789By default "Name of user not set" is used.
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005790
Edwin Kempind33d95a2018-02-16 11:44:04 +01005791[[schedule-configuration]]
5792=== Schedule Configuration
5793
5794Schedule configurations are used for running periodic background jobs.
5795
5796A schedule configuration consists of two parameters:
5797
5798[[schedule-configuration-interval]]
5799* `interval`:
5800Interval for running the periodic background job. The interval must be
5801larger than zero. The following suffixes are supported to define the
5802time unit for the interval:
5803** `s`, `sec`, `second`, `seconds`
5804** `m`, `min`, `minute`, `minutes`
5805** `h`, `hr`, `hour`, `hours`
5806** `d`, `day`, `days`
5807** `w`, `week`, `weeks` (`1 week` is treated as `7 days`)
5808** `mon`, `month`, `months` (`1 month` is treated as `30 days`)
5809** `y`, `year`, `years` (`1 year` is treated as `365 days`)
5810
5811[[schedule-configuration-startTime]]
5812* `startTime`:
5813The start time defines the first execution of the periodic background
5814job. If the configured `interval` is shorter than `startTime - now` the
5815start time will be preponed by the maximum integral multiple of
5816`interval` so that the start time is still in the future. `startTime`
5817must have one of the following formats:
5818
5819** `<day of week> <hours>:<minutes>`
5820** `<hours>:<minutes>`
5821
5822+
5823The placeholders can have the following values:
5824
5825*** `<day of week>`:
5826`Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`
5827*** `<hours>`:
5828`00`-`23`
5829*** `<minutes>`:
5830`00`-`59`
5831
5832+
5833The time zone cannot be specified but is always the system default
David Pursehouse18f388a2019-04-10 09:36:18 +09005834time zone. Hours must be zero-padded, i.e. `06:00` rather than `6:00`.
Edwin Kempind33d95a2018-02-16 11:44:04 +01005835
5836The section (and optionally the subsection) in which the `interval` and
5837`startTime` keys must be set depends on the background job for which a
5838schedule should be configured. E.g. for the change cleanup job the keys
5839must be set in the link:#changeCleanup[changeCleanup] section:
5840
5841----
5842 [changeCleanup]
5843 startTime = Fri 10:30
5844 interval = 2 days
5845----
5846
5847[[schedule-configuration-examples]]
5848Examples for a schedule configuration:
5849
5850* Example 1:
5851+
5852----
5853 startTime = Fri 10:30
5854 interval = 2 days
5855----
5856+
5857Assuming that the server is started on `Mon 07:00` then
5858`startTime - now` is `4 days 3:30 hours`. This is larger than the
5859interval hence the start time is preponed by the maximum integral
5860multiple of the interval so that start time is still in the future,
5861i.e. preponed by 4 days. This yields a start time of `Mon 10:30`, next
5862executions are `Wed 10:30`, `Fri 10:30`. etc.
5863
5864* Example 2:
5865+
5866----
5867 startTime = 06:00
5868 interval = 1 day
5869----
5870+
5871Assuming that the server is started on `Mon 07:00` then this yields the
5872first run on Tuesday at 06:00 and a repetition interval of 1 day.
5873
Dave Borowitzd4fdc932018-11-02 15:06:25 -07005874[[All-Projects-project.config]]
5875== File `etc/All-Projects/project.config`
5876
5877The optional file `'$site_path'/etc/All-Projects/project.config` provides
5878defaults for configuration read from
5879link:config-project-config.html[`project.config`] in the
5880`All-Projects` repo. Unlike `gerrit.config`, this file contains project-type
5881configuration rather than server-type configuration.
5882
5883Most administrators will not need this file, and should instead make commits to
5884`All-Projects` to modify global config. However, a separate file can be useful
5885when managing multiple Gerrit servers, since pushing changes to defaults using
5886Puppet or a similar tool can be easier than scripting git updates to
5887`All-Projects`.
5888
5889The contents of the file are loaded each time the `All-Projects` project is
5890reloaded. Updating the file requires either evicting the project cache or
5891restarting the server.
5892
5893Caveats:
5894
5895* The path from which the file is read corresponds to the name of the repo,
5896 which is link:#gerrit.allProjects[configurable].
5897* Although the file lives in a directory that shares a name with a repository,
5898 this directory is not a Git repository.
5899* Only the file `project.config` is read from this directory to provide
5900 defaults; any other files in this directory, such as `rules.pl`, are ignored.
5901 (This behavior may change in the future.)
5902* Group names listed in the access config in this file are resolved to UUIDs
5903 using the `groups` file in the repository, not in the config directory. As a
5904 result, setting ACLs in this file is not recommended.
5905
Hector Oswaldo Caballero98952b02017-08-24 06:31:28 -04005906[[secure.config]]
5907== File `etc/secure.config`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005908
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005909The optional file `'$site_path'/etc/secure.config` overrides (or
5910supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005911The file should be readable only by the daemon process and can be
5912used to contain private configuration entries that wouldn't normally
5913be exposed to everyone.
5914
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005915Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005916----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07005917[auth]
5918 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
5919
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005920[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005921 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005922
5923[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005924 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005925
5926[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005927 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07005928
5929[remote "bar"]
5930 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005931----
5932
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005933== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01005934
5935The optional file `'$site_path'/etc/peer_keys` controls who can
5936login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
5937command.
5938
David Pursehouse90bed3f2020-06-09 22:07:19 +02005939The format is one Base-64 encoded public key per line with optional comment, e.g.:
5940----
5941# Comments allowed at start of line
5942AAAAC3...51R== john@example.net
5943# Another comment
5944AAAAB5...21S== jane@example.net
5945----
Johan Bjork3e5ee302012-01-27 17:59:54 +01005946
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005947=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005948
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005949site_path::
5950+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005951Local filesystem directory holding the site customization assets.
5952Placing this directory under version control and/or backup is a
5953good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005954+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005955Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005956+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005957Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005958+
Dave Borowitz1e49e142013-04-09 12:14:57 -07005959* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005960
Saša Živkovd34dfe32017-11-20 11:14:35 +01005961[[jgitConfig]]
5962== File `etc/jgit.config`
5963
5964Gerrit uses the `$site_path/etc/jgit.config` file instead of the
5965system-wide and user-global Git configuration for its runtime JGit
5966configuration.
5967
5968Sample `etc/jgit.config` file:
5969----
5970[core]
5971 trustFolderStat = false
5972----
5973
Matthias Sohn85c18792020-09-08 01:42:03 +02005974[[jgit-gc]]
5975=== Section gc
5976
5977Options in section gc are used when command link:cmd-gc.html[gerrit gc] is used
5978or scheduled via options link:cmd-gc.html#gc.startTime[gc.startTime] and
5979link:cmd-gc.html#gc.interval[gc.interval].
5980
5981[[gc.auto]]gc.auto::
5982+
5983When there are approximately more than this many loose objects in the repository,
5984auto gc will pack them. Some commands use this command to perform a light-weight
5985garbage collection from time to time. The default value is 6700.
5986+
5987Setting this to 0 disables not only automatic packing based on the number of
5988loose objects, but any other heuristic auto gc will otherwise use to determine
5989if there’s work to do, such as link:#gc.autoPackLimit[gc.autoPackLimit].
5990
5991[[gc.autodetach]]gc.autodetach::
5992+
5993Makes auto gc run in a background thread. Default is `true`.
5994
5995[[gc.autopacklimit]]gc.autopacklimit::
5996+
5997When there are more than this many packs that are not marked with `*.keep` file
5998in the repository, auto gc consolidates them into one larger pack. The
5999default value is 50. Setting this to 0 disables it. Setting `gc.auto` to 0 will
6000also disable this.
6001
6002[[gc.packRefs]]gc.packRefs::
6003+
6004This variable determines whether gc runs git pack-refs. The default is `true`.
6005
6006[[gc.reflogExpire]]gc.reflogExpire::
6007+
6008Removes reflog entries older than this time; defaults to 90 days. The value "now"
6009expires all entries immediately, and "never" suppresses expiration altogether.
6010
6011[[gc.reflogExpireUnreachable]]gc.reflogExpireUnreachable::
6012+
6013Removes reflog entries older than this time and not reachable from the
6014current tip; defaults to 30 days. The value "now" expires all entries immediately,
6015and "never" suppresses expiration altogether.
6016
Matthias Sohnbf7ca5a2020-09-08 00:57:20 +02006017[[jgit-protocol]]
6018=== Section protocol
6019
6020[[protocol.version]]protocol.version::
6021+
6022If set, the server will accept requests from a client attempting to communicate
David Ostrovskydafac1c2021-01-04 09:26:52 +01006023using the specified protocol version. Default is `2`. If set in file
6024`etc/jgit.config` this option will be used for all repositories of the site.
6025It can be overridden for a given repository by configuring a different value in
6026the repository's `config` file.
Matthias Sohnbf7ca5a2020-09-08 00:57:20 +02006027+
6028Supported versions:
60290:: the original wire protocol.
60301:: the original wire protocol with the addition of a version string in the initial response from the server.
60312:: wire protocol version 2. Speeds up fetches from repositories with many refs by allowing the client
6032 to specify which refs to list before the server lists them.
6033
Matthias Sohn85c18792020-09-08 01:42:03 +02006034[[jgit-receive]]
6035=== Section receive
6036
6037[[receive.autogc]]receive.autogc::
6038+
Matthias Sohn53528f42020-11-23 16:23:50 +01006039By default, up to Gerrit 3.2 `git-receive-pack` will run auto gc after receiving data from git-push and updating refs.
Matthias Sohn85c18792020-09-08 01:42:03 +02006040You can stop it by setting this variable to `false`. This is recommended in gerrit to avoid the
6041additional load this creates. Instead schedule gc using link:cmd-gc.html#gc.startTime[gc.startTime]
6042and link:cmd-gc.html#gc.interval[gc.interval] or e.g. in a cron job that runs gc in a separate process.
Matthias Sohn53528f42020-11-23 16:23:50 +01006043Since Gerrit 3.3 the init command will auto-configure `git-receive-pack = false` in `etc/jgit.config` if
6044it wasn't set manually and show a warning if it was set to `true` manually.
Matthias Sohn85c18792020-09-08 01:42:03 +02006045
Shawn O. Pearce5500e692009-05-28 15:55:01 -07006046GERRIT
6047------
6048Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07006049
6050SEARCHBOX
6051---------