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.

408 lines
16 KiB

10 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
5 years ago
update Readme with pip install dependencies pip install will fail when you cannot compile some of the dependencies. one is gcc the other is the Python.h ``` Building wheels for collected packages: rcssmin, rjsmin Running setup.py bdist_wheel for rcssmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ipfho29k/rcssmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-u0q6mggl --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rcssmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rcssmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rcssmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rcssmin.c -o build/temp.linux-x86_64-3.6/rcssmin.o unable to execute 'x86_64-linux-gnu-gcc': No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for rcssmin Running setup.py clean for rcssmin Running setup.py bdist_wheel for rjsmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ipfho29k/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-axnaq3w9 --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rjsmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rjsmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rjsmin.c -o build/temp.linux-x86_64-3.6/rjsmin.o unable to execute 'x86_64-linux-gnu-gcc': No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ``` ``` Running setup.py bdist_wheel for rjsmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-cfntw7bo/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-ytqxu9_b --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rjsmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rjsmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rjsmin.c -o build/temp.linux-x86_64-3.6/rjsmin.o In file included from rjsmin.c:18:0: _setup/include/cext.h:34:10: fatal error: Python.h: No such file or directory #include "Python.h" ^~~~~~~~~~ compilation terminated. ```
6 years ago
update Readme with pip install dependencies pip install will fail when you cannot compile some of the dependencies. one is gcc the other is the Python.h ``` Building wheels for collected packages: rcssmin, rjsmin Running setup.py bdist_wheel for rcssmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ipfho29k/rcssmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-u0q6mggl --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rcssmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rcssmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rcssmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rcssmin.c -o build/temp.linux-x86_64-3.6/rcssmin.o unable to execute 'x86_64-linux-gnu-gcc': No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for rcssmin Running setup.py clean for rcssmin Running setup.py bdist_wheel for rjsmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ipfho29k/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-axnaq3w9 --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rjsmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rjsmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rjsmin.c -o build/temp.linux-x86_64-3.6/rjsmin.o unable to execute 'x86_64-linux-gnu-gcc': No such file or directory error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ``` ``` Running setup.py bdist_wheel for rjsmin ... error Complete output from command /home/ubuntu/webapps/hc-venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-cfntw7bo/rjsmin/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-ytqxu9_b --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 copying ./rjsmin.py -> build/lib.linux-x86_64-3.6 running build_ext building '_rjsmin' extension creating build/temp.linux-x86_64-3.6 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.6m -I/home/ubuntu/webapps/hc-venv/include/python3.6m -c rjsmin.c -o build/temp.linux-x86_64-3.6/rjsmin.o In file included from rjsmin.c:18:0: _setup/include/cext.h:34:10: fatal error: Python.h: No such file or directory #include "Python.h" ^~~~~~~~~~ compilation terminated. ```
6 years ago
10 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. # Healthchecks
  2. ![Build Status](https://github.com/healthchecks/healthchecks/workflows/Django%20CI/badge.svg)
  3. [![Coverage Status](https://coveralls.io/repos/healthchecks/healthchecks/badge.svg?branch=master&service=github)](https://coveralls.io/github/healthchecks/healthchecks?branch=master)
  4. ![Screenshot of Welcome page](/static/img/welcome.png?raw=true "Welcome Page")
  5. ![Screenshot of My Checks page](/static/img/my_checks.png?raw=true "My Checks Page")
  6. ![Screenshot of Period/Grace dialog](/static/img/period_grace.png?raw=true "Period/Grace Dialog")
  7. ![Screenshot of Cron dialog](/static/img/cron.png?raw=true "Cron Dialog")
  8. ![Screenshot of Integrations page](/static/img/channels.png?raw=true "Integrations Page")
  9. Healthchecks is a cron job monitoring service. It listens for HTTP requests
  10. and email messages ("pings") from your cron jobs and scheduled tasks ("checks").
  11. When a ping does not arrive on time, Healthchecks sends out alerts.
  12. Healthchecks comes with a web dashboard, API, 25+ integrations for
  13. delivering notifications, monthly email reports, WebAuthn 2FA support,
  14. team management features: projects, team members, read-only access.
  15. The building blocks are:
  16. * Python 3.6+
  17. * Django 3
  18. * PostgreSQL or MySQL
  19. Healthchecks is licensed under the BSD 3-clause license.
  20. Healthchecks is available as a hosted service
  21. at [https://healthchecks.io/](https://healthchecks.io/).
  22. ## Setting Up for Development
  23. To set up Healthchecks development environment:
  24. * Install dependencies (Debian/Ubuntu):
  25. $ sudo apt-get update
  26. $ sudo apt-get install -y gcc python3-dev python3-venv libpq-dev
  27. * Prepare directory for project code and virtualenv. Feel free to use a
  28. different location:
  29. $ mkdir -p ~/webapps
  30. $ cd ~/webapps
  31. * Prepare virtual environment
  32. (with virtualenv you get pip, we'll use it soon to install requirements):
  33. $ python3 -m venv hc-venv
  34. $ source hc-venv/bin/activate
  35. $ pip3 install wheel # make sure wheel is installed in the venv
  36. * Check out project code:
  37. $ git clone https://github.com/healthchecks/healthchecks.git
  38. * Install requirements (Django, ...) into virtualenv:
  39. $ pip install -r healthchecks/requirements.txt
  40. * Create database tables and a superuser account:
  41. $ cd ~/webapps/healthchecks
  42. $ ./manage.py migrate
  43. $ ./manage.py createsuperuser
  44. With the default configuration, Healthchecks stores data in a SQLite file
  45. `hc.sqlite` in the checkout directory (`~/webapps/healthchecks`).
  46. To use PostgreSQL or MySQL, see the section **Database Configuration** section
  47. below.
  48. * Run tests:
  49. $ ./manage.py test
  50. * Run development server:
  51. $ ./manage.py runserver
  52. The site should now be running at `http://localhost:8000`.
  53. To access Django administration site, log in as a superuser, then
  54. visit `http://localhost:8000/admin/`
  55. ## Configuration
  56. Healthchecks reads configuration from environment variables.
  57. [Full list of configuration parameters](https://healthchecks.io/docs/self_hosted_configuration/).
  58. ## Accessing Administration Panel
  59. Healthchecks comes with Django's administration panel where you can manually
  60. view and modify user accounts, projects, checks, integrations etc. To access it,
  61. * if you haven't already, create a superuser account: `./manage.py createsuperuser`
  62. * log into the site using superuser credentials
  63. * in the top navigation, "Account" dropdown, select "Site Administration"
  64. ## Sending Emails
  65. Healthchecks must be able to send email messages, so it can send out login
  66. links and alerts to users. Specify your SMTP credentials using the following
  67. environment variables:
  68. ```python
  69. EMAIL_HOST = "your-smtp-server-here.com"
  70. EMAIL_PORT = 587
  71. EMAIL_HOST_USER = "smtp-username"
  72. EMAIL_HOST_PASSWORD = "smtp-password"
  73. EMAIL_USE_TLS = True
  74. ```
  75. For more information, have a look at Django documentation,
  76. [Sending Email](https://docs.djangoproject.com/en/1.10/topics/email/) section.
  77. ## Receiving Emails
  78. Healthchecks comes with a `smtpd` management command, which starts up a
  79. SMTP listener service. With the command running, you can ping your
  80. checks by sending email messages
  81. to `[email protected]` email addresses.
  82. Start the SMTP listener on port 2525:
  83. $ ./manage.py smtpd --port 2525
  84. Send a test email:
  85. $ curl --url 'smtp://127.0.0.1:2525' \
  86. --mail-from '[email protected]' \
  87. --mail-rcpt '[email protected]' \
  88. -F '='
  89. ## Sending Status Notifications
  90. healtchecks comes with a `sendalerts` management command, which continuously
  91. polls database for any checks changing state, and sends out notifications as
  92. needed. Within an activated virtualenv, you can manually run
  93. the `sendalerts` command like so:
  94. $ ./manage.py sendalerts
  95. In a production setup, you will want to run this command from a process
  96. manager like [supervisor](http://supervisord.org/) or systemd.
  97. ## Database Cleanup
  98. With time and use the Healthchecks database will grow in size. You may
  99. decide to prune old data: inactive user accounts, old checks not assigned
  100. to users, records of outgoing email messages and records of received pings.
  101. There are separate Django management commands for each task:
  102. * Remove old records from `api_ping` table. For each check, keep 100 most
  103. recent pings:
  104. ```
  105. $ ./manage.py prunepings
  106. ```
  107. Note: 100 is the default value but you can configure a different
  108. limit per-user. To do that, go to the
  109. Administration Panel, look up user's **Profile** and modify its
  110. "Ping log limit" field.
  111. * Remove old records of sent notifications. For each check, remove
  112. notifications that are older than the oldest stored ping for same check.
  113. ```
  114. $ ./manage.py prunenotifications
  115. ```
  116. * Remove user accounts that match either of these conditions:
  117. * Account was created more than 6 months ago, and user has never logged in.
  118. These can happen when user enters invalid email address when signing up.
  119. * Last login was more than 6 months ago, and the account has no checks.
  120. Assume the user doesn't intend to use the account any more and would
  121. probably *want* it removed.
  122. ```
  123. $ ./manage.py pruneusers
  124. ```
  125. * Remove old records from the `api_tokenbucket` table. The TokenBucket
  126. model is used for rate-limiting login attempts and similar operations.
  127. Any records older than one day can be safely removed.
  128. ```
  129. $ ./manage.py prunetokenbucket
  130. ```
  131. * Remove old records from the `api_flip` table. The Flip
  132. objects are used to track status changes of checks, and to calculate
  133. downtime statistics month by month. Flip objects from more than 3 months
  134. ago are not used and can be safely removed.
  135. ```
  136. $ ./manage.py pruneflips
  137. ```
  138. When you first try these commands on your data, it is a good idea to
  139. test them on a copy of your database, not on the live database right away.
  140. In a production setup, you should also have regular, automated database
  141. backups set up.
  142. ## Two-factor Authentication
  143. Healthchecks optionally supports two-factor authentication using the WebAuthn
  144. standard. To enable WebAuthn support, set the `RP_ID` (relying party identifier )
  145. setting to a non-null value. Set its value to your site's domain without scheme
  146. and without port. For example, if your site runs on `https://my-hc.example.org`,
  147. set `RP_ID` to `my-hc.example.org`.
  148. Note that WebAuthn requires HTTPS, even if running on localhost. To test WebAuthn
  149. locally with a self-signed certificate, you can use the `runsslserver` command
  150. from the `django-sslserver` package.
  151. ## External Authentication
  152. Healthchecks supports external authentication by means of HTTP headers set by
  153. reverse proxies or the WSGI server. This allows you to integrate it into your
  154. existing authentication system (e.g., LDAP or OAuth) via an authenticating proxy.
  155. When this option is enabled, **healtchecks will trust the header's value implicitly**,
  156. so it is **very important** to ensure that attackers cannot set the value themselves
  157. (and thus impersonate any user). How to do this varies by your chosen proxy,
  158. but generally involves configuring it to strip out headers that normalize to the
  159. same name as the chosen identity header.
  160. To enable this feature, set the `REMOTE_USER_HEADER` value to a header you wish to
  161. authenticate with. HTTP headers will be prefixed with `HTTP_` and have any dashes
  162. converted to underscores. Headers without that prefix can be set by the WSGI server
  163. itself only, which is more secure.
  164. When `REMOTE_USER_HEADER` is set, Healthchecks will:
  165. - assume the header contains user's email address
  166. - look up and automatically log in the user with a matching email address
  167. - automatically create an user account if it does not exist
  168. - disable the default authentication methods (login link to email, password)
  169. ## Integrations
  170. ### Slack
  171. To enable the Slack "self-service" integration, you will need to create a "Slack App".
  172. To do so:
  173. * Create a _new Slack app_ on https://api.slack.com/apps/
  174. * Add at least _one scope_ in the permissions section to be able to deploy the app in your workspace (By example `incoming-webhook` for the `Bot Token Scopes`
  175. https://api.slack.com/apps/APP_ID/oauth?).
  176. * Add a _redirect url_ in the format `SITE_ROOT/integrations/add_slack_btn/`.
  177. For example, if your SITE_ROOT is `https://my-hc.example.org` then the redirect URL would be
  178. `https://my-hc.example.org/integrations/add_slack_btn/`.
  179. * Look up your Slack app for the Client ID and Client Secret at https://api.slack.com/apps/APP_ID/general? . Put them
  180. in `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET` environment
  181. variables.
  182. ### Discord
  183. To enable Discord integration, you will need to:
  184. * register a new application on https://discordapp.com/developers/applications/me
  185. * add a redirect URI to your Discord application. The URI format is
  186. `SITE_ROOT/integrations/add_discord/`. For example, if you are running a
  187. development server on `localhost:8000` then the redirect URI would be
  188. `http://localhost:8000/integrations/add_discord/`
  189. * Look up your Discord app's Client ID and Client Secret. Put them
  190. in `DISCORD_CLIENT_ID` and `DISCORD_CLIENT_SECRET` environment
  191. variables.
  192. ### Pushover
  193. Pushover integration works by creating an application on Pushover.net which
  194. is then subscribed to by Healthchecks users. The registration workflow is as follows:
  195. * On Healthchecks, the user adds a "Pushover" integration to a project
  196. * Healthchecks redirects user's browser to a Pushover.net subscription page
  197. * User approves adding the Healthchecks subscription to their Pushover account
  198. * Pushover.net HTTP redirects back to Healthchecks with a subscription token
  199. * Healthchecks saves the subscription token and uses it for sending Pushover
  200. notifications
  201. To enable the Pushover integration, you will need to:
  202. * Register a new application on Pushover via https://pushover.net/apps/build.
  203. * Within the Pushover 'application' configuration, enable subscriptions.
  204. Make sure the subscription type is set to "URL". Also make sure the redirect
  205. URL is configured to point back to the root of the Healthchecks instance
  206. (e.g., `http://healthchecks.example.com/`).
  207. * Put the Pushover application API Token and the Pushover subscription URL in
  208. `PUSHOVER_API_TOKEN` and `PUSHOVER_SUBSCRIPTION_URL` environment
  209. variables. The Pushover subscription URL should look similar to
  210. `https://pushover.net/subscribe/yourAppName-randomAlphaNumericData`.
  211. ### Signal
  212. Healthchecks uses [signal-cli](https://github.com/AsamK/signal-cli) to send Signal
  213. notifications. Healthcecks interacts with signal-cli over DBus.
  214. To enable the Signal integration:
  215. * Set up and configure signal-cli to listen on DBus system bus ([instructions](https://github.com/AsamK/signal-cli/wiki/DBus-service)).
  216. Make sure you can send test messages from command line, using the `dbus-send`
  217. example given in the signal-cli instructions.
  218. * Set the `SIGNAL_CLI_ENABLED` environment variable to `True`.
  219. ### Telegram
  220. * Create a Telegram bot by talking to the
  221. [BotFather](https://core.telegram.org/bots#6-botfather). Set the bot's name,
  222. description, user picture, and add a "/start" command.
  223. * After creating the bot you will have the bot's name and token. Put them
  224. in `TELEGRAM_BOT_NAME` and `TELEGRAM_TOKEN` environment variables.
  225. * Run `settelegramwebhook` management command. This command tells Telegram
  226. where to forward channel messages by invoking Telegram's
  227. [setWebhook](https://core.telegram.org/bots/api#setwebhook) API call:
  228. ```
  229. $ ./manage.py settelegramwebhook
  230. Done, Telegram's webhook set to: https://my-monitoring-project.com/integrations/telegram/bot/
  231. ```
  232. For this to work, your `SITE_ROOT` needs to be correct and use "https://"
  233. scheme.
  234. ### Apprise
  235. To enable Apprise integration, you will need to:
  236. * ensure you have apprise installed in your local environment:
  237. ```bash
  238. pip install apprise
  239. ```
  240. * enable the apprise functionality by setting the `APPRISE_ENABLED` environment variable.
  241. ### Shell Commands
  242. The "Shell Commands" integration runs user-defined local shell commands when checks
  243. go up or down. This integration is disabled by default, and can be enabled by setting
  244. the `SHELL_ENABLED` environment variable to `True`.
  245. Note: be careful when using "Shell Commands" integration, and only enable it when
  246. you fully trust the users of your Healthchecks instance. The commands will be executed
  247. by the `manage.py sendalerts` process, and will run with the same system permissions as
  248. the `sendalerts` process.
  249. ### Matrix
  250. To enable the Matrix integration you will need to:
  251. * Register a bot user (for posting notifications) in your preferred homeserver.
  252. * Use the [Login API call](https://www.matrix.org/docs/guides/client-server-api#login)
  253. to retrieve bot user's access token. You can run it as shown in the documentation,
  254. using curl in command shell.
  255. * Set the `MATRIX_` environment variables. Example:
  256. ```
  257. MATRIX_HOMESERVER=https://matrix.org
  258. MATRIX_USER_ID=@mychecks:matrix.org
  259. MATRIX_ACCESS_TOKEN=[a long string of characters returned by the login call]
  260. ```
  261. ## Running in Production
  262. Here is a non-exhaustive list of pointers and things to check before launching a Healthchecks instance
  263. in production.
  264. * Environment variables, settings.py and local_settings.py.
  265. * [DEBUG](https://docs.djangoproject.com/en/2.2/ref/settings/#debug). Make sure it is set to `False`.
  266. * [ALLOWED_HOSTS](https://docs.djangoproject.com/en/2.2/ref/settings/#allowed-hosts). Make sure it
  267. contains the correct domain name you want to use.
  268. * Server Errors. When DEBUG=False, Django will not show detailed error pages, and will not print exception
  269. tracebacks to standard output. To receive exception tracebacks in email,
  270. review and edit the [ADMINS](https://docs.djangoproject.com/en/2.2/ref/settings/#admins) and
  271. [SERVER_EMAIL](https://docs.djangoproject.com/en/2.2/ref/settings/#server-email) settings.
  272. Another good option for receiving exception tracebacks is to use [Sentry](https://sentry.io/for/django/).
  273. * Management commands that need to be run during each deployment.
  274. * This project uses [Django Compressor](https://django-compressor.readthedocs.io/en/stable/)
  275. to combine the CSS and JS files. It is configured for offline compression – run the
  276. `manage.py compress` command whenever files in the `/static/` directory change.
  277. * This project uses Django's [staticfiles app](https://docs.djangoproject.com/en/2.2/ref/contrib/staticfiles/).
  278. Run the `manage.py collectstatic` command whenever files in the `/static/`
  279. directory change. This command collects all the static files inside the `static-collected` directory.
  280. Configure your web server to serve files from this directory under the `/static/` prefix.
  281. * Database migration should be run after each update to make sure the database schemas are up to date. You can do that with `./manage.py migrate`.
  282. * Processes that need to be running constantly.
  283. * `manage.py runserver` is intended for development only. Do not use it in production,
  284. instead consider using [uWSGI](https://uwsgi-docs.readthedocs.io/en/latest/) or
  285. [gunicorn](https://gunicorn.org/).
  286. * Make sure the `manage.py sendalerts` command is running and can survive server restarts.
  287. On modern linux systems, a good option is to
  288. [define a systemd service](https://github.com/healthchecks/healthchecks/issues/273#issuecomment-520560304) for it.
  289. * General
  290. * Make sure the database is secured well and is getting backed up regularly
  291. * Make sure the TLS certificates are secured well and are getting refreshed regularly
  292. * Have monitoring in place to be sure the Healthchecks instance itself is operational
  293. (is accepting pings, is sending out alerts, is not running out of resources).