From 794ff3abd069de93f16251933d95a740813e3b80 Mon Sep 17 00:00:00 2001 From: William Date: Fri, 30 Dec 2022 10:10:46 +0100 Subject: [PATCH] feat: Add basic auth on Prometheus --- monitoring/.gitignore | 3 ++- monitoring/README.md | 1 + monitoring/docker-compose.yml | 2 ++ monitoring/web.example.yml | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 monitoring/web.example.yml diff --git a/monitoring/.gitignore b/monitoring/.gitignore index 0b898b1..778b08c 100644 --- a/monitoring/.gitignore +++ b/monitoring/.gitignore @@ -1 +1,2 @@ -prometheus.yml \ No newline at end of file +prometheus.yml +web.yml \ No newline at end of file diff --git a/monitoring/README.md b/monitoring/README.md index 165ba21..4ecc55b 100644 --- a/monitoring/README.md +++ b/monitoring/README.md @@ -5,5 +5,6 @@ ```bash cp .env.example .env # then edit cp prometheus.example.yml prometheus.yml # then edit +cp web.example.yml web.yml # then edit docker compose up -d ``` diff --git a/monitoring/docker-compose.yml b/monitoring/docker-compose.yml index 1d520cc..1ca0a90 100644 --- a/monitoring/docker-compose.yml +++ b/monitoring/docker-compose.yml @@ -38,9 +38,11 @@ services: restart: unless-stopped volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml + - ./web.yml:/etc/prometheus/web.yml - prometheus-data:/prometheus command: - '--config.file=/etc/prometheus/prometheus.yml' + - '--web.config.file=/etc/prometheus/web.yml' - '--storage.tsdb.path=/prometheus' - '--storage.tsdb.retention.time=365d' labels: diff --git a/monitoring/web.example.yml b/monitoring/web.example.yml new file mode 100644 index 0000000..8830262 --- /dev/null +++ b/monitoring/web.example.yml @@ -0,0 +1,2 @@ +basic_auth_users: + admin: $2b$12$hNf2lSsxfm0.i4a.1kVpSOVyBCfIB51VRjgBUyv6kdnyTlgWj81Ay # test