refactor: stop creating emqx-enterprise.conf
This commit is contained in:
parent
ddd68eff22
commit
7c1b453285
2
bin/emqx
2
bin/emqx
|
@ -612,7 +612,7 @@ check_license() {
|
|||
set +x
|
||||
logerr "License not found."
|
||||
logerr "Please specify one via the EMQX_LICENSE__KEY variable"
|
||||
logerr "or via license.key in emqx-enterprise.conf."
|
||||
logerr "or via license.key in emqx.conf."
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
|
12
mix.exs
12
mix.exs
|
@ -385,7 +385,9 @@ defmodule EMQXUmbrella.MixProject do
|
|||
emqx_bridge_oracle: :permanent,
|
||||
emqx_ee_schema_registry: :permanent
|
||||
],
|
||||
else: []
|
||||
else: [
|
||||
emqx_telemetry: :permanent
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -524,14 +526,6 @@ defmodule EMQXUmbrella.MixProject do
|
|||
Path.join(etc, "emqx.conf")
|
||||
)
|
||||
|
||||
if edition_type == :enterprise do
|
||||
render_template(
|
||||
"apps/emqx_conf/etc/emqx-enterprise.conf.all",
|
||||
assigns,
|
||||
Path.join(etc, "emqx-enterprise.conf")
|
||||
)
|
||||
end
|
||||
|
||||
render_template(
|
||||
"rel/emqx_vars",
|
||||
assigns,
|
||||
|
|
|
@ -505,8 +505,8 @@ relx_overlay(ReleaseType, Edition) ->
|
|||
{copy, "bin/nodetool", "bin/nodetool-{{release_version}}"}
|
||||
] ++ etc_overlay(ReleaseType, Edition).
|
||||
|
||||
etc_overlay(ReleaseType, Edition) ->
|
||||
Templates = emqx_etc_overlay(ReleaseType, Edition),
|
||||
etc_overlay(ReleaseType, _Edition) ->
|
||||
Templates = emqx_etc_overlay(ReleaseType),
|
||||
[
|
||||
{mkdir, "etc/"},
|
||||
{copy, "{{base_dir}}/lib/emqx/etc/certs", "etc/"},
|
||||
|
@ -520,24 +520,16 @@ etc_overlay(ReleaseType, Edition) ->
|
|||
Templates
|
||||
).
|
||||
|
||||
emqx_etc_overlay(ReleaseType, Edition) ->
|
||||
emqx_etc_overlay(ReleaseType) ->
|
||||
emqx_etc_overlay_per_rel(ReleaseType) ++
|
||||
emqx_etc_overlay_per_edition(Edition) ++
|
||||
emqx_etc_overlay_common().
|
||||
emqx_etc_overlay().
|
||||
|
||||
emqx_etc_overlay_per_rel(cloud) ->
|
||||
[{"{{base_dir}}/lib/emqx/etc/vm.args.cloud", "etc/vm.args"}].
|
||||
|
||||
emqx_etc_overlay_common() ->
|
||||
[{"{{base_dir}}/lib/emqx/etc/ssl_dist.conf", "etc/ssl_dist.conf"}].
|
||||
|
||||
emqx_etc_overlay_per_edition(ce) ->
|
||||
emqx_etc_overlay() ->
|
||||
[
|
||||
{"{{base_dir}}/lib/emqx_conf/etc/emqx.conf.all", "etc/emqx.conf"}
|
||||
];
|
||||
emqx_etc_overlay_per_edition(ee) ->
|
||||
[
|
||||
{"{{base_dir}}/lib/emqx_conf/etc/emqx-enterprise.conf.all", "etc/emqx-enterprise.conf"},
|
||||
{"{{base_dir}}/lib/emqx/etc/ssl_dist.conf", "etc/ssl_dist.conf"},
|
||||
{"{{base_dir}}/lib/emqx_conf/etc/emqx.conf.all", "etc/emqx.conf"}
|
||||
].
|
||||
|
||||
|
|
|
@ -14,35 +14,15 @@
|
|||
main(_) ->
|
||||
{ok, BaseConf} = file:read_file("apps/emqx_conf/etc/emqx_conf.conf"),
|
||||
Cfgs = get_all_cfgs("apps/"),
|
||||
IsEnterprise = is_enterprise(),
|
||||
Enterprise =
|
||||
case IsEnterprise of
|
||||
false -> [];
|
||||
true -> [io_lib:nl(), "include emqx-enterprise.conf", io_lib:nl()]
|
||||
end,
|
||||
Conf = [
|
||||
merge(BaseConf, Cfgs),
|
||||
io_lib:nl(),
|
||||
Enterprise
|
||||
io_lib:nl()
|
||||
],
|
||||
ok = file:write_file("apps/emqx_conf/etc/emqx.conf.all", Conf),
|
||||
|
||||
case IsEnterprise of
|
||||
true ->
|
||||
EnterpriseCfgs = get_all_cfgs("lib-ee"),
|
||||
EnterpriseConf = merge(<<"">>, EnterpriseCfgs),
|
||||
ok = file:write_file("apps/emqx_conf/etc/emqx-enterprise.conf.all", EnterpriseConf);
|
||||
false ->
|
||||
ok
|
||||
end,
|
||||
merge_desc_files_per_lang("en"),
|
||||
%% TODO: remove this when we have zh translation moved to dashboard package
|
||||
merge_desc_files_per_lang("zh").
|
||||
|
||||
is_enterprise() ->
|
||||
Profile = os:getenv("PROFILE", "emqx"),
|
||||
nomatch =/= string:find(Profile, "enterprise").
|
||||
|
||||
merge(BaseConf, Cfgs) ->
|
||||
Confs = [BaseConf | lists:map(fun read_conf/1, Cfgs)],
|
||||
infix(lists:filter(fun(I) -> iolist_size(I) > 0 end, Confs), [io_lib:nl(), io_lib:nl()]).
|
||||
|
|
|
@ -90,5 +90,4 @@ authorization {
|
|||
]
|
||||
}
|
||||
|
||||
include emqx-enterprise.conf
|
||||
include influx-bridge.conf
|
||||
|
|
Loading…
Reference in New Issue