From 179d0743ced8910df80bff735b8f5a988ff33c85 Mon Sep 17 00:00:00 2001 From: Tony Yen <67096653+TonyYenTWN@users.noreply.github.com> Date: Sat, 14 Sep 2024 19:16:28 +0200 Subject: [PATCH] gitea: export metric issue #101 --- hosts/bekkalokk/services/gitea/default.nix | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/hosts/bekkalokk/services/gitea/default.nix b/hosts/bekkalokk/services/gitea/default.nix index 4464390..303c492 100644 --- a/hosts/bekkalokk/services/gitea/default.nix +++ b/hosts/bekkalokk/services/gitea/default.nix @@ -55,6 +55,11 @@ in { USER = "gitea@pvv.ntnu.no"; SUBJECT_PREFIX = "[pvv-git]"; }; + metrics = { + ENABLED = true; + ENABLED_ISSUE_BY_LABEL = true; + ENABLED_ISSUE_BY_REPOSITORY = true; + }; indexer.REPO_INDEXER_ENABLED = true; service = { DISABLE_REGISTRATION = true; @@ -109,11 +114,20 @@ in { forceSSL = true; enableACME = true; kTLS = true; - locations."/" = { - proxyPass = "http://unix:${cfg.settings.server.HTTP_ADDR}"; - extraConfig = '' - client_max_body_size 512M; - ''; + locations = { + "/" = { + proxyPass = "http://unix:${cfg.settings.server.HTTP_ADDR}"; + extraConfig = '' + client_max_body_size 512M; + ''; + }; + "/metrics" = { + proxyPass = "http://unix:${cfg.settings.server.HTTP_ADDR}"; + extraConfig = '' + allow ${values.hosts.ildkule.ipv4}/32; + deny all; + ''; + }; }; };