From 0b099432c5a8c6841f976a25bf39e36e13df3b08 Mon Sep 17 00:00:00 2001 From: zhongwencool Date: Fri, 24 Dec 2021 19:20:36 +0800 Subject: [PATCH 1/2] fix(conf): can't include local/overide-conf file --- apps/emqx/src/emqx_config.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/emqx/src/emqx_config.erl b/apps/emqx/src/emqx_config.erl index f3e6e1366..b2154b429 100644 --- a/apps/emqx/src/emqx_config.erl +++ b/apps/emqx/src/emqx_config.erl @@ -264,6 +264,7 @@ init_load(SchemaMod, Conf) when is_list(Conf) orelse is_binary(Conf) -> {error, Reason} -> ?SLOG(error, #{msg => failed_to_load_hocon_conf, reason => Reason, + pwd => file:get_cwd(), include_dirs => IncDir }), error(failed_to_load_hocon_conf) @@ -280,7 +281,7 @@ init_load(SchemaMod, RawConf) when is_map(RawConf) -> maps:with(RootNames, RawConfWithEnvs)). include_dirs() -> - [filename:join(emqx:data_dir(), "configs")]. + [filename:join(emqx:data_dir(), "configs") ++ "/"]. merge_envs(SchemaMod, RawConf) -> Opts = #{logger => fun(_, _) -> ok end, %% everything should have been logged already when check_config From e44f7de59643a4894ed79c8131ce4d72c3799087 Mon Sep 17 00:00:00 2001 From: zhongwencool Date: Tue, 28 Dec 2021 15:39:27 +0800 Subject: [PATCH 2/2] chore(conf): update hocon to 0.22.1 --- apps/emqx/rebar.config | 2 +- apps/emqx/src/emqx_config.erl | 2 +- rebar.config | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/emqx/rebar.config b/apps/emqx/rebar.config index 330291def..4acb5cc30 100644 --- a/apps/emqx/rebar.config +++ b/apps/emqx/rebar.config @@ -17,7 +17,7 @@ , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.9.0"}}} , {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.11.1"}}} , {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.1"}}} - , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.22.0"}}} + , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.22.1"}}} , {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}} , {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}} , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.16.0"}}} diff --git a/apps/emqx/src/emqx_config.erl b/apps/emqx/src/emqx_config.erl index b2154b429..e0e6968f3 100644 --- a/apps/emqx/src/emqx_config.erl +++ b/apps/emqx/src/emqx_config.erl @@ -281,7 +281,7 @@ init_load(SchemaMod, RawConf) when is_map(RawConf) -> maps:with(RootNames, RawConfWithEnvs)). include_dirs() -> - [filename:join(emqx:data_dir(), "configs") ++ "/"]. + [filename:join(emqx:data_dir(), "configs")]. merge_envs(SchemaMod, RawConf) -> Opts = #{logger => fun(_, _) -> ok end, %% everything should have been logged already when check_config diff --git a/rebar.config b/rebar.config index 1894d817d..64a70a467 100644 --- a/rebar.config +++ b/rebar.config @@ -65,7 +65,7 @@ , {system_monitor, {git, "https://github.com/klarna-incubator/system_monitor", {tag, "2.2.0"}}} , {getopt, "1.0.2"} , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.16.0"}}} - , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.22.0"}}} + , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.22.1"}}} , {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.4.1"}}} , {esasl, {git, "https://github.com/emqx/esasl", {tag, "0.2.0"}}} , {jose, {git, "https://github.com/potatosalad/erlang-jose", {tag, "1.11.2"}}}