From 56bc4d111d31ae511056f52ee677f7837c7042a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Kut=C3=BD?= <6du1ro.n@gmail.com> Date: Mon, 3 Mar 2014 19:01:04 +0100 Subject: [PATCH] some config changes --- conf/config.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) mode change 100644 => 100755 conf/config.js diff --git a/conf/config.js b/conf/config.js old mode 100644 new mode 100755 index 8bbe65b..3c24257 --- a/conf/config.js +++ b/conf/config.js @@ -13,7 +13,7 @@ function (Settings) { * elasticsearch url: * For Basic authentication use: http://username:password@domain.com:9200 */ - elasticsearch: "http://{{ pillar.grafana.server.elasticsearch.host }}:{{ pillar.grafana.server.elasticsearch.port }}", + elasticsearch: "http://{{ salt['pillar.get']('grafana:server:elasticsearch:host', "") }}:{{ salt['pillar.get']('grafana:server:elasticsearch:port', 9200) }}", /** * graphite-web url: @@ -22,7 +22,15 @@ function (Settings) { * in nginx or apache for cross origin domain sharing to work (CORS). * Check install documentation on github */ - graphiteUrl: "http://"+window.location.hostname+":8080", + {% set data = pillar.grafana.server.data %} + + {% if data.get("type", "") == "graphite" %} + {% if data.get("ssl", "false") %} + graphiteUrl: "https://"+{{ data.get("host", "") }}+":{{ data.get("port", 443) }}", + {% else %} + graphiteUrl: "http://"+{{ data.get("host", "") }}+":{{ data.get("port", 80) }}", + {% endif %} + {% endif %} /** * Multiple graphite servers? Comment out graphiteUrl and replace with