mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 02:09:04 +02:00
feat: add declarative status page
This commit is contained in:
parent
f3ba2a1c8b
commit
718128596f
10 changed files with 101 additions and 40 deletions
|
@ -45,6 +45,10 @@ in
|
|||
);
|
||||
inherit (cfg) user group;
|
||||
};
|
||||
|
||||
machine.meta.probes.monitors."jackett.luj - IPv4".accepted_statuscodes = [ "400" ];
|
||||
machine.meta.probes.monitors."jackett.luj - IPv6".accepted_statuscodes = [ "400" ];
|
||||
|
||||
}
|
||||
|
||||
(mkIf cfg.nginx.enable (mkVPNSubdomain cfg.nginx.subdomain port))
|
||||
|
|
|
@ -43,9 +43,27 @@
|
|||
default = with profiles; [ base ];
|
||||
};
|
||||
|
||||
monitors = mkOption {
|
||||
default = { };
|
||||
type = types.attrsOf (pkgs.formats.json { }).type;
|
||||
probes = {
|
||||
monitors = lib.mkOption {
|
||||
type = types.attrsOf (pkgs.formats.json { }).type;
|
||||
default = { };
|
||||
};
|
||||
tags = lib.mkOption {
|
||||
type = types.attrsOf (pkgs.formats.json { }).type;
|
||||
default = { };
|
||||
};
|
||||
notifications = lib.mkOption {
|
||||
type = types.attrsOf (pkgs.formats.json { }).type;
|
||||
default = { };
|
||||
};
|
||||
status_pages = lib.mkOption {
|
||||
type = types.attrsOf (pkgs.formats.json { }).type;
|
||||
default = { };
|
||||
};
|
||||
settings = lib.mkOption {
|
||||
type = types.attrsOf (pkgs.formats.json { }).type;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
defaultInterface = mkOption {
|
||||
|
|
|
@ -59,7 +59,7 @@ in
|
|||
'';
|
||||
|
||||
systemConfig = _: {
|
||||
machine.meta.monitors = lib.mkIf (name != "default") {
|
||||
machine.meta.probes.monitors = lib.mkIf (name != "default") {
|
||||
"${name} - IPv4" = {
|
||||
url = "https://${
|
||||
if (hasSuffix "luj" name) then
|
||||
|
@ -69,6 +69,7 @@ in
|
|||
}";
|
||||
type = "http";
|
||||
accepted_statuscodes = [ "200-299" ];
|
||||
notificationIDList = [ 1 ];
|
||||
headers = ''
|
||||
{
|
||||
"Host": "${name}"
|
||||
|
@ -84,6 +85,7 @@ in
|
|||
}]";
|
||||
type = "http";
|
||||
accepted_statuscodes = [ "200-299" ];
|
||||
notificationIDList = [ 1 ];
|
||||
headers = ''
|
||||
{
|
||||
"Host": "${name}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue