blob: d16218fe1a026382e9173b85ec0584dcac79b37f [file] [log] [blame]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -08001Gerrit2 - Configuration
2=======================
3
Shawn O. Pearce51967cd2009-05-08 19:46:57 -07004File `gerrit.config`
5--------------------
6
7The optional file `'$site_path'/gerrit.config` is a Git-style config
8file that controls many host specific settings for Gerrit.
9
10[NOTE]
11The contents of the `gerrit.config` file are cached at startup
12by Gerrit. If you modify any propeties in this file, Gerrit needs
13to be restarted before it will use the new values.
14
15Sample `gerrit.config`:
16----
17[core]
18packedGitLimit = 200 m
19
20[cache]
21directory = /var/cache/gerrit2
22
23[cache "diff"]
24diskbuffer = 10 m
25----
26
Shawn O. Pearce0d3ecff2009-06-01 08:34:17 -070027Section auth
28~~~~~~~~~~~~
29
30See also link:config-sso.html[SSO configuration].
31
32auth.type::
33+
34Type of user authentication employed by Gerrit. This setting has
35two supported values:
36+
37* `OpenID`
38+
39The default setting. Gerrit uses any valid OpenID
40provider chosen by the end-user. For more information see
41http://openid.net/[openid.net]
42+
43* `HTTP`
44+
45Gerrit relies upon data in the HTTP request, such as the HTTP basic
46authentication, or some types of commerical single-sign-on solutions.
47
48+
49By default, OpenID.
50
51auth.httpHeader::
52+
53HTTP header to trust the username from, or unset to select HTTP basic
54or digest authentication. Only used if `auth.type` was set to HTTP.
55
56auth.emailFormat::
57+
58Optional format string to construct user email addresses out of
59user login names. Only used if auth.type is HTTP.
60+
61This value can be set to a format string, where `\{0\}` is replaced
62with the login name. E.g. "\{0\}+gerrit@example.com" with a user
63login name of "foo" will produce "foo+gerrit@example.com" during
64the first time user "foo" registers.
65
66auth.contributorAgreements::
67+
68Controls whether or not the contributor agreement features are
69enabled for the Gerrit site. If enabled a user must complete a
70contributor agreement before they can upload changes.
71+
72If enabled, the admin must also insert one or more rows into
73`contributor_agreements` and create agreement files under
74`'$site_path'/static`, so users can actually complete one or
75more agreements.
76+
77By default this is false (no agreements are used).
78
79auth.maxSessionAge::
80+
81Maximum number of minutes that an XSRF token or a session cookie
82is permitted to be valid for.
83+
84By default this is 720 minutes (12 hours). Any browser session
85which has not been used in this time span will ask the user to
86login again.
87+
88Administrators may increase (or decrease) this setting to control
89how long an idle session is allowed to remain alive.
90
91auth.allowGoogleAccountUpgrade::
92+
93Allow old Gerrit1 users to seamlessly upgrade from Google Accounts
94on Google App Engine to OpenID authentication. This should only be
95set to true on a Gerrit2 database that was imported from a Gerrit1
96database run on Google App Engine. Having it enabled incurs an
97extra database query when new Google Account users register with
98the Gerrit2 server.
99+
100Its strongly encouraged to unset this once the following query
101drops to 0, or close to 0:
102+
103====
104 SELECT COUNT(*) FROM account_external_ids e
105 WHERE e.external_id LIKE 'Google Account %'
106 AND NOT EXISTS (SELECT 1
107 FROM account_external_ids o
108 WHERE o.account_id = e.account_id
109AND o.external_id LIKE '%.google.com%/id?id=%');
110====
111+
112By default, unset/false.
113
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700114Section cache[[section_cache]]
115~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700116
117cache.directory::
118+
119Path to a local directory where Gerrit can write cached entities for
120future lookup. This local disk cache is used to retain expensively
121computed information across restarts.
122+
123If the location does not exist, Gerrit will try to create it.
124+
125Default is `'$site_path'/disk_cache`.
126
127cache.maxAge::
128Default setting inherited by named caches; see below.
129cache.memoryLimit::
130Default setting inherited by named caches; see below.
131cache.diskLimit::
132Default setting inherited by named caches; see below.
133cache.diskBuffer::
134Default setting inherited by named caches; see below.
135
136cache.<name>.maxAge::
137+
138Maximum age, in minutes, to keep an entry in the cache. If an
139entry has not been accessed in this period of time, it is removed
140from the cache.
141+
142Default is 129600 (90 days); 5 for cache "openid".
143
144cache.<name>.memoryLimit::
145+
146Maximum number of cache items to retain in memory. Keep in mind
147this is total number of items, not bytes of heap used.
148+
149Default is 1024.
150
151cache.<name>.diskLimit::
152+
153Maximum number of cache items to retain on disk, if this cache
154supports storing its items to disk. Like memoryLimit, this is
155total number of items, not bytes of disk used.
156+
157Default is 16384.
158
159cache.<name>.diskBuffer::
160+
161Number of bytes to buffer in memory before writing less frequently
162accessed cache items to disk, if this cache supports storing its
163items to disk.
164+
165Default is 5 MiB.
166+
167Common unit suffixes of 'k', 'm', or 'g' are supported.
168
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700169Standard Caches[[cache_names]]
170^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700171
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700172cache `"accounts"`::
173+
174Caches records from the `accounts` database table, containing user
175preferences and preferred display name/email address. If updates are
176made directly to this database table, this cache should be flushed.
177
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700178cache `"diff"`::
179+
180Caches the edit list describing the differences between two versions
181of a file. Gerrit uses this cache to accelerate display of file
182contents by computing the difference only once, typically during
183the initial upload.
184+
185The average entry in this cache is approximately 1100 bytes when
186stored on disk. The in-memory representation is only slightly
187larger, closer to 1300 bytes, depending on JVM.
188+
189Keeping entries for 90 days gives sufficient time for most changes
190to be submitted or abandoned before their relevant difference items
191expire out.
192
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700193cache `"groups"`::
194+
195Caches which groups a user is a member of. This is derived from the
196`account_group_members` table, and also the `account_external_ids`
197table if OpenID authentication is enabled. If either table is
198modified directly in the database, this cache should be flushed.
199
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700200cache `"openid"`::
201+
202If OpenID authentication is enabled, caches the OpenID discovery
203response by URL, for up to 5 minutes. This can reduce the time
204required for OpenID authentication through very common providers,
205such as Google Accounts.
206
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700207cache `"projects"`::
208+
209Caches the project description records, from the `projects` table
210in the database. If a project record is updated or deleted, this
211cache should be flushed. Newly inserted projects do not require
212a cache flush, as they will be read upon first reference.
213
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700214cache `"sshkeys"`::
215+
216Caches unpacked versions of user SSH keys, so the internal SSH daemon
217can match against them during authentication. The unit of storage
218is per-user, so 1024 items translates to 1024 unique user accounts.
219As each individual user account may configure multiple SSH keys,
220the total number of keys may be larger than the item count.
Shawn O. Pearce4a452712009-05-28 20:12:33 -0700221+
222This cache is based off the `account_ssh_keys` table and the
223`accounts.ssh_user_name` column in the database. If either is
224modified directly, this cache should be flushed.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700225
Shawn O. Pearce4016a932009-05-28 15:12:40 -0700226See also link:cmd-flush-caches.html[gerrit flush-caches].
227
Shawn O. Pearce6854bdc2009-06-01 08:14:15 -0700228Section contactstore
229~~~~~~~~~~~~~~~~~~~~
230
231contactstore.url::
232+
233URL of the web based contact store Gerrit will send any offline
234contact information to when it collects the data from users as part
235of a contributor agreement.
236+
237See link:config-contact.html[Contact Information].
238
239contactstore.appsec::
240+
241Shared secret of the web based contact store.
242
243Section core
244~~~~~~~~~~~~
245
246core.packedGitWindowSize::
247+
248Number of bytes of a pack file to load into memory in a single
249read operation. This is the "page size" of the JGit buffer cache,
250used for all pack access operations. All disk IO occurs as single
251window reads. Setting this too large may cause the process to load
252more data than is required; setting this too small may increase
253the frequency of `read()` system calls.
254+
255Default on JGit is 8 KiB on all platforms.
256+
257Common unit suffixes of 'k', 'm', or 'g' are supported.
258
259core.packedGitLimit::
260+
261Maximum number of bytes to load and cache in memory from pack files.
262If JGit needs to access more than this many bytes it will unload less
263frequently used windows to reclaim memory space within the process.
264As this buffer must be shared with the rest of the JVM heap, it
265should be a fraction of the total memory available.
266+
267Default on JGit is 10 MiB on all platforms.
268+
269Common unit suffixes of 'k', 'm', or 'g' are supported.
270
271core.deltaBaseCacheLimit::
272+
273Maximum number of bytes to reserve for caching base objects
274that multiple deltafied objects reference. By storing the entire
275decompressed base object in a cache Git is able to avoid unpacking
276and decompressing frequently used base objects multiple times.
277+
278Default on JGit is 10 MiB on all platforms. You probably do not
279need to adjust this value.
280+
281Common unit suffixes of 'k', 'm', or 'g' are supported.
282
283core.packedGitOpenFiles::
284+
285Maximum number of pack files to have open at once. A pack file
286must be opened in order for any of its data to be available in
287a cached window.
288+
289If you increase this to a larger setting you may need to also adjust
290the ulimit on file descriptors for the host JVM, as Gerrit needs
291additional file descriptors available for network sockets and other
292repository data manipulation.
293+
294Default on JGit is 128 file descriptors on all platforms.
295
296core.packedGitMmap::
297+
298When true, JGit will use `mmap()` rather than `malloc()+read()`
299to load data from pack files. The use of mmap can be problematic
300on some JVMs as the garbage collector must deduce that a memory
301mapped segment is no longer in use before a call to `munmap()`
302can be made by the JVM native code.
303+
304In server applications (such as Gerrit) that need to access many
305pack files, setting this to true risks artifically running out
306of virtual address space, as the garbage collector cannot reclaim
307unused mapped spaces fast enough.
308+
309Default on JGit is false. Although potentially slower, it yields
310much more predictable behavior.
311
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -0700312Section gerrit
313~~~~~~~~~~~~~~
314
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -0700315gerrit.basePath::
316+
317Local filesystem directory holding all Git repositories that
318Gerrit knows about and can process changes for. A project
319entity in Gerrit maps to a local Git repository by creating
320the path string `"$\{basePath}/$\{project_name}.git"`.
321+
322If relative, the path is resolved relative to `'$site_path'`.
323
Shawn O. Pearceeb7f8ce2009-06-01 09:57:15 -0700324gerrit.canonicalWebUrl::
325+
326The default URL for Gerrit to be accessed through.
327+
328Typically this would be set to "http://review.example.com/" or
329"http://example.com/gerrit/" so Gerrit can output links that point
330back to itself.
331+
332Setting this is highly recommended, as its necessary for the upload
333code invoked by "git push" or "repo upload" to output hyperlinks
334to the newly uploaded changes.
335
336gerrit.canonicalGitUrl::
337+
338Optional base URL for repositories available over the anonymous git
339protocol. For example, set this to `git://mirror.example.com/base/`
340to have Gerrit display patch set download URLs in the UI. Gerrit
341automatically appends the project name onto the end of the URL.
342+
343By default unset, as the git daemon must be configured externally
344by the system administrator, and might not even be running on the
345same host as Gerrit.
346
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -0700347Section gitweb[[section_gitweb]]
348~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
349
350See also link:config-gitweb.html[Gitweb Integration].
351
352gitweb.url::
353+
354Optional URL of an affiliated gitweb service. Defines the
355web location where a `gitweb.cgi` is installed to browse
Shawn O. Pearce9743d0b2009-06-01 10:10:06 -0700356gerrit.basePath and the repositories it contains.
Shawn O. Pearced7ba11f2009-06-01 09:35:41 -0700357+
358Gerrit appends any necessary query arguments onto the end of this URL.
359For example, "?p=$project.git;h=$commit".
360
Shawn O. Pearce0cb2b65f2009-06-01 09:48:45 -0700361Section repo
362~~~~~~~~~~~
363
364repo.showDownloadCommand::
365+
366If set to true, Gerrit advertises patch set downloads with the
367`repo download` command, assuming that all projects managed by this
368instance are generally worked on with the repo multi-repository tool.
369+
370By default, false, as not all instances will deploy repo.
371
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -0700372Section sshd
373~~~~~~~~~~~~
374
Shawn O. Pearce1d3cb4442009-05-30 14:03:31 -0700375sshd.listenAddress::
376+
377Specifies the local addresses the internal SSHD should listen
378for connections on. The following forms may be used to specify
379an address. In any form, `:'port'` may be omitted to use the
380default of 29418.
381+
382* 'hostname':'port' (for example `review.example.com:29418`)
383* 'IPv4':'port' (for example `10.0.0.1:29418`)
384* ['IPv6']:'port' (for example `[ff02::1]:29418`)
385* \*:'port' (for example `*:29418`)
386
387+
388If multiple values are supplied, the daemon will listen on all
389of them.
390+
391By default, *:29418.
392
Shawn O. Pearce9410f2c2009-05-14 10:26:47 -0700393sshd.reuseAddress::
394+
395If true, permits the daemon to bind to the port even if the port
396is already in use. If false, the daemon ensures the port is not
397in use before starting. Busy sites may need to set this to true
398to permit fast restarts.
399+
400By default, true.
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700401
Shawn O. Pearcefc9081f2009-05-14 10:26:59 -0700402sshd.tcpKeepAlive::
403+
404If true, enables TCP keepalive messages to the other side, so
405the daemon can terminate connections if the peer disappears.
406+
407By default, true.
408
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -0700409sshd.cipher::
410+
411Available ciphers. To permit multiple ciphers, specify multiple
412`sshd.cipher` keys in the configuration file, one cipher name
413per key. Cipher names starting with `+` are enabled in addition
414to the default ciphers, cipher names starting with `-` are removed
415from the default cipher set.
416+
417Supported ciphers: aes128-cbc, aes128-cbc, aes256-cbc, blowfish-cbc,
4183des-cbc, none.
419+
420By default, all supported ciphers except `none` are available.
421
422sshd.mac::
423+
424Available MAC (message authentication code) algorithms. To permit
425multiple algorithms, specify multiple `sshd.mac` keys in the
426configuration file, one MAC per key. MAC names starting with `+`
427are enabled in addition to the default MACs, MAC names starting with
428`-` are removed from the default MACs.
429+
430Supported MACs: hmac-md5, hmac-md5-96, hmac-sha1, hmac-sha1-96.
431+
432By default, all supported MACs are available.
433
Shawn O. Pearce0a351912009-06-01 08:14:46 -0700434Section user
435~~~~~~~~~~~~
436
437name::
438+
439Name that Gerrit calls itself in Git when it creates a new Git
440commit, such as a merge during change submission.
441+
442By default this is "Gerrit Code Review".
443
444email::
445+
446Email address that Gerrit refers to itself as when it creates a
447new Git commit, such as a merge commit during change submission.
448+
449If not set, Gerrit generates this as "gerrit@`hostname`", where
450`hostname` is the hostname of the system Gerrit is running on.
451+
452By default, not set, generating the value at startup.
453
Shawn O. Pearce0bf2f522009-05-14 11:02:03 -0700454
Shawn O. Pearce7b405712009-05-08 18:27:53 -0700455File `replication.config`
456-------------------------
457
Shawn O. Pearce51967cd2009-05-08 19:46:57 -0700458The optional file `'$site_path'/replication.config` controls how
Shawn O. Pearce7b405712009-05-08 18:27:53 -0700459Gerrit automatically replicates changes it makes to any of the Git
460repositories under its control.
461
462* link:config-replication.html[Git Replication/Mirroring]
463
464Database system_config
465----------------------
466
467Several columns in the `system_config` table within the metadata
468database may be set to control how Gerrit behaves.
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800469
470[NOTE]
471The contents of the `system_config` table are cached at startup
472by Gerrit. If you modify any columns in this table, Gerrit needs
473to be restarted before it will use the new values.
474
Shawn O. Pearce7b405712009-05-08 18:27:53 -0700475Configurable Parameters
476~~~~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800477
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700478site_path::
479+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800480Local filesystem directory holding the site customization assets.
481Placing this directory under version control and/or backup is a
482good idea.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700483+
Shawn O. Pearcee7ec0532009-05-08 09:42:54 -0700484SSH key files (`ssh_host_rsa_key` and `ssh_host_dsa_key` or
485`ssh_host_key`) in this directory provide the host keys for the
486internal SSH daemon.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700487+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800488Other files support site customization.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700489+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800490* link:config-headerfooter.html[Site Header/Footer]
Shawn O. Pearcee7ec0532009-05-08 09:42:54 -0700491* link:config-replication.html[Git Replication/Mirroring]
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800492
Shawn O. Pearce7b405712009-05-08 18:27:53 -0700493Not User Serviceable
494~~~~~~~~~~~~~~~~~~~~
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800495
496These fields generally shouldn't be modified.
497
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700498xsrf_private_key::
499+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800500A private key used to sign the XSRF (cross site request forgey)
501protection tokens. All RPC calls which can potentially modify
502data require that the client obtain, and then later present an XSRF
503token to Gerrit. The tokens are signed with this private key.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700504+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800505This column is automatically generated when the database is
506initialized. Changing it to a new value would cause all current
507XSRF tokens to be invalidated, forcing clients to either fail or
508retry any requests in progress.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700509+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800510Changing it is not recommended.
511
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700512account_private_key::
513+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800514Like xsrf_private_key, but used to sign the cookie that tells Gerrit
515what account the end-user has signed into. The key signs the cookie,
516preventing a client from spoofing another account.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700517+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800518This column is automatically generated when the database is
519initialized. Changing it to a new value would cause all current
520cookies to be invalidated, forcing clients to fail their current
521requests and require the user to sign in again.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700522+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800523Changing it is not recommended.
524
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700525admin_group_id::
526+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800527Unique identity of the group with full privileges. Any user who
528is a member of this group may manage any other group, any project,
529and other system settings over the web.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700530+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800531This is initialized by Gerrit to be the "Administrators" group.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700532+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800533Changing it is not recommended.
534
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700535anonymous_group_id::
536+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800537Unique identity of the group for anonymous (not authenticated) users.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700538+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800539All users are a member of this group, whether or not they are
540actually signed in to Gerrit. Any access rights assigned to
541this group are inherited by all users.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700542+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800543This is initialized by Gerrit to be the "Anonymous Users" group.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700544+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800545Changing it is not recommended.
546
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700547registered_group_id::
548+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800549Unique identity of the group for all authenticated users.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700550+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800551All signed-in users are a member of this group. Any access rights
552assigned to this group are inherited by all users once they have
553authenticated to Gerrit.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700554+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800555Since account registration is open and fairly easy to obtain,
556moving from the "Anonymous Users" group to this group is not
557very difficult. Caution should be taken when assigning any
558permissions to this group.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700559+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800560This is initialized by Gerrit to be the "Registered Users" group.
Shawn O. Pearce8e9c73b2009-05-08 17:38:25 -0700561+
Shawn O. Pearced2b73db2009-01-09 11:55:47 -0800562Changing it is not recommended.
563
Shawn O. Pearce5500e692009-05-28 15:55:01 -0700564GERRIT
565------
566Part of link:index.html[Gerrit Code Review]