From 5e623c12de7dfc059679d1c6ca8a4b905a8a7119 Mon Sep 17 00:00:00 2001 From: o-fl0w Date: Wed, 12 Oct 2022 13:23:21 +0200 Subject: [PATCH] update docker-compose.yml and log use of deprecated options --- docker-compose.yml | 3 +-- internal/config/config.go | 12 ++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 628bf48..d32b96f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,8 +17,7 @@ services: #FILTERS: "frontpage" # show only scene filters from front page #ALLOW_SYNC_MARKERS: "true" - #ENABLE_GLANCE_MARKERS: "true" - #ENABLE_HEATMAP_DISPLAY: "false" + #DISABLE_HEATMAP: "true" #LOG_LEVEL: "debug" #FORCE_HTTPS: "true" \ No newline at end of file diff --git a/internal/config/config.go b/internal/config/config.go index 6eaaf22..fbc6587 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -19,6 +19,8 @@ const ( envKeyAllowSyncMarkers = "ALLOW_SYNC_MARKERS" ) +var deprecatedEnvKeys = []string{"ENABLE_GLANCE_MARKERS", "HERESPHERE_QUICK_MARKERS", "HERESPHERE_SYNC_MARKERS", "ENABLE_HEATMAP_DISPLAY"} + type Application struct { StashGraphQLUrl string StashApiKey string @@ -37,6 +39,7 @@ var once sync.Once func Get() Application { once.Do(func() { + logDeprecatedKeysInUse() cfg = Application{ StashGraphQLUrl: getEnvOrDefault(envKeyStashGraphQLUrl, "http://localhost:9999/graphql"), StashApiKey: getEnvOrDefault(envKeyStashApiKey, ""), @@ -52,6 +55,15 @@ func Get() Application { return cfg } +func logDeprecatedKeysInUse() { + for _, key := range deprecatedEnvKeys { + val, found := os.LookupEnv(key) + if found { + log.Warn().Str("key", key).Str("value", val).Msg("Deprecated/removed option found. Ignoring.") + } + } +} + func getEnvOrDefault(key string, defaultValue string) string { val, ok := os.LookupEnv(key) if !ok {