fix: different default plugins start between ee and ce

This commit is contained in:
zhongwencool 2022-08-11 16:45:03 +08:00
parent 5c45418a87
commit 698b1b6df6
1 changed files with 39 additions and 11 deletions

View File

@ -217,22 +217,50 @@ load_plugin_conf(AppName, PluginDir) ->
ensure_file(File) ->
case filelib:is_file(File) of
false ->
DefaultPlugins = [ {emqx_management, true}
, {emqx_dashboard, true}
, {emqx_modules, true}
, {emqx_recon, true}
, {emqx_retainer, true}
, {emqx_telemetry, true}
, {emqx_rule_engine, true}
, {emqx_bridge_mqtt, false}
, {emqx_eviction_agent, true}
, {emqx_node_rebalance, true}
],
DefaultPlugins = default_plugins(),
write_loaded(DefaultPlugins);
true ->
ok
end.
-ifndef(EMQX_ENTERPRISE).
%% default plugins see rebar.config.erl
default_plugins() ->
[
{emqx_management, true},
{emqx_dashboard, true},
%% emqx_modules is not a plugin, but a normal application starting when boots.
{emqx_modules, false},
{emqx_retainer, true},
{emqx_recon, true},
{emqx_telemetry, true},
{emqx_rule_engine, true},
{emqx_bridge_mqtt, false},
{emqx_eviction_agent, true},
{emqx_node_rebalance, true}
].
-else.
default_plugins() ->
[
{emqx_management, true},
{emqx_dashboard, true},
%% enterprise version of emqx_modules is a plugin
{emqx_modules, true},
%% retainer is managed by emqx_modules.
%% default is true in data/load_modules. **NOT HERE**
{emqx_retainer, false},
{emqx_recon, true},
{emqx_telemetry, true},
{emqx_rule_engine, true},
{emqx_bridge_mqtt, false},
{emqx_eviction_agent, true},
{emqx_node_rebalance, true}
].
-endif.
with_loaded_file(File, SuccFun) ->
case read_loaded(File) of
{ok, Names0} ->