Tweak formatting of config docs (#603)

* Move required indicator inline

* Remove example column

* Several tweaks to env docs

1. Sort alphabetically
2. Tweak descriptions
3. Clearer pattern for default values: `Default: <value>`

* implement @tcbyrd's idea for examples
This commit is contained in:
Brandon Keepers
2018-07-10 17:40:04 -05:00
committed by Bex Warner
parent 9d94cd6675
commit e284ee2567

View File

@@ -6,28 +6,27 @@ next: docs/deployment.md
When developing a Probot App, you will need to have several different fields in a `.env` file which specify environment variables. Here are some common use cases:
Variable | Sample Value | Required | Description
---|---|---|---
`WEBHOOK_PROXY_URL` | 'https://smee.io/yourcustomurl'| Required | Allows your local development environment to receive GitHub webhook events. Go to https://smee.io/new to get started.
`WEBHOOK_SECRET` | development | Required | The webhook secret used when creating a GitHub App. 'development' is used as a default, but the value in `.env` needs to match the value configured in your App settings on GitHub.
`APP_ID` | 1234 | Required | The App ID assigned to your GitHub App
`PRIVATE_KEY` | SECRETS | Optional | Private key; however, this variable is optional, if it is not present Probot will look in your project's directory for the private key, specifically a file ending in `.pem`. Having a private key somewhere _is_ necessary to run your Probot App.
`PRIVATE_KEY_PATH` | /path/to/private/key | Optional | Path to your private key, a `.pem` file. This is only necessary if your private key is not in your project directory.
Variable | Description
---|---
`APP_ID` | The App ID assigned to your GitHub App. **Required** <p>_(Example: `1234`)_</p>
`PRIVATE_KEY_PATH` | The path to the `.pem` file for your GitHub App. If not present, Probot will look for a file ending in `.pem` in your project's directory. **Required** if the `.pem` file is not in your project directory and `PRIVATE_KEY` is not set. <p>_(Example: `path/to/key.pem`)_</p>
`PRIVATE_KEY` | The contents of the private key for your GitHub App. **Required** if the `.pem` file is not in your project directory and `PRIVATE_KEY_PATH` is not set.
`WEBHOOK_PROXY_URL` | Allows your local development environment to receive GitHub webhook events. Go to https://smee.io/new to get started. <p>_(Example: `https://smee.io/your-custom-url`)_</p>
`WEBHOOK_SECRET` | The webhook secret used when creating a GitHub App. 'development' is used as a default, but the value in `.env` needs to match the value configured in your App settings on GitHub. **Required** <p>_(Example: `development`)_</p>
For more on the set up of these items, check out [Configuring a GitHub App](https://probot.github.io/docs/development/#configuring-a-github-app).
Some less common environment variables are:
Variable | Sample Value | Required | Description
---|---|---|---
`LOG_LEVEL` | debug | Optional | The default log level is `info`, but you can also change it to `trace`, `debug`, or `warn`. This affects the verbosity of the logging Probot provides when running your app.
`IGNORED_ACCOUNTS` | 'spammyUser,abusiveUser' | Optional | Specific to the probot/stats endpoint which fuels the data about each Probot App for our website. By marking an account as ignored, that account will not be included in data collected on the website. The primary use case for this is spammy or abusive users that the GitHub API sends us but who 404.
`DISABLE_STATS` | true | Optional | Allows for Probot Apps to opt out of inclusion in the /stats endpoint which gathers data about each app.
`GHE_HOST` | 'fake.github-enterprise.com' | Optional | Allows for a Probot App to be run on a GitHub Enterprise instance.
`PORT` | 5000 | Optional | The port on which Probot will start a local server on. By default, this is 3000.
`WEBHOOK_PATH` | '/webhook' | Optional | The URL path which will recieve webhooks. By default, this is `'/'`.
`SENTRY_DSN` | 'https://user:pw@sentry.io/1234' | Optional | Logs all errors to [Sentry](https://sentry.io/) for error tracking.
`LOG_FORMAT` | json | Optional | By default, logs are formatted for readability in development. If you intend to drain logs to a logging service, use this option.
Variable | Description
---|---
`DISABLE_STATS` | Set to `true` to disable the the `/probot/stats` endpoint, which gathers data about each app. Recommend for apps with a lot of installations. <p>_(Example: `true`)_</p>
`GHE_HOST` | The hostname of your GitHub Enterprise instance. <p>_(Example: `github.mycompany.com`)_</p>
`IGNORED_ACCOUNTS` | A comma-separated list of GitHub account names to ignore. This is currently used by the `/probot/stats`. By marking an account as ignored, that account will not be included in data collected on the website. The primary use case for this is spammy or abusive users that the GitHub API sends us but who 404. <p>_(Example: `spammyPerson,abusiveAccount`)_</p>
`LOG_FORMAT` | By default, logs are formatted for readability in development. You can set this to `short`, `long`, `simple`, `json`, `bunyan`. Default: `short`
`LOG_LEVEL` | The verbosity of logs to show when running your app, which can be `trace`, `debug`, `info`, `warn`, `error`, or `fatal`. Default: `info`
`PORT` | The port to start the local server on. Default: `3000`.
`SENTRY_DSN` | Set to a [Sentry](https://sentry.io/) DSN to report all errors thrown by your app. <p>_(Example: `https://1234abcd@sentry.io/12345`)_</p>
`WEBHOOK_PATH` | The URL path which will recieve webhooks. Default: `/`.
For more information on the formatting conventions and rules of `.env` files, check out [the npm `dotenv` module's documentation](https://www.npmjs.com/package/dotenv#rules).