From c50f79cf4a6a3cdce1c4929b29870c539745a37c Mon Sep 17 00:00:00 2001 From: Mathias Merscher Date: Sat, 21 Dec 2019 13:08:19 +0100 Subject: [PATCH] adds metrics endpoint config support --- README.md | 5 +++++ defaults/main.yml | 3 +++ templates/gitea.ini.j2 | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 98dd876..74c5933 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,11 @@ As this will only deploy config files, fail2ban already has to be installed or o * `gitea_oauth2_enabled`: Enable the Oauth2 provider (true/false) * `gitea_oauth2_jwt_secret`: JWT secret +### Metrics endpoint configuration + +* `gitea_metrics_enabled`: Enable the metrics endpoint +* `gitea_metrics_token`: Bearer token for the Prometheus scrape job + ## Contributing Don't hesitate to create a pull request, and when in doubt you can reach me on Twitter [@thomas_maurice](https://twitter.com/thomas_maurice). diff --git a/defaults/main.yml b/defaults/main.yml index c28fa99..8a3d013 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -61,3 +61,6 @@ gitea_fail2ban_jail_action: iptables-allports gitea_oauth2_enabled: true gitea_oauth2_jwt_secret: ChangeMe + +gitea_metrics_enabled: false +gitea_metrics_token: ~ diff --git a/templates/gitea.ini.j2 b/templates/gitea.ini.j2 index 78fb423..a57d626 100644 --- a/templates/gitea.ini.j2 +++ b/templates/gitea.ini.j2 @@ -181,3 +181,7 @@ REDIRECT_MACARON_LOG = false ENABLE = {{ gitea_oauth2_enabled }} JWT_SECRET = {{ gitea_oauth2_jwt_secret }} +[metrics] +ENABLED = {{ gitea_metrics_enabled }} +TOKEN = {{ gitea_metrics_token }} +