mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
fix(monitoring): more firewall rules
This commit is contained in:
parent
60f7042211
commit
3f33177ae5
2 changed files with 18 additions and 2 deletions
|
|
@ -3,8 +3,9 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) toJSON toString;
|
inherit (builtins) toString;
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.types) port;
|
inherit (lib.types) port;
|
||||||
cfg = config.services.promtail;
|
cfg = config.services.promtail;
|
||||||
in {
|
in {
|
||||||
|
|
@ -20,4 +21,7 @@ in {
|
||||||
"--server.http-listen-port=${toString cfg.settings.httpListenPort}"
|
"--server.http-listen-port=${toString cfg.settings.httpListenPort}"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
config.networking.firewall.interfaces.lan = mkIf cfg.enable {
|
||||||
|
allowedTCPPorts = [ cfg.settings.httpListenPort ];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,19 @@
|
||||||
_: {
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (config.services) grafana loki prometheus;
|
||||||
|
in {
|
||||||
services = {
|
services = {
|
||||||
grafana.enable = true;
|
grafana.enable = true;
|
||||||
loki.enable = true;
|
loki.enable = true;
|
||||||
prometheus.enable = true;
|
prometheus.enable = true;
|
||||||
};
|
};
|
||||||
|
networking.firewall.interfaces.lan.allowedTCPPorts = mkMerge [
|
||||||
|
(mkIf grafana.enable [ grafana.port ])
|
||||||
|
(mkIf loki.enable [ loki.settings.httpListenPort loki.settings.grpcListenPort ])
|
||||||
|
(mkIf prometheus.enable [ prometheus.port ])
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue