forked from GithubBackups/healthchecks
Mention SITE_NAME in README, better docs for the unique
API field.
This commit is contained in:
parent
22ac7e0517
commit
9a00fd9944
30
README.md
30
README.md
@ -67,6 +67,26 @@ The site should now be running at `http://localhost:8080`
|
|||||||
To log into Django administration site as a super user,
|
To log into Django administration site as a super user,
|
||||||
visit `http://localhost:8080/admin`
|
visit `http://localhost:8080/admin`
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
Site configuration is kept in `hc/settings.py`. Additional configuration
|
||||||
|
is loaded from `hc/local_settings.py` file, if it exists. You
|
||||||
|
can create this file (should be right next to `settings.py` in the filesystem)
|
||||||
|
and override settings as needed.
|
||||||
|
|
||||||
|
Some useful settings keys to override are:
|
||||||
|
|
||||||
|
`SITE_ROOT` is used to build fully qualified URLs for pings, and for use in
|
||||||
|
emails and notifications. Example:
|
||||||
|
|
||||||
|
SITE_ROOT = "https://my-monitoring-project.com"`
|
||||||
|
|
||||||
|
`SITE_NAME` has the default value of "healthchecks.io" and is used throughout
|
||||||
|
the templates. Replace it with your own name to personalize your installation.
|
||||||
|
Example:
|
||||||
|
|
||||||
|
SITE_NAME = "My Monitoring Project"
|
||||||
|
|
||||||
## Database Configuration
|
## Database Configuration
|
||||||
|
|
||||||
Database configuration is stored in `hc/settings.py` and can be overriden
|
Database configuration is stored in `hc/settings.py` and can be overriden
|
||||||
@ -112,7 +132,6 @@ configuration from environment variables like so:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Sending Emails
|
## Sending Emails
|
||||||
|
|
||||||
healthchecks must be able to send email messages, so it can send out login
|
healthchecks must be able to send email messages, so it can send out login
|
||||||
@ -125,6 +144,7 @@ scenes. For example, the healthchecks.io site uses
|
|||||||
[django-ses-backend](https://github.com/piotrbulinski/django-ses-backend/)
|
[django-ses-backend](https://github.com/piotrbulinski/django-ses-backend/)
|
||||||
and the email configuration in `hc/local_settings.py` looks as follows:
|
and the email configuration in `hc/local_settings.py` looks as follows:
|
||||||
|
|
||||||
|
DEFAULT_FROM_EMAIL = 'noreply@my-monitoring-project.com'
|
||||||
DJMAIL_REAL_BACKEND = 'django_ses_backend.SESBackend'
|
DJMAIL_REAL_BACKEND = 'django_ses_backend.SESBackend'
|
||||||
AWS_SES_ACCESS_KEY_ID = "put-access-key-here"
|
AWS_SES_ACCESS_KEY_ID = "put-access-key-here"
|
||||||
AWS_SES_SECRET_ACCESS_KEY = "put-secret-access-key-here"
|
AWS_SES_SECRET_ACCESS_KEY = "put-secret-access-key-here"
|
||||||
@ -180,11 +200,11 @@ There are separate Django management commands for each task:
|
|||||||
|
|
||||||
```
|
```
|
||||||
$ ./manage.py pruneusers
|
$ ./manage.py pruneusers
|
||||||
```
|
```
|
||||||
|
|
||||||
When you first try these commands on your data, it is a good idea to
|
When you first try these commands on your data, it is a good idea to
|
||||||
test them on a copy of your database, not on the live database right away.
|
test them on a copy of your database, not on the live database right away.
|
||||||
In a production setup, you should also have regular, automated database
|
In a production setup, you should also have regular, automated database
|
||||||
backups set up.
|
backups set up.
|
||||||
|
|
||||||
## Integrations
|
## Integrations
|
||||||
|
@ -84,7 +84,7 @@ TEST_RUNNER = 'hc.api.tests.CustomRunner'
|
|||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
'ENGINE': 'django.db.backends.sqlite3',
|
||||||
'NAME': './hc.sqlite',
|
'NAME': './hc.sqlite',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,9 +93,9 @@ DATABASES = {
|
|||||||
if os.environ.get("DB") == "postgres":
|
if os.environ.get("DB") == "postgres":
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.postgresql',
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
'NAME': 'hc',
|
'USER': 'postgres',
|
||||||
'USER': 'postgres',
|
'NAME': 'hc',
|
||||||
'TEST': {'CHARSET': 'UTF8'}
|
'TEST': {'CHARSET': 'UTF8'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -104,8 +104,8 @@ if os.environ.get("DB") == "mysql":
|
|||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
'ENGINE': 'django.db.backends.mysql',
|
||||||
'USER': 'root',
|
'USER': 'root',
|
||||||
'NAME': 'hc',
|
'NAME': 'hc',
|
||||||
'TEST': {'CHARSET': 'UTF8'}
|
'TEST': {'CHARSET': 'UTF8'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,4 +50,12 @@ a.section {
|
|||||||
|
|
||||||
a.section:hover {
|
a.section:hover {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-docs code {
|
||||||
|
padding: 2px 4px;
|
||||||
|
font-size: 90%;
|
||||||
|
color: #427d5e;
|
||||||
|
background-color: #f2f9f6;
|
||||||
|
border-radius: 4px;
|
||||||
}
|
}
|
@ -35,7 +35,7 @@ its value should be your API key.
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
For POST requests, the {% site_name %} API expects request body to be
|
For POST requests, the {% site_name %} API expects request body to be
|
||||||
a JSON document (<em>not</em> a <code>mulitpart/form-data</code> encoded
|
a JSON document (<em>not</em> a <code>multipart/form-data</code> encoded
|
||||||
form data).
|
form data).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@ -99,6 +99,8 @@ The response may contain a JSON document with additional data.
|
|||||||
<td>
|
<td>
|
||||||
<p>string, optional, default value: ""</p>
|
<p>string, optional, default value: ""</p>
|
||||||
<p>A space-delimited list of tags for the new check.</p>
|
<p>A space-delimited list of tags for the new check.</p>
|
||||||
|
<p>Example:</p>
|
||||||
|
<pre>{"tags": "reports staging"}</pre>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -107,6 +109,8 @@ The response may contain a JSON document with additional data.
|
|||||||
<p>number, optional, default value: {{ default_timeout }}.</p>
|
<p>number, optional, default value: {{ default_timeout }}.</p>
|
||||||
<p>A number of seconds, the expected period of this check.</p>
|
<p>A number of seconds, the expected period of this check.</p>
|
||||||
<p>Minimum: 60 (one minute), maximum: 604800 (one week).</p>
|
<p>Minimum: 60 (one minute), maximum: 604800 (one week).</p>
|
||||||
|
<p>Example for 5 minute timeout:</p>
|
||||||
|
<pre>{"timeout": 300}</pre>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -130,15 +134,38 @@ The response may contain a JSON document with additional data.
|
|||||||
<tr>
|
<tr>
|
||||||
<th>unique</th>
|
<th>unique</th>
|
||||||
<td>
|
<td>
|
||||||
<p>array of strings, optional, default value: [].</p>
|
<p>array of string values, optional, default value: [].</p>
|
||||||
<p>Tells the API to only create a new check if the combination of fields
|
<p>Before creating a check, look for existing checks, filtered
|
||||||
in <code>unqiue</code> is unique. The fields currently supported are
|
by fields listed in <code>unique</code>. If a matching check is
|
||||||
name, tags, timeout, and grace. If a new check is created the API returns
|
found, return it with HTTP status code 200. If no matching check is
|
||||||
a 201 code, otherwise it returns a 200 code.</p>
|
found, proceed as normal: create a check and return it
|
||||||
|
with HTTP status code 201.</p>
|
||||||
|
|
||||||
|
<p>The accepted values are: <code>name</code>,
|
||||||
|
<code>tags</code>, <code>timeout</code> and <code>grace</code>.</p>
|
||||||
|
|
||||||
|
<p>Example:</p>
|
||||||
|
<pre>{"name": "Backups", unique: ["name"]}</pre>
|
||||||
|
<p>In this example, if a check named "Backups" exists, it will
|
||||||
|
be returned. Otherwise, a new check will be created and
|
||||||
|
returned.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<h3 class="api-section">Response Codes</h3>
|
||||||
|
<table class="table">
|
||||||
|
<tr>
|
||||||
|
<th>201 Created</th>
|
||||||
|
<td>Returned if the check was successfully created.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>200 OK</th>
|
||||||
|
<td>Returned if the <code>unique</code> parameter was used and an
|
||||||
|
existing check was matched.</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
<h3 class="api-section">Example Request</h3>
|
<h3 class="api-section">Example Request</h3>
|
||||||
{% include "front/snippets/create_check_request.html" %}
|
{% include "front/snippets/create_check_request.html" %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user