/Documentation/config-gerrit.txt
https://code.google.com/ · Plain Text · 2440 lines · 2128 code · 312 blank · 0 comment · 0 complexity · ebb8d6e47bacb68a3059fe9cad2ac960 MD5 · raw file
Large files are truncated click here to view the full file
- Gerrit Code Review - Configuration
- ==================================
- File `etc/gerrit.config`
- ------------------------
- The optional file `'$site_path'/etc/gerrit.config` is a Git-style
- config file that controls many host specific settings for Gerrit.
- [NOTE]
- The contents of the `etc/gerrit.config` file are cached at startup
- by Gerrit. If you modify any properties in this file, Gerrit needs
- to be restarted before it will use the new values.
- Sample `etc/gerrit.config`:
- ----
- [core]
- packedGitLimit = 200 m
- [cache]
- directory = /var/cache/gerrit2
- [cache "diff"]
- diskbuffer = 10 m
- ----
- [[accounts]]Section accounts
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- [[accounts.visibility]]accounts.visibility::
- +
- Controls visibility of other users' dashboard pages and
- completion suggestions to web users.
- +
- If `ALL`, all users are visible to all other users, even
- anonymous users.
- +
- If `SAME_GROUP`, only users who are also members of a group the
- current user is a member of are visible.
- +
- If `VISIBLE_GROUP`, only users who are members of at least one group
- that is visible to the current user are visible.
- +
- If `NONE`, no users other than the current user are visible.
- +
- Default is `ALL`.
- [[addreviewer]]Section addreviewer
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- [[addreviewer.maxWithoutConfirmation]]addreviewer.maxWithoutConfirmation::
- +
- The maximum number of reviewers a user can add at once by adding a
- group as reviewer without being asked to confirm the operation.
- +
- If set to 0, the user will never be asked to confirm adding a group
- as reviewer.
- +
- Default is 10.
- +
- This setting only applies for adding reviewers in the Gerrit WebUI,
- but is ignored when adding reviewers with the
- link:cmd-set-reviewers.html[set-reviewers] command.
- [[addreviewer.maxAllowed]]addreviewer.maxAllowed::
- +
- The maximum number of reviewers a user can add at once by adding a
- group as reviewer.
- +
- If set to 0, there is no limit for the number of reviewers that can
- be added at once by adding a group as reviewer.
- +
- Default is 20.
- [[auth]]Section auth
- ~~~~~~~~~~~~~~~~~~~~
- See also link:config-sso.html[SSO configuration].
- [[auth.type]]auth.type::
- +
- Type of user authentication employed by Gerrit. The supported
- values are:
- +
- * `OpenID`
- +
- The default setting. Gerrit uses any valid OpenID
- provider chosen by the end-user. For more information see
- http://openid.net/[openid.net].
- +
- * `HTTP`
- +
- Gerrit relies upon data presented in the HTTP request. This includes
- HTTP basic authentication, or some types of commercial single-sign-on
- solutions. With this setting enabled the authentication must
- take place in the web server or servlet container, and not from
- within Gerrit.
- +
- * `HTTP_LDAP`
- +
- Exactly like `HTTP` (above), but additionally Gerrit pre-populates
- a user's full name and email address based on information obtained
- from the user's account object in LDAP. The user's group membership
- is also pulled from LDAP, making any LDAP groups that a user is a
- member of available as groups in Gerrit.
- +
- * `CLIENT_SSL_CERT_LDAP`
- +
- This authentication type is actually kind of SSO. Gerrit will configure
- Jetty's SSL channel to request the client's SSL certificate. For this
- authentication to work a Gerrit administrator has to import the root
- certificate of the trust chain used to issue the client's certificate
- into the <review-site>/etc/keystore.
- After the authentication is done Gerrit will obtain basic user
- registration (name and email) from LDAP, and some group memberships.
- Therefore, the "_LDAP" suffix in the name of this authentication type.
- This authentication type can only be used under hosted daemon mode, and
- the httpd.listenUrl must use https:// as the protocol.
- +
- * `LDAP`
- +
- Gerrit prompts the user to enter a username and a password, which
- it then verifies by performing a simple bind against the configured
- <<ldap.server,ldap.server>>. In this configuration the web server
- is not involved in the user authentication process.
- +
- The actual username used in the LDAP simple bind request is the
- account's full DN, which is discovered by first querying the
- directory using either an anonymous request, or the configured
- <<ldap.username>> identity.
- * `LDAP_BIND`
- +
- Gerrit prompts the user to enter a username and a password, which
- it then verifies by performing a simple bind against the configured
- <<ldap.server,ldap.server>>. In this configuration the web server
- is not involved in the user authentication process.
- +
- Unlike LDAP above, the username used to perform the LDAP simple bind
- request is the exact string supplied by in the dialog by the user.
- The configured <<ldap.username>> identity is not used to obtain
- account information.
- +
- * `DEVELOPMENT_BECOME_ANY_ACCOUNT`
- +
- *DO NOT USE*. Only for use in a development environment.
- +
- When this is the configured authentication method a hyperlink titled
- `Become` appears in the top right corner of the page, taking the
- user to a form where they can enter the username of any existing
- user account, and immediately login as that account, without any
- authentication taking place. This form of authentication is only
- useful for the GWT hosted mode shell, where OpenID authentication
- redirects might be risky to the developer's host computer, and HTTP
- authentication is not possible.
- +
- By default, OpenID.
- [[auth.allowedOpenID]]auth.allowedOpenID::
- +
- List of permitted OpenID providers. A user may only authenticate
- with an OpenID that matches this list. Only used if `auth.type`
- is set to OpenID (the default).
- +
- Patterns may be either a
- link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
- Java regular expression (java.util.regex)] (start with `^` and
- end with `$`) or be a simple prefix (any other string).
- +
- By default, the list contains two values, `http://` and `https://`,
- allowing users to authenticate with any OpenID provider.
- [[auth.trustedOpenID]]auth.trustedOpenID::
- +
- List of trusted OpenID providers. Only used if `auth.type` is
- set to OpenID (the default).
- +
- In order for a user to take advantage of permissions beyond those
- granted to the `Anonymous Users` and `Registered Users` groups,
- the user account must only have OpenIDs which match at least one
- pattern from this list.
- +
- Patterns may be either a
- link:http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html[standard
- Java regular expression (java.util.regex)] (start with `^` and
- end with `$`) or be a simple prefix (any other string).
- +
- By default, the list contains two values, `http://` and `https://`,
- allowing Gerrit to trust any OpenID it receives.
- [[auth.maxOpenIdSessionAge]]auth.maxOpenIdSessionAge::
- +
- Time in seconds before an OpenID provider must force the user
- to authenticate themselves again before authentication to this
- Gerrit server. Currently this is only a polite request, and users
- coming from providers that don't support the PAPE extension will
- be accepted anyway. In the future it may be enforced, rejecting
- users coming from providers that don't honor the max session age.
- +
- If set to 0, the provider will always force the user to authenticate
- (e.g. supply their password). Values should use common unit suffixes
- to express their setting:
- +
- * s, sec, second, seconds
- * m, min, minute, minutes
- * h, hr, hour, hours
- * d, day, days
- * w, week, weeks (`1 week` is treated as `7 days`)
- * mon, month, months (`1 month` is treated as `30 days`)
- * y, year, years (`1 year` is treated as `365 days`)
- +
- Default is -1, permitting infinite time between authentications.
- [[auth.maxRegisterEmailTokenAge]]auth.maxRegisterEmailTokenAge::
- +
- Time in seconds before an email verification token sent to a user in
- order to validate their email address expires.
- +
- * s, sec, second, seconds
- * m, min, minute, minutes
- * h, hr, hour, hours
- * d, day, days
- * w, week, weeks (`1 week` is treated as `7 days`)
- * mon, month, months (`1 month` is treated as `30 days`)
- * y, year, years (`1 year` is treated as `365 days`)
- +
- Default is 12 hours.
- [[auth.httpHeader]]auth.httpHeader::
- +
- HTTP header to trust the username from, or unset to select HTTP basic
- or digest authentication. Only used if `auth.type` is set to HTTP.
- [[auth.logoutUrl]]auth.logoutUrl::
- +
- URL to redirect a browser to after the end-user has clicked on the
- "Sign Out" link in the upper right corner. Organizations using an
- enterprise single-sign-on solution may want to redirect the browser
- to the SSO product's sign-out page.
- +
- If not set, the redirect returns to the list of all open changes.
- [[auth.registerUrl]]auth.registerUrl::
- +
- Target for the "Register" link in the upper right corner. Used only
- when auth.type is `LDAP`.
- +
- If not set, no "Register" link is displayed.
- [[auth.cookiePath]]auth.cookiePath::
- +
- Sets "path" attribute of the authentication cookie.
- +
- If not set, HTTP request's path is used.
- [[auth.cookieSecure]]auth.cookieSecure::
- +
- Sets "secure" flag of the authentication cookie. If true, cookies
- will be transmitted only over HTTPS protocol.
- +
- By default, false.
- [[auth.emailFormat]]auth.emailFormat::
- +
- Optional format string to construct user email addresses out of
- user login names. Only used if auth.type is `HTTP`, `HTTP_LDAP`
- or `LDAP`.
- +
- This value can be set to a format string, where `{0}` is replaced
- with the login name. E.g. "\{0\}+gerrit@example.com" with a user
- login name of "foo" will produce "foo+gerrit@example.com" during
- the first time user "foo" registers.
- +
- If the site is using `HTTP_LDAP` or `LDAP`, using this option is
- discouraged. Setting `ldap.accountEmailAddress` and importing the
- email address from the LDAP directory is generally preferred.
- [[auth.contributorAgreements]]auth.contributorAgreements::
- +
- Controls whether or not the contributor agreement features are
- enabled for the Gerrit site. If enabled a user must complete a
- contributor agreement before they can upload changes.
- +
- If enabled, the admin must also insert one or more rows into
- `contributor_agreements` and create agreement files under
- `'$site_path'/static`, so users can actually complete one or
- more agreements.
- +
- By default this is false (no agreements are used).
- auth.allowGoogleAccountUpgrade::
- +
- Allows Google Account users to automatically update their Gerrit
- account when/if their Google Account OpenID identity token changes.
- Identity tokens can change if the server changes hostnames, or
- for other reasons known only to Google. The upgrade path works
- by matching users by email address if the identity is not present,
- and then changing the identity.
- +
- This setting also permits old Gerrit 1.x users to seamlessly upgrade
- from Google Accounts on Google App Engine to OpenID authentication.
- +
- Having this enabled incurs an extra database query when Google
- Account users register with the Gerrit server.
- +
- By default, unset/false.
- [[auth.trustContainerAuth]]auth.trustContainerAuth::
- +
- If true then it is the responsibility of the container hosting
- Gerrit to authenticate users. In this case Gerrit will blindly trust
- the container.
- +
- This parameter only affects git over http traffic. If set to false
- then Gerrit will do the authentication (using DIGEST authentication).
- +
- By default this is set to false.
- [[auth.gitBasicAuth]]auth.gitBasicAuth::
- +
- If true then Git over HTTP and HTTP/S traffic is authenticated using
- standard BasicAuth and credentials validated using the same auth
- method configured for Gerrit Web UI.
- +
- This parameter only affects git over http traffic. If set to false
- then Gerrit will authenticate through DIGEST authentication and
- the randomly generated HTTP password in Gerrit DB.
- +
- By default this is set to false.
- [[auth.userNameToLowerCase]]auth.userNameToLowerCase::
- +
- If set the username that is received to authenticate a git operation
- is converted to lower case for looking up the user account in Gerrit.
- +
- By setting this parameter a case insensitive authentication for the
- git operations can be achieved, if it is ensured that the usernames in
- Gerrit (scheme `username`) are stored in lower case (e.g. if the
- parameter link:#ldap.accountSshUserName[ldap.accountSshUserName] is
- set to `${sAMAccountName.toLowerCase}`). It is important that for all
- existing accounts this username is already in lower case. It is not
- possible to convert the usernames of the existing accounts to lower
- case because this would break the access to existing per-user
- branches.
- +
- This parameter only affects git over http and git over SSH traffic.
- +
- By default this is set to false.
- [[cache]]Section cache
- ~~~~~~~~~~~~~~~~~~~~~~
- [[cache.directory]]cache.directory::
- +
- Path to a local directory where Gerrit can write cached entities for
- future lookup. This local disk cache is used to retain potentially
- expensive to compute information across restarts. If the location
- does not exist, Gerrit will try to create it.
- +
- If not absolute, the path is resolved relative to `$site_path`.
- +
- Default is unset, no disk cache.
- [[cache.name.maxAge]]cache.<name>.maxAge::
- +
- Maximum age to keep an entry in the cache. Entries are removed from
- the cache and refreshed from source data every maxAge interval.
- Values should use common unit suffixes to express their setting:
- +
- * s, sec, second, seconds
- * m, min, minute, minutes
- * h, hr, hour, hours
- * d, day, days
- * w, week, weeks (`1 week` is treated as `7 days`)
- * mon, month, months (`1 month` is treated as `30 days`)
- * y, year, years (`1 year` is treated as `365 days`)
- +
- If a unit suffix is not specified, `minutes` is assumed. If 0 is
- supplied, the maximum age is infinite and items are never purged
- except when the cache is full.
- +
- Default is `0`, meaning store forever with no expire, except:
- +
- * `"adv_bases"`: default is `10 minutes`
- * `"ldap_groups"`: default is `1 hour`
- * `"web_sessions"`: default is `12 hours`
- [[cache.name.memoryLimit]]cache.<name>.memoryLimit::
- +
- The total cost of entries to retain in memory. The cost computation
- varies by the cache. For most caches where the in-memory size of each
- entry is relatively the same, memoryLimit is currently defined to be
- the number of entries held by the cache (each entry costs 1).
- +
- For caches where the size of an entry can vary significantly between
- individual entries (notably `"diff"`, `"diff_intraline"`), memoryLimit
- is an approximation of the total number of bytes stored by the cache.
- Larger entries that represent bigger patch sets or longer source files
- will consume a bigger portion of the memoryLimit. For these caches the
- memoryLimit should be set to roughly the amount of RAM (in bytes) the
- administrator can dedicate to the cache.
- +
- Default is 1024 for most caches, except:
- +
- * `"adv_bases"`: default is `4096`
- * `"diff"`: default is `10m` (10 MiB of memory)
- * `"diff_intraline"`: default is `10m` (10 MiB of memory)
- * `"plugin_resources"`: default is 2m (2 MiB of memory)
- +
- If set to 0 the cache is disabled. Entries are removed immediately
- after being stored by the cache. This is primarily useful for testing.
- [[cache.name.diskLimit]]cache.<name>.diskLimit::
- +
- Total size in bytes of the keys and values stored on disk. Caches that
- have grown bigger than this size are scanned daily at 1 AM local
- server time to trim the cache. Entries are removed in least recently
- accessed order until the cache fits within this limit. Caches may
- grow larger than this during the day, as the size check is only
- performed once every 24 hours.
- +
- Default is 128 MiB per cache.
- +
- If 0, disk storage for the cache is disabled.
- [[cache_names]]Standard Caches
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- cache `"accounts"`::
- +
- Cache entries contain important details of an active user, including
- their display name, preferences, known email addresses, and group
- memberships. Entry information is obtained from the following
- database tables:
- +
- * `accounts`
- +
- * `account_group_members`
- +
- * `account_external_ids`
- +
- If direct updates are made to any of these database tables, this
- cache should be flushed.
- cache `"accounts_byemail"`::
- +
- Caches account identities keyed by email address, which is scanned
- from the `account_external_ids` database table. If updates are
- made to this table, this cache should be flushed.
- cache `"adv_bases"`::
- +
- Used only for push over smart HTTP when branch level access controls
- are enabled. The cache entry contains all commits that are avaliable
- for the client to use as potential delta bases. Push over smart HTTP
- requires two HTTP requests, and this cache tries to carry state from
- the first request into the second to ensure it can complete.
- cache `"diff"`::
- +
- Each item caches the differences between two commits, at both the
- directory and file levels. Gerrit uses this cache to accelerate
- the display of affected file names, as well as file contents.
- +
- Entries in this cache are relatively large, so memoryLimit is an
- estimate in bytes of memory used. Administrators should try to target
- cache.diff.memoryLimit to fit all changes users will view in a 1 or 2
- day span.
- cache `"diff_intraline"`::
- +
- Each item caches the intraline difference of one file, when compared
- between two commits. Gerrit uses this cache to accelerate display of
- intraline differences when viewing a file.
- +
- Entries in this cache are relatively large, so memoryLimit is an
- estimate in bytes of memory used. Administrators should try to target
- cache.diff.memoryLimit to fit all files users will view in a 1 or 2
- day span.
- cache `"git_tags"`::
- +
- If branch or reference level READ access controls are used, this
- cache tracks which tags are reachable from the branch tips of a
- repository. Gerrit uses this information to determine the set
- of tags that a client may access, derived from which tags are
- part of the history of a visible branch.
- +
- The cache is persisted to disk across server restarts as it can
- be expensive to compute (60 or more seconds for a large history
- like the Linux kernel repository).
- cache `"groups"`::
- +
- Caches the basic group information from the `account_groups` table,
- including the group owner, name, and description.
- +
- Gerrit group membership obtained from the `account_group_members`
- table is cached under the `"accounts"` cache, above. External group
- membership obtained from LDAP is cached under `"ldap_groups"`.
- cache `"groups_byinclude"`::
- +
- Caches group inclusions in other groups. If direct updates are made
- to the `account_group_includes` table, this cache should be flushed.
- cache `"ldap_groups"`::
- +
- Caches the LDAP groups that a user belongs to, if LDAP has been
- configured on this server. This cache should be configured with a
- low maxAge setting, to ensure LDAP modifications are picked up in
- a timely fashion.
- cache `"ldap_usernames"`::
- +
- Caches a mapping of LDAP username to Gerrit account identity. The
- cache automatically updates when a user first creates their account
- within Gerrit, so the cache expire time is largely irrelevant.
- cache `"permission_sort"`::
- +
- Caches the order in which access control sections must be applied to a
- reference. Sorting the sections can be expensive when regular
- expressions are used, so this cache remembers the ordering for
- each branch.
- cache `"plugin_resources"`::
- +
- Caches formatted plugin resources, such as plugin documentation that
- has been converted from Markdown to HTML. The memoryLimit refers to
- the bytes of memory dedicated to storing the documentation.
- cache `"projects"`::
- +
- Caches the project description records, from the `projects` table
- in the database. If a project record is updated or deleted, this
- cache should be flushed. Newly inserted projects do not require
- a cache flush, as they will be read upon first reference.
- cache `"sshkeys"`::
- +
- Caches unpacked versions of user SSH keys, so the internal SSH daemon
- can match against them during authentication. The unit of storage
- is per-user, so 1024 items translates to 1024 unique user accounts.
- As each individual user account may configure multiple SSH keys,
- the total number of keys may be larger than the item count.
- +
- This cache is based off the `account_ssh_keys` table and the
- `accounts.ssh_user_name` column in the database. If either is
- modified directly, this cache should be flushed.
- cache `"web_sessions"`::
- +
- Tracks the live user sessions coming in over HTTP. Flushing this
- cache would cause all users to be signed out immediately, forcing
- them to sign-in again. To avoid breaking active users, this cache
- is not flushed automatically by `gerrit flush-caches --all`, but
- instead must be explicitly requested.
- +
- If no disk cache is configured (or `cache.web_sessions.diskLimit`
- is set to 0) a server restart will force all users to sign-out,
- and need to sign-in again after the restart, as the cache was
- unable to persist the session information. Enabling a disk cache
- is strongly recommended.
- +
- Session storage is relatively inexpensive. The average entry in
- this cache is approximately 346 bytes.
- See also link:cmd-flush-caches.html[gerrit flush-caches].
- [[cache_options]]Cache Options
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- cache.diff_intraline.maxIdleWorkers::
- +
- Number of idle worker threads to maintain for the intraline difference
- computations. There is no upper bound on how many concurrent requests
- can occur at once, if additional threads are started to handle a peak
- load, only this many will remain idle afterwards.
- +
- Default is 1.5x number of available CPUs.
- cache.diff_intraline.timeout::
- +
- Maximum number of milliseconds to wait for intraline difference data
- before giving up and disabling it for a particular file pair. This is
- a work around for an infinite loop bug in the intraline difference
- implementation. If computation takes longer than the timeout the
- worker thread is terminated and no intraline difference is displayed.
- +
- Values should use common unit suffixes to express their setting:
- +
- * ms, milliseconds
- * s, sec, second, seconds
- * m, min, minute, minutes
- * h, hr, hour, hours
- +
- If a unit suffix is not specified, `milliseconds` is assumed.
- +
- Default is 5 seconds.
- cache.diff_intraline.enabled::
- +
- Boolean to enable or disable the computation of intraline differences
- when populating a diff cache entry. This flag is provided primarily
- as a backdoor to disable the intraline difference feature if
- necessary. To maintain backwards compatability with prior versions,
- this setting will fallback to `cache.diff.intraline` if not set in the
- configuration.
- +
- Default is true, enabled.
- cache.projects.checkFrequency::
- +
- How often project configuration should be checked for update from Git.
- Gerrit Code Review caches project access rules and configuration in
- memory, checking the refs/meta/config branch every checkFrequency
- minutes to see if a new revision should be loaded and used for future
- access. Values can be specified using standard time unit abbreviations
- ('ms', 'sec', 'min', etc.).
- +
- If set to 0, checks occur every time, which may slow down operations.
- Administrators may force the cache to flush with
- link:cmd-flush-caches.html[gerrit flush-caches].
- +
- Default is 5 minutes.
- [[changeMerge]]Section changeMerge
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Controls whether or not the mergeability test of changes is
- enabled. If enabled, when the change page is loaded, the test is
- triggered. The submit button will be enabled or disabled according to
- the result.
- ----
- [changeMerge]
- test = true
- ----
- By default this is false (test is not enabled).
- [[commentlink]]Section commentlink
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Comment links are find/replace strings applied to change descriptions,
- patch comments, and in-line code comments to turn set strings into
- hyperlinks. One common use is for linking to bug-tracking systems.
- In the following example configuration the 'changeid' comment link
- will match typical Gerrit Change-Id values and create a hyperlink
- to changes which reference it. The second configuration 'bugzilla'
- will hyperlink terms such as 'bug 42' to an external bug tracker,
- supplying the argument record number '42' for display. The third
- configuration 'tracker' uses raw HTML to more precisely control
- how the replacement is displayed to the user.
- ----
- [commentlink "changeid"]
- match = (I[0-9a-f]{8,40})
- link = "#q,$1,n,z"
- [commentlink "bugzilla"]
- match = "(bug\\s+#?)(\\d+)"
- link = http://bugs.example.com/show_bug.cgi?id=$2
- [commentlink "tracker"]
- match = ([Bb]ug:\\s+)(\\d+)
- html = $1<a href=\"http://trak.example.com/$2\">$2</a>
- ----
- [[commentlink.name.match]]commentlink.<name>.match::
- +
- A JavaScript regular expression to match positions to be replaced
- with a hyperlink. Subexpressions of the matched string can be
- stored using groups and accessed with `$'n'` syntax, where 'n'
- is the group number, starting from 1.
- +
- The configuration file parser eats one level of backslashes, so the
- character class `\s` requires `\\s` in the configuration file. The
- parser also terminates the line at the first `#`, so a match
- expression containing # must be wrapped in double quotes.
- +
- To match case insensitive strings, a character class with both the
- upper and lower case character for each position must be used. For
- example, to match the string `bug` in a case insensitive way the match
- pattern `[bB][uU][gG]` needs to be used.
- +
- A common pattern to match is `bug\\s+(\\d+)`.
- [[commentlink.name.link]]commentlink.<name>.link::
- +
- The URL to direct the user to whenever the regular expression is
- matched. Groups in the match expression may be accessed as `$'n'`.
- +
- The link property is used only when the html property is not present.
- [[commentlink.name.html]]commentlink.<name>.html::
- +
- HTML to replace the entire matched string with. If present,
- this property overrides the link property above. Groups in the
- match expression may be accessed as `$'n'`.
- +
- The configuration file eats double quotes, so escaping them as
- `\"` is necessary to protect them from the parser.
- [[contactstore]]Section contactstore
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- [[contactstore.url]]contactstore.url::
- +
- URL of the web based contact store Gerrit will send any offline
- contact information to when it collects the data from users as part
- of a contributor agreement.
- +
- See link:config-contact.html[Contact Information].
- [[contactstore.appsec]]contactstore.appsec::
- +
- Shared secret of the web based contact store.
- [[container]]Section container
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- These settings are applied only if Gerrit is started as the container
- process through Gerrit's 'gerrit.sh' rc.d compatible wrapper script.
- [[container.heapLimit]]container.heapLimit::
- +
- Maximum heap size of the Java process running Gerrit, in bytes.
- This property is translated into the '-Xmx' flag for the JVM.
- +
- Default is platform and JVM specific.
- +
- Common unit suffixes of 'k', 'm', or 'g' are supported.
- [[container.javaHome]]container.javaHome::
- +
- Path of the JRE/JDK installation to run Gerrit with. If not set, the
- Gerrit startup script will attempt to search your system and guess
- a suitable JRE. Overrides the environment variable 'JAVA_HOME'.
- [[container.javaOptions]]container.javaOptions::
- +
- Additional options to pass along to the Java runtime. If multiple
- values are configured, they are passed in order on the command line,
- separated by spaces. These options are appended onto 'JAVA_OPTIONS'.
- [[container.slave]]container.slave::
- +
- Used on Gerrit slave installations. If set to true the Gerrit JVM is
- called with the '--slave' switch, enabling slave mode. If no value is
- set (or any other value), gerrit defaults to master mode.
- [[container.user]]container.user::
- +
- Login name (or UID) of the operating system user the Gerrit JVM
- will execute as. If not set, defaults to the user who launched
- the 'gerrit.sh' wrapper script.
- [[container.war]]container.war::
- +
- Path of the JAR file to start daemon execution with. This should
- be the path of the local 'gerrit.war' archive. Overrides the
- environment variable 'GERRIT_WAR'.
- +
- If not set, defaults to '$site_path/bin/gerrit.war', or to
- '$HOME/gerrit.war'.
- [[core]]Section core
- ~~~~~~~~~~~~~~~~~~~~
- [[core.packedGitWindowSize]]core.packedGitWindowSize::
- +
- Number of bytes of a pack file to load into memory in a single
- read operation. This is the "page size" of the JGit buffer cache,
- used for all pack access operations. All disk IO occurs as single
- window reads. Setting this too large may cause the process to load
- more data than is required; setting this too small may increase
- the frequency of `read()` system calls.
- +
- Default on JGit is 8 KiB on all platforms.
- +
- Common unit suffixes of 'k', 'm', or 'g' are supported.
- [[core.packedGitLimit]]core.packedGitLimit::
- +
- Maximum number of bytes to load and cache in memory from pack files.
- If JGit needs to access more than this many bytes it will unload less
- frequently used windows to reclaim memory space within the process.
- As this buffer must be shared with the rest of the JVM heap, it
- should be a fraction of the total memory available.
- +
- Default on JGit is 10 MiB on all platforms.
- +
- Common unit suffixes of 'k', 'm', or 'g' are supported.
- [[core.deltaBaseCaseLimit]]core.deltaBaseCacheLimit::
- +
- Maximum number of bytes to reserve for caching base objects
- that multiple deltafied objects reference. By storing the entire
- decompressed base object in a cache Git is able to avoid unpacking
- and decompressing frequently used base objects multiple times.
- +
- Default on JGit is 10 MiB on all platforms. You probably do not
- need to adjust this value.
- +
- Common unit suffixes of 'k', 'm', or 'g' are supported.
- [[core.packedGitOpenFiles]]core.packedGitOpenFiles::
- +
- Maximum number of pack files to have open at once. A pack file
- must be opened in order for any of its data to be available in
- a cached window.
- +
- If you increase this to a larger setting you may need to also adjust
- the ulimit on file descriptors for the host JVM, as Gerrit needs
- additional file descriptors available for network sockets and other
- repository data manipulation.
- +
- Default on JGit is 128 file descriptors on all platforms.
- [[core.streamFileThreshold]]core.streamFileThreshold::
- +
- Largest object size, in bytes, that JGit will allocate as a
- contiguous byte array. Any file revision larger than this threshold
- will have to be streamed, typically requiring the use of temporary
- files under '$GIT_DIR/objects' to implement psuedo-random access
- during delta decompression.
- +
- Servers with very high traffic should set this to be larger than
- the size of their common big files. For example a server managing
- the Android platform typically has to deal with ~10-12 MiB XML
- files, so `15 m` would be a reasonable setting in that environment.
- Setting this too high may cause the JVM to run out of heap space
- when handling very big binary files, such as device firmware or
- CD-ROM ISO images.
- +
- Default is 50 MiB on all platforms. Prior to Gerrit 2.1.6,
- this value was effectively 2047 MiB.
- +
- Common unit suffixes of 'k', 'm', or 'g' are supported.
- [[core.packedGitMmap]]core.packedGitMmap::
- +
- When true, JGit will use `mmap()` rather than `malloc()+read()`
- to load data from pack files. The use of mmap can be problematic
- on some JVMs as the garbage collector must deduce that a memory
- mapped segment is no longer in use before a call to `munmap()`
- can be made by the JVM native code.
- +
- In server applications (such as Gerrit) that need to access many
- pack files, setting this to true risks artifically running out
- of virtual address space, as the garbage collector cannot reclaim
- unused mapped spaces fast enough.
- +
- Default on JGit is false. Although potentially slower, it yields
- much more predictable behavior.
- [[core.asyncLoggingBufferSize]]core.asyncLoggingBufferSize::
- +
- Size of the buffer to store logging events for asynchronous logging.
- Putting a larger value can protect threads from stalling when the
- AsyncAppender threads are not fast enough to consume the logging events
- from the buffer. It also protects from loosing log entries in this case.
- +
- Default is 64 entries.
- [[database]]Section database
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- The database section configures where Gerrit stores its metadata
- records about user accounts and change reviews.
- ----
- [database]
- type = POSTGRESQL
- hostname = localhost
- database = reviewdb
- username = gerrit2
- password = s3kr3t
- ----
- [[database.type]]database.type::
- +
- Type of database server to connect to. If set this value will be
- used to automatically create correct database.driver and database.url
- values to open the connection.
- +
- * `POSTGRESQL`
- +
- Connect to a PostgreSQL database server.
- +
- * `H2`
- +
- Connect to a local embedded H2 database.
- +
- * `MYSQL`
- +
- Connect to a MySQL database server.
- +
- * `JDBC`
- +
- Connect using a JDBC driver class name and URL.
- +
- If not specified, database.driver and database.url are used as-is,
- and if they are also not specified, defaults to H2.
- [[database.hostname]]database.hostname::
- +
- Hostname of the database server. Defaults to 'localhost'.
- [[database.port]]database.port::
- +
- Port number of the database server. Defaults to the default port
- of the server named by database.type.
- [[database.database]]database.database::
- +
- For POSTGRESQL or MYSQL, the name of the database on the server.
- +
- For H2, this is the path to the database, and if not absolute is
- relative to `'$site_path'`.
- [[database.username]]database.username::
- +
- Username to connect to the database server as.
- [[database.password]]database.password::
- +
- Password to authenticate to the database server with.
- [[database.driver]]database.driver::
- +
- Name of the JDBC driver class to connect to the database with.
- Setting this usually isn't necessary as it can be derived from
- database.type or database.url for any supported database.
- [[database.url]]database.url::
- +
- 'jdbc:' URL for the database. Setting this variable usually
- isn't necessary as it can be constructed from the all of the
- above properties.
- [[database.poolLimit]]database.poolLimit::
- +
- Maximum number of open database connections. If the server needs
- more than this number, request processing threads will wait up
- to <<database.poolMaxWait, poolMaxWait>> seconds for a
- connection to be released before they abort with an exception.
- This limit must be several units higher than the total number of
- httpd and sshd threads as some request processing code paths may
- need multiple connections.
- +
- Default is 8.
- [[database.poolMinIdle]]database.poolMinIdle::
- +
- Minimum number of connections to keep idle in the pool.
- Default is 4.
- [[database.poolMaxIdle]]database.poolMaxIdle::
- +
- Maximum number of connections to keep idle in the pool. If there
- are more idle connections, connections will be closed instead of
- being returned back to the pool.
- Default is 4.
- [[database.poolMaxWait]]database.poolMaxWait::
- +
- Maximum amount of time a request processing thread will wait to
- acquire a database connection from the pool. If no connection is
- released within this time period, the processing thread will abort
- its current operations and return an error to the client.
- Values should use common unit suffixes to express their setting:
- +
- * ms, milliseconds
- * s, sec, second, seconds
- * m, min, minute, minutes
- * h, hr, hour, hours
- +
- If a unit suffix is not specified, `milliseconds` is assumed.
- +
- Default is `30 seconds`.
- [[download]]Section download
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ----
- [download]
- scheme = ssh
- scheme = http
- scheme = anon_http
- scheme = anon_git
- scheme = repo_download
- ----
- The download section configures the allowed download methods.
- [[download.scheme]]download.scheme::
- +
- Schemes that should be used to download changes.
- +
- Multiple schemes are supported:
- +
- * `http`
- +
- Authenticated HTTP download is allowed.
- +
- * `ssh`
- +
- Authenticated SSH download is allowed.
- +
- * `anon_http`
- +
- Anonymous HTTP download is allowed.
- +
- * `anon_git`
- +
- Anonymous Git download is allowed. This is not default, it is also
- necessary to set <<gerrit.canonicalGitUrl,gerrit.canonicalGitUrl>>
- variable.
- +
- * `repo_download`
- +
- Gerrit advertises patch set downloads with the `repo download`
- command, assuming that all projects managed by this instance are
- generally worked on with the repo multi-repository tool. This is
- not default, as not all instances will deploy repo.
- +
- If download.scheme is not specified, SSH, HTTP and Anonymous HTTP
- downloads are allowed.
- [[gerrit]]Section gerrit
- ~~~~~~~~~~~~~~~~~~~~~~~~
- [[gerrit.basePath]]gerrit.basePath::
- +
- Local filesystem directory holding all Git repositories that
- Gerrit knows about and can process changes for. A project
- entity in Gerrit maps to a local Git repository by creating
- the path string `"${basePath}/${project_name}.git"`.
- +
- If relative, the path is resolved relative to `'$site_path'`.
- [[gerrit.allProjects]]gerrit.allProjects::
- +
- Name of the permissions-only project defining global server
- access controls and settings. These are inherited into every
- other project managed by the running server. The name is
- relative to `gerrit.basePath`.
- +
- Defaults to `All-Projects` if not set.
- [[gerrit.canonicalWebUrl]]gerrit.canonicalWebUrl::
- +
- The default URL for Gerrit to be accessed through.
- +
- Typically this would be set to "http://review.example.com/" or
- "http://example.com/gerrit/" so Gerrit can output links that point
- back to itself.
- +
- Setting this is highly recommended, as its necessary for the upload
- code invoked by "git push" or "repo upload" to output hyperlinks
- to the newly uploaded changes.
- [[gerrit.canonicalGitUrl]]gerrit.canonicalGitUrl::
- +
- Optional base URL for repositories available over the anonymous git
- protocol. For example, set this to `git://mirror.example.com/base/`
- to have Gerrit display patch set download URLs in the UI. Gerrit
- automatically appends the project name onto the end of the URL.
- +
- By default unset, as the git daemon must be configured externally
- by the system administrator, and might not even be running on the
- same host as Gerrit.
- [[gerrit.gitHttpUrl]]gerrit.gitHttpUrl::
- +
- Optional base URL for repositories available over the HTTP
- protocol. For example, set this to `http://mirror.example.com/base/`
- to have Gerrit display URLs from this server, rather than itself.
- +
- By default unset, as the HTTP daemon must be configured externally
- by the system administrator, and might not even be running on the
- same host as Gerrit.
- [[gitweb]]Section gitweb
- ~~~~~~~~~~~~~~~~~~~~~~~~
- Gerrit can forward requests to either an internally managed gitweb
- (which allows Gerrit to enforce some access controls), or to an
- externally managed gitweb (where the web server manages access).
- See also link:config-gitweb.html[Gitweb Integration].
- [[gitweb.cgi]]gitweb.cgi::
- +
- Path to the locally installed `gitweb.cgi` executable. This CGI will
- be called by Gerrit Code Review when the URL `/gitweb` is accessed.
- Project level access controls are enforced prior to calling the CGI.
- +
- Defaults to `/usr/lib/cgi-bin/gitweb.cgi` if gitweb.url is not set.
- [[gitweb.url]]gitweb.url::
- +
- Optional URL of an affiliated gitweb service. Defines the
- web location where a `gitweb.cgi` is installed to browse
- gerrit.basePath and the repositories it contains.
- +
- Gerrit appends any necessary query arguments onto the end of this URL.
- For example, "?p=$project.git;h=$commit".
- [[gitweb.type]]gitweb.type::
- +
- Optional type of affiliated gitweb service. This allows using
- alternatives to gitweb, such as cgit. If set to disabled there
- is no gitweb hyperlinking support.
- +
- Valid values are `gitweb`, `cgit`, `disabled` or `custom`.
- [[gitweb.revision]]gitweb.revision::
- +
- Optional pattern to use for constructing the gitweb URL when pointing
- at a specific commit when `custom` is used above.
- +
- Valid replacements are `${project}` for the project name in Gerrit
- and `${commit}` for the SHA1 hash for the commit.
- [[gitweb.project]]gitweb.project::
- +
- Optional pattern to use for constructing the gitweb URL when pointing
- at a specific project when `custom` is used above.
- +
- Valid replacements are `${project}` for the project name in Gerrit.
- [[gitweb.branch]]gitweb.branch::
- +
- Optional pattern to use for constructing the gitweb URL when pointing
- at a specific branch when `custom` is used above.
- +
- Valid replacements are `${project}` for the project name in Gerrit
- and `${branch}` for the name of the branch.
- [[gitweb.filehistory]]gitweb.filehistory::
- +
- Optional pattern to use for constructing the gitweb URL when pointing
- at the history of a file in a specific branch when `custom` is used
- above.
- +
- Valid replacements are `${project}` for the project name in Gerrit,
- `${file}` for the file name and `${branch}` for the name of the
- branch.
- [[gitweb.linkname]]gitweb.linkname::
- +
- Optional setting for modifying the link name presented to the user
- in the Gerrit web-UI.
- +
- Default linkname for custom type is "gitweb".
- [[gitweb.pathSeparator]]gitweb.pathSeparator::
- +
- Optional character to substitute the standard path separator (slash) in
- project names and branch names.
- +
- By default, Gerrit will use hexadecimal encoding for slashes in project and
- branch names. Some web servers, such as Tomcat, reject this hexadecimal
- encoding in the URL.
- +
- Some alternative gitweb services, such as link:http://gitblit.com[Gitblit],
- allow using an alternative path separator character. In Gitblit, this can be
- configured through the property link:http://gitblit.com/properties.html[web.forwardSlashCharacter].
- In Gerrit, the alternative path separator can be configured correspondingly
- using the property 'gitweb.pathSeparator'.
- +
- Valid values are the characters '*', '(' and ')'.
- [[hooks]]Section hooks
- ~~~~~~~~~~~~~~~~~~~~~~
- See also link:config-hooks.html[Hooks].
- [[hooks.path]]hooks.path::
- +
- Optional path to hooks, if not specified then `'$site_path'/hooks` will be used.
- [[hooks.patchsetCreatedHook]]hooks.patchsetCreatedHook::
- +
- Optional filename for the patchset created hook, if not specified then
- `patchset-created` will be used.
- [[hooks.draftPublishedHook]]hooks.draftPublishedHook::
- +
- Optional filename for the draft published hook, if not specified then
- `draft-published` will be used.
- [[hooks.commentAddedHook]]hooks.commentAddedHook::
- +
- Optional filename for the comment added hook, if not specified then
- `comment-added` will be used.
- [[hooks.changeMergedHook]]hooks.changeMergedHook::
- +
- Optional filename for the change merged hook, if not specified then
- `change-merged` will be used.
- [[hooks.changeAbandonedHook]]hooks.changeAbandonedHook::
- +
- Optional filename for the change abandoned hook, if not specified then
- `change-abandoned` will be used.
- [[hooks.changeRestoredHook]]hooks.changeRestoredHook::
- +
- Optional filename for the change restored hook, if not specified then
- `change-restored` will be used.
- [[hooks.refUpdatedHook]]hooks.refUpdatedHook::
- +
- Optional filename for the ref updated hook, if not specified then
- `ref-updated` will be used.
- [[hooks.claSignedHook]]hooks.claSignedHook::
- +
- Optional filename for the CLA signed hook, if not specified then
- `cla-signed` will be used.
- [[http]]Section http
- ~~~~~~~~~~~~~~~~~~~~
- [[http.proxy]]http.proxy::
- +
- URL of the proxy server when making outgoing HTTP
- connections for OpenID login transactions. Syntax
- should be `http://`'hostname'`:`'port'.
- [[http.proxyUsername]]http.proxyUsername::
- +
- Optional username to authenticate to the HTTP proxy with.
- This property is honored only if the username does not
- appear in the http.proxy property above.
- [[http.proxyPassword]]http.proxyPassword::
- +
- Optional password to authenticate to the HTTP proxy with.
- This property is honored only if the password does not
- appear in the http.proxy property above.
- [[httpd]]Section httpd
- ~~~~~~~~~~~~~~~~~~~~~~
- The httpd section configures the embedded servlet container.
- [[httpd.listenUrl]]httpd.listenUrl::
- +
- Specifies the URLs the internal HTTP daemon should listen for
- connections on. The special hostname '*' may be used to listen
- on all local addresses. A context path may optionally be included,
- placing Gerrit Code Review's web address within a subdirectory of
- the server.
- +
- Multiple protocol schemes are supported:
- +
- * `http://`'hostname'`:`'port'
- +
- Plain-text HTTP protocol. If port is not supplied, defaults to 80,
- the standard HTTP port.
- +
- * `https://`'hostname'`:`'port'
- +
- SSL encrypted HTTP protocol. If port is not supplied, defaults to
- 443, the standard HTTPS port.
- +
- Externally facing production sites are encouraged to use a reverse
- proxy configuration and `proxy-https://` (below), rather than using
- the embedded servlet container to implement the SSL processing.
- The proxy server with SSL support is probably easier to configure,
- provides more configuration options to control cipher usage, and
- is likely using natively compiled encryption algorithms, resulting
- in higher throughput.
- +
- * `proxy-http://`'hostname'`:`'port'
- +
- Plain-text HTTP relayed from a reverse proxy. If port is not
- supplied, defaults to 8080.
- +
- Like http, but additional header parsing features are
- enabled to honor X-Forwarded-For, X-Forwarded-Host and
- X-Forwarded-Server. These headers are typically set by Apache's
- link:http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers[mod_proxy].
- +
- * `proxy-https://`'hostname'`:`'port'
- +
- Plain text HTTP relayed from a reverse proxy that has already
- handled the SSL encryption/decryption. If port is not supplied,
- defaults to 8080.
- +
- Behaves exactly like proxy-http, but also sets the scheme to assume
- 'https://' is the proper URL back to the server.
- +
- If multiple values are supplied, the daemon will listen on all
- of them.
- +
- By default, http://*:8080.
- [[httpd.reuseAddress]]httpd.reuseAddress::
- +
- If true, permits the daemon to bind to the port even if the port
- is already in use. If false, the daemon ensures the port is not
- in use before starting. Busy sites may need to set this to true
- to permit fast restarts.
- +
- By default, true.
- [[httpd.requestHeaderSize]]httpd.requestHeaderSize::
- +
- Size, in bytes, of the buffer used to parse the HTTP headers of an
- incoming HTTP request. The entire request headers, including any
- cookies sent by the browser, must fit within this buffer, otherwise
- the server aborts with the response '413 Request Entity Too Large'.
- +
- One buffer of this size is allocated per active connection.
- Allocating a buffer that is too large wastes memory that cannot be
- reclaimed, allocating a buffer that is too small may cause unexpected
- errors caused by very long Referer URLs or large cookie values.
- +
- By default, 16384 (16 K), which is sufficient for most OpenID and
- other web-based single-sign-on integrations.
- [[httpd.sslKeyStore]]httpd.sslKeyStore::
- +
- Path of the Java keystore containing the server's SSL certificate
- and private key. This keystore is required for `https://` in URL.
- +
- To create a self-signed certificate for simple internal usage:
- +
- ----
- keytool -keystore keystore -alias jetty -genkey -keyalg RSA
- chmod 600 keystore
- ----
- +
- If not absolute, the path is resolved relative to `$site_path`.
- +
- By default, `$site_path/etc/keystore`.
- [[httpd.sslKeyPassword]]httpd.sslKeyPassword::
- +
- Password used to decrypt the private portion of the sslKeyStore.
- Java keystores require a password, even if the administrator
- doesn't want to enable one.
- +
- If set to the empty string the embedded server will prompt for the
- password during startup.
- +
- By default, `gerrit`.
- [[httpd.requestLog]]httpd.requestLog::
- +
- Enable (or disable) the `'$site_path'/logs/httpd_log` request log.
- If enabled, an NCSA combined log format request log file is written
- out by the internal HTTP daemon.
- +
- By default, true if httpd.listenUrl uses http:// or https://,
- and false if httpd.listenUrl uses proxy-http:// or proxy-https://.
- [[httpd.acceptorThreads]]httpd.acceptorThreads::
- +
- Number of worker threads dedicated to accepting new incoming TCP
- connections and allocating them connection-specific resources.
- +
- By default, 2, which should be suitable for most high-traffic sites.
- [[httpd.minThreads]]httpd.minThreads::
- +
- Minimum number of spare threads to keep in the worker thread pool.
- This number must be at least 1 larger than httpd.acceptorThreads
- multipled by the number of httpd.listenUrls configured.
- +
- By default, 5, suitable for most lower-volume traffic sites.
- [[httpd.maxThreads]]httpd.maxThreads::
- +
- Maximum number of threads to permit in the worker thread pool.
- +
- By default 25, suitable for most lower-volume traffic sites.
- [[httpd.maxQueued]]httpd.maxQueued::
- +
- Maximum number of client connections which can enter the worker
- thread pool waiting for a worker thread to become available.
- 0 disables the queue and permits infinite number of connections.
- +
- By default 50.
- [[httpd.maxWait]]httpd.maxWait::
- +
- Maximum amount of time a client will wait for an available
- thread to handle a project clone, fetch or push request over the
- smart HTTP transport.
- +
- Values should use common unit suffixes to express their setting:
- +
- * s, sec, second, seconds
- * m, min, minute, minutes
- * h, hr, hour, hours
- * d, day, days
- * w, week, weeks (`1 week` is treated as `7 days`)
- * mon, month, months (`1 month` is treated as `30 days`)
- * y, year, years (`1 year` is treated as `365 days`)
- +
- If a unit suffix is not specified, `minutes` is assumed. If 0
- is supplied, the maximum age is infinite and connections will not
- abort until the client disconnects.
- +
- By default, 5 minutes.
- [[ldap]]Section ldap
- ~~~~~~~~~~~~~~~~~~~~
- LDAP integration is only enabled if `auth.type` is set to
- `HTTP_LDAP`, `LDAP` or `CLIENT_SSL_CERT_LDAP`. See above for a
- detailed description of the auth.type settings and their
- implications.
- An example LDAP configuration follows, and then discussion of
- the parameters introduced here. Suitable defaults for most
- parameters are automatically guessed based on the type of server
- detected during startup. The guessed defaults support both
- link:http://www.ietf.org/rfc/rfc2307.txt[RFC 2307] and Active
- Directory.
- ----
- [ldap]
- server = ldap://ldap.example.com
- accountBase = ou=people,dc=example,dc=com
- accountPattern = (&(objectClass=person)(uid=${username}))
- accountFullName = displayName
- accountEmailAddress = mail
- groupBase = ou=groups,dc=example,dc=com
- groupMemberPattern = (&(objectClass=group)(member=${dn}))
- ----
- [[ldap.server]]ldap.server::
- +
- URL of the organization's LDAP server to query for user information
- and group membership from. Must be of the form `ldap://host…