1 Commits

Author SHA1 Message Date
5af3f8c643 Moves oidc and smtp to a seperate compose config 2025-11-05 15:28:49 +01:00
7 changed files with 110 additions and 130 deletions

View File

@ -50,6 +50,7 @@ ENABLE_BACKUPS=true
#GRAFANA_DOMAIN=grafana.example.com
#
## Single-Sign-On with OIDC
# COMPOSE_FILE="$COMPOSE_FILE:compose.grafana-oidc.yml"
# OIDC_ENABLED=1
# SECRET_GRAFANA_OIDC_CLIENT_SECRET_VERSION=v1
# OIDC_CLIENT_ID=grafana
@ -62,6 +63,7 @@ ENABLE_BACKUPS=true
# GF_INSTALL_PLUGINS=grafana-piechart-panel
#
## grafana SMTP configuration (optional)
# COMPOSE_FILE="$COMPOSE_FILE:compose.grafana-smtp.yml"
# GF_SMTP_HOST=changeme
# GF_SMTP_USER=changme
# GF_SMTP_ENABLED=true

16
compose.grafana-oidc.yml Normal file
View File

@ -0,0 +1,16 @@
version: '3.8'
services:
grafana:
- grafana_oidc_client_secret
environment:
- OIDC_API_URL
- OIDC_AUTH_URL
- OIDC_CLIENT_ID
- OIDC_ENABLED
- OIDC_TOKEN_URL
secrets:
grafana_oidc_client_secret:
external: true
name: ${STACK_NAME}_grafana_oidc_client_secret_${SECRET_GRAFANA_OIDC_CLIENT_SECRET_VERSION}

18
compose.grafana-smtp.yml Normal file
View File

@ -0,0 +1,18 @@
version: '3.8'
services:
grafana:
secrets:
- grafana_smtp_password
environment:
- GF_SMTP_HOST
- GF_SMTP_USER
- GF_SMTP_PASSWORD__FILE=/run/secrets/grafana_smtp_password
- GF_SMTP_ENABLED
- GF_SMTP_FROM_ADDRESS
- GF_SMTP_SKIP_VERIFY
secrets:
grafana_smtp_password:
external: true
name: ${STACK_NAME}_grafana_smtp_password_${SECRET_GRAFANA_SMTP_PASSWORD_VERSION}

View File

@ -7,8 +7,6 @@ services:
- grafana-data:/var/lib/grafana:rw
secrets:
- grafana_admin_password
- grafana_oidc_client_secret
- grafana_smtp_password
configs:
- source: grafana_custom_ini
target: /etc/grafana/grafana.ini
@ -32,19 +30,8 @@ services:
environment:
- GF_SERVER_ROOT_URL
- GF_SECURITY_ADMIN_PASSWORD__FILE=/run/secrets/grafana_admin_password
- GF_SMTP_HOST
- GF_SMTP_USER
- GF_SMTP_PASSWORD__FILE=/run/secrets/grafana_smtp_password
- GF_SMTP_ENABLED
- GF_SMTP_FROM_ADDRESS
- GF_SMTP_SKIP_VERIFY
- GF_SECURITY_ALLOW_EMBEDDING
- GF_INSTALL_PLUGINS
- OIDC_API_URL
- OIDC_AUTH_URL
- OIDC_CLIENT_ID
- OIDC_ENABLED
- OIDC_TOKEN_URL
deploy:
labels:
- "traefik.enable=true"
@ -97,9 +84,3 @@ secrets:
grafana_admin_password:
external: true
name: ${STACK_NAME}_grafana_admin_password_${SECRET_GRAFANA_ADMIN_PASSWORD_VERSION}
grafana_oidc_client_secret:
external: true
name: ${STACK_NAME}_grafana_oidc_client_secret_${SECRET_GRAFANA_OIDC_CLIENT_SECRET_VERSION}
grafana_smtp_password:
external: true
name: ${STACK_NAME}_grafana_smtp_password_${SECRET_GRAFANA_SMTP_PASSWORD_VERSION}

View File

