From f70935d0a54df3b64686372f18f8d61a42faacdf Mon Sep 17 00:00:00 2001 From: Filippo Berto Date: Sun, 26 May 2024 21:45:59 +0200 Subject: [PATCH] Baldur: Grafana --- instances/baldur/configuration.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/instances/baldur/configuration.nix b/instances/baldur/configuration.nix index aa792d1..bcf1bbe 100644 --- a/instances/baldur/configuration.nix +++ b/instances/baldur/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: # let # freya_hosts = lib.attrsets.filterAttrs (k: v: builtins.elem "freya.zto" v) config.networking.hosts; # freya_ipv4 = builtins.elemAt 0 (builtins.attrNames freya_hosts); @@ -39,6 +39,16 @@ time.timeZone = "Europe/Rome"; services = { + grafana = { + enable = true; + settings = { + server = { + http_addr = "127.0.0.1"; + domain = "bertof.net"; + root_url = "https://grafana.bertof.net/"; + }; + }; + }; fail2ban = { enable = true; bantime-increment.enable = true; @@ -104,6 +114,13 @@ ''; }; }; + "grafana.bertof.net" = ssl // { + locations."/" = { + proxyPass = "http://${toString config.services.grafana.settings.server.http_addr}:${toString config.services.grafana.settings.server.http_port}"; + proxyWebsockets = true; + recommendedProxySettings = true; + }; + }; "radarr.bertof.net" = ssl // { locations."/" = { proxyPass = "http://freya.tsn:7878/"; proxyWebsockets = true; }; }; "sonarr.bertof.net" = ssl // { locations."/" = { proxyPass = "http://freya.tsn:8989/"; proxyWebsockets = true; }; }; "lidarr.bertof.net" = ssl // { locations."/" = { proxyPass = "http://freya.tsn:8686/"; proxyWebsockets = true; }; };