From 63281e5491d24e1a2c89646d9f067c27625dd712 Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Mon, 5 Sep 2022 15:29:04 +0800 Subject: [PATCH 1/7] feat: don't override env RUNNER_LOG_DIR in emqx_vars --- rel/emqx_vars | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rel/emqx_vars b/rel/emqx_vars index cd484a023..9498fa73d 100644 --- a/rel/emqx_vars +++ b/rel/emqx_vars @@ -7,11 +7,15 @@ REL_VSN="{{ release_version }}" ERTS_VSN="{{ erts_vsn }}" ERL_OPTS="{{ erl_opts }}" RUNNER_BIN_DIR="{{ runner_bin_dir }}" -RUNNER_LOG_DIR="{{ runner_log_dir }}" RUNNER_LIB_DIR="{{ runner_lib_dir }}" +IS_ELIXIR="${IS_ELIXIR:-{{ is_elixir }}}" + +if [ -z "${RUNNER_LOG_DIR:-}" ]; then + RUNNER_LOG_DIR="{{ runner_log_dir }}" +fi + EMQX_ETC_DIR="{{ emqx_etc_dir }}" RUNNER_USER="{{ runner_user }}" -IS_ELIXIR="${IS_ELIXIR:-{{ is_elixir }}}" SCHEMA_MOD="{{ emqx_schema_mod }}" IS_ENTERPRISE="{{ is_enterprise }}" From 6de78815695810bbbb727a51c2c7ca9fd3e3c5ae Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Mon, 5 Sep 2022 16:11:11 +0800 Subject: [PATCH 2/7] feat: remove node.etc_dir config --- CHANGES-5.0.md | 3 ++- apps/emqx_conf/etc/emqx_conf.conf | 1 - apps/emqx_conf/src/emqx_conf_schema.erl | 8 -------- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/CHANGES-5.0.md b/CHANGES-5.0.md index b29bfe4a5..b102c9702 100644 --- a/CHANGES-5.0.md +++ b/CHANGES-5.0.md @@ -7,7 +7,8 @@ ## Enhancements -* change the `/gateway` API path to plural form. [#8823](https://github.com/emqx/emqx/pull/8823) +* Change the `/gateway` API path to plural form. [#8823](https://github.com/emqx/emqx/pull/8823) +* Remove `node.etc_dir` from emqx.conf. [#8892](https://github.com/emqx/emqx/pull/8892) # 5.0.7 diff --git a/apps/emqx_conf/etc/emqx_conf.conf b/apps/emqx_conf/etc/emqx_conf.conf index 42479ac94..fe1b7ab91 100644 --- a/apps/emqx_conf/etc/emqx_conf.conf +++ b/apps/emqx_conf/etc/emqx_conf.conf @@ -12,7 +12,6 @@ node { name = "emqx@127.0.0.1" cookie = emqxsecretcookie data_dir = "{{ platform_data_dir }}" - etc_dir = "{{ platform_etc_dir }}" } log { diff --git a/apps/emqx_conf/src/emqx_conf_schema.erl b/apps/emqx_conf/src/emqx_conf_schema.erl index 1b24a0a38..8c4cddbc3 100644 --- a/apps/emqx_conf/src/emqx_conf_schema.erl +++ b/apps/emqx_conf/src/emqx_conf_schema.erl @@ -536,14 +536,6 @@ fields("node") -> desc => ?DESC(node_applications) } )}, - {"etc_dir", - sc( - string(), - #{ - desc => ?DESC(node_etc_dir), - 'readOnly' => true - } - )}, {"cluster_call", sc( ?R_REF("cluster_call"), From e35957af0b06b1593a6cdc978cae0fc191ce260c Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Mon, 5 Sep 2022 16:12:40 +0800 Subject: [PATCH 3/7] chore: add some warning to emqx_vars --- rel/emqx_vars | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rel/emqx_vars b/rel/emqx_vars index 9498fa73d..255777f9a 100644 --- a/rel/emqx_vars +++ b/rel/emqx_vars @@ -10,6 +10,8 @@ RUNNER_BIN_DIR="{{ runner_bin_dir }}" RUNNER_LIB_DIR="{{ runner_lib_dir }}" IS_ELIXIR="${IS_ELIXIR:-{{ is_elixir }}}" +## Allow users to pre-set `RUNNER_LOG_DIR` because it only affects boot commands like `start` and `console`, +## but not other commands such as `ping` and `ctl`. if [ -z "${RUNNER_LOG_DIR:-}" ]; then RUNNER_LOG_DIR="{{ runner_log_dir }}" fi From ed4e890db99f075613dff15eeb3b5a15249bc9a8 Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Mon, 5 Sep 2022 16:15:31 +0800 Subject: [PATCH 4/7] chore: bump emqx_conf to 0.1.4 --- apps/emqx_conf/src/emqx_conf.app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/emqx_conf/src/emqx_conf.app.src b/apps/emqx_conf/src/emqx_conf.app.src index 854fdac07..a8707025a 100644 --- a/apps/emqx_conf/src/emqx_conf.app.src +++ b/apps/emqx_conf/src/emqx_conf.app.src @@ -1,6 +1,6 @@ {application, emqx_conf, [ {description, "EMQX configuration management"}, - {vsn, "0.1.3"}, + {vsn, "0.1.4"}, {registered, []}, {mod, {emqx_conf_app, []}}, {applications, [kernel, stdlib]}, From 1819b7e2244f2ef0ed2a2900be01a9eeb6484a52 Mon Sep 17 00:00:00 2001 From: zhongwencool Date: Mon, 5 Sep 2022 17:34:29 +0800 Subject: [PATCH 5/7] chore: update rel/emqx_vars Co-authored-by: Zaiming (Stone) Shi --- rel/emqx_vars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rel/emqx_vars b/rel/emqx_vars index 255777f9a..58d20515a 100644 --- a/rel/emqx_vars +++ b/rel/emqx_vars @@ -12,7 +12,7 @@ IS_ELIXIR="${IS_ELIXIR:-{{ is_elixir }}}" ## Allow users to pre-set `RUNNER_LOG_DIR` because it only affects boot commands like `start` and `console`, ## but not other commands such as `ping` and `ctl`. -if [ -z "${RUNNER_LOG_DIR:-}" ]; then +RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-{{ runner_log_dir }}}" RUNNER_LOG_DIR="{{ runner_log_dir }}" fi From ade232214a0a6eed89277a8aa6ea125f179f7dca Mon Sep 17 00:00:00 2001 From: zhongwencool Date: Mon, 5 Sep 2022 17:34:54 +0800 Subject: [PATCH 6/7] chore: update CHANGES-5.0.md Co-authored-by: Zaiming (Stone) Shi --- CHANGES-5.0.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES-5.0.md b/CHANGES-5.0.md index b102c9702..725add9c8 100644 --- a/CHANGES-5.0.md +++ b/CHANGES-5.0.md @@ -8,7 +8,8 @@ ## Enhancements * Change the `/gateway` API path to plural form. [#8823](https://github.com/emqx/emqx/pull/8823) -* Remove `node.etc_dir` from emqx.conf. [#8892](https://github.com/emqx/emqx/pull/8892) +* Remove `node.etc_dir` from emqx.conf, because it is never used. + Also allow user to customize the logging directory [#8892](https://github.com/emqx/emqx/pull/8892) # 5.0.7 From 29f9258595266fc2b0737400abc1226d453cd9c4 Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Mon, 5 Sep 2022 17:36:35 +0800 Subject: [PATCH 7/7] chore: update RUNNER_LOG_DIR --- rel/emqx_vars | 2 -- 1 file changed, 2 deletions(-) diff --git a/rel/emqx_vars b/rel/emqx_vars index 58d20515a..27de79e0d 100644 --- a/rel/emqx_vars +++ b/rel/emqx_vars @@ -13,8 +13,6 @@ IS_ELIXIR="${IS_ELIXIR:-{{ is_elixir }}}" ## Allow users to pre-set `RUNNER_LOG_DIR` because it only affects boot commands like `start` and `console`, ## but not other commands such as `ping` and `ctl`. RUNNER_LOG_DIR="${RUNNER_LOG_DIR:-{{ runner_log_dir }}}" - RUNNER_LOG_DIR="{{ runner_log_dir }}" -fi EMQX_ETC_DIR="{{ emqx_etc_dir }}" RUNNER_USER="{{ runner_user }}"