mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(monitoring): asterisk
This commit is contained in:
parent
340364e5c2
commit
dc9ee1d789
5 changed files with 38 additions and 6 deletions
|
|
@ -45,10 +45,19 @@ in {
|
|||
asterisk = {
|
||||
port = mkAlmostOptionDefault 8088;
|
||||
protocol = "http";
|
||||
prometheus.exporter.enable = let
|
||||
sslPort = config.ports.asterisk-ssl;
|
||||
in mkAlmostOptionDefault (!sslPort.enable || !sslPort.prometheus.exporter.enable);
|
||||
};
|
||||
asterisk-ssl = {
|
||||
port = mkAlmostOptionDefault 8089;
|
||||
protocol = "https";
|
||||
prometheus.exporter.enable = mkAlmostOptionDefault true;
|
||||
};
|
||||
operator = {
|
||||
enable = mkAlmostOptionDefault false;
|
||||
port = mkAlmostOptionDefault 58080;
|
||||
protocol = "http";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -134,9 +134,10 @@ let
|
|||
...
|
||||
}: let
|
||||
inherit (gensokyo-zone.lib) mapOptionDefaults;
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.modules) mkOptionDefault;
|
||||
inherit (lib.attrsets) attrNames filterAttrs;
|
||||
inherit (lib.attrsets) attrNames attrValues filterAttrs;
|
||||
inherit (lib.lists) any;
|
||||
exporterPorts = filterAttrs (_: port: port.enable && port.prometheus.exporter.enable) config.ports;
|
||||
statusPorts = filterAttrs (_: port: port.enable && port.status.enable) config.ports;
|
||||
in {
|
||||
|
|
@ -153,6 +154,14 @@ let
|
|||
type = str;
|
||||
default = "/metrics";
|
||||
};
|
||||
ssl = {
|
||||
enable = mkEnableOption "HTTPS" // {
|
||||
default = any (port: port.ssl) (attrValues exporterPorts);
|
||||
};
|
||||
insecure = mkEnableOption "self-signed SSL" // {
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
status = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue