diff --git a/src/llar/apis/dashboard.clj b/src/llar/apis/dashboard.clj index 8eba1bb..db1c8f4 100644 --- a/src/llar/apis/dashboard.clj +++ b/src/llar/apis/dashboard.clj @@ -10,7 +10,8 @@ [java-time :as time] [mount.core :as mount] [puget.printer :as puget] - [llar.apis.reader :refer [frontend-db] :as reader] + [llar.apis.reader :refer [frontend-db map-to-tree] :as reader] + [llar.appconfig :refer [appconfig-redact-secrets]] [llar.config :as config] [llar.human :as human] [llar.live :as live] @@ -277,6 +278,12 @@ [:td chime-times] [:td (pprint-html pred)]])]]))) +(defn config-tab [] + (html + [:h2 "Home"] + [:div [:h3 "Application Config"] + (map-to-tree (appconfig-redact-secrets))])) + (def tabs {:sources #'source-tab :memory #'memory-tab @@ -284,7 +291,8 @@ :schedules #'schedule-tab :state #'state-tab :metrics #'metrics-tab - :threads #'thread-tab}) + :threads #'thread-tab + :config #'config-tab}) (defn status-index [] (wrap-body diff --git a/src/llar/appconfig.clj b/src/llar/appconfig.clj index 781ec2f..efa1d92 100644 --- a/src/llar/appconfig.clj +++ b/src/llar/appconfig.clj @@ -71,6 +71,11 @@ (defstate appconfig :start (read-config)) +(defn appconfig-redact-secrets [] + (-> appconfig + (assoc-in [:postgresql :frontend :password] "--secret removed--") + (assoc-in [:postgresql :backend :password] "--secret removed--"))) + (defn update-max-retry [] (get appconfig :update-max-retry)) diff --git a/src/llar/config.clj b/src/llar/config.clj index d2c551e..24fdfc4 100644 --- a/src/llar/config.clj +++ b/src/llar/config.clj @@ -224,7 +224,6 @@ (load-config (get-config-files))) (defn start-watcher [] - ;; (log/info (get appconfig :runtime-config-dir) (mount/running-states)) (beholder/watch handle-config-dir-change (get appconfig :runtime-config-dir))) (defstate change-watcher