2024-10-06 16:55:25 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
vhost,
|
|
|
|
location,
|
|
|
|
...
|
|
|
|
}: let
|
2023-08-29 18:17:59 +00:00
|
|
|
pages = pkgs.fetchgit {
|
|
|
|
url = "https://git.fainsin.bzh/ENSEEIHT/projet-fin-etude-rapport";
|
2023-09-06 21:00:48 +00:00
|
|
|
rev = "32fe5c7ec6d67241951fdaf001e3da1c41b29dcf"; # pages
|
|
|
|
sha256 = "sha256-pOu0lohJ1Yqg/a5hqnNTePTrU8t5By5AbhUAJfL5MBg=";
|
2023-08-29 18:17:59 +00:00
|
|
|
};
|
|
|
|
in {
|
2024-10-06 16:55:25 +00:00
|
|
|
services.nginx.virtualHosts.${vhost}.locations."/${location}/" = {
|
2024-10-06 16:15:10 +00:00
|
|
|
alias = "${pages}/";
|
|
|
|
index = "index.html";
|
2024-10-06 16:55:25 +00:00
|
|
|
tryFiles = "$uri $uri/ /${location}/index.html";
|
2024-10-06 16:15:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
services.gatus.settings.endpoints = [
|
|
|
|
{
|
2024-10-06 16:55:25 +00:00
|
|
|
name = location;
|
|
|
|
group = vhost;
|
|
|
|
url = "https://${vhost}/${location}/";
|
2024-10-06 16:15:10 +00:00
|
|
|
interval = "15m";
|
|
|
|
conditions = [
|
|
|
|
"[STATUS] == 200"
|
|
|
|
"[RESPONSE_TIME] < 300"
|
|
|
|
"[BODY] == pat(*slidevjs/slidev*)"
|
2024-10-06 16:55:25 +00:00
|
|
|
"[BODY] == pat(*/${location}/assets/index*)"
|
2024-10-06 16:15:10 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
2023-08-29 18:17:59 +00:00
|
|
|
}
|