From 769374f8a5814d3ecf9154bff21448161d6ab4a9 Mon Sep 17 00:00:00 2001 From: firest Date: Thu, 1 Sep 2022 17:24:45 +0800 Subject: [PATCH 01/26] chore: update CHANGES-4.3.md --- CHANGES-4.3.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index 9774e305a..26e7075e2 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -15,6 +15,8 @@ File format: ### Bug fixes - Fix rule-engine update behaviour which may initialize actions for disabled rules. [#8849](https://github.com/emqx/emqx/pull/8849) +- Fix JWT plugin don't support non-integer timestamp claims. [#8862](https://github.com/emqx/emqx/pull/8862) + ## v4.3.19 From d5494897c7e043d5cf2d17e6c2003109b3d31f27 Mon Sep 17 00:00:00 2001 From: firest Date: Tue, 6 Sep 2022 11:51:39 +0800 Subject: [PATCH 02/26] fix(jwt): make jwt support float timestamp claims --- apps/emqx_auth_jwt/src/emqx_auth_jwt.erl | 2 +- apps/emqx_auth_jwt/src/emqx_auth_jwt_svr.erl | 10 ++++---- .../test/emqx_auth_jwt_SUITE.erl | 24 +++++++++++++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/apps/emqx_auth_jwt/src/emqx_auth_jwt.erl b/apps/emqx_auth_jwt/src/emqx_auth_jwt.erl index acf367c56..1259bd263 100644 --- a/apps/emqx_auth_jwt/src/emqx_auth_jwt.erl +++ b/apps/emqx_auth_jwt/src/emqx_auth_jwt.erl @@ -80,7 +80,7 @@ is_expired(Exp) when is_binary(Exp) -> ?DEBUG("acl_deny_due_to_invalid_jwt_exp:~p", [Exp]), true end; -is_expired(Exp) when is_integer(Exp) -> +is_expired(Exp) when is_number(Exp) -> Now = erlang:system_time(second), Now > Exp; is_expired(Exp) -> diff --git a/apps/emqx_auth_jwt/src/emqx_auth_jwt_svr.erl b/apps/emqx_auth_jwt/src/emqx_auth_jwt_svr.erl index 0f09be22e..3a5c619aa 100644 --- a/apps/emqx_auth_jwt/src/emqx_auth_jwt_svr.erl +++ b/apps/emqx_auth_jwt/src/emqx_auth_jwt_svr.erl @@ -201,19 +201,19 @@ do_verify(JwsCompacted, [Jwk|More]) -> check_claims(Claims) -> Now = os:system_time(seconds), - Checker = [{<<"exp">>, with_int_value( + Checker = [{<<"exp">>, with_num_value( fun(ExpireTime) -> Now < ExpireTime end)}, - {<<"iat">>, with_int_value( + {<<"iat">>, with_num_value( fun(IssueAt) -> IssueAt =< Now end)}, - {<<"nbf">>, with_int_value( + {<<"nbf">>, with_num_value( fun(NotBefore) -> NotBefore =< Now end)} ], do_check_claim(Checker, Claims). -with_int_value(Fun) -> +with_num_value(Fun) -> fun(Value) -> case Value of - Int when is_integer(Int) -> Fun(Int); + Num when is_number(Num) -> Fun(Num); Bin when is_binary(Bin) -> case emqx_auth_jwt:string_to_number(Bin) of {ok, Num} -> Fun(Num); diff --git a/apps/emqx_auth_jwt/test/emqx_auth_jwt_SUITE.erl b/apps/emqx_auth_jwt/test/emqx_auth_jwt_SUITE.erl index 934d80f41..596b829a6 100644 --- a/apps/emqx_auth_jwt/test/emqx_auth_jwt_SUITE.erl +++ b/apps/emqx_auth_jwt/test/emqx_auth_jwt_SUITE.erl @@ -177,6 +177,30 @@ t_check_auth_str_exp(_Config) -> ct:pal("Auth result: ~p~n", [Result2]), ?assertMatch({ok, #{auth_result := success, jwt_claims := _}}, Result2). +t_check_auth_float_exp(init, _Config) -> + application:unset_env(emqx_auth_jwt, verify_claims). +t_check_auth_float_exp(_Config) -> + Plain = #{clientid => <<"client1">>, username => <<"plain">>, zone => external}, + Exp = os:system_time(seconds) + 3.5, + + Jwt0 = sign([{clientid, <<"client1">>}, + {username, <<"plain">>}, + {exp, Exp}], <<"HS256">>, <<"emqxsecret">>), + ct:pal("Jwt: ~p~n", [Jwt0]), + + Result0 = emqx_access_control:authenticate(Plain#{password => Jwt0}), + ct:pal("Auth result: ~p~n", [Result0]), + ?assertMatch({ok, #{auth_result := success, jwt_claims := _}}, Result0), + + Jwt1 = sign([{clientid, <<"client1">>}, + {username, <<"plain">>}, + {exp, 1.5}], <<"HS256">>, <<"emqxsecret">>), + ct:pal("Jwt: ~p~n", [Jwt1]), + + Result1 = emqx_access_control:authenticate(Plain#{password => Jwt1}), + ct:pal("Auth result: ~p~n", [Result1]), + ?assertMatch({error, _}, Result1). + t_check_claims(init, _Config) -> application:set_env(emqx_auth_jwt, verify_claims, [{sub, <<"value">>}]). t_check_claims(_Config) -> From 8ec432481d93441444ab6478b51e1307153f8e76 Mon Sep 17 00:00:00 2001 From: JianBo He Date: Wed, 7 Sep 2022 17:03:41 +0800 Subject: [PATCH 03/26] fix(shared-sub): fix dead loop if all subscribers are disconected In `broker.shared_dispatch_ack_enabled=true`, if all subscribers seesion are kept and but connnection gone. the subscribers will reply NACKs if someone shared delivers reached. However, the shared subscription always pick a subscriber to retry, even if it has already replied with NACKs. After this PR, the subscriber replies with an ACK and stores it into mqueue, instead of replying with a NACK --- src/emqx_channel.erl | 31 +++++++++++++++++++++---------- src/emqx_shared_sub.erl | 15 ++++++++++++++- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/emqx_channel.erl b/src/emqx_channel.erl index 939be4270..c49299c58 100644 --- a/src/emqx_channel.erl +++ b/src/emqx_channel.erl @@ -735,8 +735,8 @@ handle_deliver(Delivers, Channel = #channel{ %% NOTE: Order is important here. While the takeover is in %% progress, the session cannot enqueue messages, since it already %% passed on the queue to the new connection in the session state. - NPendings = lists:append(Pendings, - ignore_local(ClientInfo, maybe_nack(Delivers), ClientId, Session)), + NDelivers = ignore_local(ClientInfo, maybe_discard_shared_delivers(Delivers), ClientId, Session), + NPendings = lists:append(Pendings, NDelivers), {ok, Channel#channel{pendings = NPendings}}; handle_deliver(Delivers, Channel = #channel{ @@ -744,8 +744,8 @@ handle_deliver(Delivers, Channel = #channel{ takeover = false, session = Session, clientinfo = #{clientid := ClientId} = ClientInfo}) -> - NSession = emqx_session:enqueue(ClientInfo, - ignore_local(ClientInfo, maybe_nack(Delivers), ClientId, Session), Session), + NDelivers = ignore_local(ClientInfo, maybe_discard_shared_delivers(Delivers), ClientId, Session), + NSession = emqx_session:enqueue(ClientInfo, NDelivers, Session), {ok, Channel#channel{session = NSession}}; handle_deliver(Delivers, Channel = #channel{ @@ -776,12 +776,23 @@ ignore_local(ClientInfo, Delivers, Subscriber, Session) -> end, Delivers). %% Nack delivers from shared subscription -maybe_nack(Delivers) -> - lists:filter(fun not_nacked/1, Delivers). - -not_nacked({deliver, _Topic, Msg}) -> - not (emqx_shared_sub:is_ack_required(Msg) - andalso (ok == emqx_shared_sub:nack_no_connection(Msg))). +maybe_discard_shared_delivers(Delivers) -> + lists:filtermap( + fun({deliver, Topic, Msg}) -> + case emqx_shared_sub:is_ack_required(Msg) of + false -> + true; + true -> + case emqx_shared_sub:is_retry_dispatch(Msg) of + true -> + %% force enqueue the retried shared deliver + {true, {deliver, Topic, emqx_shared_sub:maybe_ack(Msg)}}; + false -> + ok = emqx_shared_sub:nack_no_connection(Msg), + false + end + end + end, Delivers). %%-------------------------------------------------------------------- %% Handle outgoing packet diff --git a/src/emqx_shared_sub.erl b/src/emqx_shared_sub.erl index 337d63d15..3b533d9d3 100644 --- a/src/emqx_shared_sub.erl +++ b/src/emqx_shared_sub.erl @@ -46,6 +46,7 @@ , maybe_nack_dropped/1 , nack_no_connection/1 , is_ack_required/1 + , is_retry_dispatch/1 , get_group/1 ]). @@ -239,6 +240,13 @@ get_group(Msg) -> -spec(is_ack_required(emqx_types:message()) -> boolean()). is_ack_required(Msg) -> ?NO_ACK =/= get_group_ack(Msg). +-spec(is_retry_dispatch(emqx_types:message()) -> boolean()). +is_retry_dispatch(Msg) -> + case get_group_ack(Msg) of + {_Sender, {retry, _Group, _Ref}} -> true; + _ -> false + end. + %% @doc Negative ack dropped message due to inflight window or message queue being full. -spec(maybe_nack_dropped(emqx_types:message()) -> store | drop). maybe_nack_dropped(Msg) -> @@ -280,10 +288,15 @@ maybe_ack(Msg) -> Msg; Ack -> {Sender, Ref} = fetch_sender_ref(Ack), - Sender ! {Ref, ?ACK}, + ack(Sender, Ref), without_group_ack(Msg) end. +-spec(ack(pid(), reference()) -> ok). +ack(Sender, Ref) -> + Sender ! {Ref, ?ACK}, + ok. + fetch_sender_ref({Sender, {_Type, _Group, Ref}}) -> {Sender, Ref}; %% These clauses are for backward compatibility fetch_sender_ref({Sender, Ref}) -> {Sender, Ref}. From 4f81a493912948761d49de8a54417a55a1616292 Mon Sep 17 00:00:00 2001 From: zhongwencool Date: Wed, 7 Sep 2022 17:28:30 +0800 Subject: [PATCH 04/26] feat: dashboard support bind with specific ip --- CHANGES-4.3.md | 1 + lib-ce/emqx_dashboard/priv/emqx_dashboard.schema | 4 ++-- lib-ce/emqx_dashboard/src/emqx_dashboard.erl | 11 +++++++++-- lib-ce/emqx_dashboard/test/emqx_dashboard_SUITE.erl | 7 ++++++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index 26e7075e2..aa250b7ad 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -16,6 +16,7 @@ File format: - Fix rule-engine update behaviour which may initialize actions for disabled rules. [#8849](https://github.com/emqx/emqx/pull/8849) - Fix JWT plugin don't support non-integer timestamp claims. [#8862](https://github.com/emqx/emqx/pull/8862) +- Fix dashboard binding IP address not working. [#8916](https://github.com/emqx/emqx/pull/8916) ## v4.3.19 diff --git a/lib-ce/emqx_dashboard/priv/emqx_dashboard.schema b/lib-ce/emqx_dashboard/priv/emqx_dashboard.schema index 43093c3ba..7ef39ac8d 100644 --- a/lib-ce/emqx_dashboard/priv/emqx_dashboard.schema +++ b/lib-ce/emqx_dashboard/priv/emqx_dashboard.schema @@ -11,7 +11,7 @@ ]}. {mapping, "dashboard.listener.http", "emqx_dashboard.listeners", [ - {datatype, integer} + {datatype, [integer, ip]} ]}. {mapping, "dashboard.listener.http.acceptors", "emqx_dashboard.listeners", [ @@ -39,7 +39,7 @@ ]}. {mapping, "dashboard.listener.https", "emqx_dashboard.listeners", [ - {datatype, integer} + {datatype, [integer, ip]} ]}. {mapping, "dashboard.listener.https.acceptors", "emqx_dashboard.listeners", [ diff --git a/lib-ce/emqx_dashboard/src/emqx_dashboard.erl b/lib-ce/emqx_dashboard/src/emqx_dashboard.erl index c4a774072..d88bd0da9 100644 --- a/lib-ce/emqx_dashboard/src/emqx_dashboard.erl +++ b/lib-ce/emqx_dashboard/src/emqx_dashboard.erl @@ -54,7 +54,8 @@ start_listener({Proto, Port, Options}) when Proto == https -> {"/api/v4/[...]", minirest, http_handlers()}], minirest:start_https(listener_name(Proto), ranch_opts(Port, Options), Dispatch). -ranch_opts(Port, Options0) -> +ranch_opts(Bind, Options0) -> + IpPort = ip_port(Bind), NumAcceptors = get_value(num_acceptors, Options0, 4), MaxConnections = get_value(max_connections, Options0, 512), Options = lists:foldl(fun({K, _V}, Acc) when K =:= max_connections orelse K =:= num_acceptors -> @@ -68,7 +69,13 @@ ranch_opts(Port, Options0) -> end, [], Options0), #{num_acceptors => NumAcceptors, max_connections => MaxConnections, - socket_opts => [{port, Port} | Options]}. + socket_opts => IpPort ++ Options}. + +ip_port({IpStr, Port}) -> + {ok, Ip} = inet:parse_address(IpStr), + [{ip, Ip}, {port, Port}]; +ip_port(Port) when is_integer(Port) -> + [{port, Port}]. stop_listeners() -> lists:foreach(fun(Listener) -> stop_listener(Listener) end, listeners()). diff --git a/lib-ce/emqx_dashboard/test/emqx_dashboard_SUITE.erl b/lib-ce/emqx_dashboard/test/emqx_dashboard_SUITE.erl index 778cb7731..b1a8c0194 100644 --- a/lib-ce/emqx_dashboard/test/emqx_dashboard_SUITE.erl +++ b/lib-ce/emqx_dashboard/test/emqx_dashboard_SUITE.erl @@ -326,7 +326,12 @@ setup_node(Node, Apps) -> application:set_env(emqx_management, listeners, []), ok; (emqx_dashboard) -> - application:set_env(emqx_dashboard, listeners, []), + Options = [{http,{"127.0.0.1",18184}, + [{num_acceptors,4}, + {max_connections,512}, + {inet6,false}, + {ipv6_v6only,false}]}], + application:set_env(emqx_dashboard, listeners, Options), ok; (_) -> ok From ecae9b5d405e4add76ba6bb6df4f656ef49f6f8c Mon Sep 17 00:00:00 2001 From: JianBo He Date: Thu, 8 Sep 2022 09:46:08 +0800 Subject: [PATCH 05/26] chore: update appup.src --- src/emqx.appup.src | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/emqx.appup.src b/src/emqx.appup.src index 682da8bf6..de5cf7fe0 100644 --- a/src/emqx.appup.src +++ b/src/emqx.appup.src @@ -2,18 +2,22 @@ %% Unless you know what you are doing, DO NOT edit manually!! {VSN, [{"4.3.20", - [{load_module,emqx_app,brutal_purge,soft_purge,[]}, + [{load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_channel,brutal_purge,soft_purge,[]}, + {load_module,emqx_app,brutal_purge,soft_purge,[]}, {load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}]}, {"4.3.19", - [{load_module,emqx_message,brutal_purge,soft_purge,[]}, + [{load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_app,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, {load_module,emqx_plugins,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}]}, {"4.3.18", - [{load_module,emqx_message,brutal_purge,soft_purge,[]}, + [{load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}, @@ -23,11 +27,11 @@ [{load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, + {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx,brutal_purge,soft_purge,[]}, {load_module,emqx_exclusive_subscription,brutal_purge,soft_purge,[]}, {load_module,emqx_session,brutal_purge,soft_purge,[]}, - {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {update,emqx_broker_sup,supervisor}, {load_module,emqx_app,brutal_purge,soft_purge,[]}, {load_module,emqx_plugins,brutal_purge,soft_purge,[]}, @@ -94,12 +98,12 @@ {load_module,emqx_packet,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_session,brutal_purge,soft_purge,[]}, + {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_access_rule,brutal_purge,soft_purge,[]}, {load_module,emqx,brutal_purge,soft_purge,[]}, {load_module,emqx_sys,brutal_purge,soft_purge,[]}, {load_module,emqx_plugins,brutal_purge,soft_purge,[]}, - {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {update,emqx_broker_sup,supervisor}, {load_module,emqx_frame,brutal_purge,soft_purge,[]}, {load_module,emqx_app,brutal_purge,soft_purge,[]}, @@ -506,6 +510,7 @@ {load_module,emqx_vm,brutal_purge,soft_purge,[]}, {load_module,emqx_sys_mon,brutal_purge,soft_purge,[]}, {load_module,emqx_http_lib,brutal_purge,soft_purge,[]}, + {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {load_module,emqx_connection,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_session,brutal_purge,soft_purge,[]}, @@ -513,7 +518,6 @@ {load_module,emqx_alarm_handler,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, - {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {update,emqx_broker_sup,supervisor}, {load_module,emqx_access_rule,brutal_purge,soft_purge,[]}, {load_module,emqx_ctl,brutal_purge,soft_purge,[]}, @@ -549,13 +553,13 @@ {load_module,emqx_vm,brutal_purge,soft_purge,[]}, {load_module,emqx_sys_mon,brutal_purge,soft_purge,[]}, {load_module,emqx_http_lib,brutal_purge,soft_purge,[]}, + {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {load_module,emqx_connection,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_session,brutal_purge,soft_purge,[]}, {load_module,emqx_alarm_handler,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_packet,brutal_purge,soft_purge,[]}, - {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {update,emqx_broker_sup,supervisor}, {load_module,emqx_ws_connection,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, @@ -712,18 +716,22 @@ {load_module,emqx_limiter,brutal_purge,soft_purge,[]}]}, {<<".*">>,[]}], [{"4.3.20", - [{load_module,emqx_app,brutal_purge,soft_purge,[]}, + [{load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_channel,brutal_purge,soft_purge,[]}, + {load_module,emqx_app,brutal_purge,soft_purge,[]}, {load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}]}, {"4.3.19", - [{load_module,emqx_message,brutal_purge,soft_purge,[]}, + [{load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_app,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, {load_module,emqx_plugins,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}]}, {"4.3.18", - [{load_module,emqx_message,brutal_purge,soft_purge,[]}, + [{load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}, @@ -733,11 +741,11 @@ [{load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, + {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx,brutal_purge,soft_purge,[]}, {load_module,emqx_exclusive_subscription,brutal_purge,soft_purge,[]}, {load_module,emqx_session,brutal_purge,soft_purge,[]}, - {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {update,emqx_broker_sup,supervisor}, {load_module,emqx_app,brutal_purge,soft_purge,[]}, {load_module,emqx_plugins,brutal_purge,soft_purge,[]}, @@ -807,12 +815,12 @@ {load_module,emqx_session,brutal_purge,soft_purge,[]}, {load_module,emqx_access_rule,brutal_purge,soft_purge,[]}, {load_module,emqx,brutal_purge,soft_purge,[]}, + {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_metrics,brutal_purge,soft_purge,[]}, {load_module,emqx_access_control,brutal_purge,soft_purge,[]}, {load_module,emqx_sys,brutal_purge,soft_purge,[]}, {load_module,emqx_plugins,brutal_purge,soft_purge,[]}, - {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {update,emqx_broker_sup,supervisor}, {load_module,emqx_frame,brutal_purge,soft_purge,[]}, {load_module,emqx_app,brutal_purge,soft_purge,[]}, @@ -1193,6 +1201,7 @@ {load_module,emqx_vm,brutal_purge,soft_purge,[]}, {load_module,emqx_sys_mon,brutal_purge,soft_purge,[]}, {load_module,emqx_http_lib,brutal_purge,soft_purge,[]}, + {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {load_module,emqx_connection,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_metrics,brutal_purge,soft_purge,[]}, @@ -1204,7 +1213,6 @@ {load_module,emqx_alarm_handler,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, - {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {update,emqx_broker_sup,supervisor}, {load_module,emqx_access_rule,brutal_purge,soft_purge,[]}, {load_module,emqx_ctl,brutal_purge,soft_purge,[]}, @@ -1234,6 +1242,7 @@ {load_module,emqx_vm,brutal_purge,soft_purge,[]}, {load_module,emqx_sys_mon,brutal_purge,soft_purge,[]}, {load_module,emqx_http_lib,brutal_purge,soft_purge,[]}, + {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {load_module,emqx_connection,brutal_purge,soft_purge,[]}, {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_metrics,brutal_purge,soft_purge,[]}, @@ -1244,7 +1253,6 @@ {load_module,emqx_alarm_handler,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, {load_module,emqx_packet,brutal_purge,soft_purge,[]}, - {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {update,emqx_broker_sup,supervisor}, {load_module,emqx_ws_connection,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, From 95bc9cd8e05fb54b258e61485f4cf019c2a286de Mon Sep 17 00:00:00 2001 From: JianBo He Date: Thu, 8 Sep 2022 09:52:12 +0800 Subject: [PATCH 06/26] chore: update changes --- CHANGES-4.3.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index 26e7075e2..ea0366a41 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -16,6 +16,7 @@ File format: - Fix rule-engine update behaviour which may initialize actions for disabled rules. [#8849](https://github.com/emqx/emqx/pull/8849) - Fix JWT plugin don't support non-integer timestamp claims. [#8862](https://github.com/emqx/emqx/pull/8862) +- Fix a possible dead loop caused by shared subscriptions with `shared_dispatch_ack_enabled=true`. [#8918](https://github.com/emqx/emqx/pull/8918) ## v4.3.19 From 2440733a6f0541c59cbd4df6968d257262323658 Mon Sep 17 00:00:00 2001 From: JianBo He Date: Thu, 8 Sep 2022 13:38:30 +0800 Subject: [PATCH 07/26] test: ensure shared messages queued by session --- src/emqx_shared_sub.erl | 6 ++---- test/emqx_channel_SUITE.erl | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/emqx_shared_sub.erl b/src/emqx_shared_sub.erl index 3b533d9d3..cc57e001f 100644 --- a/src/emqx_shared_sub.erl +++ b/src/emqx_shared_sub.erl @@ -52,10 +52,8 @@ %% for testing -ifdef(TEST). --export([ subscribers/2 - , ack_enabled/0 - , strategy/1 - ]). +-compile(export_all). +-compile(nowarn_export_all). -endif. %% gen_server callbacks diff --git a/test/emqx_channel_SUITE.erl b/test/emqx_channel_SUITE.erl index 1422f07b6..00edde5b1 100644 --- a/test/emqx_channel_SUITE.erl +++ b/test/emqx_channel_SUITE.erl @@ -481,6 +481,45 @@ t_handle_deliver_nl(_) -> NMsg = emqx_message:set_flag(nl, Msg), {ok, Channel} = emqx_channel:handle_deliver([{deliver, <<"t1">>, NMsg}], Channel). +t_handle_deliver_shared_in_no_connection(_) -> + Grp = <<"g">>, + Sender = self(), + Ref1 = make_ref(), + Ref2 = make_ref(), + Chann = emqx_channel:set_field(conn_state, disconnected, channel()), + + Msg0 = emqx_shared_sub:with_group_ack( + emqx_message:make(test, ?QOS_1, <<"t">>, <<"qos1">>), + Grp, + fresh, + Sender, + Ref1 + ), + Msg1 = emqx_shared_sub:with_group_ack( + emqx_message:make(test, ?QOS_2, <<"t">>, <<"qos2">>), + Grp, + retry, + Sender, + Ref2 + ), + Delivers = [{deliver, <<"+">>, Msg0}, {deliver, <<"+">>, Msg1}], + + %% all shared msgs should be queued if shared_dispatch_ack_enabled=false + meck:new(emqx_shared_sub, [passthrough, no_history]), + meck:expect(emqx_shared_sub, is_ack_required, fun(_) -> false end), + {ok, Chann1} = emqx_channel:handle_deliver(Delivers, Chann), + ?assertEqual(2, proplists:get_value(mqueue_len, emqx_channel:stats(Chann1))), + meck:unload(emqx_shared_sub), + + %% only fresh shared msgs should be queued if shared_dispatch_ack_enabled=true + meck:new(emqx_shared_sub, [passthrough, no_history]), + meck:expect(emqx_shared_sub, is_ack_required, fun(_) -> true end), + {ok, Chann2} = emqx_channel:handle_deliver(Delivers, Chann), + ?assertEqual(1, proplists:get_value(mqueue_len, emqx_channel:stats(Chann2))), + receive {Ref1, {shared_sub_nack, no_connection}} -> ok after 0 -> ?assert(false) end, + receive {Ref2, shared_sub_ack} -> ok after 0 -> ?assert(false) end, + meck:unload(emqx_shared_sub). + %%-------------------------------------------------------------------- %% Test cases for handle_out %%-------------------------------------------------------------------- From f0cc75d1446582b9e2829e390eadb84d5b42f150 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Thu, 8 Sep 2022 16:37:38 +0800 Subject: [PATCH 08/26] fix(sql): topic matching to null values should return false --- CHANGES-4.3.md | 6 +- .../src/emqx_rule_runtime.erl | 5 +- .../test/emqx_rule_engine_SUITE.erl | 142 ++++++++++++++++-- 3 files changed, 138 insertions(+), 15 deletions(-) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index aa250b7ad..9be7de63f 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -17,7 +17,11 @@ File format: - Fix rule-engine update behaviour which may initialize actions for disabled rules. [#8849](https://github.com/emqx/emqx/pull/8849) - Fix JWT plugin don't support non-integer timestamp claims. [#8862](https://github.com/emqx/emqx/pull/8862) - Fix dashboard binding IP address not working. [#8916](https://github.com/emqx/emqx/pull/8916) - +- Fix rule SQL topic matching to null values failed. [#?](https://github.com/emqx/emqx/pull/?) + The following SQL should not fail (crash) but return `{"r": false}`: + `SELECT topic =~ 't' as r FROM "$events/client_connected"`. + The topic is a null value as there's no such field in event `$events/client_connected`, so it + should return false if mathch it to a topic. ## v4.3.19 diff --git a/apps/emqx_rule_engine/src/emqx_rule_runtime.erl b/apps/emqx_rule_engine/src/emqx_rule_runtime.erl index 794c70dfd..71775f6ee 100644 --- a/apps/emqx_rule_engine/src/emqx_rule_runtime.erl +++ b/apps/emqx_rule_engine/src/emqx_rule_runtime.erl @@ -242,7 +242,10 @@ do_compare('>=', L, R) -> do_compare('=', L, R) orelse do_compare('>', L, R); do_compare('<>', L, R) -> L /= R; do_compare('!=', L, R) -> L /= R; -do_compare('=~', T, F) -> emqx_topic:match(T, F). +do_compare('=~', undefined, undefined) -> true; +do_compare('=~', T, F) when T == undefined; F == undefined -> false; +do_compare('=~', T, F) -> + emqx_topic:match(T, F). number(Bin) -> try binary_to_integer(Bin) diff --git a/apps/emqx_rule_engine/test/emqx_rule_engine_SUITE.erl b/apps/emqx_rule_engine/test/emqx_rule_engine_SUITE.erl index d1e6b26a0..c8f66ea00 100644 --- a/apps/emqx_rule_engine/test/emqx_rule_engine_SUITE.erl +++ b/apps/emqx_rule_engine/test/emqx_rule_engine_SUITE.erl @@ -2505,6 +2505,13 @@ t_sqlparse_compare_undefined(_Config) -> %% no match ?assertMatch({error, nomatch}, ?TEST_SQL(Sql00)), + Sql00_1 = "select " + " * " + "from \"t/#\" " + "where dev <> undefined ", + %% no match + ?assertMatch({error, nomatch}, ?TEST_SQL(Sql00_1)), + Sql01 = "select " " 'd' as dev " "from \"t/#\" " @@ -2513,13 +2520,29 @@ t_sqlparse_compare_undefined(_Config) -> %% pass ?assertMatch(#{}, Res01), + Sql01_1 = "select " + " 'd' as dev " + "from \"t/#\" " + "where dev <> undefined ", + {ok, Res01_1} = ?TEST_SQL(Sql01_1), + %% pass + ?assertMatch(#{}, Res01_1), + Sql02 = "select " " * " "from \"t/#\" " "where dev != 'undefined' ", {ok, Res02} = ?TEST_SQL(Sql02), %% pass - ?assertMatch(#{}, Res02). + ?assertMatch(#{}, Res02), + + Sql03 = "select " + " * " + "from \"t/#\" " + "where dev =~ 'undefined' ", + Res03 = ?TEST_SQL(Sql03), + %% no match + ?assertMatch({error, nomatch}, Res03). t_sqlparse_compare_null_null(_Config) -> %% test undefined == undefined @@ -2538,6 +2561,14 @@ t_sqlparse_compare_null_null(_Config) -> ?assertMatch(#{<<"c">> := false }, Res01), + %% test undefined <> undefined + Sql01_1 = "select " + " a <> b as c " + "from \"t/#\" ", + {ok, Res01_1} = ?TEST_SQL(Sql01_1), + ?assertMatch(#{<<"c">> := false + }, Res01_1), + %% test undefined > undefined Sql02 = "select " " a > b as c " @@ -2568,10 +2599,18 @@ t_sqlparse_compare_null_null(_Config) -> "from \"t/#\" ", {ok, Res05} = ?TEST_SQL(Sql05), ?assertMatch(#{<<"c">> := true - }, Res05). + }, Res05), + + %% test undefined =~ undefined + Sql06 = "select " + " a =~ b as c " + "from \"t/#\" ", + {ok, Res06} = ?TEST_SQL(Sql06), + ?assertMatch(#{<<"c">> := true + }, Res06). t_sqlparse_compare_null_notnull(_Config) -> - %% test undefined == b + %% test undefined == 'b' Sql00 = "select " " 'b' as b, a = b as c " "from \"t/#\" ", @@ -2579,7 +2618,7 @@ t_sqlparse_compare_null_notnull(_Config) -> ?assertMatch(#{<<"c">> := false }, Res00), - %% test undefined != b + %% test undefined != 'b' Sql01 = "select " " 'b' as b, a != b as c " "from \"t/#\" ", @@ -2587,7 +2626,15 @@ t_sqlparse_compare_null_notnull(_Config) -> ?assertMatch(#{<<"c">> := true }, Res01), - %% test undefined > b + %% test undefined <> 'b' + Sql01_1 = "select " + " 'b' as b, a <> b as c " + "from \"t/#\" ", + {ok, Res01_1} = ?TEST_SQL(Sql01_1), + ?assertMatch(#{<<"c">> := true + }, Res01_1), + + %% test undefined > 'b' Sql02 = "select " " 'b' as b, a > b as c " "from \"t/#\" ", @@ -2595,7 +2642,7 @@ t_sqlparse_compare_null_notnull(_Config) -> ?assertMatch(#{<<"c">> := false }, Res02), - %% test undefined < b + %% test undefined < 'b' Sql03 = "select " " 'b' as b, a < b as c " "from \"t/#\" ", @@ -2603,7 +2650,7 @@ t_sqlparse_compare_null_notnull(_Config) -> ?assertMatch(#{<<"c">> := false }, Res03), - %% test undefined <= b + %% test undefined <= 'b' Sql04 = "select " " 'b' as b, a <= b as c " "from \"t/#\" ", @@ -2611,13 +2658,21 @@ t_sqlparse_compare_null_notnull(_Config) -> ?assertMatch(#{<<"c">> := false }, Res04), - %% test undefined >= b + %% test undefined >= 'b' Sql05 = "select " " 'b' as b, a >= b as c " "from \"t/#\" ", {ok, Res05} = ?TEST_SQL(Sql05), ?assertMatch(#{<<"c">> := false - }, Res05). + }, Res05), + + %% test undefined =~ 'b' + Sql06 = "select " + " 'b' as b, a =~ b as c " + "from \"t/#\" ", + {ok, Res06} = ?TEST_SQL(Sql06), + ?assertMatch(#{<<"c">> := false + }, Res06). t_sqlparse_compare_notnull_null(_Config) -> %% test 'a' == undefined @@ -2636,6 +2691,14 @@ t_sqlparse_compare_notnull_null(_Config) -> ?assertMatch(#{<<"c">> := true }, Res01), + %% test 'a' <> undefined + Sql01_1 = "select " + " 'a' as a, a <> b as c " + "from \"t/#\" ", + {ok, Res01_1} = ?TEST_SQL(Sql01_1), + ?assertMatch(#{<<"c">> := true + }, Res01_1), + %% test 'a' > undefined Sql02 = "select " " 'a' as a, a > b as c " @@ -2666,7 +2729,15 @@ t_sqlparse_compare_notnull_null(_Config) -> "from \"t/#\" ", {ok, Res05} = ?TEST_SQL(Sql05), ?assertMatch(#{<<"c">> := false - }, Res05). + }, Res05), + + %% test 'a' =~ undefined + Sql06 = "select " + " 'a' as a, a =~ b as c " + "from \"t/#\" ", + {ok, Res06} = ?TEST_SQL(Sql06), + ?assertMatch(#{<<"c">> := false + }, Res06). t_sqlparse_compare(_Config) -> Sql00 = "select " @@ -2676,6 +2747,13 @@ t_sqlparse_compare(_Config) -> ?assertMatch(#{<<"c">> := true }, Res00), + Sql00_1 = "select " + " 'true' as a, true as b, a = b as c " + "from \"t/#\" ", + {ok, Res00_1} = ?TEST_SQL(Sql00_1), + ?assertMatch(#{<<"c">> := true + }, Res00_1), + Sql01 = "select " " is_null(a) as c " "from \"t/#\" ", @@ -2704,7 +2782,21 @@ t_sqlparse_compare(_Config) -> ?assertMatch(#{<<"c">> := false }, Res04), - %% test 'a' >= undefined + Sql04_0 = "select " + " 1 as a, 1 as b, a = b as c " + "from \"t/#\" ", + {ok, Res04_0} = ?TEST_SQL(Sql04_0), + ?assertMatch(#{<<"c">> := true + }, Res04_0), + + Sql04_1 = "select " + " 1 as a, '1' as b, a = b as c " + "from \"t/#\" ", + {ok, Res04_1} = ?TEST_SQL(Sql04_1), + ?assertMatch(#{<<"c">> := true + }, Res04_1), + + %% test 1 >= 2 Sql05 = "select " " 1 as a, 2 as b, a >= b as c " "from \"t/#\" ", @@ -2712,13 +2804,37 @@ t_sqlparse_compare(_Config) -> ?assertMatch(#{<<"c">> := false }, Res05), - %% test 'a' >= undefined + %% test 1 <= 2 Sql06 = "select " " 1 as a, 2 as b, a <= b as c " "from \"t/#\" ", {ok, Res06} = ?TEST_SQL(Sql06), ?assertMatch(#{<<"c">> := true - }, Res06). + }, Res06), + + %% test 1 != 2 + Sql07 = "select " + " 1 as a, 2 as b, a != b as c " + "from \"t/#\" ", + {ok, Res07} = ?TEST_SQL(Sql07), + ?assertMatch(#{<<"c">> := true + }, Res07), + + %% test 1 <> 2 + Sql07_1 = "select " + " 1 as a, 2 as b, a <> b as c " + "from \"t/#\" ", + {ok, Res07_1} = ?TEST_SQL(Sql07_1), + ?assertMatch(#{<<"c">> := true + }, Res07_1), + + %% test 't' =~ 't' + Sql08 = "select " + " 't' as a, 't' as b, a =~ b as c " + "from \"t/#\" ", + {ok, Res08} = ?TEST_SQL(Sql08), + ?assertMatch(#{<<"c">> := true + }, Res08). t_sqlparse_new_map(_Config) -> %% construct a range without 'as' From b9d75181e5f74c0ecaae65776757a71052737e5c Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Thu, 8 Sep 2022 16:38:34 +0800 Subject: [PATCH 09/26] chore: update emqx_rule_engine.appup.src --- apps/emqx_rule_engine/src/emqx_rule_engine.appup.src | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/emqx_rule_engine/src/emqx_rule_engine.appup.src b/apps/emqx_rule_engine/src/emqx_rule_engine.appup.src index b976a92bd..c24bead6e 100644 --- a/apps/emqx_rule_engine/src/emqx_rule_engine.appup.src +++ b/apps/emqx_rule_engine/src/emqx_rule_engine.appup.src @@ -3,6 +3,7 @@ {VSN, [{"4.3.14", [{load_module,emqx_rule_registry,brutal_purge,soft_purge,[]}, + {load_module,emqx_rule_runtime,brutal_purge,soft_purge,[]}, {load_module,emqx_rule_engine,brutal_purge,soft_purge,[]}]}, {"4.3.13", [{load_module,emqx_rule_engine,brutal_purge,soft_purge,[]}, @@ -185,6 +186,7 @@ {<<".*">>,[]}], [{"4.3.14", [{load_module,emqx_rule_registry,brutal_purge,soft_purge,[]}, + {load_module,emqx_rule_runtime,brutal_purge,soft_purge,[]}, {load_module,emqx_rule_engine,brutal_purge,soft_purge,[]}]}, {"4.3.13", [{load_module,emqx_rule_engine,brutal_purge,soft_purge,[]}, From 9d1f2c802f4886a2b59a68beeba21ddea47de11c Mon Sep 17 00:00:00 2001 From: zhongwencool Date: Thu, 8 Sep 2022 16:53:22 +0800 Subject: [PATCH 10/26] chore: bump minirest to 0.3.9 to fix bind output --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index b23526949..19d199a6e 100644 --- a/rebar.config +++ b/rebar.config @@ -50,7 +50,7 @@ , {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.8.1.11"}}} , {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.5.2"}}} , {cuttlefish, {git, "https://github.com/emqx/cuttlefish", {tag, "v3.3.6"}}} - , {minirest, {git, "https://github.com/emqx/minirest", {tag, "0.3.7"}}} + , {minirest, {git, "https://github.com/emqx/minirest", {tag, "0.3.9"}}} , {ecpool, {git, "https://github.com/emqx/ecpool", {tag, "0.5.2"}}} , {replayq, {git, "https://github.com/emqx/replayq", {tag, "0.3.4"}}} , {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {branch, "2.0.4"}}} From 93d10e63b04ff3c1ada172997cb0ef519052f882 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Thu, 8 Sep 2022 16:53:24 +0800 Subject: [PATCH 11/26] chore: update CHANGES-4.3.md for #8927 --- CHANGES-4.3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index 9be7de63f..796efcfff 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -17,11 +17,11 @@ File format: - Fix rule-engine update behaviour which may initialize actions for disabled rules. [#8849](https://github.com/emqx/emqx/pull/8849) - Fix JWT plugin don't support non-integer timestamp claims. [#8862](https://github.com/emqx/emqx/pull/8862) - Fix dashboard binding IP address not working. [#8916](https://github.com/emqx/emqx/pull/8916) -- Fix rule SQL topic matching to null values failed. [#?](https://github.com/emqx/emqx/pull/?) +- Fix rule SQL topic matching to null values failed. [#8927](https://github.com/emqx/emqx/pull/8927) The following SQL should not fail (crash) but return `{"r": false}`: `SELECT topic =~ 't' as r FROM "$events/client_connected"`. The topic is a null value as there's no such field in event `$events/client_connected`, so it - should return false if mathch it to a topic. + should return false if match it to a topic. ## v4.3.19 From 2c54190479eee500e3709b20a8febff9ee23a6a9 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 9 Sep 2022 12:27:02 +0200 Subject: [PATCH 12/26] fix: revert 'accepted' state of exproto plugin --- apps/emqx_exproto/src/emqx_exproto_channel.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/emqx_exproto/src/emqx_exproto_channel.erl b/apps/emqx_exproto/src/emqx_exproto_channel.erl index 4b354183e..6847b905e 100644 --- a/apps/emqx_exproto/src/emqx_exproto_channel.erl +++ b/apps/emqx_exproto/src/emqx_exproto_channel.erl @@ -66,7 +66,7 @@ -opaque(channel() :: #channel{}). --type(conn_state() :: idle | connecting | connected | disconnected). +-type(conn_state() :: idle | connecting | connected | disconnected | accepted). -type(reply() :: {outgoing, binary()} | {outgoing, [binary()]} @@ -159,7 +159,7 @@ init(ConnInfo = #{socktype := Socktype, Channel = #channel{gcli = #{channel => GRpcChann}, conninfo = NConnInfo1, clientinfo = ClientInfo, - conn_state = idle, + conn_state = accepted, timers = #{} }, case emqx_hooks:run_fold('client.connect', [NConnInfo], #{}) of From cecedaccba899d1c08b3c43790a4402008085bc6 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 9 Sep 2022 17:01:50 +0200 Subject: [PATCH 13/26] docs: remove stale changlog --- CHANGES-4.3.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGES-4.3.md b/CHANGES-4.3.md index 8ed7a470a..9cfc538e5 100644 --- a/CHANGES-4.3.md +++ b/CHANGES-4.3.md @@ -26,7 +26,6 @@ File format: - Improve error message for LwM2M plugin when object ID is not valid. [#8654](https://github.com/emqx/emqx/pull/8654). - Add tzdata apk package to alpine docker image. [#8671](https://github.com/emqx/emqx/pull/8671) -- Add node evacuation and cluster rebalancing features. [#8597](https://github.com/emqx/emqx/pull/8597) - Refine Rule Engine error log. RuleId will be logged when take action failed. [#8737](https://github.com/emqx/emqx/pull/8737) - Increases the latency interval for MQTT Bridge test connections to improve compatibility in high-latency environments. [#8745](https://github.com/emqx/emqx/pull/8745) - Close ExProto client process immediately if it's keepalive timeouted. [#8725](https://github.com/emqx/emqx/pull/8725) From c463569d88c1ea1f64401adbf15334e7ddb5921c Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 9 Sep 2022 17:10:39 +0200 Subject: [PATCH 14/26] chore: bump versions in Chart --- deploy/charts/emqx/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/charts/emqx/Chart.yaml b/deploy/charts/emqx/Chart.yaml index 7667ab443..2ad425fc0 100644 --- a/deploy/charts/emqx/Chart.yaml +++ b/deploy/charts/emqx/Chart.yaml @@ -13,8 +13,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 4.3.19 +version: 4.3.20 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 4.3.19 +appVersion: 4.3.20 From 9e122f38b9c8bd60ede4d41b1adda59b5adf3a2d Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Fri, 9 Sep 2022 12:39:53 -0300 Subject: [PATCH 15/26] ci(fix): fix check for appup coverage Before: ```elixir iex(14)> :re.run('4.3.10', "4\\.3\\.[0-4]", [{:capture, :first, :list}]) {:match, ['4.3.1']} ``` --- scripts/update_appup.escript | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/update_appup.escript b/scripts/update_appup.escript index 141fd5833..9282aa902 100755 --- a/scripts/update_appup.escript +++ b/scripts/update_appup.escript @@ -374,12 +374,12 @@ ensure_version(Version, OldInstructions) -> contains_version(Needle, Haystack) when is_list(Needle) -> lists:any( - fun(<<"*">>) -> true; %% TODO: delete after we pass esockd 5.8.4 - (Regex) when is_binary(Regex) -> + fun(Regex) when is_binary(Regex) -> + Length = length(Needle), case re:run(Needle, Regex) of - {match, _} -> + {match, [{0, Length}]} -> true; - nomatch -> + _ -> false end; (Vsn) -> From 94afb633f8715ae153a0606da2f5ba8dce939694 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Fri, 9 Sep 2022 13:37:00 -0300 Subject: [PATCH 16/26] chore: update missing appup instructions --- apps/emqx_exproto/src/emqx_exproto.appup.src | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/emqx_exproto/src/emqx_exproto.appup.src b/apps/emqx_exproto/src/emqx_exproto.appup.src index 20939ae63..fcf2fe6db 100644 --- a/apps/emqx_exproto/src/emqx_exproto.appup.src +++ b/apps/emqx_exproto/src/emqx_exproto.appup.src @@ -1,7 +1,8 @@ %% -*- mode: erlang -*- %% Unless you know what you are doing, DO NOT edit manually!! {VSN, - [{"4.3.9", + [{"4.3.10",[{load_module,emqx_exproto_channel,brutal_purge,soft_purge,[]}]}, + {"4.3.9", [{load_module,emqx_exproto_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_exproto_gcli,brutal_purge,soft_purge,[]}]}, {<<"4\\.3\\.[2-8]">>, @@ -14,7 +15,8 @@ {load_module,emqx_exproto_conn,brutal_purge,soft_purge,[]}, {load_module,emqx_exproto_channel,brutal_purge,soft_purge,[]}]}, {<<".*">>,[]}], - [{"4.3.9", + [{"4.3.10",[{load_module,emqx_exproto_channel,brutal_purge,soft_purge,[]}]}, + {"4.3.9", [{load_module,emqx_exproto_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_exproto_gcli,brutal_purge,soft_purge,[]}]}, {<<"4\\.3\\.[2-8]">>, From 4aa0f4980dec3b1d7f19f68a6696e6117ef0a7c9 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 12 Sep 2022 09:45:37 +0200 Subject: [PATCH 17/26] chore: re-generate appup updates --- .../src/emqx_auth_mnesia.appup.src | 6 ++++-- src/emqx.appup.src | 20 +++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.appup.src b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.appup.src index 7906449db..49bc4ece6 100644 --- a/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.appup.src +++ b/apps/emqx_auth_mnesia/src/emqx_auth_mnesia.appup.src @@ -1,7 +1,8 @@ %% -*- mode: erlang -*- %% Unless you know what you are doing, DO NOT edit manually!! {VSN, - [{"4.3.7", + [{"4.3.8",[{load_module,emqx_acl_mnesia_cli,brutal_purge,soft_purge,[]}]}, + {"4.3.7", [{load_module,emqx_auth_mnesia_api,brutal_purge,soft_purge,[]}, {load_module,emqx_acl_mnesia_cli,brutal_purge,soft_purge,[]}]}, {<<"4\\.3\\.[5-6]">>, @@ -33,7 +34,8 @@ {load_module,emqx_acl_mnesia_cli,brutal_purge,soft_purge,[]}, {load_module,emqx_auth_mnesia_app,brutal_purge,soft_purge,[]}]}, {<<".*">>,[]}], - [{"4.3.7", + [{"4.3.8",[{load_module,emqx_acl_mnesia_cli,brutal_purge,soft_purge,[]}]}, + {"4.3.7", [{load_module,emqx_auth_mnesia_api,brutal_purge,soft_purge,[]}, {load_module,emqx_acl_mnesia_cli,brutal_purge,soft_purge,[]}]}, {<<"4\\.3\\.[5-6]">>, diff --git a/src/emqx.appup.src b/src/emqx.appup.src index bc34d7ac6..fa43b0bb3 100644 --- a/src/emqx.appup.src +++ b/src/emqx.appup.src @@ -2,10 +2,13 @@ %% Unless you know what you are doing, DO NOT edit manually!! {VSN, [{"4.4.8", - [{load_module,emqx_cm,brutal_purge,soft_purge,[]}, + [{load_module,emqx_channel,brutal_purge,soft_purge,[]}, + {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_cm,brutal_purge,soft_purge,[]}, {load_module,emqx_message,brutal_purge,soft_purge,[]}]}, {"4.4.7", - [{load_module,emqx_message,brutal_purge,soft_purge,[]}, + [{load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_relup,brutal_purge,soft_purge,[]}, {load_module,emqx,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, @@ -14,7 +17,8 @@ {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_app,brutal_purge,soft_purge,[]}]}, {"4.4.6", - [{load_module,emqx_message,brutal_purge,soft_purge,[]}, + [{load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_relup,brutal_purge,soft_purge,[]}, {load_module,emqx_app,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, @@ -197,10 +201,13 @@ {load_module,emqx_limiter,brutal_purge,soft_purge,[]}]}, {<<".*">>,[]}], [{"4.4.8", - [{load_module,emqx_cm,brutal_purge,soft_purge,[]}, + [{load_module,emqx_channel,brutal_purge,soft_purge,[]}, + {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_cm,brutal_purge,soft_purge,[]}, {load_module,emqx_message,brutal_purge,soft_purge,[]}]}, {"4.4.7", - [{load_module,emqx_message,brutal_purge,soft_purge,[]}, + [{load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_relup,brutal_purge,soft_purge,[]}, {load_module,emqx,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, @@ -209,7 +216,8 @@ {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_app,brutal_purge,soft_purge,[]}]}, {"4.4.6", - [{load_module,emqx_message,brutal_purge,soft_purge,[]}, + [{load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, + {load_module,emqx_message,brutal_purge,soft_purge,[]}, {load_module,emqx_relup,brutal_purge,soft_purge,[]}, {load_module,emqx_app,brutal_purge,soft_purge,[]}, {load_module,emqx_misc,brutal_purge,soft_purge,[]}, From d72275685aebe39af43154dc84ea88874d4d5bcd Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 12 Sep 2022 10:40:07 +0200 Subject: [PATCH 18/26] chore: bump (ce) emqx_dashboard app version --- lib-ce/emqx_dashboard/src/emqx_dashboard.app.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib-ce/emqx_dashboard/src/emqx_dashboard.app.src b/lib-ce/emqx_dashboard/src/emqx_dashboard.app.src index 18f01de01..1581ce2cc 100644 --- a/lib-ce/emqx_dashboard/src/emqx_dashboard.app.src +++ b/lib-ce/emqx_dashboard/src/emqx_dashboard.app.src @@ -1,6 +1,6 @@ {application, emqx_dashboard, [{description, "EMQX Web Dashboard"}, - {vsn, "4.4.7"}, % strict semver, bump manually! + {vsn, "4.4.8"}, % strict semver, bump manually! {modules, []}, {registered, [emqx_dashboard_sup]}, {applications, [kernel,stdlib,mnesia,minirest]}, From 79369caa68719cf1e63c0f46beee5aa936aebace Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 12 Sep 2022 20:36:23 +0200 Subject: [PATCH 19/26] docs: update CHANGES-4.4.md --- CHANGES-4.4.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 4 deletions(-) diff --git a/CHANGES-4.4.md b/CHANGES-4.4.md index ff34ad7f5..6cfa9f74a 100644 --- a/CHANGES-4.4.md +++ b/CHANGES-4.4.md @@ -1,20 +1,82 @@ # EMQX 4.4 Changes +## v4.4.9 + +### Bug fixes (synced from v4.3.20) + +- Fix rule-engine update behaviour which may initialize actions for disabled rules. [#8849](https://github.com/emqx/emqx/pull/8849) +- Fix JWT plugin don't support non-integer timestamp claims. [#8862](https://github.com/emqx/emqx/pull/8862) +- Fix a possible dead loop caused by shared subscriptions with `shared_dispatch_ack_enabled=true`. [#8918](https://github.com/emqx/emqx/pull/8918) +- Fix dashboard binding IP address not working. [#8916](https://github.com/emqx/emqx/pull/8916) +- Fix rule SQL topic matching to null values failed. [#8927](https://github.com/emqx/emqx/pull/8927) + The following SQL should not fail (crash) but return `{"r": false}`: + `SELECT topic =~ 't' as r FROM "$events/client_connected"`. + The topic is a null value as there's no such field in event `$events/client_connected`, so it + should return false if match it to a topic. ## v4.4.8 ### Enhancements (synced from v4.3.19) * Support HTTP API `/trace/:name/detail`. - ### Bug fixes - Fix: Check if emqx_mod_trace is enabled when the trace file is not found. +### Enhancements (synced from v4.3.19) -## v4.4.5 +- Improve error message for LwM2M plugin when object ID is not valid. [#8654](https://github.com/emqx/emqx/pull/8654). +- Add tzdata apk package to alpine docker image. [#8671](https://github.com/emqx/emqx/pull/8671) +- Refine Rule Engine error log. RuleId will be logged when take action failed. [#8737](https://github.com/emqx/emqx/pull/8737) +- Increases the latency interval for MQTT Bridge test connections to improve compatibility in high-latency environments. [#8745](https://github.com/emqx/emqx/pull/8745) +- Close ExProto client process immediately if it's keepalive timeouted. [#8725](https://github.com/emqx/emqx/pull/8725) +- Upgrade grpc-erl driver to 0.6.7 to support batch operation in sending stream. [#8725](https://github.com/emqx/emqx/pull/8725) +- Improved jwt authentication module initialization process. [#8736](https://github.com/emqx/emqx/pull/8736) -### Enhancements (synced from v4.3.16) -* HTTP API `mqtt/publish` support to publish with properties and user_properties. +### Bug fixes (synced from v4.3.19) + +- Fix rule SQL compare to null values always returns false. [#8743](https://github.com/emqx/emqx/pull/8743) + Before this change, the following SQL failed to match on the WHERE clause (`clientid != foo` returns false): + `SELECT 'some_var' as clientid FROM "t" WHERE clientid != foo`. + The `foo` variable is a null value, so `clientid != foo` should be evaluated as true. +- Fix GET `/auth_clientid` and `/auth_username` counts. [#8655](https://github.com/emqx/emqx/pull/8655) +- Add an idle timer for ExProto UDP client to avoid client leaking [#8628](https://github.com/emqx/emqx/pull/8628) +- Fix ExHook can't be un-hooked if the grpc service stop first. [#8725](https://github.com/emqx/emqx/pull/8725) +- Fix the problem that ExHook cannot continue hook chains execution for mismatched topics. [#8807](https://github.com/emqx/emqx/pull/8807) +- Fix GET `/listeners/` crashes when listener is not ready. [#8752](https://github.com/emqx/emqx/pull/8752) +- Fix repeated warning messages in bin/emqx [#8824](https://github.com/emqx/emqx/pull/8824) + + +## v4.4.7 + +### Enhancements (synced from v4.3.18) + +- Make possible to debug-print SSL handshake procedure by setting listener config `log_level=debug` [#8553](https://github.com/emqx/emqx/pull/8553) +- Add option to perform GC on connection process after TLS/SSL handshake is performed. [#8649](https://github.com/emqx/emqx/pull/8649) + Expected to reduce around 35% memory consumption for each SSL connection. See [#8637](https://github.com/emqx/emqx/pull/8637) for more details. + +## v4.4.6 + +### Bug fixes (synced from v4.3.17) + +- Fixed issue where the dashboard APIs were being exposed under the + management listener. [#8411] + +- Fixed crash when shared persistent subscription [#8441] +- Fixed issue in Lua hook that prevented messages from being + rejected [#8535] +- Fix ExProto UDP client keepalive checking error. + This causes the clients to not expire as long as a new UDP packet arrives [#8575] + +### Enhancements (synced from v4.3.17) + +- HTTP API(GET /rules/) support for pagination and fuzzy filtering. [#8450] +- Add check_conf cli to check config format. [#8486] +- Optimize performance of shared subscription + +## v4.4.5 (v4.3.16) + +### Enhancements +- HTTP API `mqtt/publish` support to publish with properties and user_properties. ### Bug fixes - Clean trace zip files when file has been downloaded. From 14e6aa173d51fad6c4b2612f1eb512c58d00be96 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 12 Sep 2022 20:38:21 +0200 Subject: [PATCH 20/26] chore: update version number to 4.4.9-alpha.1 --- include/emqx_release.hrl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/emqx_release.hrl b/include/emqx_release.hrl index 261b38af0..8a1546b8f 100644 --- a/include/emqx_release.hrl +++ b/include/emqx_release.hrl @@ -29,7 +29,7 @@ -ifndef(EMQX_ENTERPRISE). --define(EMQX_RELEASE, {opensource, "4.4.8"}). +-define(EMQX_RELEASE, {opensource, "4.4.9-alpha.1"}). -else. From 79719eca6e2ce4f7dedecbbc7ad329dd77a93cb5 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Wed, 14 Sep 2022 12:04:03 +0200 Subject: [PATCH 21/26] build: add relup paths for 4.4.9 --- data/relup-paths.eterm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/data/relup-paths.eterm b/data/relup-paths.eterm index 02d171e8f..640e54cd3 100644 --- a/data/relup-paths.eterm +++ b/data/relup-paths.eterm @@ -29,4 +29,10 @@ [<<"4.4.0">>,<<"4.4.1">>,<<"4.4.2">>,<<"4.4.3">>,<<"4.4.4">>, <<"4.4.5">>,<<"4.4.6">>,<<"4.4.7">>], otp => <<"24.1.5-3">>}}. -{<<"4.5.0">>,#{from_versions => [<<"4.4.8">>],otp => <<"24.3.4.2-1">>}}. +{<<"4.4.9">>, + #{from_versions => + [<<"4.4.0">>,<<"4.4.1">>,<<"4.4.2">>,<<"4.4.3">>,<<"4.4.4">>, + <<"4.4.5">>,<<"4.4.6">>,<<"4.4.7">>,<<"4.4.8">>], + otp => <<"24.1.5-3">>}}. +{<<"4.5.0">>,#{from_versions => [<<"4.4.8">>,<<"4.4.9">>], + otp => <<"24.3.4.2-1">>}}. From d4fa8567c2b4044cc73093439400e56bb910ee1f Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Wed, 14 Sep 2022 12:04:22 +0200 Subject: [PATCH 22/26] ci: fix relup paths check use a different file for enterprise --- .github/workflows/apps_version_check.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/apps_version_check.yaml b/.github/workflows/apps_version_check.yaml index a86b06967..ff757d47d 100644 --- a/.github/workflows/apps_version_check.yaml +++ b/.github/workflows/apps_version_check.yaml @@ -22,9 +22,15 @@ jobs: - name: fix-git-unsafe-repository run: git config --global --add safe.directory /__w/emqx/emqx - name: Check relup version DB + if: endsWith(github.repository, 'emqx') run: | PKG_VSN=$(./pkg-vsn.sh) ./scripts/relup-base-vsns.escript check-vsn-db $PKG_VSN ./data/relup-paths.eterm + - name: Check relup version DB (ee) + if: endsWith(github.repository, 'enterprise') + run: | + PKG_VSN=$(./pkg-vsn.sh) + ./scripts/relup-base-vsns.escript check-vsn-db $PKG_VSN ./data/relup-paths-ee.eterm - name: Check relup (ce) if: endsWith(github.repository, 'emqx') run: ./scripts/update-appup.sh emqx --check From 62aa9656c4f4a9809d5caf7564acd58359ee57b5 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Wed, 14 Sep 2022 12:36:33 +0200 Subject: [PATCH 23/26] chore: update emqx.appup.src --- src/emqx.appup.src | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/emqx.appup.src b/src/emqx.appup.src index fa43b0bb3..690acc648 100644 --- a/src/emqx.appup.src +++ b/src/emqx.appup.src @@ -2,7 +2,9 @@ %% Unless you know what you are doing, DO NOT edit manually!! {VSN, [{"4.4.8", - [{load_module,emqx_channel,brutal_purge,soft_purge,[]}, + [{load_module,emqx_relup,brutal_purge,soft_purge,[]}, + {load_module,emqx_app,brutal_purge,soft_purge,[]}, + {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, {load_module,emqx_message,brutal_purge,soft_purge,[]}]}, @@ -201,7 +203,9 @@ {load_module,emqx_limiter,brutal_purge,soft_purge,[]}]}, {<<".*">>,[]}], [{"4.4.8", - [{load_module,emqx_channel,brutal_purge,soft_purge,[]}, + [{load_module,emqx_relup,brutal_purge,soft_purge,[]}, + {load_module,emqx_app,brutal_purge,soft_purge,[]}, + {load_module,emqx_channel,brutal_purge,soft_purge,[]}, {load_module,emqx_shared_sub,brutal_purge,soft_purge,[]}, {load_module,emqx_cm,brutal_purge,soft_purge,[]}, {load_module,emqx_message,brutal_purge,soft_purge,[]}]}, From 0606a55a03e609af588bc0556fac277176ea58c2 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Wed, 14 Sep 2022 12:48:13 +0200 Subject: [PATCH 24/26] chore: print warning messages to standard_error --- scripts/relup-base-vsns.escript | 2 +- scripts/relup-base-vsns.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/relup-base-vsns.escript b/scripts/relup-base-vsns.escript index 307d4f5fd..6c618ca45 100755 --- a/scripts/relup-base-vsns.escript +++ b/scripts/relup-base-vsns.escript @@ -285,4 +285,4 @@ print_warning(Msg) -> print_warning(Msg, []). print_warning(Msg, Args) -> - io:format(user, ?RED ++ Msg ++ ?RESET, Args). + io:format(standard_error, ?RED ++ Msg ++ ?RESET, Args). diff --git a/scripts/relup-base-vsns.sh b/scripts/relup-base-vsns.sh index 15b97921c..e05dff140 100755 --- a/scripts/relup-base-vsns.sh +++ b/scripts/relup-base-vsns.sh @@ -54,10 +54,12 @@ esac TAGS=( 'dummy' ) TAGS_EXCLUDE=( 'dummy' ) -while read -r vsn; do +base_versions="$(./scripts/relup-base-vsns.escript base-vsns "$CUR" ./data/relup-paths.eterm | xargs echo -n)" + +for vsn in ${base_versions}; do # shellcheck disable=SC2207 TAGS+=($(git tag -l "${GIT_TAG_PREFIX}${vsn}")) -done < <(./scripts/relup-base-vsns.escript base-vsns "$CUR" ./data/relup-paths.eterm) +done for tag_to_del in "${TAGS_EXCLUDE[@]}"; do TAGS=( "${TAGS[@]/$tag_to_del}" ) From e08b7aa2184d452d828aa97089edff9d13c03cb8 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Wed, 14 Sep 2022 15:00:22 +0200 Subject: [PATCH 25/26] chore: bump to v4.4.9-alpha.2 --- include/emqx_release.hrl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/emqx_release.hrl b/include/emqx_release.hrl index 8a1546b8f..3626ca4ef 100644 --- a/include/emqx_release.hrl +++ b/include/emqx_release.hrl @@ -29,7 +29,7 @@ -ifndef(EMQX_ENTERPRISE). --define(EMQX_RELEASE, {opensource, "4.4.9-alpha.1"}). +-define(EMQX_RELEASE, {opensource, "4.4.9-alpha.2"}). -else. From c005cff7a682a39aec8fa3c9bba62ae07bd5d8f6 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Wed, 14 Sep 2022 15:40:21 +0200 Subject: [PATCH 26/26] chore: syn scripts from ee back to ce --- scripts/relup-base-vsns.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/relup-base-vsns.sh b/scripts/relup-base-vsns.sh index e05dff140..1aa2b3288 100755 --- a/scripts/relup-base-vsns.sh +++ b/scripts/relup-base-vsns.sh @@ -44,9 +44,11 @@ fi case "${EDITION}" in *enterprise*) GIT_TAG_PREFIX="e" + RELUP_PATH_FILE="./data/relup-paths-ee.eterm" ;; *) GIT_TAG_PREFIX="v" + RELUP_PATH_FILE="./data/relup-paths.eterm" ;; esac @@ -54,7 +56,7 @@ esac TAGS=( 'dummy' ) TAGS_EXCLUDE=( 'dummy' ) -base_versions="$(./scripts/relup-base-vsns.escript base-vsns "$CUR" ./data/relup-paths.eterm | xargs echo -n)" +base_versions="$(./scripts/relup-base-vsns.escript base-vsns "$CUR" "$RELUP_PATH_FILE" | xargs echo -n)" for vsn in ${base_versions}; do # shellcheck disable=SC2207