From 0a9f3b827d4e41038a7621199ee790812d4758c3 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Wed, 13 Dec 2023 20:50:43 +0100 Subject: Configure Grafana to be run behind a reverse proxy --- tw/services/grafana.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tw/services/grafana.scm') diff --git a/tw/services/grafana.scm b/tw/services/grafana.scm index 2fdb9695..051aa72b 100644 --- a/tw/services/grafana.scm +++ b/tw/services/grafana.scm @@ -42,12 +42,13 @@ variables.")) (shell (file-append shadow "/sbin/nologin"))))) (define (grafana-environment config) - (match-record config (bind-address host-port) - (mixed-text-file "grafana.env" "\ + (match-record config (domain bind-address host-port) + (plain-file "grafana.env" (string-append "\ # https://grafana.com/docs/grafana/latest/setup-grafana/configure-docker/ GF_SERVER_PROTOCOL=http +GF_SERVER_DOMAIN=" domain " GF_SERVER_HTTP_ADDR=" bind-address " -GF_SERVER_HTTP_PORT=" host-port " +GF_SERVER_HTTP_PORT=" (number->string host-port) " # gzip compression is recommended by docs, but is not the default GF_SERVER_ENABLE_GZIP=true GF_ANALYTICS_REPORTING_ENABLED=false @@ -59,7 +60,7 @@ GF_SNAPSHOTS_ENABLED=false GF_DATE_FORMATS_INTERVAL_HOUR=DD.MM. HH:mm GF_DATE_FORMATS_INTERVAL_DAY=DD.MM. # TODO: https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#smtp -"))) +")))) (define (grafana-docker-service config) (match-record config (container data-path metrics-credentials-file) -- cgit v1.2.3