Compare commits

..

1 Commits

Author SHA1 Message Date
oysteikt 12e4557482 WIP: ildkule/gatus: init, remove uptime-kuma
Eval nix flake / evals (push) Successful in 9m10s
2026-07-06 02:53:15 +09:00
3 changed files with 115 additions and 45 deletions
@@ -6,6 +6,6 @@
./loki.nix
./prometheus
./scrutiny.nix
./uptime-kuma.nix
./gatus.nix
];
}
+114
View File
@@ -0,0 +1,114 @@
{ config, lib, ... }:
let
cfg = config.services.gatus;
in
{
services.gatus = {
enable = true;
settings = {
web.port = 19283;
storage = {
type = "sqlite";
path = "/var/lib/gatus/data.db";
};
endpoints = let
mkMachine = name: {
inherit name;
group = "Machines";
url = "icmp://${name}.pvv.ntnu.no";
conditions = ["[CONNECTED] == true"];
};
mkWebsite = name: url: {
inherit name url;
group = "Websites";
method = "GET";
conditions = [
"[STATUS] == 200"
];
};
in [
(mkMachine "bekkalokk")
(mkMachine "bicep")
(mkMachine "bikkje")
(mkMachine "brzeczyszczykiewicz")
(mkMachine "georg")
(mkMachine "gluttony")
(mkMachine "ildkule")
(mkMachine "kommode")
(mkMachine "lupine-1")
(mkMachine "lupine-2")
(mkMachine "lupine-3")
(mkMachine "lupine-4")
(mkMachine "lupine-5")
(mkMachine "skrot")
(mkMachine "temmie")
(mkMachine "wenche")
(mkMachine "balduzius")
(mkMachine "blossom")
(mkMachine "bubbles")
(mkMachine "buskerud")
(mkMachine "buttercup")
(mkMachine "demiurgen")
(mkMachine "drolsum")
(mkMachine "hildring")
(mkMachine "innovation")
(mkMachine "isvegg")
(mkMachine "knutsen")
(mkMachine "ludvigsen" // {
url = "icmp://ludvigsen-tap.pvv.ntnu.no";
})
(mkMachine "microbel")
(mkMachine "mirage")
(mkMachine "orchid")
(mkMachine "principal")
(mkMachine "sleipner")
(mkMachine "smask")
(mkMachine "tom")
(mkMachine "wegonke")
(mkWebsite "PVV-Nettsiden" "https://www.pvv.ntnu.no")
(mkWebsite "Gitea" "https://git.pvv.ntnu.no")
(mkWebsite "Wiki" "https://wiki.pvv.ntnu.no")
(mkWebsite "Vaultwarden" "https://pw.pvv.ntnu.no")
(mkWebsite "IDP" "https://idp.pvv.ntnu.no")
(mkWebsite "Grafana" "https://grafana.pvv.ntnu.no")
(mkWebsite "Bluemap" "https://minecraft.pvv.ntnu.no")
(mkWebsite "Mapcrafter" "http://isvegg.pvv.ntnu.no/kart")
(mkWebsite "Roundcube" "https://webmail.pvv.ntnu.no/roundcube")
(mkWebsite "Snappymail" "http://snappymail.pvv.ntnu.no")
(mkWebsite "Scrutiny" "https://scrutiny.pvv.ntnu.no")
(mkWebsite "Grzegorz - Georg" "https://georg.pvv.ntnu.no")
(mkWebsite "Grzegorz - Brzeczyszczykiewicz" "https://brzeczyszczykiewicz.pvv.ntnu.no")
{
name = "Gitea SSH";
group = "Services";
url = "ssh://git.pvv.ntnu.no:2222";
conditions = [
"[CONNECTED] == true"
];
}
{
name = "QoTD";
group = "Services";
url = "tcp://bekkalokk.pvv.ntnu.no:17";
conditions = [
"[CONNECTED] == true"
];
}
];
};
};
services.nginx.virtualHosts."status.pvv.ntnu.no" = lib.mkIf cfg.enable {
enableACME = true;
forceSSL = true;
kTLS = true;
locations."/".proxyPass = "http://localhost:${toString cfg.settings.web.port}";
};
}
@@ -1,44 +0,0 @@
{ config, pkgs, lib, values, ... }:
let
cfg = config.services.uptime-kuma;
domain = "status.pvv.ntnu.no";
stateDir = "/data/monitoring/uptime-kuma";
in {
services.uptime-kuma = {
enable = true;
settings = {
PORT = "5059";
HOST = "127.0.1.2";
};
};
services.nginx.virtualHosts.${domain} = {
enableACME = true;
forceSSL = true;
kTLS = true;
locations."/".proxyPass = "http://${cfg.settings.HOST}:${cfg.settings.PORT}";
};
fileSystems."/var/lib/private/uptime-kuma" = {
device = stateDir;
fsType = "bind";
options = [ "bind" ];
};
services.rsync-pull-targets = {
enable = true;
locations.${stateDir} = {
user = "root";
rrsyncArgs.ro = true;
authorizedKeysAttrs = [
"restrict"
"from=\"principal.pvv.ntnu.no,${values.hosts.principal.ipv6},${values.hosts.principal.ipv4}\""
"no-agent-forwarding"
"no-port-forwarding"
"no-pty"
"no-X11-forwarding"
];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJXzcDm6cVr4NmWzUSroy33FlielKqaG83wY0RCMC0p/ uptime_kuma rsync backup";
};
};
}