|
|
# Basics
|
|
|
|
|
|
The Status-API server is configured via a single JSON file. It must be mounted at `/config.json` into the container and can be set read-only. Take a look at [config.example.json](https://git.leon.wtf/leon/status-api/-/blob/master/config.example.json) for an example configuration.
|
|
|
The Status-API server is configured via a single JSON file. It must be mounted at `/config.json` into the container and can be set read-only. Take a look at [config.example.json](https://git.leon.wtf/leon/status-api/-/blob/master/server/config.example.json) for an example configuration.
|
|
|
|
|
|
# Structure
|
|
|
|
|
|
The basic structure of the config file is:
|
|
|
```json
|
|
|
{
|
|
|
"<option>": "<value>",
|
|
|
"<option>": "<value>",
|
|
|
...
|
|
|
"services": {
|
|
|
"<service name>": {
|
|
|
"friendly_url": "https://some-website.de",
|
|
|
"protocol": {
|
|
|
"type": "<some type>",
|
|
|
"config": {...}
|
|
|
"protocol": "http"
|
|
|
"protocol_config": {
|
|
|
"<protocol-config>": "<value>",
|
|
|
...
|
|
|
}
|
|
|
},
|
|
|
"<service name>": {
|
... | ... | @@ -21,18 +26,34 @@ The basic structure of the config file is: |
|
|
"config": {...}
|
|
|
}
|
|
|
}
|
|
|
....
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
The keys in the first level must be the service names. They can be choosen freely and are displayed in the API response.
|
|
|
Under every key, there must be another JSON object containing the `"friendy_url"` and `"protocol"` keys. The friendly URL is always displayed in the API response. Depending on the test protocol and it's configuration, this URL is taken as the URL which will be used to determine if the service is up. But mostly, a seperate test URL can be set, which is not displayed in the API response.
|
|
|
# First level options
|
|
|
|
|
|
All of these options are optional and have default values that can be overwritten by setting the options.
|
|
|
|
|
|
| Option | Default value |
|
|
|
|--------------------|---------------------|
|
|
|
| `"host"` | `0.0.0.0:3002` |
|
|
|
| `"db_path"` | `/db.sqlite` |
|
|
|
| `"check_interval"` | `120` |
|
|
|
| `"no_frontend"` | `false` |
|
|
|
| `"frontend_path"` | `../frontend/build` |
|
|
|
|
|
|
# Services
|
|
|
|
|
|
The keys under the `"services"` object are the service names. They can be choosen freely and are displayed in the API response.
|
|
|
Under every service, there must be another JSON object containing the `"friendy_url"` and `"protocol"` keys. The friendly URL is always displayed in the API response. The protocol must be set to one of the registered checkers (e.g. `"http"`).
|
|
|
|
|
|
Some protocols allow setting protocol specific options via the `"protocol_config"` key. This key is also optional and will be populated with the protocols defaults if not provided.
|
|
|
|
|
|
# Protocol that is used to test the service (`"protocol"` key)
|
|
|
The protocol specific options can be looked up below.
|
|
|
|
|
|
The `"protocol":` key must always contain the `"type":` key. Currently, it can be set to `"http"`, `"teamspeak"`, or `"minecraft"` (take a look at #1 for updates on protocol support). The also mandatory `"config":` key must be configured depending on the protocol type. See below for documentation for them. Most of the options under the `"config":` key are optional. If none of them are set, the `"config":` key can be empty (`{}`) but **not** omitted.
|
|
|
|
|
|
# Protocol Module List
|
|
|
# Protocol module list
|
|
|
- [HTTP Config](Protocol Modules/HTTP)
|
|
|
- [Teamspeak Config](Protocol Modules/Teamspeak)
|
|
|
- [Minecraft Config](Protocol Modules/Minecraft) |
|
|
\ No newline at end of file |