From bf37d5fb9eeafd453d5ee6f353a6a7961322a820 Mon Sep 17 00:00:00 2001 From: abednarik Date: Fri, 17 Nov 2017 12:51:33 -0300 Subject: [PATCH] Add option to configure domain and root_url in grafana config --- grafana/files/grafana.ini | 4 ++-- grafana/map.jinja | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/grafana/files/grafana.ini b/grafana/files/grafana.ini index 7742a8f..4ce5f94 100644 --- a/grafana/files/grafana.ini +++ b/grafana/files/grafana.ini @@ -29,14 +29,14 @@ http_addr = {{ server.bind.address }} http_port = {{ server.bind.port }} # The public facing domain name used to access grafana from a browser -;domain = localhost +domain = {{ server.server.domain }} # Redirect to correct domain if host header does not match domain # Prevents DNS rebinding attacks ;enforce_domain = false # The full public facing url -;root_url = %(protocol)s://%(domain)s:%(http_port)s/ +root_url = {{ server.server.root_url }} # Log web requests ;router_logging = false diff --git a/grafana/map.jinja b/grafana/map.jinja index c7c4bd4..bf85245 100644 --- a/grafana/map.jinja +++ b/grafana/map.jinja @@ -11,6 +11,9 @@ Debian: data: /var/lib/grafana logs: /var/log/grafana pid_file_dir: /var/run/grafana + server: + domain: localhost + root_url: "%(protocol)s://%(domain)s:%(http_port)s/" bind: address: 0.0.0.0 port: 3000