diff --git a/apps/emqx_conf/src/emqx_conf.erl b/apps/emqx_conf/src/emqx_conf.erl index 4b7fc72cb..aaddf7c79 100644 --- a/apps/emqx_conf/src/emqx_conf.erl +++ b/apps/emqx_conf/src/emqx_conf.erl @@ -146,7 +146,8 @@ dump_schema(Dir, SchemaModule, I18nFile) -> fun(Lang) -> gen_config_md(Dir, I18nFile, SchemaModule, Lang), gen_api_schema_json(Dir, I18nFile, Lang), - gen_example_conf(filename:dirname(I18nFile), I18nFile, SchemaModule, Lang) + ExampleDir = filename:join(filename:dirname(filename:dirname(I18nFile)), "etc"), + gen_example_conf(ExampleDir, I18nFile, SchemaModule, Lang) end, [en, zh] ), diff --git a/apps/emqx_conf/test/emqx_conf_schema_tests.erl b/apps/emqx_conf/test/emqx_conf_schema_tests.erl index af70d2a94..628f69a8b 100644 --- a/apps/emqx_conf/test/emqx_conf_schema_tests.erl +++ b/apps/emqx_conf/test/emqx_conf_schema_tests.erl @@ -19,8 +19,8 @@ doc_gen_test() -> "test", "lib", "emqx_dashboard", - "etc", - "i18n.conf.all" + "priv", + "i18n.conf" ]), _ = emqx_conf:dump_schema(Dir, emqx_conf_schema, I18nFile), ok diff --git a/apps/emqx_dashboard/test/emqx_dashboard_api_test_helpers.erl b/apps/emqx_dashboard/test/emqx_dashboard_api_test_helpers.erl index eacca6aa2..6b3891ef3 100644 --- a/apps/emqx_dashboard/test/emqx_dashboard_api_test_helpers.erl +++ b/apps/emqx_dashboard/test/emqx_dashboard_api_test_helpers.erl @@ -55,9 +55,8 @@ set_default_config(DefaultUsername) -> }, emqx_config:put([dashboard], Config), I18nFile = filename:join([ - filename:dirname(code:priv_dir(emqx_dashboard)), - "etc", - "i18n.conf.all" + code:priv_dir(emqx_dashboard), + "i18n.conf" ]), application:set_env(emqx_dashboard, i18n_file, I18nFile), ok. diff --git a/build b/build index a4602c4f8..322bd486e 100755 --- a/build +++ b/build @@ -92,7 +92,7 @@ make_docs() { # shellcheck disable=SC2086 erl -noshell -pa $libs_dir1 $libs_dir2 $libs_dir3 -eval \ "Dir = filename:join([apps, emqx_dashboard, priv, www, static]), \ - I18nFile = filename:join([apps, emqx_dashboard, etc, 'i18n.conf.all']), \ + I18nFile = filename:join([apps, emqx_dashboard, priv, 'i18n.conf']), \ ok = emqx_conf:dump_schema(Dir, $SCHEMA_MODULE, I18nFile), \ halt(0)." } diff --git a/deploy/docker/Dockerfile b/deploy/docker/Dockerfile index 0fb259082..0e29fc3b1 100644 --- a/deploy/docker/Dockerfile +++ b/deploy/docker/Dockerfile @@ -49,7 +49,7 @@ VOLUME ["/opt/emqx/log", "/opt/emqx/data"] # - 8883 port for MQTT(SSL) # - 11883 port for internal MQTT/TCP # - 18083 for dashboard -# - 4370 default Erlang distrbution port +# - 4370 default Erlang distribution port # - 5369 for backplain gen_rpc EXPOSE 1883 8081 8083 8084 8883 11883 18083 4370 5369 diff --git a/lib-ee/emqx_enterprise_conf/test/emqx_enterprise_conf_schema_tests.erl b/lib-ee/emqx_enterprise_conf/test/emqx_enterprise_conf_schema_tests.erl index 94d180377..d7c4e35dd 100644 --- a/lib-ee/emqx_enterprise_conf/test/emqx_enterprise_conf_schema_tests.erl +++ b/lib-ee/emqx_enterprise_conf/test/emqx_enterprise_conf_schema_tests.erl @@ -19,8 +19,8 @@ doc_gen_test() -> "test", "lib", "emqx_dashboard", - "etc", - "i18n.conf.all" + "priv", + "i18n.conf" ]), _ = emqx_conf:dump_schema(Dir, emqx_enterprise_conf_schema, I18nFile), ok diff --git a/mix.exs b/mix.exs index 3b4a3cd54..2ab24d161 100644 --- a/mix.exs +++ b/mix.exs @@ -322,16 +322,6 @@ defmodule EMQXUmbrella.MixProject do Path.join(etc, "certs") ) - # required by emqx_dashboard - Mix.Generator.copy_file( - "apps/emqx_dashboard/etc/i18n.conf.all", - Path.join( - release.path, - "lib/emqx_dashboard-#{release.applications.emqx_dashboard[:vsn]}/priv/i18n.conf" - ), - force: overwrite? - ) - Mix.Generator.copy_file( "apps/emqx_dashboard/etc/emqx.conf.en.example", Path.join(etc, "emqx-example.conf"), diff --git a/rebar.config b/rebar.config index 496d2dd95..a46c8817a 100644 --- a/rebar.config +++ b/rebar.config @@ -1,9 +1,9 @@ %% -*- mode: erlang -*- %% This config file is the very basic config to compile emqx %% This allows emqx to be used as a dependency for other applications -%% such as emqx module/plugin develpments and tests. +%% such as emqx module/plugin developments and tests. -%% With the help of EMQ's rebar3 fork, the config is extended +%% With the help of EMQX's rebar3 fork, the config is extended %% with rebar.config.erl module. Final result is written to %% rebar.config.rendered if environment DEBUG is set. diff --git a/rebar.config.erl b/rebar.config.erl index 90440e8dd..a32495844 100644 --- a/rebar.config.erl +++ b/rebar.config.erl @@ -424,16 +424,12 @@ emqx_etc_overlay_common() -> emqx_etc_overlay_per_edition(ce) -> [ - {"{{base_dir}}/lib/emqx_conf/etc/emqx.conf.all", "etc/emqx.conf"}, - {"{{base_dir}}/lib/emqx_dashboard/etc/i18n.conf.all", - "{{base_dir}}/lib/emqx_dashboard/priv/i18n.conf"} + {"{{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_conf/etc/emqx.conf.all", "etc/emqx.conf"}, - {"{{base_dir}}/lib/emqx_dashboard/etc/i18n.conf.all", - "{{base_dir}}/lib/emqx_dashboard/priv/i18n.conf"} + {"{{base_dir}}/lib/emqx_conf/etc/emqx.conf.all", "etc/emqx.conf"} ]. get_vsn(Profile) -> diff --git a/scripts/merge-i18n.escript b/scripts/merge-i18n.escript index e32e82d0f..9f8ac91ff 100755 --- a/scripts/merge-i18n.escript +++ b/scripts/merge-i18n.escript @@ -8,7 +8,7 @@ main(_) -> Conf = [merge(BaseConf, Cfgs), io_lib:nl() ], - ok = file:write_file("apps/emqx_dashboard/etc/i18n.conf.all", Conf). + ok = file:write_file("apps/emqx_dashboard/priv/i18n.conf", Conf). merge(BaseConf, Cfgs) -> lists:foldl(