Merge pull request #8872 from JimMoen/fix-mqtt-bridge-fields
Fix mqtt bridge fields. - Show ssl file path in Dashboard. - MQTT bridge `payload` field not required. merge `v5.0.7` into `master`.
This commit is contained in:
commit
d4785553b9
|
@ -16,6 +16,7 @@
|
||||||
* Remove `will_msg` (not used) 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 `$queue` topic name error in management API return. [#8728](https://github.com/emqx/emqx/pull/8728)
|
||||||
* Fix race condition which may cause `client.connected` and `client.disconnected` out of 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
|
## Enhancements
|
||||||
|
|
||||||
|
@ -37,6 +38,7 @@
|
||||||
|
|
||||||
## Enhancements
|
## 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)
|
* 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)
|
* 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)
|
* Updated `/nodes` API node_status from `Running/Stopped` to `running/stopped`. [#8642](https://github.com/emqx/emqx/pull/8642)
|
||||||
|
|
2
Makefile
2
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 EMQX_DEFAULT_RUNNER = debian:11-slim
|
||||||
export OTP_VSN ?= $(shell $(CURDIR)/scripts/get-otp-vsn.sh)
|
export OTP_VSN ?= $(shell $(CURDIR)/scripts/get-otp-vsn.sh)
|
||||||
export ELIXIR_VSN ?= $(shell $(CURDIR)/scripts/get-elixir-vsn.sh)
|
export ELIXIR_VSN ?= $(shell $(CURDIR)/scripts/get-elixir-vsn.sh)
|
||||||
export EMQX_DASHBOARD_VERSION ?= v1.0.7
|
export EMQX_DASHBOARD_VERSION ?= v1.0.8
|
||||||
export EMQX_EE_DASHBOARD_VERSION ?= e1.0.0
|
export EMQX_EE_DASHBOARD_VERSION ?= e1.0.0
|
||||||
export EMQX_REL_FORM ?= tgz
|
export EMQX_REL_FORM ?= tgz
|
||||||
export QUICER_DOWNLOAD_FROM_RELEASE = 1
|
export QUICER_DOWNLOAD_FROM_RELEASE = 1
|
||||||
|
|
|
@ -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.6").
|
-define(EMQX_RELEASE_CE, "5.0.7").
|
||||||
|
|
||||||
%% Enterprise edition
|
%% Enterprise edition
|
||||||
-define(EMQX_RELEASE_EE, "5.0.0-alpha.1").
|
-define(EMQX_RELEASE_EE, "5.0.0-alpha.1").
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{id, "emqx"},
|
{id, "emqx"},
|
||||||
{description, "EMQX Core"},
|
{description, "EMQX Core"},
|
||||||
% strict semver, bump manually!
|
% strict semver, bump manually!
|
||||||
{vsn, "5.0.7"},
|
{vsn, "5.0.8"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -869,7 +869,7 @@ fields("mqtt_quic_listener") ->
|
||||||
sc(
|
sc(
|
||||||
duration_ms(),
|
duration_ms(),
|
||||||
#{
|
#{
|
||||||
default => "0",
|
default => 0,
|
||||||
desc => ?DESC(fields_mqtt_quic_listener_idle_timeout)
|
desc => ?DESC(fields_mqtt_quic_listener_idle_timeout)
|
||||||
}
|
}
|
||||||
)},
|
)},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_authn, [
|
{application, emqx_authn, [
|
||||||
{description, "EMQX Authentication"},
|
{description, "EMQX Authentication"},
|
||||||
{vsn, "0.1.5"},
|
{vsn, "0.1.6"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_authn_sup, emqx_authn_registry]},
|
{registered, [emqx_authn_sup, emqx_authn_registry]},
|
||||||
{applications, [kernel, stdlib, emqx_resource, ehttpc, epgsql, mysql, jose]},
|
{applications, [kernel, stdlib, emqx_resource, ehttpc, epgsql, mysql, jose]},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_bridge, [
|
{application, emqx_bridge, [
|
||||||
{description, "An OTP application"},
|
{description, "An OTP application"},
|
||||||
{vsn, "0.1.2"},
|
{vsn, "0.1.3"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_bridge_app, []}},
|
{mod, {emqx_bridge_app, []}},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -584,9 +584,10 @@ pick_bridges_by_id(Type, Name, BridgesAllNodes) ->
|
||||||
|
|
||||||
format_bridge_info([FirstBridge | _] = Bridges) ->
|
format_bridge_info([FirstBridge | _] = Bridges) ->
|
||||||
Res = maps:remove(node, FirstBridge),
|
Res = maps:remove(node, FirstBridge),
|
||||||
|
NRes = emqx_connector_ssl:drop_invalid_certs(Res),
|
||||||
NodeStatus = collect_status(Bridges),
|
NodeStatus = collect_status(Bridges),
|
||||||
NodeMetrics = collect_metrics(Bridges),
|
NodeMetrics = collect_metrics(Bridges),
|
||||||
Res#{
|
NRes#{
|
||||||
status => aggregate_status(NodeStatus),
|
status => aggregate_status(NodeStatus),
|
||||||
node_status => NodeStatus,
|
node_status => NodeStatus,
|
||||||
metrics => aggregate_metrics(NodeMetrics),
|
metrics => aggregate_metrics(NodeMetrics),
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_connector, [
|
{application, emqx_connector, [
|
||||||
{description, "An OTP application"},
|
{description, "An OTP application"},
|
||||||
{vsn, "0.1.4"},
|
{vsn, "0.1.5"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_connector_app, []}},
|
{mod, {emqx_connector_app, []}},
|
||||||
{applications, [
|
{applications, [
|
||||||
|
|
|
@ -18,27 +18,89 @@
|
||||||
|
|
||||||
-export([
|
-export([
|
||||||
convert_certs/2,
|
convert_certs/2,
|
||||||
|
drop_invalid_certs/1,
|
||||||
clear_certs/2
|
clear_certs/2
|
||||||
]).
|
]).
|
||||||
|
|
||||||
convert_certs(RltvDir, NewConfig) ->
|
%% TODO: rm `connector` case after `dev/ee5.0` merged into `master`.
|
||||||
NewSSL = map_get_oneof([<<"ssl">>, ssl], NewConfig, undefined),
|
%% The `connector` config layer will be removed.
|
||||||
case emqx_tls_lib:ensure_ssl_files(RltvDir, NewSSL) of
|
%% for bridges with `connector` field. i.e. `mqtt_source` and `mqtt_sink`
|
||||||
{ok, NewSSL1} ->
|
convert_certs(RltvDir, #{<<"connector">> := Connector} = Config) when
|
||||||
{ok, new_ssl_config(NewConfig, NewSSL1)};
|
is_map(Connector)
|
||||||
|
->
|
||||||
|
SSL = map_get_oneof([<<"ssl">>, ssl], Connector, undefined),
|
||||||
|
new_ssl_config(RltvDir, Config, SSL);
|
||||||
|
convert_certs(RltvDir, #{connector := Connector} = Config) when
|
||||||
|
is_map(Connector)
|
||||||
|
->
|
||||||
|
SSL = map_get_oneof([<<"ssl">>, ssl], Connector, undefined),
|
||||||
|
new_ssl_config(RltvDir, Config, SSL);
|
||||||
|
%% for bridges without `connector` field. i.e. webhook
|
||||||
|
convert_certs(RltvDir, #{<<"ssl">> := SSL} = Config) ->
|
||||||
|
new_ssl_config(RltvDir, Config, SSL);
|
||||||
|
convert_certs(RltvDir, #{ssl := SSL} = Config) ->
|
||||||
|
new_ssl_config(RltvDir, Config, SSL);
|
||||||
|
%% for bridges use connector name
|
||||||
|
convert_certs(_RltvDir, Config) ->
|
||||||
|
{ok, Config}.
|
||||||
|
|
||||||
|
clear_certs(RltvDir, #{<<"connector">> := Connector} = _Config) when
|
||||||
|
is_map(Connector)
|
||||||
|
->
|
||||||
|
OldSSL = map_get_oneof([<<"ssl">>, ssl], Connector, undefined),
|
||||||
|
ok = emqx_tls_lib:delete_ssl_files(RltvDir, undefined, OldSSL);
|
||||||
|
clear_certs(RltvDir, #{connector := Connector} = _Config) when
|
||||||
|
is_map(Connector)
|
||||||
|
->
|
||||||
|
OldSSL = map_get_oneof([<<"ssl">>, ssl], Connector, undefined),
|
||||||
|
ok = emqx_tls_lib:delete_ssl_files(RltvDir, undefined, OldSSL);
|
||||||
|
clear_certs(RltvDir, #{<<"ssl">> := OldSSL} = _Config) ->
|
||||||
|
ok = emqx_tls_lib:delete_ssl_files(RltvDir, undefined, OldSSL);
|
||||||
|
clear_certs(RltvDir, #{ssl := OldSSL} = _Config) ->
|
||||||
|
ok = emqx_tls_lib:delete_ssl_files(RltvDir, undefined, OldSSL);
|
||||||
|
clear_certs(_RltvDir, _) ->
|
||||||
|
ok.
|
||||||
|
|
||||||
|
drop_invalid_certs(#{<<"connector">> := Connector} = Config) when
|
||||||
|
is_map(Connector)
|
||||||
|
->
|
||||||
|
SSL = map_get_oneof([<<"ssl">>, ssl], Connector, undefined),
|
||||||
|
NewSSL = emqx_tls_lib:drop_invalid_certs(SSL),
|
||||||
|
new_ssl_config(Config, NewSSL);
|
||||||
|
drop_invalid_certs(#{connector := Connector} = Config) when
|
||||||
|
is_map(Connector)
|
||||||
|
->
|
||||||
|
SSL = map_get_oneof([<<"ssl">>, ssl], Connector, undefined),
|
||||||
|
NewSSL = emqx_tls_lib:drop_invalid_certs(SSL),
|
||||||
|
new_ssl_config(Config, NewSSL);
|
||||||
|
drop_invalid_certs(#{<<"ssl">> := SSL} = Config) ->
|
||||||
|
NewSSL = emqx_tls_lib:drop_invalid_certs(SSL),
|
||||||
|
new_ssl_config(Config, NewSSL);
|
||||||
|
drop_invalid_certs(#{ssl := SSL} = Config) ->
|
||||||
|
NewSSL = emqx_tls_lib:drop_invalid_certs(SSL),
|
||||||
|
new_ssl_config(Config, NewSSL);
|
||||||
|
%% for bridges use connector name
|
||||||
|
drop_invalid_certs(Config) ->
|
||||||
|
Config.
|
||||||
|
|
||||||
|
new_ssl_config(RltvDir, Config, SSL) ->
|
||||||
|
case emqx_tls_lib:ensure_ssl_files(RltvDir, SSL) of
|
||||||
|
{ok, NewSSL} ->
|
||||||
|
{ok, new_ssl_config(Config, NewSSL)};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
{error, {bad_ssl_config, Reason}}
|
{error, {bad_ssl_config, Reason}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
clear_certs(_RltvDir, undefined) ->
|
new_ssl_config(#{connector := Connector} = Config, NewSSL) ->
|
||||||
ok;
|
Config#{connector => Connector#{ssl => NewSSL}};
|
||||||
clear_certs(RltvDir, Config) ->
|
new_ssl_config(#{<<"connector">> := Connector} = Config, NewSSL) ->
|
||||||
OldSSL = map_get_oneof([<<"ssl">>, ssl], Config, undefined),
|
Config#{<<"connector">> => Connector#{<<"ssl">> => NewSSL}};
|
||||||
ok = emqx_tls_lib:delete_ssl_files(RltvDir, undefined, OldSSL).
|
new_ssl_config(#{ssl := _} = Config, NewSSL) ->
|
||||||
|
Config#{ssl => NewSSL};
|
||||||
new_ssl_config(Config, undefined) -> Config;
|
new_ssl_config(#{<<"ssl">> := _} = Config, NewSSL) ->
|
||||||
new_ssl_config(Config, #{<<"enable">> := _} = SSL) -> Config#{<<"ssl">> => SSL};
|
Config#{<<"ssl">> => NewSSL};
|
||||||
new_ssl_config(Config, #{enable := _} = SSL) -> Config#{ssl => SSL}.
|
new_ssl_config(Config, _NewSSL) ->
|
||||||
|
Config.
|
||||||
|
|
||||||
map_get_oneof([], _Map, Default) ->
|
map_get_oneof([], _Map, Default) ->
|
||||||
Default;
|
Default;
|
||||||
|
|
|
@ -87,7 +87,6 @@ fields("connector") ->
|
||||||
sc(
|
sc(
|
||||||
binary(),
|
binary(),
|
||||||
#{
|
#{
|
||||||
default => "emqx",
|
|
||||||
desc => ?DESC("username")
|
desc => ?DESC("username")
|
||||||
}
|
}
|
||||||
)},
|
)},
|
||||||
|
@ -95,7 +94,6 @@ fields("connector") ->
|
||||||
sc(
|
sc(
|
||||||
binary(),
|
binary(),
|
||||||
#{
|
#{
|
||||||
default => "emqx",
|
|
||||||
desc => ?DESC("password")
|
desc => ?DESC("password")
|
||||||
}
|
}
|
||||||
)},
|
)},
|
||||||
|
@ -226,7 +224,7 @@ fields("egress") ->
|
||||||
sc(
|
sc(
|
||||||
binary(),
|
binary(),
|
||||||
#{
|
#{
|
||||||
required => true,
|
default => <<"${payload}">>,
|
||||||
desc => ?DESC("payload")
|
desc => ?DESC("payload")
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_exhook, [
|
{application, emqx_exhook, [
|
||||||
{description, "EMQX Extension for Hook"},
|
{description, "EMQX Extension for Hook"},
|
||||||
{vsn, "5.0.3"},
|
{vsn, "5.0.4"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_exhook_app, []}},
|
{mod, {emqx_exhook_app, []}},
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
%% -*- mode: erlang -*-
|
%% -*- mode: erlang -*-
|
||||||
{application, emqx_gateway, [
|
{application, emqx_gateway, [
|
||||||
{description, "The Gateway management application"},
|
{description, "The Gateway management application"},
|
||||||
{vsn, "0.1.4"},
|
{vsn, "0.1.5"},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{mod, {emqx_gateway_app, []}},
|
{mod, {emqx_gateway_app, []}},
|
||||||
{applications, [kernel, stdlib, grpc, emqx, emqx_authn]},
|
{applications, [kernel, stdlib, grpc, emqx, emqx_authn]},
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{application, emqx_management, [
|
{application, emqx_management, [
|
||||||
{description, "EMQX Management API and CLI"},
|
{description, "EMQX Management API and CLI"},
|
||||||
% strict semver, bump manually!
|
% strict semver, bump manually!
|
||||||
{vsn, "5.0.4"},
|
{vsn, "5.0.5"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_management_sup]},
|
{registered, [emqx_management_sup]},
|
||||||
{applications, [kernel, stdlib, emqx_plugins, minirest, emqx]},
|
{applications, [kernel, stdlib, emqx_plugins, minirest, emqx]},
|
||||||
|
|
|
@ -14,8 +14,8 @@ type: application
|
||||||
|
|
||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# 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.
|
# to the chart and its templates, including the app version.
|
||||||
version: 5
|
version: 5.0.7
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application.
|
# incremented each time you make changes to the application.
|
||||||
appVersion: latest
|
appVersion: 5.0.7
|
||||||
|
|
Loading…
Reference in New Issue