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 <noreply@anthropic.com>
This commit is contained in:
sam 2026-07-20 15:25:23 -07:00
parent 387d9fc50e
commit 36eae5df82

View File

@ -109,9 +109,19 @@ done
# Container processes run as assorted UIDs; lab-permissive perms. # Container processes run as assorted UIDs; lab-permissive perms.
$SUDO chmod -R 777 "$OBMP_DATA_ROOT" 2>/dev/null || true $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 ..." echo "Syncing Grafana provisioning ..."
$SUDO cp -r obmp-grafana/provisioning/. "$OBMP_DATA_ROOT/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 ------------------------------------------------------- # --- Grafana root URL -------------------------------------------------------
# In local mode Grafana is hit directly on :3000; in authelia mode the public # In local mode Grafana is hit directly on :3000; in authelia mode the public