9 Commits

Author SHA1 Message Date
renovate 0057787f1b chore(deps): update traefik:v3.7 docker digest to 5a52522 2026-06-23 04:22:08 +00:00
Micha 81151d8af4 Fix Dawarich Grafana datasource database config 2026-06-22 20:45:09 +02:00
Micha 45ff8286cf Use table-format Dawarich Grafana panels 2026-06-22 20:20:07 +02:00
Micha f318d80477 Simplify Dawarich Grafana dashboard query model 2026-06-22 20:12:14 +02:00
Micha b8d9bba5d3 Replace Dawarich Grafana dashboard 2026-06-22 19:55:47 +02:00
Micha 3bebc03a8f chore(deps): move dawarich redis to v8 track
dawarich_redis was the last redis instance still on 7-alpine; the
closed PR #10 kept it as an "Ignored or Blocked" entry in the Renovate
Dependency Dashboard (issue #6). Bump to the already-running
redis:8.8.0-alpine digest and add apps/dawarich to the renovate redis
8.x allowedVersions pin. Data path /mnt/user/appdata/dawarich/redis
unchanged; redis 8 loads the existing RDB snapshots.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 19:51:36 +02:00
Micha 0f1e78e0ca Fix Dawarich Grafana readonly user init 2026-06-22 19:01:39 +02:00
Micha 658750bc19 Allow Dawarich mobile track point route 2026-06-22 16:55:18 +02:00
Micha 5afba298e9 Allow Dawarich mobile API routes 2026-06-22 16:45:26 +02:00
12 changed files with 859 additions and 441 deletions
-3
View File
@@ -8,9 +8,6 @@ POSTGRES_USER=dawarich
POSTGRES_DB=dawarich_production POSTGRES_DB=dawarich_production
GRAFANA_DB_USER=dawarich_grafana_ro GRAFANA_DB_USER=dawarich_grafana_ro
PHOTON_API_HOST=photon.komoot.io
PHOTON_API_USE_HTTPS=true
METRICS_USERNAME=prometheus METRICS_USERNAME=prometheus
BACKGROUND_PROCESSING_CONCURRENCY=5 BACKGROUND_PROCESSING_CONCURRENCY=5
RAILS_MAX_THREADS=10 RAILS_MAX_THREADS=10
+1 -14
View File
@@ -67,7 +67,7 @@ install -d -m 750 \
Die UI liegt auf `https://dawarich.kaleschke.info` und nutzt `authelia@file,secure-headers@file`. Die UI liegt auf `https://dawarich.kaleschke.info` und nutzt `authelia@file,secure-headers@file`.
Der Healthcheck und die Tracking-API-Routen fuer OwnTracks, Overland und Traccar sind separat und priorisiert ohne Authelia geroutet, weil Mobile Clients per Dawarich-API-Key authentifizieren und keine Browser-ForwardAuth-Challenge verarbeiten koennen. Der Healthcheck, die Mobile-App-API-Routen (`/api/v1/settings`, `/api/v1/points`, `/api/v1/tracks`, `/api/v1/tracks/<id>/points`) und die Tracking-API-Routen fuer OwnTracks, Overland und Traccar sind separat und priorisiert ohne Authelia geroutet, weil Mobile Clients per Dawarich-API-Key authentifizieren und keine Browser-ForwardAuth-Challenge verarbeiten koennen.
## Prometheus ## Prometheus
@@ -79,19 +79,6 @@ Der Monitoring-Stack ist dafuer bereits vorbereitet:
Nicht `dawarich_app:9394` scrapen: das ist nach aktueller Dawarich-Doku veraltet. Der Web-Service aggregiert App- und Sidekiq-Metriken unter `/metrics`. Im KalliLab scrapt Prometheus intern `http://dawarich_app:3000/metrics` ueber `backend_net` und setzt `X-Forwarded-Proto: https`, damit Dawarich mit `APPLICATION_PROTOCOL=https` keinen HTTPS-Redirect erzeugt. Nicht `dawarich_app:9394` scrapen: das ist nach aktueller Dawarich-Doku veraltet. Der Web-Service aggregiert App- und Sidekiq-Metriken unter `/metrics`. Im KalliLab scrapt Prometheus intern `http://dawarich_app:3000/metrics` ueber `backend_net` und setzt `X-Forwarded-Proto: https`, damit Dawarich mit `APPLICATION_PROTOCOL=https` keinen HTTPS-Redirect erzeugt.
Verifikation aus dem Prometheus-Container:
```bash
PW="$(cat /run/secrets/dawarich_metrics_password)"
curl -i -u "prometheus:${PW}" http://dawarich_app:3000/metrics
```
Erwartung:
- `200`: Scrape ist direkt funktionsfaehig.
- `301`/`308` nach HTTPS: `http_headers` mit `X-Forwarded-Proto: https` im Prometheus-Job beibehalten.
- `403 Blocked host`: `dawarich_app` in `APPLICATION_HOSTS` aufnehmen.
## Grafana ## Grafana
Der Read-only-User `dawarich_grafana_ro` wird beim ersten DB-Init durch `postgres/initdb/20-grafana-readonly.sh` angelegt. Der Read-only-User `dawarich_grafana_ro` wird beim ersten DB-Init durch `postgres/initdb/20-grafana-readonly.sh` angelegt.
+3 -7
View File
@@ -36,7 +36,7 @@ services:
- no-new-privileges:true - no-new-privileges:true
dawarich_redis: dawarich_redis:
image: redis:7-alpine@sha256:6ab0b6e7381779332f97b8ca76193e45b0756f38d4c0dcda72dbb3c32061ab99 image: redis:8.8.0-alpine@sha256:09160599abd229764c0fb44cb6be640294e1d360a54b19985ab4843dcf2d90f1
container_name: dawarich_redis container_name: dawarich_redis
restart: unless-stopped restart: unless-stopped
command: command:
@@ -93,8 +93,6 @@ services:
TIME_ZONE: ${TZ} TIME_ZONE: ${TZ}
SELF_HOSTED: "true" SELF_HOSTED: "true"
STORE_GEODATA: "true" STORE_GEODATA: "true"
PHOTON_API_HOST: ${PHOTON_API_HOST:-photon.komoot.io}
PHOTON_API_USE_HTTPS: "${PHOTON_API_USE_HTTPS:-true}"
RAILS_LOG_TO_STDOUT: "true" RAILS_LOG_TO_STDOUT: "true"
PROMETHEUS_EXPORTER_ENABLED: "true" PROMETHEUS_EXPORTER_ENABLED: "true"
METRICS_USERNAME: ${METRICS_USERNAME} METRICS_USERNAME: ${METRICS_USERNAME}
@@ -134,7 +132,7 @@ services:
- traefik.docker.network=frontend_net - traefik.docker.network=frontend_net
# Public API-key endpoints for mobile apps and Home Assistant pushes. # Public API-key endpoints for mobile apps and Home Assistant pushes.
- traefik.http.routers.dawarich-api.rule=Host(`${DAWARICH_HOST}`) && (Path(`/api/v1/health`) || Path(`/api/v1/owntracks/points`) || Path(`/api/v1/overland/batches`) || Path(`/api/v1/traccar/points`)) - traefik.http.routers.dawarich-api.rule=Host(`${DAWARICH_HOST}`) && (Path(`/api/v1/health`) || Path(`/api/v1/settings`) || Path(`/api/v1/settings/transportation_recalculation_status`) || Path(`/api/v1/points`) || Path(`/api/v1/tracks`) || PathRegexp(`/api/v1/tracks/[0-9]+/points`) || Path(`/api/v1/owntracks/points`) || Path(`/api/v1/overland/batches`) || Path(`/api/v1/traccar/points`))
- traefik.http.routers.dawarich-api.entrypoints=websecure - traefik.http.routers.dawarich-api.entrypoints=websecure
- traefik.http.routers.dawarich-api.tls=true - traefik.http.routers.dawarich-api.tls=true
- traefik.http.routers.dawarich-api.tls.certresolver=le - traefik.http.routers.dawarich-api.tls.certresolver=le
@@ -180,13 +178,11 @@ services:
TIME_ZONE: ${TZ} TIME_ZONE: ${TZ}
SELF_HOSTED: "true" SELF_HOSTED: "true"
STORE_GEODATA: "true" STORE_GEODATA: "true"
PHOTON_API_HOST: ${PHOTON_API_HOST:-photon.komoot.io}
PHOTON_API_USE_HTTPS: "${PHOTON_API_USE_HTTPS:-true}"
RAILS_LOG_TO_STDOUT: "true" RAILS_LOG_TO_STDOUT: "true"
PROMETHEUS_EXPORTER_ENABLED: "true" PROMETHEUS_EXPORTER_ENABLED: "true"
PROMETHEUS_EXPORTER_PORT: "9394" PROMETHEUS_EXPORTER_PORT: "9394"
METRICS_USERNAME: ${METRICS_USERNAME} METRICS_USERNAME: ${METRICS_USERNAME}
BACKGROUND_PROCESSING_CONCURRENCY: "5" BACKGROUND_PROCESSING_CONCURRENCY: ${BACKGROUND_PROCESSING_CONCURRENCY}
RAILS_MAX_THREADS: ${RAILS_MAX_THREADS} RAILS_MAX_THREADS: ${RAILS_MAX_THREADS}
volumes: volumes:
- dawarich_public:/var/app/public - dawarich_public:/var/app/public
+415 -193
View File
@@ -20,12 +20,276 @@
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": null,
"links": [], "links": [],
"liveNow": false,
"panels": [ "panels": [
{ {
"id": 10,
"type": "stat",
"title": "Points Last 30 Days",
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "dawarich-postgres" "uid": "dawarich-postgres"
}, },
"pluginVersion": "13.0.2",
"gridPos": {
"x": 0,
"y": 0,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT count(*)::double precision AS points\nFROM points\nWHERE timestamp >= extract(epoch from now() - interval '30 days')::integer\n AND timestamp <= extract(epoch from now())::integer\n AND lonlat IS NOT NULL;"
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "points",
"values": false
},
"textMode": "auto",
"wideLayout": true
}
},
{
"id": 11,
"type": "stat",
"title": "Kilometers Last 30 Days",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2",
"gridPos": {
"x": 6,
"y": 0,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT round(coalesce(sum(distance),0)::numeric / 1000.0, 2)::double precision AS km\nFROM tracks\nWHERE start_at >= now() - interval '30 days';"
}
],
"fieldConfig": {
"defaults": {
"unit": "km",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "km",
"values": false
},
"textMode": "auto",
"wideLayout": true
}
},
{
"id": 12,
"type": "stat",
"title": "Tracks Last 30 Days",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2",
"gridPos": {
"x": 12,
"y": 0,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT count(*)::double precision AS tracks\nFROM tracks\nWHERE start_at >= now() - interval '30 days';"
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "tracks",
"values": false
},
"textMode": "auto",
"wideLayout": true
}
},
{
"id": 13,
"type": "stat",
"title": "Anomalies Last 30 Days",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2",
"gridPos": {
"x": 18,
"y": 0,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT count(*)::double precision AS anomalies\nFROM points\nWHERE timestamp >= extract(epoch from now() - interval '30 days')::integer\n AND timestamp <= extract(epoch from now())::integer\n AND anomaly IS TRUE;"
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "anomalies",
"values": false
},
"textMode": "auto",
"wideLayout": true
}
},
{
"id": 1,
"type": "geomap",
"title": "Location Points",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2",
"gridPos": {
"x": 0,
"y": 4,
"w": 14,
"h": 12
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\n ST_Y(lonlat::geometry)::double precision AS lat,\n ST_X(lonlat::geometry)::double precision AS lon,\n accuracy::double precision AS accuracy,\n to_timestamp(timestamp) AS seen_at\nFROM points\nWHERE timestamp >= extract(epoch from now() - interval '30 days')::integer\n AND timestamp <= extract(epoch from now())::integer\n AND lonlat IS NOT NULL\nORDER BY timestamp DESC\nLIMIT 5000;"
}
],
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": { "custom": {
@@ -44,18 +308,10 @@
"value": null "value": null
} }
] ]
}, }
"unit": "none"
}, },
"overrides": [] "overrides": []
}, },
"gridPos": {
"h": 16,
"w": 16,
"x": 0,
"y": 0
},
"id": 1,
"options": { "options": {
"basemap": { "basemap": {
"config": {}, "config": {},
@@ -73,42 +329,29 @@
"layers": [ "layers": [
{ {
"config": { "config": {
"showLegend": true, "showLegend": false,
"style": { "style": {
"color": { "color": {
"fixed": "dark-green" "fixed": "green"
},
"opacity": 0.55,
"rotation": {
"fixed": 0,
"max": 360,
"min": -360,
"mode": "mod"
}, },
"opacity": 0.7,
"size": { "size": {
"fixed": 4, "fixed": 5,
"max": 15, "max": 15,
"min": 2 "min": 2
}, },
"symbol": { "symbol": {
"fixed": "img/icons/marker/circle.svg", "fixed": "img/icons/marker/circle.svg",
"mode": "fixed" "mode": "fixed"
},
"textConfig": {
"fontSize": 12,
"offsetX": 0,
"offsetY": 0,
"textAlign": "center",
"textBaseline": "middle"
} }
} }
}, },
"location": { "location": {
"latitude": "latitude", "latitude": "lat",
"longitude": "longitude", "longitude": "lon",
"mode": "coords" "mode": "coords"
}, },
"name": "Location points", "name": "Points",
"tooltip": true, "tooltip": true,
"type": "markers" "type": "markers"
} }
@@ -119,14 +362,30 @@
"view": { "view": {
"allLayers": true, "allLayers": true,
"id": "fit", "id": "fit",
"lat": 51, "lat": 52.0,
"lon": 10, "lon": 7.5,
"zoom": 5 "zoom": 8
}
} }
}, },
{
"id": 2,
"type": "table",
"title": "Kilometers per Day",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2", "pluginVersion": "13.0.2",
"gridPos": {
"x": 14,
"y": 4,
"w": 10,
"h": 6
},
"targets": [ "targets": [
{ {
"refId": "A",
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "dawarich-postgres" "uid": "dawarich-postgres"
@@ -134,53 +393,15 @@
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT\n to_timestamp(timestamp) AS \"time\",\n ST_Y(lonlat::geometry) AS latitude,\n ST_X(lonlat::geometry) AS longitude,\n accuracy,\n tracker_id\nFROM points\nWHERE $__unixEpochFilter(timestamp)\n AND lonlat IS NOT NULL\nORDER BY timestamp DESC\nLIMIT 20000;", "rawSql": "SELECT\n date_trunc('day', start_at)::date AS day,\n round(coalesce(sum(distance),0)::numeric / 1000.0, 2)::double precision AS km\nFROM tracks\nWHERE start_at >= now() - interval '30 days'\nGROUP BY 1\nORDER BY 1 DESC;"
"refId": "A"
} }
], ],
"title": "Location Points",
"type": "geomap"
},
{
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": {
"mode": "palette-classic"
},
"custom": { "custom": {
"axisBorderShow": false, "align": "auto",
"axisCenteredZero": false, "cellOptions": {
"axisColorMode": "text", "type": "auto"
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 70,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
} }
}, },
"mappings": [], "mappings": [],
@@ -192,152 +413,153 @@
"value": null "value": null
} }
] ]
}, }
"unit": "km"
}, },
"overrides": [] "overrides": []
}, },
"gridPos": {
"h": 8,
"w": 8,
"x": 16,
"y": 0
},
"id": 2,
"options": { "options": {
"legend": { "cellHeight": "sm",
"calcs": [ "footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum" "sum"
], ],
"displayMode": "list", "show": false
"placement": "bottom",
"showLegend": true
}, },
"tooltip": { "showHeader": true
"hideZeros": false,
"mode": "single",
"sort": "none"
} }
}, },
"pluginVersion": "13.0.2",
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "time_series",
"rawQuery": true,
"rawSql": "SELECT\n make_date(year, month, 1)::timestamp AS \"time\",\n round((distance::numeric / 1000.0), 2) AS \"km\"\nFROM stats\nWHERE make_date(year, month, 1)::timestamp BETWEEN $__timeFrom() AND $__timeTo()\nORDER BY 1;",
"refId": "A"
}
],
"title": "Kilometers per Month",
"type": "timeseries"
},
{ {
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 70,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 8,
"x": 16,
"y": 8
},
"id": 3, "id": 3,
"options": { "type": "table",
"legend": { "title": "Points per Day",
"calcs": [ "datasource": {
"sum" "type": "postgres",
], "uid": "dawarich-postgres"
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
}, },
"pluginVersion": "13.0.2", "pluginVersion": "13.0.2",
"gridPos": {
"x": 14,
"y": 10,
"w": 10,
"h": 6
},
"targets": [ "targets": [
{ {
"refId": "A",
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "dawarich-postgres" "uid": "dawarich-postgres"
}, },
"editorMode": "code", "editorMode": "code",
"format": "time_series", "format": "table",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT\n date_trunc('day', to_timestamp(timestamp)) AS \"time\",\n count(*) AS \"points\"\nFROM points\nWHERE $__unixEpochFilter(timestamp)\nGROUP BY 1\nORDER BY 1;", "rawSql": "SELECT\n date_trunc('day', to_timestamp(timestamp))::date AS day,\n count(*)::double precision AS points\nFROM points\nWHERE timestamp >= extract(epoch from now() - interval '30 days')::integer\n AND timestamp <= extract(epoch from now())::integer\nGROUP BY 1\nORDER BY 1 DESC;"
"refId": "A"
} }
], ],
"title": "Points per Day", "fieldConfig": {
"type": "timeseries" "defaults": {
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
}
},
{
"id": 4,
"type": "table",
"title": "Recent Tracks",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2",
"gridPos": {
"x": 0,
"y": 16,
"w": 24,
"h": 7
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\n start_at AS start,\n end_at AS end,\n round((distance::numeric / 1000.0), 2)::double precision AS km,\n round((duration::numeric / 60.0), 1)::double precision AS minutes\nFROM tracks\nWHERE start_at >= now() - interval '30 days'\nORDER BY start_at DESC\nLIMIT 50;"
}
],
"fieldConfig": {
"defaults": {
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
}
} }
], ],
"preload": false,
"refresh": "5m", "refresh": "5m",
"schemaVersion": 41, "schemaVersion": 41,
"tags": [ "tags": [
"dawarich", "homelab",
"location" "dawarich"
], ],
"templating": { "templating": {
"list": [] "list": []
@@ -350,6 +572,6 @@
"timezone": "browser", "timezone": "browser",
"title": "Dawarich", "title": "Dawarich",
"uid": "dawarich", "uid": "dawarich",
"version": 1, "version": 5,
"weekStart": "" "weekStart": ""
} }
@@ -10,6 +10,7 @@ datasources:
user: dawarich_grafana_ro user: dawarich_grafana_ro
editable: false editable: false
jsonData: jsonData:
database: dawarich_production
sslmode: disable sslmode: disable
postgresVersion: 1700 postgresVersion: 1700
timescaledb: false timescaledb: false
@@ -3,33 +3,22 @@ set -eu
GRAFANA_USER="${GRAFANA_DB_USER:-dawarich_grafana_ro}" GRAFANA_USER="${GRAFANA_DB_USER:-dawarich_grafana_ro}"
GRAFANA_PASSWORD="$(cat /run/secrets/dawarich_grafana_ro_password)" GRAFANA_PASSWORD="$(cat /run/secrets/dawarich_grafana_ro_password)"
export GRAFANA_USER GRAFANA_PASSWORD
sql_ident() { psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<'EOSQL'
printf '"%s"' "$(printf '%s' "$1" | sed 's/"/""/g')" \set grafana_user `printf %s "$GRAFANA_USER"`
} \set grafana_password `printf %s "$GRAFANA_PASSWORD"`
sql_literal() { SELECT format('CREATE ROLE %I LOGIN PASSWORD %L', :'grafana_user', :'grafana_password')
printf "'%s'" "$(printf '%s' "$1" | sed "s/'/''/g")" WHERE NOT EXISTS (SELECT 1 FROM pg_catalog.pg_roles WHERE rolname = :'grafana_user')
} \gexec
DB_IDENT="$(sql_ident "$POSTGRES_DB")" SELECT format('ALTER ROLE %I WITH LOGIN PASSWORD %L', :'grafana_user', :'grafana_password')
USER_IDENT="$(sql_ident "$GRAFANA_USER")" WHERE EXISTS (SELECT 1 FROM pg_catalog.pg_roles WHERE rolname = :'grafana_user')
USER_LITERAL="$(sql_literal "$GRAFANA_USER")" \gexec
PASSWORD_LITERAL="$(sql_literal "$GRAFANA_PASSWORD")"
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<EOSQL SELECT format('GRANT CONNECT ON DATABASE %I TO %I', current_database(), :'grafana_user')\gexec
DO \$\$ SELECT format('GRANT USAGE ON SCHEMA public TO %I', :'grafana_user')\gexec
BEGIN SELECT format('GRANT SELECT ON ALL TABLES IN SCHEMA public TO %I', :'grafana_user')\gexec
IF NOT EXISTS (SELECT 1 FROM pg_catalog.pg_roles WHERE rolname = ${USER_LITERAL}) THEN SELECT format('ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO %I', :'grafana_user')\gexec
EXECUTE 'CREATE ROLE ${USER_IDENT} LOGIN PASSWORD ${PASSWORD_LITERAL}';
ELSE
EXECUTE 'ALTER ROLE ${USER_IDENT} WITH LOGIN PASSWORD ${PASSWORD_LITERAL}';
END IF;
END
\$\$;
GRANT CONNECT ON DATABASE ${DB_IDENT} TO ${USER_IDENT};
GRANT USAGE ON SCHEMA public TO ${USER_IDENT};
GRANT SELECT ON ALL TABLES IN SCHEMA public TO ${USER_IDENT};
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO ${USER_IDENT};
EOSQL EOSQL
+2
View File
@@ -121,6 +121,8 @@ Komodo-Mongo laeuft bereits auf der erlaubten MongoDB-8.0-Schiene; ein offener M
**2026-06-21 (Routine-Merge-Runde):** Sechs offene Renovate-PRs nach Sichtpruefung in einem Bulk-Deploy ueber den Komodo-Webhook gemergt: die Sammelgruppe `minor-and-patch-updates` (u. a. gitea 1.26.3, home-assistant 2026.6.4, alertmanager v0.33.0, influxdb 3.10.0-core, code-server 4.125.0, filebrowser, speedtest, super-productivity plus Digest-Refreshes fuer borg-ui/glances/scrutiny/mailarchiver/python), die reinen Digest-Refreshes fuer `unbound`, `traefik:v3.7` und `postgres:18.4` (gleiche Versionen) sowie n8n 2.26.2 -> 2.27.3 und der `nextcloud:33.0.5-apache` Digest-Refresh. Anschliessend nach Operator-Freigabe nachgezogen: Gitea 1.26.3 -> 1.26.4, cAdvisor v0.57.0 -> v0.60.1 und Nextcloud 33.0.5 -> 34.0.0. **2026-06-21 (Routine-Merge-Runde):** Sechs offene Renovate-PRs nach Sichtpruefung in einem Bulk-Deploy ueber den Komodo-Webhook gemergt: die Sammelgruppe `minor-and-patch-updates` (u. a. gitea 1.26.3, home-assistant 2026.6.4, alertmanager v0.33.0, influxdb 3.10.0-core, code-server 4.125.0, filebrowser, speedtest, super-productivity plus Digest-Refreshes fuer borg-ui/glances/scrutiny/mailarchiver/python), die reinen Digest-Refreshes fuer `unbound`, `traefik:v3.7` und `postgres:18.4` (gleiche Versionen) sowie n8n 2.26.2 -> 2.27.3 und der `nextcloud:33.0.5-apache` Digest-Refresh. Anschliessend nach Operator-Freigabe nachgezogen: Gitea 1.26.3 -> 1.26.4, cAdvisor v0.57.0 -> v0.60.1 und Nextcloud 33.0.5 -> 34.0.0.
**2026-06-22 (Dawarich-Redis nachgezogen):** `dawarich_redis` war nach den 2026-05-31-Migrationen die letzte verbliebene Redis-7-Instanz; der seinerzeit geschlossene PR #10 hielt sie als "Ignored or Blocked" im Dependency Dashboard (Issue #6). Bewusste Entscheidung, die Instanz auf die 8.x-Schiene nachzuziehen: `apps/dawarich/docker-compose.yml` von `redis:7-alpine` auf den bereits produktiven `redis:8.8.0-alpine`-Digest gehoben und in `renovate.json` zur `allowedVersions`-Redis-8.x-Liste hinzugefuegt. Damit ist die Dashboard-Blockade aufgeloest und alle Redis-Instanzen laufen auf 8.x. Datenpfad `/mnt/user/appdata/dawarich/redis` unveraendert; Redis 8 laedt die bestehenden RDB-Snapshots.
## Erwartete erste PRs (historisch) ## Erwartete erste PRs (historisch)
Beim Erstlauf wird Renovate vermutlich PRs fuer einige der digest-gepinnten Images oeffnen, weil diese Digests seit Wochen nicht erneuert wurden. Reihenfolge der Sichtpruefung: Beim Erstlauf wird Renovate vermutlich PRs fuer einige der digest-gepinnten Images oeffnen, weil diese Digests seit Wochen nicht erneuert wurden. Reihenfolge der Sichtpruefung:
+2 -2
View File
@@ -43,9 +43,9 @@ Secret-Werte sind nicht enthalten. Es werden nur Secret-Namen, Env-Key-Namen und
| `immich_machine_learning` | Immich ML | `apps/immich/docker-compose.yml` | intern | `immich_default`, `immich_egress` | `model-cache` | rebuildbar | nein | keine Traefik-Route; `immich_egress` (nicht-internal) nur fuer Modell-Download zu huggingface, sonst scheitert Smart Search/Gesichtserkennung an DNS | | `immich_machine_learning` | Immich ML | `apps/immich/docker-compose.yml` | intern | `immich_default`, `immich_egress` | `model-cache` | rebuildbar | nein | keine Traefik-Route; `immich_egress` (nicht-internal) nur fuer Modell-Download zu huggingface, sonst scheitert Smart Search/Gesichtserkennung an DNS |
| `mealie` | Rezeptverwaltung | `apps/mealie/docker-compose.yml` | `https://mealie.kaleschke.info` | `mealie-postgres`, Traefik | `/mnt/user/appdata/mealie/data` | Tier 2, Borg + `mealie.dump` | ja | App + DB in internem Netz getrennt | | `mealie` | Rezeptverwaltung | `apps/mealie/docker-compose.yml` | `https://mealie.kaleschke.info` | `mealie-postgres`, Traefik | `/mnt/user/appdata/mealie/data` | Tier 2, Borg + `mealie.dump` | ja | App + DB in internem Netz getrennt |
| `mealie-postgres` | Mealie-Datenbank | `apps/mealie/docker-compose.yml` | intern | `mealie_internal` | `/mnt/user/appdata/mealie/postgres18`, archivierter Rollback-Altstand `/mnt/user/appdata/_archive/pg18-immich-rollback-volumes-20260602/mealie-postgres17`, `mealie_postgres_password.txt` | Dump `mealie.dump` | nein | interne DB; PostgreSQL 18 | | `mealie-postgres` | Mealie-Datenbank | `apps/mealie/docker-compose.yml` | intern | `mealie_internal` | `/mnt/user/appdata/mealie/postgres18`, archivierter Rollback-Altstand `/mnt/user/appdata/_archive/pg18-immich-rollback-volumes-20260602/mealie-postgres17`, `mealie_postgres_password.txt` | Dump `mealie.dump` | nein | interne DB; PostgreSQL 18 |
| `dawarich_app` | Standort-Historie / Google-Timeline-Ersatz | `apps/dawarich/docker-compose.yml` | `https://dawarich.kaleschke.info` | eigene PostGIS-DB, eigene Redis, Traefik + Authelia, Photon Reverse Geocoding, optional Home Assistant Push | `/mnt/user/appdata/dawarich/{postgres17,redis,shared,public,watched,storage}`, `dawarich_*.txt` Secrets | Tier 2, Borg + `dawarich.dump` | ja + Authelia | UI hinter Authelia; API-Key-Tracking-Endpunkte fuer OwnTracks/Overland/Traccar ohne ForwardAuth priorisiert. Reverse Geocoding nutzt standardmaessig `photon.komoot.io` ohne Key. App und Sidekiq nutzen `freikin/dawarich:1.8.1`; Prometheus-Scrape nach aktueller Dawarich-Doku ueber `dawarich_app:3000/metrics`, Sidekiq-Metriken intern ueber `:9394`. | | `dawarich_app` | Standort-Historie / Google-Timeline-Ersatz | `apps/dawarich/docker-compose.yml` | `https://dawarich.kaleschke.info` | eigene PostGIS-DB, eigene Redis, Traefik + Authelia, optional Home Assistant Push | `/mnt/user/appdata/dawarich/{postgres17,redis,shared,public,watched,storage}`, `dawarich_*.txt` Secrets | Tier 2, Borg + `dawarich.dump` | ja + Authelia | UI hinter Authelia; API-Key-Tracking-Endpunkte fuer OwnTracks/Overland/Traccar ohne ForwardAuth priorisiert. App und Sidekiq nutzen `freikin/dawarich:1.8.1`; Prometheus-Scrape nach aktueller Dawarich-Doku ueber `dawarich_app:3000/metrics`, Sidekiq-Metriken intern ueber `:9394`. |
| `dawarich_db` | Dawarich PostGIS-Datenbank | `apps/dawarich/docker-compose.yml` | intern | `backend_net` | `/mnt/user/appdata/dawarich/postgres17`, `dawarich_postgres_password.txt`, `dawarich_grafana_ro_password.txt` | Dump `dawarich.dump`; raw DB nur bei gleichem PG/PostGIS und sauberem Shutdown | nein | PostGIS 17-3.5 Alpine; Grafana-Read-only-User `dawarich_grafana_ro` per Init-Script | | `dawarich_db` | Dawarich PostGIS-Datenbank | `apps/dawarich/docker-compose.yml` | intern | `backend_net` | `/mnt/user/appdata/dawarich/postgres17`, `dawarich_postgres_password.txt`, `dawarich_grafana_ro_password.txt` | Dump `dawarich.dump`; raw DB nur bei gleichem PG/PostGIS und sauberem Shutdown | nein | PostGIS 17-3.5 Alpine; Grafana-Read-only-User `dawarich_grafana_ro` per Init-Script |
| `dawarich_redis` | Dawarich Cache/Queue-Backend | `apps/dawarich/docker-compose.yml` | intern | `backend_net` | `/mnt/user/appdata/dawarich/redis`, `dawarich_redis_password.txt` | Teil von Dawarich-Restore, aber aus DB/Appdaten rekonstruierbar | nein | Redis 7 Alpine, keine Host-Ports | | `dawarich_redis` | Dawarich Cache/Queue-Backend | `apps/dawarich/docker-compose.yml` | intern | `backend_net` | `/mnt/user/appdata/dawarich/redis`, `dawarich_redis_password.txt` | Teil von Dawarich-Restore, aber aus DB/Appdaten rekonstruierbar | nein | Redis 8.8 Alpine, keine Host-Ports |
| `mail-archiver` | Mail-Archivierung | `apps/mail-archiver/docker-compose.yml` | `https://mail.kaleschke.info` | PostgreSQL 18, Internet/IMAP, Traefik, Authelia | `/mnt/user/appdata/mailarchiver/data-protection-keys` | Tier 2, `postgresql17-mailarchiver.dump` | ja + Authelia | Hybrid-Dienst: `frontend_net` fuer Internet, `backend_net` fuer DB; App-eigene Auth bleibt zusaetzliche Schutzschicht; Dump-Dateiname behaelt den historischen Cluster-Namen | | `mail-archiver` | Mail-Archivierung | `apps/mail-archiver/docker-compose.yml` | `https://mail.kaleschke.info` | PostgreSQL 18, Internet/IMAP, Traefik, Authelia | `/mnt/user/appdata/mailarchiver/data-protection-keys` | Tier 2, `postgresql17-mailarchiver.dump` | ja + Authelia | Hybrid-Dienst: `frontend_net` fuer Internet, `backend_net` fuer DB; App-eigene Auth bleibt zusaetzliche Schutzschicht; Dump-Dateiname behaelt den historischen Cluster-Namen |
| `nextcloud` | Datei-/Cloud-Dienst | `apps/nextcloud/docker-compose.yml` | `https://cloud.kaleschke.info` | eigene PostgreSQL, eigene Redis, Traefik | `/mnt/user/appdata/nextcloud/html`, `/mnt/user/documents/nextcloud-data` | Tier 2, `nextcloud.dump` + Share | ja | native App-Auth ohne zentrale ForwardAuth; WebDAV/CardDAV beachten | | `nextcloud` | Datei-/Cloud-Dienst | `apps/nextcloud/docker-compose.yml` | `https://cloud.kaleschke.info` | eigene PostgreSQL, eigene Redis, Traefik | `/mnt/user/appdata/nextcloud/html`, `/mnt/user/documents/nextcloud-data` | Tier 2, `nextcloud.dump` + Share | ja | native App-Auth ohne zentrale ForwardAuth; WebDAV/CardDAV beachten |
| `nextcloud-postgres` | Nextcloud-Datenbank | `apps/nextcloud/docker-compose.yml` | intern | `nextcloud_internal` | `/mnt/user/appdata/nextcloud/postgres18`, archivierter Rollback-Altstand `/mnt/user/appdata/_archive/pg18-immich-rollback-volumes-20260602/nextcloud-postgres17`, `nextcloud_postgres_password.txt` | `nextcloud.dump`, raw DB nicht primaerer Restore-Weg | nein | interne DB; PostgreSQL 18 | | `nextcloud-postgres` | Nextcloud-Datenbank | `apps/nextcloud/docker-compose.yml` | intern | `nextcloud_internal` | `/mnt/user/appdata/nextcloud/postgres18`, archivierter Rollback-Altstand `/mnt/user/appdata/_archive/pg18-immich-rollback-volumes-20260602/nextcloud-postgres17`, `nextcloud_postgres_password.txt` | `nextcloud.dump`, raw DB nicht primaerer Restore-Weg | nein | interne DB; PostgreSQL 18 |
+415 -193
View File
@@ -20,12 +20,276 @@
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": null,
"links": [], "links": [],
"liveNow": false,
"panels": [ "panels": [
{ {
"id": 10,
"type": "stat",
"title": "Points Last 30 Days",
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "dawarich-postgres" "uid": "dawarich-postgres"
}, },
"pluginVersion": "13.0.2",
"gridPos": {
"x": 0,
"y": 0,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT count(*)::double precision AS points\nFROM points\nWHERE timestamp >= extract(epoch from now() - interval '30 days')::integer\n AND timestamp <= extract(epoch from now())::integer\n AND lonlat IS NOT NULL;"
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "points",
"values": false
},
"textMode": "auto",
"wideLayout": true
}
},
{
"id": 11,
"type": "stat",
"title": "Kilometers Last 30 Days",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2",
"gridPos": {
"x": 6,
"y": 0,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT round(coalesce(sum(distance),0)::numeric / 1000.0, 2)::double precision AS km\nFROM tracks\nWHERE start_at >= now() - interval '30 days';"
}
],
"fieldConfig": {
"defaults": {
"unit": "km",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "km",
"values": false
},
"textMode": "auto",
"wideLayout": true
}
},
{
"id": 12,
"type": "stat",
"title": "Tracks Last 30 Days",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2",
"gridPos": {
"x": 12,
"y": 0,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT count(*)::double precision AS tracks\nFROM tracks\nWHERE start_at >= now() - interval '30 days';"
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "tracks",
"values": false
},
"textMode": "auto",
"wideLayout": true
}
},
{
"id": 13,
"type": "stat",
"title": "Anomalies Last 30 Days",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2",
"gridPos": {
"x": 18,
"y": 0,
"w": 6,
"h": 4
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT count(*)::double precision AS anomalies\nFROM points\nWHERE timestamp >= extract(epoch from now() - interval '30 days')::integer\n AND timestamp <= extract(epoch from now())::integer\n AND anomaly IS TRUE;"
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"colorMode": "value",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "anomalies",
"values": false
},
"textMode": "auto",
"wideLayout": true
}
},
{
"id": 1,
"type": "geomap",
"title": "Location Points",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2",
"gridPos": {
"x": 0,
"y": 4,
"w": 14,
"h": 12
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\n ST_Y(lonlat::geometry)::double precision AS lat,\n ST_X(lonlat::geometry)::double precision AS lon,\n accuracy::double precision AS accuracy,\n to_timestamp(timestamp) AS seen_at\nFROM points\nWHERE timestamp >= extract(epoch from now() - interval '30 days')::integer\n AND timestamp <= extract(epoch from now())::integer\n AND lonlat IS NOT NULL\nORDER BY timestamp DESC\nLIMIT 5000;"
}
],
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": { "custom": {
@@ -44,18 +308,10 @@
"value": null "value": null
} }
] ]
}, }
"unit": "none"
}, },
"overrides": [] "overrides": []
}, },
"gridPos": {
"h": 16,
"w": 16,
"x": 0,
"y": 0
},
"id": 1,
"options": { "options": {
"basemap": { "basemap": {
"config": {}, "config": {},
@@ -73,42 +329,29 @@
"layers": [ "layers": [
{ {
"config": { "config": {
"showLegend": true, "showLegend": false,
"style": { "style": {
"color": { "color": {
"fixed": "dark-green" "fixed": "green"
},
"opacity": 0.55,
"rotation": {
"fixed": 0,
"max": 360,
"min": -360,
"mode": "mod"
}, },
"opacity": 0.7,
"size": { "size": {
"fixed": 4, "fixed": 5,
"max": 15, "max": 15,
"min": 2 "min": 2
}, },
"symbol": { "symbol": {
"fixed": "img/icons/marker/circle.svg", "fixed": "img/icons/marker/circle.svg",
"mode": "fixed" "mode": "fixed"
},
"textConfig": {
"fontSize": 12,
"offsetX": 0,
"offsetY": 0,
"textAlign": "center",
"textBaseline": "middle"
} }
} }
}, },
"location": { "location": {
"latitude": "latitude", "latitude": "lat",
"longitude": "longitude", "longitude": "lon",
"mode": "coords" "mode": "coords"
}, },
"name": "Location points", "name": "Points",
"tooltip": true, "tooltip": true,
"type": "markers" "type": "markers"
} }
@@ -119,14 +362,30 @@
"view": { "view": {
"allLayers": true, "allLayers": true,
"id": "fit", "id": "fit",
"lat": 51, "lat": 52.0,
"lon": 10, "lon": 7.5,
"zoom": 5 "zoom": 8
}
} }
}, },
{
"id": 2,
"type": "table",
"title": "Kilometers per Day",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2", "pluginVersion": "13.0.2",
"gridPos": {
"x": 14,
"y": 4,
"w": 10,
"h": 6
},
"targets": [ "targets": [
{ {
"refId": "A",
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "dawarich-postgres" "uid": "dawarich-postgres"
@@ -134,53 +393,15 @@
"editorMode": "code", "editorMode": "code",
"format": "table", "format": "table",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT\n to_timestamp(timestamp) AS \"time\",\n ST_Y(lonlat::geometry) AS latitude,\n ST_X(lonlat::geometry) AS longitude,\n accuracy,\n tracker_id\nFROM points\nWHERE $__unixEpochFilter(timestamp)\n AND lonlat IS NOT NULL\nORDER BY timestamp DESC\nLIMIT 20000;", "rawSql": "SELECT\n date_trunc('day', start_at)::date AS day,\n round(coalesce(sum(distance),0)::numeric / 1000.0, 2)::double precision AS km\nFROM tracks\nWHERE start_at >= now() - interval '30 days'\nGROUP BY 1\nORDER BY 1 DESC;"
"refId": "A"
} }
], ],
"title": "Location Points",
"type": "geomap"
},
{
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"color": {
"mode": "palette-classic"
},
"custom": { "custom": {
"axisBorderShow": false, "align": "auto",
"axisCenteredZero": false, "cellOptions": {
"axisColorMode": "text", "type": "auto"
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 70,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
} }
}, },
"mappings": [], "mappings": [],
@@ -192,152 +413,153 @@
"value": null "value": null
} }
] ]
}, }
"unit": "km"
}, },
"overrides": [] "overrides": []
}, },
"gridPos": {
"h": 8,
"w": 8,
"x": 16,
"y": 0
},
"id": 2,
"options": { "options": {
"legend": { "cellHeight": "sm",
"calcs": [ "footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum" "sum"
], ],
"displayMode": "list", "show": false
"placement": "bottom",
"showLegend": true
}, },
"tooltip": { "showHeader": true
"hideZeros": false,
"mode": "single",
"sort": "none"
} }
}, },
"pluginVersion": "13.0.2",
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "time_series",
"rawQuery": true,
"rawSql": "SELECT\n make_date(year, month, 1)::timestamp AS \"time\",\n round((distance::numeric / 1000.0), 2) AS \"km\"\nFROM stats\nWHERE make_date(year, month, 1)::timestamp BETWEEN $__timeFrom() AND $__timeTo()\nORDER BY 1;",
"refId": "A"
}
],
"title": "Kilometers per Month",
"type": "timeseries"
},
{ {
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "bars",
"fillOpacity": 70,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 8,
"x": 16,
"y": 8
},
"id": 3, "id": 3,
"options": { "type": "table",
"legend": { "title": "Points per Day",
"calcs": [ "datasource": {
"sum" "type": "postgres",
], "uid": "dawarich-postgres"
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"hideZeros": false,
"mode": "single",
"sort": "none"
}
}, },
"pluginVersion": "13.0.2", "pluginVersion": "13.0.2",
"gridPos": {
"x": 14,
"y": 10,
"w": 10,
"h": 6
},
"targets": [ "targets": [
{ {
"refId": "A",
"datasource": { "datasource": {
"type": "postgres", "type": "postgres",
"uid": "dawarich-postgres" "uid": "dawarich-postgres"
}, },
"editorMode": "code", "editorMode": "code",
"format": "time_series", "format": "table",
"rawQuery": true, "rawQuery": true,
"rawSql": "SELECT\n date_trunc('day', to_timestamp(timestamp)) AS \"time\",\n count(*) AS \"points\"\nFROM points\nWHERE $__unixEpochFilter(timestamp)\nGROUP BY 1\nORDER BY 1;", "rawSql": "SELECT\n date_trunc('day', to_timestamp(timestamp))::date AS day,\n count(*)::double precision AS points\nFROM points\nWHERE timestamp >= extract(epoch from now() - interval '30 days')::integer\n AND timestamp <= extract(epoch from now())::integer\nGROUP BY 1\nORDER BY 1 DESC;"
"refId": "A"
} }
], ],
"title": "Points per Day", "fieldConfig": {
"type": "timeseries" "defaults": {
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
}
},
{
"id": 4,
"type": "table",
"title": "Recent Tracks",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"pluginVersion": "13.0.2",
"gridPos": {
"x": 0,
"y": 16,
"w": 24,
"h": 7
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "postgres",
"uid": "dawarich-postgres"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT\n start_at AS start,\n end_at AS end,\n round((distance::numeric / 1000.0), 2)::double precision AS km,\n round((duration::numeric / 60.0), 1)::double precision AS minutes\nFROM tracks\nWHERE start_at >= now() - interval '30 days'\nORDER BY start_at DESC\nLIMIT 50;"
}
],
"fieldConfig": {
"defaults": {
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
}
} }
], ],
"preload": false,
"refresh": "5m", "refresh": "5m",
"schemaVersion": 41, "schemaVersion": 41,
"tags": [ "tags": [
"dawarich", "homelab",
"location" "dawarich"
], ],
"templating": { "templating": {
"list": [] "list": []
@@ -350,6 +572,6 @@
"timezone": "browser", "timezone": "browser",
"title": "Dawarich", "title": "Dawarich",
"uid": "dawarich", "uid": "dawarich",
"version": 1, "version": 5,
"weekStart": "" "weekStart": ""
} }
@@ -10,6 +10,7 @@ datasources:
user: dawarich_grafana_ro user: dawarich_grafana_ro
editable: false editable: false
jsonData: jsonData:
database: dawarich_production
sslmode: disable sslmode: disable
postgresVersion: 1700 postgresVersion: 1700
timescaledb: false timescaledb: false
+2 -1
View File
@@ -95,7 +95,8 @@
"matchFileNames": [ "matchFileNames": [
"infra/redis/docker-compose.yml", "infra/redis/docker-compose.yml",
"apps/nextcloud/docker-compose.yml", "apps/nextcloud/docker-compose.yml",
"apps/immich/docker-compose.yml" "apps/immich/docker-compose.yml",
"apps/dawarich/docker-compose.yml"
], ],
"matchPackageNames": ["redis"], "matchPackageNames": ["redis"],
"allowedVersions": "/^8\\.\\d+\\.\\d+-alpine(?:\\d+\\.\\d+)?$/" "allowedVersions": "/^8\\.\\d+\\.\\d+-alpine(?:\\d+\\.\\d+)?$/"
+1 -1
View File
@@ -1,6 +1,6 @@
services: services:
traefik: traefik:
image: traefik:v3.7@sha256:d6858791f9e74df44ca4014166647c41cdc2abd3bf2a71b832ca4e1c6a91b257 image: traefik:v3.7@sha256:5a52522fa05731d9c537540f873ba8c4842e83354c27275b747145bab75da120
container_name: traefik container_name: traefik
restart: unless-stopped restart: unless-stopped
security_opt: security_opt: