blob: 6d238f734e41d1a8080bf9bcf543e7bdaae6b329 [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
Gal Paikince4e7c62020-08-28 18:47:32 +0300185[[asyncPostUpdate]]
186=== Section asyncPostUpdate
187
188[[asyncPostUpdate.threadPoolSize]]asyncPostUpdate.threadPoolSize::
189+
190Maximum size of thread pool in which async post updates are sent out.
191+
192When set to 0, a direct executor is used.
193+
194When unset, use link:#sendemail[sendemail.threadPoolSize] threadPoolSize. When both
195are unset, use the default.
196+
197By default, 1.
198
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800199[[auth]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800200=== Section auth
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700201
202See also link:config-sso.html[SSO configuration].
203
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700204[[auth.type]]auth.type::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700205+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700206Type of user authentication employed by Gerrit. The supported
207values are:
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700208+
209* `OpenID`
210+
211The default setting. Gerrit uses any valid OpenID
212provider chosen by the end-user. For more information see
Marian Harbach34253372019-12-10 18:01:31 +0100213http://openid.net/[openid.net,role=external,window=_blank].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700214+
James E. Blairca8bc3b2011-12-21 18:12:26 +0000215* `OpenID_SSO`
216+
217Supports OpenID from a single provider. There is no registration
218link, and the "Sign In" link sends the user directly to the provider's
219SSO entry point.
220+
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700221* `HTTP`
222+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700223Gerrit relies upon data presented in the HTTP request. This includes
Edwin Kempinf1acbb82011-09-15 12:49:42 +0200224HTTP basic authentication, or some types of commercial single-sign-on
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700225solutions. With this setting enabled the authentication must
226take place in the web server or servlet container, and not from
227within Gerrit.
228+
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700229* `HTTP_LDAP`
230+
231Exactly like `HTTP` (above), but additionally Gerrit pre-populates
232a user's full name and email address based on information obtained
233from the user's account object in LDAP. The user's group membership
234is also pulled from LDAP, making any LDAP groups that a user is a
David Pursehouseef92bec2017-08-25 18:45:02 +0900235member of available as groups in Gerrit. Hence the `_LDAP` suffix in
236the name of this authentication type. Gerrit does NOT authenticate
237the user via LDAP.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700238+
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200239* `CLIENT_SSL_CERT_LDAP`
240+
241This authentication type is actually kind of SSO. Gerrit will configure
David Pursehouse221d4f62012-06-08 17:38:08 +0900242Jetty's SSL channel to request the client's SSL certificate. For this
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200243authentication to work a Gerrit administrator has to import the root
244certificate of the trust chain used to issue the client's certificate
245into the <review-site>/etc/keystore.
246After the authentication is done Gerrit will obtain basic user
247registration (name and email) from LDAP, and some group memberships.
David Pursehouseef92bec2017-08-25 18:45:02 +0900248Hence the `_LDAP` suffix in the name of this authentication type.
249Gerrit does NOT authenticate the user via LDAP.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200250This authentication type can only be used under hosted daemon mode, and
251the httpd.listenUrl must use https:// as the protocol.
Chulho Yangb72ff8f2013-07-04 02:35:53 -0400252Optionally, certificate revocation list file can be used
253at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200254+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700255* `LDAP`
256+
257Gerrit prompts the user to enter a username and a password, which
258it then verifies by performing a simple bind against the configured
259<<ldap.server,ldap.server>>. In this configuration the web server
260is not involved in the user authentication process.
261+
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800262The actual username used in the LDAP simple bind request is the
263account's full DN, which is discovered by first querying the
264directory using either an anonymous request, or the configured
Robin Rosenberga3baed02012-10-14 14:09:32 +0200265<<ldap.username,ldap.username>> identity. Gerrit can also use kerberos if
266<<ldap.authentication,ldap.authentication>> is set to `GSSAPI`.
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100267+
268If link:#auth.gitBasicAuthPolicy[`auth.gitBasicAuthPolicy`] is set to `HTTP`,
269the randomly generated HTTP password is used for authentication. On the other hand,
270if link:#auth.gitBasicAuthPolicy[`auth.gitBasicAuthPolicy`] is set to `HTTP_LDAP`,
271the password in the request is first checked against the HTTP password and, if
272it does not match, it is then validated against the LDAP password.
273Service users that only exist in the Gerrit database are authenticated by their
274HTTP passwords.
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800275
276* `LDAP_BIND`
277+
278Gerrit prompts the user to enter a username and a password, which
279it then verifies by performing a simple bind against the configured
280<<ldap.server,ldap.server>>. In this configuration the web server
281is not involved in the user authentication process.
282+
David Pursehouse42f42042013-08-01 14:02:25 +0900283Unlike `LDAP` above, the username used to perform the LDAP simple bind
David Pursehouse1344f5b2013-08-09 17:35:47 +0900284request is the exact string supplied in the dialog by the user.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200285The configured <<ldap.username,ldap.username>> identity is not used to obtain
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800286account information.
287+
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200288* `OAUTH`
David Ostrovskye9707d82015-02-22 01:14:02 +0100289+
290OAuth is a protocol that lets external apps request authorization to private
291details in a user's account without getting their password. This is
292preferred over Basic Authentication because tokens can be limited to specific
293types of data, and can be revoked by users at any time.
294+
295Site owners have to register their application before getting started. Note
296that provider specific plugins must be used with this authentication scheme.
297+
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100298Git clients may send OAuth 2 access tokens instead of passwords in the Basic
299authentication header. Note that provider specific plugins must be installed to
300facilitate this authentication scheme. If multiple OAuth 2 provider plugins are
301installed one of them must be selected as default with the
302`auth.gitOAuthProvider` option.
303+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700304* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
305+
306*DO NOT USE*. Only for use in a development environment.
307+
308When this is the configured authentication method a hyperlink titled
309`Become` appears in the top right corner of the page, taking the
310user to a form where they can enter the username of any existing
311user account, and immediately login as that account, without any
David Ostrovsky7163dac2017-07-29 06:49:38 +0200312authentication taking place.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700313
314+
315By default, OpenID.
316
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700317[[auth.allowedOpenID]]auth.allowedOpenID::
318+
319List of permitted OpenID providers. A user may only authenticate
320with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse42f42042013-08-01 14:02:25 +0900321is set to `OpenID` (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700322+
Magnus Bäcke5611832011-02-02 08:57:15 +0100323Patterns may be either a
324link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +0100325Java regular expression (java.util.regex),role=external,window=_blank] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700326end with `$`) or be a simple prefix (any other string).
327+
328By default, the list contains two values, `http://` and `https://`,
329allowing users to authenticate with any OpenID provider.
330
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700331[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700332+
David Pursehouse221d4f62012-06-08 17:38:08 +0900333List of trusted OpenID providers. Only used if `auth.type` is
David Pursehouse42f42042013-08-01 14:02:25 +0900334set to `OpenID` (the default).
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700335+
336In order for a user to take advantage of permissions beyond those
337granted to the `Anonymous Users` and `Registered Users` groups,
338the user account must only have OpenIDs which match at least one
339pattern from this list.
340+
Magnus Bäcke5611832011-02-02 08:57:15 +0100341Patterns may be either a
342link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +0100343Java regular expression (java.util.regex),role=external,window=_blank] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700344end with `$`) or be a simple prefix (any other string).
345+
346By default, the list contains two values, `http://` and `https://`,
347allowing Gerrit to trust any OpenID it receives.
348
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100349[[auth.openIdDomain]]auth.openIdDomain::
350+
351List of allowed OpenID email address domains. Only used if
David Pursehouse42f42042013-08-01 14:02:25 +0900352`auth.type` is set to `OPENID` or `OPENID_SSO`.
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100353+
354Domain is case insensitive and must be in the same form as it
355appears in the email address, for example, "example.com".
356+
357By default, any domain is accepted.
358
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700359[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
360+
361Time in seconds before an OpenID provider must force the user
362to authenticate themselves again before authentication to this
363Gerrit server. Currently this is only a polite request, and users
364coming from providers that don't support the PAPE extension will
365be accepted anyway. In the future it may be enforced, rejecting
366users coming from providers that don't honor the max session age.
367+
368If set to 0, the provider will always force the user to authenticate
369(e.g. supply their password). Values should use common unit suffixes
370to express their setting:
371+
372* s, sec, second, seconds
373* m, min, minute, minutes
374* h, hr, hour, hours
375* d, day, days
376* w, week, weeks (`1 week` is treated as `7 days`)
377* mon, month, months (`1 month` is treated as `30 days`)
378* y, year, years (`1 year` is treated as `365 days`)
379
380+
381Default is -1, permitting infinite time between authentications.
382
David Pursehouse5be35a32015-09-09 17:35:32 +0900383[[auth.registerEmailPrivateKey]]auth.registerEmailPrivateKey::
384+
385Private key to use when generating an email verification token.
386+
387If not set, a random key is generated when running the
388link:pgm-init.html[site initialization].
389
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700390[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
391+
392Time in seconds before an email verification token sent to a user in
393order to validate their email address expires.
394+
395* s, sec, second, seconds
396* m, min, minute, minutes
397* h, hr, hour, hours
398* d, day, days
399* w, week, weeks (`1 week` is treated as `7 days`)
400* mon, month, months (`1 month` is treated as `30 days`)
401* y, year, years (`1 year` is treated as `365 days`)
402
403+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800404Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700405
James E. Blairca8bc3b2011-12-21 18:12:26 +0000406[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
407+
David Pursehouse42f42042013-08-01 14:02:25 +0900408The SSO entry point URL. Only used if `auth.type` is set to
409`OpenID_SSO`.
James E. Blairca8bc3b2011-12-21 18:12:26 +0000410+
411The "Sign In" link will send users directly to this URL.
412
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700413[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700414+
415HTTP header to trust the username from, or unset to select HTTP basic
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100416authentication. Only used if `auth.type` is set to `HTTP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700417
Luca Milanesio384ed6c2013-07-30 09:10:07 +0100418[[auth.httpDisplaynameHeader]]auth.httpDisplaynameHeader::
419+
420HTTP header to retrieve the user's display name from. Only used if `auth.type`
421is set to `HTTP`.
422+
423If set, Gerrit trusts and enforces the user's full name using the HTTP header
424and disables the ability to manually modify the user's full name
425from the contact information page.
426
427[[auth.httpEmailHeader]]auth.httpEmailHeader::
428+
429HTTP header to retrieve the user's e-mail from. Only used if `auth.type`
430is set to `HTTP`.
431+
432If set, Gerrit trusts and enforces the user's e-mail using the HTTP header
433and disables the ability to manually modify or register other e-mails
434from the contact information page.
435
Luca Milanesio97d07352014-07-17 08:31:06 +0100436[[auth.httpExternalIdHeader]]auth.httpExternalIdHeader::
437+
438HTTP header to retrieve the user's external identification token.
439Only used if `auth.type` is set to `HTTP`.
440+
441If set, Gerrit adds the value contained in the HTTP header to the
442user's identity. Typical use is with a federated identity token from
443an external system (e.g. GitHub OAuth 2.0 authentication) where
444the user's auth token exchanged during authentication handshake
445needs to be used for authenticated communication to the external
446system later on.
447+
448Example: `auth.httpExternalIdHeader: X-GitHub-OTP`
449
Luca Milanesio5185b042013-07-27 22:03:06 +0100450[[auth.loginUrl]]auth.loginUrl::
451+
452URL to redirect a browser to after the end-user has clicked on the
David Pursehouse42f42042013-08-01 14:02:25 +0900453login link in the upper right corner. Only used if `auth.type` is set
454to `HTTP` or `HTTP_LDAP`.
Luca Milanesio5185b042013-07-27 22:03:06 +0100455Organizations using an enterprise single-sign-on solution may want to
456redirect the browser to the SSO product's sign-in page for completing the
457login process and validate their credentials.
458+
David Pursehouse42f42042013-08-01 14:02:25 +0900459If set, Gerrit allows anonymous access until the end-user performs the login
460and provides a trusted identity through the HTTP header.
Luca Milanesio5185b042013-07-27 22:03:06 +0100461If not set, Gerrit requires the HTTP header with a trusted identity
David Pursehouse42f42042013-08-01 14:02:25 +0900462and returns the error page 'LoginRedirect.html' if such a header is not
463present.
Luca Milanesio5185b042013-07-27 22:03:06 +0100464
465[[auth.loginText]]auth.loginText::
466+
David Pursehouse42f42042013-08-01 14:02:25 +0900467Text displayed in the loginUrl link. Only used if `auth.loginUrl` is set.
Luca Milanesio5185b042013-07-27 22:03:06 +0100468+
David Pursehouse42f42042013-08-01 14:02:25 +0900469If not set, the "Sign In" text is used.
Luca Milanesio5185b042013-07-27 22:03:06 +0100470
Luca Milanesio111e0b72013-08-15 18:56:42 +0100471[[auth.registerPageUrl]]auth.registerPageUrl::
472+
David Pursehouse268744b2013-08-17 15:32:11 +0900473URL of the registration page to use when a new user logs in to Gerrit for
474the first time. Used only when `auth.type` is set to `HTTP`.
Luca Milanesio111e0b72013-08-15 18:56:42 +0100475+
476If not set, the standard Gerrit registration page `/#/register/` is displayed.
477
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700478[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700479+
480URL to redirect a browser to after the end-user has clicked on the
481"Sign Out" link in the upper right corner. Organizations using an
482enterprise single-sign-on solution may want to redirect the browser
483to the SSO product's sign-out page.
484+
485If not set, the redirect returns to the list of all open changes.
486
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800487[[auth.registerUrl]]auth.registerUrl::
488+
489Target for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200490when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800491+
492If not set, no "Register" link is displayed.
493
Chad Horohoe65897082012-11-10 10:26:25 -0800494[[auth.registerText]]auth.registerText::
495+
496Text for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200497when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Chad Horohoe65897082012-11-10 10:26:25 -0800498+
499If not set, defaults to "Register".
500
David Pursehouse3d604492013-01-25 17:41:53 +0900501[[auth.editFullNameUrl]]auth.editFullNameUrl::
502+
503Target for the "Edit" button when the user is allowed to edit their
Edwin Kempin54093152015-05-08 10:50:35 +0200504full name. Used only when `auth.type` is `LDAP`, `LDAP_BIND` or
505`CUSTOM_EXTENSION`.
David Pursehouse3d604492013-01-25 17:41:53 +0900506
507[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
508+
David Pursehouse42f42042013-08-01 14:02:25 +0900509Target for the "Obtain Password" link. Used only when `auth.type` is
Edwin Kempin54093152015-05-08 10:50:35 +0200510`CUSTOM_EXTENSION`.
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700511
512[[auth.switchAccountUrl]]auth.switchAccountUrl::
David Pursehouse3d604492013-01-25 17:41:53 +0900513+
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700514URL to switch user identities and login as a different account than
515the currently active account. This is disabled by default except when
516`auth.type` is `OPENID` and `DEVELOPMENT_BECOME_ANY_ACCOUNT`. If set
517the "Switch Account" link is displayed next to "Sign Out".
518+
519When `auth.type` does not normally enable this URL administrators may
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700520set this to `login/`, allowing users to begin a new web session. This value
David Ostrovsky7163dac2017-07-29 06:49:38 +0200521is used as an href in PolyGerrit, so absolute URLs like
Logan Hanks71d1ffd2017-03-16 14:12:23 -0700522`https://someotherhost/login` work as well.
523+
524If a ${path} parameter is included, then PolyGerrit will substitute the
525currently viewed path in the link. Be aware that this path will include
526a leading slash, so a value like this might be appropriate: `/login${path}`.
David Pursehouse3d604492013-01-25 17:41:53 +0900527
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000528[[auth.cookiePath]]auth.cookiePath::
529+
530Sets "path" attribute of the authentication cookie.
531+
532If not set, HTTP request's path is used.
533
Sammy Gillespie26873c02016-02-11 14:39:43 +0000534[[auth.cookieDomain]]auth.cookieDomain::
535+
536Sets "domain" attribute of the authentication cookie.
537+
538If not set, HTTP request's domain is used.
539
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000540[[auth.cookieSecure]]auth.cookieSecure::
541+
542Sets "secure" flag of the authentication cookie. If true, cookies
543will be transmitted only over HTTPS protocol.
544+
545By default, false.
546
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700547[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700548+
549Optional format string to construct user email addresses out of
David Pursehouse42f42042013-08-01 14:02:25 +0900550user login names. Only used if `auth.type` is `HTTP`, `HTTP_LDAP`
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700551or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700552+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700553This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700554with the login name. E.g. "\{0\}+gerrit@example.com" with a user
555login name of "foo" will produce "foo+gerrit@example.com" during
556the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700557+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700558If the site is using `HTTP_LDAP` or `LDAP`, using this option is
559discouraged. Setting `ldap.accountEmailAddress` and importing the
560email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700561
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700562[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700563+
564Controls whether or not the contributor agreement features are
565enabled for the Gerrit site. If enabled a user must complete a
566contributor agreement before they can upload changes.
567+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800568If enabled, the admin must also add one or more
569link:config-cla.html[contributor-agreement sections]
570in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700571`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700572more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700573+
574By default this is false (no agreements are used).
Fredrik Luthandera3cf3542012-07-04 16:55:35 -0700575+
576To enable the actual usage of contributor agreement the project
577specific config option in the `project.config` must be set:
578link:config-project-config.html[receive.requireContributorAgreement].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700579
Christian Halstricka3d88a52011-08-31 09:21:41 +0200580[[auth.trustContainerAuth]]auth.trustContainerAuth::
581+
582If true then it is the responsibility of the container hosting
583Gerrit to authenticate users. In this case Gerrit will blindly trust
584the container.
585+
586This parameter only affects git over http traffic. If set to false
Han-Wen Nienhuys84d830b2017-02-15 16:36:04 +0100587then Gerrit will do the authentication (using Basic authentication).
Christian Halstricka3d88a52011-08-31 09:21:41 +0200588+
589By default this is set to false.
590
Luca Milanesio42058842012-01-05 21:25:38 +0000591
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400592[[auth.gitBasicAuthPolicy]]auth.gitBasicAuthPolicy::
593+
David Pursehousef7a1c2a2017-08-25 19:12:54 +0900594When `auth.type` is `LDAP`, `LDAP_BIND` or `OAUTH`, it allows using either the generated
Luca Milanesio51edcb72017-03-06 11:59:55 +0000595HTTP password, the LDAP or OAUTH password, or a combination of HTTP and LDAP
596authentication, to authenticate Git over HTTP and REST API requests.
597The supported values are:
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400598+
599*`HTTP`
600+
David Pursehousee2920032017-08-25 19:12:21 +0900601Only the HTTP password is accepted when doing Git over HTTP and REST API requests.
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400602+
603*`LDAP`
604+
605Only the `LDAP` password is allowed when doing Git over HTTP and REST API
606requests.
607+
Luca Milanesio51edcb72017-03-06 11:59:55 +0000608*`OAUTH`
609+
David Pursehousee2920032017-08-25 19:12:21 +0900610Only the `OAUTH` authentication is allowed when doing Git over HTTP and REST API
Luca Milanesio51edcb72017-03-06 11:59:55 +0000611requests.
612+
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400613*`HTTP_LDAP`
614+
615The password in the request is first checked against the HTTP password and, if
616it does not match, it is then validated against the `LDAP` password.
617+
Luca Milanesio51edcb72017-03-06 11:59:55 +0000618By default this is set to `LDAP` when link:#auth.type[`auth.type`] is `LDAP`
619and `OAUTH` when link:#auth.type[`auth.type`] is `OAUTH`.
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400620Otherwise, the default value is `HTTP`.
621
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200622[[auth.gitOAuthProvider]]auth.gitOAuthProvider::
623+
624Selects the OAuth 2 provider to authenticate git over HTTP traffic with.
625+
626In general there is no way to determine from an access token alone, which
627OAuth 2 provider to address to verify that token, and the BasicAuth
628scheme does not support amending such details. If multiple OAuth provider
629plugins in a system offer support for git over HTTP authentication site
630administrators must configure, which one to use as default provider.
631In case the provider cannot be determined from a request the access token
632will be sent to the default provider for verification.
633+
634The value of this parameter must be the identifier of an OAuth 2 provider
635in the form `plugin-name:provider-name`. Consult the respective plugin
636documentation for details.
637
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200638[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
639+
640If set the username that is received to authenticate a git operation
641is converted to lower case for looking up the user account in Gerrit.
642+
643By setting this parameter a case insensitive authentication for the
644git operations can be achieved, if it is ensured that the usernames in
645Gerrit (scheme `username`) are stored in lower case (e.g. if the
646parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
647set to `${sAMAccountName.toLowerCase}`). It is important that for all
648existing accounts this username is already in lower case. It is not
649possible to convert the usernames of the existing accounts to lower
650case because this would break the access to existing per-user
Edwin Kempine7ae45c2018-09-20 09:57:15 +0200651branches and Gerrit provides no tool to do such a conversion.
652+
653Setting this parameter to `true` will prevent all users from login that
654have a non-lower-case username.
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200655+
656This parameter only affects git over http and git over SSH traffic.
657+
658By default this is set to false.
659
Shawn Pearcea931fe12013-06-11 12:29:17 -0700660[[auth.enableRunAs]]auth.enableRunAs::
661+
662If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
663header from any users granted the link:access-control.html#capability_runAs[Run As]
664capability. The header and capability permit the authenticated user
665to impersonate another account.
666+
667If false the feature is disabled and cannot be re-enabled without
668editing gerrit.config and restarting the server.
669+
670Default is true.
671
David Pursehouse21bd07b2015-11-27 00:15:42 +0900672[[auth.allowRegisterNewEmail]]auth.allowRegisterNewEmail::
673+
674Whether users are allowed to register new email addresses.
675+
676In addition for the HTTP authentication type
677link:#auth.httpemailheader[auth.httpemailheader] must *not* be set to
678enable registration of new email addresses.
679+
680By default, true.
681
Owen Lic24f7242017-06-14 10:04:00 -0400682[[auth.autoUpdateAccountActiveStatus]]auth.autoUpdateAccountActiveStatus::
683+
684Whether to allow automatic synchronization of an account's inactive flag upon login.
685If set to true, upon login, if the authentication back-end reports the account as active,
686the account's inactive flag in the internal Gerrit database will be updated to be active.
687If the authentication back-end reports the account as inactive, the account's flag will be
688updated to be inactive and the login attempt will be blocked. Users enabling this feature
689should ensure that their authentication back-end is supported. Currently, only
690strict 'LDAP' authentication is supported.
691+
Owen Lie2877bb2017-07-14 09:11:20 -0400692In addition, if this parameter is not set, or false, the corresponding scheduled
693task to deactivate inactive Gerrit accounts will also be disabled. If this
694parameter is set to true, users should also consider configuring the
695link:#accountDeactivation[accountDeactivation] section appropriately.
696+
Owen Lic24f7242017-06-14 10:04:00 -0400697By default, false.
698
Patrick Hiesel8d0770e2018-10-09 13:39:54 +0200699[[auth.skipFullRefEvaluationIfAllRefsAreVisible]]auth.skipFullRefEvaluationIfAllRefsAreVisible::
700+
701Whether to skip the full ref visibility checks as a performance shortcut when all refs are
702visible to a user. Full ref filtering would filter out things like pending edits.
703+
704By default, true.
705
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800706[[cache]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800707=== Section cache
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700708
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700709[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700710+
711Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700712future lookup. This local disk cache is used to retain potentially
713expensive to compute information across restarts. If the location
714does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700715+
David Pursehousea61ee502016-09-06 16:27:09 +0900716Technically, cached entities are persisted as a set of H2 databases
Saša Živkove607d6c2016-02-24 10:46:46 +0000717inside this directory.
718+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700719If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700720+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700721Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700722
Thomas Draebinge5dcc602020-04-20 15:40:54 +0200723[[cache.enableDiskStatMetrics]]cache.enableDiskStatMetrics::
724+
725Whether to enable the computation of disk statistics of persistent caches.
726This computation is expensive and requires a long time on larger installations.
727+
728By default, false.
729
Saša Živkovf3134572016-02-09 11:42:46 +0100730[[cache.h2CacheSize]]cache.h2CacheSize::
731+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200732The size of the in-memory cache for each opened H2 cache database, in bytes.
Saša Živkove607d6c2016-02-24 10:46:46 +0000733+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200734Some caches of Gerrit are persistent and are backed by an H2 database.
Saša Živkove607d6c2016-02-24 10:46:46 +0000735H2 uses memory to cache its database content. The parameter `h2CacheSize`
736allows to limit the memory used by H2 and thus prevent out-of-memory
Saša Živkovf3134572016-02-09 11:42:46 +0100737caused by the H2 database using too much memory.
738+
Dave Borowitz3d1f85c2018-11-16 15:36:04 -0800739Technically the H2 cache size is configured using the CACHE_SIZE parameter in
740the H2 JDBC connection URL, as described
Marian Harbach34253372019-12-10 18:01:31 +0100741link:http://www.h2database.com/html/features.html#cache_settings[here,role=external,window=_blank]
Saša Živkovf3134572016-02-09 11:42:46 +0100742+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200743Default is unset, using up to half of the available memory.
David Pursehousee6976dc2017-06-30 16:33:44 +0900744+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200745H2 will persist this value in the database, so to unset explicitly specify 0.
Saša Živkovf3134572016-02-09 11:42:46 +0100746+
747Common unit suffixes of 'k', 'm', or 'g' are supported.
748
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200749[[cache.h2AutoServer]]cache.h2AutoServer::
750+
751If set to true, enable H2 autoserver mode for the H2-backed persistent cache
752databases.
753+
Marian Harbach34253372019-12-10 18:01:31 +0100754See link:http://www.h2database.com/html/features.html#auto_mixed_mode[here,role=external,window=_blank]
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200755for detail.
756+
757Default is false.
758
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700759[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700760+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700761Maximum age to keep an entry in the cache. Entries are removed from
762the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700763Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700764+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700765* s, sec, second, seconds
766* m, min, minute, minutes
767* h, hr, hour, hours
768* d, day, days
769* w, week, weeks (`1 week` is treated as `7 days`)
770* mon, month, months (`1 month` is treated as `30 days`)
771* y, year, years (`1 year` is treated as `365 days`)
772
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700773+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200774--
Edwin Kempinabcd5042013-03-12 16:04:37 +0100775If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700776supplied, the maximum age is infinite and items are never purged
777except when the cache is full.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200778
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700779Default is `0`, meaning store forever with no expire, except:
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200780
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400781* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700782* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700783* `"web_sessions"`: default is `12 hours`
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200784--
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700785
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700786[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700787+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700788The total cost of entries to retain in memory. The cost computation
789varies by the cache. For most caches where the in-memory size of each
790entry is relatively the same, memoryLimit is currently defined to be
791the number of entries held by the cache (each entry costs 1).
792+
793For caches where the size of an entry can vary significantly between
794individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
795is an approximation of the total number of bytes stored by the cache.
796Larger entries that represent bigger patch sets or longer source files
797will consume a bigger portion of the memoryLimit. For these caches the
798memoryLimit should be set to roughly the amount of RAM (in bytes) the
799administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700800+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700801Default is 1024 for most caches, except:
802+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400803* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700804* `"diff"`: default is `10m` (10 MiB of memory)
805* `"diff_intraline"`: default is `10m` (10 MiB of memory)
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200806* `"diff_summary"`: default is `10m` (10 MiB of memory)
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400807* `"external_ids_map"`: default is `2` and should not be changed
Edwin Kempind967ec42017-11-13 15:14:41 +0100808* `"groups"`: default is unlimited
809* `"groups_byname"`: default is unlimited
810* `"groups_byuuid"`: default is unlimited
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700811* `"plugin_resources"`: default is 2m (2 MiB of memory)
812
813+
814If set to 0 the cache is disabled. Entries are removed immediately
815after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700816
Dave Borowitz08bac5ca2018-06-05 14:58:28 -0400817[[cache.name.expireFromMemoryAfterAccess]]cache.<name>.expireFromMemoryAfterAccess::
818+
819Time after last access to automatically expire entries from an in-memory
820cache. If 0 or not specified, entries are never expired in this manner.
821Values may use unit suffixes as in link:#cache.name.maxAge[maxAge].
822+
823This option only applies to in-memory caches; persistent cache values are
824not expired in this manner, and are only pruned via
825link:#cache.name.diskLimit[diskLimit].
826
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700827[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700828+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700829Total size in bytes of the keys and values stored on disk. Caches that
830have grown bigger than this size are scanned daily at 1 AM local
831server time to trim the cache. Entries are removed in least recently
832accessed order until the cache fits within this limit. Caches may
833grow larger than this during the day, as the size check is only
834performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700835+
Saša Živkove789f2e2016-09-22 10:37:34 +0200836Default is 128 MiB per cache, except:
837+
Dave Borowitzbab45862018-05-01 12:31:48 -0400838* `"change_notes"`: disk storage is disabled by default
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200839* `"diff_summary"`: default is `1g` (1 GiB of disk space)
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700840* `"external_ids_map"`: disk storage is disabled by default
Patrick Hieselc2c108c2020-07-23 09:54:22 +0200841* `"persisted_projects"`: default is `1g` (1 GiB of disk space)
Saša Živkove789f2e2016-09-22 10:37:34 +0200842
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700843+
Dave Borowitzdab51552018-05-14 16:35:37 -0700844If 0 or negative, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700845
Patrick Hieseld70f37f2020-04-16 14:12:31 +0200846[[cache.name.expireAfterWrite]]cache.<name>.expireAfterWrite::
847+
848Duration after which a cached value will be evicted and not
849read anymore.
850+
851Values should use common unit suffixes to express their setting:
852+
853* ms, milliseconds
854* s, sec, second, seconds
855* m, min, minute, minutes
856* h, hr, hour, hours
857+
858Disabled by default.
859
860[[cache.name.refreshAfterWrite]]cache.<name>.refreshAfterWrite::
861+
862Duration after which we asynchronously refresh the cached value.
863+
864Values should use common unit suffixes to express their setting:
865+
866* ms, milliseconds
867* s, sec, second, seconds
868* m, min, minute, minutes
869* h, hr, hour, hours
870+
871This applies only to these caches that support refreshing:
872+
873* `"projects"`: Caching project information in-memory. Defaults to 15 minutes.
874
875[[cache.refreshThreadPoolSize]]cache.refreshThreadPoolSize::
876+
877Number of threads that are available to refresh cached values that became
878out of date. This applies only to these caches that support refreshing:
879+
880* `"projects"`: Caching project information in-memory
881+
882Refreshes will only be scheduled on this executor if the values are
883out of sync.
884The check if they are is cheap and always happens on the thread that
885inquires for a cached value.
886+
Gal Paikince4e7c62020-08-28 18:47:32 +0300887When set to 0, a direct executor is used.
888+
Patrick Hieseld70f37f2020-04-16 14:12:31 +0200889Defaults to 2.
890
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800891==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700892
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700893cache `"accounts"`::
894+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700895Cache entries contain important details of an active user, including
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +0200896their display name, preferences, and known email addresses. Entry
Dave Borowitzada289c2018-12-18 13:24:14 -0800897information is obtained from NoteDb data in the `All-Users` repo.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700898
899+
Dave Borowitzada289c2018-12-18 13:24:14 -0800900If direct updates are made to `All-Users`, this cache should be flushed.
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700901
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400902cache `"adv_bases"`::
903+
904Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900905are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400906for the client to use as potential delta bases. Push over smart HTTP
907requires two HTTP requests, and this cache tries to carry state from
908the first request into the second to ensure it can complete.
909
Patrick Hiesel7575e882020-04-06 14:09:32 +0200910cache `"default_preferences"`::
911+
912Caches the server's default general, edit and diff preferences.
913+
914Default value is 1 to hold only the most current version in-memory.
915
Patrick Hieselace3dc92019-01-15 14:08:13 +0000916cache `"changes"`::
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200917+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200918The size of `memoryLimit` determines the number of projects for which
919all changes will be cached. If the cache is set to 1024, this means all
Patrick Hieselace3dc92019-01-15 14:08:13 +0000920changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800921+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000922Default value is 0 (disabled). It is disabled by default due to the fact
923that change updates are not communicated between Gerrit servers. Hence
Matthias Sohnd8182ba2019-12-09 14:50:23 +0100924this cache should be disabled in a cluster setup using multiple primary
925or multiple replica nodes.
Gustaf Lundh53493772012-11-18 18:41:15 -0800926+
Patrick Hieselace3dc92019-01-15 14:08:13 +0000927The cache should be flushed whenever the database changes table is modified
928outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200929
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700930cache `"diff"`::
931+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700932Each item caches the differences between two commits, at both the
933directory and file levels. Gerrit uses this cache to accelerate
934the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700935+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700936Entries in this cache are relatively large, so memoryLimit is an
937estimate in bytes of memory used. Administrators should try to target
938cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
939day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700940
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400941cache `"diff_intraline"`::
942+
943Each item caches the intraline difference of one file, when compared
944between two commits. Gerrit uses this cache to accelerate display of
945intraline differences when viewing a file.
946+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700947Entries in this cache are relatively large, so memoryLimit is an
948estimate in bytes of memory used. Administrators should try to target
949cache.diff.memoryLimit to fit all files users will view in a 1 or 2
950day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400951
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200952cache `"diff_summary"`::
Saša Živkove789f2e2016-09-22 10:37:34 +0200953+
954Each item caches list of file paths which are different between two
955commits. Gerrit uses this cache to accelerate computing of the list
956of paths of changed files.
957+
958Ideally, disk limit of this cache is large enough to cover all changes.
959This should significantly speed up change reindexing, especially
960full offline reindexing.
961
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400962cache `"external_ids_map"`::
963+
964A singleton cache whose sole entry is a map of the parsed representation
Dave Borowitz70dfbd62018-06-05 13:30:48 -0400965of link:config-accounts.html#external-ids[all current external IDs]. The
966cache may temporarily contain 2 entries, but the second one is promptly
967expired.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400968+
Dave Borowitzb20d23a82018-08-21 13:43:10 -0700969It is not recommended to change the in-memory attributes of this cache
970away from the defaults. The cache may be persisted by setting
971`diskLimit`, which is only recommended if cold start performance is
972problematic.
Patrick Hiesel42b47b12019-07-22 09:32:37 +0200973+
974`external_ids_map` supports computing the new cache value based on a
975previously cached state. This applies modifications based on the Git
976diff and is almost always faster.
977`cache.external_ids_map.enablePartialReloads` turns this behavior on
Patrick Hieselc486edf2019-08-19 15:55:17 +0200978or off. The default is `true`.
Dave Borowitz6f7fa0a2018-06-05 13:30:48 -0400979
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700980cache `"git_tags"`::
981+
982If branch or reference level READ access controls are used, this
983cache tracks which tags are reachable from the branch tips of a
984repository. Gerrit uses this information to determine the set
985of tags that a client may access, derived from which tags are
986part of the history of a visible branch.
987+
988The cache is persisted to disk across server restarts as it can
989be expensive to compute (60 or more seconds for a large history
990like the Linux kernel repository).
991
Youssef Elghareeb3d549302020-07-15 17:08:28 +0200992cache `"comment_context"`::
993+
994Caches the context lines of comments, which are the lines of the source file
995highlighted by the user when the comment was written.
996
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700997cache `"groups"`::
998+
Edwin Kempin3091e112017-11-13 15:23:58 +0100999Caches the basic group information of internal groups by group ID,
1000including the group owner, name, and description.
1001+
Edwin Kempind967ec42017-11-13 15:14:41 +01001002For this cache it is important to configure a size that is larger than
1003the number of internal Gerrit groups, otherwise general Gerrit
1004performance may be poor. This is why by default this cache is
1005unlimited.
1006+
Edwin Kempin3091e112017-11-13 15:23:58 +01001007External group membership obtained from LDAP is cached under
1008`"ldap_groups"`.
1009
1010cache `"groups_byname"`::
1011+
1012Caches the basic group information of internal groups by group name,
1013including the group owner, name, and description.
1014+
Edwin Kempind967ec42017-11-13 15:14:41 +01001015For this cache it is important to configure a size that is larger than
1016the number of internal Gerrit groups, otherwise general Gerrit
1017performance may be poor. This is why by default this cache is
1018unlimited.
1019+
Edwin Kempin3091e112017-11-13 15:23:58 +01001020External group membership obtained from LDAP is cached under
1021`"ldap_groups"`.
1022
1023cache `"groups_byuuid"`::
1024+
1025Caches the basic group information of internal groups by group UUID,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001026including the group owner, name, and description.
1027+
Edwin Kempind967ec42017-11-13 15:14:41 +01001028For this cache it is important to configure a size that is larger than
1029the number of internal Gerrit groups, otherwise general Gerrit
1030performance may be poor. This is why by default this cache is
1031unlimited.
1032+
Alice Kober-Sotzekeab33202017-09-27 13:54:30 +02001033External group membership obtained from LDAP is cached under
1034`"ldap_groups"`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001035
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +02001036cache `"groups_bymember"`::
Matt Fischer620255a2011-03-22 14:28:23 -05001037+
Alice Kober-Sotzek864ed142017-10-12 14:24:36 +02001038Caches the groups which contain a specific member (account). If direct
1039updates are made to the `account_group_members` table, this cache should
1040be flushed.
1041
Alice Kober-Sotzek3e1fe1b2017-10-12 14:44:17 +02001042cache `"groups_bysubgroups"`::
1043+
1044Caches the parent groups of a subgroup. If direct updates are made
Matt Fischer620255a2011-03-22 14:28:23 -05001045to the `account_group_includes` table, this cache should be flushed.
1046
Youssef Elghareebf08d4b32020-03-26 18:02:15 +01001047cache `"groups_external"`::
1048+
1049Caches all the external groups available to Gerrit. The cache holds a
1050single entry which maps to the latest available of all external groups'
1051UUIDs. This cache uses "groups_external_persisted" to load its value.
1052
1053cache `"groups_external_persisted"`::
1054+
1055Caches all external groups available to Gerrit at some point in history.
1056The cache key is representation of a specific groups state in NoteDb and
1057the value is the list of all external groups.
1058The cache is persisted to enhance performance.
1059
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07001060cache `"ldap_groups"`::
1061+
1062Caches the LDAP groups that a user belongs to, if LDAP has been
1063configured on this server. This cache should be configured with a
1064low maxAge setting, to ensure LDAP modifications are picked up in
1065a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001066
Gustaf Lundh0919a492012-10-19 15:29:23 +02001067cache `"ldap_groups_byinclude"`::
1068+
1069Caches the hierarchical structure of LDAP groups.
1070
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -07001071cache `"ldap_usernames"`::
1072+
1073Caches a mapping of LDAP username to Gerrit account identity. The
1074cache automatically updates when a user first creates their account
1075within Gerrit, so the cache expire time is largely irrelevant.
1076
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -07001077cache `"permission_sort"`::
1078+
David Pursehouse221d4f62012-06-08 17:38:08 +09001079Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -07001080reference. Sorting the sections can be expensive when regular
1081expressions are used, so this cache remembers the ordering for
1082each branch.
1083
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001084cache `"plugin_resources"`::
1085+
1086Caches formatted plugin resources, such as plugin documentation that
1087has been converted from Markdown to HTML. The memoryLimit refers to
1088the bytes of memory dedicated to storing the documentation.
1089
Patrick Hieselc2c108c2020-07-23 09:54:22 +02001090cache `"persisted_projects"`::
1091+
1092Caches the project description records, from the `refs/meta/config`
1093branch of each project. This is the persisted variant of the
1094`projects` cache. The intention is for this cache to have an in-memory
1095size of 0.
1096
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001097cache `"projects"`::
1098+
Patrick Hieselc2c108c2020-07-23 09:54:22 +02001099Caches the project description records, from the `refs/meta/config`
1100branch of each project. If a project record is updated or deleted, this
Shawn O. Pearce4a452712009-05-28 20:12:33 -07001101cache should be flushed. Newly inserted projects do not require
1102a cache flush, as they will be read upon first reference.
1103
Dave Borowitz08aa8bb2018-04-05 12:01:06 -04001104cache `"prolog_rules"`::
1105+
1106Caches parsed `rules.pl` contents for each project. This cache uses the same
1107size as the `projects` cache, and cannot be configured independently.
1108
Patrick Hiesela57c0d62019-02-19 09:09:22 +01001109cache `"pure_revert"`::
1110+
1111Result of checking if one change or commit is a pure/clean revert of
1112another.
1113
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07001114cache `"sshkeys"`::
1115+
1116Caches unpacked versions of user SSH keys, so the internal SSH daemon
1117can match against them during authentication. The unit of storage
1118is per-user, so 1024 items translates to 1024 unique user accounts.
1119As each individual user account may configure multiple SSH keys,
1120the total number of keys may be larger than the item count.
1121
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001122cache `"web_sessions"`::
1123+
1124Tracks the live user sessions coming in over HTTP. Flushing this
1125cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -07001126them to sign-in again. To avoid breaking active users, this cache
1127is not flushed automatically by `gerrit flush-caches --all`, but
1128instead must be explicitly requested.
1129+
1130If no disk cache is configured (or `cache.web_sessions.diskLimit`
1131is set to 0) a server restart will force all users to sign-out,
1132and need to sign-in again after the restart, as the cache was
1133unable to persist the session information. Enabling a disk cache
1134is strongly recommended.
1135+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -07001136Session storage is relatively inexpensive. The average entry in
1137this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -07001138
Shawn O. Pearce4016a932009-05-28 15:12:40 -07001139See also link:cmd-flush-caches.html[gerrit flush-caches].
1140
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001141==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001142
Hugo Arès2bc86812015-03-09 15:20:28 -04001143[[cache.diff.timeout]]cache.diff.timeout::
1144+
1145Maximum number of milliseconds to wait for diff data before giving up and
1146falling back on a simpler diff algorithm that will not be able to break down
1147modified regions into smaller ones. This is a work around for an infinite loop
1148bug in the default difference algorithm implementation.
1149+
1150Values should use common unit suffixes to express their setting:
1151+
1152* ms, milliseconds
1153* s, sec, second, seconds
1154* m, min, minute, minutes
1155* h, hr, hour, hours
1156
1157+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001158--
Hugo Arès2bc86812015-03-09 15:20:28 -04001159If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001160
Hugo Arès2bc86812015-03-09 15:20:28 -04001161Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001162--
Hugo Arès2bc86812015-03-09 15:20:28 -04001163
Edwin Kempin42d27432013-11-24 17:06:24 +01001164[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001165+
1166Maximum number of milliseconds to wait for intraline difference data
1167before giving up and disabling it for a particular file pair. This is
1168a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +09001169implementation.
1170+
1171If computation takes longer than the timeout, the worker thread is
1172terminated, an error message is shown, and no intraline difference is
1173displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001174+
1175Values should use common unit suffixes to express their setting:
1176+
1177* ms, milliseconds
1178* s, sec, second, seconds
1179* m, min, minute, minutes
1180* h, hr, hour, hours
1181
1182+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001183--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001184If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001185
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001186Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001187--
Shawn O. Pearce617aa392010-11-15 14:03:28 -08001188
Edwin Kempin42d27432013-11-24 17:06:24 +01001189[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001190+
1191Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001192when populating a diff cache entry. This flag is provided primarily
1193as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +09001194necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -08001195this setting will fallback to `cache.diff.intraline` if not set in the
1196configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -08001197+
1198Default is true, enabled.
1199
Simon Leifc19ff12014-10-02 13:36:00 -04001200[[cache.projects.loadOnStartup]]cache.projects.loadOnStartup::
1201+
1202If the project cache should be loaded during server startup.
1203+
1204The cache is loaded concurrently. Admins should ensure that the cache
1205size set under <<cache.name.memoryLimit,cache.projects.memoryLimit>>
1206is not smaller than the number of repos.
1207+
1208Default is false, disabled.
1209
1210[[cache.projects.loadThreads]]cache.projects.loadThreads::
1211+
1212Only relevant if <<cache.projects.loadOnStartup,cache.projects.loadOnStartup>>
1213is true.
1214+
1215The number of threads to allocate for loading the cache at startup. These
1216threads will die out after the cache is loaded.
1217+
1218Default is the number of CPUs.
1219
Shawn Pearce67a33302016-08-11 11:51:59 -07001220
1221[[capability]]
1222=== Section capability
1223
1224[[capability.administrateServer]]capability.administrateServer::
1225+
1226Names of groups of users that are allowed to exercise the
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001227`administrateServer` capability, in addition to those listed in
Shawn Pearce67a33302016-08-11 11:51:59 -07001228All-Projects. Configuring this option can be a useful fail-safe
1229to recover a server in the event an administrator removed all
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001230groups from the `administrateServer` capability, or to ensure that
Shawn Pearce67a33302016-08-11 11:51:59 -07001231specific groups always have administration capabilities.
1232+
1233----
1234[capability]
1235 administrateServer = group Fail Safe Admins
1236----
1237+
1238The configuration file uses group names, not UUIDs. If a group is
1239renamed the gerrit.config file must be updated to reflect the new
1240name. If a group cannot be found for the configured name a warning
1241is logged and the server will continue normal startup.
1242+
1243If not specified (default), only the groups listed by All-Projects
Edwin Kempin53d52ba2017-06-09 10:57:43 +02001244may use the `administrateServer` capability.
1245
1246[[capability.makeFirstUserAdmin]]capability.makeFirstUserAdmin::
1247+
1248Whether the first user that logs in to the Gerrit server should
1249automatically be added to the administrator group and hence get the
1250`administrateServer` capability assigned. This is useful to bootstrap
1251the authentication database.
1252+
1253Default is true.
Shawn Pearce67a33302016-08-11 11:51:59 -07001254
1255
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001256[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001257=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -07001258
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001259[[change.allowBlame]]change.allowBlame::
1260+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001261Allow blame on side by side diff. If set to false, blame cannot be used.
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001262+
1263Default is true.
1264
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001265[[change.cacheAutomerge]]change.cacheAutomerge::
1266+
Sven Selberg0299e252020-05-05 16:16:41 +02001267When reviewing merge commits, the left-hand side shows the output of the
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001268result of JGit's automatic merge algorithm. This option controls whether
1269this output is cached in the change repository, or if only the diff is
1270cached in the persistent `diff` cache.
1271+
1272If true, automerge results are stored in the repository under
1273`refs/cache-automerge/*`; the results of diffing the change against its
1274automerge base are stored in the diff cache. If false, no extra data is
1275stored in the repository, only the diff cache. This can result in slight
1276performance improvements by reducing the number of refs in the repo.
1277+
1278Default is true.
1279
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001280[[change.commentSizeLimit]]change.commentSizeLimit::
1281+
1282Maximum allowed size in characters of a regular (non-robot) comment. Comments
1283which exceed this size will be rejected. Size computation is approximate and may
1284be off by roughly 1%. Common unit suffixes of 'k', 'm', or 'g' are supported.
1285The value must be positive.
1286+
Joerg Zierenfaea7e12020-04-06 10:44:46 +02001287The default limit is 16kiB.
1288
1289[[change.cumulativeCommentSizeLimit]]change.cumulativeCommentSizeLimit::
1290+
1291Maximum allowed size in characters of all comments (including robot comments)
1292and change messages. Size computation is approximate and may be off by roughly
12931%. Common unit suffixes of 'k', 'm', or 'g' are supported.
1294+
1295The default limit is 3MiB.
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001296
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001297[[change.disablePrivateChanges]]change.disablePrivateChanges::
Patrick Hieseldb8df482019-01-24 10:11:23 +01001298+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001299If set to true, users are not allowed to create private changes.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001300+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001301The default is false.
1302
Ben Rohlfs2cc33542020-02-28 12:44:09 +01001303[[change.enableAttentionSet]]change.enableAttentionSet::
1304+
1305If set to true, then all UI features for using and interacting with the
1306attention set are enabled.
1307+
1308The default is false for now, but will be changed to true in Q2 2020.
1309
1310[[change.enableAssignee]]change.enableAssignee::
1311+
1312If set to true, then all UI features for using and interacting with the
1313assignee are enabled.
1314+
1315The default is true for now, but will be changed to false in Q2 2020.
1316
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001317[[change.largeChange]]change.largeChange::
1318+
1319Number of changed lines from which on a change is considered as a large
1320change. The number of changed lines of a change is the sum of the lines
1321that were inserted and deleted in the change.
1322+
1323The specified value is used to visualize the change sizes in the Web UI
1324in change tables and user dashboards.
1325+
1326By default 500.
1327
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001328[[change.maxComments]]change.maxComments::
1329+
1330Maximum number of comments (regular plus robot) allowed per change. Additional
1331comments are rejected.
1332+
1333By default 5,000.
1334
Dave Borowitzca614bc2019-04-15 15:29:15 -07001335[[change.maxUpdates]]change.maxUpdates::
1336+
1337Maximum number of updates to a change. Counts only updates to the main NoteDb
1338meta ref; draft comments, robot comments, stars, etc. do not count towards the
1339total.
1340+
1341Many NoteDb operations require walking the entire change meta ref and loading
1342its contents into memory, so changes with arbitrarily many updates may cause
1343high CPU usage, memory pressure, persistent cache bloat, and other problems.
1344+
Dave Borowitz18e7b552019-04-17 07:53:38 -07001345The following operations are allowed even when a change is at the limit:
Edwin Kempinf2f815b2020-01-22 17:09:16 +01001346
Dave Borowitz18e7b552019-04-17 07:53:38 -07001347* Abandon
1348* Submit
1349* Submit by push with `%submit`
1350* Auto-close by pushing directly to the branch
1351* Fix with link:rest-api-changes.html#fix-input[`expect_merged_as`]
Edwin Kempinf2f815b2020-01-22 17:09:16 +01001352
Dave Borowitzca614bc2019-04-15 15:29:15 -07001353By default 1000.
1354
Patrick Hiesela4824db2019-12-20 10:55:26 +01001355[[change.mergeabilityComputationBehavior]]change.mergeabilityComputationBehavior::
1356+
1357This setting determines when Gerrit computes if a change is mergeable or not.
1358This computation is expensive, especially when the repository is large or when
1359there are many open changes.
1360+
1361This config can have the following states:
1362+
1363* `API_REF_UPDATED_AND_CHANGE_REINDEX`: Gerrit indexes `mergeability` enabling
1364 the `is:mergeable` predicate in change search and allowing fast retrieval of
1365 this bit in query responses. Gerrit will always serve `mergeable` in
1366 link:rest-api-changes.html#change-info[ChangeInfo] objects.
1367 Gerrit will reindex all open changes when the target ref advances (expensive).
1368* `REF_UPDATED_AND_CHANGE_REINDEX`: Gerrit indexes `mergeability` enabling the
1369 `is:mergeable` predicate in change search and allowing fast retrieval of this
1370 bit in query responses. Gerrit will never serve `mergeable` in
1371 link:rest-api-changes.html#change-info[ChangeInfo]
1372 objects. This state can be a final state for instances that only want to
1373 optimize the read path, but not the write path for speed or serve as an
1374 intermediary step for instances that want to optimize both and need to migrate
1375 callers of their API.
1376 Gerrit will reindex all open changes when the target ref advances (expensive).
1377* `NEVER`: Gerrit does not index `mergeable`, so `is:mergeable` is disabled as
1378 query operator. Gerrit does not serve `mergeable` in
1379 link:rest-api-changes.html#change-info[ChangeInfo].
1380
1381Default is `REF_UPDATED_AND_CHANGE_REINDEX`.
1382
Edwin Kempin67229a42019-10-08 09:13:34 +02001383[[change.move]]change.move::
1384+
1385Whether the link:rest-api-changes.html#move-change[Move Change] REST
1386endpoint is enabled.
1387+
1388The move change functionality has some corner cases with undesired side
1389effects. Hence administrators may decide to disable this functionality.
1390In particular, if a change that has dependencies on other changes is
1391moved to a new branch, and the moved change gets submitted to the new
1392branch, the changes on which the change depends are silently merged
1393into the new branch, although these changes have not been moved to that
1394branch (see details in
1395link:https://bugs.chromium.org/p/gerrit/issues/detail?id=9877[issue
13969877]).
1397+
1398By default true.
1399
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001400[[change.replyLabel]]change.replyLabel::
1401+
1402Label name for the reply button. In the user interface an ellipsis (…)
1403is appended.
1404+
1405Default is "Reply". In the user interface it becomes "Reply…".
1406
1407[[change.replyTooltip]]change.replyTooltip::
1408+
1409Tooltip for the reply button. In the user interface a note about the
1410keyboard shortcut is appended.
1411+
1412Default is "Reply and score". In the user interface it becomes "Reply
1413and score (Shortcut: a)".
1414
1415[[change.robotCommentSizeLimit]]change.robotCommentSizeLimit::
1416+
Joerg Zieren7cac5d12020-01-02 10:18:14 +01001417Maximum allowed size in characters of a robot comment. Robot comments which
1418exceed this size will be rejected on addition. Size computation is approximate
1419and may be off by roughly 1%. Common unit suffixes of 'k', 'm', or 'g' are
1420supported. Zero or negative values allow robot comments of unlimited size.
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001421+
Joerg Zierenfaea7e12020-04-06 10:44:46 +02001422The default limit is 1MiB.
Patrick Hieseldb8df482019-01-24 10:11:23 +01001423
Gal Paikin02d6ba62020-07-13 23:49:24 +03001424[[change.sendNewPatchsetEmails]]change.sendNewPatchsetEmails::
1425+
1426When false, emails will not be sent to owners, reviewers, and cc for
1427creating a new patchset unless they are project watchers or have starred
1428the change.
1429+
1430Default is true.
1431
Luca Milanesiof2a275b2017-04-10 10:59:34 +01001432[[change.showAssigneeInChangesTable]]change.showAssigneeInChangesTable::
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001433+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001434Show assignee field in changes table. If set to false, assignees will
1435not be visible in changes table.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001436+
Luca Milanesio50057ff2017-04-06 09:59:11 +01001437Default is false.
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001438
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001439[[change.strictLabels]]change.strictLabels::
1440+
1441Reject invalid label votes: invalid labels or invalid values. This
David Pursehouse33495ab2019-10-31 09:38:43 +09001442configuration option is provided for backwards compatibility and may
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001443be removed in future gerrit versions.
1444+
1445Default is false.
1446
David Ostrovsky9933eb32014-05-20 16:08:20 +02001447[[change.submitLabel]]change.submitLabel::
1448+
1449Label name for the submit button.
1450+
1451Default is "Submit".
1452
Stefan Beller7c380d512015-08-21 10:55:21 -07001453[[change.submitLabelWithParents]]change.submitLabelWithParents::
1454+
1455Label name for the submit button if the change has parents which will
1456be submitted together with this change.
1457+
1458Default is "Submit including parents".
1459
David Ostrovsky9933eb32014-05-20 16:08:20 +02001460[[change.submitTooltip]]change.submitTooltip::
1461+
1462Tooltip for the submit button. Variables available for replacement
1463include `${patchSet}` for the current patch set number (1, 2, 3),
1464`${branch}` for the branch name ("master") and `${commit}` for the
1465abbreviated commit SHA-1 (`c9c0edb`).
1466+
1467Default is "Submit patch set ${patchSet} into ${branch}".
1468
Stefan Beller0e655542015-07-20 21:14:38 -07001469[[change.submitTooltipAncestors]]change.submitTooltipAncestors::
1470+
1471Tooltip for the submit button if there are ancestors which would
1472also be submitted by submitting the change. Additionally to the variables
1473as in link:#change.submitTooltip[change.submitTooltip], there is the
1474variable `${submitSize}` indicating the number of changes which are
1475submitted.
1476+
1477Default is "Submit all ${topicSize} changes of the same topic (${submitSize}
1478changes including ancestors and other changes related by topic)".
1479
Stefan Bellera038cf72015-01-13 16:25:10 -08001480[[change.submitTopicLabel]]change.submitTopicLabel::
1481+
1482If `change.submitWholeTopic` is set and a change has a topic,
1483the label name for the submit button is given here instead of
1484the configuration `change.submitLabel`.
1485+
1486Defaults to "Submit whole topic"
1487
1488[[change.submitTopicTooltip]]change.submitTopicTooltip::
1489+
David Pursehousea61ee502016-09-06 16:27:09 +09001490If `change.submitWholeTopic` is configured to true and a change has a
Stefan Bellera038cf72015-01-13 16:25:10 -08001491topic, this configuration determines the tooltip for the submit button
1492instead of `change.submitTooltip`. The variable `${topicSize}` is available
Stefan Beller7c380d512015-08-21 10:55:21 -07001493for the number of changes in the same topic to be submitted. The number of
1494all changes to be submitted is in the variable `${submitSize}`.
Stefan Bellera038cf72015-01-13 16:25:10 -08001495+
Stefan Beller7c380d512015-08-21 10:55:21 -07001496Defaults to "Submit all ${topicSize} changes of the same topic
1497(${submitSize} changes including ancestors and other
1498changes related by topic)".
Stefan Bellera038cf72015-01-13 16:25:10 -08001499
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001500[[change.submitWholeTopic]]change.submitWholeTopic::
Richard Möhne4abe9a2014-11-13 20:05:13 +01001501+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001502Determines if the submit button submits the whole topic instead of
1503just the current change.
David Ostrovskya304aff2018-04-05 23:07:51 +02001504+
1505Default is false.
1506
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001507[[change.updateDelay]]change.updateDelay::
Changcheng Xiao16095352017-12-18 10:03:08 +01001508+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001509How often in seconds the web interface should poll for updates to the
1510currently open change. The poller relies on the client's browser
1511cache to use If-Modified-Since and respect `304 Not Modified` HTTP
1512responses. This allows for fast polls, often under 8 milliseconds.
Changcheng Xiao16095352017-12-18 10:03:08 +01001513+
Dave Borowitz1f85d3a2019-04-16 12:16:04 -07001514With a configured 30 second delay a server with 4900 active users will
1515typically need to dedicate 1 CPU to the update check. 4900 users
1516divided by an average delay of 30 seconds is 163 requests arriving per
1517second. If requests are served at \~6 ms response time, 1 CPU is
1518necessary to keep up with the update request traffic. On a smaller
1519user base of 500 active users, the default 30 second delay is only 17
1520requests per second and requires ~10% CPU.
1521+
1522If 0 the update polling is disabled.
1523+
1524Default is 5 minutes.
Changcheng Xiao16095352017-12-18 10:03:08 +01001525
Edwin Kempine326a1d2015-06-03 10:27:39 +02001526[[changeCleanup]]
1527=== Section changeCleanup
1528
1529This section allows to configure change cleanups and schedules them to
1530run periodically.
1531
1532[[changeCleanup.abandonAfter]]changeCleanup.abandonAfter::
1533+
1534Period of inactivity after which open changes should be abandoned
1535automatically.
1536+
1537By default `0`, never abandon open changes.
1538+
1539[WARNING] Auto-Abandoning changes may confuse/annoy users. When
1540enabling this, make sure to choose a reasonably large grace period and
1541inform users in advance.
1542+
1543The following suffixes are supported to define the time unit:
1544+
1545* `d, day, days`
1546* `w, week, weeks` (`1 week` is treated as `7 days`)
1547* `mon, month, months` (`1 month` is treated as `30 days`)
1548* `y, year, years` (`1 year` is treated as `365 days`)
1549
Edwin Kempin7080ef12015-06-10 15:03:09 +02001550[[changeCleanup.abandonIfMergeable]]changeCleanup.abandonIfMergeable::
1551+
David Pursehousef4bc2562019-12-04 09:55:40 +09001552Whether changes which are mergeable should be auto-abandoned. When set
1553to `false`, `-is:mergeable` is appended to the query used to find
1554the changes to auto-abandon.
Edwin Kempin7080ef12015-06-10 15:03:09 +02001555+
David Pursehousef4bc2562019-12-04 09:55:40 +09001556By default `true`, meaning mergeable changes are auto-abandoned.
1557+
Patrick Hiesela4824db2019-12-20 10:55:26 +01001558If
1559link:#change.mergeabilityComputationBehavior[`change.mergeabilityComputationBehavior`]
1560is set to `NEVER`, setting this option to `false` has no effect and it behaves
1561as though it were set to `true`.
Edwin Kempin7080ef12015-06-10 15:03:09 +02001562
Jacek Centkowski36d35212019-05-13 14:32:00 +02001563[[changeCleanup.cleanupAccountPatchReview]]changeCleanup.cleanupAccountPatchReview::
1564+
1565Whether accountPatchReview data should be also removed when change
1566gets auto-abandoned.
1567+
1568By default `false`.
1569
Edwin Kempine326a1d2015-06-03 10:27:39 +02001570[[changeCleanup.abandonMessage]]changeCleanup.abandonMessage::
1571+
1572Change message that should be posted when a change is abandoned.
1573+
1574'${URL}' can be used as a placeholder for the Gerrit web URL.
1575+
1576By default "Auto-Abandoned due to inactivity, see
1577${URL}Documentation/user-change-cleanup.html#auto-abandon\n\n
1578If this change is still wanted it should be restored.".
1579
1580[[changeCleanup.startTime]]changeCleanup.startTime::
1581+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001582The link:#schedule-configuration-startTime[start time] for running
1583change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001584
1585[[changeCleanup.interval]]changeCleanup.interval::
1586+
Edwin Kempind33d95a2018-02-16 11:44:04 +01001587The link:#schedule-configuration-interval[interval] for running
1588change cleanups.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001589
Edwin Kempind33d95a2018-02-16 11:44:04 +01001590link:#schedule-configuration-examples[Schedule examples] can be found
1591in the link:#schedule-configuration[Schedule Configuration] section.
Edwin Kempine326a1d2015-06-03 10:27:39 +02001592
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001593[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001594=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001595
Brad Larson991a31b2009-11-03 14:30:26 -06001596Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -05001597patch comments, in-line code comments and approval category value descriptions
1598to turn set strings into hyperlinks. One common use is for linking to
1599bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -06001600
1601In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001602will match typical Gerrit Change-Id values and create a hyperlink
1603to changes which reference it. The second configuration 'bugzilla'
1604will hyperlink terms such as 'bug 42' to an external bug tracker,
1605supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +09001606configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001607how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -06001608
Sven Selberg2a0beab2018-04-20 14:49:20 +02001609commentlinks supports link:#reloadConfig[configuration reloads]. Though a
Gustaf Lundhca7eb792018-04-16 10:56:03 +02001610link:cmd-flush-caches.html[flush-caches] of "projects" is needed for the
1611commentlinks to be immediately available in the UI.
1612
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001613----
1614[commentlink "changeid"]
1615 match = (I[0-9a-f]{8,40})
David Pursehouse9f68e1a2016-01-28 09:21:03 +00001616 link = "#/q/$1"
Brad Larson991a31b2009-11-03 14:30:26 -06001617
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001618[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001619 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001620 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -06001621
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001622[commentlink "tracker"]
1623 match = ([Bb]ug:\\s+)(\\d+)
1624 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
1625----
1626
Dave Borowitz13b38002013-04-08 12:03:29 -07001627Comment links can also be specified in `project.config` and sections in
1628children override those in parents. The only restriction is that to
1629avoid injecting arbitrary user-supplied HTML in the page, comment links
1630defined in `project.config` may only supply `link`, not `html`.
1631
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001632[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -06001633+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001634A JavaScript regular expression to match positions to be replaced
1635with a hyperlink. Subexpressions of the matched string can be
1636stored using groups and accessed with `$'n'` syntax, where 'n'
1637is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -06001638+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001639The configuration file parser eats one level of backslashes, so the
1640character class `\s` requires `\\s` in the configuration file. The
1641parser also terminates the line at the first `#`, so a match
1642expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001643+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -08001644To match case insensitive strings, a character class with both the
1645upper and lower case character for each position must be used. For
1646example, to match the string `bug` in a case insensitive way the match
1647pattern `[bB][uU][gG]` needs to be used.
1648+
David Ostrovsky7163dac2017-07-29 06:49:38 +02001649The commentlink.name.match regular expressions are applied to the raw,
1650unformatted and unescaped text form. Regex matching against HTML is not
1651supported. Comment link patterns that are written in this style should
1652be updated to match text formats.
Matthew Webbercd7d2bf2015-10-14 15:54:06 +01001653+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001654A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -06001655
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001656[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -06001657+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001658The URL to direct the user to whenever the regular expression is
1659matched. Groups in the match expression may be accessed as `$'n'`.
1660+
1661The link property is used only when the html property is not present.
1662
1663[[commentlink.name.html]]commentlink.<name>.html::
1664+
1665HTML to replace the entire matched string with. If present,
1666this property overrides the link property above. Groups in the
1667match expression may be accessed as `$'n'`.
1668+
1669The configuration file eats double quotes, so escaping them as
1670`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -06001671
Dave Borowitz82d79c02013-04-08 15:45:12 -07001672[[commentlink.name.enabled]]commentlink.<name>.enabled::
1673+
1674Whether the comment link is enabled. A child project may override a
1675section in a parent or the site-wide config that is disabled by
1676specifying `enabled = true`.
1677+
1678Disabling sections in `gerrit.config` can be used by site administrators
1679to create a library of comment links with `html` set that are not
1680user-supplied and thus can be verified to be XSS-free, but are only
1681enabled for a subset of projects.
1682+
David Pursehouse6f1af472013-12-11 19:23:33 +09001683By default, true.
1684+
Dave Borowitz82d79c02013-04-08 15:45:12 -07001685Note that the names and contents of disabled sections are visible even
1686to anonymous users via the
1687link:rest-api-projects.html#get-config[REST API].
1688
Brad Larson991a31b2009-11-03 14:30:26 -06001689
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001690[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001691=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001692
1693These settings are applied only if Gerrit is started as the container
1694process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
1695
1696[[container.heapLimit]]container.heapLimit::
1697+
1698Maximum heap size of the Java process running Gerrit, in bytes.
1699This property is translated into the '-Xmx' flag for the JVM.
1700+
1701Default is platform and JVM specific.
1702+
1703Common unit suffixes of 'k', 'm', or 'g' are supported.
1704
1705[[container.javaHome]]container.javaHome::
1706+
1707Path of the JRE/JDK installation to run Gerrit with. If not set, the
1708Gerrit startup script will attempt to search your system and guess
1709a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
1710
1711[[container.javaOptions]]container.javaOptions::
1712+
David Pursehousea13052b2020-02-10 14:26:08 +09001713Additional options to pass along to the Java runtime. May be specified
1714multiple times to configure multiple values. If multiple values are
1715configured, they are passed in order on the command line, separated by
1716spaces. These options are appended onto 'JAVA_OPTIONS'.
David Pursehousea70a60c2020-02-10 14:22:43 +09001717+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001718For example, it is possible to overwrite Gerrit's default log4j
1719configuration:
David Pursehousea70a60c2020-02-10 14:22:43 +09001720+
David Ostrovskyc772bd82013-10-03 10:37:51 +02001721----
1722 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
1723----
1724
Hugo Arès6710f0a2014-11-04 10:28:42 -05001725[[container.daemonOpt]]container.daemonOpt::
1726+
1727Additional options to pass to the daemon (e.g. '--enable-httpd'). If
1728multiple values are configured, they are passed in that order to the command
1729line, separated by spaces.
1730+
1731Execute `java -jar gerrit.war daemon --help` to see all possible
1732options.
1733
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001734[[container.replica]]container.replica::
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001735+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02001736Used on Gerrit replica installations. If set to true the Gerrit JVM is
1737called with the '--replica' switch, enabling replica mode. If no value is
Matthias Sohnd8182ba2019-12-09 14:50:23 +01001738set (or any other value), Gerrit defaults to primary mode enabling write
1739operations.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001740
David Ostrovsky21fca752019-10-18 08:50:29 +02001741[[container.slave]]container.slave::
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001742+
Christian Aistleitnerde8b0722020-06-20 22:17:23 +02001743Backward compatibility for link:#container.replica[`container.replica`]
1744config setting.
Han-Wen Nienhuysa51f1c02019-10-14 18:56:01 +02001745
Khai Do6168beb2016-12-19 17:26:28 -08001746[[container.startupTimeout]]container.startupTimeout::
1747+
1748The maximum time (in seconds) to wait for a gerrit.sh start command
1749to run a new Gerrit daemon successfully. If not set, defaults to
175090 seconds.
1751
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001752[[container.user]]container.user::
1753+
1754Login name (or UID) of the operating system user the Gerrit JVM
1755will execute as. If not set, defaults to the user who launched
1756the 'gerrit.sh' wrapper script.
1757
1758[[container.war]]container.war::
1759+
1760Path of the JAR file to start daemon execution with. This should
1761be the path of the local 'gerrit.war' archive. Overrides the
1762environment variable 'GERRIT_WAR'.
1763+
1764If not set, defaults to '$site_path/bin/gerrit.war', or to
1765'$HOME/gerrit.war'.
1766
1767
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001768[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001769=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001770
Saša Živkovd34dfe32017-11-20 11:14:35 +01001771[NOTE]
1772The link:#jgitConfig[etc/jgit.config] file supports configuration of all JGit
1773options.
1774
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001775[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001776+
1777Number of bytes of a pack file to load into memory in a single
1778read operation. This is the "page size" of the JGit buffer cache,
1779used for all pack access operations. All disk IO occurs as single
1780window reads. Setting this too large may cause the process to load
1781more data than is required; setting this too small may increase
1782the frequency of `read()` system calls.
1783+
1784Default on JGit is 8 KiB on all platforms.
1785+
1786Common unit suffixes of 'k', 'm', or 'g' are supported.
1787
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001788[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001789+
1790Maximum number of bytes to load and cache in memory from pack files.
1791If JGit needs to access more than this many bytes it will unload less
1792frequently used windows to reclaim memory space within the process.
1793As this buffer must be shared with the rest of the JVM heap, it
1794should be a fraction of the total memory available.
1795+
1796Default on JGit is 10 MiB on all platforms.
1797+
1798Common unit suffixes of 'k', 'm', or 'g' are supported.
1799
Matthias Sohn79bec412020-02-12 01:00:31 +01001800[[core.packedGitUseStrongRefs]]core.packedGitUseStrongRefs::
1801+
1802Set to `true` in order to use strong references to reference packfile
1803pages cached in the WindowCache. Otherwise SoftReferences are used.
1804If this option is set to `false`, the Java garbage collector will
1805flush the WindowCache to free memory if the used heap comes close to
1806the maximum heap size. This has the advantage that it can quickly
1807reclaim memory which was used by the WindowCache but comes at the
1808price that the previously cached pack file content needs to be again
1809copied from the file system cache to the Gerrit process.
1810Setting this option to `true` prevents flushing the WindowCache
1811which provides more predictable performance.
1812+
1813Default is `false`.
1814
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001815[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001816+
1817Maximum number of bytes to reserve for caching base objects
1818that multiple deltafied objects reference. By storing the entire
1819decompressed base object in a cache Git is able to avoid unpacking
1820and decompressing frequently used base objects multiple times.
1821+
1822Default on JGit is 10 MiB on all platforms. You probably do not
1823need to adjust this value.
1824+
1825Common unit suffixes of 'k', 'm', or 'g' are supported.
1826
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001827[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001828+
1829Maximum number of pack files to have open at once. A pack file
1830must be opened in order for any of its data to be available in
1831a cached window.
1832+
1833If you increase this to a larger setting you may need to also adjust
1834the ulimit on file descriptors for the host JVM, as Gerrit needs
1835additional file descriptors available for network sockets and other
1836repository data manipulation.
1837+
1838Default on JGit is 128 file descriptors on all platforms.
1839
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001840[[core.streamFileThreshold]]core.streamFileThreshold::
1841+
1842Largest object size, in bytes, that JGit will allocate as a
1843contiguous byte array. Any file revision larger than this threshold
1844will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001845files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001846during delta decompression.
1847+
1848Servers with very high traffic should set this to be larger than
1849the size of their common big files. For example a server managing
1850the Android platform typically has to deal with ~10-12 MiB XML
1851files, so `15 m` would be a reasonable setting in that environment.
1852Setting this too high may cause the JVM to run out of heap space
1853when handling very big binary files, such as device firmware or
1854CD-ROM ISO images.
1855+
Luca Milanesiob104a552019-11-18 17:28:56 -08001856Defaults to 25% of the available JVM heap, limited to 2g.
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001857+
1858Common unit suffixes of 'k', 'm', or 'g' are supported.
1859
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001860[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001861+
1862When true, JGit will use `mmap()` rather than `malloc()+read()`
1863to load data from pack files. The use of mmap can be problematic
1864on some JVMs as the garbage collector must deduce that a memory
1865mapped segment is no longer in use before a call to `munmap()`
1866can be made by the JVM native code.
1867+
1868In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001869pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001870of virtual address space, as the garbage collector cannot reclaim
1871unused mapped spaces fast enough.
1872+
1873Default on JGit is false. Although potentially slower, it yields
1874much more predictable behavior.
1875
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001876[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1877+
1878Size of the buffer to store logging events for asynchronous logging.
1879Putting a larger value can protect threads from stalling when the
1880AsyncAppender threads are not fast enough to consume the logging events
David Pursehouse1ff91c02015-05-19 15:05:26 +09001881from the buffer. It also protects from losing log entries in this case.
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001882+
1883Default is 64 entries.
1884
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001885[[core.useRecursiveMerge]]core.useRecursiveMerge::
1886+
Edwin Kempin71831d22014-07-15 08:54:29 +02001887Use JGit's recursive merger for three-way merges. This only affects
Sebastian Schuberth774aac92015-04-16 13:21:04 +02001888projects that allow content merges.
Edwin Kempin71831d22014-07-15 08:54:29 +02001889+
1890As explained in this
1891link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[
Marian Harbach34253372019-12-10 18:01:31 +01001892blog,role=external,window=_blank], the recursive merge produces better results if the two commits
Edwin Kempin71831d22014-07-15 08:54:29 +02001893that are merged have more than one common predecessor.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001894+
Edwin Kempin7853c5b2014-07-15 08:57:17 +02001895Default is true.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001896
Hugo Arès47344372016-06-27 10:23:17 -04001897[[core.repositoryCacheCleanupDelay]]core.repositoryCacheCleanupDelay::
1898+
1899Delay between each periodic cleanup of expired repositories.
1900+
1901Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1902`min`, etc.).
1903+
1904Set it to 0 in order to switch off cache expiration. If cache expiration is
1905switched off, the JVM can still evict cache entries when it is running low
1906on available heap memory.
1907+
1908Set it to -1 to automatically derive cleanup delay from
1909`core.repositoryCacheExpireAfter` (lowest value between 1/10 of
1910`core.repositoryCacheExpireAfter` and 10 minutes).
1911+
1912Default is -1.
1913
1914[[core.repositoryCacheExpireAfter]]core.repositoryCacheExpireAfter::
1915+
1916Time an unused repository should expire and be evicted from the repository
1917cache.
1918+
1919Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1920`min`, etc.).
1921+
1922Default is 1 hour.
1923
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001924[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001925=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03001926
1927----
1928[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001929 command = checkout
1930 command = cherry_pick
1931 command = pull
1932 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001933 scheme = ssh
1934 scheme = http
1935 scheme = anon_http
1936 scheme = anon_git
1937 scheme = repo_download
1938----
1939
1940The download section configures the allowed download methods.
1941
Edwin Kempin08b03a22012-09-14 16:32:57 +02001942[[download.command]]download.command::
1943+
1944Commands that should be offered to download changes.
1945+
1946Multiple commands are supported:
1947+
1948* `checkout`
1949+
1950Command to fetch and checkout the patch set.
1951+
1952* `cherry_pick`
1953+
1954Command to fetch the patch set and to cherry-pick it onto the current
1955commit.
1956+
1957* `pull`
1958+
1959Command to pull the patch set.
1960+
1961* `format_patch`
1962+
1963Command to fetch the patch set and to feed it into the `format-patch`
1964command.
1965
1966+
1967If `download.command` is not specified, all download commands are
1968offered.
1969
monica.dionisio3f630442010-06-29 15:42:57 -03001970[[download.scheme]]download.scheme::
1971+
1972Schemes that should be used to download changes.
1973+
1974Multiple schemes are supported:
1975+
1976* `http`
1977+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001978Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001979+
1980* `ssh`
1981+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001982Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001983+
1984* `anon_http`
1985+
1986Anonymous HTTP download is allowed.
1987+
1988* `anon_git`
1989+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001990Anonymous Git download is allowed. This is not default, it is also
1991necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1992variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001993+
1994* `repo_download`
1995+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001996Gerrit advertises patch set downloads with the `repo download`
1997command, assuming that all projects managed by this instance are
1998generally worked on with the repo multi-repository tool. This is
1999not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03002000
2001+
Edwin Kempin08b03a22012-09-14 16:32:57 +02002002If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07002003downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08002004
Edwin Kempin322db672015-07-03 08:50:46 +02002005[[download.checkForHiddenChangeRefs]]download.checkForHiddenChangeRefs::
2006+
2007Whether the download commands should be adapted when the change refs
2008are hidden.
2009+
2010Git has a configuration option to hide refs from the initial
2011advertisement (`uploadpack.hideRefs`). This option can be used to hide
2012the change refs from the client. As consequence fetching changes by
2013change ref does not work anymore. However by setting
2014`uploadpack.allowTipSha1InWant` to `true` fetching changes by commit ID
2015is possible. If `download.checkForHiddenChangeRefs` is set to `true`
2016the git download commands use the commit ID instead of the change ref
2017when a project is configured like this.
2018+
2019Example git configuration on a project:
2020+
2021----
2022[uploadpack]
2023 hideRefs = refs/changes/
2024 hideRefs = refs/cache-automerge/
2025 allowTipSha1InWant = true
2026----
2027+
2028By default `false`.
2029
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002030[[download.archive]]download.archive::
2031+
2032Specifies which archive formats, if any, should be offered on the change
Francois Ferrand1e933882014-09-25 11:19:08 +02002033screen and supported for `git-upload-archive` operation:
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002034+
2035----
2036[download]
2037 archive = tar
2038 archive = tbz2
2039 archive = tgz
2040 archive = txz
Francois Ferrand1e933882014-09-25 11:19:08 +02002041 archive = zip
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002042----
2043
Shawn Pearce6edde312014-03-26 22:00:26 -07002044If `download.archive` is not specified defaults to all archive
2045commands. Set to `off` or empty string to disable.
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07002046
Francois Ferrand1e933882014-09-25 11:19:08 +02002047Zip is not supported because it may be interpreted by a Java plugin as a
2048valid JAR file, whose code would have access to cookies on the domain.
2049For this reason `zip` format is always excluded from formats offered
2050through the `Download` drop down or accessible in the REST API.
2051
Stefan Bellere1b2ad32016-11-29 14:54:13 -08002052[[download.maxBundleSize]]download.maxBundleSize::
2053+
2054Specifies the maximum size of a bundle in bytes that can be downloaded.
2055As bundles are kept in memory this setting is to protect the server
2056from a single request consuming too much heap when generating
2057a bundle and thereby impacting other users.
2058+
2059Defaults to 100MB.
2060
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002061[[gc]]
2062=== Section gc
2063
2064This section allows to configure the git garbage collection and schedules it
2065to run periodically. It will be triggered and executed sequentially for all
2066projects.
2067
Christian Halstricke6c68322015-03-11 15:21:42 +01002068[[gc.aggressive]]gc.aggressive::
2069+
2070Determines if scheduled garbage collections and garbage collections triggered
2071through Web-UI should run in aggressive mode or not. Aggressive garbage
2072collections are more expensive but may lead to significantly smaller
2073repositories.
2074+
2075Valid values are "true" and "false," default is "false".
2076
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002077[[gc.startTime]]gc.startTime::
2078+
Edwin Kempind33d95a2018-02-16 11:44:04 +01002079The link:#schedule-configuration-startTime[start time] for running the
2080git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002081
2082[[gc.interval]]gc.interval::
2083+
Edwin Kempind33d95a2018-02-16 11:44:04 +01002084The link:#schedule-configuration-interval[interval] for running the
2085git garbage collection.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002086
Edwin Kempind33d95a2018-02-16 11:44:04 +01002087link:#schedule-configuration-examples[Schedule examples] can be found
2088in the link:#schedule-configuration[Schedule Configuration] section.
Matthias Sohn0fb2c992014-06-03 01:42:59 +02002089
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002090[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002091=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002092
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002093[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07002094+
2095Local filesystem directory holding all Git repositories that
2096Gerrit knows about and can process changes for. A project
2097entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02002098the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07002099+
2100If relative, the path is resolved relative to `'$site_path'`.
2101
Shawn O. Pearce897d9212011-06-16 16:59:59 -07002102[[gerrit.allProjects]]gerrit.allProjects::
2103+
2104Name of the permissions-only project defining global server
2105access controls and settings. These are inherited into every
2106other project managed by the running server. The name is
2107relative to `gerrit.basePath`.
2108+
2109Defaults to `All-Projects` if not set.
2110
Edwin Kempin2bf5edd2014-03-25 22:21:23 +01002111[[gerrit.allUsers]]gerrit.allUsers::
2112+
2113Name of the project in which meta data of all users is stored.
2114The name is relative to `gerrit.basePath`.
2115+
2116Defaults to `All-Users` if not set.
2117
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002118[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002119+
2120The default URL for Gerrit to be accessed through.
2121+
Sebastian Schuberth64037132016-07-28 13:40:16 +02002122Typically this would be set to something like "http://review.example.com/"
2123or "http://example.com:8080/gerrit/" so Gerrit can output links that point
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002124back to itself.
2125+
2126Setting this is highly recommended, as its necessary for the upload
2127code invoked by "git push" or "repo upload" to output hyperlinks
2128to the newly uploaded changes.
2129
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002130[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07002131+
2132Optional base URL for repositories available over the anonymous git
2133protocol. For example, set this to `git://mirror.example.com/base/`
2134to have Gerrit display patch set download URLs in the UI. Gerrit
2135automatically appends the project name onto the end of the URL.
2136+
2137By default unset, as the git daemon must be configured externally
2138by the system administrator, and might not even be running on the
2139same host as Gerrit.
2140
Dave Borowitza5d3fec2015-07-09 14:24:02 -07002141[[gerrit.docUrl]]gerrit.docUrl::
2142+
2143Optional base URL for documentation, under which one can find
2144"index.html", "rest-api.html", etc. Used as the base for the fixed set
2145of links in the "Documentation" tab. A slash is implicitly appended.
2146(For finer control over the top menu, consider writing a
2147link:dev-plugins.html#top-menu-extensions[plugin].)
2148+
2149If unset or empty, the documentation tab will only be shown if
2150`/Documentation/index.html` can be reached by the browser at app load
2151time.
2152
Dave Borowitza17a9842015-09-15 09:58:17 -04002153[[gerrit.editGpgKeys]]gerrit.editGpgKeys::
2154+
2155If enabled and server-side signed push validation is also
2156link:#receive.enableSignedPush[enabled], enable the
2157link:rest-api-accounts.html#list-gpg-keys[REST API endpoints] and web UI
2158for editing GPG keys. If disabled, GPG keys can only be added by
2159administrators with direct git access to All-Users.
2160+
2161Defaults to true.
2162
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002163[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
2164+
2165Optional command to install the `commit-msg` hook. Typically of the
2166form:
David Pursehouse05588e52015-01-07 14:25:11 +09002167+
Dave Borowitz76ab1a12013-05-10 17:01:29 +01002168----
2169fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
2170----
2171+
2172By default unset; falls back to using scp from the canonical SSH host,
2173or curl from the canonical HTTP URL for the server. Only necessary if a
2174proxy or other server/network configuration prevents clients from
2175fetching from the default location.
2176
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07002177[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
2178+
2179Optional base URL for repositories available over the HTTP
2180protocol. For example, set this to `http://mirror.example.com/base/`
2181to have Gerrit display URLs from this server, rather than itself.
2182+
2183By default unset, as the HTTP daemon must be configured externally
2184by the system administrator, and might not even be running on the
2185same host as Gerrit.
2186
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002187[[gerrit.installDbModule]]gerrit.installDbModule::
2188+
2189Repeatable list of class name of additional Guice modules to load at
2190Gerrit startup as part of the dbInjector and during the init phases.
2191Classes are resolved using the primary Gerrit class loader, hence the
2192class needs to be either declared in Gerrit or an additional JAR
2193located under the `/lib` directory.
2194+
2195By default unset.
2196
Luca Milanesio62cc3502016-11-15 10:22:38 -08002197[[gerrit.installModule]]gerrit.installModule::
2198+
2199Repeatable list of class name of additional Guice modules to load at
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002200Gerrit startup as part of the sysInjector and during the init phases.
Luca Milanesio62cc3502016-11-15 10:22:38 -08002201Classes are resolved using the primary Gerrit class loader, hence the
2202class needs to be either declared in Gerrit or an additional JAR
2203located under the `/lib` directory.
2204+
2205By default unset.
2206+
2207Example:
2208----
2209[gerrit]
2210 installModule = com.googlesource.gerrit.libmodule.MyModule
2211 installModule = com.example.abc.OurSpecialSauceModule
Luca Milanesiob8ec7e22019-04-29 07:26:11 +01002212 installDbModule = com.example.def.OurCustomProvider
Luca Milanesio62cc3502016-11-15 10:22:38 -08002213----
2214
Luca Milanesio92254852019-02-14 01:33:14 +00002215[[gerrit.listProjectsFromIndex]]gerrit.listProjectsFromIndex::
2216+
2217Enable rendering of project list from the secondary index instead
2218of purely relying on the in-memory cache.
2219+
2220By default false.
2221+
2222[NOTE]
2223The in-memory cache (set to false) rendering provides an **unlimited list** as a result
2224of the list project API, causing the full list of projects to be
2225returned as a result of the link:rest-api-projects.html[/projects/] REST API
2226or the link:cmd-ls-projects.html[gerrit ls-projects] SSH command.
2227When the rendering from the secondary index (set to true),
2228the **list is limited** by the global capability
2229link:access-control.html#capability_queryLimit[queryLimit]
2230which is defaulted to 500 entries.
2231
Sven Selberge63e92d2019-01-22 18:19:19 +01002232[[gerrit.primaryWeblinkName]]gerrit.primaryWeblinkName::
2233+
2234Name of the link:dev-plugins.html#links-to-external-tools[Weblink] that should
2235be chosen in cases where only one Weblink can be used in the UI, for example in
2236inline links.
2237+
2238By default unset, meaning that the UI is responsible for trying to identify
2239a weblink to be used in these cases, most likely weblinks that links to code
2240browsers with known integrations with Gerrit (like Gitiles and Gitweb).
2241+
2242Example:
2243----
2244[gerrit]
2245 primaryWeblinkName = gitiles
2246----
2247
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002248[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
2249+
David Pursehouse214ab862014-12-01 11:48:26 +09002250URL to direct users to when they need to report a bug.
2251+
2252By default unset, meaning no bug report URL will be displayed. Administrators
2253should set this to the URL of their issue tracker, if necessary.
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002254
David Pursehouse46a2f6c2018-11-30 11:12:19 +09002255[[gerrit.enableReverseDnsLookup]]gerrit.enableReverseDnsLookup::
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002256+
David Pursehouse793525f2018-11-30 11:20:02 +09002257Enable reverse DNS lookup during computing ref log entry for identified user,
2258to record the actual hostname of the user's host in the ref log.
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002259+
David Pursehouse793525f2018-11-30 11:20:02 +09002260Enabling reverse DNS lookup can cause performance issues on git push when
2261the reverse DNS lookup is slow.
2262+
2263Defaults to false, reverse DNS lookup is disabled. The user's IP address
2264will be recorded in the ref log rather than their hostname.
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002265
David Pursehouse962e1182014-12-03 17:17:52 +09002266[[gerrit.secureStoreClass]]gerrit.secureStoreClass::
2267+
2268Use the secure store implementation from a specified class.
2269+
2270If specified, must be the fully qualified class name of a class that implements
2271the `com.google.gerrit.server.securestore.SecureStore` interface, and the jar
2272file containing the class must be placed in the `$site_path/lib` folder.
2273+
2274If not specified, the default no-op implementation is used.
2275
Dariusz Luksza7a046da2014-04-03 17:05:47 +02002276[[gerrit.canLoadInIFrame]]gerrit.canLoadInIFrame::
2277+
2278For security reasons Gerrit will always jump out of iframe.
2279Setting this option to true will prevent this behavior.
2280+
2281By default false.
2282
Marcin Czech559ea2b2020-06-15 17:36:18 +02002283[[gerrit.xframeOption]]gerrit.xframeOption::
2284+
2285Add link:https://tools.ietf.org/html/rfc7034[`X-Frame-Options`] header to all HTTP
2286responses. The `X-Frame-Options` HTTP response header can be used to indicate
2287whether or not a browser should be allowed to render a page in a
2288`<frame>`, `<iframe>`, `<embed>` or `<object>`.
2289+
2290Available values:
2291+
22921. ALLOW - The page can be displayed in a frame.
22932. SAMEORIGIN - The page can only be displayed in a frame on the same origin as the page itself.
2294+
2295If link:#gerrit.canLoadInIFrame is set to false this option is ignored and the
2296`X-Frame-Options` header is always set to `DENY`.
2297Setting this option to `ALLOW` will cause the `X-Frame-Options` header to be omitted
2298the the page can be displayed in a frame.
2299+
2300By default SAMEORIGIN.
2301
Wyatt Allen414659c2017-03-15 09:55:31 -07002302[[gerrit.cdnPath]]gerrit.cdnPath::
2303+
2304Path prefix for PolyGerrit's static resources if using a CDN.
2305
Viktar Donich65ae7482017-10-20 14:13:31 -07002306[[gerrit.faviconPath]]gerrit.faviconPath::
2307+
2308Path for PolyGerrit's favicon after link:#gerrit.canonicalWebUrl[default URL],
2309including icon name and extension (.ico should be used).
2310
Fabio Ponciroli829be0d2020-05-06 13:59:20 +02002311[[gerrit.instanceId]]gerrit.instanceId::
2312+
2313Optional identifier for this Gerrit instance.
2314Used to identify a specific instance within a group of Gerrit instances with the
2315same `serverId` (i.e.: a Gerrit cluster).
2316Unlike `instanceName` this value is not available in the email templates.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002317
2318[[gerrit.instanceName]]gerrit.instanceName::
2319+
2320Short identifier for this Gerrit instance.
2321A good name should be short but precise enough so that users can identify the instance among others.
2322+
2323Defaults to the full hostname of the Gerrit server.
2324
Luca Milanesio1a3d84f2020-05-04 17:14:12 +01002325[[gerrit.experimentalRollingUpgrade]]gerrit.experimentalRollingUpgrade::
2326+
2327Enable Gerrit rolling upgrade to the next version.
2328For example if Gerrit v3.1 is version N (All-Projects:refs/meta/version=181)
2329then its next version N+1 is v3.2 (All-Projects:refs/meta/version=183).
2330Allow Gerrit to start even if the underlying schema version has been bumped to
2331the next Gerrit version.
2332+
2333Set to true if Gerrit is installed in
2334[high-availability configuration](https://gerrit.googlesource.com/plugins/high-availability/+/refs/heads/master/README.md)
2335during the rolling upgrade to the next version.
2336+
2337By default false.
2338+
2339The rolling upgrade process, at high level, assumes that Gerrit is installed
2340on two or more nodes sharing the repositories over NFS. The upgrade is composed
2341of the following steps:
2342+
23431. Set gerrit.experimentalRollingUpgrade to true on all Gerrit masters
23442. Set the first master unhealthy
23453. Shutdown the first master and [upgrade](install.html#init) to the next version
23464. Startup the first master, wait for the online reindex to complete
23475. Verify the the first master upgrade is successful and online reindex is complete
23486. Set the first master healthy
23497. Repeat steps 2. to 6. for all the other Gerrit nodes
2350+
2351[WARNING]
2352Rolling upgrade may or may not be possible depending on the changes introduced
2353by the target version of the upgrade. Refer to the release notes and check whether
2354the rolling upgrade is possible or not and the associated constraints.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01002355
Sven Selberg327c2e42018-04-10 11:42:19 +02002356[[gerrit.serverId]]gerrit.serverId::
2357+
2358Used by NoteDb to, amongst other things, identify author identities from
2359per-server specific account IDs.
2360+
2361If this value is not set on startup it is automatically set to a random UUID.
2362+
2363[NOTE]
2364If this value doesn't match the serverId used when creating an already existing
2365NoteDb, Gerrit will not be able to use that instance of NoteDb. The serverId
2366used to create the NoteDb will show in the resulting exception message in case
2367the value differs.
2368
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002369[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002370=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002371
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002372Gerrit can forward requests to either an internally managed gitweb
2373(which allows Gerrit to enforce some access controls), or to an
2374externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002375See also link:config-gitweb.html[Gitweb Integration].
2376
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002377[[gitweb.cgi]]gitweb.cgi::
2378+
2379Path to the locally installed `gitweb.cgi` executable. This CGI will
2380be called by Gerrit Code Review when the URL `/gitweb` is accessed.
2381Project level access controls are enforced prior to calling the CGI.
2382+
David Pursehousea89dc982016-09-15 09:35:44 +02002383Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if `gitweb.url` is not set.
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002384
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002385[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002386+
2387Optional URL of an affiliated gitweb service. Defines the
2388web location where a `gitweb.cgi` is installed to browse
David Pursehousea89dc982016-09-15 09:35:44 +02002389`gerrit.basePath` and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002390+
2391Gerrit appends any necessary query arguments onto the end of this URL.
David Pursehousea89dc982016-09-15 09:35:44 +02002392For example, `?p=$project.git;h=$commit`.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002393
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002394[[gitweb.type]]gitweb.type::
2395+
2396Optional type of affiliated gitweb service. This allows using
David Pursehousea66f7ff2016-09-05 21:11:10 +09002397alternatives to gitweb, such as cgit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002398+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07002399Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
David Pursehousea66f7ff2016-09-05 21:11:10 +09002400+
2401If not set, or set to `disabled`, there is no gitweb hyperlinking
2402support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002403
Edwin Kempind86909c2012-03-26 10:36:29 +02002404[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002405+
2406Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002407at a specific commit when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002408+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002409Valid replacements are `${project}` for the project name in Gerrit
2410and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002411
Edwin Kempind86909c2012-03-26 10:36:29 +02002412[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002413+
2414Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002415at a specific project when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002416+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002417Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002418
Edwin Kempind86909c2012-03-26 10:36:29 +02002419[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002420+
2421Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002422at a specific branch when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002423+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002424Valid replacements are `${project}` for the project name in Gerrit
2425and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002426
Paladox none5759f2c2017-10-27 18:13:54 +00002427[[gitweb.tag]]gitweb.tag::
2428+
2429Optional pattern to use for constructing the gitweb URL when pointing
2430at a specific tag when `gitweb.type` is set to `custom`.
2431+
2432Valid replacements are `${project}` for the project name in Gerrit
2433and `${tag}` for the name of the tag.
2434
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002435[[gitweb.roottree]]gitweb.roottree::
2436+
2437Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002438at the contents of the root tree in a specific commit when `gitweb.type`
2439is set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002440+
2441Valid replacements are `${project}` for the project name in Gerrit
2442and `${commit}` for the SHA1 hash for the commit.
2443
2444[[gitweb.file]]gitweb.file::
2445+
2446Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002447at the contents of a file in a specific commit when `gitweb.type` is
2448set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002449+
2450Valid replacements are `${project}` for the project name in Gerrit,
2451`${file}` for the file name and `${commit}` for the SHA1 hash for
2452the commit.
2453
Edwin Kempin64011562012-03-26 10:50:12 +02002454[[gitweb.filehistory]]gitweb.filehistory::
2455+
2456Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002457at the history of a file in a specific branch when when `gitweb.type`
2458is set to `custom`.
Edwin Kempin64011562012-03-26 10:50:12 +02002459+
2460Valid replacements are `${project}` for the project name in Gerrit,
2461`${file}` for the file name and `${branch}` for the name of the
2462branch.
2463
Gustaf Lundha07d2e72011-10-27 15:26:35 -07002464[[gitweb.linkname]]gitweb.linkname::
2465+
2466Optional setting for modifying the link name presented to the user
2467in the Gerrit web-UI.
2468+
David Pursehousea89dc982016-09-15 09:35:44 +02002469The default linkname for custom type is `gitweb`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002470
Adrian Goerlerf2007072011-11-10 08:39:55 +01002471[[gitweb.pathSeparator]]gitweb.pathSeparator::
2472+
2473Optional character to substitute the standard path separator (slash) in
2474project names and branch names.
2475+
2476By default, Gerrit will use hexadecimal encoding for slashes in project and
2477branch names. Some web servers, such as Tomcat, reject this hexadecimal
2478encoding in the URL.
2479+
Marian Harbach34253372019-12-10 18:01:31 +01002480Some alternative gitweb services, such as link:http://gitblit.com[Gitblit,role=external,window=_blank],
Adrian Goerlerf2007072011-11-10 08:39:55 +01002481allow using an alternative path separator character. In Gitblit, this can be
Marian Harbach34253372019-12-10 18:01:31 +01002482configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter,role=external,window=_blank].
Adrian Goerlerf2007072011-11-10 08:39:55 +01002483In Gerrit, the alternative path separator can be configured correspondingly
David Pursehousea89dc982016-09-15 09:35:44 +02002484using the property `gitweb.pathSeparator`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002485+
David Pursehousea89dc982016-09-15 09:35:44 +02002486Valid values are the characters `*`, `(` and `)`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002487
David Pursehouse5d592e82016-06-09 05:12:26 +00002488[[gitweb.urlEncode]]gitweb.urlEncode::
Luca Milanesio25312032013-10-11 11:34:39 +01002489+
2490Whether or not Gerrit should encode the generated viewer URL.
2491+
2492Gerrit composes the viewer URL using information about the project, branch, file
2493or commit of the target object to be displayed. Typically viewers such as CGit
David Pursehousea89dc982016-09-15 09:35:44 +02002494and gitweb do need those parts to be encoded, including the `/` in project's name,
Luca Milanesio25312032013-10-11 11:34:39 +01002495for being correctly parsed.
2496However other viewers could instead require an unencoded URL (e.g. GitHub web
David Pursehousea89dc982016-09-15 09:35:44 +02002497based viewer).
Luca Milanesio25312032013-10-11 11:34:39 +01002498+
David Pursehousea89dc982016-09-15 09:35:44 +02002499Valid values are `true` and `false`. The default is `true`.
Luca Milanesio25312032013-10-11 11:34:39 +01002500
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002501[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002502=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01002503
2504[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
2505+
2506Controls whether newly created groups should be by default visible to
2507all registered users.
2508+
2509By default, false.
2510
Edwin Kempinf3eddd52017-01-20 14:05:47 +01002511[[groups.uuid.name]]groups.<uuid>.name::
2512+
2513Display name for group with the given UUID.
2514+
2515This option is only supported for system groups (scheme 'global').
2516+
2517E.g. this parameter can be used to configure another name for the
2518`Anonymous Users` group:
2519+
2520----
2521[groups "global:Anonymous-Users"]
2522 name = All Users
2523----
2524+
2525When setting this parameter it should be verified that there is no
2526existing group with the same name (case-insensitive). Configuring an
2527ambiguous name makes Gerrit fail on startup. Once set Gerrit ensures
2528that it is not possible to create a group with this name. Gerrit also
2529keeps the default name reserved so that it cannot be used for new
2530groups either. This means there is no danger of ambiguous group names
2531when this parameter is removed and the system group uses the default
2532name again.
2533
Prakash Aswala6d49fb2020-02-27 15:09:30 +05302534[[has-operand-alias]]
2535=== Section has operand alias
2536
2537'has' operand aliasing allows global aliases to be defined for query
2538'has' operands. Currently only change queries are supported. The alias
2539name is the git config key name, and the 'has' operand being aliased
2540is the git config value.
2541
2542For example:
2543
2544----
2545[has-operand-alias "change"]
2546 oldtopic = topic
2547----
2548
2549This section is particularly useful to alias 'has' operands (which may
2550be long and clunky as they include a plugin name in them) to shorter
2551operands without the plugin name. Admins should take care to choose
2552shorter operands that are unique and unlikely to conflict in the future.
2553
2554Aliases are resolved dynamically at invocation time to the currently
2555loaded version of plugins. If a referenced plugin is not loaded, or
2556does not define the command, "unsupported operand" is returned to the
2557user.
2558
2559Aliases will override existing 'has' operands. In case of multiple
2560aliases with same name, the last one defined will be used.
2561
2562When the target of an alias does not exist, the 'has' operand with the
2563name of the alias will be used (if present). This enables an admin to
2564configure the system to override a core 'has' operand with an operand
2565provided by a plugin when present and otherwise fall back to the 'has'
2566operand provided by core.
2567
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002568[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002569=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002570
2571[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002572+
2573URL of the proxy server when making outgoing HTTP
2574connections for OpenID login transactions. Syntax
2575should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002576
2577[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002578+
2579Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002580This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002581appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002582
2583[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002584+
2585Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002586This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002587appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002588
Hugo Arès88e33ac2014-03-03 13:52:45 -05002589[[http.addUserAsRequestAttribute]]http.addUserAsRequestAttribute::
2590+
2591If true, 'User' attribute will be added to the request attributes so it
2592can be accessed outside the request scope (will be set to username or id
2593if username not configured).
2594+
2595This attribute can be used by the servlet container to log user in the
2596http access log.
2597+
2598When running the embedded servlet container, this attribute is used to
2599print user in the httpd_log.
2600+
2601* `%{User}r`
2602+
2603Pattern to print user in Tomcat AccessLog.
2604
2605+
2606Default value is true.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002607
Gustaf Lundhe45c3332018-05-02 10:52:11 +02002608[[http.addUserAsResponseHeader]]http.addUserAsResponseHeader::
2609+
2610If true, the header 'User' will be added to the list of response headers so it
2611can be accessed from a reverse proxy for logging purposes.
2612
2613+
2614Default value is false.
2615
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002616[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002617=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002618
2619The httpd section configures the embedded servlet container.
2620
2621[[httpd.listenUrl]]httpd.listenUrl::
2622+
Gert van Dijk70e26612019-09-29 16:20:25 +02002623Configuration for the listening sockets of the internal HTTP daemon.
2624Each entry of `listenUrl` combines the following options for a
2625listening socket: protocol, network address, port and context path.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002626+
Gert van Dijk70e26612019-09-29 16:20:25 +02002627_Protocol_ can be either `http://`, `https://`, `proxy-http://` or
2628`proxy-https://`. The latter two are special forms of `http://` with
2629awareness of a reverse proxy (see below). _Network address_ selects
2630the interface and/or scope of the listening socket. For notes
2631examples, see below. _Port_ is the TCP port number and is optional
2632(default value depends on the protocol). _Context path_ is the
2633optional "base URI" for the Gerrit Code Review as application to
2634serve on.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002635+
Gert van Dijk70e26612019-09-29 16:20:25 +02002636**Protocol** schemes:
2637+
2638* `http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002639+
2640Plain-text HTTP protocol. If port is not supplied, defaults to 80,
2641the standard HTTP port.
2642+
Gert van Dijk70e26612019-09-29 16:20:25 +02002643* `https://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002644+
2645SSL encrypted HTTP protocol. If port is not supplied, defaults to
2646443, the standard HTTPS port.
2647+
Gert van Dijk70e26612019-09-29 16:20:25 +02002648For configuration of the certificate and private key, see
2649<<httpd.sslKeyStore,httpd.sslKeyStore>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002650+
Gert van Dijk70e26612019-09-29 16:20:25 +02002651[NOTE]
2652SSL/TLS configuration capabilities of Gerrit internal HTTP daemon
2653are very limited. Externally facing production sites are strongly
2654encouraged to use a reverse proxy configuration to handle SSL/TLS
2655and use a `proxy-https://` scheme here (below) for security and
2656performance reasons.
2657+
2658* `proxy-http://`
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002659+
2660Plain-text HTTP relayed from a reverse proxy. If port is not
2661supplied, defaults to 8080.
2662+
Gert van Dijk70e26612019-09-29 16:20:25 +02002663Like `http://`, but additional header parsing features are
2664enabled to honor `X-Forwarded-For`, `X-Forwarded-Host` and
2665`X-Forwarded-Server`. These headers are typically set by Apache's
Marian Harbach34253372019-12-10 18:01:31 +01002666link: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 -08002667+
Gert van Dijk70e26612019-09-29 16:20:25 +02002668[NOTE]
2669--
2670For secruity reasons, make sure to only allow connections from a
2671trusted reverse proxy in your network, as clients could otherwise
2672easily spoof these headers and thus spoof their originating IP
2673address effectively. If the reverse proxy is running on the same
2674machine as Gerrit daemon, the use of a _loopback_ network address
2675to bind to (see below) is strongly recommended to mitigate this.
2676
2677If not using Apache's mod_proxy, validate that your reverse proxy
2678sets these headers on all requests. If not, either configure it to
2679sanitize them from the origin, or use the `http://` scheme instead.
2680--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002681+
Gert van Dijk70e26612019-09-29 16:20:25 +02002682* `proxy-https://`
2683+
2684Plain-text HTTP relayed from a reverse proxy that has already
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002685handled the SSL encryption/decryption. If port is not supplied,
2686defaults to 8080.
2687+
Gert van Dijk70e26612019-09-29 16:20:25 +02002688Behaves exactly like `proxy-http://`, but also sets the scheme to
2689assume `https://` is the proper URL back to the server.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002690
2691+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002692--
Gert van Dijk70e26612019-09-29 16:20:25 +02002693**Network address** forms:
2694
2695* Loopback (localhost): `127.0.0.1` (IPv4) or `[::1]` (IPv6).
2696* All (unspecified): `0.0.0.0` (IPv4), `[::]` (IPv6) or `*`
2697 (IPv4 and IPv6)
2698* Interface IP address, e.g. `1.2.3.4` (IPv4) or
2699 `[2001:db8::a00:20ff:fea7:ccea]` (IPv6)
2700* Hostname, resolved at startup time to an address.
2701
2702**Context path** is the local part of the URL to be used to access
2703Gerrit on ('base URL'). E.g. `/gerrit/` to serve Gerrit on that URI
2704as base. If set, consider to align this with the
2705<<gerrit.canonicalWebUrl,gerrit.canonicalWebUrl>> setting. Correct
2706settings may depend on the reverse proxy configuration as well. By
2707default, this is `/` so that Gerrit serves requests on the root.
2708
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002709If multiple values are supplied, the daemon will listen on all
2710of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002711
Gert van Dijk70e26612019-09-29 16:20:25 +02002712Examples:
2713
2714----
2715[httpd]
2716 listenUrl = proxy-https://127.0.0.1:9999/gerrit/
2717[gerrit]
2718 # Reverse proxy is configured to serve with SSL/TLS on
2719 # example.com and to relay requests on /gerrit/ onto
2720 # http://127.0.0.1:9999/gerrit/
2721 canonicalWebUrl = https://example.com/gerrit/
2722----
2723
2724----
2725[httpd]
2726 # Listen on specific external interface with plaintext
2727 # HTTP on IPv6.
2728 listenUrl = http://[2001:db8::a00:20ff:fea7:ccea]
2729
2730 # Also listen on specific internal interface for use with
2731 # reverse proxy run on another host.
2732 listenUrl = proxy-https://192.168.100.123
2733----
2734
2735See also the page on link:config-reverseproxy.html[reverse proxy]
2736configuration.
2737
2738By default, `\http://*:8080`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002739--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002740
2741[[httpd.reuseAddress]]httpd.reuseAddress::
2742+
2743If true, permits the daemon to bind to the port even if the port
2744is already in use. If false, the daemon ensures the port is not
2745in use before starting. Busy sites may need to set this to true
2746to permit fast restarts.
2747+
2748By default, true.
2749
Luca Milanesio4e2bb452018-03-21 09:07:24 +00002750[[httpd.gracefulStopTimeout]]httpd.gracefulStopTimeout::
2751+
2752Set a graceful stop time. If set, the daemon ensures that all incoming
2753calls are preserved for a maximum period of time, before starting
2754the graceful shutdown process. Sites behind a workload balancer such as
2755HAProxy would need this to be set for avoiding serving errors during
2756rolling restarts.
2757+
2758Values should use common unit suffixes to express their setting:
2759+
2760* s, sec, second, seconds
2761* m, min, minute, minutes
2762+
2763By default, 0 seconds (immediate shutdown).
2764
Thomas Meyeraa93fdf2016-10-23 10:53:48 +02002765[[httpd.inheritChannel]]httpd.inheritChannel::
2766+
2767If true, permits the daemon to inherit its server socket channel
2768from fd0/1(stdin/stdout). When set to true, the server can be socket
2769activated via systemd or xinetd.
2770+
2771By default, false.
2772
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002773[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
2774+
2775Size, in bytes, of the buffer used to parse the HTTP headers of an
2776incoming HTTP request. The entire request headers, including any
2777cookies sent by the browser, must fit within this buffer, otherwise
2778the server aborts with the response '413 Request Entity Too Large'.
2779+
2780One buffer of this size is allocated per active connection.
2781Allocating a buffer that is too large wastes memory that cannot be
2782reclaimed, allocating a buffer that is too small may cause unexpected
2783errors caused by very long Referer URLs or large cookie values.
2784+
2785By default, 16384 (16 K), which is sufficient for most OpenID and
2786other web-based single-sign-on integrations.
2787
Chulho Yangb72ff8f2013-07-04 02:35:53 -04002788[[httpd.sslCrl]]httpd.sslCrl::
2789+
2790Path of the certificate revocation list file in PEM format. This
2791crl file is optional, and available for CLIENT_SSL_CERT_LDAP
2792authentication.
2793+
2794To create and view a crl using openssl:
2795+
2796----
2797openssl ca -gencrl -out crl.pem
2798openssl crl -in crl.pem -text
2799----
2800+
2801If not absolute, the path is resolved relative to `$site_path`.
2802+
2803By default, `$site_path/etc/crl.pem`.
2804
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002805[[httpd.sslKeyStore]]httpd.sslKeyStore::
2806+
2807Path of the Java keystore containing the server's SSL certificate
2808and private key. This keystore is required for `https://` in URL.
2809+
2810To create a self-signed certificate for simple internal usage:
2811+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002812----
2813keytool -keystore keystore -alias jetty -genkey -keyalg RSA
2814chmod 600 keystore
2815----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002816+
2817If not absolute, the path is resolved relative to `$site_path`.
2818+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002819By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002820
2821[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
2822+
2823Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09002824Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002825doesn't want to enable one.
2826+
2827If set to the empty string the embedded server will prompt for the
2828password during startup.
2829+
2830By default, `gerrit`.
2831
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002832[[httpd.requestLog]]httpd.requestLog::
2833+
2834Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
2835If enabled, an NCSA combined log format request log file is written
Matthias Sohn450bc202020-08-20 14:40:32 +02002836out by the internal HTTP daemon. The httpd log format is documented
2837link:logs.html#_httpd_log[here].
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002838+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01002839`log4j.appender` with the name `httpd_log` can be configured to overwrite
2840programmatic configuration.
2841+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002842By default, true if httpd.listenUrl uses http:// or https://,
2843and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
2844
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002845[[httpd.acceptorThreads]]httpd.acceptorThreads::
2846+
2847Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09002848connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002849+
2850By default, 2, which should be suitable for most high-traffic sites.
2851
2852[[httpd.minThreads]]httpd.minThreads::
2853+
2854Minimum number of spare threads to keep in the worker thread pool.
2855This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09002856multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002857+
2858By default, 5, suitable for most lower-volume traffic sites.
2859
2860[[httpd.maxThreads]]httpd.maxThreads::
2861+
2862Maximum number of threads to permit in the worker thread pool.
2863+
2864By default 25, suitable for most lower-volume traffic sites.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02002865+
2866[NOTE]
2867Unless SSH daemon is disabled, see <<sshd.listenAddress, sshd.listenAddress>>,
2868the max number of concurrent Git requests over HTTP and SSH together is
2869defined by the <<sshd.threads, sshd.threads>> and
2870<<sshd.batchThreads, sshd.batchThreads>>.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002871
2872[[httpd.maxQueued]]httpd.maxQueued::
2873+
2874Maximum number of client connections which can enter the worker
2875thread pool waiting for a worker thread to become available.
David Ostrovsky14fe8bc2014-03-26 06:03:44 -070028760 sets the queue size to the Integer.MAX_VALUE.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002877+
Luca Milanesio0ae62fe2015-09-04 07:56:00 -07002878By default 200.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002879
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002880[[httpd.maxWait]]httpd.maxWait::
2881+
David Pursehouse221d4f62012-06-08 17:38:08 +09002882Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002883thread to handle a project clone, fetch or push request over the
2884smart HTTP transport.
2885+
2886Values should use common unit suffixes to express their setting:
2887+
2888* s, sec, second, seconds
2889* m, min, minute, minutes
2890* h, hr, hour, hours
2891* d, day, days
2892* w, week, weeks (`1 week` is treated as `7 days`)
2893* mon, month, months (`1 month` is treated as `30 days`)
2894* y, year, years (`1 year` is treated as `365 days`)
2895
2896+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002897--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002898If a unit suffix is not specified, `minutes` is assumed. If 0
2899is supplied, the maximum age is infinite and connections will not
2900abort until the client disconnects.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002901
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002902By default, 5 minutes.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002903--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002904
Luca Milanesioce7b7452013-06-18 11:40:49 +01002905[[httpd.filterClass]]httpd.filterClass::
2906+
2907Class that implements the javax.servlet.Filter interface
2908for filtering any HTTP related traffic going through the Gerrit
2909HTTP protocol.
2910Class is loaded and configured in the Gerrit Jetty container
2911and run in front of all Gerrit URL handlers, allowing the filter
2912to inspect, modify, allow or reject each request.
2913It needs to be provided as JAR library
2914under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
2915loader and cannot be dynamically loaded by a plugin.
2916+
2917Failing to load the Filter class would result in a Gerrit start-up
2918failure, as this class is supposed to provide mandatory filtering
2919in front of Gerrit HTTP protocol.
2920+
David Pursehouse42f42042013-08-01 14:02:25 +09002921Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01002922of an Apache HTTP proxy layer as security enforcement on top of Gerrit
2923by returning a trusted username as HTTP Header.
2924+
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002925Allow multiple values to install multiple servlet filters.
2926+
Luca Milanesioce7b7452013-06-18 11:40:49 +01002927Example of using a security library secure.jar under $GERRIT_SITE/lib
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002928that provides a org.anyorg.MySecureHeaderFilter Servlet Filter that enforces
2929a trusted username in the `TRUSTED_USER` HTTP Header and
2930org.anyorg.MySecureIPFilter that performs source IP security filtering:
Dyrone Teng14fc0832019-09-27 16:59:02 +08002931+
Luca Milanesioce7b7452013-06-18 11:40:49 +01002932----
2933[auth]
2934 type = HTTP
2935 httpHeader = TRUSTED_USER
2936
Dariusz Lukszaaac01132015-02-11 12:13:07 +01002937[httpd]
Luca Milanesiodcb4bd52017-05-03 22:20:51 +01002938 filterClass = org.anyorg.MySecureHeaderFilter
2939 filterClass = org.anyorg.MySecureIPFilter
Luca Milanesioce7b7452013-06-18 11:40:49 +01002940----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002941
Teng Longc192ca92019-09-23 11:22:03 +08002942[[filterClass.className.initParam]]filterClass.<className>.initParam::
2943+
2944Gerrit supports customized pluggable HTTP filters as `filterClass`. This
2945option allows to pass extra initialization parameters to the filter. It
2946allows for multiple key/value pairs to be passed in this pattern:
2947+
2948----
2949initParam = <key>=<value>
2950----
2951For a comprehensive example:
2952+
2953----
2954[httpd]
2955 filterClass = org.anyorg.AFilter
2956 filterClass = org.anyorg.BFilter
2957[filterClass "org.anyorg.AFilter"]
2958 key1 = value1
2959 key2 = value2
2960[filterClass "org.anyorg.BFilter"]
2961 key3 = value3
2962----
2963
Luca Milanesiodca95d52017-05-09 21:22:21 +01002964[[httpd.idleTimeout]]httpd.idleTimeout::
2965+
2966Maximum idle time for a connection, which roughly translates to the
2967TCP socket `SO_TIMEOUT`.
2968+
Luca Milanesiodca95d52017-05-09 21:22:21 +01002969This value is interpreted as the maximum time between some progress
2970being made on the connection. So if a single byte is read or written,
2971then the timeout is reset.
2972+
David Pursehouse9f0e5bc2017-06-30 16:16:53 +09002973The max idle time is applied:
2974+
2975* When waiting for a new message to be received on a connection
2976* When waiting for a new message to be sent on a connection
2977
2978+
Luca Milanesiodca95d52017-05-09 21:22:21 +01002979By default, 30 seconds.
2980
Juan Hernandezec512562013-08-06 16:30:50 +02002981[[httpd.robotsFile]]httpd.robotsFile::
2982+
2983Location of an external robots.txt file to be used instead of the one
2984bundled with the .war of the application.
2985+
2986If not absolute, the path is resolved relative to `$site_path`.
2987+
2988If the file doesn't exist or can't be read the default robots.txt file
2989bundled with the .war will be used instead.
2990
Dariusz Luksza011cfed2014-04-03 10:23:35 +02002991[[httpd.registerMBeans]]httpd.registerMBeans::
2992+
2993Enable (or disable) registration of Jetty MBeans for Java JMX.
2994+
2995By default, false.
2996
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002997[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002998=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09002999
3000The index section configures the secondary index.
3001
David Pursehouse3fc5ee32014-03-17 18:35:32 +09003002Note that after enabling the secondary index, the index must be built
3003using the link:pgm-reindex.html[reindex program] before restarting the
3004Gerrit server.
3005
David Pursehouse6d458432013-08-23 16:17:18 +09003006[[index.type]]index.type::
3007+
3008Type of secondary indexing employed by Gerrit. The supported
3009values are:
3010+
3011* `LUCENE`
3012+
3013A link:http://lucene.apache.org/[Lucene] index is used.
3014+
David Pursehouse8e72f532014-06-24 11:01:28 +09003015+
Dariusz Lukszaea529882017-04-25 15:11:31 +02003016* `ELASTICSEARCH` look into link:#elasticsearch[Elasticsearch section]
David Pursehouse8e72f532014-06-24 11:01:28 +09003017+
Marian Harbach34253372019-12-10 18:01:31 +01003018An link:https://www.elastic.co/products/elasticsearch[Elasticsearch,role=external,window=_blank] index is
David Pursehouse2e79e5b2018-04-20 10:23:29 +02003019used. Refer to the link:#elasticsearch[Elasticsearch section] for further
3020configuration details.
David Pursehouse6d458432013-08-23 16:17:18 +09003021
3022+
Shawn Pearced4ae3a162013-11-24 17:00:31 -08003023By default, `LUCENE`.
David Pursehouse6d458432013-08-23 16:17:18 +09003024
David Pursehouse904db302014-03-17 18:55:38 +09003025[[index.threads]]index.threads::
3026+
Hugo Arèsfab06702016-06-10 12:49:52 -04003027Number of threads to use for indexing in normal interactive operations. Setting
3028it to 0 disables the dedicated thread pool and indexing will be done in the same
3029thread as the operation.
David Pursehouse904db302014-03-17 18:55:38 +09003030+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02003031If not set or set to a zero, defaults to the number of logical CPUs as returned
3032by the JVM. If set to a negative value, defaults to a direct executor.
David Pursehouse00c82142014-01-22 17:41:09 +09003033
Dave Borowitz787af5f2014-10-22 16:26:00 -07003034[[index.batchThreads]]index.batchThreads::
3035+
3036Number of threads to use for indexing in background operations, such as
Christian Aistleitner6e3c1a12020-06-14 20:57:00 +02003037online schema upgrades, and also for offline reindexing.
Dave Borowitz787af5f2014-10-22 16:26:00 -07003038+
Patrick Hieselbdbee9c2018-07-04 10:54:26 +02003039If not set or set to a zero, defaults to the number of logical CPUs as returned
3040by the JVM. If set to a negative value, defaults to a direct executor.
Dave Borowitz787af5f2014-10-22 16:26:00 -07003041
Dave Borowitzd80b9342015-03-25 10:32:21 -07003042[[index.onlineUpgrade]]index.onlineUpgrade::
3043+
3044Whether to upgrade to new index schema versions while the server is
3045running. This is recommended as it prevents additional downtime during
3046Gerrit version upgrades (avoiding the need for an offline reindex step
3047using Reindex), but can add additional server load during the upgrade.
3048+
3049If set to false, there is no way to upgrade the index schema to take
3050advantage of new search features without restarting the server.
3051+
3052Defaults to true.
3053
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07003054[[index.maxLimit]]index.maxLimit::
3055+
3056Maximum limit to allow for search queries. Requesting results above this
3057limit will truncate the list (but will still set `_more_changes` on
3058result lists). Set to 0 for no limit.
3059+
David Pursehouse7c1f4a42018-03-15 17:03:40 +09003060When `index.type` is set to `ELASTICSEARCH`, this value should not exceed
3061the `index.max_result_window` value configured on the Elasticsearch
David Pursehouse52c2b4a2018-04-10 23:38:57 +09003062server. If a value is not configured during site initialization, defaults to
306310000, which is the default value of `index.max_result_window` in Elasticsearch.
David Pursehouse7c1f4a42018-03-15 17:03:40 +09003064+
David Pursehouse52c2b4a2018-04-10 23:38:57 +09003065When `index.type` is set to `LUCENE`, defaults to no limit.
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07003066
Dave Borowitzf56d3652015-04-22 17:35:34 -07003067[[index.maxPages]]index.maxPages::
3068+
3069Maximum number of pages of search results to allow, as index
3070implementations may have to scan through large numbers of skipped
3071results when searching with an offset. Requesting results starting past
3072this threshold times the requested limit will result in an error. Set to
30730 for no limit.
3074+
3075Defaults to no limit.
3076
Dave Borowitzd034ca82015-10-15 11:20:30 -04003077[[index.maxTerms]]index.maxTerms::
3078+
3079Maximum number of leaf terms to allow in a query. Too-large queries may
3080perform poorly, so setting this option causes query parsing to fail fast
Dave Borowitzada289c2018-12-18 13:24:14 -08003081before attempting to send them to the secondary index.
Dave Borowitzd034ca82015-10-15 11:20:30 -04003082+
Marco Miller6da22822016-01-29 12:31:38 -05003083When the index type is `LUCENE`, also sets the maximum number of clauses
3084permitted per BooleanQuery. This is so that all enforced query limits
3085are the same.
3086+
3087Defaults to 1024.
Dave Borowitzd034ca82015-10-15 11:20:30 -04003088
Dave Borowitz3747f0f2017-06-23 14:29:31 -04003089[[index.autoReindexIfStale]]index.autoReindexIfStale::
3090+
3091Whether to automatically check if a document became stale in the index
3092immediately after indexing it. If false, there is a race condition during two
3093simultaneous writes that may cause one of the writes to not be reflected in the
3094index. The check to avoid this does consume some resources.
3095+
Dave Borowitzb7da0762018-03-19 09:08:45 -04003096Defaults to false.
Dave Borowitz3747f0f2017-06-23 14:29:31 -04003097
Edwin Kempin0f0de862018-02-08 16:24:11 +01003098[[index.scheduledIndexer]]
3099==== Subsection index.scheduledIndexer
3100
3101This section configures periodic indexing. Periodic indexing is
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003102intended to run only on replicas and only updates the group index.
3103Replication to replicas happens on Git level so that Gerrit is not aware
3104of incoming replication events. But replicas need an updated group index
Edwin Kempin0f0de862018-02-08 16:24:11 +01003105to resolve memberships of users for ACL validation. To keep the group
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003106index in replicas up-to-date the Gerrit replica periodically scans the
Edwin Kempin0f0de862018-02-08 16:24:11 +01003107group refs in the All-Users repository to reindex groups if they are
3108stale.
3109
3110The scheduled reindexer is not able to detect group deletions that
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003111happened while the replica was offline, but since group deletions are not
Edwin Kempin0f0de862018-02-08 16:24:11 +01003112supported this should never happen. If nevertheless groups refs were
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003113deleted while a replica was offline a full offline link:pgm-reindex.html[
Edwin Kempin0f0de862018-02-08 16:24:11 +01003114reindex] must be performed.
3115
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003116This section is only used if Gerrit runs in replica mode, otherwise it is
Edwin Kempin0f0de862018-02-08 16:24:11 +01003117ignored.
3118
Edwin Kempina32d4432018-02-16 17:18:31 +01003119[[index.scheduledIndexer.runOnStartup]]index.scheduledIndexer.runOnStartup::
3120+
3121Whether the scheduled indexer should run once immediately on startup.
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003122If set to `true` the replica startup is blocked until all stale groups
3123were reindexed. Enabling this allows to prevent that replicas that were
Edwin Kempina32d4432018-02-16 17:18:31 +01003124offline for a longer period of time run with outdated group information
3125until the first scheduled indexing is done.
3126+
3127Defaults to `true`.
3128
Edwin Kempin0f0de862018-02-08 16:24:11 +01003129[[index.scheduledIndexer.enabled]]index.scheduledIndexer.enabled::
3130+
3131Whether the scheduled indexer is enabled. If the scheduled indexer is
3132disabled you must implement other means to keep the group index for the
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02003133replica up-to-date (e.g. by using ElasticSearch for the indexes).
Edwin Kempin0f0de862018-02-08 16:24:11 +01003134+
3135Defaults to `true`.
3136
3137[[index.scheduledIndexer.startTime]]index.scheduledIndexer.startTime::
3138+
3139The link:#schedule-configuration-startTime[start time] for running
3140the scheduled indexer.
3141+
3142Defaults to `00:00`.
3143
3144[[index.scheduledIndexer.interval]]index.scheduledIndexer.interval::
3145+
3146The link:#schedule-configuration-interval[interval] for running
3147the scheduled indexer.
3148+
3149Defaults to `5m`.
3150
3151link:#schedule-configuration-examples[Schedule examples] can be found
3152in the link:#schedule-configuration[Schedule Configuration] section.
3153
David Pursehouse902b3ee2014-07-09 16:17:49 +09003154==== Lucene configuration
3155
3156Open and closed changes are indexed in separate indexes named
3157'open' and 'closed' respectively.
3158
3159The following settings are only used when the index type is `LUCENE`.
David Pursehouseac88c362014-02-06 12:01:34 +09003160
David Pursehouse00c82142014-01-22 17:41:09 +09003161[[index.name.ramBufferSize]]index.name.ramBufferSize::
3162+
David Pursehouse00c82142014-01-22 17:41:09 +09003163Determines the amount of RAM that may be used for buffering added documents
3164and deletions before they are flushed to the index. See the
3165link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
Marian Harbach34253372019-12-10 18:01:31 +01003166Lucene documentation,role=external,window=_blank] for further details.
David Pursehouse00c82142014-01-22 17:41:09 +09003167+
3168Defaults to 16M.
3169
3170[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
3171+
David Pursehouse00c82142014-01-22 17:41:09 +09003172Determines the minimal number of documents required before the buffered
3173in-memory documents are flushed to the index. Large values generally
3174give faster indexing. See the
3175link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
Marian Harbach34253372019-12-10 18:01:31 +01003176Lucene documentation,role=external,window=_blank] for further details.
David Pursehouse00c82142014-01-22 17:41:09 +09003177+
3178Defaults to -1, meaning no maximum is set and the writer will flush
3179according to RAM usage.
3180
Dave Borowitzd08b0452014-02-13 11:56:03 -08003181[[index.name.commitWithin]]index.name.commitWithin::
3182+
Dave Borowitzd08b0452014-02-13 11:56:03 -08003183Determines the period at which changes are automatically committed to
3184stable store on disk. This is a costly operation and may block
3185additional index writes, so lower with caution.
3186+
Bruce Zuaf058e62014-03-21 10:03:05 +08003187If zero, changes are committed after every write. This is very costly
3188but may be useful if offline reindexing is infeasible, or for development
3189servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08003190+
Bruce Zuaf058e62014-03-21 10:03:05 +08003191Values can be specified using standard time unit abbreviations (`ms`, `sec`,
3192`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07003193+
Bruce Zuaf058e62014-03-21 10:03:05 +08003194If negative, `commitWithin` is disabled. Changes are flushed to disk when
3195the in-memory buffer fills, but only committed and guaranteed to be synced
3196to disk when the process finishes.
David Pursehouse902b3ee2014-07-09 16:17:49 +09003197+
Dave Borowitzd08b0452014-02-13 11:56:03 -08003198Defaults to 300000 ms (5 minutes).
3199
Trevor Getty8fb5db52019-08-26 14:33:19 +02003200
3201[[index.name.maxMergeCount]]index.name.maxMergeCount::
3202+
3203Determines the max number of simultaneous merges that are allowed. If a merge
3204is necessary yet we already have this many threads running, the incoming thread
3205(that is calling add/updateDocument) will block until a merge thread has
3206completed. Note that Lucene will only run the smallest maxThreadCount merges
3207at a time. See the
3208link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Marian Harbach34253372019-12-10 18:01:31 +01003209Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003210+
3211Defaults to -1 for (auto detection).
3212
3213
3214[[index.name.maxThreadCount]]index.name.maxThreadCount::
3215+
3216Determines the max number of simultaneous Lucene merge threads that should be running at
3217once. This must be less than or equal to maxMergeCount. See the
3218link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#setDefaultMaxMergesAndThreads(boolean)[
Marian Harbach34253372019-12-10 18:01:31 +01003219Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003220+
3221For further details on Lucene index configuration (auto detection) which
3222affects maxThreadCount and maxMergeCount settings.
3223See the
3224link: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 +01003225Lucene documentation,role=external,window=_blank]
Trevor Getty8fb5db52019-08-26 14:33:19 +02003226+
3227Defaults to -1 for (auto detection).
3228
3229[[index.name.enableAutoIOThrottle]]index.name.enableAutoIOThrottle::
3230+
3231Allows the control of whether automatic IO throttling is enabled and used by
3232default in the lucene merge queue. Automatic dynamic IO throttling, which when
3233on is used to adaptively rate limit writes bytes/sec to the minimal rate necessary
3234so merges do not fall behind. See the
3235link:https://lucene.apache.org/core/5_5_0/core/org/apache/lucene/index/ConcurrentMergeScheduler.html#enableAutoIOThrottle()[
Marian Harbach34253372019-12-10 18:01:31 +01003236Lucene documentation,role=external,window=_blank] for further details.
Trevor Getty8fb5db52019-08-26 14:33:19 +02003237+
3238Defaults to true (throttling enabled).
3239
David Pursehouse902b3ee2014-07-09 16:17:49 +09003240Sample Lucene index configuration:
David Pursehouse00c82142014-01-22 17:41:09 +09003241----
3242[index]
3243 type = LUCENE
3244
3245[index "changes_open"]
3246 ramBufferSize = 60 m
3247 maxBufferedDocs = 3000
Trevor Getty8fb5db52019-08-26 14:33:19 +02003248 maxThreadCount = 5
3249 maxMergeCount = 50
3250
David Pursehouse00c82142014-01-22 17:41:09 +09003251
3252[index "changes_closed"]
3253 ramBufferSize = 20 m
3254 maxBufferedDocs = 500
Trevor Getty8fb5db52019-08-26 14:33:19 +02003255 maxThreadCount = 10
3256 maxMergeCount = 100
3257 enableIOThrottle = false
3258
David Pursehouse00c82142014-01-22 17:41:09 +09003259----
3260
Dariusz Lukszaea529882017-04-25 15:11:31 +02003261[[elasticsearch]]
3262=== Section elasticsearch
David Pursehouse8e72f532014-06-24 11:01:28 +09003263
David Pursehouse1a82b372018-06-19 11:14:21 +09003264WARNING: Support for Elasticsearch is still experimental and is not recommended
David Pursehouse7e566dc2018-09-20 14:12:15 +09003265for production use. For compatibility information, please refer to the
Marian Harbach34253372019-12-10 18:01:31 +01003266link:https://www.gerritcodereview.com/elasticsearch.html[project homepage,role=external,window=_blank].
David Pursehouse8e72f532014-06-24 11:01:28 +09003267
David Ostrovsky81d2b5e2020-04-04 15:09:32 +02003268In Elasticsearch version 6.2 or later, the open and closed changes are merged
3269into the default `_doc` type. The latter is also used for the accounts and groups
3270indices starting with Elasticsearch 6.2.
David Pursehouse8e72f532014-06-24 11:01:28 +09003271
David Pursehouse6ea25322018-07-03 21:26:07 +09003272Note that when Gerrit is configured to use Elasticsearch, the Elasticsearch
3273server(s) must be reachable during the site initialization.
3274
Dariusz Lukszaea529882017-04-25 15:11:31 +02003275[[elasticsearch.prefix]]elasticsearch.prefix::
David Pursehouse8e72f532014-06-24 11:01:28 +09003276+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08003277This setting can be used to prefix index names to allow multiple Gerrit
David Pursehouse997cf2a2018-05-10 15:40:47 +09003278instances in a single Elasticsearch cluster. Prefix `gerrit1_` would result in a
3279change index named `gerrit1_changes_0001`.
David Pursehouse8e72f532014-06-24 11:01:28 +09003280+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08003281Not set by default.
David Pursehouse8e72f532014-06-24 11:01:28 +09003282
David Pursehouse479c50b2018-07-02 12:47:07 +09003283[[elasticsearch.server]]elasticsearch.server::
Dariusz Lukszaea529882017-04-25 15:11:31 +02003284+
David Pursehouse479c50b2018-07-02 12:47:07 +09003285Elasticsearch server URI in the form `http[s]://hostname:port`. The `port` is
3286optional and defaults to `9200` if not specified.
Dariusz Lukszaea529882017-04-25 15:11:31 +02003287+
David Pursehouse479c50b2018-07-02 12:47:07 +09003288At least one server must be specified. May be specified multiple times to
3289configure multiple Elasticsearch servers.
Dariusz Lukszaea529882017-04-25 15:11:31 +02003290+
David Pursehouse479c50b2018-07-02 12:47:07 +09003291Note that the site initialization program only allows to configure a single
3292server. To configure multiple servers the `gerrit.config` file must be edited
3293manually.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003294
David Pursehouse499f7fe2018-11-30 16:07:21 +09003295[[elasticsearch.numberOfShards]]elasticsearch.numberOfShards::
3296+
3297Sets the number of shards to use per index. Refer to the
Dyrone Tengae8babd2020-03-18 16:06:29 +08003298link:https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#_static_index_settings[
Marian Harbach34253372019-12-10 18:01:31 +01003299Elasticsearch documentation,role=external,window=_blank] for details.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003300+
Marco Miller082139a2019-06-17 15:00:35 -04003301Defaults to 5 for Elasticsearch versions 5 and 6, and to 1 starting with Elasticsearch 7.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003302
3303[[elasticsearch.numberOfReplicas]]elasticsearch.numberOfReplicas::
3304+
3305Sets the number of replicas to use per index. Refer to the
Dyrone Tengae8babd2020-03-18 16:06:29 +08003306link:https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings[
Marian Harbach34253372019-12-10 18:01:31 +01003307Elasticsearch documentation,role=external,window=_blank] for details.
David Pursehouse499f7fe2018-11-30 16:07:21 +09003308+
3309Defaults to 1.
3310
Dyrone Teng76fed532020-03-18 11:20:03 +08003311[[elasticsearch.maxResultWindow]]elasticsearch.maxResultWindow::
3312+
3313Sets the maximum value of `from + size` for searches to use per index. Refer to the
3314link:https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings[
David Pursehoused9aa6b02020-03-19 13:33:17 +09003315Elasticsearch documentation,role=external,window=_blank] for details.
Dyrone Teng76fed532020-03-18 11:20:03 +08003316+
3317Defaults to 10000.
3318
David Pursehouse13f1d632018-07-02 14:37:36 +09003319==== Elasticsearch Security
Dariusz Lukszaea529882017-04-25 15:11:31 +02003320
David Pursehouse13f1d632018-07-02 14:37:36 +09003321When security is enabled in Elasticsearch, the username and password must be provided.
3322Note that the same username and password are used for all servers.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003323
Marco Milleree4eefc2020-07-29 16:24:59 -04003324For further information about Elasticsearch security, please refer to
Marco Miller527d2d02020-07-31 13:06:58 -04003325link:https://www.elastic.co/guide/en/elasticsearch/reference/current/security-getting-started.html[the documentation,role=external,window=_blank].
Marco Milleree4eefc2020-07-29 16:24:59 -04003326This is the current documentation link. Select another Elasticsearch version
3327from the dropdown menu available on that page if need be.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003328
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003329[[elasticsearch.username]]elasticsearch.username::
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003330+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003331Username used to connect to Elasticsearch.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003332+
David Pursehouse975fdd22018-07-02 14:23:07 +09003333If a password is set, defaults to `elastic`, otherwise not set by default.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003334
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003335[[elasticsearch.password]]elasticsearch.password::
3336+
3337Password used to connect to Elasticsearch.
3338+
3339Not set by default.
Dariusz Luksza4ca46be2017-04-25 11:40:29 +02003340
Patrick Hieselda692472019-10-07 16:03:23 +02003341[[event]]
3342=== Section event
3343
3344[[event.payload.listChangeOptions]]events.payload.listChangeOptions::
3345+
3346List of options that Gerrit applies when rendering the payload of an
3347internal event. This is the same set of options that are documented
3348link:rest-api-changes.html#query-options[here].
3349+
3350Depending on the setup, these events might get serialized using stream
3351events.
3352+
3353This can be set to the set of minimal options that consumers of Gerrit's
Patrick Hiesela4824db2019-12-20 10:55:26 +01003354events need. A minimal set would be (`SKIP_DIFFSTAT`).
Patrick Hieselda692472019-10-07 16:03:23 +02003355+
3356Every option that gets added here will have a performance impact. The
3357general recommendation is therefore to set this to a minimal set of
3358required options.
3359+
3360Defaults to all available options minus `CHANGE_ACTIONS`,
3361`CURRENT_ACTIONS` and `CHECK`. This is a rich default to make sure the
3362config is backwards compatible with what the default was before the config
3363was added.
3364
3365
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003366[[ldap]]
3367=== Section ldap
3368
3369LDAP integration is only enabled if `auth.type` is set to
3370`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
3371detailed description of the `auth.type` settings and their
3372implications.
3373
3374An example LDAP configuration follows, and then discussion of
3375the parameters introduced here. Suitable defaults for most
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003376parameters are automatically guessed based on the type of server
Michal Pasierb3e262742017-01-23 12:50:48 +01003377detected during startup. The guessed defaults support
Marian Harbach34253372019-12-10 18:01:31 +01003378link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307,role=external,window=_blank], Active
3379Directory and link:https://www.freeipa.org[FreeIPA,role=external,window=_blank].
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003380
3381----
3382[ldap]
3383 server = ldap://ldap.example.com
3384
3385 accountBase = ou=people,dc=example,dc=com
3386 accountPattern = (&(objectClass=person)(uid=${username}))
3387 accountFullName = displayName
3388 accountEmailAddress = mail
3389
3390 groupBase = ou=groups,dc=example,dc=com
3391 groupMemberPattern = (&(objectClass=group)(member=${dn}))
3392----
3393
Luca Milanesioa05d42b2018-12-19 01:13:06 +00003394[[ldap.guessRelevantGroups]]ldap.guessRelevantGroups::
3395+
3396Filter the groups found in LDAP by guessing the ones relevant to
3397Gerrit and removing the others from list completions and ACL evaluations.
3398The guess is based on two elements: the projects most recently
3399accessed in the cache and the list of LDAP groups included in their ACLs.
3400+
3401Please note that projects rarely used and thus not cached may be
3402temporarily inaccessible by users even with LDAP membership and grants
3403referenced in the ACLs.
3404+
3405By default, true.
3406
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003407[[ldap.server]]ldap.server::
3408+
3409URL of the organization's LDAP server to query for user information
3410and group membership from. Must be of the form `ldap://host` or
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003411`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003412+
3413If `auth.type` is `LDAP` this setting should use `ldaps://` to
3414ensure the end user's plaintext password is transmitted only over
3415an encrypted connection.
3416
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003417[[ldap.startTls]]ldap.startTls::
3418+
3419If true, Gerrit will perform StartTLS extended operation.
3420+
3421By default, false, StartTLS will not be enabled.
3422
Alon Bar-Leve39c35c2019-06-10 12:59:55 +03003423[[ldap.supportAnonymous]]ldap.supportAnonymous::
3424+
3425If false, Gerrit will provide credentials only at connection open, this is
3426required for some `LDAP` implementations that do not allow anonymous bind
3427for StartTLS or for reauthentication.
3428+
3429By default, true.
3430
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003431[[ldap.sslVerify]]ldap.sslVerify::
3432+
Alon Bar-Lev8ae444d2017-05-08 20:11:09 +03003433If false and ldap.server is an `ldaps://` style URL or `ldap.startTls`
3434is true, Gerrit will not verify the server certificate when it connects
3435to perform a query.
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003436+
3437By default, true, requiring the certificate to be verified.
3438
Olga Grinbergcf1b06a2015-02-03 15:54:48 -05003439[[ldap.groupsVisibleToAll]]ldap.groupsVisibleToAll::
3440+
3441If true, LDAP groups are visible to all registered users.
3442+
3443By default, false, LDAP groups are visible only to administrators and
3444group members.
3445
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003446[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003447+
3448_(Optional)_ Username to bind to the LDAP server with. If not set,
3449an anonymous connection to the LDAP server is attempted.
3450
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003451[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003452+
3453_(Optional)_ Password for the user identified by `ldap.username`.
3454If not set, an anonymous (or passwordless) connection to the LDAP
3455server is attempted.
3456
Ben Wu0410a152010-06-04 16:17:24 +08003457[[ldap.referral]]ldap.referral::
3458+
3459_(Optional)_ How an LDAP referral should be handled if it is
3460encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05003461automatically follow any referrals, or `ignore` to ignore the
3462referrals.
Ben Wu0410a152010-06-04 16:17:24 +08003463+
3464By default, `ignore`.
3465
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003466[[ldap.readTimeout]]ldap.readTimeout::
3467+
3468_(Optional)_ The read timeout for an LDAP operation. The value is
3469in the usual time-unit format like "1 s", "100 ms", etc...
3470A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09003471threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01003472+
3473By default there is no timeout and Gerrit will wait for the LDAP
3474server to respond until the TCP connection times out.
3475
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003476[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003477+
3478Root of the tree containing all user accounts. This is typically
3479of the form `ou=people,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003480+
3481This setting may be added multiple times to specify more than
3482one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003483
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003484[[ldap.accountScope]]ldap.accountScope::
3485+
3486Scope of the search performed for accounts. Must be one of:
3487+
3488* `one`: Search only one level below accountBase, but not recursive
3489* `sub` or `subtree`: Search recursively below accountBase
3490* `base` or `object`: Search exactly accountBase; probably not desired
3491
3492+
3493Default is `subtree` as many directories have several levels.
3494
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003495[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003496+
3497Query pattern to use when searching for a user account. This may be
3498any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09003499`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003500`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09003501that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02003502the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07003503the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003504+
3505This pattern is used to search the objects contained directly under
3506the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02003507is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003508setting depends on the LDAP schema used by the directory server.
3509+
Michal Pasierb3e262742017-01-23 12:50:48 +01003510Default is `(uid=${username})` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003511and `(&(objectClass=user)(sAMAccountName=${username}))`
3512for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003513
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07003514[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003515+
3516_(Optional)_ Name of an attribute on the user account object which
3517contains the initial value for the user's full name field in Gerrit.
3518Typically this is the `displayName` property in LDAP, but could
3519also be `legalName` or `cn`.
3520+
David Pursehouse221d4f62012-06-08 17:38:08 +09003521Attribute values may be concatenated with literal strings. For
3522example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02003523`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003524+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003525If set, users will be unable to modify their full name field, as
3526Gerrit will populate it only from the LDAP data.
3527+
Michal Pasierb3e262742017-01-23 12:50:48 +01003528Default is `displayName` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003529and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003530
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003531[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003532+
3533_(Optional)_ Name of an attribute on the user account object which
3534contains the user's Internet email address, as defined by this
3535LDAP server.
3536+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003537Attribute values may be concatenated with literal strings,
3538for example to set the email address to the lowercase form
3539of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02003540`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003541+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003542If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09003543but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003544and select a different preferred email address.
3545+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003546Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003547
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003548[[ldap.accountSshUserName]]ldap.accountSshUserName::
3549+
3550_(Optional)_ Name of an attribute on the user account object which
3551contains the initial value for the user's SSH username field in
3552Gerrit. Typically this is the `uid` property in LDAP, but could
3553also be `cn`. Administrators should prefer to match the attribute
3554corresponding to the user's workstation username, as this is what
3555SSH clients will default to.
3556+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003557Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02003558an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003559force the value of sAMAccountName, if defined, to be all lowercase.
3560The suffix `.toUpperCase` can be used for the other direction.
3561The suffix `.localPart` can be used to split attribute values of
3562the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02003563example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07003564+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003565If set, users will be unable to modify their SSH username field, as
David Pursehousec12da502016-08-11 20:45:03 +09003566Gerrit will populate it only from the LDAP data. Note that once the
3567username has been set it cannot be changed, therefore it is
3568recommended not to make changes to this setting that would cause the
3569value to differ, as this will prevent users from logging in.
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07003570+
Michal Pasierb3e262742017-01-23 12:50:48 +01003571Default is `uid` for FreeIPA and RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003572and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07003573
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003574[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04003575+
3576_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003577contains the groups the user is part of. Typically used for Active
Michal Pasierb3e262742017-01-23 12:50:48 +01003578Directory and FreeIPA servers.
Anthony93de7db2009-10-03 10:01:50 -04003579+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07003580Default is unset for RFC 2307 servers (disabled)
Michal Pasierb3e262742017-01-23 12:50:48 +01003581and `memberOf` for Active Directory and FreeIPA.
3582
3583[[ldap.accountMemberExpandGroups]]ldap.accountMemberExpandGroups::
3584+
3585_(Optional)_ Whether to expand nested groups recursively. This
3586setting is used only if `ldap.accountMemberField` is set.
3587+
3588Default is unset for FreeIPA and `true` for RFC 2307 servers
3589and Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04003590
Saša Živkovc81291f2015-02-04 17:19:20 +01003591[[ldap.fetchMemberOfEagerly]]ldap.fetchMemberOfEagerly::
3592+
3593_(Optional)_ Whether to fetch the `memberOf` account attribute on
3594login. Setups which use LDAP for user authentication but don't make
3595use of the LDAP groups may benefit from setting this option to `false`
3596as this will result in a much faster LDAP login.
3597+
3598Default is unset for RFC 2307 servers (disabled) and `true` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003599Active Directory and FreeIPA.
Saša Živkovc81291f2015-02-04 17:19:20 +01003600
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003601[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003602+
3603Root of the tree containing all group objects. This is typically
3604of the form `ou=groups,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00003605+
3606This setting may be added multiple times to specify more than
3607one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003608
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07003609[[ldap.groupScope]]ldap.groupScope::
3610+
3611Scope of the search performed for group objects. Must be one of:
3612+
3613* `one`: Search only one level below groupBase, but not recursive
3614* `sub` or `subtree`: Search recursively below groupBase
3615* `base` or `object`: Search exactly groupBase; probably not desired
3616
3617+
3618Default is `subtree` as many directories have several levels.
3619
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003620[[ldap.groupPattern]]ldap.groupPattern::
3621+
3622Query pattern used when searching for an LDAP group to connect
3623to a Gerrit group. This may be any valid LDAP query expression,
3624including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02003625`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003626group owner.
3627+
Michal Pasierb3e262742017-01-23 12:50:48 +01003628Default is `(cn=${groupname})` for FreeIPA and RFC 2307 servers,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003629and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07003630
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003631[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003632+
3633Query pattern to use when searching for the groups that a user
3634account is currently a member of. This may be any valid LDAP query
3635expression, including the standard `(&...)` and `(|...)` operators.
3636+
David Pursehouse42f42042013-08-01 14:02:25 +09003637If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003638replaced with a parameter set to the username that was supplied
3639by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02003640such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003641corresponding attribute (in this case, `fooBarAttribute`) as read
3642from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02003643Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003644+
Scott Dial50457502013-08-11 16:52:51 -04003645Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
Michal Pasierb3e262742017-01-23 12:50:48 +01003646RFC 2307, and unset (disabled) for Active Directory and FreeIPA.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003647
Auke Schrijnen57809132012-09-26 21:05:39 +02003648[[ldap.groupName]]ldap.groupName::
3649+
David Pursehouse39489ae2012-10-12 13:50:04 +09003650_(Optional)_ Name of the attribute on the group object which contains
3651the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02003652+
David Pursehouse39489ae2012-10-12 13:50:04 +09003653Typically the attribute name is `cn` for RFC 2307 and Active Directory
3654servers. For other servers the attribute name may differ, for example
3655`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02003656+
David Pursehouse39489ae2012-10-12 13:50:04 +09003657It is also possible to specify a literal string containing a pattern of
3658attribute values. For example to create a Gerrit group name consisting of
3659LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
3660+
3661Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02003662
Gustaf Lundhdaf41af2016-12-05 19:05:09 +01003663[[ldap.mandatoryGroup]]ldap.mandatoryGroup::
3664+
3665All users must be a member of this group to allow account creation or
3666authentication.
3667+
3668Setting mandatoryGroup implies enabling of `ldap.fetchMemberOfEagerly`
3669+
3670By default, unset.
3671
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003672[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
3673+
3674Converts the local username, that is used to login into the Gerrit
David Pursehousea1d633b2014-05-02 17:21:02 +09003675Web UI, to lower case before doing the LDAP authentication. By setting
3676this parameter to true, a case insensitive login to the Gerrit Web UI
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003677can be achieved.
3678+
3679If set, it must be ensured that the local usernames for all existing
3680accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09003681local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02003682anymore. The local usernames for the existing accounts can be
3683converted to lower case by running the server program
3684link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
3685Please be aware that the conversion of the local usernames to lower
3686case can't be undone. For newly created accounts the local username
3687will be directly stored in lower case.
3688+
3689By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07003690
Robin Rosenberga3baed02012-10-14 14:09:32 +02003691[[ldap.authentication]]ldap.authentication::
3692+
3693Defines how Gerrit authenticates with the server. When set to `GSSAPI`
3694Gerrit will use Kerberos. To use kerberos the
3695`java.security.auth.login.config` system property must point to a
3696login to a JAAS configuration file and, if Java 6 is used, the system
3697property `java.security.krb5.conf` must point to the appropriate
3698krb5.ini file with references to the KDC.
3699
3700Typical jaas.conf.
3701
3702----
3703KerberosLogin {
3704 com.sun.security.auth.module.Krb5LoginModule
3705 required
3706 useTicketCache=true
3707 doNotPrompt=true
3708 renewTGT=true;
3709};
3710----
3711
3712See Java documentation on how to create the krb5.ini file.
3713
3714Note the `renewTGT` property to make sure the TGT does not expire,
3715and `useTicketCache` to use the TGT supplied by the operating system. As
3716the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09003717to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02003718
3719On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
3720must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
3721have local administrator privileges.
3722
Bruce Zucd04bbc2014-07-25 15:48:09 +08003723[[ldap.useConnectionPooling]]ldap.useConnectionPooling::
3724+
3725_(Optional)_ Enable the LDAP connection pooling or not.
3726+
3727If it is true, the LDAP service provider maintains a pool of (possibly)
3728previously used connections and assigns them to a Context instance as
3729needed. When a Context instance is done with a connection (closed or
3730garbage collected), the connection is returned to the pool for future use.
3731+
3732For details, see link:http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html[
Marian Harbach34253372019-12-10 18:01:31 +01003733LDAP connection management (Pool),role=external,window=_blank] and link:http://docs.oracle.com/javase/tutorial/jndi/ldap/config.html[
3734LDAP connection management (Configuration),role=external,window=_blank]
Bruce Zucd04bbc2014-07-25 15:48:09 +08003735+
3736By default, false.
3737
3738[[ldap.connectTimeout]]ldap.connectTimeout::
3739+
Saša Živkov303701a2015-01-19 16:24:44 +01003740_(Optional)_ Timeout period for establishment of an LDAP connection.
Bruce Zucd04bbc2014-07-25 15:48:09 +08003741+
3742The value is in the usual time-unit format like "1 s", "100 ms",
3743etc...
3744+
3745By default there is no timeout and Gerrit will wait indefinitely.
3746
Saša Živkov5049f512015-01-19 17:04:43 +01003747[[ldap-connection-pooling]]
3748==== LDAP Connection Pooling
3749Once LDAP connection pooling is enabled by setting the link:#ldap.useConnectionPooling[
3750ldap.useConnectionPooling] configuration property to `true`, the connection pool
3751can be configured using JVM system properties as explained in the
3752link:http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-ldap.html#POOL[
Marian Harbach34253372019-12-10 18:01:31 +01003753Java SE Documentation,role=external,window=_blank].
Bruce Zucd04bbc2014-07-25 15:48:09 +08003754
Saša Živkov5049f512015-01-19 17:04:43 +01003755For standalone Gerrit (running with the embedded Jetty), JVM system properties
3756are specified in the link:#container[container section]:
Bruce Zucd04bbc2014-07-25 15:48:09 +08003757
Saša Živkov5049f512015-01-19 17:04:43 +01003758----
3759 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.maxsize=20
3760 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.prefsize=10
3761 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.timeout=300000
3762----
Bruce Zucd04bbc2014-07-25 15:48:09 +08003763
Saša Živkovca7a67e2015-12-01 14:25:10 +01003764[[lfs]]
3765=== Section lfs
3766
3767[[lfs.plugin]]lfs.plugin::
3768+
David Pursehouse2463c542016-08-02 16:04:58 +09003769The name of a plugin which serves the
3770link:https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md[
Marian Harbach34253372019-12-10 18:01:31 +01003771LFS protocol,role=external,window=_blank] on the `<project-name>/info/lfs/objects/batch` endpoint. When
David Pursehouse2463c542016-08-02 16:04:58 +09003772not configured Gerrit will respond with `501 Not Implemented` on LFS protocol
3773requests.
Saša Živkovca7a67e2015-12-01 14:25:10 +01003774+
3775By default unset.
3776
Gustaf Lundhaef90122015-04-27 16:48:19 +02003777[[log]]
3778=== Section log
3779
3780[[log.jsonLogging]]log.jsonLogging::
3781+
Thomas Draebing6930b212020-02-13 17:51:42 +01003782If set to true, enables error, ssh and http logging in JSON format (file name:
3783"logs/{error|sshd|httpd}_log.json").
Gustaf Lundhaef90122015-04-27 16:48:19 +02003784+
3785Defaults to false.
3786
3787[[log.textLogging]]log.textLogging::
3788+
3789If set to true, enables error logging in regular plain text format. Can only be disabled
3790if `jsonLogging` is enabled.
3791+
3792Defaults to true.
3793
David Pursehouse2281fef2017-11-21 21:27:17 +09003794[[log.compress]]log.compress::
3795+
3796If set to true, log files are compressed at server startup and then daily at 11pm
3797(in the server's local time zone).
3798+
3799Defaults to true.
3800
David Pursehouse633fff32017-11-21 22:08:12 +09003801[[log.rotate]]log.rotate::
3802+
3803If set to true, log files are rotated daily at midnight (GMT).
3804+
3805Defaults to true.
3806
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003807[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003808=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003809
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003810[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003811+
3812If set to true, files with the MIME type `<name>` will be sent as
3813direct downloads to the user's browser, rather than being wrapped up
3814inside of zipped archives. The type name may be a complete type
Jonathan Nieder5758f182015-03-30 11:28:55 -07003815name, e.g. `image/gif`, a generic media type, e.g. `+image/*+`,
3816or the wildcard `+*/*+` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003817+
3818By default, false for all MIME types.
3819
3820Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003821----
3822[mimetype "image/*"]
3823 safe = true
3824
3825[mimetype "application/pdf"]
3826 safe = true
3827
3828[mimetype "application/msword"]
3829 safe = true
3830
3831[mimetype "application/vnd.ms-excel"]
3832 safe = true
3833----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003834
Dave Borowitzbc314912017-03-21 14:23:35 -07003835[[note-db]]
3836=== Section noteDb
3837
Dave Borowitzada289c2018-12-18 13:24:14 -08003838NoteDb is the Git-based database storage backend for Gerrit. For more
3839information, including how to migrate data from an older Gerrit version, see the
3840link:note-db.html[documentation].
Dave Borowitzbc314912017-03-21 14:23:35 -07003841
Edwin Kempin5be9c312017-07-07 10:40:55 +02003842[[notedb.accounts.sequenceBatchSize]]notedb.accounts.sequenceBatchSize::
3843+
Edwin Kempin311d5702017-07-28 15:10:24 +02003844The next available account sequence number is stored as UTF-8 text in a
3845blob pointed to by the `refs/sequences/accounts` ref in the `All-Users`
Edwin Kempin5be9c312017-07-07 10:40:55 +02003846repository. Multiple processes share the same sequence by incrementing
3847the counter using normal git ref updates. To amortize the cost of these
3848ref updates, processes increment the counter by a larger number and
3849hand out numbers from that range in memory until they run out. This
3850configuration parameter controls the size of the account ID batch that
3851each process retrieves at once.
3852+
Edwin Kempin5be9c312017-07-07 10:40:55 +02003853By default, 1.
3854
David Pursehouse05eaefe2020-06-02 15:42:46 +09003855[[notedb.changes.sequenceBatchSize]]notedb.changes.sequenceBatchSize::
3856+
3857The next available change sequence number is stored as UTF-8 text in a
3858blob pointed to by the `refs/sequences/changes` ref in the `All-Projects`
3859repository. Multiple processes share the same sequence by incrementing
3860the counter using normal git ref updates. To amortize the cost of these
3861ref updates, processes increment the counter by a larger number and
3862hand out numbers from that range in memory until they run out. This
3863configuration parameter controls the size of the change ID batch that
3864each process retrieves at once.
3865+
3866By default, 20.
Han-Wen Nienhuyse5ca19c2017-11-08 13:33:33 +01003867
Michael Ochmann69813262016-01-27 17:53:55 +01003868[[oauth]]
3869=== Section oauth
3870
3871OAuth integration is only enabled if `auth.type` is set to `OAUTH`. See
3872link:#auth.type[above] for a detailed description of the `auth.type` settings
3873and their implications.
3874
3875By default, contact information, like the full name and email address,
3876is retrieved from the selected OAuth provider when a user account is created,
3877or when a user requests to reload that information in the settings UI. If
3878that is not supported by the OAuth provider, users can be allowed to edit
3879their contact information manually.
3880
3881[[oauth.allowEditFullName]]oauth.allowEditFullName::
3882+
3883If true, the full name can be edited in the contact information.
3884+
3885Default is false.
3886
3887[[oauth.allowRegisterNewEmail]]oauth.allowRegisterNewEmail::
3888+
3889If true, additional email addresses can be registered in the contact
3890information.
3891+
3892Default is false.
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003893
Zac Livingston70a16102018-11-20 15:07:34 -07003894[[operator-alias]]
3895=== Section operator alias
3896
3897Operator aliasing allows global aliases to be defined for query operators.
3898Currently only change queries are supported. The alias name is the git
3899config key name, and the operator being aliased is the git config value.
3900
3901For example:
3902
3903----
3904[operator-alias "change"]
3905 oldage = age
3906 number = change
3907----
3908
3909This section is particularly useful to alias operator names which may be
3910long and clunky because they include a plugin name in them to a shorter
3911name without the plugin name.
3912
3913Aliases are resolved dynamically at invocation time to any currently
3914loaded versions of plugins. If the alias points to an operator provided
3915by a plugin which is not currently loaded, or the plugin does not define
3916the operator, then "unsupported operator" is returned to the user.
3917
3918Aliases will override existing operators. In the case of multiple aliases
3919with the same name, the last one defined will be used.
3920
3921When the target of an alias doesn't exist, the operator with the name
3922of the alias will be used (if present). This enables an admin to config
3923the system to override a core operator with an operator provided by a
3924plugin when present and otherwise fall back to the operator provided by
3925core.
3926
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003927[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003928=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003929
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003930Global settings controlling how Gerrit Code Review creates pack
3931streams for Git clients running clone, fetch, or pull. Most of these
3932variables are per-client request, and thus should be carefully set
3933given the expected concurrent request load and available CPU and
3934memory resources.
3935
3936[[pack.deltacompression]]pack.deltacompression::
3937+
3938If true, delta compression between objects is enabled. This may
3939result in a smaller overall transfer for the client, but requires
3940more server memory and CPU time.
3941+
3942False (off) by default, matching Gerrit Code Review 2.1.4.
3943
3944[[pack.threads]]pack.threads::
3945+
3946Maximum number of threads to use for delta compression (if enabled).
3947This is per-client request. If set to 0 then the number of CPUs is
3948auto-detected and one thread per CPU is used, per client request.
3949+
3950By default, 1.
3951
3952
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003953[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003954=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003955
3956[[plugins.checkFrequency]]plugins.checkFrequency::
3957+
3958How often plugins should be examined for new plugins to load, removed
3959plugins to be unloaded, or updated plugins to be reloaded. Values can
3960be specified using standard time unit abbreviations ('ms', 'sec',
3961'min', etc.).
3962+
3963If set to 0, automatic plugin reloading is disabled. Administrators
Christian Aistleitner8ce1a4e2015-06-05 01:54:15 +02003964may force reloading with link:cmd-plugin-reload.html[gerrit plugin reload].
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003965+
3966Default is 1 minute.
3967
Shawn Pearcefd033502014-02-14 16:42:35 -08003968[[plugins.allowRemoteAdmin]]plugins.allowRemoteAdmin::
3969+
3970Enable remote installation, enable and disable of plugins over HTTP
3971and SSH. If set to true Administrators can install new plugins
3972remotely, or disable existing plugins. Defaults to false.
3973
Saša Živkov350fc682019-05-13 14:13:51 +02003974[[plugins.mandatory]]plugins.mandatory::
3975+
3976List of mandatory plugins. If a plugin from this list does not load,
David Pursehousef06aefb2019-10-18 20:39:53 +09003977Gerrit will fail to start.
3978+
3979Disabling and restarting of a mandatory plugin is rejected, but reloading
3980of a mandatory plugin is still possible.
Saša Živkov350fc682019-05-13 14:13:51 +02003981
Dariusz Luksza98f23522015-03-11 11:41:41 +01003982[[plugins.jsLoadTimeout]]plugins.jsLoadTimeout::
3983+
3984Set the timeout value for loading JavaScript plugins in Gerrit UI.
3985Values can be specified using standard time unit abbreviations ('ms',
3986'sec', 'min', etc.).
3987+
3988Default is 5 seconds. Negative values will be converted to 0.
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003989
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003990[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003991=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003992
Dave Borowitzff243892015-08-31 15:35:28 -04003993This section is used to configure behavior of the 'receive-pack'
3994handler, which responds to 'git push' requests.
lincoln2be11602010-07-05 10:53:25 -03003995
Dave Borowitzff243892015-08-31 15:35:28 -04003996[[receive.allowGroup]]receive.allowGroup::
Dave Borowitz532342bf2015-06-18 20:28:22 -04003997+
Dave Borowitzff243892015-08-31 15:35:28 -04003998Name of the groups of users that are allowed to execute
3999'receive-pack' on the server. One or more groups can be set.
Dave Borowitz532342bf2015-06-18 20:28:22 -04004000+
Dave Borowitzff243892015-08-31 15:35:28 -04004001If no groups are added, any user will be allowed to execute
4002'receive-pack' on the server.
Dave Borowitz532342bf2015-06-18 20:28:22 -04004003
4004[[receive.certNonceSeed]]receive.certNonceSeed::
4005+
4006If set to a non-empty value and server-side signed push validation is
4007link:#receive.enableSignedPush[enabled], use this value as the seed to
4008the HMAC SHA-1 nonce generator. If unset, a 64-byte random seed will be
4009generated at server startup.
4010+
4011As this is used as the seed of a cryptographic algorithm, it is
4012recommended to be placed in link:#secure-config[`secure.config`].
4013+
4014Defaults to unset.
4015
4016[[receive.certNonceSlop]]receive.certNonceSlop::
4017+
4018When validating the nonce passed as part of the signed push protocol,
4019accept valid nonces up to this many seconds old. This allows
4020certificate verification to work over HTTP where there is a lag between
4021the HTTP response providing the nonce to sign and the next request
4022containing the signed nonce. This can be significant on large
4023repositories, since the lag also includes the time to count objects on
4024the client.
4025+
4026Default is 5 minutes.
4027
Dave Borowitzff243892015-08-31 15:35:28 -04004028[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
4029+
4030Number of threads to perform change creation or patch set updates
4031concurrently. Each thread uses its own database connection from
4032the database connection pool, and if all threads are busy then
4033main receive thread will also perform a change creation or patch
4034set update.
4035+
4036Defaults to 1, using only the main receive thread. This feature is for
4037databases with very high latency that can benefit from concurrent
4038operations when multiple changes are impacted at once.
4039
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08004040[[receive.checkMagicRefs]]receive.checkMagicRefs::
4041+
4042If true, Gerrit will verify the destination repository has
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01004043no references under the magic 'refs/for' branch namespace. Names under
4044these locations confuse clients when trying to upload code reviews so
4045Gerrit requires them to be empty.
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08004046+
4047If false Gerrit skips the sanity check and assumes administrators
4048have ensured the repository does not contain any magic references.
4049Setting to false to skip the check can decrease latency during push.
4050+
4051Default is true.
4052
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02004053[[receive.allowProjectOwnersToChangeParent]]receive.allowProjectOwnersToChangeParent::
4054+
4055If true, Gerrit will allow project owners to change the parent of a project.
4056+
4057By default only Gerrit administrators are allowed to change the parent
4058of a project. By allowing project owners to change parents, it may
4059allow the owner to circumvent certain enforced rules (like important
4060BLOCK rules).
4061+
4062Default is false.
Rikard Almgrene9221be2018-09-18 11:12:03 +02004063+
4064This value supports configuration reloads:
4065link:cmd-reload-config.html[reload-config]
Gustaf Lundhfd5fcf42018-06-25 16:15:21 +02004066
Gustaf Lundh9062fd62013-02-14 17:23:11 +01004067[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
4068+
4069If set to true, Gerrit will validate that all referenced objects that
4070are not included in the received pack are reachable by the user.
4071+
4072Carrying out this check on gits with many refs and commits can be a
4073very CPU-heavy operation. For non public Gerrit-servers this check may
4074be overkill.
4075+
4076Only disable this check if you trust the clients not to forge SHA1
4077references to access commits intended to be hidden from the user.
4078+
4079Default is true.
4080
Patrick Hiesel24653be2019-10-22 09:47:32 +02004081[[receive.enableInMemoryRefCache]]receive.enableInMemoryRefCache::
4082+
4083If true, Gerrit will cache all refs advertised during push in memory and
4084base later receive operations on that cache.
4085+
4086Turning this cache off is considered experimental.
4087+
4088This cache provides value when the ref database is slow and/or does not
4089offer an inverse lookup of object ID to ref name. When RefTable is used,
4090this cache can be turned off (experimental) to get speed improvements.
4091+
4092Default is true.
4093
Dave Borowitzff243892015-08-31 15:35:28 -04004094[[receive.enableSignedPush]]receive.enableSignedPush::
lincoln2be11602010-07-05 10:53:25 -03004095+
Dave Borowitzff243892015-08-31 15:35:28 -04004096If true, server-side signed push validation is enabled.
lincoln2be11602010-07-05 10:53:25 -03004097+
Dave Borowitzff243892015-08-31 15:35:28 -04004098When a client pushes with `git push --signed`, this ensures that the
4099push certificate is valid and signed with a valid public key stored in
David Pursehouse6117a472016-07-26 08:02:49 +00004100the `refs/meta/gpg-keys` branch of `All-Users`.
Dave Borowitzff243892015-08-31 15:35:28 -04004101+
4102Defaults to false.
4103
4104[[receive.maxBatchChanges]]receive.maxBatchChanges::
4105+
4106The maximum number of changes that Gerrit allows to be pushed
4107in a batch for review. When this number is exceeded Gerrit rejects
4108the push with an error message.
4109+
4110May be overridden for certain groups by specifying a limit in the
4111link:access-control.html#capability_batchChangesLimit['Batch Changes Limit']
4112global capability.
4113+
4114This setting can be used to prevent users from uploading large
4115number of changes for review by mistake.
4116+
4117Default is zero, no limit.
lincoln2be11602010-07-05 10:53:25 -03004118
Dave Borowitz78542192017-08-31 10:45:47 -04004119[[receive.maxBatchCommits]]receive.maxBatchCommits::
4120+
4121The maximum number of commits that Gerrit allows to be pushed in a batch
4122directly to a branch when link:user-upload.html#bypass_review[bypassing review].
4123This limit can be bypassed if a user link:user-upload.html#skip_validation[skips
4124validation].
4125+
4126Default is 10000.
4127
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004128[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
4129+
4130Maximum allowed Git object size that 'receive-pack' will accept.
4131If an object is larger than the given size the pack-parsing will abort
4132and the push operation will fail. If set to zero then there is no
4133limit.
4134+
David Pursehouse221d4f62012-06-08 17:38:08 +09004135Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004136from pushing objects which are too large to Gerrit.
4137+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07004138This setting can also be set in the `project.config`
David Pursehouse2e548682018-08-01 15:12:47 +02004139(link:config-project-config.html[receive.maxObjectSizeLimit]) in order
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07004140to further reduce the global setting. The project specific setting is
4141only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02004142+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01004143Default is zero.
4144+
4145Common unit suffixes of 'k', 'm', or 'g' are supported.
4146
David Pursehouse3f9c7402018-09-05 18:43:03 +09004147[[receive.inheritProjectMaxObjectSizeLimit]]receive.inheritProjectMaxObjectSizeLimit::
4148+
4149Controls whether the project-level link:config-project-config.html[`receive.maxObjectSizeLimit`]
4150value is inherited from the parent project. When `true`, the value is
4151inherited, otherwise it is not inherited.
4152+
4153Default is false, the value is not inherited.
4154
Dave Borowitz1bb49492015-08-31 15:36:59 -04004155[[receive.maxTrustDepth]]receive.maxTrustDepth::
4156+
4157If signed push validation is link:#receive.enableSignedPush[enabled],
4158set to the maximum depth to search when checking if a key is
4159link:#receive.trustedKey[trusted].
4160+
4161Default is 0, meaning only explicitly trusted keys are allowed.
4162
Dave Borowitz234734a2012-03-01 14:22:29 -08004163[[receive.threadPoolSize]]receive.threadPoolSize::
4164+
4165Maximum size of the thread pool in which the change data in received packs is
4166processed.
4167+
4168Defaults to the number of available CPUs according to the Java runtime.
4169
Dave Borowitz1c401362012-03-02 17:39:17 -08004170[[receive.timeout]]receive.timeout::
4171+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07004172Overall timeout on the time taken to process the change data in
4173received packs. Only includes the time processing Gerrit changes
4174and updating references, not the time to index the pack. Values can
4175be specified using standard time unit abbreviations ('ms', 'sec',
4176'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08004177+
Dariusz Lukszade482b02015-11-09 18:25:04 +01004178Default is 4 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07004179is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08004180
Dave Borowitz1bb49492015-08-31 15:36:59 -04004181[[receive.trustedKey]]receive.trustedKey::
4182+
4183List of GPG key fingerprints that should be considered trust roots by
4184the server when signed push validation is
4185link:#receive.enableSignedPush[enabled]. A key is trusted by the server
4186if it is either in this list, or a path of trust signatures leads from
4187the key to a configured trust root. The maximum length of the path is
4188determined by link:#receive.maxTrustDepth[`receive.maxTrustDepth`].
4189+
4190Key fingerprints can be displayed with `gpg --list-keys
4191--with-fingerprint`.
4192+
4193Trust signatures can be added to a key using the `tsign` command to
4194link:https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html[
Marian Harbach34253372019-12-10 18:01:31 +01004195`gpg --edit-key`,role=external,window=_blank], after which the signed key should be re-uploaded.
Dave Borowitz1bb49492015-08-31 15:36:59 -04004196+
4197If no keys are specified, web-of-trust checks are disabled. This is the
4198default behavior.
4199
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004200[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004201=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004202
Hugo Josefson072b4702010-04-21 19:27:11 +02004203Repositories in this sense are the same as projects.
4204
Shawn O. Pearce897d9212011-06-16 16:59:59 -07004205In the following example configuration `Registered Users` is set
4206to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02004207
4208----
4209[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02004210 ownerGroup = Registered Users
4211----
4212
Hugo Arès7d2b9422014-11-25 15:33:42 -05004213The only matching patterns supported are exact match or wildcard matching which
4214can be specified by ending the name with a `*`. If a project matches more than one
4215repository configuration, then the configuration from the more precise match
4216will be used. In the following example, the default submit type for a project
4217named `project/plugins/a` would be `CHERRY_PICK`.
4218
4219----
4220[repository "project/*"]
4221 defaultSubmitType = MERGE_IF_NECESSARY
4222[repository "project/plugins/*"]
4223 defaultSubmitType = CHERRY_PICK
4224----
4225
Michael Ochmann8129ece2016-07-08 11:25:25 +02004226[NOTE]
4227All properties are used from the matching repository configuration. In
Hugo Arès7d2b9422014-11-25 15:33:42 -05004228the previous example, all properties will be used from `project/plugins/\*`
4229section and no properties will be inherited nor overridden from `project/*`.
Hugo Josefson072b4702010-04-21 19:27:11 +02004230
Hugo Arès218bb3b2015-04-22 15:05:14 -04004231[[repository.name.basePath]]repository.<name>.basePath::
4232+
4233Alternate to <<gerrit.basePath,gerrit.basePath>>. The repository will be created
4234and used from this location instead: ${alternateBasePath}/${projectName}.git.
4235+
4236If configuring the basePath for an existing project in gerrit, make sure to stop
4237gerrit, move the repository in the alternate basePath, configure basePath for
4238this repository and then start Gerrit.
4239+
4240Path must be absolute.
4241
Edwin Kempina79ea552013-11-19 11:24:37 +01004242[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
4243+
4244The default submit type for newly created projects. Supported values
Dave Borowitzc8f8d2e2017-10-23 11:18:23 -04004245are `INHERIT`, `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02004246`REBASE_ALWAYS`, `MERGE_ALWAYS` and `CHERRY_PICK`.
4247+
Changcheng Xiao21885982019-01-15 18:16:51 +01004248For more details see link:config-project-config.html#submit-type[Submit Types].
Edwin Kempina79ea552013-11-19 11:24:37 +01004249+
Changcheng Xiao21885982019-01-15 18:16:51 +01004250Default is link:config-project-config.html#submit_type_inherit[`INHERIT`].
Dave Borowitzcad4d262018-01-22 10:02:22 -05004251+
Dave Borowitz03e51742018-01-09 07:57:01 -05004252This submit type is only applied at project creation time if a submit type is
4253omitted from the link:rest-api-projects.html#project-input[ProjectInput]. If the
Dave Borowitzcad4d262018-01-22 10:02:22 -05004254submit type is unset in the project config at runtime, for backwards
4255compatibility purposes, it defaults to
4256link:project-configuration.html#merge_if_necessary[`MERGE_IF_NECESSARY`] rather
4257than `INHERIT`.
Edwin Kempina79ea552013-11-19 11:24:37 +01004258
Hugo Josefson072b4702010-04-21 19:27:11 +02004259[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
4260+
4261A name of a group which exists in the database. Zero, one or many
4262groups are allowed. Each on its own line. Groups which don't exist
4263in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02004264
Edwin Kempin22687fa2018-01-22 11:55:07 +01004265[[retry]]
4266=== Section retry
4267
4268[[retry.maxWait]]retry.maxWait::
4269+
4270Maximum time to wait between attempts to retry an operations when one attempt
4271fails (e.g. on NoteDb updates due to contention, aka lock failure, on the
4272underlying ref storage). Operations are retried with exponential backoff, plus
4273some random jitter, until the interval reaches this limit. After that, retries
4274continue to occur after a fixed timeout (plus jitter), up to
4275link:#retry.timeout[`retry.timeout`].
4276+
4277Defaults to 5 seconds; unit suffixes are supported, and assumes milliseconds if
4278not specified.
4279
4280[[retry.timeout]]retry.timeout::
4281+
4282Total timeout for retrying operations when one attempt fails.
4283+
4284It is possible to overwrite this default timeout based on operation types by
4285setting link:#retry.operationType.timeout[`retry.<operationType>.timeout`].
4286+
4287Defaults to 20 seconds; unit suffixes are supported, and assumes milliseconds if
4288not specified.
4289
4290[[retry.operationType.timeout]]retry.<operationType>.timeout::
4291+
4292Total timeout for retrying operations of type `<operationType>` when one
4293attempt fails. `<operationType>` can be `ACCOUNT_UPDATE`, `CHANGE_UPDATE`,
4294`GROUP_UPDATE` and `INDEX_QUERY`.
4295+
4296Defaults to link:#retry.timeout[`retry.timeout`]; unit suffixes are supported,
4297and assumes milliseconds if not specified.
4298
Edwin Kempindd837ae2019-06-18 11:42:14 +02004299[[retry.retryWithTraceOnFailure]]retry.retryWithTraceOnFailure::
4300+
4301Whether Gerrit should automatically retry operations on failure with tracing
4302enabled. The automatically generated traces can help with debugging. Please
4303note that only some of the REST endpoints support automatic retry.
4304+
4305By default this is set to false.
4306
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004307[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004308=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004309
4310[[rules.enable]]rules.enable::
4311+
Matt Baker8ce12fc2013-11-26 21:43:12 -07004312If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07004313project's refs/meta/config branch, if present. When set to false,
4314only the default internal rules will be used.
4315+
4316Default is true, to execute project specific rules.
4317
Shawn Pearceed001d72014-12-17 14:25:55 -08004318[[rules.reductionLimit]]rules.reductionLimit::
4319+
4320Maximum number of Prolog reductions that can be performed when
4321evaluating rules for a single change. Each function call made
4322in user rule code, internal Gerrit Prolog code, or the Prolog
4323interpreter counts against this limit.
4324+
4325Sites using very complex rules that need many reductions should
4326compile Prolog to Java bytecode with link:pgm-rulec.html[rulec].
4327This eliminates the dynamic Prolog interpreter from charging its
4328own reductions against the limit, enabling more logic to execute
4329within the same bounds.
4330+
4331A reductionLimit of 0 is nearly infinite, implemented by setting
4332the internal limit to 2^31-1.
4333+
4334Default is 100,000 reductions (about 14 ms on Intel Core i7 CPU).
4335
4336[[rules.compileReductionLimit]]rules.compileReductionLimit::
4337+
4338Maximum number of Prolog reductions that can be performed when
4339compiling source code to internal Prolog machine code.
4340+
4341Default is 10x reductionLimit (1,000,000).
4342
Shawn Pearcea2b98522015-11-21 09:47:32 -08004343[[rules.maxSourceBytes]]rules.maxSourceBytes::
4344+
4345Maximum input size (in bytes) of a Prolog rules.pl file. Larger
4346source files may need a larger rules.compileReductionLimit. Consider
4347using link:pgm-rulec.html[rulec] to precompile larger rule files.
4348+
4349A size of 0 bytes disables rules, same as rules.enable = false.
4350+
David Pursehouse0c1dadf2015-11-24 09:14:21 +00004351Common unit suffixes of 'k', 'm', or 'g' are supported.
4352+
Shawn Pearcea2b98522015-11-21 09:47:32 -08004353Default is 128 KiB.
4354
4355[[rules.maxPrologDatabaseSize]]rules.maxPrologDatabaseSize::
4356+
4357Number of predicate clauses allowed to be defined in the Prolog
4358database by project rules. Very complex rules may need more than the
4359default 256 limit, but cost more memory and may need more time to
4360evaluate. Consider using link:pgm-rulec.html[rulec] to precompile
4361larger rule files.
4362+
4363Default is 256.
4364
David Pursehouse511a35b2014-04-04 10:27:13 +09004365[[execution]]
4366=== Section execution
Bruce Zua7e34312014-04-01 17:35:41 +08004367
4368[[execution.defaultThreadPoolSize]]execution.defaultThreadPoolSize::
4369+
4370The default size of the background execution thread pool in
4371which miscellaneous tasks are handled.
4372+
Jacek Centkowskice5510d2019-11-13 16:27:25 -08004373Default and minimum is 2 so that a single, potentially longer executing
4374task (e.g. GC), is not blocking the entire execution.
Bruce Zua7e34312014-04-01 17:35:41 +08004375
Patrick Hiesel2ed39822018-04-16 12:04:02 +02004376[[execution.fanOutThreadPoolSize]]execution.fanOutThreadPoolSize::
4377+
4378Maximum size of thread pool to on which a serving thread can fan-out
4379work to parallelize it.
4380+
4381When set to 0, a direct executor will be used.
4382+
4383By default, 25 which means that formatting happens in the caller thread.
4384
Patrick Hiesel328b7612016-10-21 16:43:13 +02004385[[receiveemail]]
4386=== Section receiveemail
4387
4388[[receiveemail.protocol]]receiveemail.protocol::
4389+
4390Specifies the protocol used for receiving emails. Valid options are
4391'POP3', 'IMAP' and 'NONE'. Note that Gerrit will automatically switch between
4392POP3 and POP3s as well as IMAP and IMAPS depending on the specified
4393link:#receiveemail.encryption[encryption].
4394+
4395Defaults to 'NONE' which means that receiving emails is disabled.
4396
4397[[receiveemail.host]]receiveemail.host::
4398+
4399The hostname of the mailserver. Example: 'imap.gmail.com'.
4400+
4401Defaults to an empty string which means that receiving emails is disabled.
4402
4403[[receiveemail.port]]receiveemail.port::
4404+
David Pursehouse4b067752017-03-03 15:54:53 +09004405The port the email server exposes for receiving emails.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004406+
4407Defaults to the industry standard for a given protocol and encryption:
David Pursehouse34907442017-04-04 09:55:38 +09004408POP3: 110; POP3S: 995; IMAP: 143; IMAPS: 993.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004409
4410[[receiveemail.username]]receiveemail.username::
4411+
4412Username used for authenticating with the email server.
4413+
4414Defaults to an empty string.
4415
4416[[receiveemail.password]]receiveemail.password::
4417+
4418Password used for authenticating with the email server.
4419+
4420Defaults to an empty string.
4421
4422[[receiveemail.encryption]]receiveemail.encryption::
4423+
4424Encryption standard used for transport layer security between Gerrit and the
4425email server. Possible values include 'NONE', 'SSL' and 'TLS'.
4426+
4427Defaults to 'NONE'.
4428
4429[[receiveemail.fetchInterval]]receiveemail.fetchInterval::
4430+
4431Time between two consecutive fetches from the email server. Communication with
4432the email server is not kept alive. Examples: 60s, 10m, 1h.
4433+
4434Defaults to 60 seconds.
4435
4436[[receiveemail.enableImapIdle]]receiveemail.enableImapIdle::
4437+
4438If the IMAP protocol is used for retrieving emails, IMAPv4 IDLE can be used to
4439keep the connection with the email server alive and receive a push when a new
4440email is delivered to the inbox. In this case, Gerrit will process the email
4441immediately and will not have a fetch delay.
Patrick Hiesel328b7612016-10-21 16:43:13 +02004442+
4443Defaults to false.
4444
Patrick Hiesel4266cf72017-02-03 08:18:19 +01004445[[receiveemail.filter.mode]]receiveemail.filter.mode::
4446+
4447A black- and whitelist filter to filter incoming emails.
4448+
4449If `OFF`, emails are not filtered by the list filter.
4450+
4451If `WHITELIST`, only emails where a pattern from
4452<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4453matches 'From' will be processed.
4454+
4455If `BLACKLIST`, only emails where no pattern from
4456<<receiveemail.filter.patterns,receiveemail.filter.patterns>>
4457matches 'From' will be processed.
4458+
4459Defaults to `OFF`.
4460
4461[[receiveemail.filter.patterns]]receiveemail.filter.patterns::
4462+
4463A list of regular expressions to match the email sender against. This can also
4464be a list of addresses when regular expression characters are escaped.
4465
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004466[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004467=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004468
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004469[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07004470+
4471If false Gerrit will not send email messages, for any reason,
4472and all other properties of section sendemail are ignored.
4473+
4474By default, true, allowing notifications to be sent.
4475
Jonathan Niederdabd8c22016-09-20 14:10:11 -07004476[[sendemail.html]]sendemail.html::
4477+
4478If false, Gerrit will only send plain-text emails.
4479If true, Gerrit will send multi-part emails with an HTML and
4480plain text part.
4481+
4482By default, true, allowing HTML in the emails Gerrit sends.
4483
Bruce Zua7e34312014-04-01 17:35:41 +08004484[[sendemail.connectTimeout]]sendemail.connectTimeout::
4485+
4486The connection timeout of opening a socket connected to a
4487remote SMTP server.
4488+
4489Values can be specified using standard time unit abbreviations
4490('ms', 'sec', 'min', etc.).
4491If no unit is specified, milliseconds is assumed.
4492+
4493Default is 0. A timeout of zero is interpreted as an infinite
4494timeout. The connection will then block until established or
4495an error occurs.
4496
4497[[sendemail.threadPoolSize]]sendemail.threadPoolSize::
Gal Paikince4e7c62020-08-28 18:47:32 +03004498Deprecated. Replaced with link:#asyncPostUpdate.threadPoolSize[asyncPostUpdate.threadPoolSize]
Bruce Zua7e34312014-04-01 17:35:41 +08004499
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004500[[sendemail.from]]sendemail.from::
4501+
4502Designates what name and address Gerrit will place in the From
4503field of any generated email messages. The supported values are:
4504+
4505* `USER`
4506+
4507Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09004508Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004509classified as spam if the user's domain has SPF or DKIM enabled
4510and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
Zhen Chenae765aa2016-08-08 15:49:44 -07004511relay for that domain. You can specify
4512<<sendemail.allowedDomain,sendemail.allowedDomain>> to instruct Gerrit to only
4513send as USER if USER is from those domains.
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004514+
4515* `MIXED`
4516+
Edwin Kempincdb0e002011-09-08 14:23:30 +02004517Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004518`review@example.com` is the same as <<user.email,user.email>>.
4519See below for a description of how the replacement is handled.
4520+
4521* `SERVER`
4522+
4523Gerrit will set the From header to the same name and address
4524it records in any commits Gerrit creates. This is set by
4525<<user.name,user.name>> and <<user.email,user.email>>, or guessed
4526from the local operating system.
4527+
Edwin Kempinebfbbac2015-07-01 16:02:39 +02004528* `Code Review <review@example.com>`
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004529+
4530If set to a name and email address in brackets, Gerrit will use
4531this name and email address for any messages, overriding the name
4532that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02004533Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07004534which is replaced by the Full Name of the current user.
4535
4536+
4537By default, MIXED.
4538
Zhen Chenae765aa2016-08-08 15:49:44 -07004539[[sendemail.allowedDomain]]sendemail.allowedDomain::
4540+
4541Only used when `sendemail.from` is set to `USER`.
4542List of allowed domains. If user's email matches one of the domains, emails will
4543be sent as USER, otherwise as MIXED mode. Wildcards may be specified by
Maxime Guerreiroebac2d42018-03-21 13:54:51 +01004544including `\*` to match any number of characters, for example `*.example.com`
Zhen Chenae765aa2016-08-08 15:49:44 -07004545matches any subdomain of `example.com`.
4546+
4547By default, `*`.
4548
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004549[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004550+
4551Hostname (or IP address) of a SMTP server that will relay
4552messages generated by Gerrit to end users.
4553+
4554By default, 127.0.0.1 (aka localhost).
4555
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004556[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004557+
4558Port number of the SMTP server in sendemail.smtpserver.
4559+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08004560By default, 25, or 465 if smtpEncryption is 'ssl'.
4561
4562[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
4563+
4564Specify the encryption to use, either 'ssl' or 'tls'.
4565+
4566By default, 'none', indicating no encryption is used.
4567
4568[[sendemail.sslVerify]]sendemail.sslVerify::
4569+
4570If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
4571will not verify the server certificate when it connects to send
4572an email message.
4573+
4574By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004575
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004576[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004577+
4578User name to authenticate with, if required for relay.
4579
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004580[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07004581+
4582Password for the account named by sendemail.smtpUser.
4583
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004584[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004585+
4586If present, each value adds one entry to the whitelist of email
4587addresses that Gerrit can send email to. If set to a complete
4588email address, that one address is added to the white list.
4589If set to a domain name, any address at that domain can receive
4590email from Gerrit.
4591+
Rikard Almgren5b9de1c2019-03-12 17:55:16 +01004592If allowrcpt is configured, The set of allowed recipients is:
4593`allowrcpt - denyrcpt`.
4594+
4595By default, unset, permitting delivery to any email address.
4596
4597[[sendemail.denyrcpt]]sendemail.denyrcpt::
4598+
4599If present, each value adds one entry to the blacklist of email
4600addresses that Gerrit can send email to. If set to a complete
4601email address, that one address is added to the blacklist.
4602If set to a domain name, any address at that domain can *not* receive
4603email from Gerrit.
4604+
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07004605By default, unset, permitting delivery to any email address.
4606
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004607[[sendemail.includeDiff]]sendemail.includeDiff::
4608+
Bruce Zueb00ff32012-11-27 17:38:10 +08004609If true, new change emails and merged change emails from Gerrit
4610will include the complete unified diff of the change.
4611Variable maxmimumDiffSize places an upper limit on how large the
4612email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07004613+
4614By default, false.
4615
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07004616[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
4617+
4618Largest size of unified diff output to include in an email. When
4619the diff exceeds this size the file paths will be listed instead.
4620Standard byte unit suffixes are supported.
4621+
4622By default, 256 KiB.
4623
Alex Blewitt9cca7402011-02-11 01:39:30 +00004624[[sendemail.importance]]sendemail.importance::
4625+
4626If present, emails sent from Gerrit will have the given level
4627of importance. Valid values include 'high' and 'low', which
4628email clients will render in different ways.
4629+
4630By default, unset, so no Importance header is generated.
4631
4632[[sendemail.expiryDays]]sendemail.expiryDays::
4633+
4634If present, emails sent from Gerrit will expire after the given
4635number of days. This will add the Expiry-Date header and
4636email clients may expire or expunge mails whose Expiry-Date
4637header is in the past. This should be a positive non-zero
4638number indicating how many days in the future the mails
4639should expire.
4640+
4641By default, unset, so no Expiry-Date header is generated.
4642
Patrick Hiesel31d60f02017-02-09 17:38:40 +01004643[[sendemail.replyToAddress]]sendemail.replyToAddress::
4644+
4645A custom Reply-To address should only be provided if Gerrit is set up to
4646receive emails and the inbound address differs from
4647<<sendemail.from,sendemail.from>>.
4648It will be set as Reply-To header on all types of outgoing email where
4649Gerrit can parse back a user's reply.
4650+
4651Defaults to an empty string which adds <<sendemail.from,sendemail.from>> as
4652Reply-To if inbound email is enabled and the review's author otherwise.
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004653
David Pursehouse917b7262017-04-21 18:18:52 +02004654[[sendemail.allowTLD]]sendemail.allowTLD::
4655+
4656List of custom TLDs to allow sending emails to in addition to those specified
Marian Harbach34253372019-12-10 18:01:31 +01004657in the link:http://data.iana.org/TLD/[IANA list,role=external,window=_blank].
David Pursehouse917b7262017-04-21 18:18:52 +02004658+
4659Defaults to an empty list, meaning no additional TLDs are allowed.
4660
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004661
4662[[sendemail.addInstanceNameInSubject]]sendemail.addInstanceNameInSubject::
4663+
4664When set to true, Gerrit will add its short name to the email subject, allowing recipients to quickly identify
4665what Gerrit instance the email came from.
4666+
4667The short name can be customized via the gerrit.instanceName option.
4668+
Luca Milanesiofdfca772018-04-04 23:42:32 +01004669Defaults to false.
Maxime Guerreiro8d129d42018-03-21 18:59:27 +01004670
4671
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004672[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004673=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004674
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004675[[site.allowOriginRegex]]site.allowOriginRegex::
4676+
4677List of regular expressions matching origins that should be permitted
Shawn Pearce53ebad42017-06-10 11:14:20 -07004678to use the full Gerrit REST API. These should be trusted applications,
4679as the sites may be able to use the user's credentials. Applies to
4680all requests, including state changing methods (PUT, DELETE, POST).
4681+
4682Expressions should not require trailing slash. For example a valid
4683pattern might be `https://build-status[.]example[.]com`.
Shawn Pearcec896eaa2016-08-23 19:38:58 -07004684+
4685By default, unset, denying all cross-origin requests.
4686
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004687[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
4688+
4689If true the server checks the site header, footer and CSS files for
4690updated versions. If false, a server restart is required to change
4691any of these resources. Default is true, allowing automatic reloads.
4692
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004693[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004694=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07004695
4696Variables in section ssh-alias permit the site administrator to alias
4697another command from Gerrit or a plugin into the `gerrit` command
4698namespace. To alias `replication start` to `gerrit replicate`:
4699
4700----
4701[ssh-alias]
4702 replicate = replication start
4703----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07004704
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004705[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004706=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07004707
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02004708[[sshd.enableCompression]]sshd.enableCompression::
4709+
4710In the general case, we want to disable transparent compression, since
4711the majority of our data transfer is highly compressed Git pack files
4712and we cannot make them any smaller than they already are.
4713+
4714However, if there are CPU in abundance and the server is reachable
4715through slow networks, gits with huge amount of refs can benefit from
4716SSH-compression since git does not compress the ref announcement during
4717handshake.
4718+
Han-Wen Nienhuys348a6032019-09-24 19:44:57 +02004719Compression can be especially useful when Gerrit replicas are being used
Matthias Sohnd8182ba2019-12-09 14:50:23 +01004720for the larger clones and fetches and the primary server mostly takes
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02004721small receive-packs.
4722+
4723By default, `false`.
4724
David Ostrovskye2921b62015-03-04 22:36:10 +01004725[[sshd.backend]]sshd.backend::
4726+
4727Starting from version 0.9.0 Apache SSHD project added support for NIO2
Orgad Shanehb7bb7352019-09-19 10:26:19 +03004728IoSession. To use the old MINA session the `backend` option must be set
4729to `MINA`.
David Ostrovskye2921b62015-03-04 22:36:10 +01004730+
Luca Milanesiofc1ed9c2016-03-01 18:28:36 +00004731By default, `NIO2`.
David Ostrovskye2921b62015-03-04 22:36:10 +01004732
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004733[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004734+
4735Specifies the local addresses the internal SSHD should listen
4736for connections on. The following forms may be used to specify
4737an address. In any form, `:'port'` may be omitted to use the
David Pursehousea3af2552016-08-02 14:04:44 +09004738default of `29418`.
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004739+
David Pursehousea3af2552016-08-02 14:04:44 +09004740* `'hostname':'port'` (for example `review.example.com:29418`)
4741* `'IPv4':'port'` (for example `10.0.0.1:29418`)
4742* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
4743* `+*:'port'+` (for example `+*:29418+`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004744
4745+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004746--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004747If multiple values are supplied, the daemon will listen on all
4748of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004749
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07004750To disable the internal SSHD, set listenAddress to `off`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004751
David Pursehousea3af2552016-08-02 14:04:44 +09004752By default, `*:29418`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004753--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07004754
James Y Knight910bd862011-01-11 20:05:56 -05004755[[sshd.advertisedAddress]]sshd.advertisedAddress::
4756+
4757Specifies the addresses clients should be told to connect to.
4758This may differ from sshd.listenAddress if a firewall based port
4759redirector is being used, making Gerrit appear to answer on port
476022. The following forms may be used to specify an address. In any
4761form, `:'port'` may be omitted to use the default SSH port of 22.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004762
David Pursehousea3af2552016-08-02 14:04:44 +09004763* `'hostname':'port'` (for example `review.example.com:22`)
4764* `'IPv4':'port'` (for example `10.0.0.1:29418`)
4765* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
James Y Knight910bd862011-01-11 20:05:56 -05004766
4767+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004768--
James Y Knight910bd862011-01-11 20:05:56 -05004769If multiple values are supplied, the daemon will advertise all
4770of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004771
David Pursehousea3af2552016-08-02 14:04:44 +09004772By default uses the value of `sshd.listenAddress`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02004773--
James Y Knight910bd862011-01-11 20:05:56 -05004774
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004775[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07004776+
4777If true, enables TCP keepalive messages to the other side, so
4778the daemon can terminate connections if the peer disappears.
4779+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02004780Only effective when `sshd.backend` is set to `MINA`.
4781+
David Pursehousea3af2552016-08-02 14:04:44 +09004782By default, `true`.
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07004783
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004784[[sshd.threads]]sshd.threads::
4785+
4786Number of threads to use when executing SSH command requests.
4787If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09004788are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004789+
Florian Klink2a389462019-07-23 14:14:32 +02004790By default, 2x the number of CPUs available to the JVM (but at least 4
4791threads).
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02004792+
4793[NOTE]
4794When SSH daemon is enabled then this setting also defines the max number of
4795concurrent Git requests for interactive users over SSH and HTTP together.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08004796
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004797[[sshd.batchThreads]]sshd.batchThreads::
4798+
4799Number of threads to allocate for SSH command requests from
Patrick Hiesele587c402020-08-07 16:11:29 +02004800link:access-control.html#service_users[service users].
Fredrik Luthander46843022012-03-13 16:11:02 +01004801If equals to 0, then all non-interactive requests are executed in the same
4802queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004803+
4804Any other value will remove the number of threads from the queue
4805allocated to interactive users, and create a separate thread pool
4806of the requested size, which will be used to run commands from
Patrick Hiesele587c402020-08-07 16:11:29 +02004807service users.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004808+
Patrick Hiesele587c402020-08-07 16:11:29 +02004809If the number of threads requested for service users is larger
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004810than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09004811value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004812+
Dariusz Luksza145de472015-11-09 18:44:35 +01004813By default is 1 on single core node, 2 otherwise.
Saša Živkov3d4ed9f2017-10-13 15:30:29 +02004814+
4815[NOTE]
4816When SSH daemon is enabled then this setting also defines the max number of
4817concurrent Git requests for batch users over SSH and HTTP together.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07004818
Kenny Root15ac1b82010-02-24 00:29:20 -08004819[[sshd.streamThreads]]sshd.streamThreads::
4820+
4821Number of threads to use when formatting events to asynchronous
4822streaming clients. Event formatting is multiplexed onto this thread
4823pool by a simple FIFO scheduling system.
4824+
4825By default, 1 plus the number of CPUs available to the JVM.
4826
Edwin Kempinb5df3b82011-10-10 11:31:14 +02004827[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07004828+
4829Number of threads used to parse a command line submitted by a client
4830over SSH for execution, create the internal data structures used by
4831that command, and schedule it for execution on another thread.
4832+
4833By default, 2.
4834
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004835[[sshd.maxAuthTries]]sshd.maxAuthTries::
4836+
4837Maximum number of authentication attempts before the server
4838disconnects the client. Each public key that a client has loaded
4839into its local agent counts as one auth request. Users can work
4840around the server's limit by loading less keys into their agent,
4841or selecting a specific key in their `~/.ssh/config` file with
4842the `IdentityFile` option.
4843+
4844By default, 6.
4845
4846[[sshd.loginGraceTime]]sshd.loginGraceTime::
4847+
4848Time in seconds that a client has to authenticate before the server
4849automatically terminates their connection. Values should use common
4850unit suffixes to express their setting:
4851+
4852* s, sec, second, seconds
4853* m, min, minute, minutes
4854* h, hr, hour, hours
4855* d, day, days
4856
4857+
4858By default, 2 minutes.
4859
Christian Aistleitner3d794592013-04-08 00:19:40 +02004860[[sshd.idleTimeout]]sshd.idleTimeout::
4861+
4862Time in seconds after which the server automatically terminates idle
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00004863connections (or 0 to disable closing of idle connections) not waiting for
4864any server operation to complete.
4865Values should use common unit suffixes to express their setting:
Christian Aistleitner3d794592013-04-08 00:19:40 +02004866+
4867* s, sec, second, seconds
4868* m, min, minute, minutes
4869* h, hr, hour, hours
4870* d, day, days
4871
4872+
4873By default, 0.
4874
Paladox nonedaafdb62017-10-14 16:18:42 +00004875[[sshd.waitTimeout]]sshd.waitTimeout::
4876+
Luca Milanesio9ba08ea2017-10-16 16:04:28 +00004877Time in seconds after which the server automatically terminates
4878connections waiting for a server operation to complete, like for instance
4879cloning a very large repo with lots of refs.
Paladox nonedaafdb62017-10-14 16:18:42 +00004880Values should use common unit suffixes to express their setting:
4881+
4882* s, sec, second, seconds
4883* m, min, minute, minutes
4884* h, hr, hour, hours
4885* d, day, days
4886
4887+
4888By default, 30s.
4889
Thomas Draebing2c7346a2020-08-03 17:51:15 +02004890[[sshd.gracefulStopTimeout]]sshd.gracefulStopTimeout::
4891+
4892Set a graceful stop time. If set, Gerrit ensures that all open SSH
4893sessions are preserved for a maximum period of time, before forcing the
4894shutdown of the SSH daemon. During this period, no new requests
4895will be accepted. This option is meant to be used in setups performing
4896rolling restarts.
4897+
4898Values should use common unit suffixes to express their setting:
4899+
4900* s, sec, second, seconds
4901* m, min, minute, minutes
4902+
4903By default, 0 seconds (immediate shutdown).
4904
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004905[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
4906+
4907Maximum number of concurrent SSH sessions that a user account
4908may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09004909that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07004910the number of commands a user may issue over a single connection.
4911If set to 0, there is no limit.
4912+
4913By default, 64.
4914
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004915[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004916+
4917Available ciphers. To permit multiple ciphers, specify multiple
4918`sshd.cipher` keys in the configuration file, one cipher name
4919per key. Cipher names starting with `+` are enabled in addition
4920to the default ciphers, cipher names starting with `-` are removed
4921from the default cipher set.
4922+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004923Supported ciphers:
4924+
4925* `aes128-ctr`
4926* `aes192-ctr`
4927* `aes256-ctr`
4928* `aes128-cbc`
4929* `aes192-cbc`
4930* `aes256-cbc`
4931* `blowfish-cbc`
4932* `3des-cbc`
4933* `arcfour128`
4934* `arcfour256`
4935* `none`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004936+
4937By default, all supported ciphers except `none` are available.
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004938+
4939If your setup allows for it, it's recommended to disable all ciphers except
4940the AES-CTR modes.
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004941
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004942[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004943+
4944Available MAC (message authentication code) algorithms. To permit
4945multiple algorithms, specify multiple `sshd.mac` keys in the
4946configuration file, one MAC per key. MAC names starting with `+`
4947are enabled in addition to the default MACs, MAC names starting with
4948`-` are removed from the default MACs.
4949+
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004950Supported MACs:
4951+
4952* `hmac-md5`
4953* `hmac-md5-96`
4954* `hmac-sha1`
4955* `hmac-sha1-96`
4956* `hmac-sha2-256`
4957* `hmac-sha2-512`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004958+
4959By default, all supported MACs are available.
4960
Scott Dialb4a04fa2016-03-15 09:44:11 -04004961[[sshd.kex]]sshd.kex::
4962+
4963--
4964Available key exchange algorithms. To permit multiple algorithms,
4965specify multiple `sshd.kex` keys in the configuration file, one key
4966exchange algorithm per key. Key exchange algorithm names starting
4967with `+` are enabled in addition to the default key exchange
4968algorithms, key exchange algorithm names starting with `-` are
4969removed from the default key exchange algorithms.
4970
4971In the following example configuration, support for the 1024-bit
4972`diffie-hellman-group1-sha1` key exchange is disabled while leaving
4973all of the other default algorithms enabled:
4974
4975----
4976[sshd]
4977 kex = -diffie-hellman-group1-sha1
4978----
4979
4980Supported key exchange algorithms:
4981
4982* `ecdh-sha2-nistp521`
4983* `ecdh-sha2-nistp384`
4984* `ecdh-sha2-nistp256`
4985* `diffie-hellman-group-exchange-sha256`
4986* `diffie-hellman-group-exchange-sha1`
4987* `diffie-hellman-group14-sha1`
4988* `diffie-hellman-group1-sha1`
4989
4990By default, all supported key exchange algorithms are available.
Gert van Dijkcc03e8a2017-10-23 23:45:24 +02004991
4992It is strongly recommended to disable at least `diffie-hellman-group1-sha1`
4993as it's known to be vulnerable (logjam attack). Additionally, if your setup
4994allows for it, it is recommended to disable the remaining two `sha1` key
4995exchange algorithms.
Scott Dialb4a04fa2016-03-15 09:44:11 -04004996--
4997
Alex Blewitt7efb06f2013-04-01 12:46:48 -04004998[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
4999+
5000Enable kerberos authentication for SSH connections. To permit
5001kerberos authentication, the server must have a host principal
5002(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
5003This must be provisioned by the kerberos administrators, and is
5004typically installed into `/etc/krb5.keytab` on host machines.
5005+
5006The keytab must contain at least one `host/` principal, typically
5007using the host's canonical name. If it does not use the
5008canonical name, the `sshd.kerberosPrincipal` should be configured
5009with the correct name.
5010+
5011By default, not set and so kerberos authentication is not enabled.
5012
5013[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
5014+
5015If kerberos authentication is enabled with `sshd.kerberosKeytab`,
5016instead use the given principal name instead of the default.
5017If the principal does not begin with `host/` a warning message is
5018printed and may prevent successful authentication.
5019+
5020This may be useful if the host is behind an IP load balancer or
5021other SSH forwarding systems, since the principal name is constructed
5022by the client and must match for kerberos authentication to work.
5023+
5024By default, `host/canonical.host.name`
5025
Shawn Pearce318bfca2013-10-17 22:15:38 -07005026[[sshd.requestLog]]sshd.requestLog::
5027+
5028Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
5029If enabled, a request log file is written out by the SSH daemon.
Matthias Sohn450bc202020-08-20 14:40:32 +02005030The sshd log format is documented link:logs.html#_sshd_log[here].
Shawn Pearce318bfca2013-10-17 22:15:38 -07005031+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01005032`log4j.appender` with the name `sshd_log` can be configured to overwrite
5033programmatic configuration.
5034+
David Pursehousea3af2552016-08-02 14:04:44 +09005035By default, `true`.
Gustaf Lundh4e859932018-04-16 10:56:31 +02005036+
Sven Selberg2a0beab2018-04-20 14:49:20 +02005037This value supports link:#reloadConfig[configuration reloads].
Shawn Pearce318bfca2013-10-17 22:15:38 -07005038
David Ostrovsky985201b2015-03-04 22:37:33 +01005039[[sshd.rekeyBytesLimit]]sshd.rekeyBytesLimit::
5040+
5041The SSH daemon will issue a rekeying after a certain amount of data.
5042This configuration option allows you to tweak that setting.
5043+
5044By default, 1073741824 (bytes, 1GB).
5045+
David Pursehousea3af2552016-08-02 14:04:44 +09005046The `rekeyBytesLimit` cannot be set to lower than 32.
David Ostrovsky985201b2015-03-04 22:37:33 +01005047
5048[[sshd.rekeyTimeLimit]]sshd.rekeyTimeLimit::
5049+
5050The SSH daemon will issue a rekeying after a certain amount of time.
5051This configuration option allows you to tweak that setting.
5052+
5053By default, 1h.
5054+
5055Set to 0 to disable this check.
5056
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005057[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005058=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07005059
Sven Selberg42d9d292014-08-13 11:20:11 +02005060[[suggest.maxSuggestedReviewers]]suggest.maxSuggestedReviewers::
5061+
5062The maximum numbers of reviewers suggested.
5063+
5064By default 10.
Gustaf Lundh25e608f2018-04-16 10:54:53 +02005065+
Sven Selberg2a0beab2018-04-20 14:49:20 +02005066This value supports link:#reloadConfig[configuration reloads].
Sven Selberg42d9d292014-08-13 11:20:11 +02005067
Edwin Kempinf957dc22012-10-19 20:41:18 +02005068[[suggest.from]]suggest.from::
5069+
5070The number of characters that a user must have typed before suggestions
Patrick Hiesel87880b02016-05-03 18:15:08 +02005071are provided. If set to 0, suggestions are always provided. This is only
5072used for suggesting accounts when adding members to a group.
Edwin Kempinf957dc22012-10-19 20:41:18 +02005073+
5074By default 0.
Gal Paikin0d07c542020-01-08 17:11:53 +02005075[[suggest.relevantChanges]]suggest.relevantChanges::
5076+
5077When suggesting reviewers, we go over recent changes of the user, and
5078give priority to users that are present as reviewers in any of those
5079changes. The number of changes we go over is `sugggest.relevantChanges`.
5080+
Gal Paikincb5a7ca2020-02-18 09:44:28 +01005081This nubmer is a tradeoff between speed and accuracy.
Gal Paikin0d07c542020-01-08 17:11:53 +02005082A high number would be accurate but slow, and a low number would be
5083fast but inaccurate.
Gal Paikincb5a7ca2020-02-18 09:44:28 +01005084+
5085By default 50.
Edwin Kempinf957dc22012-10-19 20:41:18 +02005086
Edwin Kempin0a49eca2019-06-21 09:38:46 +02005087[[tracing]]
5088=== Section tracing
5089
5090[[tracing.performanceLogging]]tracing.performanceLogging::
5091+
5092Whether performance logging is enabled.
5093+
5094When performance logging is enabled, performance events for some
5095operations are collected in memory while a request is running. At the
5096end of the request the performance events are handed over to the
5097link:dev-plugins.html#performance-logger[PerformanceLogger] plugins.
5098This means if performance logging is enabled, the memory footprint of
5099requests is slightly increased.
5100+
5101This setting has no effect if no
5102link:dev-plugins.html#performance-logger[PerformanceLogger] plugins are
5103installed, because then performance logging is always disabled.
5104+
5105By default, true.
5106
Edwin Kempin2cba2982019-07-05 13:19:43 +02005107[[tracing.traceid]]
5108==== Subsection tracing.<trace-id>
5109
5110There can be multiple `tracing.<trace-id>` subsections to configure
5111automatic tracing of requests. To be traced a request must match all
5112conditions of one `tracing.<trace-id>` subsection. The subsection name
5113is used as trace ID. Using this trace ID administrators can find
5114matching log entries.
5115
5116[[tracing.traceid.requestType]]tracing.<trace-id>.requestType::
5117+
5118Type of request for which request tracing should be always enabled (can
5119be `GIT_RECEIVE`, `GIT_UPLOAD`, `REST` and `SSH`).
5120+
5121May be specified multiple times.
5122+
5123By default, unset (all request types are matched).
5124
Edwin Kempinb0ddb0b2019-07-08 12:11:32 +02005125[[tracing.traceid.requestUriPattern]]tracing.<trace-id>.requestUriPattern::
5126+
5127Regular expression to match request URIs for which request tracing
5128should be always enabled. Request URIs are only available for REST
5129requests. Request URIs never include the '/a' prefix.
5130+
5131May be specified multiple times.
5132+
5133By default, unset (all request URIs are matched).
5134
Edwin Kempin2cba2982019-07-05 13:19:43 +02005135[[tracing.traceid.account]]tracing.<trace-id>.account::
5136+
5137Account ID of an account for which request tracing should be always
5138enabled.
5139+
5140May be specified multiple times.
5141+
5142By default, unset (all accounts are matched).
5143
5144[[tracing.traceid.projectPattern]]tracing.<trace-id>.projectPattern::
5145+
5146Regular expression to match project names for which request tracing
5147should be always enabled.
5148+
5149May be specified multiple times.
5150+
5151By default, unset (all projects are matched).
5152
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005153[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005154=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07005155
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07005156Tagged footer lines containing references to external
5157tracking systems, parsed out of the commit message and
David Pursehoused55a6b62015-02-27 17:39:38 +09005158saved in Gerrit's secondary index.
Shawn Pearceff61c8a2013-10-07 19:35:53 -07005159
5160After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08005161must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07005162
Edwin Kempinbb421f12011-08-25 11:19:00 +02005163The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07005164bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07005165
5166----
5167[trackingid "jira-bug"]
5168 footer = Bugfix:
David Pursehousece7f6862015-02-19 14:52:45 +09005169 footer = Bug:
Goran Lungberg04132a12010-06-15 17:20:37 -07005170 match = JRA\\d{2,8}
5171 system = JIRA
5172
5173[trackingid "jira-feature"]
5174 footer = Feature
5175 match = JRA(\\d{2,8})
5176 system = JIRA
5177----
5178
5179[[trackingid.name.footer]]trackingid.<name>.footer::
5180+
David Pursehousece7f6862015-02-19 14:52:45 +09005181A prefix tag that identifies the footer line to parse for tracking ids.
5182+
5183Several trackingid entries can have the same footer tag, and a single trackingid
5184entry can have multiple footer tags.
5185+
5186If multiple footer tags are specified, each tag will be parsed separately and
5187duplicates will be ignored.
5188+
5189The trailing ":" is optional.
Goran Lungberg04132a12010-06-15 17:20:37 -07005190
5191[[trackingid.name.match]]trackingid.<name>.match::
5192+
Magnus Bäcke5611832011-02-02 08:57:15 +01005193A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
Marian Harbach34253372019-12-10 18:01:31 +01005194Java regular expression (java.util.regex),role=external,window=_blank] used to match the
Magnus Bäcke5611832011-02-02 08:57:15 +01005195external tracking id part of the footer line. The match can
5196result in several entries in the DB. If grouping is used in the
5197regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01005198Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07005199+
5200The configuration file parser eats one level of backslashes, so the
5201character class `\s` requires `\\s` in the configuration file. The
5202parser also terminates the line at the first `#`, so a match
5203expression containing # must be wrapped in double quotes.
5204
5205[[trackingid.name.system]]trackingid.<name>.system::
5206+
David Pursehouse221d4f62012-06-08 17:38:08 +09005207The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07005208It is possible to have several trackingid entries for the same
5209tracking system.
5210
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005211[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005212=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07005213
5214[[transfer.timeout]]transfer.timeout::
5215+
5216Number of seconds to wait for a single network read or write
5217to complete before giving up and declaring the remote side is
5218not responding. If 0, there is no timeout, and this server will
5219wait indefinitely for a transfer to finish.
5220+
5221A timeout should be large enough to mostly transfer the objects to
5222the other side. 1 second may be too small for larger projects,
5223especially over a WAN link, while 10-30 seconds is a much more
5224reasonable timeout value.
5225+
5226Defaults to 0 seconds, wait indefinitely.
5227
lincoln2be11602010-07-05 10:53:25 -03005228
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005229[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005230=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005231
Dave Borowitzb1795142017-10-12 07:13:37 -07005232Options to control the behavior of `upload-pack` on the server side,
5233which handles a user's fetch, clone, or repo sync command.
lincoln2be11602010-07-05 10:53:25 -03005234
5235----
5236[upload]
5237 allowGroup = GROUP_ALLOWED_TO_EXECUTE
5238 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
5239----
5240
5241[[upload.allowGroup]]upload.allowGroup::
5242+
Dave Borowitzb1795142017-10-12 07:13:37 -07005243Name of the groups of users that are allowed to execute 'upload-pack'.
5244One or more groups can be set.
lincoln2be11602010-07-05 10:53:25 -03005245+
5246If no groups are added, any user will be allowed to execute
5247'upload-pack' on the server.
5248
Owen Lie2877bb2017-07-14 09:11:20 -04005249[[accountDeactivation]]
5250=== Section accountDeactivation
5251
5252Configures the parameters for the scheduled task to sweep and deactivate Gerrit
5253accounts according to their status reported by the auth backend. Currently only
5254supported for LDAP backends.
5255
5256[[accountDeactivation.startTime]]accountDeactivation.startTime::
5257+
Edwin Kempind33d95a2018-02-16 11:44:04 +01005258The link:#schedule-configuration-startTime[start time] for running
5259account deactivations.
Owen Lie2877bb2017-07-14 09:11:20 -04005260
5261[[accountDeactivation.interval]]accountDeactivation.interval::
5262+
Edwin Kempind33d95a2018-02-16 11:44:04 +01005263The link:#schedule-configuration-interval[interval] for running
5264account deactivations.
5265
Saša Živkovf0966112020-03-17 12:20:31 +01005266Note that the task will only be scheduled if the
5267link:#autoUpdateAccountActiveStatus[auth.autoUpdateAccountActiveStatus]
5268is set to true.
5269
Edwin Kempind33d95a2018-02-16 11:44:04 +01005270link:#schedule-configuration-examples[Schedule examples] can be found
5271in the link:#schedule-configuration[Schedule Configuration] section.
Owen Lie2877bb2017-07-14 09:11:20 -04005272
Stefan Beller0f724ff2015-07-17 10:17:51 -07005273[[submodule]]
5274=== Section submodule
5275
Shawn Pearcedc477cd2016-03-24 19:56:18 -07005276[[submodule.verbosesuperprojectupdate]]submodule.verboseSuperprojectUpdate::
Stefan Beller0f724ff2015-07-17 10:17:51 -07005277+
5278When using link:user-submodules.html#automatic_update[automatic superproject updates]
Zhen Chenc877ca92016-07-27 14:22:37 -07005279this option will determine how the submodule commit messages are included into
Stefan Beller0f724ff2015-07-17 10:17:51 -07005280the commit message of the superproject update.
5281+
Zhen Chenc877ca92016-07-27 14:22:37 -07005282If `FALSE`, will not include any commit messages for the gitlink update.
5283+
5284If `SUBJECT_ONLY`, will include only the commit subjects.
5285+
5286If `TRUE`, will include full commit messages.
5287+
5288By default this is `TRUE`.
Stefan Beller0f724ff2015-07-17 10:17:51 -07005289
Shawn Pearcedc477cd2016-03-24 19:56:18 -07005290[[submodule.enableSuperProjectSubscriptions]]submodule.enableSuperProjectSubscriptions::
Stefan Beller8cc252e2016-03-10 10:06:53 -08005291+
5292This allows to enable the superproject subscription mechanism.
5293+
5294By default this is true.
Stefan Beller0f724ff2015-07-17 10:17:51 -07005295
Patrick Hiesel44e5d6e2017-08-24 16:07:26 +02005296[[submodule.maxCombinedCommitMessageSize]]submodule.maxCombinedCommitMessageSize::
5297+
5298This allows to limit the length of the commit message for a submodule.
5299+
5300By default this is 262144 (256 KiB).
5301+
5302Common unit suffixes of k, m, or g are supported.
5303
5304[[submodule.maxCommitMessages]]submodule.maxCommitMessages::
5305+
5306This allows to limit the number of commit messages that should be combined when creating
5307a commit message for a submodule.
5308+
5309By default this is 1000.
5310
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08005311[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005312=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005313
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005314[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005315+
5316Name that Gerrit calls itself in Git when it creates a new Git
5317commit, such as a merge during change submission.
5318+
5319By default this is "Gerrit Code Review".
5320
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07005321[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07005322+
5323Email address that Gerrit refers to itself as when it creates a
5324new Git commit, such as a merge commit during change submission.
5325+
5326If not set, Gerrit generates this as "gerrit@`hostname`", where
5327`hostname` is the hostname of the system Gerrit is running on.
5328+
5329By default, not set, generating the value at startup.
5330
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005331[[user.anonymousCoward]]user.anonymousCoward::
5332+
David Pursehousea1d633b2014-05-02 17:21:02 +09005333Username that is displayed in the Gerrit Web UI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005334notifications if the full name of the user is not set.
5335+
Han-Wen Nienhuys3fb723d2017-11-20 19:21:13 +01005336By default "Name of user not set" is used.
Edwin Kempin0e02ded2011-09-16 15:10:14 +02005337
Edwin Kempind33d95a2018-02-16 11:44:04 +01005338[[schedule-configuration]]
5339=== Schedule Configuration
5340
5341Schedule configurations are used for running periodic background jobs.
5342
5343A schedule configuration consists of two parameters:
5344
5345[[schedule-configuration-interval]]
5346* `interval`:
5347Interval for running the periodic background job. The interval must be
5348larger than zero. The following suffixes are supported to define the
5349time unit for the interval:
5350** `s`, `sec`, `second`, `seconds`
5351** `m`, `min`, `minute`, `minutes`
5352** `h`, `hr`, `hour`, `hours`
5353** `d`, `day`, `days`
5354** `w`, `week`, `weeks` (`1 week` is treated as `7 days`)
5355** `mon`, `month`, `months` (`1 month` is treated as `30 days`)
5356** `y`, `year`, `years` (`1 year` is treated as `365 days`)
5357
5358[[schedule-configuration-startTime]]
5359* `startTime`:
5360The start time defines the first execution of the periodic background
5361job. If the configured `interval` is shorter than `startTime - now` the
5362start time will be preponed by the maximum integral multiple of
5363`interval` so that the start time is still in the future. `startTime`
5364must have one of the following formats:
5365
5366** `<day of week> <hours>:<minutes>`
5367** `<hours>:<minutes>`
5368
5369+
5370The placeholders can have the following values:
5371
5372*** `<day of week>`:
5373`Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat`, `Sun`
5374*** `<hours>`:
5375`00`-`23`
5376*** `<minutes>`:
5377`00`-`59`
5378
5379+
5380The time zone cannot be specified but is always the system default
David Pursehouse18f388a2019-04-10 09:36:18 +09005381time zone. Hours must be zero-padded, i.e. `06:00` rather than `6:00`.
Edwin Kempind33d95a2018-02-16 11:44:04 +01005382
5383The section (and optionally the subsection) in which the `interval` and
5384`startTime` keys must be set depends on the background job for which a
5385schedule should be configured. E.g. for the change cleanup job the keys
5386must be set in the link:#changeCleanup[changeCleanup] section:
5387
5388----
5389 [changeCleanup]
5390 startTime = Fri 10:30
5391 interval = 2 days
5392----
5393
5394[[schedule-configuration-examples]]
5395Examples for a schedule configuration:
5396
5397* Example 1:
5398+
5399----
5400 startTime = Fri 10:30
5401 interval = 2 days
5402----
5403+
5404Assuming that the server is started on `Mon 07:00` then
5405`startTime - now` is `4 days 3:30 hours`. This is larger than the
5406interval hence the start time is preponed by the maximum integral
5407multiple of the interval so that start time is still in the future,
5408i.e. preponed by 4 days. This yields a start time of `Mon 10:30`, next
5409executions are `Wed 10:30`, `Fri 10:30`. etc.
5410
5411* Example 2:
5412+
5413----
5414 startTime = 06:00
5415 interval = 1 day
5416----
5417+
5418Assuming that the server is started on `Mon 07:00` then this yields the
5419first run on Tuesday at 06:00 and a repetition interval of 1 day.
5420
Dave Borowitzd4fdc932018-11-02 15:06:25 -07005421[[All-Projects-project.config]]
5422== File `etc/All-Projects/project.config`
5423
5424The optional file `'$site_path'/etc/All-Projects/project.config` provides
5425defaults for configuration read from
5426link:config-project-config.html[`project.config`] in the
5427`All-Projects` repo. Unlike `gerrit.config`, this file contains project-type
5428configuration rather than server-type configuration.
5429
5430Most administrators will not need this file, and should instead make commits to
5431`All-Projects` to modify global config. However, a separate file can be useful
5432when managing multiple Gerrit servers, since pushing changes to defaults using
5433Puppet or a similar tool can be easier than scripting git updates to
5434`All-Projects`.
5435
5436The contents of the file are loaded each time the `All-Projects` project is
5437reloaded. Updating the file requires either evicting the project cache or
5438restarting the server.
5439
5440Caveats:
5441
5442* The path from which the file is read corresponds to the name of the repo,
5443 which is link:#gerrit.allProjects[configurable].
5444* Although the file lives in a directory that shares a name with a repository,
5445 this directory is not a Git repository.
5446* Only the file `project.config` is read from this directory to provide
5447 defaults; any other files in this directory, such as `rules.pl`, are ignored.
5448 (This behavior may change in the future.)
5449* Group names listed in the access config in this file are resolved to UUIDs
5450 using the `groups` file in the repository, not in the config directory. As a
5451 result, setting ACLs in this file is not recommended.
5452
Hector Oswaldo Caballero98952b02017-08-24 06:31:28 -04005453[[secure.config]]
5454== File `etc/secure.config`
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07005455
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005456The optional file `'$site_path'/etc/secure.config` overrides (or
5457supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005458The file should be readable only by the daemon process and can be
5459used to contain private configuration entries that wouldn't normally
5460be exposed to everyone.
5461
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005462Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005463----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07005464[auth]
5465 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
5466
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005467[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005468 username = webuser
5469 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005470
5471[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005472 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005473
5474[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005475 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005476
5477[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08005478 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07005479
5480[remote "bar"]
5481 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08005482----
5483
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005484== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01005485
5486The optional file `'$site_path'/etc/peer_keys` controls who can
5487login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
5488command.
5489
David Pursehouse90bed3f2020-06-09 22:07:19 +02005490The format is one Base-64 encoded public key per line with optional comment, e.g.:
5491----
5492# Comments allowed at start of line
5493AAAAC3...51R== john@example.net
5494# Another comment
5495AAAAB5...21S== jane@example.net
5496----
Johan Bjork3e5ee302012-01-27 17:59:54 +01005497
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005498=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005499
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005500site_path::
5501+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005502Local filesystem directory holding the site customization assets.
5503Placing this directory under version control and/or backup is a
5504good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005505+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005506Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005507+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005508Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07005509+
Dave Borowitz1e49e142013-04-09 12:14:57 -07005510* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08005511
Saša Živkovd34dfe32017-11-20 11:14:35 +01005512[[jgitConfig]]
5513== File `etc/jgit.config`
5514
5515Gerrit uses the `$site_path/etc/jgit.config` file instead of the
5516system-wide and user-global Git configuration for its runtime JGit
5517configuration.
5518
5519Sample `etc/jgit.config` file:
5520----
5521[core]
5522 trustFolderStat = false
5523----
5524
Shawn O. Pearce5500e692009-05-28 15:55:01 -07005525GERRIT
5526------
5527Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07005528
5529SEARCHBOX
5530---------