Remove config.yaml from the repository.

- Instead, propose a `config-example.yaml` file
- Change the README accordingly
This commit is contained in:
Alexis Métaireau 2023-10-18 12:40:38 +02:00
parent 8c58a50e8f
commit fa45338914
3 changed files with 52 additions and 92 deletions

View file

@ -6,6 +6,7 @@ Todo:
- [x] Use Postgresql as a database - [x] Use Postgresql as a database
- [x] Expose a simple read-only website. - [x] Expose a simple read-only website.
- [ ] Last seen agents
- [ ] Use background tasks for alerting - [ ] Use background tasks for alerting
- [ ] Add a command to generate new authentication tokens - [ ] Add a command to generate new authentication tokens
- [ ] Task for database cleanup (to run periodically) - [ ] Task for database cleanup (to run periodically)
@ -39,6 +40,12 @@ source venv/bin/activate
pip install -e . pip install -e .
``` ```
Prepare a configuration file, you can copy the `config-example.yaml` file and edit it:
```bash
cp config-example.yaml config.yaml
```
Then, you can run the server: Then, you can run the server:
```bash ```bash
@ -77,6 +84,7 @@ general:
service: service:
secrets: secrets:
# Secrets can be generated using `openssl rand -base64 32`. # Secrets can be generated using `openssl rand -base64 32`.
# DO NOT REUSE THESE ONES.
- "O4kt8Max9/k0EmHaEJ0CGGYbBNFmK8kOZNIoUk3Kjwc" - "O4kt8Max9/k0EmHaEJ0CGGYbBNFmK8kOZNIoUk3Kjwc"
- "x1T1VZR51pxrv5pQUyzooMG4pMUvHNMhA5y/3cUsYVs=" - "x1T1VZR51pxrv5pQUyzooMG4pMUvHNMhA5y/3cUsYVs="

44
config-example.yaml Normal file
View file

@ -0,0 +1,44 @@
general:
frequency: "1m" # Run checks every minute.
alerts:
error:
- local
warning:
- local
alert:
- local
service:
secrets:
# Secrets can be generated using `openssl rand -base64 32`.
- "O4kt8Max9/k0EmHaEJ0CGGYbBNFmK8kOZNIoUk3Kjwc"
- "x1T1VZR51pxrv5pQUyzooMG4pMUvHNMhA5y/3cUsYVs="
ssl:
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://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
- domain: "https://munin.framasoft.org"
paths:
- path: "/"
checks:
- status-is: 301
- path: "/munin/"
checks:
- status-is: 401

View file

@ -1,92 +0,0 @@
general:
frequency: "1m" # Run checks every minute.
alerts:
error:
- local
warning:
- local
alert:
- local
service:
secrets:
# Secrets can be generated using `openssl rand -base64 32`.
- "O4kt8Max9/k0EmHaEJ0CGGYbBNFmK8kOZNIoUk3Kjwc"
- "x1T1VZR51pxrv5pQUyzooMG4pMUvHNMhA5y/3cUsYVs="
ssl:
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://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"
- domain: "https://munin.framasoft.org"
paths:
- path: "/"
checks:
- status-is: "301"
- path: "/munin/"
checks:
- status-is: "401"
- domain: "https://framagenda.org"
paths:
- path: "/status.php"
checks:
- status-is: "200"
# Là, idéalement, il faudrait un json-contains,
# qui serait une table de hachage
- body-contains: '"maintenance":false'
- ssl-certificate-expiration: "on-check"
- path: "/"
checks:
- status-is: "302"
- path: "/login"
checks:
- status-is: "200"
- domain: "https://framadrive.org"
paths:
- path: "/status.php"
checks:
- status-is: "200"
- body-contains: '"maintenance":false'
- ssl-certificate-expiration: "on-check"
- path: "/"
checks:
- status-is: "302"
- path: "/login"
checks:
- status-is: "200"
- domain: "https://cloud.framabook.org"
paths:
- path: "/status.php"
checks:
- status-is: "200"
- body-contains: '"maintenance":false'
- ssl-certificate-expiration: "on-check"
- path: "/"
checks:
- status-is: "302"
- path: "/login"
checks:
- status-is: "200"
- domain: "https://framasoft.org"
paths:
- path: "/"
checks:
- status-is: "200"
- ssl-certificate-expiration: "on-check"