@ -216,7 +216,7 @@
"datasourceUid": "PBFA97CFB590B2093",
"model": {
"editorMode": "code",
"expr": "(node_filesystem_free_bytes{fstype=\"ext4\"} / node_filesystem_size_bytes{fstype=\"ext4\"}) * 100",
"expr": "(node_filesystem_free_bytes{fstype=\"ext4\",mountpoint=~\"(/$)|(/media.*)\"} / node_filesystem_size_bytes{fstype=\"ext4\",mountpoint=~\"(/$)|(/media.*)\"}) * 100",
"instant": true,
"intervalMs": 1000,
"legendFormat": "__auto",

View File

@ -93,6 +93,7 @@
},
"hideTimeOverride": true,
"id": 2,
"links": [],
"maxDataPoints": 100,
"options": {
"colorMode": "value",
@ -106,12 +107,10 @@
"fields": "",
"values": false
},
"showPercentChange": false,
"text": {},
"textMode": "auto",
"wideLayout": true
"textMode": "auto"
},
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"targets": [
{
"datasource": {
@ -173,6 +172,7 @@
"y": 0
},
"id": 1,
"links": [],
"maxDataPoints": 100,
"options": {
"colorMode": "value",
@ -186,12 +186,10 @@
"fields": "",
"values": false
},
"showPercentChange": false,
"text": {},
"textMode": "auto",
"wideLayout": true
"textMode": "auto"
},
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"targets": [
{
"datasource": {
@ -253,6 +251,7 @@
},
"hideTimeOverride": true,
"id": 4,
"links": [],
"maxDataPoints": 100,
"options": {
"colorMode": "value",
@ -266,12 +265,10 @@
"fields": "",
"values": false
},
"showPercentChange": false,
"text": {},
"textMode": "auto",
"wideLayout": true
"textMode": "auto"
},
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"targets": [
{
"datasource": {
@ -338,10 +335,9 @@
"y": 0
},
"id": 8,
"links": [],
"maxDataPoints": 100,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
@ -352,10 +348,9 @@
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto",
"text": {}
},
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"targets": [
{
"datasource": {
@ -410,12 +405,13 @@
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"pointradius": 5,
"points": false,
"renderer": "flot",
@ -511,6 +507,7 @@
},
"hideTimeOverride": true,
"id": 3,
"links": [],
"maxDataPoints": 100,
"options": {
"colorMode": "value",
@ -524,12 +521,10 @@
"fields": "",
"values": false
},
"showPercentChange": false,
"text": {},
"textMode": "auto",
"wideLayout": true
"textMode": "auto"
},
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"targets": [
{
"datasource": {
@ -590,6 +585,7 @@
},
"hideTimeOverride": true,
"id": 9,
"links": [],
"maxDataPoints": 100,
"options": {
"colorMode": "value",
@ -603,12 +599,10 @@
"fields": "",
"values": false
},
"showPercentChange": false,
"text": {},
"textMode": "auto",
"wideLayout": true
"textMode": "auto"
},
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"targets": [
{
"datasource": {
@ -677,10 +671,9 @@
},
"hideTimeOverride": true,
"id": 11,
"links": [],
"maxDataPoints": 100,
"options": {
"minVizHeight": 75,
"minVizWidth": 75,
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
@ -691,10 +684,9 @@
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"sizing": "auto",
"text": {}
},
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"targets": [
{
"datasource": {
@ -721,39 +713,7 @@
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "left",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
"mode": "thresholds"
},
"mappings": [
{
@ -787,42 +747,33 @@
},
"unit": "percent"
},
"overrides": [
{
"matcher": {
"id": "byType",
"options": "time"
},
"properties": [
{
"id": "custom.axisPlacement",
"value": "hidden"
}
]
}
]
"overrides": []
},
"gridPos": {
"h": 6,
"w": 6,
"h": 4,
"w": 2.6666666666666665,
"x": 0,
"y": 8
},
"id": 10,
"links": [],
"maxDataPoints": 100,
"maxPerRow": 12,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"last"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single",
"sort": "none"
}
"textMode": "auto"
},
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"repeat": "node_id",
"repeatDirection": "h",
"targets": [
@ -831,20 +782,18 @@
"type": "prometheus",
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"exemplar": true,
"expr": "node_filesystem_free_bytes{fstype=\"ext4\"} / node_filesystem_size_bytes{fstype=\"ext4\"} * on(instance) group_left(node_name) node_meta{node_name=~\"$node_id\"} * 100",
"expr": "sum((node_filesystem_free_bytes{fstype=\"ext4\",mountpoint=~\"(/$)|(/media.*)\"} / node_filesystem_size_bytes{fstype=\"ext4\",mountpoint=~\"(/$)|(/media.*)\"}) * on(instance) group_left(node_name) node_meta{node_name=~\"$node_id\"} * 100) / count(node_meta * on(instance) group_left(node_name) node_meta{node_name=~\"$node_id\"})",
"format": "time_series",
"interval": "",
"intervalFactor": 2,
"legendFormat": "{{mountpoint}}",
"range": true,
"legendFormat": "",
"refId": "A",
"step": 20
}
],
"title": "Available Disk Space $node_id",
"type": "timeseries"
"type": "stat"
},
{
"aliasColors": {},
@ -862,7 +811,7 @@
"h": 7,
"w": 24,
"x": 0,
"y": 14
"y": 12
},
"hiddenSeries": false,
"id": 14,
@ -881,12 +830,13 @@
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null as zero",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"pointradius": 5,
"points": false,
"renderer": "flot",
@ -950,7 +900,6 @@
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
@ -964,7 +913,6 @@
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
@ -1013,11 +961,12 @@
},
"gridPos": {
"h": 7,
"w": 6,
"w": 2.6666666666666665,
"x": 0,
"y": 21
"y": 19
},
"id": 15,
"links": [],
"maxPerRow": 12,
"options": {
"legend": {
@ -1125,7 +1074,7 @@
"h": 7,
"w": 24,
"x": 0,
"y": 28
"y": 26
},
"hiddenSeries": false,
"id": 16,
@ -1142,12 +1091,13 @@
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null as zero",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "10.4.14",
"pluginVersion": "10.0.2",
"pointradius": 5,
"points": false,
"renderer": "flot",
@ -1228,7 +1178,7 @@
"h": 7,
"w": 12,
"x": 0,
"y": 35
"y": 33
},
"hiddenSeries": false,
"id": 18,
@ -1245,6 +1195,7 @@
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null as zero",
"options": {
"alertThreshold": true
@ -1330,7 +1281,7 @@
"h": 7,
"w": 12,
"x": 12,
"y": 35
"y": 33
},
"hiddenSeries": false,
"id": 19,
@ -1349,6 +1300,7 @@
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null as zero",
"options": {
"alertThreshold": true
@ -1424,7 +1376,7 @@
"h": 7,
"w": 18,
"x": 0,
"y": 42
"y": 40
},
"hiddenSeries": false,
"id": 12,
@ -1445,6 +1397,7 @@
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"options": {
"alertThreshold": true
@ -1546,9 +1499,10 @@
"h": 7,
"w": 6,
"x": 18,
"y": 42
"y": 40
},
"id": 7,
"links": [],
"maxDataPoints": 100,
"options": {
"colorMode": "none",
@ -1646,9 +1600,10 @@
"h": 7,
"w": 24,
"x": 0,
"y": 49
"y": 47
},
"id": 17,
"links": [],
"options": {
"legend": {
"calcs": [],
@ -1703,7 +1658,7 @@
"h": 9,
"w": 24,
"x": 0,
"y": 56
"y": 54
},
"id": 30,
"options": {
@ -1733,7 +1688,8 @@
}
],
"refresh": "",
"schemaVersion": 39,
"schemaVersion": 38,
"style": "dark",
"tags": [
"swarmprom",
"prometheus",
@ -1880,6 +1836,6 @@
"timezone": "",
"title": "Docker Swarm Nodes",
"uid": "BPlb-Sgik",
"version": 7,
"version": 24,
"weekStart": ""
}
}

7
release/next Normal file
View File

@ -0,0 +1,7 @@
1. OIDC was moved into a seperate compose file. If you have oidc configured you need to add the following line to you .env file:
COMPOSE_FILE="$COMPOSE_FILE:compose.grafana-oidc.yml"
2. SMTP was moved into a seperate compose file. If you have smtp configured you need to add the following line to you .env file:
COMPOSE_FILE="$COMPOSE_FILE:compose.grafana-smtp.yml"