فهرست منبع

Merge pull request #8830 from emqx/sync-changes-from-506

Merge changes in 506 to 507
zhouzb 3 سال پیش
والد
کامیت
de418d8326

+ 11 - 3
CHANGES-5.0.md

@@ -1,16 +1,22 @@
-# 5.0.6
+# 5.0.7
 
 ## Bug fixes
 
-* Remove the needless `will_msg` field from the client API. [#8721](https://github.com/emqx/emqx/pull/8721)
+* Remove `will_msg` (not used) field from the client API. [#8721](https://github.com/emqx/emqx/pull/8721)
 * Fix `$queue` topic name error in management API return. [#8728](https://github.com/emqx/emqx/pull/8728)
-* Fix sometimes `client.connected` and `client.disconnected` could be in wrong order. [#8625](https://github.com/emqx/emqx/pull/8625)
+* Fix race condition which may cause `client.connected` and `client.disconnected` out of order. [#8625](https://github.com/emqx/emqx/pull/8625)
 * Fix quic listener default idle timeout's type. [#8826](https://github.com/emqx/emqx/pull/8826)
 
 ## Enhancements
 
 * Do not auto-populate default SSL cipher suites, so that the configs are less bloated. [#8769](https://github.com/emqx/emqx/pull/8769)
 
+# 5.0.6
+
+## Bug fixes
+
+* Upgrade Dashboard version to fix an issue where the node status was not displayed correctly. [#8771](https://github.com/emqx/emqx/pull/8771)
+
 # 5.0.5
 
 ## Bug fixes
@@ -21,11 +27,13 @@
 
 ## Enhancements
 
+* Add `bootstrap_users_file` configuration to add default Dashboard username list, which is only added when EMQX is first started.
 * The license is now copied to all nodes in the cluster when it's reloaded. [#8598](https://github.com/emqx/emqx/pull/8598)
 * Added a HTTP API to manage licenses. [#8610](https://github.com/emqx/emqx/pull/8610)
 * Updated `/nodes` API node_status from `Running/Stopped` to `running/stopped`. [#8642](https://github.com/emqx/emqx/pull/8642)
 * Improve handling of placeholder interpolation errors [#8635](https://github.com/emqx/emqx/pull/8635)
 * Better logging on unknown object IDs. [#8670](https://github.com/emqx/emqx/pull/8670)
+* The bind option support `:1883` style. [#8758](https://github.com/emqx/emqx/pull/8758)
 
 # 5.0.4
 

+ 1 - 1
Makefile

@@ -6,7 +6,7 @@ export EMQX_DEFAULT_BUILDER = ghcr.io/emqx/emqx-builder/5.0-17:1.13.4-24.2.1-1-d
 export EMQX_DEFAULT_RUNNER = debian:11-slim
 export OTP_VSN ?= $(shell $(CURDIR)/scripts/get-otp-vsn.sh)
 export ELIXIR_VSN ?= $(shell $(CURDIR)/scripts/get-elixir-vsn.sh)
-export EMQX_DASHBOARD_VERSION ?= v1.0.6
+export EMQX_DASHBOARD_VERSION ?= v1.0.7
 export EMQX_EE_DASHBOARD_VERSION ?= e1.0.0
 export EMQX_REL_FORM ?= tgz
 export QUICER_DOWNLOAD_FROM_RELEASE = 1

+ 1 - 1
apps/emqx/include/emqx_release.hrl

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

+ 1 - 1
apps/emqx/src/emqx.app.src

@@ -3,7 +3,7 @@
     {id, "emqx"},
     {description, "EMQX Core"},
     % strict semver, bump manually!
-    {vsn, "5.0.5"},
+    {vsn, "5.0.7"},
     {modules, []},
     {registered, []},
     {applications, [

+ 4 - 0
apps/emqx/src/emqx_schema.erl

@@ -2164,8 +2164,12 @@ to_bar_separated_list(Str) ->
 %%  - 127.0.0.1:1883
 %%  - ::1:1883
 %%  - [::1]:1883
+%%  - :1883
+%%  - :::1883
 to_ip_port(Str) ->
     case split_ip_port(Str) of
+        {"", Port} ->
+            {ok, {{0, 0, 0, 0}, list_to_integer(Port)}};
         {Ip, Port} ->
             PortVal = list_to_integer(Port),
             case inet:parse_address(Ip) of

+ 1 - 1
apps/emqx_authn/src/emqx_authn.app.src

@@ -1,7 +1,7 @@
 %% -*- mode: erlang -*-
 {application, emqx_authn, [
     {description, "EMQX Authentication"},
-    {vsn, "0.1.4"},
+    {vsn, "0.1.5"},
     {modules, []},
     {registered, [emqx_authn_sup, emqx_authn_registry]},
     {applications, [kernel, stdlib, emqx_resource, ehttpc, epgsql, mysql, jose]},

+ 1 - 1
apps/emqx_connector/src/emqx_connector.app.src

@@ -1,7 +1,7 @@
 %% -*- mode: erlang -*-
 {application, emqx_connector, [
     {description, "An OTP application"},
-    {vsn, "0.1.3"},
+    {vsn, "0.1.4"},
     {registered, []},
     {mod, {emqx_connector_app, []}},
     {applications, [

+ 1 - 1
apps/emqx_dashboard/i18n/emqx_dashboard_i18n.conf

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

+ 12 - 7
apps/emqx_dashboard/src/emqx_dashboard_admin.erl

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

+ 1 - 1
apps/emqx_dashboard/src/emqx_dashboard_app.erl

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

+ 2 - 1
apps/emqx_dashboard/src/emqx_dashboard_schema.erl

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

+ 1 - 1
apps/emqx_exhook/src/emqx_exhook.app.src

@@ -1,7 +1,7 @@
 %% -*- mode: erlang -*-
 {application, emqx_exhook, [
     {description, "EMQX Extension for Hook"},
-    {vsn, "5.0.2"},
+    {vsn, "5.0.3"},
     {modules, []},
     {registered, []},
     {mod, {emqx_exhook_app, []}},

+ 1 - 1
apps/emqx_exhook/src/emqx_exhook_server.erl

@@ -231,7 +231,7 @@ resolve_hookspec(HookSpecs) when is_list(HookSpecs) ->
                         end,
                     case {lists:member(Name, AvailableHooks), lists:member(Name, MessageHooks)} of
                         {false, _} ->
-                            error({unknown_hookpoint, Name});
+                            error({unknown_hookpoint, Name0});
                         {true, false} ->
                             Acc#{Name => #{}};
                         {true, true} ->

+ 1 - 1
apps/emqx_gateway/src/emqx_gateway.app.src

@@ -1,7 +1,7 @@
 %% -*- mode: erlang -*-
 {application, emqx_gateway, [
     {description, "The Gateway management application"},
-    {vsn, "0.1.3"},
+    {vsn, "0.1.4"},
     {registered, []},
     {mod, {emqx_gateway_app, []}},
     {applications, [kernel, stdlib, grpc, emqx, emqx_authn]},

+ 1 - 1
apps/emqx_management/src/emqx_management.app.src

@@ -2,7 +2,7 @@
 {application, emqx_management, [
     {description, "EMQX Management API and CLI"},
     % strict semver, bump manually!
-    {vsn, "5.0.3"},
+    {vsn, "5.0.4"},
     {modules, []},
     {registered, [emqx_management_sup]},
     {applications, [kernel, stdlib, emqx_plugins, minirest, emqx]},

+ 12 - 5
apps/emqx_management/src/emqx_mgmt_api_listeners.erl

@@ -342,11 +342,18 @@ list_listeners(get, #{query_string := Query}) ->
     {200, listener_status_by_id(NodeL)}.
 
 crud_listeners_by_id(get, #{bindings := #{id := Id0}}) ->
-    Listeners = [
-        Conf#{<<"id">> => Id, <<"type">> => Type}
-     || {Id, Type, Conf} <- emqx_listeners:list_raw(),
-        Id =:= Id0
-    ],
+    Listeners =
+        [
+            Conf#{
+                <<"id">> => Id,
+                <<"type">> => Type,
+                <<"bind">> := iolist_to_binary(
+                    emqx_listeners:format_bind(maps:get(<<"bind">>, Conf))
+                )
+            }
+         || {Id, Type, Conf} <- emqx_listeners:list_raw(),
+            Id =:= Id0
+        ],
     case Listeners of
         [] -> {404, #{code => 'BAD_LISTENER_ID', message => ?LISTENER_NOT_FOUND}};
         [L] -> {200, L}

+ 1 - 1
apps/emqx_retainer/src/emqx_retainer.app.src

@@ -2,7 +2,7 @@
 {application, emqx_retainer, [
     {description, "EMQX Retainer"},
     % strict semver, bump manually!
-    {vsn, "5.0.3"},
+    {vsn, "5.0.4"},
     {modules, []},
     {registered, [emqx_retainer_sup]},
     {applications, [kernel, stdlib, emqx]},

+ 1 - 1
lib-ee/emqx_license/src/emqx_license.app.src

@@ -1,6 +1,6 @@
 {application, emqx_license, [
     {description, "EMQX License"},
-    {vsn, "5.0.1"},
+    {vsn, "5.0.2"},
     {modules, []},
     {registered, [emqx_license_sup]},
     {applications, [kernel, stdlib]},