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.

403 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. * Remove old records of sent notifications. For each check, remove
  108. notifications that are older than the oldest stored ping for same check.
  109. ```
  110. $ ./manage.py prunenotifications
  111. ```
  112. * Remove user accounts that match either of these conditions:
  113. * Account was created more than 6 months ago, and user has never logged in.
  114. These can happen when user enters invalid email address when signing up.
  115. * Last login was more than 6 months ago, and the account has no checks.
  116. Assume the user doesn't intend to use the account any more and would
  117. probably *want* it removed.
  118. ```
  119. $ ./manage.py pruneusers
  120. ```
  121. * Remove old records from the `api_tokenbucket` table. The TokenBucket
  122. model is used for rate-limiting login attempts and similar operations.
  123. Any records older than one day can be safely removed.
  124. ```
  125. $ ./manage.py prunetokenbucket
  126. ```
  127. * Remove old records from the `api_flip` table. The Flip
  128. objects are used to track status changes of checks, and to calculate
  129. downtime statistics month by month. Flip objects from more than 3 months
  130. ago are not used and can be safely removed.
  131. ```
  132. $ ./manage.py pruneflips
  133. ```
  134. When you first try these commands on your data, it is a good idea to
  135. test them on a copy of your database, not on the live database right away.
  136. In a production setup, you should also have regular, automated database
  137. backups set up.
  138. ## Two-factor Authentication
  139. Healthchecks optionally supports two-factor authentication using the WebAuthn
  140. standard. To enable WebAuthn support, set the `RP_ID` (relying party identifier )
  141. setting to a non-null value. Set its value to your site's domain without scheme
  142. and without port. For example, if your site runs on `https://my-hc.example.org`,
  143. set `RP_ID` to `my-hc.example.org`.
  144. Note that WebAuthn requires HTTPS, even if running on localhost. To test WebAuthn
  145. locally with a self-signed certificate, you can use the `runsslserver` command
  146. from the `django-sslserver` package.
  147. ## External Authentication
  148. Healthchecks supports external authentication by means of HTTP headers set by
  149. reverse proxies or the WSGI server. This allows you to integrate it into your
  150. existing authentication system (e.g., LDAP or OAuth) via an authenticating proxy.
  151. When this option is enabled, **healtchecks will trust the header's value implicitly**,
  152. so it is **very important** to ensure that attackers cannot set the value themselves
  153. (and thus impersonate any user). How to do this varies by your chosen proxy,
  154. but generally involves configuring it to strip out headers that normalize to the
  155. same name as the chosen identity header.
  156. To enable this feature, set the `REMOTE_USER_HEADER` value to a header you wish to
  157. authenticate with. HTTP headers will be prefixed with `HTTP_` and have any dashes
  158. converted to underscores. Headers without that prefix can be set by the WSGI server
  159. itself only, which is more secure.
  160. When `REMOTE_USER_HEADER` is set, Healthchecks will:
  161. - assume the header contains user's email address
  162. - look up and automatically log in the user with a matching email address
  163. - automatically create an user account if it does not exist
  164. - disable the default authentication methods (login link to email, password)
  165. ## Integrations
  166. ### Slack
  167. To enable the Slack "self-service" integration, you will need to create a "Slack App".
  168. To do so:
  169. * Create a _new Slack app_ on https://api.slack.com/apps/
  170. * 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`
  171. https://api.slack.com/apps/APP_ID/oauth?).
  172. * Add a _redirect url_ in the format `SITE_ROOT/integrations/add_slack_btn/`.
  173. For example, if your SITE_ROOT is `https://my-hc.example.org` then the redirect URL would be
  174. `https://my-hc.example.org/integrations/add_slack_btn/`.
  175. * Look up your Slack app for the Client ID and Client Secret at https://api.slack.com/apps/APP_ID/general? . Put them
  176. in `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET` environment
  177. variables.
  178. ### Discord
  179. To enable Discord integration, you will need to:
  180. * register a new application on https://discordapp.com/developers/applications/me
  181. * add a redirect URI to your Discord application. The URI format is
  182. `SITE_ROOT/integrations/add_discord/`. For example, if you are running a
  183. development server on `localhost:8000` then the redirect URI would be
  184. `http://localhost:8000/integrations/add_discord/`
  185. * Look up your Discord app's Client ID and Client Secret. Put them
  186. in `DISCORD_CLIENT_ID` and `DISCORD_CLIENT_SECRET` environment
  187. variables.
  188. ### Pushover
  189. Pushover integration works by creating an application on Pushover.net which
  190. is then subscribed to by Healthchecks users. The registration workflow is as follows:
  191. * On Healthchecks, the user adds a "Pushover" integration to a project
  192. * Healthchecks redirects user's browser to a Pushover.net subscription page
  193. * User approves adding the Healthchecks subscription to their Pushover account
  194. * Pushover.net HTTP redirects back to Healthchecks with a subscription token
  195. * Healthchecks saves the subscription token and uses it for sending Pushover
  196. notifications
  197. To enable the Pushover integration, you will need to:
  198. * Register a new application on Pushover via https://pushover.net/apps/build.
  199. * Within the Pushover 'application' configuration, enable subscriptions.
  200. Make sure the subscription type is set to "URL". Also make sure the redirect
  201. URL is configured to point back to the root of the Healthchecks instance
  202. (e.g., `http://healthchecks.example.com/`).
  203. * Put the Pushover application API Token and the Pushover subscription URL in
  204. `PUSHOVER_API_TOKEN` and `PUSHOVER_SUBSCRIPTION_URL` environment
  205. variables. The Pushover subscription URL should look similar to
  206. `https://pushover.net/subscribe/yourAppName-randomAlphaNumericData`.
  207. ### Signal
  208. Healthchecks uses [signal-cli](https://github.com/AsamK/signal-cli) to send Signal
  209. notifications. Healthcecks interacts with signal-cli over DBus.
  210. To enable the Signal integration:
  211. * Set up and configure signal-cli to listen on DBus system bus ([instructions](https://github.com/AsamK/signal-cli/wiki/DBus-service)).
  212. Make sure you can send test messages from command line, using the `dbus-send`
  213. example given in the signal-cli instructions.
  214. * Set the `SIGNAL_CLI_ENABLED` environment variable to `True`.
  215. ### Telegram
  216. * Create a Telegram bot by talking to the
  217. [BotFather](https://core.telegram.org/bots#6-botfather). Set the bot's name,
  218. description, user picture, and add a "/start" command.
  219. * After creating the bot you will have the bot's name and token. Put them
  220. in `TELEGRAM_BOT_NAME` and `TELEGRAM_TOKEN` environment variables.
  221. * Run `settelegramwebhook` management command. This command tells Telegram
  222. where to forward channel messages by invoking Telegram's
  223. [setWebhook](https://core.telegram.org/bots/api#setwebhook) API call:
  224. ```
  225. $ ./manage.py settelegramwebhook
  226. Done, Telegram's webhook set to: https://my-monitoring-project.com/integrations/telegram/bot/
  227. ```
  228. For this to work, your `SITE_ROOT` needs to be correct and use "https://"
  229. scheme.
  230. ### Apprise
  231. To enable Apprise integration, you will need to:
  232. * ensure you have apprise installed in your local environment:
  233. ```bash
  234. pip install apprise
  235. ```
  236. * enable the apprise functionality by setting the `APPRISE_ENABLED` environment variable.
  237. ### Shell Commands
  238. The "Shell Commands" integration runs user-defined local shell commands when checks
  239. go up or down. This integration is disabled by default, and can be enabled by setting
  240. the `SHELL_ENABLED` environment variable to `True`.
  241. Note: be careful when using "Shell Commands" integration, and only enable it when
  242. you fully trust the users of your Healthchecks instance. The commands will be executed
  243. by the `manage.py sendalerts` process, and will run with the same system permissions as
  244. the `sendalerts` process.
  245. ### Matrix
  246. To enable the Matrix integration you will need to:
  247. * Register a bot user (for posting notifications) in your preferred homeserver.
  248. * Use the [Login API call](https://www.matrix.org/docs/guides/client-server-api#login)
  249. to retrieve bot user's access token. You can run it as shown in the documentation,
  250. using curl in command shell.
  251. * Set the `MATRIX_` environment variables. Example:
  252. ```
  253. MATRIX_HOMESERVER=https://matrix.org
  254. MATRIX_USER_ID=@mychecks:matrix.org
  255. MATRIX_ACCESS_TOKEN=[a long string of characters returned by the login call]
  256. ```
  257. ## Running in Production
  258. Here is a non-exhaustive list of pointers and things to check before launching a Healthchecks instance
  259. in production.
  260. * Environment variables, settings.py and local_settings.py.
  261. * [DEBUG](https://docs.djangoproject.com/en/2.2/ref/settings/#debug). Make sure it is set to `False`.
  262. * [ALLOWED_HOSTS](https://docs.djangoproject.com/en/2.2/ref/settings/#allowed-hosts). Make sure it
  263. contains the correct domain name you want to use.
  264. * Server Errors. When DEBUG=False, Django will not show detailed error pages, and will not print exception
  265. tracebacks to standard output. To receive exception tracebacks in email,
  266. review and edit the [ADMINS](https://docs.djangoproject.com/en/2.2/ref/settings/#admins) and
  267. [SERVER_EMAIL](https://docs.djangoproject.com/en/2.2/ref/settings/#server-email) settings.
  268. Another good option for receiving exception tracebacks is to use [Sentry](https://sentry.io/for/django/).
  269. * Management commands that need to be run during each deployment.
  270. * This project uses [Django Compressor](https://django-compressor.readthedocs.io/en/stable/)
  271. to combine the CSS and JS files. It is configured for offline compression – run the
  272. `manage.py compress` command whenever files in the `/static/` directory change.
  273. * This project uses Django's [staticfiles app](https://docs.djangoproject.com/en/2.2/ref/contrib/staticfiles/).
  274. Run the `manage.py collectstatic` command whenever files in the `/static/`
  275. directory change. This command collects all the static files inside the `static-collected` directory.
  276. Configure your web server to serve files from this directory under the `/static/` prefix.
  277. * 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`.
  278. * Processes that need to be running constantly.
  279. * `manage.py runserver` is intended for development only. Do not use it in production,
  280. instead consider using [uWSGI](https://uwsgi-docs.readthedocs.io/en/latest/) or
  281. [gunicorn](https://gunicorn.org/).
  282. * Make sure the `manage.py sendalerts` command is running and can survive server restarts.
  283. On modern linux systems, a good option is to
  284. [define a systemd service](https://github.com/healthchecks/healthchecks/issues/273#issuecomment-520560304) for it.
  285. * General
  286. * Make sure the database is secured well and is getting backed up regularly
  287. * Make sure the TLS certificates are secured well and are getting refreshed regularly
  288. * Have monitoring in place to be sure the Healthchecks instance itself is operational
  289. (is accepting pings, is sending out alerts, is not running out of resources).