From bde5d11078b41fc63757a47625b0eb3688c6a581 Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Sun, 13 Jun 2021 21:04:33 +0200 Subject: [PATCH] fix(hocon): call new schema definition functions --- apps/emqx/src/emqx_schema.erl | 18 ++++++++---------- apps/emqx_dashboard/priv/emqx_dashboard.schema | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/emqx/src/emqx_schema.erl b/apps/emqx/src/emqx_schema.erl index 3fb60a6a6..3d2242aa7 100644 --- a/apps/emqx/src/emqx_schema.erl +++ b/apps/emqx/src/emqx_schema.erl @@ -1180,18 +1180,16 @@ ceiling(X) -> %% types -t(T) -> - fun (type) -> T; (_) -> undefined end. +t(Type) -> hoconsc:t(Type). -t(T, M, D) -> - fun (type) -> T; (mapping) -> M; (default) -> D; (_) -> undefined end. +t(Type, Mapping, Default) -> + hoconsc:t(Type, #{mapping => Mapping, default => Default}). -t(T, M, D, O) -> - fun (type) -> T; - (mapping) -> M; - (default) -> D; - (override_env) -> O; - (_) -> undefined end. +t(Type, Mapping, Default, OverrideEnv) -> + hoconsc:t(Type, #{ mapping => Mapping + , default => Default + , override_env => OverrideEnv + }). ref(Field) -> fun (type) -> Field; (_) -> undefined end. diff --git a/apps/emqx_dashboard/priv/emqx_dashboard.schema b/apps/emqx_dashboard/priv/emqx_dashboard.schema index d485ecdf9..203bb7358 100644 --- a/apps/emqx_dashboard/priv/emqx_dashboard.schema +++ b/apps/emqx_dashboard/priv/emqx_dashboard.schema @@ -7,7 +7,7 @@ {mapping, "dashboard.default_user.password", "emqx_dashboard.default_user_passwd", [ {datatype, string}, - {override_env, "ADMIN_PASSWORD"} + {override_env, "EMQX_ADMIN_PASSWORD"} ]}. {mapping, "dashboard.listener.http.port", "emqx_dashboard.listeners", [