You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/configuration.md
+18-59Lines changed: 18 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,44 +14,21 @@ Olli provides several configuration options to alter how the application behaves
14
14
15
15
# File Format
16
16
17
-
Olli uses TOML for it's configuration, below the headings such as `olli` correspond to the outer block and the keys inside to the inner block. For example, the `olli` configuration section has a key `interval_minutes`, which in code looks like:
18
-
19
-
```toml
20
-
[olli]
21
-
interval_minutes = 5
22
-
```
17
+
Olli uses a .env file or environment variables for it's configuration, see `.env.example` for an example `.env` file. This file must either exist in the project root directory, or environment variables must be made available to the container.
23
18
24
19
Configuration is validated on startup and if a key is missing or otherwise incorrectly formatted Olli will refuse to start with an error.
25
20
26
-
# File location
27
-
28
-
Olli searches several locations for a config file to simplify deployment.
29
-
30
-
An Olli config file can reside at:
31
-
-`olli.toml` (in the current working directory)
32
-
-`/config/olli.toml`
33
-
-`/olli/config.toml`
34
-
-`/etc/olli/config.toml`
35
-
36
-
The order above is the order that Olli searches for configuration files.
37
-
38
21
# Sections
39
22
40
-
## `olli`
23
+
## `service`
41
24
42
-
`interval_minutes` (required): The interval that Olli should poll during, for example if this is set to 5 then Olli will search the logs for the past 5 minutes every 5 minutes and report.
25
+
`service_interval_minutes` (required): The interval that Olli should poll during, for example if this is set to 5 then Olli will search the logs for the past 5 minutes every 5 minutes and report.
43
26
44
27
### Tokens
45
28
46
-
Olli takes in a list of tokens to scan for, and each token has a set of configuration options. In the configuration file a set of tokens looks like:
29
+
Olli takes in a list of tokens to scan for, and each token is a JSON dictionary containing a set of configuration options. In the configuration file a set of tokens looks like:
# When no color is provided it falls back to blurple.
56
33
```
57
34
@@ -61,44 +38,26 @@ Tokens also accept a `case_sensitive` key which defaults to `false`. If you want
61
38
62
39
## `loki`
63
40
64
-
`api_url`: The base URL of your Loki instance, for example `"http://localhost:3100/"`.
41
+
`loki_api_url`: The base URL of your Loki instance, for example `http://localhost:3100/`.
65
42
66
-
`jobs`: A list of jobs to filter for logs in, only services in this list will be searched for tokens. An example might be `jobs = ["default/bot","default/site"]`.
43
+
`loki_jobs`: A list of jobs to filter for logs in, only services in this list will be searched for tokens. An example might be `loki_jobs=["default/bot","default/site"]`.
67
44
68
-
`max_logs`: This is passed on to Loki to define the maximum number of logs that should be returned, it defaults to 5,000 (raised from the 100 default of Loki).
45
+
`loki_max_logs`: This is passed on to Loki to define the maximum number of logs that should be returned, it defaults to 5,000 (raised from the 100 default of Loki).
69
46
70
47
## `discord`
71
48
72
-
`webhook_url`: This should be a Discord webhook which Olli will POST to when a service has hit a token filter in the last interval. It is optional but if not specified **must be provided in the `WEBHOOK_URL` environment variable.**
49
+
`discord_webhook_url` (required): This should be a Discord webhook which Olli will POST to when a service has hit a token filter in the last interval.
73
50
74
51
# Putting it together
75
52
76
-
All together, a configuration file for Olli might look somethinng along the lines of:
53
+
All together, a configuration file for Olli might look something along the lines of:
77
54
78
-
```toml
79
-
[olli]
80
-
interval_minutes = 5
81
-
82
-
[loki]
83
-
api_url = "http://localhost:3100/"
84
-
jobs = [
85
-
"default/bot"
86
-
]
87
-
88
-
[discord]
89
-
# The only Discord configuration option is webhook_url, which you can
90
-
# either specify here or in an environment variable called WEBHOOK_URL
0 commit comments