diff --git a/README.md b/README.md index 6e062df..fd67250 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Todo: - [x] Use Postgresql as a database - [x] Expose a simple read-only website. +- [ ] Last seen agents - [ ] Use background tasks for alerting - [ ] Add a command to generate new authentication tokens - [ ] Task for database cleanup (to run periodically) @@ -39,6 +40,12 @@ source venv/bin/activate 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: ```bash @@ -77,6 +84,7 @@ general: service: secrets: # Secrets can be generated using `openssl rand -base64 32`. + # DO NOT REUSE THESE ONES. - "O4kt8Max9/k0EmHaEJ0CGGYbBNFmK8kOZNIoUk3Kjwc" - "x1T1VZR51pxrv5pQUyzooMG4pMUvHNMhA5y/3cUsYVs=" diff --git a/config-example.yaml b/config-example.yaml new file mode 100644 index 0000000..150b043 --- /dev/null +++ b/config-example.yaml @@ -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: '
' + - 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 \ No newline at end of file diff --git a/config.yaml b/config.yaml deleted file mode 100644 index f4358dd..0000000 --- a/config.yaml +++ /dev/null @@ -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: '
' - - 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" -