{"parents": [], "prev": {"link": "../installation/", "title": "Installing Review Board Gateway"}, "next": {"link": "../running/", "title": "Running rb-gateway"}, "title": "Configuring Review Board Gateway", "meta": null, "body": "
\n

# Configuring Review Board Gateway\u00b6

\n

`rb-gateway` is configured with two files: a configuration file and a\npassword file.

\n
\n

## Configuration File\u00b6

\n

The configuration file is a JSON file which defines the basic settings for the\nservice, and includes an array listing each of the local repositories which\n`rb-gateway` should allow access to:

\n

    {\n    "htpasswdPath": "/etc/rb-gateway/htpasswd",\n    "port": 8888,\n    "tokenStorePath": "/var/lib/rb-gateway/tokens.dat",\n    "webhookStorePath": "/etc/rb-gateway/webhooks.json",\n    "repositories": [\n        {"name": "repo1", "path": "/path/to/repo1.git", "scm": "git"},\n        {"name": "repo2", "path": "/path/to/repo2.hg", "scm": "hg"}\n    ]\n}\n

\n
\n

Relative paths in the configuration file are resolved relative to the\ndirectory containing the configuration file.

\n

The available configuration keys are as follows:

\n

\n
`htpasswdPath` (string)

  The path to the password file.

  \n

  Defaults to `htpasswd`.

  \n
\n
`port` (int)

  The port for `rb-gateway` to listen on.

  \n

  Defaults to `8888`.

  \n
\n
`repositories` (array of object)

  The list of all repositories to host with `rb-gateway`. This key is\nrequired.

  \n

  Each repository in the configuration file is a JSON object with the following\nkeys:

  \n
  \n
  `name` (string)

    The name to use for the repository. This is used for the configuration in\nthe Review Board admin UI when linking the repository, and appears in API\nURLs.

    \n
  \n
  `path` (string)

    The path on disk to the local repository.

    \n
  \n
  `scm` (string)

    The type of repository. This can be either `git` or `hg`.

    \n
  \n
  \n
\n
`sslCertificate` (string)

  The path to the SSL public certificate to use when HTTPS is enabled.

  \n

  Required if `useTLS` is `true`.

  \n
\n
`sslKey` (string)

  The path to the SSL private key to use when HTTPS is enabled.

  \n

  Required if `useTLS` is `true`.

  \n
\n
`tokenStorePath` (string)

  The path to a file where `rb-gateway` will store authentication sessions.\nThe directory for this file must exist and be writable.

  \n

  Defaults to `tokens.dat`.

  \n
\n
`useTLS` (boolean)

  Whether to use HTTPS for communication. This requires a valid certificate\nspecified in the `sslCertificate` and `sslKey` config options.

  \n

  Defaults to `false`.

  \n
\n
`webhookStorePath` (string)

  The path to the WebHook configuration file.

  \n

  Defaults to `webhooks.json`.

  \n
\n

\n
\n
\n

## Password File\u00b6

\n

The password file uses the htpasswd format to store authentication\ncredentials. These credentials are used by the Review Board server to connect\nto the service. This file can be created or updated with Apache\u2019s\nhtpasswd tool or other widely-available third party tools.

\n

Passwords may be stored as bcrypt hashes (recommended) or in plain text. For\nexample, to create a new htpasswd file with a bcrypt-hashed password:

\n

    $ htpasswd -Bc /etc/rb-gateway/htpasswd myuser\n

\n
\n
\n
\n

## WebHooks File\u00b6

\n

The WebHook configuration file is a JSON file containing a list of\nconfigurations for WebHooks which should be emitted when new code is pushed.

\n

The available configuration keys are as follows. All keys are required.

\n

\n
`enabled` (boolean)

  Whether the WebHook is enabled.

  \n
\n
`events` (array of string)

  The set of events to notify on. This currently only supports `"push"`.

  \n
\n
`id` (string)

  A unique ID for the WebHook.

  \n
\n
`repos` (array of string)

  The set of repositories to trigger this WebHook configuration for.

  \n
\n
`secret` (string)

  A secret to use for generating an HMAC-SHA1 signature for the payload.

  \n
\n
`url` (string)

  The URL to dispatch the WebHook to.

  \n
\n

\n
\n

### Example\u00b6

\n

    [\n    {\n        "enabled": true,\n        "events": ["push"],\n        "id": "repo1-reviewboard",\n        "repos": ["repo1"],\n        "secret": "<secret from Review Board>",\n        "url": "https://reviewboard.example.com/repos/1/rbgateway/hooks/close-submitted/"\n    }\n]\n

\n
\n
\n
\n
\n", "metatags": "\n", "rellinks": [["genindex", "General Index", "I", "index"], ["running/index", "Running rb-gateway", "N", "next"], ["installation/index", "Installing Review Board Gateway", "P", "previous"]], "sourcename": "configuration/index.rst.txt", "toc": "

\n
- Configuring Review Board Gateway
  \n
  - Configuration File
  \n
  - Password File
  \n
  - WebHooks File
    \n
    - Example
    \n
    \n
  \n
  \n
\n

\n", "display_toc": true, "page_source_suffix": ".rst", "current_page_name": "configuration/index", "sidebars": ["relations.html", "searchbox.html"], "alabaster_version": "0.7.16", "alabaster_version_info": [0, 7, 16]}