You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

592 lines
19 KiB

  1. # Server Configuration
  2. Healthchecks prepares its configuration in `hc/settings.py`. It reads configuration
  3. from environment variables. Below is a list of variables it reads and uses:
  4. ## `ALLOWED_HOSTS` {: #ALLOWED_HOSTS }
  5. Default: `*`
  6. The host/domain names that this site can serve. You can specify multiple domain names
  7. by separating them with commas:
  8. ```ini
  9. ALLOWED_HOSTS=my-hc.example.org,alternative-name.example.org
  10. ```
  11. Apart from the comma-separated syntax, this is a standard Django setting.
  12. Read more about it in the
  13. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#allowed-hosts).
  14. ## `APPRISE_ENABLED` {: #APPRISE_ENABLED }
  15. Default: `False`
  16. A boolean that turns on/off the [Apprise](https://github.com/caronc/apprise)
  17. integration.
  18. Before enabling the Apprise integration, make sure the `apprise` package is installed:
  19. ```bash
  20. pip install apprise
  21. ```
  22. ## `DB` {: #DB }
  23. Default: `sqlite`
  24. The database enginge to use. Possible values: `sqlite`, `postgres`, `mysql`.
  25. ## `DB_CONN_MAX_AGE` {: #DB_CONN_MAX_AGE }
  26. Default: `0`
  27. This is a standard Django setting, read more in
  28. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#conn-max-age).
  29. ## `DB_HOST` {: #DB_HOST }
  30. Default: `""` (empty string)
  31. This is a standard Django setting, read more in
  32. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#host).
  33. ## `DB_NAME` {: #DB_NAME }
  34. Default: `hc` (PostgreSQL, MySQL) or `/path/to/projectdir/hc.sqlite` (SQLite)
  35. This is a standard Django setting, read more in
  36. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#name).
  37. ## `DB_PASSWORD` {: #DB_PASSWORD }
  38. Default: `""` (empty string)
  39. This is a standard Django setting, read more in
  40. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#password).
  41. ## `DB_PORT` {: #DB_PORT }
  42. Default: `""` (empty string)
  43. This is a standard Django setting, read more in
  44. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#port).
  45. ## `DB_SSLMODE` {: #DB_SSLMODE }
  46. Default: `prefer`
  47. PostgreSQL-specific, [details](https://www.postgresql.org/docs/10/libpq-connect.html#LIBPQ-CONNECT-SSLMODE)
  48. ## `DB_TARGET_SESSION_ATTRS` {: #DB_TARGET_SESSION_ATTRS }
  49. Default: `read-write`
  50. PostgreSQL-specific, [details](https://www.postgresql.org/docs/10/libpq-connect.html#LIBPQ-CONNECT-TARGET-SESSION-ATTRS)
  51. ## `DB_USER` {: #DB_USER }
  52. Default: `postgres` (PostgreSQL) or `root` (MySQL)
  53. This is a standard Django setting, read more in
  54. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#user).
  55. ## `DEBUG` {: #DEBUG }
  56. Default: `True`
  57. A boolean that turns on/off debug mode.
  58. _Never run a Healthchecks instance in production with the debug mode turned on!_
  59. This is a standard Django setting, read more in
  60. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#debug).
  61. ## `DEFAULT_FROM_EMAIL` {: #DEFAULT_FROM_EMAIL }
  62. Default: `[email protected]`
  63. This is a standard Django setting, read more in
  64. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#default-from-email).
  65. ## `DISCORD_CLIENT_ID` {: #DISCORD_CLIENT_ID }
  66. Default: `None`
  67. The Discord Client ID, required by the Discord integration.
  68. To set up the Discord integration:
  69. * Register a new application at
  70. [https://discordapp.com/developers/applications/me](https://discordapp.com/developers/applications/me)
  71. * Add a Redirect URI to your Discord application. The URI format is
  72. `SITE_ROOT/integrations/add_discord/`. For example, if `your SITE_ROOT`
  73. is `https://my-hc.example.org` then the Redirect URI would be
  74. `https://my-hc.example.org/integrations/add_discord/`
  75. * Look up your Discord app's _Client ID_ and _Client Secret_. Put them
  76. in the `DISCORD_CLIENT_ID` and `DISCORD_CLIENT_SECRET` environment
  77. variables.
  78. ## `DISCORD_CLIENT_SECRET` {: #DISCORD_CLIENT_SECRET }
  79. Default: `None`
  80. The Discord Client Secret, required by the Discord integration. Look it up at
  81. [https://discordapp.com/developers/applications/me](https://discordapp.com/developers/applications/me).
  82. ## `EMAIL_HOST` {: #EMAIL_HOST }
  83. Default: `""` (empty string)
  84. This is a standard Django setting, read more in
  85. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#email-host).
  86. ## `EMAIL_HOST_PASSWORD` {: #EMAIL_HOST_PASSWORD }
  87. Default: `""` (empty string)
  88. This is a standard Django setting, read more in
  89. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#email-host-password).
  90. ## `EMAIL_HOST_USER` {: #EMAIL_HOST_USER }
  91. Default: `""` (empty string)
  92. This is a standard Django setting, read more in
  93. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#email-host-user).
  94. ## `EMAIL_PORT` {: #EMAIL_PORT }
  95. Default: `587`
  96. This is a standard Django setting, read more in
  97. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#email-port).
  98. ## `EMAIL_USE_TLS` {: #EMAIL_USE_TLS }
  99. Default: `True`
  100. This is a standard Django setting, read more in
  101. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#email-use-tls).
  102. ## `EMAIL_USE_VERIFICATION` {: #EMAIL_USE_VERIFICATION }
  103. Default: `True`
  104. A boolean that turns on/off a verification step when adding an email integration.
  105. If enabled, whenever an user adds an email integration, Healthchecks emails a
  106. verification link to the new address. The new integration becomes active only
  107. after user clicks the verification link.
  108. If you are setting up a private healthchecks instance where
  109. you trust your users, you can opt to disable the verification step. In that case,
  110. set `EMAIL_USE_VERIFICATION` to `False`.
  111. ## `LINENOTIFY_CLIENT_ID` {: #LINENOTIFY_CLIENT_ID }
  112. Default: `None`
  113. ## `LINENOTIFY_CLIENT_SECRET` {: #LINENOTIFY_CLIENT_SECRET }
  114. Default: `None`
  115. ## `MASTER_BADGE_LABEL` {: #MASTER_BADGE_URL }
  116. Default: same as `SITE_NAME`
  117. The label for the "Overall Status" status badge.
  118. ## `MATRIX_ACCESS_TOKEN` {: #MATRIX_ACCESS_TOKEN }
  119. Default: `None`
  120. The [Matrix](https://matrix.org/) bot user's access token, required by the Matrix
  121. integration.
  122. To set up the Matrix integration:
  123. * Register a bot user (for posting notifications) in your preferred Matrix homeserver.
  124. * Use the [Login API call](https://www.matrix.org/docs/guides/client-server-api#login)
  125. to retrieve bot user's access token. You can run it as shown in the documentation,
  126. using curl in command shell.
  127. * Set the `MATRIX_` environment variables. Example:
  128. ```ini
  129. MATRIX_ACCESS_TOKEN=[a long string of characters returned by the login call]
  130. MATRIX_HOMESERVER=https://matrix.org
  131. MATRIX_USER_ID=@mychecks:matrix.org
  132. ```
  133. ## `MATRIX_HOMESERVER` {: #MATRIX_HOMESERVER }
  134. Default: `None`
  135. The Matrix bot's homeserver address, required by the Matrix integration.
  136. ## `MATRIX_USER_ID` {: #MATRIX_USER_ID }
  137. Default: `None`
  138. The Matrix bot's user identifier, required by the Matrix integration.
  139. ## `MATTERMOST_ENABLED` {: #MATTERMOST_ENABLED }
  140. Default: `True`
  141. A boolean that turns on/off the Mattermost integration. Enabled by default.
  142. ## `MSTEAMS_ENABLED` {: #MSTEAMS_ENABLED }
  143. Default: `True`
  144. A boolean that turns on/off the MS Teams integration. Enabled by default.
  145. ## `OPSGENIE_ENABLED` {: #OPSGENIE_ENABLED }
  146. Default: `True`
  147. A boolean that turns on/off the Opsgenie integration. Enabled by default.
  148. ## `PAGERTREE_ENABLED` {: #PAGERTREE_ENABLED }
  149. Default: `True`
  150. A boolean that turns on/off the PagerTree integration. Enabled by default.
  151. ## `PD_APP_ID` {: #PD_APP_ID }
  152. Default: `None`
  153. PagerDuty application ID. If set, enables the PagerDuty
  154. [Simple Install Flow](https://developer.pagerduty.com/docs/app-integration-development/events-integration/).
  155. If `None`, Healthchecks will fall back to the even simpler flow where users manually
  156. copy integration keys from PagerDuty and paste them in Healthchecks.
  157. To set up:
  158. * Register a PagerDuty app at [PagerDuty](https://pagerduty.com/) › Developer Mode › My Apps
  159. * In the newly created app, add the "Events Integration" functionality
  160. * Specify a Redirect URL: `https://your-domain.com/integrations/add_pagerduty/`
  161. * Copy the displayed app_id value (PXXXXX) and put it in the `PD_APP_ID` environment
  162. variable
  163. ## `PD_ENABLED` {: #PD_ENABLED }
  164. Default: `True`
  165. A boolean that turns on/off the PagerDuty integration. Enabled by default.
  166. ## `PING_BODY_LIMIT` {: #PING_BODY_LIMIT }
  167. Default: `10000`
  168. The upper size limit in bytes for logged ping request bodies.
  169. The default value is 10000 (10 kilobytes). You can adjust the limit or you can remove
  170. the it altogether by setting this value to `None`.
  171. ## `PING_EMAIL_DOMAIN` {: #PING_EMAIL_DOMAIN }
  172. Default: `localhost`
  173. The domain to use for generating ping email addresses. Example:
  174. ```ini
  175. PING_EMAIL_DOMAIN=ping.my-hc.example.org
  176. ```
  177. In this example, Healthchecks would generate ping email addresses similar
  178. to `[email protected]`.
  179. ## `PING_ENDPOINT` {: #PING_ENDPOINT }
  180. Default: `SITE_ROOT` + `/ping/`
  181. The base URL to use for generating ping URLs. Example:
  182. ```ini
  183. PING_ENDPOINT=https://ping.my-hc.example.org
  184. ```
  185. In this example, Healthchecks would generate ping URLs similar
  186. to `https://ping.my-hc.example.org/3f1a7317-8e96-437c-a17d-b0d550b51e86`.
  187. ## `PROMETHEUS_ENABLED` {: #PROMETHEUS_ENABLED }
  188. Default: `True`
  189. A boolean that turns on/off the Prometheus integration. Enabled by default.
  190. ## `PUSHBULLET_CLIENT_ID` {: #PUSHBULLET_CLIENT_ID }
  191. Default: `None`
  192. ## `PUSHBULLET_CLIENT_SECRET` {: #PUSHBULLET_CLIENT_SECRET }
  193. Default: `None`
  194. ## `PUSHOVER_API_TOKEN` {: #PUSHOVER_API_TOKEN }
  195. Default: `None`
  196. The [Pushover](https://pushover.net/) API token, required by the Pushover integration.
  197. To enable the Pushover integration:
  198. * Register a new Pushover application at
  199. [https://pushover.net/apps/build](https://pushover.net/apps/build).
  200. * Within the Pushover application configuration, enable subscriptions.
  201. Make sure the subscription type is set to "URL". Also make sure the redirect
  202. URL is configured to point back to the root of the Healthchecks instance
  203. (e.g., `https://my-hc.example.org/`).
  204. * Put the Pushover application's _API Token_ and the _Subscription URL_ in
  205. `PUSHOVER_API_TOKEN` and `PUSHOVER_SUBSCRIPTION_URL` environment
  206. variables. The Pushover subscription URL should look similar to
  207. `https://pushover.net/subscribe/yourAppName-randomAlphaNumericData`.
  208. ## `PUSHOVER_EMERGENCY_EXPIRATION` {: #PUSHOVER_EMERGENCY_EXPIRATION }
  209. Default: `86400` (24 hours)
  210. Specifies how many seconds an emergency Pushoover notification
  211. will continue to be retried for.
  212. More information in [Pushover API documentation](https://pushover.net/api#priority).
  213. ## `PUSHOVER_EMERGENCY_RETRY_DELAY` {: #PUSHOVER_EMERGENCY_RETRY_DELAY }
  214. Default: `300` (5 minutes)
  215. Specifies how often (in seconds) the Pushover servers will send the same notification
  216. to the user.
  217. More information in [Pushover API documentation](https://pushover.net/api#priority).
  218. ## `PUSHOVER_SUBSCRIPTION_URL` {: #PUSHOVER_SUBSCRIPTION_URL }
  219. Default: `None`
  220. The Pushover Subscription URL, required by the Pushover integration.
  221. ## `REGISTRATION_OPEN` {: #REGISTRATION_OPEN }
  222. Default: `True`
  223. A boolean that controls whether site visitors can create new accounts.
  224. Set it to `False` if you are setting up a private Healthchecks instance, but
  225. it needs to be publicly accessible (so, for example, your cloud services
  226. can send pings to it).
  227. If you close new user registration, you can still selectively invite users
  228. to your team account.
  229. ## `REMOTE_USER_HEADER` {: #REMOTE_USER_HEADER }
  230. Default: `None`
  231. Specifies the request header to use for external authentication.
  232. Healthchecks supports external authentication by means of HTTP headers set by
  233. reverse proxies or the WSGI server. This allows you to integrate it into your
  234. existing authentication system (e.g., LDAP or OAuth) via an authenticating proxy. When this option is enabled, **Healtchecks will trust the header's value implicitly**, so it is **very important** to ensure that attackers cannot set the value themselves (and thus impersonate any user). How to do this varies by your chosen proxy, but generally involves configuring it to strip out headers that normalize to the same name as the chosen identity header.
  235. To enable this feature, set the `REMOTE_USER_HEADER` value to a header you wish to authenticate with. HTTP headers will be prefixed with `HTTP_` and have any dashes converted to underscores. Headers without that prefix can be set by the WSGI server itself only, which is more secure.
  236. When `REMOTE_USER_HEADER` is set, Healthchecks will:
  237. - assume the header contains user's email address
  238. - look up and automatically log in the user with a matching email address
  239. - automatically create an user account if it does not exist
  240. - disable the default authentication methods (login link to email, password)
  241. ## `RP_ID` {: #RP_ID }
  242. Default: `None`
  243. The [Relying Party identifier](https://www.w3.org/TR/webauthn-2/#relying-party-identifier),
  244. required by the WebAuthn second-factor authentication feature.
  245. Healthchecks optionally supports two-factor authentication using the WebAuthn
  246. standard. To enable WebAuthn support, set the `RP_ID` setting to a non-null value.
  247. Set its value to your site's domain without scheme and without port. For example,
  248. if your site runs on `https://my-hc.example.org`, set `RP_ID` to `my-hc.example.org`.
  249. Note that WebAuthn requires HTTPS, even if running on localhost. To test WebAuthn
  250. locally with a self-signed certificate, you can use the `runsslserver` command
  251. from the `django-sslserver` package.
  252. ## `SECRET_KEY` {: #SECRET_KEY }
  253. Default: `---`
  254. A secret key used for cryptographic signing, and should be set to a unique,
  255. unpredictable value.
  256. This is a standard Django setting, read more in
  257. [Django documentation](https://docs.djangoproject.com/en/3.1/ref/settings/#secret-key).
  258. ## `SHELL_ENABLED` {: #SHELL_ENABLED }
  259. Default: `False`
  260. A boolean that turns on/off the "Shell Commands" integration.
  261. The "Shell Commands" integration runs user-defined local shell commands when checks
  262. go up or down. This integration is disabled by default, and can be enabled by setting
  263. the `SHELL_ENABLED` environment variable to `True`.
  264. Note: be careful when using "Shell Commands" integration, and only enable it when
  265. you fully trust the users of your Healthchecks instance. The commands will be executed
  266. by the `manage.py sendalerts` process, and will run with its system permissions.
  267. ## `SIGNAL_CLI_ENABLED` {: #SIGNAL_CLI_ENABLED }
  268. Default: `False`
  269. A boolean that turns on/off the [Signal](https://signal.org/) integration.
  270. Healthchecks uses [signal-cli](https://github.com/AsamK/signal-cli) to send Signal
  271. notifications. Healthcecks interacts with signal-cli over DBus.
  272. To enable the Signal integration:
  273. * Set up and configure signal-cli to listen on DBus system bus
  274. ([instructions](https://github.com/AsamK/signal-cli/wiki/DBus-service)).
  275. Make sure you can send test messages from command line, using the `dbus-send`
  276. example given in the signal-cli instructions.
  277. * Set the `SIGNAL_CLI_ENABLED` environment variable to `True`.
  278. ## `SITE_NAME` {: #SITE_NAME }
  279. Default: `Mychecks`
  280. The display name of this Healthchecks instance. Healthchecks uses it throughout
  281. its web UI and documentation.
  282. ## `SITE_ROOT` {: #SITE_ROOT }
  283. Default: `http://localhost:8000`
  284. The base URL of this Healthchecks instance. Healthchecks uses `SITE_ROOT` whenever
  285. it needs to construct absolute URLs.
  286. ## `SLACK_CLIENT_ID` {: #SLACK_CLIENT_ID }
  287. Default: `None`
  288. The Slack Client ID, used by the Slack integration.
  289. The Slack integration can work with or without the Slack Client ID. If
  290. the Slack Client ID is not set, in the "Integrations - Add Slack" page,
  291. Healthchecks will ask the user to provide a webhook URL for posting notifications.
  292. If the Slack Client _is_ set, Healthchecks will use the OAuth2 flow
  293. to get the webhook URL from Slack. The OAuth2 flow is more user-friendly.
  294. To set it up, go to [https://api.slack.com/apps/](https://api.slack.com/apps/)
  295. and create a _Slack app_. When setting up the Slack app, make sure to:
  296. * Add the [incoming-webhook](https://api.slack.com/scopes/incoming-webhook)
  297. scope to the Bot Token Scopes.
  298. * Add a _Redirect URL_ in the format `SITE_ROOT/integrations/add_slack_btn/`.
  299. For example, if your `SITE_ROOT` is `https://my-hc.example.org` then the
  300. Redirect URL would be `https://my-hc.example.org/integrations/add_slack_btn/`.
  301. ## `SLACK_CLIENT_SECRET` {: #SLACK_CLIENT_SECRET }
  302. Default: `None`
  303. The Slack Client Secret. Required if `SLACK_CLIENT_ID` is set.
  304. Look it up at [https://api.slack.com/apps/](https://api.slack.com/apps/).
  305. ## `SLACK_ENABLED` {: #SLACK_ENABLED }
  306. Default: `True`
  307. A boolean that turns on/off the Slack integration. Enabled by default.
  308. ## `SPIKE_ENABLED` {: #SPIKE_ENABLED }
  309. Default: `True`
  310. A boolean that turns on/off the Spike.sh integration. Enabled by default.
  311. ## `TELEGRAM_BOT_NAME` {: #TELEGRAM_BOT_NAME }
  312. Default: `ExampleBot`
  313. The [Telegram](https://telegram.org/) bot name, required by the Telegram integration.
  314. To set up the Telegram integration:
  315. * Create a Telegram bot by talking to the
  316. [BotFather](https://core.telegram.org/bots#6-botfather). Set the bot's name,
  317. description, user picture, and add a "/start" command.
  318. * After creating the bot you will have the bot's name and token. Put them
  319. in `TELEGRAM_BOT_NAME` and `TELEGRAM_TOKEN` environment variables.
  320. * Run the `settelegramwebhook` management command. This command tells Telegram
  321. where to forward channel messages by invoking Telegram's
  322. [setWebhook](https://core.telegram.org/bots/api#setwebhook) API call:
  323. ```bash
  324. $ ./manage.py settelegramwebhook
  325. Done, Telegram's webhook set to: https://my-monitoring-project.com/integrations/telegram/bot/
  326. ```
  327. For this to work, your `SITE_ROOT` must be publicy accessible and use the "https://"
  328. scheme.
  329. ## `TELEGRAM_TOKEN` {: #TELEGRAM_TOKEN }
  330. Default: `None`
  331. The Telegram bot user's authentication token, required by the Telegram integration.
  332. ## `TRELLO_APP_KEY` {: #TRELLO_APP_KEY }
  333. Default: `None`
  334. The [Trello](https://trello.com/) app key, required by the Trello integration.
  335. To set up the Trello integration, get a developer API key from
  336. [https://trello.com/app-key](https://trello.com/app-key) and put it in the
  337. `TRELLO_APP_KEY` environment variable.
  338. ## `TWILIO_ACCOUNT` {: #TWILIO_ACCOUNT }
  339. Default: `None`
  340. ## `TWILIO_AUTH` {: #TWILIO_AUTH }
  341. Default: `None`
  342. ## `TWILIO_FROM` {: #TWILIO_FROM }
  343. Default: `None`
  344. ## `TWILIO_USE_WHATSAPP` {: #TWILIO_USE_WHATSAPP }
  345. Default: `False`
  346. ## `USE_PAYMENTS` {: #USE_PAYMENTS }
  347. Default: `False`
  348. A boolean that turns on/off billing features.
  349. ## `VICTOROPS_ENABLED` {: #VICTOROPS_ENABLED }
  350. Default: `True`
  351. A boolean that turns on/off the Splunk On-Call (VictorOps) integration.
  352. Enabled by default.
  353. ## `WEBHOOKS_ENABLED` {: #WEBHOOKS_ENABLED }
  354. Default: `True`
  355. A boolean that turns on/off the Webhooks integration. Enabled by default.
  356. ## `ZULIP_ENABLED` {: #ZULIP_ENABLED }
  357. Default: `True`
  358. A boolean that turns on/off the Zulip integration. Enabled by default.