feat: Add basic auth on Prometheus

This commit is contained in:
William 2022-12-30 10:10:46 +01:00
parent 414eb2e584
commit 794ff3abd0
4 changed files with 7 additions and 1 deletions

View File

@ -1 +1,2 @@
prometheus.yml prometheus.yml
web.yml

View File

@ -5,5 +5,6 @@
```bash ```bash
cp .env.example .env # then edit cp .env.example .env # then edit
cp prometheus.example.yml prometheus.yml # then edit cp prometheus.example.yml prometheus.yml # then edit
cp web.example.yml web.yml # then edit
docker compose up -d docker compose up -d
``` ```

View File

@ -38,9 +38,11 @@ services:
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml - ./prometheus.yml:/etc/prometheus/prometheus.yml
- ./web.yml:/etc/prometheus/web.yml
- prometheus-data:/prometheus - prometheus-data:/prometheus
command: command:
- '--config.file=/etc/prometheus/prometheus.yml' - '--config.file=/etc/prometheus/prometheus.yml'
- '--web.config.file=/etc/prometheus/web.yml'
- '--storage.tsdb.path=/prometheus' - '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=365d' - '--storage.tsdb.retention.time=365d'
labels: labels:

View File

@ -0,0 +1,2 @@
basic_auth_users:
admin: $2b$12$hNf2lSsxfm0.i4a.1kVpSOVyBCfIB51VRjgBUyv6kdnyTlgWj81Ay # test