refactor: node.config_files should be hidden as it's not configurable

this config schema exists only for app-env mapping.
users can not change it because the bootstraping config
has to be etc/emqx.conf
This commit is contained in:
Zaiming (Stone) Shi 2023-01-14 07:33:52 +01:00
parent 33be7672ad
commit 8b3ec48406
2 changed files with 10 additions and 27 deletions

View File

@ -456,19 +456,6 @@ the old dir should be deleted first.<br/>
} }
} }
node_config_files {
desc {
en: """List of configuration files that are read during startup. The order is
significant: later configuration files override the previous ones.
"""
zh: """启动时读取的配置文件列表。后面的配置文件项覆盖前面的文件。"""
}
label {
en: "Config Files"
zh: "配置文件"
}
}
node_global_gc_interval { node_global_gc_interval {
desc { desc {
en: """Periodic garbage collection interval. Set to <code>disabled</code> to have it disabled.""" en: """Periodic garbage collection interval. Set to <code>disabled</code> to have it disabled."""

View File

@ -466,9 +466,9 @@ fields("node") ->
hoconsc:array(string()), hoconsc:array(string()),
#{ #{
mapping => "emqx.config_files", mapping => "emqx.config_files",
default => undefined, hidden => true,
'readOnly' => true, required => false,
desc => ?DESC(node_config_files) 'readOnly' => true
} }
)}, )},
{"global_gc_interval", {"global_gc_interval",
@ -1037,17 +1037,13 @@ metrics_enabled(disabled) -> [].
tr_default_config_driver(Conf) -> tr_default_config_driver(Conf) ->
conf_get("rpc.driver", Conf). conf_get("rpc.driver", Conf).
tr_config_files(Conf) -> tr_config_files(_Conf) ->
case conf_get("emqx.config_files", Conf) of case os:getenv("EMQX_ETC_DIR") of
[_ | _] = Files -> false ->
Files; %% testing, or running emqx app as deps
_ -> [filename:join([code:lib_dir(emqx), "etc", "emqx.conf"])];
case os:getenv("EMQX_ETC_DIR") of Dir ->
false -> [filename:join([Dir, "emqx.conf"])]
[filename:join([code:lib_dir(emqx), "etc", "emqx.conf"])];
Dir ->
[filename:join([Dir, "emqx.conf"])]
end
end. end.
tr_cluster_override_conf_file(Conf) -> tr_cluster_override_conf_file(Conf) ->