Merge pull request #8740 from lafirest/fix/bootstrap_user_file_5.0.5
fix(dashboard): change `bootstrap_user` to `bootstrap_user_file`
This commit is contained in:
commit
bf452113a1
|
@ -197,7 +197,7 @@ its own from which a browser should permit loading resources."""
|
||||||
zh: "多语言支持"
|
zh: "多语言支持"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bootstrap_user {
|
bootstrap_user_file {
|
||||||
desc {
|
desc {
|
||||||
en: "Initialize users file."
|
en: "Initialize users file."
|
||||||
zh: "初始化用户文件"
|
zh: "初始化用户文件"
|
||||||
|
|
|
@ -87,7 +87,7 @@ add_default_user() ->
|
||||||
|
|
||||||
-spec add_bootstrap_user() -> ok | {error, _}.
|
-spec add_bootstrap_user() -> ok | {error, _}.
|
||||||
add_bootstrap_user() ->
|
add_bootstrap_user() ->
|
||||||
case emqx:get_config([dashboard, bootstrap_user], undefined) of
|
case emqx:get_config([dashboard, bootstrap_user_file], undefined) of
|
||||||
undefined ->
|
undefined ->
|
||||||
ok;
|
ok;
|
||||||
File ->
|
File ->
|
||||||
|
@ -324,7 +324,12 @@ add_bootstrap_user(File) ->
|
||||||
after
|
after
|
||||||
file:close(Dev)
|
file:close(Dev)
|
||||||
end;
|
end;
|
||||||
Error ->
|
{error, Reason} = Error ->
|
||||||
|
?SLOG(error, #{
|
||||||
|
msg => "failed to open the dashboard bootstrap users file",
|
||||||
|
file => File,
|
||||||
|
reason => Reason
|
||||||
|
}),
|
||||||
Error
|
Error
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
|
@ -55,7 +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, ?HOCON(binary(), #{desc => ?DESC(bootstrap_user), required => false})}
|
{bootstrap_user_file,
|
||||||
|
?HOCON(binary(), #{desc => ?DESC(bootstrap_user_file), required => false})}
|
||||||
];
|
];
|
||||||
fields("listeners") ->
|
fields("listeners") ->
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue