From 093c901afa6e6e303e75538944936b96f754133a Mon Sep 17 00:00:00 2001 From: Andreas Gerstmayr Date: Fri, 22 Jan 2021 12:41:42 +0100 Subject: [PATCH] updates for Grafana 7.3.6-2 build - change working dir to $GRAFANA_HOME in grafana-cli wrapper (fixes Red Hat BZ #1916083) - add pcp-redis-datasource to allow_loading_unsigned_plugins config option --- 001-wrappers-grafana-cli.patch | 4 +++- distro-defaults.ini | 2 +- grafana.spec | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/001-wrappers-grafana-cli.patch b/001-wrappers-grafana-cli.patch index fb3d2cc..722d61f 100644 --- a/001-wrappers-grafana-cli.patch +++ b/001-wrappers-grafana-cli.patch @@ -32,14 +32,16 @@ index 9cad151c0d..a786edc596 100755 if [ -f "$DEFAULT" ]; then . "$DEFAULT" fi -@@ -36,4 +38,11 @@ OPTS="--homepath=${GRAFANA_HOME} \ +@@ -36,4 +38,13 @@ OPTS="--homepath=${GRAFANA_HOME} \ cfg:default.paths.logs=${LOG_DIR} \ cfg:default.paths.plugins=${PLUGINS_DIR}'" -eval $EXECUTABLE "$OPTS" "$@" +if [ "$(id -u)" -eq 0 ]; then ++ cd "${GRAFANA_HOME}" + exec runuser -u "${GRAFANA_USER}" -- "$EXECUTABLE" "$OPTS" "$@" +elif [ "$(id -u -n)" = "${GRAFANA_USER}" ]; then ++ cd "${GRAFANA_HOME}" + exec "$EXECUTABLE" "$OPTS" "$@" +else + echo "Please run this script as user \"${GRAFANA_USER}\" or root." diff --git a/distro-defaults.ini b/distro-defaults.ini index 62b1f3a..d925297 100644 --- a/distro-defaults.ini +++ b/distro-defaults.ini @@ -769,7 +769,7 @@ disable_sanitize_html = false enable_alpha = false app_tls_skip_verify_insecure = false # Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature. -allow_loading_unsigned_plugins = +allow_loading_unsigned_plugins = pcp-redis-datasource marketplace_url = https://grafana.com/grafana/plugins/ #################################### Grafana Image Renderer Plugin ########################## diff --git a/grafana.spec b/grafana.spec index 576add7..da4c016 100644 --- a/grafana.spec +++ b/grafana.spec @@ -23,7 +23,7 @@ end} Name: grafana Version: 7.3.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Metrics dashboard and graph editor License: ASL 2.0 URL: https://grafana.org @@ -623,6 +623,10 @@ export TZ=GMT %changelog +* Fri Jan 22 2021 Andreas Gerstmayr 7.3.6-2 +- change working dir to $GRAFANA_HOME in grafana-cli wrapper (fixes Red Hat BZ #1916083) +- add pcp-redis-datasource to allow_loading_unsigned_plugins config option + * Mon Dec 21 2020 Andreas Gerstmayr 7.3.6-1 - update to 7.3.6 tagged upstream community sources, see CHANGELOG - remove dependency on SAML (not supported in the open source version of Grafana)