Update installation instructions and config example.

This commit is contained in:
Alexis Métaireau 2023-10-18 02:31:23 +02:00
parent 85e73e0869
commit 824a0afa3e

View file

@ -31,23 +31,18 @@ Implemented checks :
## How to run ?
We're using [pipenv](https://pipenv.pypa.io/) to manage the virtual environment and the dependencies.
You can install it with [pipx](https://pypa.github.io/pipx/):
To install it, create a virtualenv and install the dependencies:
```bash
pipx install pipenv
```
And then, checkout this repository and sync its pipenv
```bash
pipenv sync
python3 -m venv venv
source venv/bin/activate
pip install -e .
```
Once all the dependencies are in place, here is how to run the server:
```bash
pipenv run argos server
argos server
```
The server will read a `config.yaml` file at startup, and will populate the tasks specified in it. See the configuration section below for more information on how to configure the checks you want to run.
@ -55,7 +50,7 @@ The server will read a `config.yaml` file at startup, and will populate the task
And here is how to run the agent:
```bash
pipenv run argos agent --server http://localhost:8000 --auth "<auth-token>"
argos agent http://localhost:8000 "<auth-token>"
```
## Configuration
@ -64,37 +59,41 @@ Here is a simple configuration file:
```yaml
general:
frequency: 4h # Run checks every 4 hours.
alerts:
error:
- local
warning:
- local
alert:
- local
frequency: "1m" # Run checks every minute.
alerts:
error:
- local
warning:
- local
alert:
- local
service:
port: 8888
# Can be generated using `openssl rand -base64 32`.
secrets:
- "O4kt8Max9/k0EmHaEJ0CGGYbBNFmK8kOZNIoUk3Kjwc"
- "x1T1VZR51pxrv5pQUyzooMG4pMUvHNMhA5y/3cUsYVs="
secrets:
# Secrets can be generated using `openssl rand -base64 32`.
- "O4kt8Max9/k0EmHaEJ0CGGYbBNFmK8kOZNIoUk3Kjwc"
- "x1T1VZR51pxrv5pQUyzooMG4pMUvHNMhA5y/3cUsYVs="
ssl:
thresholds:
critical: "1d"
warning: "10d"
thresholds:
- "1d": critical
- "5d": warning
# It's also possible to define the checks in another file
# with the include syntax:
#
# websites: !include websites.yaml
#
websites:
- domain: "https://blog.notmyidea.org"
paths:
- path: "/"
checks:
- status-is: 200
- body-contains: "Alexis"
- ssl-certificate-expiration: "on-check"
- path: "/foo"
checks:
- status-is: 400
- domain: "https://mypads.framapad.org"
paths:
- path: "/mypads/"
checks:
- status-is: "200"
- body-contains: '<div id= "mypads"></div>'
- ssl-certificate-expiration: "on-check"
- path: "/admin/"
checks:
- status-is: "401"
```
## Development notes