Use credentials file for Dawarich metrics scrape

This commit is contained in:
2026-06-21 23:00:00 +02:00
parent 699b1f118e
commit 4cf9e3226e
6 changed files with 16 additions and 9 deletions
+3 -1
View File
@@ -43,6 +43,7 @@ openssl rand -base64 48 > /mnt/user/appdata/secrets/dawarich_postgres_password.t
openssl rand -base64 48 | tr -dc 'A-Za-z0-9._~-' | head -c 48 > /mnt/user/appdata/secrets/dawarich_redis_password.txt
openssl rand -hex 64 > /mnt/user/appdata/secrets/dawarich_secret_key_base.txt
openssl rand -base64 48 > /mnt/user/appdata/secrets/dawarich_metrics_password.txt
printf 'prometheus:%s' "$(cat /mnt/user/appdata/secrets/dawarich_metrics_password.txt)" | base64 -w0 > /mnt/user/appdata/secrets/dawarich_metrics_basic_auth.txt
openssl rand -base64 48 > /mnt/user/appdata/secrets/dawarich_grafana_ro_password.txt
chmod 600 /mnt/user/appdata/secrets/dawarich_*.txt
```
@@ -75,7 +76,8 @@ Die Tracking-API-Routen fuer OwnTracks, Overland und Traccar sind separat und pr
Der Monitoring-Stack ist dafuer bereits vorbereitet:
- `/mnt/user/appdata/secrets/dawarich_metrics_password.txt` ist als Docker Secret eingebunden.
- `/mnt/user/appdata/secrets/dawarich_metrics_password.txt` ist in Dawarich eingebunden.
- `/mnt/user/appdata/secrets/dawarich_metrics_basic_auth.txt` ist in Prometheus eingebunden und enthaelt nur den Base64-Credential-Teil fuer den HTTP-Header.
Nicht `dawarich_app:9394` scrapen: das ist nach aktueller Dawarich-Doku veraltet. Der Web-Service aggregiert App- und Sidekiq-Metriken unter `/metrics`. Im KalliLab wird dieser Endpoint ueber `https://dawarich.kaleschke.info/metrics` gescraped, damit Traefik den HTTPS-Kontext setzt und Dawarich nicht auf HTTPS umleitet.
+3 -3
View File
@@ -9,9 +9,9 @@
- job_name: dawarich
metrics_path: /metrics
scheme: https
basic_auth:
username: prometheus
password_file: /run/secrets/dawarich_metrics_password
authorization:
type: Basic
credentials_file: /run/secrets/dawarich_metrics_basic_auth
static_configs:
- targets:
- dawarich.kaleschke.info
@@ -0,0 +1 @@
BASE64_OF_PROMETHEUS_COLON_METRICS_PASSWORD