forked from GithubBackups/healthchecks
commit
6643a7771b
21
README.md
21
README.md
@ -81,13 +81,17 @@ Some useful settings keys to override are:
|
|||||||
`SITE_ROOT` is used to build fully qualified URLs for pings, and for use in
|
`SITE_ROOT` is used to build fully qualified URLs for pings, and for use in
|
||||||
emails and notifications. Example:
|
emails and notifications. Example:
|
||||||
|
|
||||||
|
```python
|
||||||
SITE_ROOT = "https://my-monitoring-project.com"
|
SITE_ROOT = "https://my-monitoring-project.com"
|
||||||
|
```
|
||||||
|
|
||||||
`SITE_NAME` has the default value of "Mychecks" and is used throughout
|
`SITE_NAME` has the default value of "Mychecks" and is used throughout
|
||||||
the templates. Replace it with your own name to personalize your installation.
|
the templates. Replace it with your own name to personalize your installation.
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
```python
|
||||||
SITE_NAME = "My Monitoring Project"
|
SITE_NAME = "My Monitoring Project"
|
||||||
|
```
|
||||||
|
|
||||||
`REGISTRATION_OPEN` controls whether site visitors can create new accounts.
|
`REGISTRATION_OPEN` controls whether site visitors can create new accounts.
|
||||||
Set it to `False` if you are setting up a private healthchecks instance, but
|
Set it to `False` if you are setting up a private healthchecks instance, but
|
||||||
@ -105,6 +109,7 @@ in `hc/local_settings.py`. The default database engine is SQLite. To use
|
|||||||
PostgreSQL, create `hc/local_settings.py` if it does not exist, and put the
|
PostgreSQL, create `hc/local_settings.py` if it does not exist, and put the
|
||||||
following in it, changing it as neccessary:
|
following in it, changing it as neccessary:
|
||||||
|
|
||||||
|
```python
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.postgresql',
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
@ -114,9 +119,11 @@ following in it, changing it as neccessary:
|
|||||||
'TEST': {'CHARSET': 'UTF8'}
|
'TEST': {'CHARSET': 'UTF8'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
For MySQL:
|
For MySQL:
|
||||||
|
|
||||||
|
```python
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
@ -126,10 +133,12 @@ For MySQL:
|
|||||||
'TEST': {'CHARSET': 'UTF8'}
|
'TEST': {'CHARSET': 'UTF8'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
You can also use `hc/local_settings.py` to read database
|
You can also use `hc/local_settings.py` to read database
|
||||||
configuration from environment variables like so:
|
configuration from environment variables like so:
|
||||||
|
|
||||||
|
```python
|
||||||
import os
|
import os
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
@ -141,7 +150,7 @@ configuration from environment variables like so:
|
|||||||
'TEST': {'CHARSET': 'UTF8'}
|
'TEST': {'CHARSET': 'UTF8'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Sending Emails
|
## Sending Emails
|
||||||
|
|
||||||
@ -149,11 +158,13 @@ healthchecks must be able to send email messages, so it can send out login
|
|||||||
links and alerts to users. Put your SMTP server configuration in
|
links and alerts to users. Put your SMTP server configuration in
|
||||||
`hc/local_settings.py` like so:
|
`hc/local_settings.py` like so:
|
||||||
|
|
||||||
|
```python
|
||||||
EMAIL_HOST = "your-smtp-server-here.com"
|
EMAIL_HOST = "your-smtp-server-here.com"
|
||||||
EMAIL_PORT = 587
|
EMAIL_PORT = 587
|
||||||
EMAIL_HOST_USER = "username"
|
EMAIL_HOST_USER = "username"
|
||||||
EMAIL_HOST_PASSWORD = "password"
|
EMAIL_HOST_PASSWORD = "password"
|
||||||
EMAIL_USE_TLS = True
|
EMAIL_USE_TLS = True
|
||||||
|
```
|
||||||
|
|
||||||
For more information, have a look at Django documentation,
|
For more information, have a look at Django documentation,
|
||||||
[Sending Email](https://docs.djangoproject.com/en/1.10/topics/email/) section.
|
[Sending Email](https://docs.djangoproject.com/en/1.10/topics/email/) section.
|
||||||
@ -180,9 +191,9 @@ There are separate Django management commands for each task:
|
|||||||
* Remove old records from `api_ping` table. For each check, keep 100 most
|
* Remove old records from `api_ping` table. For each check, keep 100 most
|
||||||
recent pings:
|
recent pings:
|
||||||
|
|
||||||
````
|
```
|
||||||
$ ./manage.py prunepings
|
$ ./manage.py prunepings
|
||||||
````
|
```
|
||||||
|
|
||||||
* Remove checks older than 2 hours that are not assigned to users. Such
|
* Remove checks older than 2 hours that are not assigned to users. Such
|
||||||
checks are by-products of random visitors and robots loading the welcome
|
checks are by-products of random visitors and robots loading the welcome
|
||||||
@ -195,9 +206,9 @@ There are separate Django management commands for each task:
|
|||||||
* Remove old records of sent notifications. For each check, remove
|
* Remove old records of sent notifications. For each check, remove
|
||||||
notifications that are older than the oldest stored ping for same check.
|
notifications that are older than the oldest stored ping for same check.
|
||||||
|
|
||||||
````
|
```
|
||||||
$ ./manage.py prunenotifications
|
$ ./manage.py prunenotifications
|
||||||
````
|
```
|
||||||
|
|
||||||
* Remove user accounts that match either of these conditions:
|
* Remove user accounts that match either of these conditions:
|
||||||
* Account was created more than 6 months ago, and user has never logged in.
|
* Account was created more than 6 months ago, and user has never logged in.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user