blob: 759e5cd7da99a96623943297879d9a3d4bfa0916 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - Configuration
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08002
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003== File `etc/gerrit.config`
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07004
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08005The optional file `'$site_path'/etc/gerrit.config` is a Git-style
6config file that controls many host specific settings for Gerrit.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07007
8[NOTE]
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08009The contents of the `etc/gerrit.config` file are cached at startup
Brandon Casey4a21add2011-07-05 13:14:18 -050010by Gerrit. If you modify any properties in this file, Gerrit needs
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070011to be restarted before it will use the new values.
12
Shawn O. Pearcec5fed822009-11-17 16:10:10 -080013Sample `etc/gerrit.config`:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070014----
15[core]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080016 packedGitLimit = 200 m
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070017
18[cache]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -080019 directory = /var/cache/gerrit2
Shawn O. Pearce51967cd2009-05-08 19:46:57 -070020----
21
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -080022[[accounts]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080023=== Section accounts
Dave Borowitz45baa892012-02-23 16:43:05 -080024
Matthias Sohnf3360662012-04-05 15:42:52 +020025[[accounts.visibility]]accounts.visibility::
Dave Borowitz45baa892012-02-23 16:43:05 -080026+
27Controls visibility of other users' dashboard pages and
28completion suggestions to web users.
29+
30If `ALL`, all users are visible to all other users, even
31anonymous users.
32+
33If `SAME_GROUP`, only users who are also members of a group the
34current user is a member of are visible.
35+
36If `VISIBLE_GROUP`, only users who are members of at least one group
37that is visible to the current user are visible.
38+
39If `NONE`, no users other than the current user are visible.
40+
41Default is `ALL`.
42
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -080043[[addreviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080044=== Section addreviewer
Edwin Kempin49cb3e12011-06-29 14:35:14 +020045
46[[addreviewer.maxWithoutConfirmation]]addreviewer.maxWithoutConfirmation::
47+
48The maximum number of reviewers a user can add at once by adding a
49group as reviewer without being asked to confirm the operation.
50+
51If set to 0, the user will never be asked to confirm adding a group
52as reviewer.
53+
54Default is 10.
Edwin Kempin5e65d9b2011-07-08 07:35:48 +020055+
David Pursehousea1d633b2014-05-02 17:21:02 +090056This setting only applies for adding reviewers in the Gerrit Web UI,
Edwin Kempin5e65d9b2011-07-08 07:35:48 +020057but is ignored when adding reviewers with the
Edwin Kempin33e92d02011-07-11 22:00:57 +020058link:cmd-set-reviewers.html[set-reviewers] command.
Edwin Kempin49cb3e12011-06-29 14:35:14 +020059
60[[addreviewer.maxAllowed]]addreviewer.maxAllowed::
61+
62The maximum number of reviewers a user can add at once by adding a
63group as reviewer.
64+
65If set to 0, there is no limit for the number of reviewers that can
66be added at once by adding a group as reviewer.
67+
68Default is 20.
69
Patrick Hiesel87880b02016-05-03 18:15:08 +020070[[addReviewer.baseWeight]]addReviewer.baseWeight::
71+
72The weight that will be applied in the default reviewer ranking algorithm.
73This can be increased or decreased to give more or less influence to plugins.
74If set to zero, the base ranking will not have any effect. Reviewers will then
75be ordered as ranked by the plugins (if there are any).
76+
77By default 1.
78
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -080079[[auth]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080080=== Section auth
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070081
82See also link:config-sso.html[SSO configuration].
83
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -070084[[auth.type]]auth.type::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070085+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070086Type of user authentication employed by Gerrit. The supported
87values are:
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070088+
89* `OpenID`
90+
91The default setting. Gerrit uses any valid OpenID
92provider chosen by the end-user. For more information see
Shawn O. Pearce2920ef32009-08-03 08:03:34 -070093http://openid.net/[openid.net].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070094+
James E. Blairca8bc3b2011-12-21 18:12:26 +000095* `OpenID_SSO`
96+
97Supports OpenID from a single provider. There is no registration
98link, and the "Sign In" link sends the user directly to the provider's
99SSO entry point.
100+
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700101* `HTTP`
102+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700103Gerrit relies upon data presented in the HTTP request. This includes
Edwin Kempinf1acbb82011-09-15 12:49:42 +0200104HTTP basic authentication, or some types of commercial single-sign-on
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700105solutions. With this setting enabled the authentication must
106take place in the web server or servlet container, and not from
107within Gerrit.
108+
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700109* `HTTP_LDAP`
110+
111Exactly like `HTTP` (above), but additionally Gerrit pre-populates
112a user's full name and email address based on information obtained
113from the user's account object in LDAP. The user's group membership
114is also pulled from LDAP, making any LDAP groups that a user is a
115member of available as groups in Gerrit.
116+
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200117* `CLIENT_SSL_CERT_LDAP`
118+
119This authentication type is actually kind of SSO. Gerrit will configure
David Pursehouse221d4f62012-06-08 17:38:08 +0900120Jetty's SSL channel to request the client's SSL certificate. For this
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200121authentication to work a Gerrit administrator has to import the root
122certificate of the trust chain used to issue the client's certificate
123into the <review-site>/etc/keystore.
124After the authentication is done Gerrit will obtain basic user
125registration (name and email) from LDAP, and some group memberships.
126Therefore, the "_LDAP" suffix in the name of this authentication type.
127This authentication type can only be used under hosted daemon mode, and
128the httpd.listenUrl must use https:// as the protocol.
Chulho Yangb72ff8f2013-07-04 02:35:53 -0400129Optionally, certificate revocation list file can be used
130at <review-site>/etc/crl.pem. For details, see httpd.sslCrl.
Sasa Zivkoveabc8972010-10-04 15:47:08 +0200131+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700132* `LDAP`
133+
134Gerrit prompts the user to enter a username and a password, which
135it then verifies by performing a simple bind against the configured
136<<ldap.server,ldap.server>>. In this configuration the web server
137is not involved in the user authentication process.
138+
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800139The actual username used in the LDAP simple bind request is the
140account's full DN, which is discovered by first querying the
141directory using either an anonymous request, or the configured
Robin Rosenberga3baed02012-10-14 14:09:32 +0200142<<ldap.username,ldap.username>> identity. Gerrit can also use kerberos if
143<<ldap.authentication,ldap.authentication>> is set to `GSSAPI`.
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800144
145* `LDAP_BIND`
146+
147Gerrit prompts the user to enter a username and a password, which
148it then verifies by performing a simple bind against the configured
149<<ldap.server,ldap.server>>. In this configuration the web server
150is not involved in the user authentication process.
151+
David Pursehouse42f42042013-08-01 14:02:25 +0900152Unlike `LDAP` above, the username used to perform the LDAP simple bind
David Pursehouse1344f5b2013-08-09 17:35:47 +0900153request is the exact string supplied in the dialog by the user.
Robin Rosenberg524a3032012-10-14 14:24:36 +0200154The configured <<ldap.username,ldap.username>> identity is not used to obtain
Shawn O. Pearcec892d342010-02-17 17:00:50 -0800155account information.
156+
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200157* `OAUTH`
David Ostrovskye9707d82015-02-22 01:14:02 +0100158+
159OAuth is a protocol that lets external apps request authorization to private
160details in a user's account without getting their password. This is
161preferred over Basic Authentication because tokens can be limited to specific
162types of data, and can be revoked by users at any time.
163+
164Site owners have to register their application before getting started. Note
165that provider specific plugins must be used with this authentication scheme.
166+
Shawn O. Pearce2920ef32009-08-03 08:03:34 -0700167* `DEVELOPMENT_BECOME_ANY_ACCOUNT`
168+
169*DO NOT USE*. Only for use in a development environment.
170+
171When this is the configured authentication method a hyperlink titled
172`Become` appears in the top right corner of the page, taking the
173user to a form where they can enter the username of any existing
174user account, and immediately login as that account, without any
175authentication taking place. This form of authentication is only
176useful for the GWT hosted mode shell, where OpenID authentication
177redirects might be risky to the developer's host computer, and HTTP
178authentication is not possible.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700179
180+
181By default, OpenID.
182
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700183[[auth.allowedOpenID]]auth.allowedOpenID::
184+
185List of permitted OpenID providers. A user may only authenticate
186with an OpenID that matches this list. Only used if `auth.type`
David Pursehouse42f42042013-08-01 14:02:25 +0900187is set to `OpenID` (the default).
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700188+
Magnus Bäcke5611832011-02-02 08:57:15 +0100189Patterns may be either a
190link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
191Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearce533cafc2010-05-11 16:05:27 -0700192end with `$`) or be a simple prefix (any other string).
193+
194By default, the list contains two values, `http://` and `https://`,
195allowing users to authenticate with any OpenID provider.
196
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700197[[auth.trustedOpenID]]auth.trustedOpenID::
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700198+
David Pursehouse221d4f62012-06-08 17:38:08 +0900199List of trusted OpenID providers. Only used if `auth.type` is
David Pursehouse42f42042013-08-01 14:02:25 +0900200set to `OpenID` (the default).
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700201+
202In order for a user to take advantage of permissions beyond those
203granted to the `Anonymous Users` and `Registered Users` groups,
204the user account must only have OpenIDs which match at least one
205pattern from this list.
206+
Magnus Bäcke5611832011-02-02 08:57:15 +0100207Patterns may be either a
208link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
209Java regular expression (java.util.regex)] (start with `^` and
Shawn O. Pearced7c026d2009-08-05 20:11:22 -0700210end with `$`) or be a simple prefix (any other string).
211+
212By default, the list contains two values, `http://` and `https://`,
213allowing Gerrit to trust any OpenID it receives.
214
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100215[[auth.openIdDomain]]auth.openIdDomain::
216+
217List of allowed OpenID email address domains. Only used if
David Pursehouse42f42042013-08-01 14:02:25 +0900218`auth.type` is set to `OPENID` or `OPENID_SSO`.
Mike Goulined2ab0cd2012-12-18 11:20:53 +1100219+
220Domain is case insensitive and must be in the same form as it
221appears in the email address, for example, "example.com".
222+
223By default, any domain is accepted.
224
Shawn O. Pearce89030bc2010-04-24 17:25:29 -0700225[[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
226+
227Time in seconds before an OpenID provider must force the user
228to authenticate themselves again before authentication to this
229Gerrit server. Currently this is only a polite request, and users
230coming from providers that don't support the PAPE extension will
231be accepted anyway. In the future it may be enforced, rejecting
232users coming from providers that don't honor the max session age.
233+
234If set to 0, the provider will always force the user to authenticate
235(e.g. supply their password). Values should use common unit suffixes
236to express their setting:
237+
238* s, sec, second, seconds
239* m, min, minute, minutes
240* h, hr, hour, hours
241* d, day, days
242* w, week, weeks (`1 week` is treated as `7 days`)
243* mon, month, months (`1 month` is treated as `30 days`)
244* y, year, years (`1 year` is treated as `365 days`)
245
246+
247Default is -1, permitting infinite time between authentications.
248
David Pursehouse5be35a32015-09-09 17:35:32 +0900249[[auth.registerEmailPrivateKey]]auth.registerEmailPrivateKey::
250+
251Private key to use when generating an email verification token.
252+
253If not set, a random key is generated when running the
254link:pgm-init.html[site initialization].
255
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700256[[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
257+
258Time in seconds before an email verification token sent to a user in
259order to validate their email address expires.
260+
261* s, sec, second, seconds
262* m, min, minute, minutes
263* h, hr, hour, hours
264* d, day, days
265* w, week, weeks (`1 week` is treated as `7 days`)
266* mon, month, months (`1 month` is treated as `30 days`)
267* y, year, years (`1 year` is treated as `365 days`)
268
269+
Shawn O. Pearced6bd00b2012-01-20 12:40:51 -0800270Default is 12 hours.
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -0700271
James E. Blairca8bc3b2011-12-21 18:12:26 +0000272[[auth.openIdSsoUrl]]auth.openIdSsoUrl::
273+
David Pursehouse42f42042013-08-01 14:02:25 +0900274The SSO entry point URL. Only used if `auth.type` is set to
275`OpenID_SSO`.
James E. Blairca8bc3b2011-12-21 18:12:26 +0000276+
277The "Sign In" link will send users directly to this URL.
278
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700279[[auth.httpHeader]]auth.httpHeader::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700280+
281HTTP header to trust the username from, or unset to select HTTP basic
David Pursehouse42f42042013-08-01 14:02:25 +0900282or digest authentication. Only used if `auth.type` is set to `HTTP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700283
Luca Milanesio384ed6c2013-07-30 09:10:07 +0100284[[auth.httpDisplaynameHeader]]auth.httpDisplaynameHeader::
285+
286HTTP header to retrieve the user's display name from. Only used if `auth.type`
287is set to `HTTP`.
288+
289If set, Gerrit trusts and enforces the user's full name using the HTTP header
290and disables the ability to manually modify the user's full name
291from the contact information page.
292
293[[auth.httpEmailHeader]]auth.httpEmailHeader::
294+
295HTTP header to retrieve the user's e-mail from. Only used if `auth.type`
296is set to `HTTP`.
297+
298If set, Gerrit trusts and enforces the user's e-mail using the HTTP header
299and disables the ability to manually modify or register other e-mails
300from the contact information page.
301
Luca Milanesio97d07352014-07-17 08:31:06 +0100302[[auth.httpExternalIdHeader]]auth.httpExternalIdHeader::
303+
304HTTP header to retrieve the user's external identification token.
305Only used if `auth.type` is set to `HTTP`.
306+
307If set, Gerrit adds the value contained in the HTTP header to the
308user's identity. Typical use is with a federated identity token from
309an external system (e.g. GitHub OAuth 2.0 authentication) where
310the user's auth token exchanged during authentication handshake
311needs to be used for authenticated communication to the external
312system later on.
313+
314Example: `auth.httpExternalIdHeader: X-GitHub-OTP`
315
Luca Milanesio5185b042013-07-27 22:03:06 +0100316[[auth.loginUrl]]auth.loginUrl::
317+
318URL to redirect a browser to after the end-user has clicked on the
David Pursehouse42f42042013-08-01 14:02:25 +0900319login link in the upper right corner. Only used if `auth.type` is set
320to `HTTP` or `HTTP_LDAP`.
Luca Milanesio5185b042013-07-27 22:03:06 +0100321Organizations using an enterprise single-sign-on solution may want to
322redirect the browser to the SSO product's sign-in page for completing the
323login process and validate their credentials.
324+
David Pursehouse42f42042013-08-01 14:02:25 +0900325If set, Gerrit allows anonymous access until the end-user performs the login
326and provides a trusted identity through the HTTP header.
Luca Milanesio5185b042013-07-27 22:03:06 +0100327If not set, Gerrit requires the HTTP header with a trusted identity
David Pursehouse42f42042013-08-01 14:02:25 +0900328and returns the error page 'LoginRedirect.html' if such a header is not
329present.
Luca Milanesio5185b042013-07-27 22:03:06 +0100330
331[[auth.loginText]]auth.loginText::
332+
David Pursehouse42f42042013-08-01 14:02:25 +0900333Text displayed in the loginUrl link. Only used if `auth.loginUrl` is set.
Luca Milanesio5185b042013-07-27 22:03:06 +0100334+
David Pursehouse42f42042013-08-01 14:02:25 +0900335If not set, the "Sign In" text is used.
Luca Milanesio5185b042013-07-27 22:03:06 +0100336
Luca Milanesio111e0b72013-08-15 18:56:42 +0100337[[auth.registerPageUrl]]auth.registerPageUrl::
338+
David Pursehouse268744b2013-08-17 15:32:11 +0900339URL of the registration page to use when a new user logs in to Gerrit for
340the first time. Used only when `auth.type` is set to `HTTP`.
Luca Milanesio111e0b72013-08-15 18:56:42 +0100341+
342If not set, the standard Gerrit registration page `/#/register/` is displayed.
343
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700344[[auth.logoutUrl]]auth.logoutUrl::
Shawn O. Pearce12b5d842009-08-15 15:11:10 -0700345+
346URL to redirect a browser to after the end-user has clicked on the
347"Sign Out" link in the upper right corner. Organizations using an
348enterprise single-sign-on solution may want to redirect the browser
349to the SSO product's sign-out page.
350+
351If not set, the redirect returns to the list of all open changes.
352
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800353[[auth.registerUrl]]auth.registerUrl::
354+
355Target for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200356when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Shawn O. Pearcec9d26b52009-12-16 08:05:27 -0800357+
358If not set, no "Register" link is displayed.
359
Chad Horohoe65897082012-11-10 10:26:25 -0800360[[auth.registerText]]auth.registerText::
361+
362Text for the "Register" link in the upper right corner. Used only
Edwin Kempin54093152015-05-08 10:50:35 +0200363when `auth.type` is `LDAP`, `LDAP_BIND` or `CUSTOM_EXTENSION`.
Chad Horohoe65897082012-11-10 10:26:25 -0800364+
365If not set, defaults to "Register".
366
David Pursehouse3d604492013-01-25 17:41:53 +0900367[[auth.editFullNameUrl]]auth.editFullNameUrl::
368+
369Target for the "Edit" button when the user is allowed to edit their
Edwin Kempin54093152015-05-08 10:50:35 +0200370full name. Used only when `auth.type` is `LDAP`, `LDAP_BIND` or
371`CUSTOM_EXTENSION`.
David Pursehouse3d604492013-01-25 17:41:53 +0900372
373[[auth.httpPasswordUrl]]auth.httpPasswordUrl::
374+
David Pursehouse42f42042013-08-01 14:02:25 +0900375Target for the "Obtain Password" link. Used only when `auth.type` is
Edwin Kempin54093152015-05-08 10:50:35 +0200376`CUSTOM_EXTENSION`.
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700377
378[[auth.switchAccountUrl]]auth.switchAccountUrl::
David Pursehouse3d604492013-01-25 17:41:53 +0900379+
Shawn Pearcee0cafe42013-08-29 23:28:13 -0700380URL to switch user identities and login as a different account than
381the currently active account. This is disabled by default except when
382`auth.type` is `OPENID` and `DEVELOPMENT_BECOME_ANY_ACCOUNT`. If set
383the "Switch Account" link is displayed next to "Sign Out".
384+
385When `auth.type` does not normally enable this URL administrators may
386set this to `login/` or `$canonicalWebUrl/login`, allowing users to
387begin a new web session.
David Pursehouse3d604492013-01-25 17:41:53 +0900388
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000389[[auth.cookiePath]]auth.cookiePath::
390+
391Sets "path" attribute of the authentication cookie.
392+
393If not set, HTTP request's path is used.
394
Sammy Gillespie26873c02016-02-11 14:39:43 +0000395[[auth.cookieDomain]]auth.cookieDomain::
396+
397Sets "domain" attribute of the authentication cookie.
398+
399If not set, HTTP request's domain is used.
400
Piotr Sikora7cec2f82011-02-26 12:57:30 +0000401[[auth.cookieSecure]]auth.cookieSecure::
402+
403Sets "secure" flag of the authentication cookie. If true, cookies
404will be transmitted only over HTTPS protocol.
405+
406By default, false.
407
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700408[[auth.emailFormat]]auth.emailFormat::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700409+
410Optional format string to construct user email addresses out of
David Pursehouse42f42042013-08-01 14:02:25 +0900411user login names. Only used if `auth.type` is `HTTP`, `HTTP_LDAP`
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700412or `LDAP`.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700413+
Shawn O. Pearce44221bf2011-06-27 10:37:30 -0700414This value can be set to a format string, where `{0}` is replaced
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700415with the login name. E.g. "\{0\}+gerrit@example.com" with a user
416login name of "foo" will produce "foo+gerrit@example.com" during
417the first time user "foo" registers.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700418+
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -0700419If the site is using `HTTP_LDAP` or `LDAP`, using this option is
420discouraged. Setting `ldap.accountEmailAddress` and importing the
421email address from the LDAP directory is generally preferred.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700422
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700423[[auth.contributorAgreements]]auth.contributorAgreements::
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700424+
425Controls whether or not the contributor agreement features are
426enabled for the Gerrit site. If enabled a user must complete a
427contributor agreement before they can upload changes.
428+
Marc Petit-Hugueninbbb85492012-12-03 11:11:00 -0800429If enabled, the admin must also add one or more
430link:config-cla.html[contributor-agreement sections]
431in project.config and create agreement files under
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700432`'$site_path'/static`, so users can actually complete one or
Grzegorz Kossakowski28e4e1b2009-09-23 11:33:34 -0700433more agreements.
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700434+
435By default this is false (no agreements are used).
Fredrik Luthandera3cf3542012-07-04 16:55:35 -0700436+
437To enable the actual usage of contributor agreement the project
438specific config option in the `project.config` must be set:
439link:config-project-config.html[receive.requireContributorAgreement].
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -0700440
Christian Halstricka3d88a52011-08-31 09:21:41 +0200441[[auth.trustContainerAuth]]auth.trustContainerAuth::
442+
443If true then it is the responsibility of the container hosting
444Gerrit to authenticate users. In this case Gerrit will blindly trust
445the container.
446+
447This parameter only affects git over http traffic. If set to false
448then Gerrit will do the authentication (using DIGEST authentication).
449+
450By default this is set to false.
451
Luca Milanesio42058842012-01-05 21:25:38 +0000452[[auth.gitBasicAuth]]auth.gitBasicAuth::
453+
454If true then Git over HTTP and HTTP/S traffic is authenticated using
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400455standard BasicAuth. Depending on the configured `auth.type`, credentials
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200456are validated against the randomly generated HTTP password, against LDAP
457(`auth.type = LDAP`) or against an OAuth 2 provider (`auth.type = OAUTH`).
Luca Milanesio42058842012-01-05 21:25:38 +0000458+
Edwin Kempin4b9d9982014-04-16 11:27:46 +0200459This parameter affects git over HTTP traffic and access to the REST
460API. If set to false then Gerrit will authenticate through DIGEST
461authentication and the randomly generated HTTP password in the Gerrit
462database.
Luca Milanesio42058842012-01-05 21:25:38 +0000463+
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400464When `auth.type` is `LDAP`, users should authenticate using their LDAP passwords.
465However, if link:#auth.gitBasicAuthPolicy[`auth.gitBasicAuthPolicy`] is set to `HTTP`,
466the randomly generated HTTP password is used exclusively. In the other hand,
467if link:#auth.gitBasicAuthPolicy[`auth.gitBasicAuthPolicy`] is set to `HTTP_LDAP`,
468the password in the request is first checked against the HTTP password and, if
469it does not match, it is then validated against the LDAP password.
470Service users that only exist in the Gerrit database are authenticated by their
471HTTP passwords.
Luca Milanesio42058842012-01-05 21:25:38 +0000472+
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200473When `auth.type` is `OAUTH`, Git clients may send OAuth 2 access tokens
474instead of passwords in the Basic authentication header. Note that provider
475specific plugins must be installed to facilitate this authentication scheme.
476If multiple OAuth 2 provider plugins are installed one of them must be
477selected as default with the `auth.gitOAuthProvider` option.
478+
Luca Milanesio42058842012-01-05 21:25:38 +0000479By default this is set to false.
480
Hector Oswaldo Caballero2a9ad1f2016-09-15 18:24:42 -0400481[[auth.gitBasicAuthPolicy]]auth.gitBasicAuthPolicy::
482+
483When `auth.type` is `LDAP` and BasicAuth (i.e., link:#auth.gitBasicAuth[`auth.gitBasicAuth`]
484is set to true), it allows using either the generated HTTP password, the LDAP
485password or both to authenticate Git over HTTP and REST API requests. The
486supported values are:
487+
488*`HTTP`
489+
490Only the randomly generated HTTP password is accepted when doing Git over HTTP
491and REST API requests.
492+
493*`LDAP`
494+
495Only the `LDAP` password is allowed when doing Git over HTTP and REST API
496requests.
497+
498*`HTTP_LDAP`
499+
500The password in the request is first checked against the HTTP password and, if
501it does not match, it is then validated against the `LDAP` password.
502+
503By default this is set to `LDAP` when link:#auth.type[`auth.type`] is `LDAP`.
504Otherwise, the default value is `HTTP`.
505
Michael Ochmanne9e046a2015-10-20 15:34:29 +0200506[[auth.gitOAuthProvider]]auth.gitOAuthProvider::
507+
508Selects the OAuth 2 provider to authenticate git over HTTP traffic with.
509+
510In general there is no way to determine from an access token alone, which
511OAuth 2 provider to address to verify that token, and the BasicAuth
512scheme does not support amending such details. If multiple OAuth provider
513plugins in a system offer support for git over HTTP authentication site
514administrators must configure, which one to use as default provider.
515In case the provider cannot be determined from a request the access token
516will be sent to the default provider for verification.
517+
518The value of this parameter must be the identifier of an OAuth 2 provider
519in the form `plugin-name:provider-name`. Consult the respective plugin
520documentation for details.
521
Edwin Kempin4b9e5e72011-09-22 15:06:14 +0200522[[auth.userNameToLowerCase]]auth.userNameToLowerCase::
523+
524If set the username that is received to authenticate a git operation
525is converted to lower case for looking up the user account in Gerrit.
526+
527By setting this parameter a case insensitive authentication for the
528git operations can be achieved, if it is ensured that the usernames in
529Gerrit (scheme `username`) are stored in lower case (e.g. if the
530parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
531set to `${sAMAccountName.toLowerCase}`). It is important that for all
532existing accounts this username is already in lower case. It is not
533possible to convert the usernames of the existing accounts to lower
534case because this would break the access to existing per-user
535branches.
536+
537This parameter only affects git over http and git over SSH traffic.
538+
539By default this is set to false.
540
Shawn Pearcea931fe12013-06-11 12:29:17 -0700541[[auth.enableRunAs]]auth.enableRunAs::
542+
543If true HTTP REST APIs will accept the `X-Gerrit-RunAs` HTTP request
544header from any users granted the link:access-control.html#capability_runAs[Run As]
545capability. The header and capability permit the authenticated user
546to impersonate another account.
547+
548If false the feature is disabled and cannot be re-enabled without
549editing gerrit.config and restarting the server.
550+
551Default is true.
552
David Pursehouse21bd07b2015-11-27 00:15:42 +0900553[[auth.allowRegisterNewEmail]]auth.allowRegisterNewEmail::
554+
555Whether users are allowed to register new email addresses.
556+
557In addition for the HTTP authentication type
558link:#auth.httpemailheader[auth.httpemailheader] must *not* be set to
559enable registration of new email addresses.
560+
561By default, true.
562
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800563[[cache]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800564=== Section cache
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700565
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700566[[cache.directory]]cache.directory::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700567+
568Path to a local directory where Gerrit can write cached entities for
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700569future lookup. This local disk cache is used to retain potentially
570expensive to compute information across restarts. If the location
571does not exist, Gerrit will try to create it.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700572+
David Pursehousea61ee502016-09-06 16:27:09 +0900573Technically, cached entities are persisted as a set of H2 databases
Saša Živkove607d6c2016-02-24 10:46:46 +0000574inside this directory.
575+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700576If not absolute, the path is resolved relative to `$site_path`.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700577+
Shawn O. Pearce4b212282009-08-05 19:45:56 -0700578Default is unset, no disk cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700579
Saša Živkovf3134572016-02-09 11:42:46 +0100580[[cache.h2CacheSize]]cache.h2CacheSize::
581+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200582The size of the in-memory cache for each opened H2 cache database, in bytes.
Saša Živkove607d6c2016-02-24 10:46:46 +0000583+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200584Some caches of Gerrit are persistent and are backed by an H2 database.
Saša Živkove607d6c2016-02-24 10:46:46 +0000585H2 uses memory to cache its database content. The parameter `h2CacheSize`
586allows to limit the memory used by H2 and thus prevent out-of-memory
Saša Živkovf3134572016-02-09 11:42:46 +0100587caused by the H2 database using too much memory.
588+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200589See <<database.h2.cachesize,database.h2.cachesize>> for a detailed discussion.
Saša Živkovf3134572016-02-09 11:42:46 +0100590+
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200591Default is unset, using up to half of the available memory.
592
593H2 will persist this value in the database, so to unset explicitly specify 0.
Saša Živkovf3134572016-02-09 11:42:46 +0100594+
595Common unit suffixes of 'k', 'm', or 'g' are supported.
596
Björn Pedersen64af3ad2016-05-20 10:21:07 +0200597[[cache.h2AutoServer]]cache.h2AutoServer::
598+
599If set to true, enable H2 autoserver mode for the H2-backed persistent cache
600databases.
601+
602See link:http://www.h2database.com/html/features.html#auto_mixed_mode[here]
603for detail.
604+
605Default is false.
606
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700607[[cache.name.maxAge]]cache.<name>.maxAge::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700608+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700609Maximum age to keep an entry in the cache. Entries are removed from
610the cache and refreshed from source data every maxAge interval.
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700611Values should use common unit suffixes to express their setting:
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700612+
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700613* s, sec, second, seconds
614* m, min, minute, minutes
615* h, hr, hour, hours
616* d, day, days
617* w, week, weeks (`1 week` is treated as `7 days`)
618* mon, month, months (`1 month` is treated as `30 days`)
619* y, year, years (`1 year` is treated as `365 days`)
620
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700621+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200622--
Edwin Kempinabcd5042013-03-12 16:04:37 +0100623If a unit suffix is not specified, `seconds` is assumed. If 0 is
Shawn O. Pearce3fdbf392009-09-04 18:08:26 -0700624supplied, the maximum age is infinite and items are never purged
625except when the cache is full.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200626
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700627Default is `0`, meaning store forever with no expire, except:
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200628
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400629* `"adv_bases"`: default is `10 minutes`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700630* `"ldap_groups"`: default is `1 hour`
Shawn O. Pearced9c403e2009-08-19 08:35:41 -0700631* `"web_sessions"`: default is `12 hours`
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200632--
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700633
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700634[[cache.name.memoryLimit]]cache.<name>.memoryLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700635+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700636The total cost of entries to retain in memory. The cost computation
637varies by the cache. For most caches where the in-memory size of each
638entry is relatively the same, memoryLimit is currently defined to be
639the number of entries held by the cache (each entry costs 1).
640+
641For caches where the size of an entry can vary significantly between
642individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
643is an approximation of the total number of bytes stored by the cache.
644Larger entries that represent bigger patch sets or longer source files
645will consume a bigger portion of the memoryLimit. For these caches the
646memoryLimit should be set to roughly the amount of RAM (in bytes) the
647administrator can dedicate to the cache.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700648+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700649Default is 1024 for most caches, except:
650+
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400651* `"adv_bases"`: default is `4096`
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700652* `"diff"`: default is `10m` (10 MiB of memory)
653* `"diff_intraline"`: default is `10m` (10 MiB of memory)
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200654* `"diff_summary"`: default is `10m` (10 MiB of memory)
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700655* `"plugin_resources"`: default is 2m (2 MiB of memory)
656
657+
658If set to 0 the cache is disabled. Entries are removed immediately
659after being stored by the cache. This is primarily useful for testing.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700660
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -0700661[[cache.name.diskLimit]]cache.<name>.diskLimit::
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700662+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700663Total size in bytes of the keys and values stored on disk. Caches that
664have grown bigger than this size are scanned daily at 1 AM local
665server time to trim the cache. Entries are removed in least recently
666accessed order until the cache fits within this limit. Caches may
667grow larger than this during the day, as the size check is only
668performed once every 24 hours.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700669+
Saša Živkove789f2e2016-09-22 10:37:34 +0200670Default is 128 MiB per cache, except:
671+
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200672* `"diff_summary"`: default is `1g` (1 GiB of disk space)
Saša Živkove789f2e2016-09-22 10:37:34 +0200673
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700674+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700675If 0, disk storage for the cache is disabled.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700676
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800677==== [[cache_names]]Standard Caches
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700678
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700679cache `"accounts"`::
680+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700681Cache entries contain important details of an active user, including
682their display name, preferences, known email addresses, and group
683memberships. Entry information is obtained from the following
684database tables:
685+
686* `accounts`
687+
688* `account_group_members`
689+
690* `account_external_ids`
691
692+
693If direct updates are made to any of these database tables, this
694cache should be flushed.
695
696cache `"accounts_byemail"`::
697+
698Caches account identities keyed by email address, which is scanned
699from the `account_external_ids` database table. If updates are
700made to this table, this cache should be flushed.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700701
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400702cache `"adv_bases"`::
703+
704Used only for push over smart HTTP when branch level access controls
David Pursehouse92463562013-06-24 10:16:28 +0900705are enabled. The cache entry contains all commits that are available
Shawn O. Pearce05687e92011-04-04 17:29:03 -0400706for the client to use as potential delta bases. Push over smart HTTP
707requires two HTTP requests, and this cache tries to carry state from
708the first request into the second to ensure it can complete.
709
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200710cache `"changes"`::
711+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200712The size of `memoryLimit` determines the number of projects for which
713all changes will be cached. If the cache is set to 1024, this means all
714changes for up to 1024 projects can be held in the cache.
Gustaf Lundh53493772012-11-18 18:41:15 -0800715+
Gustaf Lundh3353c362013-04-24 17:25:39 +0200716Default value is 0 (disabled). It is disabled by default due to the fact
717that change updates are not communicated between Gerrit servers. Hence
718this cache should be disabled in an multi-master/multi-slave setup.
Gustaf Lundh53493772012-11-18 18:41:15 -0800719+
720The cache should be flushed whenever the database changes table is modified
Matt Baker8ce12fc2013-11-26 21:43:12 -0700721outside of Gerrit.
Gustaf Lundh47ce4e32012-05-21 11:18:42 +0200722
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700723cache `"diff"`::
724+
Shawn O. Pearceefaf9792009-09-02 18:12:52 -0700725Each item caches the differences between two commits, at both the
726directory and file levels. Gerrit uses this cache to accelerate
727the display of affected file names, as well as file contents.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700728+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700729Entries in this cache are relatively large, so memoryLimit is an
730estimate in bytes of memory used. Administrators should try to target
731cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
732day span.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700733
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400734cache `"diff_intraline"`::
735+
736Each item caches the intraline difference of one file, when compared
737between two commits. Gerrit uses this cache to accelerate display of
738intraline differences when viewing a file.
739+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700740Entries in this cache are relatively large, so memoryLimit is an
741estimate in bytes of memory used. Administrators should try to target
742cache.diff.memoryLimit to fit all files users will view in a 1 or 2
743day span.
Shawn O. Pearcef0cfe532011-04-11 23:40:06 -0400744
Dave Borowitz7388e9e2016-09-23 13:20:29 +0200745cache `"diff_summary"`::
Saša Živkove789f2e2016-09-22 10:37:34 +0200746+
747Each item caches list of file paths which are different between two
748commits. Gerrit uses this cache to accelerate computing of the list
749of paths of changed files.
750+
751Ideally, disk limit of this cache is large enough to cover all changes.
752This should significantly speed up change reindexing, especially
753full offline reindexing.
754
Shawn O. Pearce2d65d292011-06-24 08:12:02 -0700755cache `"git_tags"`::
756+
757If branch or reference level READ access controls are used, this
758cache tracks which tags are reachable from the branch tips of a
759repository. Gerrit uses this information to determine the set
760of tags that a client may access, derived from which tags are
761part of the history of a visible branch.
762+
763The cache is persisted to disk across server restarts as it can
764be expensive to compute (60 or more seconds for a large history
765like the Linux kernel repository).
766
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700767cache `"groups"`::
768+
Shawn O. Pearce4dba9882009-08-05 19:55:15 -0700769Caches the basic group information from the `account_groups` table,
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700770including the group owner, name, and description.
771+
772Gerrit group membership obtained from the `account_group_members`
773table is cached under the `"accounts"` cache, above. External group
774membership obtained from LDAP is cached under `"ldap_groups"`.
775
Matt Fischer620255a2011-03-22 14:28:23 -0500776cache `"groups_byinclude"`::
777+
778Caches group inclusions in other groups. If direct updates are made
779to the `account_group_includes` table, this cache should be flushed.
780
Bruce Zu825125a2014-11-19 17:01:42 +0900781cache `"groups_members"`::
782+
783Caches subgroups. If direct updates are made to the
784`account_group_includes` table, this cache should be flushed.
785
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -0700786cache `"ldap_groups"`::
787+
788Caches the LDAP groups that a user belongs to, if LDAP has been
789configured on this server. This cache should be configured with a
790low maxAge setting, to ensure LDAP modifications are picked up in
791a timely fashion.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700792
Gustaf Lundh0919a492012-10-19 15:29:23 +0200793cache `"ldap_groups_byinclude"`::
794+
795Caches the hierarchical structure of LDAP groups.
796
Shawn O. Pearce6d26f4a2009-08-24 15:43:52 -0700797cache `"ldap_usernames"`::
798+
799Caches a mapping of LDAP username to Gerrit account identity. The
800cache automatically updates when a user first creates their account
801within Gerrit, so the cache expire time is largely irrelevant.
802
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700803cache `"permission_sort"`::
804+
David Pursehouse221d4f62012-06-08 17:38:08 +0900805Caches the order in which access control sections must be applied to a
Shawn O. Pearce0c1abdb2011-06-24 11:01:25 -0700806reference. Sorting the sections can be expensive when regular
807expressions are used, so this cache remembers the ordering for
808each branch.
809
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700810cache `"plugin_resources"`::
811+
812Caches formatted plugin resources, such as plugin documentation that
813has been converted from Markdown to HTML. The memoryLimit refers to
814the bytes of memory dedicated to storing the documentation.
815
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700816cache `"projects"`::
817+
818Caches the project description records, from the `projects` table
819in the database. If a project record is updated or deleted, this
820cache should be flushed. Newly inserted projects do not require
821a cache flush, as they will be read upon first reference.
822
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700823cache `"sshkeys"`::
824+
825Caches unpacked versions of user SSH keys, so the internal SSH daemon
826can match against them during authentication. The unit of storage
827is per-user, so 1024 items translates to 1024 unique user accounts.
828As each individual user account may configure multiple SSH keys,
829the total number of keys may be larger than the item count.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700830+
831This cache is based off the `account_ssh_keys` table and the
832`accounts.ssh_user_name` column in the database. If either is
833modified directly, this cache should be flushed.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700834
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700835cache `"web_sessions"`::
836+
837Tracks the live user sessions coming in over HTTP. Flushing this
838cache would cause all users to be signed out immediately, forcing
Shawn O. Pearce727d80f2009-08-17 07:57:54 -0700839them to sign-in again. To avoid breaking active users, this cache
840is not flushed automatically by `gerrit flush-caches --all`, but
841instead must be explicitly requested.
842+
843If no disk cache is configured (or `cache.web_sessions.diskLimit`
844is set to 0) a server restart will force all users to sign-out,
845and need to sign-in again after the restart, as the cache was
846unable to persist the session information. Enabling a disk cache
847is strongly recommended.
848+
Shawn O. Pearce2e1cb2b2012-05-24 14:28:40 -0700849Session storage is relatively inexpensive. The average entry in
850this cache is approximately 346 bytes.
Shawn O. Pearceb09322b2009-08-15 17:49:00 -0700851
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700852See also link:cmd-flush-caches.html[gerrit flush-caches].
853
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800854==== [[cache_options]]Cache Options
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800855
Hugo Arès2bc86812015-03-09 15:20:28 -0400856[[cache.diff.timeout]]cache.diff.timeout::
857+
858Maximum number of milliseconds to wait for diff data before giving up and
859falling back on a simpler diff algorithm that will not be able to break down
860modified regions into smaller ones. This is a work around for an infinite loop
861bug in the default difference algorithm implementation.
862+
863Values should use common unit suffixes to express their setting:
864+
865* ms, milliseconds
866* s, sec, second, seconds
867* m, min, minute, minutes
868* h, hr, hour, hours
869
870+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200871--
Hugo Arès2bc86812015-03-09 15:20:28 -0400872If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200873
Hugo Arès2bc86812015-03-09 15:20:28 -0400874Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200875--
Hugo Arès2bc86812015-03-09 15:20:28 -0400876
Edwin Kempin42d27432013-11-24 17:06:24 +0100877[[cache.diff_intraline.timeout]]cache.diff_intraline.timeout::
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800878+
879Maximum number of milliseconds to wait for intraline difference data
880before giving up and disabling it for a particular file pair. This is
881a work around for an infinite loop bug in the intraline difference
David Pursehousee8c1fb92013-04-17 17:18:43 +0900882implementation.
883+
884If computation takes longer than the timeout, the worker thread is
885terminated, an error message is shown, and no intraline difference is
886displayed for the file pair.
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800887+
888Values should use common unit suffixes to express their setting:
889+
890* ms, milliseconds
891* s, sec, second, seconds
892* m, min, minute, minutes
893* h, hr, hour, hours
894
895+
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200896--
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800897If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200898
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800899Default is 5 seconds.
Edwin Kempina09ebcf2015-04-16 14:53:23 +0200900--
Shawn O. Pearce617aa392010-11-15 14:03:28 -0800901
Edwin Kempin42d27432013-11-24 17:06:24 +0100902[[cache.diff_intraline.enabled]]cache.diff_intraline.enabled::
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800903+
904Boolean to enable or disable the computation of intraline differences
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800905when populating a diff cache entry. This flag is provided primarily
906as a backdoor to disable the intraline difference feature if
David Pursehouse92463562013-06-24 10:16:28 +0900907necessary. To maintain backwards compatibility with prior versions,
Shawn O. Pearce307dd4e2010-11-15 12:12:20 -0800908this setting will fallback to `cache.diff.intraline` if not set in the
909configuration.
Shawn O. Pearce29de4362010-03-03 17:51:26 -0800910+
911Default is true, enabled.
912
Edwin Kempin42d27432013-11-24 17:06:24 +0100913[[cache.projects.checkFrequency]]cache.projects.checkFrequency::
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700914+
915How often project configuration should be checked for update from Git.
916Gerrit Code Review caches project access rules and configuration in
917memory, checking the refs/meta/config branch every checkFrequency
918minutes to see if a new revision should be loaded and used for future
919access. Values can be specified using standard time unit abbreviations
920('ms', 'sec', 'min', etc.).
921+
922If set to 0, checks occur every time, which may slow down operations.
Shawn Pearcec825ef12013-02-20 11:29:46 -0800923If set to 'disabled' or 'off', no check will ever be done.
Shawn O. Pearceb8e4e352011-05-19 18:09:01 -0700924Administrators may force the cache to flush with
925link:cmd-flush-caches.html[gerrit flush-caches].
926+
927Default is 5 minutes.
928
Simon Leifc19ff12014-10-02 13:36:00 -0400929[[cache.projects.loadOnStartup]]cache.projects.loadOnStartup::
930+
931If the project cache should be loaded during server startup.
932+
933The cache is loaded concurrently. Admins should ensure that the cache
934size set under <<cache.name.memoryLimit,cache.projects.memoryLimit>>
935is not smaller than the number of repos.
936+
937Default is false, disabled.
938
939[[cache.projects.loadThreads]]cache.projects.loadThreads::
940+
941Only relevant if <<cache.projects.loadOnStartup,cache.projects.loadOnStartup>>
942is true.
943+
944The number of threads to allocate for loading the cache at startup. These
945threads will die out after the cache is loaded.
946+
947Default is the number of CPUs.
948
Shawn Pearce67a33302016-08-11 11:51:59 -0700949
950[[capability]]
951=== Section capability
952
953[[capability.administrateServer]]capability.administrateServer::
954+
955Names of groups of users that are allowed to exercise the
956administrateServer capability, in addition to those listed in
957All-Projects. Configuring this option can be a useful fail-safe
958to recover a server in the event an administrator removed all
959groups from the administrateServer capability, or to ensure that
960specific groups always have administration capabilities.
961+
962----
963[capability]
964 administrateServer = group Fail Safe Admins
965----
966+
967The configuration file uses group names, not UUIDs. If a group is
968renamed the gerrit.config file must be updated to reflect the new
969name. If a group cannot be found for the configured name a warning
970is logged and the server will continue normal startup.
971+
972If not specified (default), only the groups listed by All-Projects
973may use the administrateServer capability.
974
975
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -0800976[[change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800977=== Section change
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700978
Edwin Kempin662e55f2013-11-23 12:50:29 +0100979[[change.largeChange]]change.largeChange::
980+
981Number of changed lines from which on a change is considered as a large
982change. The number of changed lines of a change is the sum of the lines
983that were inserted and deleted in the change.
984+
David Pursehousea1d633b2014-05-02 17:21:02 +0900985The specified value is used to visualize the change sizes in the Web UI
Edwin Kempin662e55f2013-11-23 12:50:29 +0100986in change tables and user dashboards.
987+
988By default 500.
989
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700990[[change.updateDelay]]change.updateDelay::
991+
992How often in seconds the web interface should poll for updates to the
993currently open change. The poller relies on the client's browser
994cache to use If-Modified-Since and respect `304 Not Modified` HTTP
Matt Baker8ce12fc2013-11-26 21:43:12 -0700995responses. This allows for fast polls, often under 8 milliseconds.
Shawn Pearceb9ebb662013-07-19 19:45:25 -0700996+
997With a configured 30 second delay a server with 4900 active users will
998typically need to dedicate 1 CPU to the update check. 4900 users
999divided by an average delay of 30 seconds is 163 requests arriving per
Edwin Kempin720eebe2014-07-16 13:44:04 +02001000second. If requests are served at \~6 ms response time, 1 CPU is
Shawn Pearceb9ebb662013-07-19 19:45:25 -07001001necessary to keep up with the update request traffic. On a smaller
1002user base of 500 active users, the default 30 second delay is only 17
1003requests per second and requires ~10% CPU.
1004+
1005If 0 the update polling is disabled.
1006+
1007Default is 30 seconds.
1008
Gabor Somossyb72d4c62015-10-20 23:40:07 +01001009[[change.allowBlame]]change.allowBlame::
1010+
1011Allow blame on side by side diff. If set to false, blame cannot be used.
1012+
1013Default is true.
1014
David Ostrovsky1b61dc72014-01-28 18:40:48 +01001015[[change.allowDrafts]]change.allowDrafts::
1016+
1017Allow drafts workflow. If set to false, drafts cannot be created,
1018deleted or published.
1019+
1020Default is true.
1021
Dave Borowitzf5e6e042016-04-25 13:03:42 -04001022[[change.cacheAutomerge]]change.cacheAutomerge::
1023+
1024When reviewing diff commits, the left-hand side shows the output of the
1025result of JGit's automatic merge algorithm. This option controls whether
1026this output is cached in the change repository, or if only the diff is
1027cached in the persistent `diff` cache.
1028+
1029If true, automerge results are stored in the repository under
1030`refs/cache-automerge/*`; the results of diffing the change against its
1031automerge base are stored in the diff cache. If false, no extra data is
1032stored in the repository, only the diff cache. This can result in slight
1033performance improvements by reducing the number of refs in the repo.
1034+
1035Default is true.
1036
Gustaf Lundh661d30a2016-09-19 14:41:29 +02001037[[change.showAssignee]]change.showAssignee::
1038+
1039Allow assignee workflow. If set to false, assignees will not be visible anywhere
1040in UI.
1041+
1042Default is true.
1043
David Ostrovsky9933eb32014-05-20 16:08:20 +02001044[[change.submitLabel]]change.submitLabel::
1045+
1046Label name for the submit button.
1047+
1048Default is "Submit".
1049
Stefan Beller7c380d512015-08-21 10:55:21 -07001050[[change.submitLabelWithParents]]change.submitLabelWithParents::
1051+
1052Label name for the submit button if the change has parents which will
1053be submitted together with this change.
1054+
1055Default is "Submit including parents".
1056
David Ostrovsky9933eb32014-05-20 16:08:20 +02001057[[change.submitTooltip]]change.submitTooltip::
1058+
1059Tooltip for the submit button. Variables available for replacement
1060include `${patchSet}` for the current patch set number (1, 2, 3),
1061`${branch}` for the branch name ("master") and `${commit}` for the
1062abbreviated commit SHA-1 (`c9c0edb`).
1063+
1064Default is "Submit patch set ${patchSet} into ${branch}".
1065
Stefan Beller0e655542015-07-20 21:14:38 -07001066[[change.submitTooltipAncestors]]change.submitTooltipAncestors::
1067+
1068Tooltip for the submit button if there are ancestors which would
1069also be submitted by submitting the change. Additionally to the variables
1070as in link:#change.submitTooltip[change.submitTooltip], there is the
1071variable `${submitSize}` indicating the number of changes which are
1072submitted.
1073+
1074Default is "Submit all ${topicSize} changes of the same topic (${submitSize}
1075changes including ancestors and other changes related by topic)".
1076
David Pursehouse2ecd0302016-04-07 19:12:00 +09001077[[change.submitWholeTopic]]change.submitWholeTopic::
Stefan Bellera038cf72015-01-13 16:25:10 -08001078+
1079Determines if the submit button submits the whole topic instead of
1080just the current change.
1081+
1082Default is false.
1083
1084[[change.submitTopicLabel]]change.submitTopicLabel::
1085+
1086If `change.submitWholeTopic` is set and a change has a topic,
1087the label name for the submit button is given here instead of
1088the configuration `change.submitLabel`.
1089+
1090Defaults to "Submit whole topic"
1091
1092[[change.submitTopicTooltip]]change.submitTopicTooltip::
1093+
David Pursehousea61ee502016-09-06 16:27:09 +09001094If `change.submitWholeTopic` is configured to true and a change has a
Stefan Bellera038cf72015-01-13 16:25:10 -08001095topic, this configuration determines the tooltip for the submit button
1096instead of `change.submitTooltip`. The variable `${topicSize}` is available
Stefan Beller7c380d512015-08-21 10:55:21 -07001097for the number of changes in the same topic to be submitted. The number of
1098all changes to be submitted is in the variable `${submitSize}`.
Stefan Bellera038cf72015-01-13 16:25:10 -08001099+
Stefan Beller7c380d512015-08-21 10:55:21 -07001100Defaults to "Submit all ${topicSize} changes of the same topic
1101(${submitSize} changes including ancestors and other
1102changes related by topic)".
Stefan Bellera038cf72015-01-13 16:25:10 -08001103
Richard Möhne4abe9a2014-11-13 20:05:13 +01001104[[change.replyLabel]]change.replyLabel::
1105+
1106Label name for the reply button. In the user interface an ellipsis (…)
1107is appended.
1108+
1109Default is "Reply". In the user interface it becomes "Reply…".
1110
1111[[change.replyTooltip]]change.replyTooltip::
1112+
1113Tooltip for the reply button. In the user interface a note about the
1114keyboard shortcut is appended.
1115+
1116Default is "Reply and score". In the user interface it becomes "Reply
1117and score (Shortcut: a)".
1118
Edwin Kempine326a1d2015-06-03 10:27:39 +02001119[[changeCleanup]]
1120=== Section changeCleanup
1121
1122This section allows to configure change cleanups and schedules them to
1123run periodically.
1124
1125[[changeCleanup.abandonAfter]]changeCleanup.abandonAfter::
1126+
1127Period of inactivity after which open changes should be abandoned
1128automatically.
1129+
1130By default `0`, never abandon open changes.
1131+
1132[WARNING] Auto-Abandoning changes may confuse/annoy users. When
1133enabling this, make sure to choose a reasonably large grace period and
1134inform users in advance.
1135+
1136The following suffixes are supported to define the time unit:
1137+
1138* `d, day, days`
1139* `w, week, weeks` (`1 week` is treated as `7 days`)
1140* `mon, month, months` (`1 month` is treated as `30 days`)
1141* `y, year, years` (`1 year` is treated as `365 days`)
1142
Edwin Kempin7080ef12015-06-10 15:03:09 +02001143[[changeCleanup.abandonIfMergeable]]changeCleanup.abandonIfMergeable::
1144+
1145Whether changes which are mergeable should be auto-abandoned.
1146+
1147By default `true`.
1148
Edwin Kempine326a1d2015-06-03 10:27:39 +02001149[[changeCleanup.abandonMessage]]changeCleanup.abandonMessage::
1150+
1151Change message that should be posted when a change is abandoned.
1152+
1153'${URL}' can be used as a placeholder for the Gerrit web URL.
1154+
1155By default "Auto-Abandoned due to inactivity, see
1156${URL}Documentation/user-change-cleanup.html#auto-abandon\n\n
1157If this change is still wanted it should be restored.".
1158
1159[[changeCleanup.startTime]]changeCleanup.startTime::
1160+
1161Start time to define the first execution of the change cleanups.
1162If the configured `'changeCleanup.interval'` is shorter than
1163`'changeCleanup.startTime - now'` the start time will be preponed by
1164the maximum integral multiple of `'changeCleanup.interval'` so that the
1165start time is still in the future.
1166+
1167----
1168<day of week> <hours>:<minutes>
1169or
1170<hours>:<minutes>
1171
1172<day of week> : Mon, Tue, Wed, Thu, Fri, Sat, Sun
1173<hours> : 00-23
1174<minutes> : 0-59
1175----
1176
1177
1178[[changeCleanup.interval]]changeCleanup.interval::
1179+
1180Interval for periodic repetition of triggering the change cleanups.
1181The interval must be larger than zero. The following suffixes are supported
1182to define the time unit for the interval:
1183+
1184* `s, sec, second, seconds`
1185* `m, min, minute, minutes`
1186* `h, hr, hour, hours`
1187* `d, day, days`
1188* `w, week, weeks` (`1 week` is treated as `7 days`)
1189* `mon, month, months` (`1 month` is treated as `30 days`)
1190* `y, year, years` (`1 year` is treated as `365 days`)
1191
1192link:#schedule-examples[Schedule examples] can be found in the
1193link:#gc[gc] section.
1194
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001195[[changeMerge]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001196=== Section changeMerge
carloseduardo.baldacin14246de2011-07-14 17:52:22 -03001197
Edwin Kempin42d27432013-11-24 17:06:24 +01001198[[changeMerge.checkFrequency]]changeMerge.checkFrequency::
Dave Borowitz204669c2012-10-11 11:06:08 -07001199+
1200How often the database should be rescanned for changes that have been
1201submitted but not merged due to transient errors. Values can be
1202specified using standard time unit abbreviations ('ms', 'sec', 'min',
1203etc.). Set to 0 to disable periodic rescanning, only scanning once on
1204master node startup.
1205+
1206Default is 300 seconds (5 minutes).
1207
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001208[[commentlink]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001209=== Section commentlink
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001210
Brad Larson991a31b2009-11-03 14:30:26 -06001211Comment links are find/replace strings applied to change descriptions,
Chris Harris63c7cdd2012-11-23 12:17:36 -05001212patch comments, in-line code comments and approval category value descriptions
1213to turn set strings into hyperlinks. One common use is for linking to
1214bug-tracking systems.
Brad Larson991a31b2009-11-03 14:30:26 -06001215
1216In the following example configuration the 'changeid' comment link
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001217will match typical Gerrit Change-Id values and create a hyperlink
1218to changes which reference it. The second configuration 'bugzilla'
1219will hyperlink terms such as 'bug 42' to an external bug tracker,
1220supplying the argument record number '42' for display. The third
David Pursehouse221d4f62012-06-08 17:38:08 +09001221configuration 'tracker' uses raw HTML to more precisely control
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001222how the replacement is displayed to the user.
Brad Larson991a31b2009-11-03 14:30:26 -06001223
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001224----
1225[commentlink "changeid"]
1226 match = (I[0-9a-f]{8,40})
David Pursehouse9f68e1a2016-01-28 09:21:03 +00001227 link = "#/q/$1"
Brad Larson991a31b2009-11-03 14:30:26 -06001228
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001229[commentlink "bugzilla"]
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001230 match = "(bug\\s+#?)(\\d+)"
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001231 link = http://bugs.example.com/show_bug.cgi?id=$2
Brad Larson991a31b2009-11-03 14:30:26 -06001232
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001233[commentlink "tracker"]
1234 match = ([Bb]ug:\\s+)(\\d+)
1235 html = $1<a href=\"http://trak.example.com/$2\">$2</a>
1236----
1237
Dave Borowitz13b38002013-04-08 12:03:29 -07001238Comment links can also be specified in `project.config` and sections in
1239children override those in parents. The only restriction is that to
1240avoid injecting arbitrary user-supplied HTML in the page, comment links
1241defined in `project.config` may only supply `link`, not `html`.
1242
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001243[[commentlink.name.match]]commentlink.<name>.match::
Brad Larson991a31b2009-11-03 14:30:26 -06001244+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001245A JavaScript regular expression to match positions to be replaced
1246with a hyperlink. Subexpressions of the matched string can be
1247stored using groups and accessed with `$'n'` syntax, where 'n'
1248is the group number, starting from 1.
Brad Larson991a31b2009-11-03 14:30:26 -06001249+
Shawn O. Pearcec99630a2010-02-21 19:11:56 -08001250The configuration file parser eats one level of backslashes, so the
1251character class `\s` requires `\\s` in the configuration file. The
1252parser also terminates the line at the first `#`, so a match
1253expression containing # must be wrapped in double quotes.
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001254+
Shawn O. Pearce665beaa2010-02-21 22:41:03 -08001255To match case insensitive strings, a character class with both the
1256upper and lower case character for each position must be used. For
1257example, to match the string `bug` in a case insensitive way the match
1258pattern `[bB][uU][gG]` needs to be used.
1259+
Matthew Webbercd7d2bf2015-10-14 15:54:06 +01001260The regular expression pattern is applied to the HTML form of the message
1261in question, which means it needs to assume the data has been escaped.
1262So `"` needs to be matched as `&amp;quot;`, `<` as `&amp;lt;`, and `'` as
1263`&amp;#39;`.
1264+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001265A common pattern to match is `bug\\s+(\\d+)`.
Brad Larson991a31b2009-11-03 14:30:26 -06001266
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001267[[commentlink.name.link]]commentlink.<name>.link::
Brad Larson991a31b2009-11-03 14:30:26 -06001268+
Shawn O. Pearceda866ae2009-12-16 15:46:03 -08001269The URL to direct the user to whenever the regular expression is
1270matched. Groups in the match expression may be accessed as `$'n'`.
1271+
1272The link property is used only when the html property is not present.
1273
1274[[commentlink.name.html]]commentlink.<name>.html::
1275+
1276HTML to replace the entire matched string with. If present,
1277this property overrides the link property above. Groups in the
1278match expression may be accessed as `$'n'`.
1279+
1280The configuration file eats double quotes, so escaping them as
1281`\"` is necessary to protect them from the parser.
Brad Larson991a31b2009-11-03 14:30:26 -06001282
Dave Borowitz82d79c02013-04-08 15:45:12 -07001283[[commentlink.name.enabled]]commentlink.<name>.enabled::
1284+
1285Whether the comment link is enabled. A child project may override a
1286section in a parent or the site-wide config that is disabled by
1287specifying `enabled = true`.
1288+
1289Disabling sections in `gerrit.config` can be used by site administrators
1290to create a library of comment links with `html` set that are not
1291user-supplied and thus can be verified to be XSS-free, but are only
1292enabled for a subset of projects.
1293+
David Pursehouse6f1af472013-12-11 19:23:33 +09001294By default, true.
1295+
Dave Borowitz82d79c02013-04-08 15:45:12 -07001296Note that the names and contents of disabled sections are visible even
1297to anonymous users via the
1298link:rest-api-projects.html#get-config[REST API].
1299
Brad Larson991a31b2009-11-03 14:30:26 -06001300
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001301[[container]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001302=== Section container
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001303
1304These settings are applied only if Gerrit is started as the container
1305process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
1306
1307[[container.heapLimit]]container.heapLimit::
1308+
1309Maximum heap size of the Java process running Gerrit, in bytes.
1310This property is translated into the '-Xmx' flag for the JVM.
1311+
1312Default is platform and JVM specific.
1313+
1314Common unit suffixes of 'k', 'm', or 'g' are supported.
1315
1316[[container.javaHome]]container.javaHome::
1317+
1318Path of the JRE/JDK installation to run Gerrit with. If not set, the
1319Gerrit startup script will attempt to search your system and guess
1320a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
1321
1322[[container.javaOptions]]container.javaOptions::
1323+
1324Additional options to pass along to the Java runtime. If multiple
1325values are configured, they are passed in order on the command line,
1326separated by spaces. These options are appended onto 'JAVA_OPTIONS'.
1327
David Ostrovskyc772bd82013-10-03 10:37:51 +02001328For example, it is possible to overwrite Gerrit's default log4j
1329configuration:
1330
1331----
1332 javaOptions = -Dlog4j.configuration=file:///home/gerrit/site/etc/log4j.properties
1333----
1334
Hugo Arès6710f0a2014-11-04 10:28:42 -05001335[[container.daemonOpt]]container.daemonOpt::
1336+
1337Additional options to pass to the daemon (e.g. '--enable-httpd'). If
1338multiple values are configured, they are passed in that order to the command
1339line, separated by spaces.
1340+
1341Execute `java -jar gerrit.war daemon --help` to see all possible
1342options.
1343
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001344[[container.slave]]container.slave::
1345+
1346Used on Gerrit slave installations. If set to true the Gerrit JVM is
1347called with the '--slave' switch, enabling slave mode. If no value is
Matt Baker8ce12fc2013-11-26 21:43:12 -07001348set (or any other value), Gerrit defaults to master mode.
Fredrik Luthanderb8f7d6d2010-05-18 21:11:22 +02001349
Khai Do6168beb2016-12-19 17:26:28 -08001350[[container.startupTimeout]]container.startupTimeout::
1351+
1352The maximum time (in seconds) to wait for a gerrit.sh start command
1353to run a new Gerrit daemon successfully. If not set, defaults to
135490 seconds.
1355
Shawn O. Pearcee24c71fb2009-12-07 20:32:40 -08001356[[container.user]]container.user::
1357+
1358Login name (or UID) of the operating system user the Gerrit JVM
1359will execute as. If not set, defaults to the user who launched
1360the 'gerrit.sh' wrapper script.
1361
1362[[container.war]]container.war::
1363+
1364Path of the JAR file to start daemon execution with. This should
1365be the path of the local 'gerrit.war' archive. Overrides the
1366environment variable 'GERRIT_WAR'.
1367+
1368If not set, defaults to '$site_path/bin/gerrit.war', or to
1369'$HOME/gerrit.war'.
1370
1371
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001372[[core]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001373=== Section core
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001374
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001375[[core.packedGitWindowSize]]core.packedGitWindowSize::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001376+
1377Number of bytes of a pack file to load into memory in a single
1378read operation. This is the "page size" of the JGit buffer cache,
1379used for all pack access operations. All disk IO occurs as single
1380window reads. Setting this too large may cause the process to load
1381more data than is required; setting this too small may increase
1382the frequency of `read()` system calls.
1383+
1384Default on JGit is 8 KiB on all platforms.
1385+
1386Common unit suffixes of 'k', 'm', or 'g' are supported.
1387
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001388[[core.packedGitLimit]]core.packedGitLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001389+
1390Maximum number of bytes to load and cache in memory from pack files.
1391If JGit needs to access more than this many bytes it will unload less
1392frequently used windows to reclaim memory space within the process.
1393As this buffer must be shared with the rest of the JVM heap, it
1394should be a fraction of the total memory available.
1395+
1396Default on JGit is 10 MiB on all platforms.
1397+
1398Common unit suffixes of 'k', 'm', or 'g' are supported.
1399
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001400[[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001401+
1402Maximum number of bytes to reserve for caching base objects
1403that multiple deltafied objects reference. By storing the entire
1404decompressed base object in a cache Git is able to avoid unpacking
1405and decompressing frequently used base objects multiple times.
1406+
1407Default on JGit is 10 MiB on all platforms. You probably do not
1408need to adjust this value.
1409+
1410Common unit suffixes of 'k', 'm', or 'g' are supported.
1411
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001412[[core.packedGitOpenFiles]]core.packedGitOpenFiles::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001413+
1414Maximum number of pack files to have open at once. A pack file
1415must be opened in order for any of its data to be available in
1416a cached window.
1417+
1418If you increase this to a larger setting you may need to also adjust
1419the ulimit on file descriptors for the host JVM, as Gerrit needs
1420additional file descriptors available for network sockets and other
1421repository data manipulation.
1422+
1423Default on JGit is 128 file descriptors on all platforms.
1424
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001425[[core.streamFileThreshold]]core.streamFileThreshold::
1426+
1427Largest object size, in bytes, that JGit will allocate as a
1428contiguous byte array. Any file revision larger than this threshold
1429will have to be streamed, typically requiring the use of temporary
David Pursehouse92463562013-06-24 10:16:28 +09001430files under '$GIT_DIR/objects' to implement pseudo-random access
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001431during delta decompression.
1432+
1433Servers with very high traffic should set this to be larger than
1434the size of their common big files. For example a server managing
1435the Android platform typically has to deal with ~10-12 MiB XML
1436files, so `15 m` would be a reasonable setting in that environment.
1437Setting this too high may cause the JVM to run out of heap space
1438when handling very big binary files, such as device firmware or
1439CD-ROM ISO images.
1440+
Edwin Kempin7f5a4af2014-11-12 10:05:03 +01001441Defaults to 25% of the available JVM heap, limited to 2048m.
Shawn O. Pearce329fe792010-09-03 15:44:23 -07001442+
1443Common unit suffixes of 'k', 'm', or 'g' are supported.
1444
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001445[[core.packedGitMmap]]core.packedGitMmap::
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001446+
1447When true, JGit will use `mmap()` rather than `malloc()+read()`
1448to load data from pack files. The use of mmap can be problematic
1449on some JVMs as the garbage collector must deduce that a memory
1450mapped segment is no longer in use before a call to `munmap()`
1451can be made by the JVM native code.
1452+
1453In server applications (such as Gerrit) that need to access many
David Pursehouse92463562013-06-24 10:16:28 +09001454pack files, setting this to true risks artificially running out
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -07001455of virtual address space, as the garbage collector cannot reclaim
1456unused mapped spaces fast enough.
1457+
1458Default on JGit is false. Although potentially slower, it yields
1459much more predictable behavior.
1460
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001461[[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
1462+
1463Size of the buffer to store logging events for asynchronous logging.
1464Putting a larger value can protect threads from stalling when the
1465AsyncAppender threads are not fast enough to consume the logging events
David Pursehouse1ff91c02015-05-19 15:05:26 +09001466from the buffer. It also protects from losing log entries in this case.
Sasa Zivkovf69aeb12012-06-11 14:05:14 +02001467+
1468Default is 64 entries.
1469
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001470[[core.useRecursiveMerge]]core.useRecursiveMerge::
1471+
Edwin Kempin71831d22014-07-15 08:54:29 +02001472Use JGit's recursive merger for three-way merges. This only affects
Sebastian Schuberth774aac92015-04-16 13:21:04 +02001473projects that allow content merges.
Edwin Kempin71831d22014-07-15 08:54:29 +02001474+
1475As explained in this
1476link:http://codicesoftware.blogspot.com/2011/09/merge-recursive-strategy.html[
1477blog], the recursive merge produces better results if the two commits
1478that are merged have more than one common predecessor.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001479+
Edwin Kempin7853c5b2014-07-15 08:57:17 +02001480Default is true.
Dave Borowitz1bec65a2013-03-13 10:59:01 -07001481
Hugo Arès47344372016-06-27 10:23:17 -04001482[[core.repositoryCacheCleanupDelay]]core.repositoryCacheCleanupDelay::
1483+
1484Delay between each periodic cleanup of expired repositories.
1485+
1486Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1487`min`, etc.).
1488+
1489Set it to 0 in order to switch off cache expiration. If cache expiration is
1490switched off, the JVM can still evict cache entries when it is running low
1491on available heap memory.
1492+
1493Set it to -1 to automatically derive cleanup delay from
1494`core.repositoryCacheExpireAfter` (lowest value between 1/10 of
1495`core.repositoryCacheExpireAfter` and 10 minutes).
1496+
1497Default is -1.
1498
1499[[core.repositoryCacheExpireAfter]]core.repositoryCacheExpireAfter::
1500+
1501Time an unused repository should expire and be evicted from the repository
1502cache.
1503+
1504Values can be specified using standard time unit abbreviations (`ms`, `sec`,
1505`min`, etc.).
1506+
1507Default is 1 hour.
1508
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001509[[database]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001510=== Section database
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001511
1512The database section configures where Gerrit stores its metadata
1513records about user accounts and change reviews.
1514
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001515----
1516[database]
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001517 type = POSTGRESQL
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08001518 hostname = localhost
1519 database = reviewdb
1520 username = gerrit2
1521 password = s3kr3t
1522----
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001523
1524[[database.type]]database.type::
1525+
1526Type of database server to connect to. If set this value will be
1527used to automatically create correct database.driver and database.url
1528values to open the connection.
1529+
David Pursehouse227e4032016-02-26 15:47:14 +09001530* `DB2`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001531+
David Pursehouse227e4032016-02-26 15:47:14 +09001532Connect to a DB2 database server.
1533+
1534* `DERBY`
1535+
1536Connect to an Apache Derby database server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001537+
1538* `H2`
1539+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001540Connect to a local embedded H2 database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001541+
David Pursehouse4f859e72016-02-26 15:44:38 +09001542* `JDBC`
1543+
1544Connect using a JDBC driver class name and URL.
1545+
David Pursehouse227e4032016-02-26 15:47:14 +09001546* `MAXDB`
1547+
David Pursehouse9166dd12016-11-15 16:02:02 -08001548Connect to an SAP MaxDB database server.
David Pursehouse227e4032016-02-26 15:47:14 +09001549+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001550* `MYSQL`
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001551+
1552Connect to a MySQL database server.
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001553+
David Pursehouse227e4032016-02-26 15:47:14 +09001554* `ORACLE`
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001555+
David Pursehouse227e4032016-02-26 15:47:14 +09001556Connect to an Oracle database server.
1557+
David Pursehouse4f859e72016-02-26 15:44:38 +09001558* `POSTGRESQL`
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001559+
David Pursehouse4f859e72016-02-26 15:44:38 +09001560Connect to a PostgreSQL database server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001561
1562+
1563If not specified, database.driver and database.url are used as-is,
1564and if they are also not specified, defaults to H2.
1565
1566[[database.hostname]]database.hostname::
1567+
1568Hostname of the database server. Defaults to 'localhost'.
1569
1570[[database.port]]database.port::
1571+
1572Port number of the database server. Defaults to the default port
1573of the server named by database.type.
1574
1575[[database.database]]database.database::
1576+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001577For POSTGRESQL or MYSQL, the name of the database on the server.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001578+
1579For H2, this is the path to the database, and if not absolute is
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001580relative to `'$site_path'`.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001581
1582[[database.username]]database.username::
1583+
1584Username to connect to the database server as.
1585
1586[[database.password]]database.password::
1587+
1588Password to authenticate to the database server with.
1589
1590[[database.driver]]database.driver::
1591+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001592Name of the JDBC driver class to connect to the database with.
1593Setting this usually isn't necessary as it can be derived from
1594database.type or database.url for any supported database.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001595
1596[[database.url]]database.url::
1597+
Shawn O. Pearce1be39062009-12-19 14:11:52 -08001598'jdbc:' URL for the database. Setting this variable usually
1599isn't necessary as it can be constructed from the all of the
1600above properties.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001601
Christian Aistleitner851072a2013-05-05 15:04:09 +02001602[[database.connectionPool]]database.connectionPool::
1603+
1604If true, use connection pooling for database connections. Otherwise, a
1605new database connection is opened for each request.
1606+
1607Default is false for MySQL, and true for other database backends.
1608
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001609[[database.poolLimit]]database.poolLimit::
1610+
1611Maximum number of open database connections. If the server needs
1612more than this number, request processing threads will wait up
1613to <<database.poolMaxWait, poolMaxWait>> seconds for a
1614connection to be released before they abort with an exception.
1615This limit must be several units higher than the total number of
1616httpd and sshd threads as some request processing code paths may
1617need multiple connections.
1618+
Dariusz Luksza2ebfc282015-11-09 20:25:25 +01001619Default is <<sshd.threads, sshd.threads>>
1620 + <<httpd.maxThreads, httpd.maxThreads>> + 2.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001621+
1622This setting only applies if
1623<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001624
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001625[[database.poolMinIdle]]database.poolMinIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001626+
1627Minimum number of connections to keep idle in the pool.
1628Default is 4.
Christian Aistleitner851072a2013-05-05 15:04:09 +02001629+
1630This setting only applies if
1631<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001632
Shawn O. Pearcef458bf62010-02-25 09:03:03 -08001633[[database.poolMaxIdle]]database.poolMaxIdle::
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001634+
1635Maximum number of connections to keep idle in the pool. If there
1636are more idle connections, connections will be closed instead of
1637being returned back to the pool.
Dariusz Luksza30d70ae2015-11-09 22:19:59 +01001638Default is min(<<database.poolLimit, database.poolLimit>>, 16).
Christian Aistleitner851072a2013-05-05 15:04:09 +02001639+
1640This setting only applies if
1641<<database.connectionPool,database.connectionPool>> is true.
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001642
1643[[database.poolMaxWait]]database.poolMaxWait::
1644+
1645Maximum amount of time a request processing thread will wait to
1646acquire a database connection from the pool. If no connection is
1647released within this time period, the processing thread will abort
1648its current operations and return an error to the client.
1649Values should use common unit suffixes to express their setting:
1650+
1651* ms, milliseconds
1652* s, sec, second, seconds
1653* m, min, minute, minutes
1654* h, hr, hour, hours
1655
1656+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001657--
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001658If a unit suffix is not specified, `milliseconds` is assumed.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001659
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001660Default is `30 seconds`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001661
Christian Aistleitner851072a2013-05-05 15:04:09 +02001662This setting only applies if
1663<<database.connectionPool,database.connectionPool>> is true.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02001664--
Shawn O. Pearce07f35177d2010-02-23 09:47:10 -08001665
David Ostrovsky38a6f6c2014-01-11 13:56:09 +01001666[[database.dataSourceInterceptorClass]]database.dataSourceInterceptorClass::
1667
1668Class that implements DataSourceInterceptor interface to monitor SQL activity.
1669This class must have default constructor and be available on Gerrit's bootstrap
1670classpath, e. g. in `$gerrit_site/lib` directory. Example implementation of
1671SQL monitoring can be found in javamelody-plugin.
1672
Björn Pedersen64af3ad2016-05-20 10:21:07 +02001673[[database.h2]]database.h2::
1674+
1675The settings in this section are used for the reviewdb if the
1676<<database.type,database.type>> is H2.
1677+
1678Additionally gerrit uses H2 for storing reviewed flags on changes.
1679
1680[[database.h2.cacheSize]]database.h2.cacheSize::
1681+
1682The size of the H2 internal database cache, in bytes. The H2 internal cache for
1683persistent H2-backed caches is controlled by
1684<<cache.h2CacheSize,cache.h2CacheSize>>.
1685+
1686H2 uses memory to cache its database content. The parameter `cacheSize`
1687allows to limit the memory used by H2 and thus prevent out-of-memory
1688caused by the H2 database using too much memory.
1689+
1690Technically the H2 cache size is configured using the CACHE_SIZE parameter in
1691the H2 JDBC connection URL, as described
1692link:http://www.h2database.com/html/features.html#cache_settings[here]
1693+
1694Default is unset, using up to half of the available memory.
1695
1696H2 will persist this value in the database, so to unset explicitly specify 0.
1697+
1698Common unit suffixes of 'k', 'm', or 'g' are supported.
1699
1700[[database.h2.autoServer]]database.h2.autoServer::
1701+
1702If `true` enable the automatic mixed mode
1703(see link:http://www.h2database.com/html/features.html#auto_mixed_mode[Automatic Mixed Mode]).
1704This enables concurrent access to the embedded H2 database from command line
1705utils (e.g. RebuildNoteDb).
1706+
1707Default is `false`.
1708
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001709[[download]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001710=== Section download
monica.dionisio3f630442010-06-29 15:42:57 -03001711
1712----
1713[download]
Edwin Kempin08b03a22012-09-14 16:32:57 +02001714 command = checkout
1715 command = cherry_pick
1716 command = pull
1717 command = format_patch
monica.dionisio3f630442010-06-29 15:42:57 -03001718 scheme = ssh
1719 scheme = http
1720 scheme = anon_http
1721 scheme = anon_git
1722 scheme = repo_download
1723----
1724
1725The download section configures the allowed download methods.
1726
Edwin Kempin08b03a22012-09-14 16:32:57 +02001727[[download.command]]download.command::
1728+
1729Commands that should be offered to download changes.
1730+
1731Multiple commands are supported:
1732+
1733* `checkout`
1734+
1735Command to fetch and checkout the patch set.
1736+
1737* `cherry_pick`
1738+
1739Command to fetch the patch set and to cherry-pick it onto the current
1740commit.
1741+
1742* `pull`
1743+
1744Command to pull the patch set.
1745+
1746* `format_patch`
1747+
1748Command to fetch the patch set and to feed it into the `format-patch`
1749command.
1750
1751+
1752If `download.command` is not specified, all download commands are
1753offered.
1754
monica.dionisio3f630442010-06-29 15:42:57 -03001755[[download.scheme]]download.scheme::
1756+
1757Schemes that should be used to download changes.
1758+
1759Multiple schemes are supported:
1760+
1761* `http`
1762+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001763Authenticated HTTP download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001764+
1765* `ssh`
1766+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001767Authenticated SSH download is allowed.
monica.dionisio3f630442010-06-29 15:42:57 -03001768+
1769* `anon_http`
1770+
1771Anonymous HTTP download is allowed.
1772+
1773* `anon_git`
1774+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001775Anonymous Git download is allowed. This is not default, it is also
1776necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
1777variable.
monica.dionisio3f630442010-06-29 15:42:57 -03001778+
1779* `repo_download`
1780+
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001781Gerrit advertises patch set downloads with the `repo download`
1782command, assuming that all projects managed by this instance are
1783generally worked on with the repo multi-repository tool. This is
1784not default, as not all instances will deploy repo.
monica.dionisio3f630442010-06-29 15:42:57 -03001785
1786+
Edwin Kempin08b03a22012-09-14 16:32:57 +02001787If `download.scheme` is not specified, SSH, HTTP and Anonymous HTTP
Shawn O. Pearce5c46a072010-08-23 08:33:32 -07001788downloads are allowed.
Shawn O. Pearcefb5548e2009-11-11 07:39:21 -08001789
Edwin Kempin322db672015-07-03 08:50:46 +02001790[[download.checkForHiddenChangeRefs]]download.checkForHiddenChangeRefs::
1791+
1792Whether the download commands should be adapted when the change refs
1793are hidden.
1794+
1795Git has a configuration option to hide refs from the initial
1796advertisement (`uploadpack.hideRefs`). This option can be used to hide
1797the change refs from the client. As consequence fetching changes by
1798change ref does not work anymore. However by setting
1799`uploadpack.allowTipSha1InWant` to `true` fetching changes by commit ID
1800is possible. If `download.checkForHiddenChangeRefs` is set to `true`
1801the git download commands use the commit ID instead of the change ref
1802when a project is configured like this.
1803+
1804Example git configuration on a project:
1805+
1806----
1807[uploadpack]
1808 hideRefs = refs/changes/
1809 hideRefs = refs/cache-automerge/
1810 allowTipSha1InWant = true
1811----
1812+
1813By default `false`.
1814
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001815[[download.archive]]download.archive::
1816+
1817Specifies which archive formats, if any, should be offered on the change
Francois Ferrand1e933882014-09-25 11:19:08 +02001818screen and supported for `git-upload-archive` operation:
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001819+
1820----
1821[download]
1822 archive = tar
1823 archive = tbz2
1824 archive = tgz
1825 archive = txz
Francois Ferrand1e933882014-09-25 11:19:08 +02001826 archive = zip
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001827----
1828
Shawn Pearce6edde312014-03-26 22:00:26 -07001829If `download.archive` is not specified defaults to all archive
1830commands. Set to `off` or empty string to disable.
David Ostrovskyfc9cdf02014-03-26 14:46:45 -07001831
Francois Ferrand1e933882014-09-25 11:19:08 +02001832Zip is not supported because it may be interpreted by a Java plugin as a
1833valid JAR file, whose code would have access to cookies on the domain.
1834For this reason `zip` format is always excluded from formats offered
1835through the `Download` drop down or accessible in the REST API.
1836
Stefan Bellere1b2ad32016-11-29 14:54:13 -08001837[[download.maxBundleSize]]download.maxBundleSize::
1838+
1839Specifies the maximum size of a bundle in bytes that can be downloaded.
1840As bundles are kept in memory this setting is to protect the server
1841from a single request consuming too much heap when generating
1842a bundle and thereby impacting other users.
1843+
1844Defaults to 100MB.
1845
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001846[[gc]]
1847=== Section gc
1848
1849This section allows to configure the git garbage collection and schedules it
1850to run periodically. It will be triggered and executed sequentially for all
1851projects.
1852
Christian Halstricke6c68322015-03-11 15:21:42 +01001853[[gc.aggressive]]gc.aggressive::
1854+
1855Determines if scheduled garbage collections and garbage collections triggered
1856through Web-UI should run in aggressive mode or not. Aggressive garbage
1857collections are more expensive but may lead to significantly smaller
1858repositories.
1859+
1860Valid values are "true" and "false," default is "false".
1861
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001862[[gc.startTime]]gc.startTime::
1863+
1864Start time to define the first execution of the git garbage collection.
1865If the configured `'gc.interval'` is shorter than `'gc.startTime - now'`
1866the start time will be preponed by the maximum integral multiple of
1867`'gc.interval'` so that the start time is still in the future.
1868+
1869----
1870<day of week> <hours>:<minutes>
1871or
1872<hours>:<minutes>
1873
1874<day of week> : Mon, Tue, Wed, Thu, Fri, Sat, Sun
1875<hours> : 00-23
1876<minutes> : 0-59
1877----
1878
1879
1880[[gc.interval]]gc.interval::
1881+
1882Interval for periodic repetition of triggering the git garbage collection.
1883The interval must be larger than zero. The following suffixes are supported
1884to define the time unit for the interval:
1885+
1886* `s, sec, second, seconds`
1887* `m, min, minute, minutes`
1888* `h, hr, hour, hours`
1889* `d, day, days`
1890* `w, week, weeks` (`1 week` is treated as `7 days`)
1891* `mon, month, months` (`1 month` is treated as `30 days`)
1892* `y, year, years` (`1 year` is treated as `365 days`)
1893
Edwin Kempine326a1d2015-06-03 10:27:39 +02001894[[schedule-examples]]
Matthias Sohn0fb2c992014-06-03 01:42:59 +02001895Examples::
1896+
1897----
1898gc.startTime = Fri 10:30
1899gc.interval = 2 day
1900----
1901+
1902Assuming the server is started on Mon 7:00 -> `'startTime - now = 4 days 3:30 hours'`.
1903This is larger than the interval hence prepone the start time
1904by the maximum integral multiple of the interval so that start
1905time is still in the future, i.e. prepone by 4 days. This yields
1906a start time of Mon 10:30, next executions are Wed 10:30, Fri 10:30
1907etc.
1908+
1909----
1910gc.startTime = 6:00
1911gc.interval = 1 day
1912----
1913+
1914Assuming the server is started on Mon 7:00 this yields the first run on next Tuesday
1915at 6:00 and a repetition interval of 1 day.
1916
1917
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08001918[[gerrit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001919=== Section gerrit
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001920
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001921[[gerrit.basePath]]gerrit.basePath::
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001922+
1923Local filesystem directory holding all Git repositories that
1924Gerrit knows about and can process changes for. A project
1925entity in Gerrit maps to a local Git repository by creating
Edwin Kempincdb0e002011-09-08 14:23:30 +02001926the path string `"${basePath}/${project_name}.git"`.
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -07001927+
1928If relative, the path is resolved relative to `'$site_path'`.
1929
Shawn O. Pearce897d9212011-06-16 16:59:59 -07001930[[gerrit.allProjects]]gerrit.allProjects::
1931+
1932Name of the permissions-only project defining global server
1933access controls and settings. These are inherited into every
1934other project managed by the running server. The name is
1935relative to `gerrit.basePath`.
1936+
1937Defaults to `All-Projects` if not set.
1938
Edwin Kempin2bf5edd2014-03-25 22:21:23 +01001939[[gerrit.allUsers]]gerrit.allUsers::
1940+
1941Name of the project in which meta data of all users is stored.
1942The name is relative to `gerrit.basePath`.
1943+
1944Defaults to `All-Users` if not set.
1945
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001946[[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001947+
1948The default URL for Gerrit to be accessed through.
1949+
Sebastian Schuberth64037132016-07-28 13:40:16 +02001950Typically this would be set to something like "http://review.example.com/"
1951or "http://example.com:8080/gerrit/" so Gerrit can output links that point
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001952back to itself.
1953+
1954Setting this is highly recommended, as its necessary for the upload
1955code invoked by "git push" or "repo upload" to output hyperlinks
1956to the newly uploaded changes.
1957
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07001958[[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -07001959+
1960Optional base URL for repositories available over the anonymous git
1961protocol. For example, set this to `git://mirror.example.com/base/`
1962to have Gerrit display patch set download URLs in the UI. Gerrit
1963automatically appends the project name onto the end of the URL.
1964+
1965By default unset, as the git daemon must be configured externally
1966by the system administrator, and might not even be running on the
1967same host as Gerrit.
1968
Dave Borowitza5d3fec2015-07-09 14:24:02 -07001969[[gerrit.docUrl]]gerrit.docUrl::
1970+
1971Optional base URL for documentation, under which one can find
1972"index.html", "rest-api.html", etc. Used as the base for the fixed set
1973of links in the "Documentation" tab. A slash is implicitly appended.
1974(For finer control over the top menu, consider writing a
1975link:dev-plugins.html#top-menu-extensions[plugin].)
1976+
1977If unset or empty, the documentation tab will only be shown if
1978`/Documentation/index.html` can be reached by the browser at app load
1979time.
1980
Dave Borowitza17a9842015-09-15 09:58:17 -04001981[[gerrit.editGpgKeys]]gerrit.editGpgKeys::
1982+
1983If enabled and server-side signed push validation is also
1984link:#receive.enableSignedPush[enabled], enable the
1985link:rest-api-accounts.html#list-gpg-keys[REST API endpoints] and web UI
1986for editing GPG keys. If disabled, GPG keys can only be added by
1987administrators with direct git access to All-Users.
1988+
1989Defaults to true.
1990
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001991[[gerrit.installCommitMsgHookCommand]]gerrit.installCommitMsgHookCommand::
1992+
1993Optional command to install the `commit-msg` hook. Typically of the
1994form:
David Pursehouse05588e52015-01-07 14:25:11 +09001995+
Dave Borowitz76ab1a12013-05-10 17:01:29 +01001996----
1997fetch-cmd some://url/to/commit-msg .git/hooks/commit-msg ; chmod +x .git/hooks/commit-msg
1998----
1999+
2000By default unset; falls back to using scp from the canonical SSH host,
2001or curl from the canonical HTTP URL for the server. Only necessary if a
2002proxy or other server/network configuration prevents clients from
2003fetching from the default location.
2004
Shawn O. Pearce5d6de522011-10-07 18:00:16 -07002005[[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
2006+
2007Optional base URL for repositories available over the HTTP
2008protocol. For example, set this to `http://mirror.example.com/base/`
2009to have Gerrit display URLs from this server, rather than itself.
2010+
2011By default unset, as the HTTP daemon must be configured externally
2012by the system administrator, and might not even be running on the
2013same host as Gerrit.
2014
Luca Milanesio62cc3502016-11-15 10:22:38 -08002015[[gerrit.installModule]]gerrit.installModule::
2016+
2017Repeatable list of class name of additional Guice modules to load at
2018Gerrit startup and init phases.
2019Classes are resolved using the primary Gerrit class loader, hence the
2020class needs to be either declared in Gerrit or an additional JAR
2021located under the `/lib` directory.
2022+
2023By default unset.
2024+
2025Example:
2026----
2027[gerrit]
2028 installModule = com.googlesource.gerrit.libmodule.MyModule
2029 installModule = com.example.abc.OurSpecialSauceModule
2030----
2031
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002032[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
2033+
David Pursehouse214ab862014-12-01 11:48:26 +09002034URL to direct users to when they need to report a bug.
2035+
2036By default unset, meaning no bug report URL will be displayed. Administrators
2037should set this to the URL of their issue tracker, if necessary.
Shawn O. Pearceb8bea1b2012-08-16 17:18:58 -07002038
David Pursehouse753ca332013-12-10 15:36:29 +09002039[[gerrit.reportBugText]]gerrit.reportBugText::
2040+
2041Text to be displayed in the link to the bug report URL.
2042+
David Pursehouse214ab862014-12-01 11:48:26 +09002043Only used when `gerrit.reportBugUrl` is set.
2044+
David Pursehouse753ca332013-12-10 15:36:29 +09002045Defaults to "Report Bug".
2046
Dariusz Luksza45ee73e2014-08-20 09:38:09 +02002047[[gerrit.disableReverseDnsLookup]]gerrit.disableReverseDnsLookup::
2048+
2049Disables reverse DNS lookup during computing ref log entry for identified user.
2050+
2051Defaults to false.
2052
David Pursehouse962e1182014-12-03 17:17:52 +09002053[[gerrit.secureStoreClass]]gerrit.secureStoreClass::
2054+
2055Use the secure store implementation from a specified class.
2056+
2057If specified, must be the fully qualified class name of a class that implements
2058the `com.google.gerrit.server.securestore.SecureStore` interface, and the jar
2059file containing the class must be placed in the `$site_path/lib` folder.
2060+
2061If not specified, the default no-op implementation is used.
2062
Dariusz Luksza7a046da2014-04-03 17:05:47 +02002063[[gerrit.canLoadInIFrame]]gerrit.canLoadInIFrame::
2064+
2065For security reasons Gerrit will always jump out of iframe.
2066Setting this option to true will prevent this behavior.
2067+
2068By default false.
2069
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002070[[gitweb]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002071=== Section gitweb
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002072
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002073Gerrit can forward requests to either an internally managed gitweb
2074(which allows Gerrit to enforce some access controls), or to an
2075externally managed gitweb (where the web server manages access).
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002076See also link:config-gitweb.html[Gitweb Integration].
2077
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002078[[gitweb.cgi]]gitweb.cgi::
2079+
2080Path to the locally installed `gitweb.cgi` executable. This CGI will
2081be called by Gerrit Code Review when the URL `/gitweb` is accessed.
2082Project level access controls are enforced prior to calling the CGI.
2083+
David Pursehousea89dc982016-09-15 09:35:44 +02002084Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if `gitweb.url` is not set.
Shawn O. Pearce618dae22010-03-12 19:07:43 -08002085
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002086[[gitweb.url]]gitweb.url::
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002087+
2088Optional URL of an affiliated gitweb service. Defines the
2089web location where a `gitweb.cgi` is installed to browse
David Pursehousea89dc982016-09-15 09:35:44 +02002090`gerrit.basePath` and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002091+
2092Gerrit appends any necessary query arguments onto the end of this URL.
David Pursehousea89dc982016-09-15 09:35:44 +02002093For example, `?p=$project.git;h=$commit`.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -07002094
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002095[[gitweb.type]]gitweb.type::
2096+
2097Optional type of affiliated gitweb service. This allows using
David Pursehousea66f7ff2016-09-05 21:11:10 +09002098alternatives to gitweb, such as cgit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002099+
Shawn O. Pearce2b11da02011-09-06 16:18:12 -07002100Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
David Pursehousea66f7ff2016-09-05 21:11:10 +09002101+
2102If not set, or set to `disabled`, there is no gitweb hyperlinking
2103support.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002104
Edwin Kempind86909c2012-03-26 10:36:29 +02002105[[gitweb.revision]]gitweb.revision::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002106+
2107Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002108at a specific commit when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002109+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002110Valid replacements are `${project}` for the project name in Gerrit
2111and `${commit}` for the SHA1 hash for the commit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002112
Edwin Kempind86909c2012-03-26 10:36:29 +02002113[[gitweb.project]]gitweb.project::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002114+
2115Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002116at a specific project when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002117+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002118Valid replacements are `${project}` for the project name in Gerrit.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002119
Edwin Kempind86909c2012-03-26 10:36:29 +02002120[[gitweb.branch]]gitweb.branch::
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002121+
2122Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002123at a specific branch when `gitweb.type` is set to `custom`.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002124+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002125Valid replacements are `${project}` for the project name in Gerrit
2126and `${branch}` for the name of the branch.
Shane Mc Cormack27868a42009-12-28 04:49:39 +00002127
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002128[[gitweb.roottree]]gitweb.roottree::
2129+
2130Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002131at the contents of the root tree in a specific commit when `gitweb.type`
2132is set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002133+
2134Valid replacements are `${project}` for the project name in Gerrit
2135and `${commit}` for the SHA1 hash for the commit.
2136
2137[[gitweb.file]]gitweb.file::
2138+
2139Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002140at the contents of a file in a specific commit when `gitweb.type` is
2141set to `custom`.
Colby Ranger79d4ebe2013-12-16 14:19:18 -08002142+
2143Valid replacements are `${project}` for the project name in Gerrit,
2144`${file}` for the file name and `${commit}` for the SHA1 hash for
2145the commit.
2146
Edwin Kempin64011562012-03-26 10:50:12 +02002147[[gitweb.filehistory]]gitweb.filehistory::
2148+
2149Optional pattern to use for constructing the gitweb URL when pointing
David Pursehousea89dc982016-09-15 09:35:44 +02002150at the history of a file in a specific branch when when `gitweb.type`
2151is set to `custom`.
Edwin Kempin64011562012-03-26 10:50:12 +02002152+
2153Valid replacements are `${project}` for the project name in Gerrit,
2154`${file}` for the file name and `${branch}` for the name of the
2155branch.
2156
Gustaf Lundha07d2e72011-10-27 15:26:35 -07002157[[gitweb.linkname]]gitweb.linkname::
2158+
2159Optional setting for modifying the link name presented to the user
2160in the Gerrit web-UI.
2161+
David Pursehousea89dc982016-09-15 09:35:44 +02002162The default linkname for custom type is `gitweb`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002163
Adrian Goerlerf2007072011-11-10 08:39:55 +01002164[[gitweb.pathSeparator]]gitweb.pathSeparator::
2165+
2166Optional character to substitute the standard path separator (slash) in
2167project names and branch names.
2168+
2169By default, Gerrit will use hexadecimal encoding for slashes in project and
2170branch names. Some web servers, such as Tomcat, reject this hexadecimal
2171encoding in the URL.
2172+
2173Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
2174allow using an alternative path separator character. In Gitblit, this can be
2175configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
2176In Gerrit, the alternative path separator can be configured correspondingly
David Pursehousea89dc982016-09-15 09:35:44 +02002177using the property `gitweb.pathSeparator`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002178+
David Pursehousea89dc982016-09-15 09:35:44 +02002179Valid values are the characters `*`, `(` and `)`.
Adrian Goerlerf2007072011-11-10 08:39:55 +01002180
David Pursehouse5d592e82016-06-09 05:12:26 +00002181[[gitweb.urlEncode]]gitweb.urlEncode::
Luca Milanesio25312032013-10-11 11:34:39 +01002182+
2183Whether or not Gerrit should encode the generated viewer URL.
2184+
2185Gerrit composes the viewer URL using information about the project, branch, file
2186or commit of the target object to be displayed. Typically viewers such as CGit
David Pursehousea89dc982016-09-15 09:35:44 +02002187and gitweb do need those parts to be encoded, including the `/` in project's name,
Luca Milanesio25312032013-10-11 11:34:39 +01002188for being correctly parsed.
2189However other viewers could instead require an unencoded URL (e.g. GitHub web
David Pursehousea89dc982016-09-15 09:35:44 +02002190based viewer).
Luca Milanesio25312032013-10-11 11:34:39 +01002191+
David Pursehousea89dc982016-09-15 09:35:44 +02002192Valid values are `true` and `false`. The default is `true`.
Luca Milanesio25312032013-10-11 11:34:39 +01002193
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002194[[groups]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002195=== Section groups
Edwin Kempin4bbff702013-01-11 09:59:53 +01002196
2197[[groups.newGroupsVisibleToAll]]groups.newGroupsVisibleToAll::
2198+
2199Controls whether newly created groups should be by default visible to
2200all registered users.
2201+
2202By default, false.
2203
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002204[[http]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002205=== Section http
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002206
2207[[http.proxy]]http.proxy::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002208+
2209URL of the proxy server when making outgoing HTTP
2210connections for OpenID login transactions. Syntax
2211should be `http://`'hostname'`:`'port'.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002212
2213[[http.proxyUsername]]http.proxyUsername::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002214+
2215Optional username to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002216This property is honored only if the username does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002217appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002218
2219[[http.proxyPassword]]http.proxyPassword::
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002220+
2221Optional password to authenticate to the HTTP proxy with.
Robin Rosenberg524a3032012-10-14 14:24:36 +02002222This property is honored only if the password does not
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002223appear in the http.proxy property above.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002224
Hugo Arès88e33ac2014-03-03 13:52:45 -05002225[[http.addUserAsRequestAttribute]]http.addUserAsRequestAttribute::
2226+
2227If true, 'User' attribute will be added to the request attributes so it
2228can be accessed outside the request scope (will be set to username or id
2229if username not configured).
2230+
2231This attribute can be used by the servlet container to log user in the
2232http access log.
2233+
2234When running the embedded servlet container, this attribute is used to
2235print user in the httpd_log.
2236+
2237* `%{User}r`
2238+
2239Pattern to print user in Tomcat AccessLog.
2240
2241+
2242Default value is true.
Shawn O. Pearce309d8d32009-11-17 16:03:16 -08002243
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002244[[httpd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002245=== Section httpd
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002246
2247The httpd section configures the embedded servlet container.
2248
2249[[httpd.listenUrl]]httpd.listenUrl::
2250+
2251Specifies the URLs the internal HTTP daemon should listen for
Edwin Kempincdb0e002011-09-08 14:23:30 +02002252connections on. The special hostname '*' may be used to listen
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002253on all local addresses. A context path may optionally be included,
2254placing Gerrit Code Review's web address within a subdirectory of
2255the server.
2256+
2257Multiple protocol schemes are supported:
2258+
2259* `http://`'hostname'`:`'port'
2260+
2261Plain-text HTTP protocol. If port is not supplied, defaults to 80,
2262the standard HTTP port.
2263+
2264* `https://`'hostname'`:`'port'
2265+
2266SSL encrypted HTTP protocol. If port is not supplied, defaults to
2267443, the standard HTTPS port.
2268+
2269Externally facing production sites are encouraged to use a reverse
2270proxy configuration and `proxy-https://` (below), rather than using
2271the embedded servlet container to implement the SSL processing.
2272The proxy server with SSL support is probably easier to configure,
2273provides more configuration options to control cipher usage, and
2274is likely using natively compiled encryption algorithms, resulting
2275in higher throughput.
2276+
2277* `proxy-http://`'hostname'`:`'port'
2278+
2279Plain-text HTTP relayed from a reverse proxy. If port is not
2280supplied, defaults to 8080.
2281+
2282Like http, but additional header parsing features are
2283enabled to honor X-Forwarded-For, X-Forwarded-Host and
2284X-Forwarded-Server. These headers are typically set by Apache's
2285link:http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers[mod_proxy].
2286+
2287* `proxy-https://`'hostname'`:`'port'
2288+
2289Plain text HTTP relayed from a reverse proxy that has already
2290handled the SSL encryption/decryption. If port is not supplied,
2291defaults to 8080.
2292+
2293Behaves exactly like proxy-http, but also sets the scheme to assume
2294'https://' is the proper URL back to the server.
2295
2296+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002297--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002298If multiple values are supplied, the daemon will listen on all
2299of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002300
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002301By default, http://*:8080.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002302--
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002303
2304[[httpd.reuseAddress]]httpd.reuseAddress::
2305+
2306If true, permits the daemon to bind to the port even if the port
2307is already in use. If false, the daemon ensures the port is not
2308in use before starting. Busy sites may need to set this to true
2309to permit fast restarts.
2310+
2311By default, true.
2312
2313[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
2314+
2315Size, in bytes, of the buffer used to parse the HTTP headers of an
2316incoming HTTP request. The entire request headers, including any
2317cookies sent by the browser, must fit within this buffer, otherwise
2318the server aborts with the response '413 Request Entity Too Large'.
2319+
2320One buffer of this size is allocated per active connection.
2321Allocating a buffer that is too large wastes memory that cannot be
2322reclaimed, allocating a buffer that is too small may cause unexpected
2323errors caused by very long Referer URLs or large cookie values.
2324+
2325By default, 16384 (16 K), which is sufficient for most OpenID and
2326other web-based single-sign-on integrations.
2327
Chulho Yangb72ff8f2013-07-04 02:35:53 -04002328[[httpd.sslCrl]]httpd.sslCrl::
2329+
2330Path of the certificate revocation list file in PEM format. This
2331crl file is optional, and available for CLIENT_SSL_CERT_LDAP
2332authentication.
2333+
2334To create and view a crl using openssl:
2335+
2336----
2337openssl ca -gencrl -out crl.pem
2338openssl crl -in crl.pem -text
2339----
2340+
2341If not absolute, the path is resolved relative to `$site_path`.
2342+
2343By default, `$site_path/etc/crl.pem`.
2344
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002345[[httpd.sslKeyStore]]httpd.sslKeyStore::
2346+
2347Path of the Java keystore containing the server's SSL certificate
2348and private key. This keystore is required for `https://` in URL.
2349+
2350To create a self-signed certificate for simple internal usage:
2351+
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002352----
2353keytool -keystore keystore -alias jetty -genkey -keyalg RSA
2354chmod 600 keystore
2355----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002356+
2357If not absolute, the path is resolved relative to `$site_path`.
2358+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08002359By default, `$site_path/etc/keystore`.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002360
2361[[httpd.sslKeyPassword]]httpd.sslKeyPassword::
2362+
2363Password used to decrypt the private portion of the sslKeyStore.
David Pursehouse221d4f62012-06-08 17:38:08 +09002364Java keystores require a password, even if the administrator
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002365doesn't want to enable one.
2366+
2367If set to the empty string the embedded server will prompt for the
2368password during startup.
2369+
2370By default, `gerrit`.
2371
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002372[[httpd.requestLog]]httpd.requestLog::
2373+
2374Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
2375If enabled, an NCSA combined log format request log file is written
2376out by the internal HTTP daemon.
2377+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01002378`log4j.appender` with the name `httpd_log` can be configured to overwrite
2379programmatic configuration.
2380+
Shawn O. Pearce1766f502010-01-15 10:49:46 -08002381By default, true if httpd.listenUrl uses http:// or https://,
2382and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
2383
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002384[[httpd.acceptorThreads]]httpd.acceptorThreads::
2385+
2386Number of worker threads dedicated to accepting new incoming TCP
David Pursehouse221d4f62012-06-08 17:38:08 +09002387connections and allocating them connection-specific resources.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002388+
2389By default, 2, which should be suitable for most high-traffic sites.
2390
2391[[httpd.minThreads]]httpd.minThreads::
2392+
2393Minimum number of spare threads to keep in the worker thread pool.
2394This number must be at least 1 larger than httpd.acceptorThreads
David Pursehouse92463562013-06-24 10:16:28 +09002395multiplied by the number of httpd.listenUrls configured.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002396+
2397By default, 5, suitable for most lower-volume traffic sites.
2398
2399[[httpd.maxThreads]]httpd.maxThreads::
2400+
2401Maximum number of threads to permit in the worker thread pool.
2402+
2403By default 25, suitable for most lower-volume traffic sites.
2404
2405[[httpd.maxQueued]]httpd.maxQueued::
2406+
2407Maximum number of client connections which can enter the worker
2408thread pool waiting for a worker thread to become available.
David Ostrovsky14fe8bc2014-03-26 06:03:44 -070024090 sets the queue size to the Integer.MAX_VALUE.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002410+
Luca Milanesio0ae62fe2015-09-04 07:56:00 -07002411By default 200.
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002412
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002413[[httpd.maxWait]]httpd.maxWait::
2414+
David Pursehouse221d4f62012-06-08 17:38:08 +09002415Maximum amount of time a client will wait for an available
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002416thread to handle a project clone, fetch or push request over the
2417smart HTTP transport.
2418+
2419Values should use common unit suffixes to express their setting:
2420+
2421* s, sec, second, seconds
2422* m, min, minute, minutes
2423* h, hr, hour, hours
2424* d, day, days
2425* w, week, weeks (`1 week` is treated as `7 days`)
2426* mon, month, months (`1 month` is treated as `30 days`)
2427* y, year, years (`1 year` is treated as `365 days`)
2428
2429+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002430--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002431If a unit suffix is not specified, `minutes` is assumed. If 0
2432is supplied, the maximum age is infinite and connections will not
2433abort until the client disconnects.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002434
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002435By default, 5 minutes.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02002436--
Shawn O. Pearcee5452b72010-01-15 14:32:50 -08002437
Luca Milanesioce7b7452013-06-18 11:40:49 +01002438[[httpd.filterClass]]httpd.filterClass::
2439+
2440Class that implements the javax.servlet.Filter interface
2441for filtering any HTTP related traffic going through the Gerrit
2442HTTP protocol.
2443Class is loaded and configured in the Gerrit Jetty container
2444and run in front of all Gerrit URL handlers, allowing the filter
2445to inspect, modify, allow or reject each request.
2446It needs to be provided as JAR library
2447under $GERRIT_SITE/lib as it is resolved using the default Gerrit class
2448loader and cannot be dynamically loaded by a plugin.
2449+
2450Failing to load the Filter class would result in a Gerrit start-up
2451failure, as this class is supposed to provide mandatory filtering
2452in front of Gerrit HTTP protocol.
2453+
David Pursehouse42f42042013-08-01 14:02:25 +09002454Typical usage is in conjunction with the `auth.type=HTTP` as replacement
Luca Milanesioce7b7452013-06-18 11:40:49 +01002455of an Apache HTTP proxy layer as security enforcement on top of Gerrit
2456by returning a trusted username as HTTP Header.
2457+
2458Example of using a security library secure.jar under $GERRIT_SITE/lib
2459that provides a org.anyorg.MySecureFilter Servlet Filter that enforces
2460a trusted username in the `TRUSTED_USER` HTTP Header:
2461
2462----
2463[auth]
2464 type = HTTP
2465 httpHeader = TRUSTED_USER
2466
Dariusz Lukszaaac01132015-02-11 12:13:07 +01002467[httpd]
Luca Milanesioce7b7452013-06-18 11:40:49 +01002468 filterClass = org.anyorg.MySecureFilter
2469----
Shawn O. Pearcefa2486a2009-11-11 14:51:30 -08002470
Juan Hernandezec512562013-08-06 16:30:50 +02002471[[httpd.robotsFile]]httpd.robotsFile::
2472+
2473Location of an external robots.txt file to be used instead of the one
2474bundled with the .war of the application.
2475+
2476If not absolute, the path is resolved relative to `$site_path`.
2477+
2478If the file doesn't exist or can't be read the default robots.txt file
2479bundled with the .war will be used instead.
2480
Dariusz Luksza011cfed2014-04-03 10:23:35 +02002481[[httpd.registerMBeans]]httpd.registerMBeans::
2482+
2483Enable (or disable) registration of Jetty MBeans for Java JMX.
2484+
2485By default, false.
2486
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002487[[index]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002488=== Section index
David Pursehouse6d458432013-08-23 16:17:18 +09002489
2490The index section configures the secondary index.
2491
David Pursehouse3fc5ee32014-03-17 18:35:32 +09002492Note that after enabling the secondary index, the index must be built
2493using the link:pgm-reindex.html[reindex program] before restarting the
2494Gerrit server.
2495
David Pursehouse6d458432013-08-23 16:17:18 +09002496[[index.type]]index.type::
2497+
2498Type of secondary indexing employed by Gerrit. The supported
2499values are:
2500+
2501* `LUCENE`
2502+
2503A link:http://lucene.apache.org/[Lucene] index is used.
2504+
David Pursehouse8e72f532014-06-24 11:01:28 +09002505+
2506* `ELASTICSEARCH`
2507+
2508An link:http://www.elasticsearch.org/[Elasticsearch] index is used.
David Pursehouse6d458432013-08-23 16:17:18 +09002509
2510+
Shawn Pearced4ae3a162013-11-24 17:00:31 -08002511By default, `LUCENE`.
David Pursehouse6d458432013-08-23 16:17:18 +09002512
David Pursehouse904db302014-03-17 18:55:38 +09002513[[index.threads]]index.threads::
2514+
Hugo Arèsfab06702016-06-10 12:49:52 -04002515Number of threads to use for indexing in normal interactive operations. Setting
2516it to 0 disables the dedicated thread pool and indexing will be done in the same
2517thread as the operation.
David Pursehouse904db302014-03-17 18:55:38 +09002518+
Hugo Arès176cd582016-05-06 14:37:09 -04002519If not set or set to a negative value, defaults to 1 plus half of the number of
2520logical CPUs as returned by the JVM.
David Pursehouse00c82142014-01-22 17:41:09 +09002521
Dave Borowitz787af5f2014-10-22 16:26:00 -07002522[[index.batchThreads]]index.batchThreads::
2523+
2524Number of threads to use for indexing in background operations, such as
2525online schema upgrades.
2526+
Sebastian Schubertha13dc292015-05-21 15:31:28 +02002527If not set or set to a negative value, defaults to the number of logical
Hugo Arès1cf252c2016-05-06 08:38:22 -04002528CPUs as returned by the JVM.
Dave Borowitz787af5f2014-10-22 16:26:00 -07002529
Dave Borowitzd80b9342015-03-25 10:32:21 -07002530[[index.onlineUpgrade]]index.onlineUpgrade::
2531+
2532Whether to upgrade to new index schema versions while the server is
2533running. This is recommended as it prevents additional downtime during
2534Gerrit version upgrades (avoiding the need for an offline reindex step
2535using Reindex), but can add additional server load during the upgrade.
2536+
2537If set to false, there is no way to upgrade the index schema to take
2538advantage of new search features without restarting the server.
2539+
2540Defaults to true.
2541
Dave Borowitzb82fbcb2015-04-22 16:43:54 -07002542[[index.maxLimit]]index.maxLimit::
2543+
2544Maximum limit to allow for search queries. Requesting results above this
2545limit will truncate the list (but will still set `_more_changes` on
2546result lists). Set to 0 for no limit.
2547+
2548Defaults to no limit.
2549
Dave Borowitzf56d3652015-04-22 17:35:34 -07002550[[index.maxPages]]index.maxPages::
2551+
2552Maximum number of pages of search results to allow, as index
2553implementations may have to scan through large numbers of skipped
2554results when searching with an offset. Requesting results starting past
2555this threshold times the requested limit will result in an error. Set to
25560 for no limit.
2557+
2558Defaults to no limit.
2559
Dave Borowitzd034ca82015-10-15 11:20:30 -04002560[[index.maxTerms]]index.maxTerms::
2561+
2562Maximum number of leaf terms to allow in a query. Too-large queries may
2563perform poorly, so setting this option causes query parsing to fail fast
Marco Miller6da22822016-01-29 12:31:38 -05002564before attempting to send them to the secondary index. Should this limit
2565be reached, database is used instead of index as applicable.
Dave Borowitzd034ca82015-10-15 11:20:30 -04002566+
Marco Miller6da22822016-01-29 12:31:38 -05002567When the index type is `LUCENE`, also sets the maximum number of clauses
2568permitted per BooleanQuery. This is so that all enforced query limits
2569are the same.
2570+
2571Defaults to 1024.
Dave Borowitzd034ca82015-10-15 11:20:30 -04002572
David Pursehouse902b3ee2014-07-09 16:17:49 +09002573==== Lucene configuration
2574
2575Open and closed changes are indexed in separate indexes named
2576'open' and 'closed' respectively.
2577
2578The following settings are only used when the index type is `LUCENE`.
David Pursehouseac88c362014-02-06 12:01:34 +09002579
David Pursehouse00c82142014-01-22 17:41:09 +09002580[[index.name.ramBufferSize]]index.name.ramBufferSize::
2581+
David Pursehouse00c82142014-01-22 17:41:09 +09002582Determines the amount of RAM that may be used for buffering added documents
2583and deletions before they are flushed to the index. See the
2584link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setRAMBufferSizeMB(double)[
2585Lucene documentation] for further details.
2586+
2587Defaults to 16M.
2588
2589[[index.name.maxBufferedDocs]]index.name.maxBufferedDocs::
2590+
David Pursehouse00c82142014-01-22 17:41:09 +09002591Determines the minimal number of documents required before the buffered
2592in-memory documents are flushed to the index. Large values generally
2593give faster indexing. See the
2594link:http://lucene.apache.org/core/4_6_0/core/org/apache/lucene/index/LiveIndexWriterConfig.html#setMaxBufferedDocs(int)[
2595Lucene documentation] for further details.
2596+
2597Defaults to -1, meaning no maximum is set and the writer will flush
2598according to RAM usage.
2599
Dave Borowitzd08b0452014-02-13 11:56:03 -08002600[[index.name.commitWithin]]index.name.commitWithin::
2601+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002602Determines the period at which changes are automatically committed to
2603stable store on disk. This is a costly operation and may block
2604additional index writes, so lower with caution.
2605+
Bruce Zuaf058e62014-03-21 10:03:05 +08002606If zero, changes are committed after every write. This is very costly
2607but may be useful if offline reindexing is infeasible, or for development
2608servers.
Dave Borowitzd08b0452014-02-13 11:56:03 -08002609+
Bruce Zuaf058e62014-03-21 10:03:05 +08002610Values can be specified using standard time unit abbreviations (`ms`, `sec`,
2611`min`, etc.).
David Pursehouse9354c1a2014-03-22 12:23:43 -07002612+
Bruce Zuaf058e62014-03-21 10:03:05 +08002613If negative, `commitWithin` is disabled. Changes are flushed to disk when
2614the in-memory buffer fills, but only committed and guaranteed to be synced
2615to disk when the process finishes.
David Pursehouse902b3ee2014-07-09 16:17:49 +09002616+
Dave Borowitzd08b0452014-02-13 11:56:03 -08002617Defaults to 300000 ms (5 minutes).
2618
David Pursehouse902b3ee2014-07-09 16:17:49 +09002619Sample Lucene index configuration:
David Pursehouse00c82142014-01-22 17:41:09 +09002620----
2621[index]
2622 type = LUCENE
2623
2624[index "changes_open"]
2625 ramBufferSize = 60 m
2626 maxBufferedDocs = 3000
2627
2628[index "changes_closed"]
2629 ramBufferSize = 20 m
2630 maxBufferedDocs = 500
2631----
2632
David Pursehouse8e72f532014-06-24 11:01:28 +09002633
2634==== Elasticsearch configuration
2635
Dariusz Luksza40533612016-09-22 14:44:40 +02002636WARNING: The Elasticsearch support is incomplete. Online reindexing
2637is not implemented yet.
David Pursehouse8e72f532014-06-24 11:01:28 +09002638
2639Open and closed changes are indexed in a single index, separated
2640into types 'open_changes' and 'closed_changes' respectively.
2641
2642The following settings are only used when the index type is
2643`ELASTICSEARCH`.
2644
2645[[index.protocol]]index.protocol::
2646+
2647Elasticsearch server protocol [http|https].
2648+
2649Defaults to `http`.
2650
2651[[index.hostname]]index.hostname::
2652+
2653Elasticsearch server hostname.
2654
2655Defaults to `localhost`.
2656
2657[[index.port]]index.port::
2658+
2659Elasticsearch server port.
2660+
2661Defauls to `9200`.
2662
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08002663[[index.prefix]]index.prefix::
David Pursehouse8e72f532014-06-24 11:01:28 +09002664+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08002665This setting can be used to prefix index names to allow multiple Gerrit
2666instances in a single Elasticsearch cluster. Prefix 'gerrit1_' would result in a
2667change index named 'gerrit1_changes_0001'.
David Pursehouse8e72f532014-06-24 11:01:28 +09002668+
Hugo Arès3ba6dfe2016-11-15 15:12:55 -08002669Not set by default.
David Pursehouse8e72f532014-06-24 11:01:28 +09002670
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08002671[[ldap]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002672=== Section ldap
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002673
David Pursehouse221d4f62012-06-08 17:38:08 +09002674LDAP integration is only enabled if `auth.type` is set to
Sasa Zivkoveabc8972010-10-04 15:47:08 +02002675`HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
David Pursehouse42f42042013-08-01 14:02:25 +09002676detailed description of the `auth.type` settings and their
Sasa Zivkoveabc8972010-10-04 15:47:08 +02002677implications.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002678
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002679An example LDAP configuration follows, and then discussion of
2680the parameters introduced here. Suitable defaults for most
2681parameters are automatically guessed based on the type of server
2682detected during startup. The guessed defaults support both
2683link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307] and Active
2684Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002685
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08002686----
2687[ldap]
2688 server = ldap://ldap.example.com
2689
2690 accountBase = ou=people,dc=example,dc=com
2691 accountPattern = (&(objectClass=person)(uid=${username}))
2692 accountFullName = displayName
2693 accountEmailAddress = mail
2694
2695 groupBase = ou=groups,dc=example,dc=com
2696 groupMemberPattern = (&(objectClass=group)(member=${dn}))
2697----
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002698
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002699[[ldap.server]]ldap.server::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002700+
2701URL of the organization's LDAP server to query for user information
2702and group membership from. Must be of the form `ldap://host` or
2703`ldaps://host` to bind with either a plaintext or SSL connection.
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002704+
David Pursehouse42f42042013-08-01 14:02:25 +09002705If `auth.type` is `LDAP` this setting should use `ldaps://` to
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002706ensure the end user's plaintext password is transmitted only over
2707an encrypted connection.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002708
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002709[[ldap.sslVerify]]ldap.sslVerify::
2710+
2711If false and ldap.server is an `ldaps://` style URL, Gerrit
2712will not verify the server certificate when it connects to
2713perform a query.
2714+
2715By default, true, requiring the certificate to be verified.
2716
Olga Grinbergcf1b06a2015-02-03 15:54:48 -05002717[[ldap.groupsVisibleToAll]]ldap.groupsVisibleToAll::
2718+
2719If true, LDAP groups are visible to all registered users.
2720+
2721By default, false, LDAP groups are visible only to administrators and
2722group members.
2723
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002724[[ldap.username]]ldap.username::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002725+
2726_(Optional)_ Username to bind to the LDAP server with. If not set,
2727an anonymous connection to the LDAP server is attempted.
2728
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002729[[ldap.password]]ldap.password::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002730+
2731_(Optional)_ Password for the user identified by `ldap.username`.
2732If not set, an anonymous (or passwordless) connection to the LDAP
2733server is attempted.
2734
Ben Wu0410a152010-06-04 16:17:24 +08002735[[ldap.referral]]ldap.referral::
2736+
2737_(Optional)_ How an LDAP referral should be handled if it is
2738encountered during directory traversal. Set to `follow` to
James Y Knight1244ed02011-01-04 02:40:32 -05002739automatically follow any referrals, or `ignore` to ignore the
2740referrals.
Ben Wu0410a152010-06-04 16:17:24 +08002741+
2742By default, `ignore`.
2743
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01002744[[ldap.readTimeout]]ldap.readTimeout::
2745+
2746_(Optional)_ The read timeout for an LDAP operation. The value is
2747in the usual time-unit format like "1 s", "100 ms", etc...
2748A timeout can be used to avoid blocking all of the SSH command start
David Pursehouse221d4f62012-06-08 17:38:08 +09002749threads in case the LDAP server becomes slow.
Sasa Zivkov100bd4b2011-11-07 14:58:46 +01002750+
2751By default there is no timeout and Gerrit will wait for the LDAP
2752server to respond until the TCP connection times out.
2753
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002754[[ldap.accountBase]]ldap.accountBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002755+
2756Root of the tree containing all user accounts. This is typically
2757of the form `ou=people,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00002758+
2759This setting may be added multiple times to specify more than
2760one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002761
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002762[[ldap.accountScope]]ldap.accountScope::
2763+
2764Scope of the search performed for accounts. Must be one of:
2765+
2766* `one`: Search only one level below accountBase, but not recursive
2767* `sub` or `subtree`: Search recursively below accountBase
2768* `base` or `object`: Search exactly accountBase; probably not desired
2769
2770+
2771Default is `subtree` as many directories have several levels.
2772
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002773[[ldap.accountPattern]]ldap.accountPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002774+
2775Query pattern to use when searching for a user account. This may be
2776any valid LDAP query expression, including the standard `(&...)` and
David Pursehouse42f42042013-08-01 14:02:25 +09002777`(|...)` operators. If `auth.type` is `HTTP_LDAP` then the variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002778`${username}` is replaced with a parameter set to the username
David Pursehouse42f42042013-08-01 14:02:25 +09002779that was supplied by the HTTP server. If `auth.type` is `LDAP` then
Edwin Kempincdb0e002011-09-08 14:23:30 +02002780the variable `${username}` is replaced by the string entered by
Shawn O. Pearcef7e065e2009-09-26 20:01:10 -07002781the end user.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002782+
2783This pattern is used to search the objects contained directly under
2784the `ldap.accountBase` tree. A typical setting for this parameter
Edwin Kempincdb0e002011-09-08 14:23:30 +02002785is `(uid=${username})` or `(cn=${username})`, but the proper
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002786setting depends on the LDAP schema used by the directory server.
2787+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002788Default is `(uid=${username})` for RFC 2307 servers,
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002789and `(&(objectClass=user)(sAMAccountName=${username}))`
2790for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002791
Shawn O. Pearce37dc1f82009-08-19 09:49:07 -07002792[[ldap.accountFullName]]ldap.accountFullName::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002793+
2794_(Optional)_ Name of an attribute on the user account object which
2795contains the initial value for the user's full name field in Gerrit.
2796Typically this is the `displayName` property in LDAP, but could
2797also be `legalName` or `cn`.
2798+
David Pursehouse221d4f62012-06-08 17:38:08 +09002799Attribute values may be concatenated with literal strings. For
2800example to join given name and surname together, use the pattern
Edwin Kempincdb0e002011-09-08 14:23:30 +02002801`${givenName} ${SN}`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002802+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002803If set, users will be unable to modify their full name field, as
2804Gerrit will populate it only from the LDAP data.
2805+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002806Default is `displayName` for RFC 2307 servers,
2807and `${givenName} ${sn}` for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002808
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002809[[ldap.accountEmailAddress]]ldap.accountEmailAddress::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002810+
2811_(Optional)_ Name of an attribute on the user account object which
2812contains the user's Internet email address, as defined by this
2813LDAP server.
2814+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002815Attribute values may be concatenated with literal strings,
2816for example to set the email address to the lowercase form
2817of sAMAccountName followed by a constant domain name, use
Edwin Kempincdb0e002011-09-08 14:23:30 +02002818`${sAMAccountName.toLowerCase}@example.com`.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002819+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002820If set, the preferred email address will be prefilled from LDAP,
David Pursehouse221d4f62012-06-08 17:38:08 +09002821but users may still be able to register additional email addresses,
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002822and select a different preferred email address.
2823+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002824Default is `mail`.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002825
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002826[[ldap.accountSshUserName]]ldap.accountSshUserName::
2827+
2828_(Optional)_ Name of an attribute on the user account object which
2829contains the initial value for the user's SSH username field in
2830Gerrit. Typically this is the `uid` property in LDAP, but could
2831also be `cn`. Administrators should prefer to match the attribute
2832corresponding to the user's workstation username, as this is what
2833SSH clients will default to.
2834+
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002835Attribute values may also be forced to lowercase, or to uppercase in
Edwin Kempincdb0e002011-09-08 14:23:30 +02002836an expression. For example, `${sAMAccountName.toLowerCase}` will
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002837force the value of sAMAccountName, if defined, to be all lowercase.
2838The suffix `.toUpperCase` can be used for the other direction.
2839The suffix `.localPart` can be used to split attribute values of
2840the form 'user@example.com' and return only the left hand side, for
Edwin Kempincdb0e002011-09-08 14:23:30 +02002841example `${userPrincipalName.localPart}` would provide only 'user'.
Shawn O. Pearceb86ae002009-09-26 16:54:05 -07002842+
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002843If set, users will be unable to modify their SSH username field, as
David Pursehousec12da502016-08-11 20:45:03 +09002844Gerrit will populate it only from the LDAP data. Note that once the
2845username has been set it cannot be changed, therefore it is
2846recommended not to make changes to this setting that would cause the
2847value to differ, as this will prevent users from logging in.
Shawn O. Pearce3ca1dcf2009-08-20 08:56:23 -07002848+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002849Default is `uid` for RFC 2307 servers,
2850and `${sAMAccountName.toLowerCase}` for Active Directory.
Shawn O. Pearce59e09222009-08-19 09:04:49 -07002851
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002852[[ldap.accountMemberField]]ldap.accountMemberField::
Anthony93de7db2009-10-03 10:01:50 -04002853+
2854_(Optional)_ Name of an attribute on the user account object which
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002855contains the groups the user is part of. Typically used for Active
2856Directory servers.
Anthony93de7db2009-10-03 10:01:50 -04002857+
Shawn O. Pearce02c2e802009-10-29 14:46:03 -07002858Default is unset for RFC 2307 servers (disabled)
2859and `memberOf` for Active Directory.
Anthony93de7db2009-10-03 10:01:50 -04002860
Saša Živkovc81291f2015-02-04 17:19:20 +01002861[[ldap.fetchMemberOfEagerly]]ldap.fetchMemberOfEagerly::
2862+
2863_(Optional)_ Whether to fetch the `memberOf` account attribute on
2864login. Setups which use LDAP for user authentication but don't make
2865use of the LDAP groups may benefit from setting this option to `false`
2866as this will result in a much faster LDAP login.
2867+
2868Default is unset for RFC 2307 servers (disabled) and `true` for
2869Active Directory.
2870
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002871[[ldap.groupBase]]ldap.groupBase::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002872+
2873Root of the tree containing all group objects. This is typically
2874of the form `ou=groups,dc=example,dc=com`.
David Pursehouse82d55632015-12-14 10:31:27 +00002875+
2876This setting may be added multiple times to specify more than
2877one root.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002878
Shawn O. Pearce304ccdb2009-08-25 12:25:27 -07002879[[ldap.groupScope]]ldap.groupScope::
2880+
2881Scope of the search performed for group objects. Must be one of:
2882+
2883* `one`: Search only one level below groupBase, but not recursive
2884* `sub` or `subtree`: Search recursively below groupBase
2885* `base` or `object`: Search exactly groupBase; probably not desired
2886
2887+
2888Default is `subtree` as many directories have several levels.
2889
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002890[[ldap.groupPattern]]ldap.groupPattern::
2891+
2892Query pattern used when searching for an LDAP group to connect
2893to a Gerrit group. This may be any valid LDAP query expression,
2894including the standard `(&...)` and `(|...)` operators. The variable
Edwin Kempincdb0e002011-09-08 14:23:30 +02002895`${groupname}` is replaced with the search term supplied by the
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002896group owner.
2897+
Edwin Kempincdb0e002011-09-08 14:23:30 +02002898Default is `(cn=${groupname})` for RFC 2307,
2899and `(&(objectClass=group)(cn=${groupname}))` for Active Directory.
Shawn O. Pearce7d25f782009-10-30 08:01:03 -07002900
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07002901[[ldap.groupMemberPattern]]ldap.groupMemberPattern::
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002902+
2903Query pattern to use when searching for the groups that a user
2904account is currently a member of. This may be any valid LDAP query
2905expression, including the standard `(&...)` and `(|...)` operators.
2906+
David Pursehouse42f42042013-08-01 14:02:25 +09002907If `auth.type` is `HTTP_LDAP` then the variable `${username}` is
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002908replaced with a parameter set to the username that was supplied
2909by the HTTP server. Other variables appearing in the pattern,
Edwin Kempincdb0e002011-09-08 14:23:30 +02002910such as `${fooBarAttribute}`, are replaced with the value of the
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002911corresponding attribute (in this case, `fooBarAttribute`) as read
2912from the user's account object matched under `ldap.accountBase`.
Edwin Kempincdb0e002011-09-08 14:23:30 +02002913Attributes such as `${dn}` or `${uidNumber}` may be useful.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002914+
Scott Dial50457502013-08-11 16:52:51 -04002915Default is `(|(memberUid=${username})(gidNumber=${gidNumber}))` for
2916RFC 2307, and unset (disabled) for Active Directory.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002917
Auke Schrijnen57809132012-09-26 21:05:39 +02002918[[ldap.groupName]]ldap.groupName::
2919+
David Pursehouse39489ae2012-10-12 13:50:04 +09002920_(Optional)_ Name of the attribute on the group object which contains
2921the value to use as the group name in Gerrit.
Auke Schrijnen57809132012-09-26 21:05:39 +02002922+
David Pursehouse39489ae2012-10-12 13:50:04 +09002923Typically the attribute name is `cn` for RFC 2307 and Active Directory
2924servers. For other servers the attribute name may differ, for example
2925`apple-group-realname` on Apple MacOS X Server.
Auke Schrijnen57809132012-09-26 21:05:39 +02002926+
David Pursehouse39489ae2012-10-12 13:50:04 +09002927It is also possible to specify a literal string containing a pattern of
2928attribute values. For example to create a Gerrit group name consisting of
2929LDAP group name and group ID, use the pattern `${cn} (${gidNumber})`.
2930+
2931Default is `cn`.
Auke Schrijnen57809132012-09-26 21:05:39 +02002932
Gustaf Lundhdaf41af2016-12-05 19:05:09 +01002933[[ldap.mandatoryGroup]]ldap.mandatoryGroup::
2934+
2935All users must be a member of this group to allow account creation or
2936authentication.
2937+
2938Setting mandatoryGroup implies enabling of `ldap.fetchMemberOfEagerly`
2939+
2940By default, unset.
2941
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002942[[ldap.localUsernameToLowerCase]]ldap.localUsernameToLowerCase::
2943+
2944Converts the local username, that is used to login into the Gerrit
David Pursehousea1d633b2014-05-02 17:21:02 +09002945Web UI, to lower case before doing the LDAP authentication. By setting
2946this parameter to true, a case insensitive login to the Gerrit Web UI
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002947can be achieved.
2948+
2949If set, it must be ensured that the local usernames for all existing
2950accounts are converted to lower case, otherwise a user that has a
David Pursehouse221d4f62012-06-08 17:38:08 +09002951local username that contains upper case characters will not be able to login
Edwin Kempinb3b0d292011-09-14 14:17:34 +02002952anymore. The local usernames for the existing accounts can be
2953converted to lower case by running the server program
2954link:pgm-LocalUsernamesToLowerCase.html[LocalUsernamesToLowerCase].
2955Please be aware that the conversion of the local usernames to lower
2956case can't be undone. For newly created accounts the local username
2957will be directly stored in lower case.
2958+
2959By default, unset/false.
Shawn O. Pearce302a7dd2009-08-18 19:33:15 -07002960
Robin Rosenberga3baed02012-10-14 14:09:32 +02002961[[ldap.authentication]]ldap.authentication::
2962+
2963Defines how Gerrit authenticates with the server. When set to `GSSAPI`
2964Gerrit will use Kerberos. To use kerberos the
2965`java.security.auth.login.config` system property must point to a
2966login to a JAAS configuration file and, if Java 6 is used, the system
2967property `java.security.krb5.conf` must point to the appropriate
2968krb5.ini file with references to the KDC.
2969
2970Typical jaas.conf.
2971
2972----
2973KerberosLogin {
2974 com.sun.security.auth.module.Krb5LoginModule
2975 required
2976 useTicketCache=true
2977 doNotPrompt=true
2978 renewTGT=true;
2979};
2980----
2981
2982See Java documentation on how to create the krb5.ini file.
2983
2984Note the `renewTGT` property to make sure the TGT does not expire,
2985and `useTicketCache` to use the TGT supplied by the operating system. As
2986the whole point of using GSSAPI is to have passwordless authentication
David Pursehouse92463562013-06-24 10:16:28 +09002987to the LDAP service, this option does not acquire a new TGT on its own.
Robin Rosenberga3baed02012-10-14 14:09:32 +02002988
2989On Windows servers the registry key `HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters`
2990must have the DWORD value `allowtgtsessionkey` set to 1 and the account must not
2991have local administrator privileges.
2992
Bruce Zucd04bbc2014-07-25 15:48:09 +08002993[[ldap.useConnectionPooling]]ldap.useConnectionPooling::
2994+
2995_(Optional)_ Enable the LDAP connection pooling or not.
2996+
2997If it is true, the LDAP service provider maintains a pool of (possibly)
2998previously used connections and assigns them to a Context instance as
2999needed. When a Context instance is done with a connection (closed or
3000garbage collected), the connection is returned to the pool for future use.
3001+
3002For details, see link:http://docs.oracle.com/javase/tutorial/jndi/ldap/pool.html[
3003LDAP connection management (Pool)] and link:http://docs.oracle.com/javase/tutorial/jndi/ldap/config.html[
3004LDAP connection management (Configuration)]
3005+
3006By default, false.
3007
3008[[ldap.connectTimeout]]ldap.connectTimeout::
3009+
Saša Živkov303701a2015-01-19 16:24:44 +01003010_(Optional)_ Timeout period for establishment of an LDAP connection.
Bruce Zucd04bbc2014-07-25 15:48:09 +08003011+
3012The value is in the usual time-unit format like "1 s", "100 ms",
3013etc...
3014+
3015By default there is no timeout and Gerrit will wait indefinitely.
3016
Saša Živkov5049f512015-01-19 17:04:43 +01003017[[ldap-connection-pooling]]
3018==== LDAP Connection Pooling
3019Once LDAP connection pooling is enabled by setting the link:#ldap.useConnectionPooling[
3020ldap.useConnectionPooling] configuration property to `true`, the connection pool
3021can be configured using JVM system properties as explained in the
3022link:http://docs.oracle.com/javase/7/docs/technotes/guides/jndi/jndi-ldap.html#POOL[
3023Java SE Documentation].
Bruce Zucd04bbc2014-07-25 15:48:09 +08003024
Saša Živkov5049f512015-01-19 17:04:43 +01003025For standalone Gerrit (running with the embedded Jetty), JVM system properties
3026are specified in the link:#container[container section]:
Bruce Zucd04bbc2014-07-25 15:48:09 +08003027
Saša Živkov5049f512015-01-19 17:04:43 +01003028----
3029 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.maxsize=20
3030 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.prefsize=10
3031 javaOptions = -Dcom.sun.jndi.ldap.connect.pool.timeout=300000
3032----
Bruce Zucd04bbc2014-07-25 15:48:09 +08003033
Saša Živkovca7a67e2015-12-01 14:25:10 +01003034[[lfs]]
3035=== Section lfs
3036
3037[[lfs.plugin]]lfs.plugin::
3038+
David Pursehouse2463c542016-08-02 16:04:58 +09003039The name of a plugin which serves the
3040link:https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md[
3041LFS protocol] on the `<project-name>/info/lfs/objects/batch` endpoint. When
3042not configured Gerrit will respond with `501 Not Implemented` on LFS protocol
3043requests.
Saša Živkovca7a67e2015-12-01 14:25:10 +01003044+
3045By default unset.
3046
Gustaf Lundhaef90122015-04-27 16:48:19 +02003047[[log]]
3048=== Section log
3049
3050[[log.jsonLogging]]log.jsonLogging::
3051+
3052If set to true, enables error logging in JSON format (file name: "logs/error_log.json").
3053+
3054Defaults to false.
3055
3056[[log.textLogging]]log.textLogging::
3057+
3058If set to true, enables error logging in regular plain text format. Can only be disabled
3059if `jsonLogging` is enabled.
3060+
3061Defaults to true.
3062
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003063[[mimetype]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003064=== Section mimetype
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003065
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003066[[mimetype.name.safe]]mimetype.<name>.safe::
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003067+
3068If set to true, files with the MIME type `<name>` will be sent as
3069direct downloads to the user's browser, rather than being wrapped up
3070inside of zipped archives. The type name may be a complete type
Jonathan Nieder5758f182015-03-30 11:28:55 -07003071name, e.g. `image/gif`, a generic media type, e.g. `+image/*+`,
3072or the wildcard `+*/*+` to match all types.
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003073+
3074By default, false for all MIME types.
3075
3076Common examples:
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08003077----
3078[mimetype "image/*"]
3079 safe = true
3080
3081[mimetype "application/pdf"]
3082 safe = true
3083
3084[mimetype "application/msword"]
3085 safe = true
3086
3087[mimetype "application/vnd.ms-excel"]
3088 safe = true
3089----
Shawn O. Pearce01cb11902009-07-15 08:19:01 -07003090
Michael Ochmann69813262016-01-27 17:53:55 +01003091[[oauth]]
3092=== Section oauth
3093
3094OAuth integration is only enabled if `auth.type` is set to `OAUTH`. See
3095link:#auth.type[above] for a detailed description of the `auth.type` settings
3096and their implications.
3097
3098By default, contact information, like the full name and email address,
3099is retrieved from the selected OAuth provider when a user account is created,
3100or when a user requests to reload that information in the settings UI. If
3101that is not supported by the OAuth provider, users can be allowed to edit
3102their contact information manually.
3103
3104[[oauth.allowEditFullName]]oauth.allowEditFullName::
3105+
3106If true, the full name can be edited in the contact information.
3107+
3108Default is false.
3109
3110[[oauth.allowRegisterNewEmail]]oauth.allowRegisterNewEmail::
3111+
3112If true, additional email addresses can be registered in the contact
3113information.
3114+
3115Default is false.
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003116
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003117[[pack]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003118=== Section pack
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003119
Shawn O. Pearce5f11b292010-08-05 17:57:35 -07003120Global settings controlling how Gerrit Code Review creates pack
3121streams for Git clients running clone, fetch, or pull. Most of these
3122variables are per-client request, and thus should be carefully set
3123given the expected concurrent request load and available CPU and
3124memory resources.
3125
3126[[pack.deltacompression]]pack.deltacompression::
3127+
3128If true, delta compression between objects is enabled. This may
3129result in a smaller overall transfer for the client, but requires
3130more server memory and CPU time.
3131+
3132False (off) by default, matching Gerrit Code Review 2.1.4.
3133
3134[[pack.threads]]pack.threads::
3135+
3136Maximum number of threads to use for delta compression (if enabled).
3137This is per-client request. If set to 0 then the number of CPUs is
3138auto-detected and one thread per CPU is used, per client request.
3139+
3140By default, 1.
3141
3142
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003143[[plugins]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003144=== Section plugins
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003145
3146[[plugins.checkFrequency]]plugins.checkFrequency::
3147+
3148How often plugins should be examined for new plugins to load, removed
3149plugins to be unloaded, or updated plugins to be reloaded. Values can
3150be specified using standard time unit abbreviations ('ms', 'sec',
3151'min', etc.).
3152+
3153If set to 0, automatic plugin reloading is disabled. Administrators
Christian Aistleitner8ce1a4e2015-06-05 01:54:15 +02003154may force reloading with link:cmd-plugin-reload.html[gerrit plugin reload].
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003155+
3156Default is 1 minute.
3157
Shawn Pearcefd033502014-02-14 16:42:35 -08003158[[plugins.allowRemoteAdmin]]plugins.allowRemoteAdmin::
3159+
3160Enable remote installation, enable and disable of plugins over HTTP
3161and SSH. If set to true Administrators can install new plugins
3162remotely, or disable existing plugins. Defaults to false.
3163
Dariusz Luksza98f23522015-03-11 11:41:41 +01003164[[plugins.jsLoadTimeout]]plugins.jsLoadTimeout::
3165+
3166Set the timeout value for loading JavaScript plugins in Gerrit UI.
3167Values can be specified using standard time unit abbreviations ('ms',
3168'sec', 'min', etc.).
3169+
3170Default is 5 seconds. Negative values will be converted to 0.
Shawn O. Pearce5ad16ea2012-05-09 14:24:25 -07003171
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003172[[receive]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003173=== Section receive
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003174
Dave Borowitzff243892015-08-31 15:35:28 -04003175This section is used to configure behavior of the 'receive-pack'
3176handler, which responds to 'git push' requests.
lincoln2be11602010-07-05 10:53:25 -03003177
Dave Borowitzff243892015-08-31 15:35:28 -04003178[[receive.allowGroup]]receive.allowGroup::
Dave Borowitz532342bf2015-06-18 20:28:22 -04003179+
Dave Borowitzff243892015-08-31 15:35:28 -04003180Name of the groups of users that are allowed to execute
3181'receive-pack' on the server. One or more groups can be set.
Dave Borowitz532342bf2015-06-18 20:28:22 -04003182+
Dave Borowitzff243892015-08-31 15:35:28 -04003183If no groups are added, any user will be allowed to execute
3184'receive-pack' on the server.
Dave Borowitz532342bf2015-06-18 20:28:22 -04003185
3186[[receive.certNonceSeed]]receive.certNonceSeed::
3187+
3188If set to a non-empty value and server-side signed push validation is
3189link:#receive.enableSignedPush[enabled], use this value as the seed to
3190the HMAC SHA-1 nonce generator. If unset, a 64-byte random seed will be
3191generated at server startup.
3192+
3193As this is used as the seed of a cryptographic algorithm, it is
3194recommended to be placed in link:#secure-config[`secure.config`].
3195+
3196Defaults to unset.
3197
3198[[receive.certNonceSlop]]receive.certNonceSlop::
3199+
3200When validating the nonce passed as part of the signed push protocol,
3201accept valid nonces up to this many seconds old. This allows
3202certificate verification to work over HTTP where there is a lag between
3203the HTTP response providing the nonce to sign and the next request
3204containing the signed nonce. This can be significant on large
3205repositories, since the lag also includes the time to count objects on
3206the client.
3207+
3208Default is 5 minutes.
3209
Dave Borowitzff243892015-08-31 15:35:28 -04003210[[receive.changeUpdateThreads]]receive.changeUpdateThreads::
3211+
3212Number of threads to perform change creation or patch set updates
3213concurrently. Each thread uses its own database connection from
3214the database connection pool, and if all threads are busy then
3215main receive thread will also perform a change creation or patch
3216set update.
3217+
3218Defaults to 1, using only the main receive thread. This feature is for
3219databases with very high latency that can benefit from concurrent
3220operations when multiple changes are impacted at once.
3221
Shawn Pearce5cb31bf2013-02-27 16:20:26 -08003222[[receive.checkMagicRefs]]receive.checkMagicRefs::
3223+
3224If true, Gerrit will verify the destination repository has
3225no references under the magic 'refs/drafts', 'refs/for', or
3226'refs/publish' branch namespaces. Names under these locations
3227confuse clients when trying to upload code reviews so Gerrit
3228requires them to be empty.
3229+
3230If false Gerrit skips the sanity check and assumes administrators
3231have ensured the repository does not contain any magic references.
3232Setting to false to skip the check can decrease latency during push.
3233+
3234Default is true.
3235
Gustaf Lundh9062fd62013-02-14 17:23:11 +01003236[[receive.checkReferencedObjectsAreReachable]]receive.checkReferencedObjectsAreReachable::
3237+
3238If set to true, Gerrit will validate that all referenced objects that
3239are not included in the received pack are reachable by the user.
3240+
3241Carrying out this check on gits with many refs and commits can be a
3242very CPU-heavy operation. For non public Gerrit-servers this check may
3243be overkill.
3244+
3245Only disable this check if you trust the clients not to forge SHA1
3246references to access commits intended to be hidden from the user.
3247+
3248Default is true.
3249
Dave Borowitzff243892015-08-31 15:35:28 -04003250[[receive.enableSignedPush]]receive.enableSignedPush::
lincoln2be11602010-07-05 10:53:25 -03003251+
Dave Borowitzff243892015-08-31 15:35:28 -04003252If true, server-side signed push validation is enabled.
lincoln2be11602010-07-05 10:53:25 -03003253+
Dave Borowitzff243892015-08-31 15:35:28 -04003254When a client pushes with `git push --signed`, this ensures that the
3255push certificate is valid and signed with a valid public key stored in
David Pursehouse6117a472016-07-26 08:02:49 +00003256the `refs/meta/gpg-keys` branch of `All-Users`.
Dave Borowitzff243892015-08-31 15:35:28 -04003257+
3258Defaults to false.
3259
3260[[receive.maxBatchChanges]]receive.maxBatchChanges::
3261+
3262The maximum number of changes that Gerrit allows to be pushed
3263in a batch for review. When this number is exceeded Gerrit rejects
3264the push with an error message.
3265+
3266May be overridden for certain groups by specifying a limit in the
3267link:access-control.html#capability_batchChangesLimit['Batch Changes Limit']
3268global capability.
3269+
3270This setting can be used to prevent users from uploading large
3271number of changes for review by mistake.
3272+
3273Default is zero, no limit.
lincoln2be11602010-07-05 10:53:25 -03003274
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003275[[receive.maxObjectSizeLimit]]receive.maxObjectSizeLimit::
3276+
3277Maximum allowed Git object size that 'receive-pack' will accept.
3278If an object is larger than the given size the pack-parsing will abort
3279and the push operation will fail. If set to zero then there is no
3280limit.
3281+
David Pursehouse221d4f62012-06-08 17:38:08 +09003282Gerrit administrators can use this setting to prevent developers
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003283from pushing objects which are too large to Gerrit.
3284+
Fredrik Luthandera3cf3542012-07-04 16:55:35 -07003285This setting can also be set in the `project.config`
3286link:config-project-config.html[receive.maxObjectSizeLimit] in order
3287to further reduce the global setting. The project specific setting is
3288only honored when it further reduces the global limit.
Sasa Zivkov5a708a82013-06-28 17:07:55 +02003289+
Sasa Zivkov59d89c32011-11-18 15:32:35 +01003290Default is zero.
3291+
3292Common unit suffixes of 'k', 'm', or 'g' are supported.
3293
Dave Borowitz1bb49492015-08-31 15:36:59 -04003294[[receive.maxTrustDepth]]receive.maxTrustDepth::
3295+
3296If signed push validation is link:#receive.enableSignedPush[enabled],
3297set to the maximum depth to search when checking if a key is
3298link:#receive.trustedKey[trusted].
3299+
3300Default is 0, meaning only explicitly trusted keys are allowed.
3301
Dave Borowitz234734a2012-03-01 14:22:29 -08003302[[receive.threadPoolSize]]receive.threadPoolSize::
3303+
3304Maximum size of the thread pool in which the change data in received packs is
3305processed.
3306+
3307Defaults to the number of available CPUs according to the Java runtime.
3308
Dave Borowitz1c401362012-03-02 17:39:17 -08003309[[receive.timeout]]receive.timeout::
3310+
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07003311Overall timeout on the time taken to process the change data in
3312received packs. Only includes the time processing Gerrit changes
3313and updating references, not the time to index the pack. Values can
3314be specified using standard time unit abbreviations ('ms', 'sec',
3315'min', etc.).
Dave Borowitz1c401362012-03-02 17:39:17 -08003316+
Dariusz Lukszade482b02015-11-09 18:25:04 +01003317Default is 4 minutes. If no unit is specified, milliseconds
Shawn O. Pearce00dd12d2012-03-12 15:52:11 -07003318is assumed.
Dave Borowitz1c401362012-03-02 17:39:17 -08003319
Dave Borowitz1bb49492015-08-31 15:36:59 -04003320[[receive.trustedKey]]receive.trustedKey::
3321+
3322List of GPG key fingerprints that should be considered trust roots by
3323the server when signed push validation is
3324link:#receive.enableSignedPush[enabled]. A key is trusted by the server
3325if it is either in this list, or a path of trust signatures leads from
3326the key to a configured trust root. The maximum length of the path is
3327determined by link:#receive.maxTrustDepth[`receive.maxTrustDepth`].
3328+
3329Key fingerprints can be displayed with `gpg --list-keys
3330--with-fingerprint`.
3331+
3332Trust signatures can be added to a key using the `tsign` command to
3333link:https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Key-Management.html[
3334`gpg --edit-key`], after which the signed key should be re-uploaded.
3335+
3336If no keys are specified, web-of-trust checks are disabled. This is the
3337default behavior.
3338
lincoln2be11602010-07-05 10:53:25 -03003339
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003340[[repository]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003341=== Section repository
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003342
Hugo Josefson072b4702010-04-21 19:27:11 +02003343Repositories in this sense are the same as projects.
3344
Shawn O. Pearce897d9212011-06-16 16:59:59 -07003345In the following example configuration `Registered Users` is set
3346to be the default owner of new projects.
Hugo Josefson072b4702010-04-21 19:27:11 +02003347
3348----
3349[repository "*"]
Hugo Josefson072b4702010-04-21 19:27:11 +02003350 ownerGroup = Registered Users
3351----
3352
Hugo Arès7d2b9422014-11-25 15:33:42 -05003353The only matching patterns supported are exact match or wildcard matching which
3354can be specified by ending the name with a `*`. If a project matches more than one
3355repository configuration, then the configuration from the more precise match
3356will be used. In the following example, the default submit type for a project
3357named `project/plugins/a` would be `CHERRY_PICK`.
3358
3359----
3360[repository "project/*"]
3361 defaultSubmitType = MERGE_IF_NECESSARY
3362[repository "project/plugins/*"]
3363 defaultSubmitType = CHERRY_PICK
3364----
3365
Michael Ochmann8129ece2016-07-08 11:25:25 +02003366[NOTE]
3367All properties are used from the matching repository configuration. In
Hugo Arès7d2b9422014-11-25 15:33:42 -05003368the previous example, all properties will be used from `project/plugins/\*`
3369section and no properties will be inherited nor overridden from `project/*`.
Hugo Josefson072b4702010-04-21 19:27:11 +02003370
Hugo Arès218bb3b2015-04-22 15:05:14 -04003371[[repository.name.basePath]]repository.<name>.basePath::
3372+
3373Alternate to <<gerrit.basePath,gerrit.basePath>>. The repository will be created
3374and used from this location instead: ${alternateBasePath}/${projectName}.git.
3375+
3376If configuring the basePath for an existing project in gerrit, make sure to stop
3377gerrit, move the repository in the alternate basePath, configure basePath for
3378this repository and then start Gerrit.
3379+
3380Path must be absolute.
3381
Edwin Kempina79ea552013-11-19 11:24:37 +01003382[[repository.name.defaultSubmitType]]repository.<name>.defaultSubmitType::
3383+
3384The default submit type for newly created projects. Supported values
3385are `MERGE_IF_NECESSARY`, `FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`,
3386`MERGE_ALWAYS` and `CHERRY_PICK`.
3387+
3388By default, `MERGE_IF_NECESSARY`.
3389
Hugo Josefson072b4702010-04-21 19:27:11 +02003390[[repository.name.ownerGroup]]repository.<name>.ownerGroup::
3391+
3392A name of a group which exists in the database. Zero, one or many
3393groups are allowed. Each on its own line. Groups which don't exist
3394in the database are ignored.
Hugo Josefson072b4702010-04-21 19:27:11 +02003395
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003396[[rules]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003397=== Section rules
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07003398
3399[[rules.enable]]rules.enable::
3400+
Matt Baker8ce12fc2013-11-26 21:43:12 -07003401If true, Gerrit will load and execute 'rules.pl' files in each
Shawn O. Pearce94860ee2011-09-29 13:11:08 -07003402project's refs/meta/config branch, if present. When set to false,
3403only the default internal rules will be used.
3404+
3405Default is true, to execute project specific rules.
3406
Shawn Pearceed001d72014-12-17 14:25:55 -08003407[[rules.reductionLimit]]rules.reductionLimit::
3408+
3409Maximum number of Prolog reductions that can be performed when
3410evaluating rules for a single change. Each function call made
3411in user rule code, internal Gerrit Prolog code, or the Prolog
3412interpreter counts against this limit.
3413+
3414Sites using very complex rules that need many reductions should
3415compile Prolog to Java bytecode with link:pgm-rulec.html[rulec].
3416This eliminates the dynamic Prolog interpreter from charging its
3417own reductions against the limit, enabling more logic to execute
3418within the same bounds.
3419+
3420A reductionLimit of 0 is nearly infinite, implemented by setting
3421the internal limit to 2^31-1.
3422+
3423Default is 100,000 reductions (about 14 ms on Intel Core i7 CPU).
3424
3425[[rules.compileReductionLimit]]rules.compileReductionLimit::
3426+
3427Maximum number of Prolog reductions that can be performed when
3428compiling source code to internal Prolog machine code.
3429+
3430Default is 10x reductionLimit (1,000,000).
3431
Shawn Pearcea2b98522015-11-21 09:47:32 -08003432[[rules.maxSourceBytes]]rules.maxSourceBytes::
3433+
3434Maximum input size (in bytes) of a Prolog rules.pl file. Larger
3435source files may need a larger rules.compileReductionLimit. Consider
3436using link:pgm-rulec.html[rulec] to precompile larger rule files.
3437+
3438A size of 0 bytes disables rules, same as rules.enable = false.
3439+
David Pursehouse0c1dadf2015-11-24 09:14:21 +00003440Common unit suffixes of 'k', 'm', or 'g' are supported.
3441+
Shawn Pearcea2b98522015-11-21 09:47:32 -08003442Default is 128 KiB.
3443
3444[[rules.maxPrologDatabaseSize]]rules.maxPrologDatabaseSize::
3445+
3446Number of predicate clauses allowed to be defined in the Prolog
3447database by project rules. Very complex rules may need more than the
3448default 256 limit, but cost more memory and may need more time to
3449evaluate. Consider using link:pgm-rulec.html[rulec] to precompile
3450larger rule files.
3451+
3452Default is 256.
3453
David Pursehouse511a35b2014-04-04 10:27:13 +09003454[[execution]]
3455=== Section execution
Bruce Zua7e34312014-04-01 17:35:41 +08003456
3457[[execution.defaultThreadPoolSize]]execution.defaultThreadPoolSize::
3458+
3459The default size of the background execution thread pool in
3460which miscellaneous tasks are handled.
3461+
3462Default is 1.
3463
Patrick Hiesel328b7612016-10-21 16:43:13 +02003464[[receiveemail]]
3465=== Section receiveemail
3466
3467[[receiveemail.protocol]]receiveemail.protocol::
3468+
3469Specifies the protocol used for receiving emails. Valid options are
3470'POP3', 'IMAP' and 'NONE'. Note that Gerrit will automatically switch between
3471POP3 and POP3s as well as IMAP and IMAPS depending on the specified
3472link:#receiveemail.encryption[encryption].
3473+
3474Defaults to 'NONE' which means that receiving emails is disabled.
3475
3476[[receiveemail.host]]receiveemail.host::
3477+
3478The hostname of the mailserver. Example: 'imap.gmail.com'.
3479+
3480Defaults to an empty string which means that receiving emails is disabled.
3481
3482[[receiveemail.port]]receiveemail.port::
3483+
3484The port the email server exposes for receving emails.
3485+
3486Defaults to the industry standard for a given protocol and encryption:
3487POP3: 110; POP3S: 995; IMAP: 143; IMAPS: 995.
3488
3489[[receiveemail.username]]receiveemail.username::
3490+
3491Username used for authenticating with the email server.
3492+
3493Defaults to an empty string.
3494
3495[[receiveemail.password]]receiveemail.password::
3496+
3497Password used for authenticating with the email server.
3498+
3499Defaults to an empty string.
3500
3501[[receiveemail.encryption]]receiveemail.encryption::
3502+
3503Encryption standard used for transport layer security between Gerrit and the
3504email server. Possible values include 'NONE', 'SSL' and 'TLS'.
3505+
3506Defaults to 'NONE'.
3507
3508[[receiveemail.fetchInterval]]receiveemail.fetchInterval::
3509+
3510Time between two consecutive fetches from the email server. Communication with
3511the email server is not kept alive. Examples: 60s, 10m, 1h.
3512+
3513Defaults to 60 seconds.
3514
3515[[receiveemail.enableImapIdle]]receiveemail.enableImapIdle::
3516+
3517If the IMAP protocol is used for retrieving emails, IMAPv4 IDLE can be used to
3518keep the connection with the email server alive and receive a push when a new
3519email is delivered to the inbox. In this case, Gerrit will process the email
3520immediately and will not have a fetch delay.
3521
3522+
3523Defaults to false.
3524
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003525[[sendemail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003526=== Section sendemail
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003527
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003528[[sendemail.enable]]sendemail.enable::
Shawn O. Pearce2e4573b2009-06-02 09:09:50 -07003529+
3530If false Gerrit will not send email messages, for any reason,
3531and all other properties of section sendemail are ignored.
3532+
3533By default, true, allowing notifications to be sent.
3534
Jonathan Niederdabd8c22016-09-20 14:10:11 -07003535[[sendemail.html]]sendemail.html::
3536+
3537If false, Gerrit will only send plain-text emails.
3538If true, Gerrit will send multi-part emails with an HTML and
3539plain text part.
3540+
3541By default, true, allowing HTML in the emails Gerrit sends.
3542
Bruce Zua7e34312014-04-01 17:35:41 +08003543[[sendemail.connectTimeout]]sendemail.connectTimeout::
3544+
3545The connection timeout of opening a socket connected to a
3546remote SMTP server.
3547+
3548Values can be specified using standard time unit abbreviations
3549('ms', 'sec', 'min', etc.).
3550If no unit is specified, milliseconds is assumed.
3551+
3552Default is 0. A timeout of zero is interpreted as an infinite
3553timeout. The connection will then block until established or
3554an error occurs.
3555
3556[[sendemail.threadPoolSize]]sendemail.threadPoolSize::
3557+
3558Maximum size of thread pool in which the review comments
3559notifications are sent out asynchronously.
3560+
3561By default, 1.
3562
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003563[[sendemail.from]]sendemail.from::
3564+
3565Designates what name and address Gerrit will place in the From
3566field of any generated email messages. The supported values are:
3567+
3568* `USER`
3569+
3570Gerrit will set the From header to use the current user's
David Pursehouse92463562013-06-24 10:16:28 +09003571Full Name and Preferred Email. This may cause messages to be
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003572classified as spam if the user's domain has SPF or DKIM enabled
3573and <<sendemail.smtpServer,sendemail.smtpServer>> is not a trusted
Zhen Chenae765aa2016-08-08 15:49:44 -07003574relay for that domain. You can specify
3575<<sendemail.allowedDomain,sendemail.allowedDomain>> to instruct Gerrit to only
3576send as USER if USER is from those domains.
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003577+
3578* `MIXED`
3579+
Edwin Kempincdb0e002011-09-08 14:23:30 +02003580Shorthand for `${user} (Code Review) <review@example.com>` where
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003581`review@example.com` is the same as <<user.email,user.email>>.
3582See below for a description of how the replacement is handled.
3583+
3584* `SERVER`
3585+
3586Gerrit will set the From header to the same name and address
3587it records in any commits Gerrit creates. This is set by
3588<<user.name,user.name>> and <<user.email,user.email>>, or guessed
3589from the local operating system.
3590+
Edwin Kempinebfbbac2015-07-01 16:02:39 +02003591* `Code Review <review@example.com>`
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003592+
3593If set to a name and email address in brackets, Gerrit will use
3594this name and email address for any messages, overriding the name
3595that may have been selected for commits by user.name and user.email.
Edwin Kempincdb0e002011-09-08 14:23:30 +02003596Optionally, the name portion may contain the placeholder `${user}`,
Shawn O. Pearce5c31bd72009-09-10 18:13:33 -07003597which is replaced by the Full Name of the current user.
3598
3599+
3600By default, MIXED.
3601
Zhen Chenae765aa2016-08-08 15:49:44 -07003602[[sendemail.allowedDomain]]sendemail.allowedDomain::
3603+
3604Only used when `sendemail.from` is set to `USER`.
3605List of allowed domains. If user's email matches one of the domains, emails will
3606be sent as USER, otherwise as MIXED mode. Wildcards may be specified by
3607including `*` to match any number of characters, for example `*.example.com`
3608matches any subdomain of `example.com`.
3609+
3610By default, `*`.
3611
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003612[[sendemail.smtpServer]]sendemail.smtpServer::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003613+
3614Hostname (or IP address) of a SMTP server that will relay
3615messages generated by Gerrit to end users.
3616+
3617By default, 127.0.0.1 (aka localhost).
3618
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003619[[sendemail.smtpServerPort]]sendemail.smtpServerPort::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003620+
3621Port number of the SMTP server in sendemail.smtpserver.
3622+
Shawn O. Pearce6e9a83f2009-11-02 10:30:48 -08003623By default, 25, or 465 if smtpEncryption is 'ssl'.
3624
3625[[sendemail.smtpEncryption]]sendemail.smtpEncryption::
3626+
3627Specify the encryption to use, either 'ssl' or 'tls'.
3628+
3629By default, 'none', indicating no encryption is used.
3630
3631[[sendemail.sslVerify]]sendemail.sslVerify::
3632+
3633If false and sendemail.smtpEncryption is 'ssl' or 'tls', Gerrit
3634will not verify the server certificate when it connects to send
3635an email message.
3636+
3637By default, true, requiring the certificate to be verified.
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003638
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003639[[sendemail.smtpUser]]sendemail.smtpUser::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003640+
3641User name to authenticate with, if required for relay.
3642
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003643[[sendemail.smtpPass]]sendemail.smtpPass::
Shawn O. Pearceb0572c62009-06-01 14:18:22 -07003644+
3645Password for the account named by sendemail.smtpUser.
3646
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003647[[sendemail.allowrcpt]]sendemail.allowrcpt::
Shawn O. Pearce219a8ee2009-06-01 18:13:57 -07003648+
3649If present, each value adds one entry to the whitelist of email
3650addresses that Gerrit can send email to. If set to a complete
3651email address, that one address is added to the white list.
3652If set to a domain name, any address at that domain can receive
3653email from Gerrit.
3654+
3655By default, unset, permitting delivery to any email address.
3656
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07003657[[sendemail.includeDiff]]sendemail.includeDiff::
3658+
Bruce Zueb00ff32012-11-27 17:38:10 +08003659If true, new change emails and merged change emails from Gerrit
3660will include the complete unified diff of the change.
3661Variable maxmimumDiffSize places an upper limit on how large the
3662email can get when this option is enabled.
Shawn O. Pearce02aacbc2012-06-12 13:44:22 -07003663+
3664By default, false.
3665
Shawn O. Pearce28a950b2012-06-12 14:36:34 -07003666[[sendemail.maximumDiffSize]]sendemail.maximumDiffSize::
3667+
3668Largest size of unified diff output to include in an email. When
3669the diff exceeds this size the file paths will be listed instead.
3670Standard byte unit suffixes are supported.
3671+
3672By default, 256 KiB.
3673
Alex Blewitt9cca7402011-02-11 01:39:30 +00003674[[sendemail.importance]]sendemail.importance::
3675+
3676If present, emails sent from Gerrit will have the given level
3677of importance. Valid values include 'high' and 'low', which
3678email clients will render in different ways.
3679+
3680By default, unset, so no Importance header is generated.
3681
3682[[sendemail.expiryDays]]sendemail.expiryDays::
3683+
3684If present, emails sent from Gerrit will expire after the given
3685number of days. This will add the Expiry-Date header and
3686email clients may expire or expunge mails whose Expiry-Date
3687header is in the past. This should be a positive non-zero
3688number indicating how many days in the future the mails
3689should expire.
3690+
3691By default, unset, so no Expiry-Date header is generated.
3692
Shawn O. Pearcedba97642011-09-07 20:12:31 -07003693
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003694[[site]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003695=== Section site
Shawn O. Pearcedba97642011-09-07 20:12:31 -07003696
Shawn Pearcec896eaa2016-08-23 19:38:58 -07003697[[site.allowOriginRegex]]site.allowOriginRegex::
3698+
3699List of regular expressions matching origins that should be permitted
3700to use the Gerrit REST API to read content. These should be trusted
3701applications as the sites may be able to use the user's credentials.
3702Only applies to GET and HEAD requests.
3703+
3704By default, unset, denying all cross-origin requests.
3705
Shawn O. Pearcedba97642011-09-07 20:12:31 -07003706[[site.refreshHeaderFooter]]site.refreshHeaderFooter::
3707+
3708If true the server checks the site header, footer and CSS files for
3709updated versions. If false, a server restart is required to change
3710any of these resources. Default is true, allowing automatic reloads.
3711
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003712[[ssh-alias]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003713=== Section ssh-alias
Shawn O. Pearce521380a2012-05-11 14:57:56 -07003714
3715Variables in section ssh-alias permit the site administrator to alias
3716another command from Gerrit or a plugin into the `gerrit` command
3717namespace. To alias `replication start` to `gerrit replicate`:
3718
3719----
3720[ssh-alias]
3721 replicate = replication start
3722----
Shawn O. Pearcedba97642011-09-07 20:12:31 -07003723
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08003724[[sshd]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003725=== Section sshd
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -07003726
Gustaf Lundhd60e90f2015-08-03 16:18:33 +02003727[[sshd.enableCompression]]sshd.enableCompression::
3728+
3729In the general case, we want to disable transparent compression, since
3730the majority of our data transfer is highly compressed Git pack files
3731and we cannot make them any smaller than they already are.
3732+
3733However, if there are CPU in abundance and the server is reachable
3734through slow networks, gits with huge amount of refs can benefit from
3735SSH-compression since git does not compress the ref announcement during
3736handshake.
3737+
3738Compression can be especially useful when Gerrit slaves are being used
3739for the larger clones and fetches and the master server mostly takes
3740small receive-packs.
3741+
3742By default, `false`.
3743
David Ostrovskye2921b62015-03-04 22:36:10 +01003744[[sshd.backend]]sshd.backend::
3745+
3746Starting from version 0.9.0 Apache SSHD project added support for NIO2
3747IoSession. To use the new NIO2 session the `backend` option must be set
Marco Miller4eba49e2016-04-06 08:23:01 -04003748to `NIO2`. Otherwise, this option must be set to `MINA`.
David Ostrovskye2921b62015-03-04 22:36:10 +01003749+
Luca Milanesiofc1ed9c2016-03-01 18:28:36 +00003750By default, `NIO2`.
David Ostrovskye2921b62015-03-04 22:36:10 +01003751
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003752[[sshd.listenAddress]]sshd.listenAddress::
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003753+
3754Specifies the local addresses the internal SSHD should listen
3755for connections on. The following forms may be used to specify
3756an address. In any form, `:'port'` may be omitted to use the
David Pursehousea3af2552016-08-02 14:04:44 +09003757default of `29418`.
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003758+
David Pursehousea3af2552016-08-02 14:04:44 +09003759* `'hostname':'port'` (for example `review.example.com:29418`)
3760* `'IPv4':'port'` (for example `10.0.0.1:29418`)
3761* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
3762* `+*:'port'+` (for example `+*:29418+`)
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003763
3764+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003765--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003766If multiple values are supplied, the daemon will listen on all
3767of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003768
Shawn O. Pearce6af6f5f2010-06-08 17:38:43 -07003769To disable the internal SSHD, set listenAddress to `off`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003770
David Pursehousea3af2552016-08-02 14:04:44 +09003771By default, `*:29418`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003772--
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -07003773
James Y Knight910bd862011-01-11 20:05:56 -05003774[[sshd.advertisedAddress]]sshd.advertisedAddress::
3775+
3776Specifies the addresses clients should be told to connect to.
3777This may differ from sshd.listenAddress if a firewall based port
3778redirector is being used, making Gerrit appear to answer on port
377922. The following forms may be used to specify an address. In any
3780form, `:'port'` may be omitted to use the default SSH port of 22.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003781
David Pursehousea3af2552016-08-02 14:04:44 +09003782* `'hostname':'port'` (for example `review.example.com:22`)
3783* `'IPv4':'port'` (for example `10.0.0.1:29418`)
3784* `['IPv6']:'port'` (for example `[ff02::1]:29418`)
James Y Knight910bd862011-01-11 20:05:56 -05003785
3786+
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003787--
James Y Knight910bd862011-01-11 20:05:56 -05003788If multiple values are supplied, the daemon will advertise all
3789of them.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003790
David Pursehousea3af2552016-08-02 14:04:44 +09003791By default uses the value of `sshd.listenAddress`.
Edwin Kempina09ebcf2015-04-16 14:53:23 +02003792--
James Y Knight910bd862011-01-11 20:05:56 -05003793
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003794[[sshd.tcpKeepAlive]]sshd.tcpKeepAlive::
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07003795+
3796If true, enables TCP keepalive messages to the other side, so
3797the daemon can terminate connections if the peer disappears.
3798+
David Ostrovskye5b7f1a2013-10-23 21:10:39 +02003799Only effective when `sshd.backend` is set to `MINA`.
3800+
David Pursehousea3af2552016-08-02 14:04:44 +09003801By default, `true`.
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -07003802
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08003803[[sshd.threads]]sshd.threads::
3804+
3805Number of threads to use when executing SSH command requests.
3806If additional requests are received while all threads are busy they
David Pursehouse221d4f62012-06-08 17:38:08 +09003807are queued and serviced in a first-come-first-served order.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08003808+
Dariusz Luksza4b5a4162015-11-09 21:53:29 +01003809By default, 2x the number of CPUs available to the JVM.
Shawn O. Pearce1a4580b2009-11-19 17:37:10 -08003810
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003811[[sshd.batchThreads]]sshd.batchThreads::
3812+
3813Number of threads to allocate for SSH command requests from
Fredrik Luthander46843022012-03-13 16:11:02 +01003814link:access-control.html#non-interactive_users[non-interactive users].
3815If equals to 0, then all non-interactive requests are executed in the same
3816queue as interactive requests.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003817+
3818Any other value will remove the number of threads from the queue
3819allocated to interactive users, and create a separate thread pool
3820of the requested size, which will be used to run commands from
3821non-interactive users.
3822+
3823If the number of threads requested for non-interactive users is larger
3824than the total number of threads allocated in sshd.threads, then the
David Pursehouse92463562013-06-24 10:16:28 +09003825value of sshd.threads is increased to accommodate the requested value.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003826+
Dariusz Luksza145de472015-11-09 18:44:35 +01003827By default is 1 on single core node, 2 otherwise.
Nico Sallembienfc53f7f2010-05-18 16:40:10 -07003828
Kenny Root15ac1b82010-02-24 00:29:20 -08003829[[sshd.streamThreads]]sshd.streamThreads::
3830+
3831Number of threads to use when formatting events to asynchronous
3832streaming clients. Event formatting is multiplexed onto this thread
3833pool by a simple FIFO scheduling system.
3834+
3835By default, 1 plus the number of CPUs available to the JVM.
3836
Edwin Kempinb5df3b82011-10-10 11:31:14 +02003837[[sshd.commandStartThreads]]sshd.commandStartThreads::
Shawn O. Pearced6296552011-05-15 13:56:30 -07003838+
3839Number of threads used to parse a command line submitted by a client
3840over SSH for execution, create the internal data structures used by
3841that command, and schedule it for execution on another thread.
3842+
3843By default, 2.
3844
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07003845[[sshd.maxAuthTries]]sshd.maxAuthTries::
3846+
3847Maximum number of authentication attempts before the server
3848disconnects the client. Each public key that a client has loaded
3849into its local agent counts as one auth request. Users can work
3850around the server's limit by loading less keys into their agent,
3851or selecting a specific key in their `~/.ssh/config` file with
3852the `IdentityFile` option.
3853+
3854By default, 6.
3855
3856[[sshd.loginGraceTime]]sshd.loginGraceTime::
3857+
3858Time in seconds that a client has to authenticate before the server
3859automatically terminates their connection. Values should use common
3860unit suffixes to express their setting:
3861+
3862* s, sec, second, seconds
3863* m, min, minute, minutes
3864* h, hr, hour, hours
3865* d, day, days
3866
3867+
3868By default, 2 minutes.
3869
Christian Aistleitner3d794592013-04-08 00:19:40 +02003870[[sshd.idleTimeout]]sshd.idleTimeout::
3871+
3872Time in seconds after which the server automatically terminates idle
3873connections (or 0 to disable closing of idle connections). Values
3874should use common unit suffixes to express their setting:
3875+
3876* s, sec, second, seconds
3877* m, min, minute, minutes
3878* h, hr, hour, hours
3879* d, day, days
3880
3881+
3882By default, 0.
3883
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07003884[[sshd.maxConnectionsPerUser]]sshd.maxConnectionsPerUser::
3885+
3886Maximum number of concurrent SSH sessions that a user account
3887may open at one time. This is the number of distinct SSH logins
David Pursehouse221d4f62012-06-08 17:38:08 +09003888that each user may have active at one time, and is not related to
Shawn O. Pearce8a0bf362010-11-05 17:49:41 -07003889the number of commands a user may issue over a single connection.
3890If set to 0, there is no limit.
3891+
3892By default, 64.
3893
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003894[[sshd.cipher]]sshd.cipher::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003895+
3896Available ciphers. To permit multiple ciphers, specify multiple
3897`sshd.cipher` keys in the configuration file, one cipher name
3898per key. Cipher names starting with `+` are enabled in addition
3899to the default ciphers, cipher names starting with `-` are removed
3900from the default cipher set.
3901+
David Pursehousea3af2552016-08-02 14:04:44 +09003902Supported ciphers: `aes128-cbc`, `aes128-cbc`, `aes256-cbc`, `blowfish-cbc`,
3903`3des-cbc`, `none`.
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003904+
3905By default, all supported ciphers except `none` are available.
3906
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07003907[[sshd.mac]]sshd.mac::
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003908+
3909Available MAC (message authentication code) algorithms. To permit
3910multiple algorithms, specify multiple `sshd.mac` keys in the
3911configuration file, one MAC per key. MAC names starting with `+`
3912are enabled in addition to the default MACs, MAC names starting with
3913`-` are removed from the default MACs.
3914+
David Pursehousea3af2552016-08-02 14:04:44 +09003915Supported MACs: `hmac-md5`, `hmac-md5-96`, `hmac-sha1`, `hmac-sha1-96`,
3916`hmac-sha2-256`, `hmac-sha2-512`.
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07003917+
3918By default, all supported MACs are available.
3919
Scott Dialb4a04fa2016-03-15 09:44:11 -04003920[[sshd.kex]]sshd.kex::
3921+
3922--
3923Available key exchange algorithms. To permit multiple algorithms,
3924specify multiple `sshd.kex` keys in the configuration file, one key
3925exchange algorithm per key. Key exchange algorithm names starting
3926with `+` are enabled in addition to the default key exchange
3927algorithms, key exchange algorithm names starting with `-` are
3928removed from the default key exchange algorithms.
3929
3930In the following example configuration, support for the 1024-bit
3931`diffie-hellman-group1-sha1` key exchange is disabled while leaving
3932all of the other default algorithms enabled:
3933
3934----
3935[sshd]
3936 kex = -diffie-hellman-group1-sha1
3937----
3938
3939Supported key exchange algorithms:
3940
3941* `ecdh-sha2-nistp521`
3942* `ecdh-sha2-nistp384`
3943* `ecdh-sha2-nistp256`
3944* `diffie-hellman-group-exchange-sha256`
3945* `diffie-hellman-group-exchange-sha1`
3946* `diffie-hellman-group14-sha1`
3947* `diffie-hellman-group1-sha1`
3948
3949By default, all supported key exchange algorithms are available.
3950Without Bouncy Castle, `diffie-hellman-group1-sha1` is the only
3951available algorithm.
3952--
3953
Alex Blewitt7efb06f2013-04-01 12:46:48 -04003954[[sshd.kerberosKeytab]]sshd.kerberosKeytab::
3955+
3956Enable kerberos authentication for SSH connections. To permit
3957kerberos authentication, the server must have a host principal
3958(see `sshd.kerberosPrincipal`) which is acquired from a keytab.
3959This must be provisioned by the kerberos administrators, and is
3960typically installed into `/etc/krb5.keytab` on host machines.
3961+
3962The keytab must contain at least one `host/` principal, typically
3963using the host's canonical name. If it does not use the
3964canonical name, the `sshd.kerberosPrincipal` should be configured
3965with the correct name.
3966+
3967By default, not set and so kerberos authentication is not enabled.
3968
3969[[sshd.kerberosPrincipal]]sshd.kerberosPrincipal::
3970+
3971If kerberos authentication is enabled with `sshd.kerberosKeytab`,
3972instead use the given principal name instead of the default.
3973If the principal does not begin with `host/` a warning message is
3974printed and may prevent successful authentication.
3975+
3976This may be useful if the host is behind an IP load balancer or
3977other SSH forwarding systems, since the principal name is constructed
3978by the client and must match for kerberos authentication to work.
3979+
3980By default, `host/canonical.host.name`
3981
Shawn Pearce318bfca2013-10-17 22:15:38 -07003982[[sshd.requestLog]]sshd.requestLog::
3983+
3984Enable (or disable) the `'$site_path'/logs/sshd_log` request log.
3985If enabled, a request log file is written out by the SSH daemon.
3986+
David Ostrovsky8e4a9902013-11-19 23:57:48 +01003987`log4j.appender` with the name `sshd_log` can be configured to overwrite
3988programmatic configuration.
3989+
David Pursehousea3af2552016-08-02 14:04:44 +09003990By default, `true`.
Shawn Pearce318bfca2013-10-17 22:15:38 -07003991
David Ostrovsky985201b2015-03-04 22:37:33 +01003992[[sshd.rekeyBytesLimit]]sshd.rekeyBytesLimit::
3993+
3994The SSH daemon will issue a rekeying after a certain amount of data.
3995This configuration option allows you to tweak that setting.
3996+
3997By default, 1073741824 (bytes, 1GB).
3998+
David Pursehousea3af2552016-08-02 14:04:44 +09003999The `rekeyBytesLimit` cannot be set to lower than 32.
David Ostrovsky985201b2015-03-04 22:37:33 +01004000
4001[[sshd.rekeyTimeLimit]]sshd.rekeyTimeLimit::
4002+
4003The SSH daemon will issue a rekeying after a certain amount of time.
4004This configuration option allows you to tweak that setting.
4005+
4006By default, 1h.
4007+
4008Set to 0 to disable this check.
4009
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004010[[suggest]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004011=== Section suggest
Shawn O. Pearce07bd6fb2011-04-29 19:15:47 -07004012
Sven Selberg42d9d292014-08-13 11:20:11 +02004013[[suggest.maxSuggestedReviewers]]suggest.maxSuggestedReviewers::
4014+
4015The maximum numbers of reviewers suggested.
4016+
4017By default 10.
4018
Edwin Kempinf957dc22012-10-19 20:41:18 +02004019[[suggest.from]]suggest.from::
4020+
4021The number of characters that a user must have typed before suggestions
Patrick Hiesel87880b02016-05-03 18:15:08 +02004022are provided. If set to 0, suggestions are always provided. This is only
4023used for suggesting accounts when adding members to a group.
Edwin Kempinf957dc22012-10-19 20:41:18 +02004024+
4025By default 0.
4026
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004027[[theme]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004028=== Section theme
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08004029
4030[[theme.backgroundColor]]theme.backgroundColor::
4031+
4032Background color for the page, and major data tables like the all
4033open changes table or the account dashboard. The value must be a
4034valid HTML hex color code, or standard color name.
4035+
Chad Horohoebbdf7482012-11-13 18:23:15 -08004036By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08004037
4038[[theme.topMenuColor]]theme.topMenuColor::
4039+
4040This is the color of the main menu bar at the top of the page.
4041The value must be a valid HTML hex color code, or standard color
Chad Horohoebbdf7482012-11-13 18:23:15 -08004042name.
4043+
4044By default white, `FFFFFF`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08004045
4046[[theme.textColor]]theme.textColor::
4047+
4048Text color for the page, and major data tables like the all
4049open changes table or the account dashboard. The value must be a
4050valid HTML hex color code, or standard color name.
4051+
Chad Horohoebbdf7482012-11-13 18:23:15 -08004052By default dark grey, `353535`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08004053
4054[[theme.trimColor]]theme.trimColor::
4055+
4056Primary color used as a background color behind text. This is
4057the color of the main menu bar at the top, of table headers,
4058and of major UI areas that we want to offset from other portions
4059of the page. The value must be a valid HTML hex color code, or
4060standard color name.
4061+
Chad Horohoebbdf7482012-11-13 18:23:15 -08004062By default a light grey, `EEEEEE`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08004063
4064[[theme.selectionColor]]theme.selectionColor::
4065+
4066Background color used within a trimColor area to denote the currently
4067selected tab, or the background color used in a table to denote the
4068currently selected row. The value must be a valid HTML hex color
4069code, or standard color name.
4070+
Chad Horohoebbdf7482012-11-13 18:23:15 -08004071By default a pale blue, `D8EDF9`.
Shawn O. Pearce2ba3ab42010-02-25 12:10:10 -08004072
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01004073[[theme.changeTableOutdatedColor]]theme.changeTableOutdatedColor::
4074+
4075Background color used for patch outdated messages. The value must be
4076a valid HTML hex color code, or standard color name.
4077+
Edwin Kempinb0347332012-07-17 10:14:32 +02004078By default a shade of red, `F08080`.
Andrew Hutchingscfd7abb2012-06-29 10:57:05 +01004079
4080[[theme.tableOddRowColor]]theme.tableOddRowColor::
4081+
4082Background color for tables such as lists of open reviews for odd
4083rows. This is so you can have a different color for odd and even
4084rows of the table. The value must be a valid HTML hex color code,
4085or standard color name.
4086+
4087By default transparent.
4088
4089[[theme.tableEvenRowColor]]theme.tableEvenRowColor::
4090+
4091Background color for tables such as lists of open reviews for even
4092rows. This is so you can have a different color for odd and even
4093rows of the table. The value must be a valid HTML hex color code,
4094or standard color name.
4095+
4096By default transparent.
4097
Shawn O. Pearcea83bb1c2011-05-20 08:46:48 -07004098A different theme may be used for signed-in vs. signed-out user status
4099by using the "signed-in" and "signed-out" theme sections. Variables
4100not specified in a section are inherited from the default theme.
4101
4102----
4103[theme]
4104 backgroundColor = FFFFFF
4105[theme "signed-in"]
4106 backgroundColor = C0C0C0
4107[theme "signed-out"]
4108 backgroundColor = 00FFFF
4109----
4110
David Ostrovsky117c6032013-08-09 00:44:56 +02004111As example, here is the theme configuration to have the old green look:
4112
4113----
4114[theme]
4115 backgroundColor = FCFEEF
4116 textColor = 000000
4117 trimColor = D4E9A9
4118 selectionColor = FFFFCC
4119 topMenuColor = D4E9A9
4120 changeTableOutdatedColor = F08080
4121[theme "signed-in"]
4122 backgroundColor = FFFFFF
4123----
4124
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004125[[trackingid]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004126=== Section trackingid
Goran Lungberg04132a12010-06-15 17:20:37 -07004127
Shawn O. Pearcee800b1e2010-06-16 17:33:43 -07004128Tagged footer lines containing references to external
4129tracking systems, parsed out of the commit message and
David Pursehoused55a6b62015-02-27 17:39:38 +09004130saved in Gerrit's secondary index.
Shawn Pearceff61c8a2013-10-07 19:35:53 -07004131
4132After making changes to this section, existing changes
Shawn Pearce9f4de522013-11-29 11:57:53 -08004133must be reindexed with link:pgm-reindex.html[reindex].
Goran Lungberg04132a12010-06-15 17:20:37 -07004134
Edwin Kempinbb421f12011-08-25 11:19:00 +02004135The tracking ids are searchable using tr:<tracking id> or
Shawn O. Pearce91763a02010-06-16 15:39:33 -07004136bug:<tracking id>.
Goran Lungberg04132a12010-06-15 17:20:37 -07004137
4138----
4139[trackingid "jira-bug"]
4140 footer = Bugfix:
David Pursehousece7f6862015-02-19 14:52:45 +09004141 footer = Bug:
Goran Lungberg04132a12010-06-15 17:20:37 -07004142 match = JRA\\d{2,8}
4143 system = JIRA
4144
4145[trackingid "jira-feature"]
4146 footer = Feature
4147 match = JRA(\\d{2,8})
4148 system = JIRA
4149----
4150
4151[[trackingid.name.footer]]trackingid.<name>.footer::
4152+
David Pursehousece7f6862015-02-19 14:52:45 +09004153A prefix tag that identifies the footer line to parse for tracking ids.
4154+
4155Several trackingid entries can have the same footer tag, and a single trackingid
4156entry can have multiple footer tags.
4157+
4158If multiple footer tags are specified, each tag will be parsed separately and
4159duplicates will be ignored.
4160+
4161The trailing ":" is optional.
Goran Lungberg04132a12010-06-15 17:20:37 -07004162
4163[[trackingid.name.match]]trackingid.<name>.match::
4164+
Magnus Bäcke5611832011-02-02 08:57:15 +01004165A link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
4166Java regular expression (java.util.regex)] used to match the
4167external tracking id part of the footer line. The match can
4168result in several entries in the DB. If grouping is used in the
4169regex the first group will be interpreted as the tracking id.
Christian Aistleitner5cec3682013-03-16 23:02:37 +01004170Tracking ids longer than 32 characters will be ignored.
Goran Lungberg04132a12010-06-15 17:20:37 -07004171+
4172The configuration file parser eats one level of backslashes, so the
4173character class `\s` requires `\\s` in the configuration file. The
4174parser also terminates the line at the first `#`, so a match
4175expression containing # must be wrapped in double quotes.
4176
4177[[trackingid.name.system]]trackingid.<name>.system::
4178+
David Pursehouse221d4f62012-06-08 17:38:08 +09004179The name of the external tracking system (maximum 10 characters).
Goran Lungberg04132a12010-06-15 17:20:37 -07004180It is possible to have several trackingid entries for the same
4181tracking system.
4182
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004183[[transfer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004184=== Section transfer
Shawn O. Pearce6e4dfdd2010-05-12 17:26:08 -07004185
4186[[transfer.timeout]]transfer.timeout::
4187+
4188Number of seconds to wait for a single network read or write
4189to complete before giving up and declaring the remote side is
4190not responding. If 0, there is no timeout, and this server will
4191wait indefinitely for a transfer to finish.
4192+
4193A timeout should be large enough to mostly transfer the objects to
4194the other side. 1 second may be too small for larger projects,
4195especially over a WAN link, while 10-30 seconds is a much more
4196reasonable timeout value.
4197+
4198Defaults to 0 seconds, wait indefinitely.
4199
lincoln2be11602010-07-05 10:53:25 -03004200
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004201[[upload]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004202=== Section upload
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004203
lincoln2be11602010-07-05 10:53:25 -03004204Sets the group of users allowed to execute 'upload-pack' on the
4205server, 'upload-pack' is what runs on the server during a user's
4206fetch, clone or repo sync command.
4207
4208----
4209[upload]
4210 allowGroup = GROUP_ALLOWED_TO_EXECUTE
4211 allowGroup = YET_ANOTHER_GROUP_ALLOWED_TO_EXECUTE
4212----
4213
4214[[upload.allowGroup]]upload.allowGroup::
4215+
4216Name of the groups of users that are allowed to execute 'upload-pack'
4217on the server. One or more groups can be set.
4218+
4219If no groups are added, any user will be allowed to execute
4220'upload-pack' on the server.
4221
Edwin Kempinfa0d4942015-07-16 12:38:52 +02004222[[urlAlias]]
4223=== Section urlAlias
4224
4225URL aliases define regular expressions for URL tokens that are mapped
4226to target URL tokens.
4227
4228Each URL alias must be specified in its own subsection. The subsection
4229name should be a descriptive name. It must be unique, but is not
4230interpreted in any way.
4231
4232The URL aliases are applied in no particular order. The first matching
4233URL alias is used and further matches are ignored.
4234
4235URL aliases can be used to map plugin screens into the Gerrit URL
4236namespace, or to replace Gerrit screens by plugin screens.
4237
4238Example:
4239
4240----
4241[urlAlias "MyPluginScreen"]
4242 match = /myscreen/(.*)
4243 token = /x/myplugin/myscreen/$1
4244[urlAlias "MyChangeScreen"]
4245 match = /c/(.*)
4246 token = /x/myplugin/c/$1
4247----
4248
4249[[urlAlias.match]]urlAlias.match::
4250+
4251A regular expression for a URL token.
4252+
4253The matched URL token is replaced by `urlAlias.token`.
4254
4255[[urlAlias.token]]urlAlias.token::
4256+
4257The target URL token.
4258+
4259It can contain placeholders for the groups matched by the
4260`urlAlias.match` regular expression: `$1` for the first matched group,
4261`$2` for the second matched group, etc.
lincoln2be11602010-07-05 10:53:25 -03004262
Stefan Beller0f724ff2015-07-17 10:17:51 -07004263[[submodule]]
4264=== Section submodule
4265
Shawn Pearcedc477cd2016-03-24 19:56:18 -07004266[[submodule.verbosesuperprojectupdate]]submodule.verboseSuperprojectUpdate::
Stefan Beller0f724ff2015-07-17 10:17:51 -07004267+
4268When using link:user-submodules.html#automatic_update[automatic superproject updates]
Zhen Chenc877ca92016-07-27 14:22:37 -07004269this option will determine how the submodule commit messages are included into
Stefan Beller0f724ff2015-07-17 10:17:51 -07004270the commit message of the superproject update.
4271+
Zhen Chenc877ca92016-07-27 14:22:37 -07004272If `FALSE`, will not include any commit messages for the gitlink update.
4273+
4274If `SUBJECT_ONLY`, will include only the commit subjects.
4275+
4276If `TRUE`, will include full commit messages.
4277+
4278By default this is `TRUE`.
Stefan Beller0f724ff2015-07-17 10:17:51 -07004279
Shawn Pearcedc477cd2016-03-24 19:56:18 -07004280[[submodule.enableSuperProjectSubscriptions]]submodule.enableSuperProjectSubscriptions::
Stefan Beller8cc252e2016-03-10 10:06:53 -08004281+
4282This allows to enable the superproject subscription mechanism.
4283+
4284By default this is true.
Stefan Beller0f724ff2015-07-17 10:17:51 -07004285
Yuxuan 'fishy' Wang3fba03a2013-12-10 15:08:11 -08004286[[user]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004287=== Section user
Shawn O. Pearce0a351912009-06-01 08:14:46 -07004288
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004289[[user.name]]user.name::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07004290+
4291Name that Gerrit calls itself in Git when it creates a new Git
4292commit, such as a merge during change submission.
4293+
4294By default this is "Gerrit Code Review".
4295
Shawn O. Pearce92a7fd12009-08-18 19:52:48 -07004296[[user.email]]user.email::
Shawn O. Pearce0a351912009-06-01 08:14:46 -07004297+
4298Email address that Gerrit refers to itself as when it creates a
4299new Git commit, such as a merge commit during change submission.
4300+
4301If not set, Gerrit generates this as "gerrit@`hostname`", where
4302`hostname` is the hostname of the system Gerrit is running on.
4303+
4304By default, not set, generating the value at startup.
4305
Edwin Kempin0e02ded2011-09-16 15:10:14 +02004306[[user.anonymousCoward]]user.anonymousCoward::
4307+
David Pursehousea1d633b2014-05-02 17:21:02 +09004308Username that is displayed in the Gerrit Web UI and in e-mail
Edwin Kempin0e02ded2011-09-16 15:10:14 +02004309notifications if the full name of the user is not set.
4310+
4311By default "Anonymous Coward" is used.
4312
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -07004313
Dave Borowitz532342bf2015-06-18 20:28:22 -04004314== [[secure.config]]File `etc/secure.config`
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08004315The optional file `'$site_path'/etc/secure.config` overrides (or
4316supplements) the settings supplied by `'$site_path'/etc/gerrit.config`.
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08004317The file should be readable only by the daemon process and can be
4318used to contain private configuration entries that wouldn't normally
4319be exposed to everyone.
4320
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08004321Sample `etc/secure.config`:
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08004322----
Shawn O. Pearce34f38cf2011-06-16 19:18:54 -07004323[auth]
4324 registerEmailPrivateKey = 2zHNrXE2bsoylzUqDxZp0H1cqUmjgWb6
4325
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08004326[database]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08004327 username = webuser
4328 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08004329
4330[ldap]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08004331 password = l3tm3srch
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08004332
4333[httpd]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08004334 sslKeyPassword = g3rr1t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08004335
4336[sendemail]
Shawn O. Pearce9d342a42009-12-16 15:49:05 -08004337 smtpPass = sp@m
Shawn O. Pearce7929d872011-05-15 13:33:15 -07004338
4339[remote "bar"]
4340 password = s3kr3t
Shawn O. Pearce0d4037a2009-11-12 18:33:46 -08004341----
4342
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004343== File `etc/peer_keys`
Johan Bjork3e5ee302012-01-27 17:59:54 +01004344
4345The optional file `'$site_path'/etc/peer_keys` controls who can
4346login as the 'Gerrit Code Review' user, required for the link:cmd-suexec.html[suexec]
4347command.
4348
4349The format is one Base-64 encoded public key per line.
4350
4351
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004352== Database system_config
Shawn O. Pearce7b405712009-05-08 18:27:53 -07004353
4354Several columns in the `system_config` table within the metadata
4355database may be set to control how Gerrit behaves.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08004356
4357[NOTE]
4358The contents of the `system_config` table are cached at startup
4359by Gerrit. If you modify any columns in this table, Gerrit needs
4360to be restarted before it will use the new values.
4361
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004362=== Configurable Parameters
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08004363
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07004364site_path::
4365+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08004366Local filesystem directory holding the site customization assets.
4367Placing this directory under version control and/or backup is a
4368good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07004369+
Shawn O. Pearcec5fed822009-11-17 16:10:10 -08004370Files in this directory provide additional configuration.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07004371+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08004372Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -07004373+
Dave Borowitz1e49e142013-04-09 12:14:57 -07004374* link:config-themes.html[Themes]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08004375
Shawn O. Pearce5500e692009-05-28 15:55:01 -07004376GERRIT
4377------
4378Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07004379
4380SEARCHBOX
4381---------