From 7cc84ccc2c966de4a4b1433cdeb993d04dfefe96 Mon Sep 17 00:00:00 2001 From: Jef Roosens Date: Mon, 20 Apr 2026 21:59:19 +0200 Subject: [PATCH] setup metrics route for forgejo --- .../templates/app.ini.j2 | 2 +- .../templates/forgejo.Caddyfile.j2 | 14 ++++++++++++++ roles/any.software.gitea/templates/app.ini.j2 | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/roles/any.software.forgejo-podman/templates/app.ini.j2 b/roles/any.software.forgejo-podman/templates/app.ini.j2 index 3643eb0..8fd8c80 100644 --- a/roles/any.software.forgejo-podman/templates/app.ini.j2 +++ b/roles/any.software.forgejo-podman/templates/app.ini.j2 @@ -123,4 +123,4 @@ ENABLED = true SCHEDULE = @weekly [metrics] -enabled = true +ENABLED = true diff --git a/roles/any.software.forgejo-podman/templates/forgejo.Caddyfile.j2 b/roles/any.software.forgejo-podman/templates/forgejo.Caddyfile.j2 index 39a4f48..f5468dc 100644 --- a/roles/any.software.forgejo-podman/templates/forgejo.Caddyfile.j2 +++ b/roles/any.software.forgejo-podman/templates/forgejo.Caddyfile.j2 @@ -2,4 +2,18 @@ reverse_proxy localhost:{{ forgejo_http_port }} { header_down +X-Robots-Tag "none" } + + route /metrics { + @local { + remote_ip 127.0.0.1 ::1 + } + + handle @local { + reverse_proxy localhost:{{ forgejo_http_port }} + } + + handle { + respond "Not Found" 404 + } + } } diff --git a/roles/any.software.gitea/templates/app.ini.j2 b/roles/any.software.gitea/templates/app.ini.j2 index 4653ec3..48c5698 100644 --- a/roles/any.software.gitea/templates/app.ini.j2 +++ b/roles/any.software.gitea/templates/app.ini.j2 @@ -110,3 +110,6 @@ JWT_SECRET = {{ gitea_jwt_secret }} [other] SHOW_FOOTER_VERSION = false SHOW_FOOTER_TEMPLATE_LOAD_TIME = false + +[metrics] +enabled = true