dashboards as cfg: copy dash/ds files if missing

This commit is contained in:
bergquist
2017-12-06 10:17:05 +01:00
parent 361acd3fa1
commit 50bc801f1c
2 changed files with 12 additions and 8 deletions

View File

@@ -29,12 +29,14 @@ case "$1" in
if [ ! -f $CONF_FILE ]; then
cp /usr/share/grafana/conf/sample.ini $CONF_FILE
cp /usr/share/grafana/conf/ldap.toml /etc/grafana/ldap.toml
mkdir -p /etc/grafana/dashboards /etc/grafana/datasources
cp /usr/share/grafana/conf/dashboards/sample.yaml /etc/grafana/dashboards/sample.yaml
cp /usr/share/grafana/conf/datasources/sample.yaml /etc/grafana/datasources/sample.yaml
fi
if [ ! -f $DATASOURCES_CFG_DIR ]; then
mkdir -p /etc/grafana/dashboards /etc/grafana/datasources
cp /usr/share/grafana/conf/dashboards/sample.yaml $DASHBOARDS_CFG_DIR/sample.yaml
cp /usr/share/grafana/conf/datasources/sample.yaml $DATASOURCES_CFG_DIR/sample.yaml
fi
# configuration files should not be modifiable by grafana user, as this can be a security issue
chown -Rh root:$GRAFANA_GROUP /etc/grafana/*
chmod 755 /etc/grafana