Merge pull request #8760 from emqx/bump-vsn

Release 5.0.5: bump vsn
This commit is contained in:
JianBo He 2022-08-19 15:51:44 +08:00 committed by GitHub
commit 0252325386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 11 deletions

View File

@ -32,7 +32,7 @@
%% `apps/emqx/src/bpapi/README.md' %% `apps/emqx/src/bpapi/README.md'
%% Community edition %% Community edition
-define(EMQX_RELEASE_CE, "5.0.5-beta.1"). -define(EMQX_RELEASE_CE, "5.0.5").
%% Enterprise edition %% Enterprise edition
-define(EMQX_RELEASE_EE, "5.0.0-alpha.1"). -define(EMQX_RELEASE_EE, "5.0.0-alpha.1").

View File

@ -197,7 +197,7 @@ its own from which a browser should permit loading resources."""
zh: "多语言支持" zh: "多语言支持"
} }
} }
bootstrap_user_file { bootstrap_users_file {
desc { desc {
en: "Initialize users file." en: "Initialize users file."
zh: "初始化用户文件" zh: "初始化用户文件"

View File

@ -52,7 +52,7 @@
-export([ -export([
add_default_user/0, add_default_user/0,
default_username/0, default_username/0,
add_bootstrap_user/0 add_bootstrap_users/0
]). ]).
-type emqx_admin() :: #?ADMIN{}. -type emqx_admin() :: #?ADMIN{}.
@ -85,16 +85,16 @@ mnesia(boot) ->
add_default_user() -> add_default_user() ->
add_default_user(binenv(default_username), binenv(default_password)). add_default_user(binenv(default_username), binenv(default_password)).
-spec add_bootstrap_user() -> ok | {error, _}. -spec add_bootstrap_users() -> ok | {error, _}.
add_bootstrap_user() -> add_bootstrap_users() ->
case emqx:get_config([dashboard, bootstrap_user_file], undefined) of case emqx:get_config([dashboard, bootstrap_users_file], undefined) of
undefined -> undefined ->
ok; ok;
File -> File ->
case mnesia:table_info(?ADMIN, size) of case mnesia:table_info(?ADMIN, size) of
0 -> 0 ->
?SLOG(debug, #{msg => "Add dashboard bootstrap users", file => File}), ?SLOG(debug, #{msg => "Add dashboard bootstrap users", file => File}),
add_bootstrap_user(File); add_bootstrap_users(File);
_ -> _ ->
ok ok
end end
@ -312,7 +312,7 @@ add_default_user(Username, Password) ->
_ -> {ok, default_user_exists} _ -> {ok, default_user_exists}
end. end.
add_bootstrap_user(File) -> add_bootstrap_users(File) ->
case file:open(File, [read]) of case file:open(File, [read]) of
{ok, Dev} -> {ok, Dev} ->
{ok, MP} = re:compile(<<"(\.+):(\.+$)">>, [ungreedy]), {ok, MP} = re:compile(<<"(\.+):(\.+$)">>, [ungreedy]),

View File

@ -31,7 +31,7 @@ start(_StartType, _StartArgs) ->
case emqx_dashboard:start_listeners() of case emqx_dashboard:start_listeners() of
ok -> ok ->
emqx_dashboard_cli:load(), emqx_dashboard_cli:load(),
case emqx_dashboard_admin:add_bootstrap_user() of case emqx_dashboard_admin:add_bootstrap_users() of
ok -> ok ->
{ok, _} = emqx_dashboard_admin:add_default_user(), {ok, _} = emqx_dashboard_admin:add_default_user(),
{ok, Sup}; {ok, Sup};

View File

@ -55,8 +55,8 @@ fields("dashboard") ->
)}, )},
{cors, fun cors/1}, {cors, fun cors/1},
{i18n_lang, fun i18n_lang/1}, {i18n_lang, fun i18n_lang/1},
{bootstrap_user_file, {bootstrap_users_file,
?HOCON(binary(), #{desc => ?DESC(bootstrap_user_file), required => false})} ?HOCON(binary(), #{desc => ?DESC(bootstrap_users_file), required => false})}
]; ];
fields("listeners") -> fields("listeners") ->
[ [