From 36eae5df82210288c2c25d93e8c47a64ceb4279a Mon Sep 17 00:00:00 2001 From: sam Date: Mon, 20 Jul 2026 15:25:23 -0700 Subject: [PATCH] setup.sh: sync dashboard JSONs to the data-root, not just provisioning YAML Fresh remote hosts came up with an empty Grafana: the provisioning YAML pointed Grafana at /var/lib/grafana/dashboards/... (bind-mounted from ${OBMP_DATA_ROOT}/grafana/dashboards) but nothing on the host ever populated that path. Grafana loaded the providers, found no JSON files, and showed the built-in Home dashboard only. setup.sh already copied obmp-grafana/provisioning/. -> the equivalent host path; add the same copy for obmp-grafana/dashboards/. so a fresh host gets all 42 committed dashboards on first run. Grafana's file provider re-scans every 30s, so they appear without a container restart. Co-Authored-By: Claude Opus 4.7 --- setup.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 15f2d2d..650cfdc 100755 --- a/setup.sh +++ b/setup.sh @@ -109,9 +109,19 @@ done # Container processes run as assorted UIDs; lab-permissive perms. $SUDO chmod -R 777 "$OBMP_DATA_ROOT" 2>/dev/null || true -# --- Grafana provisioning --------------------------------------------------- +# --- Grafana provisioning + dashboards -------------------------------------- +# Provisioning YAML points Grafana at /var/lib/grafana/dashboards/... (bind- +# mounted from $OBMP_DATA_ROOT/grafana/dashboards). Sync BOTH -- otherwise +# Grafana loads the providers, finds no JSON files, and shows an empty UI. +# allowUiUpdates: true in the provisioning YAML means UI edits persist to +# the container's copy; the on-disk sync overwrites them, which is the +# desired behavior for a repo-authored dashboard set. If you edit a +# dashboard in Grafana, export it and commit the JSON. echo "Syncing Grafana provisioning ..." $SUDO cp -r obmp-grafana/provisioning/. "$OBMP_DATA_ROOT/grafana/provisioning/" +echo "Syncing Grafana dashboards ..." +$SUDO mkdir -p "$OBMP_DATA_ROOT/grafana/dashboards" +$SUDO cp -r obmp-grafana/dashboards/. "$OBMP_DATA_ROOT/grafana/dashboards/" # --- Grafana root URL ------------------------------------------------------- # In local mode Grafana is hit directly on :3000; in authelia mode the public