From 3de0d71d0038974737a92f55d487d1972e0a151d Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Fri, 22 Apr 2022 17:25:53 +0800 Subject: [PATCH 1/5] fix: swagger crash --- apps/emqx_authz/i18n/emqx_authz_api_cache_i18n.conf | 6 ++++-- .../i18n/emqx_authz_api_settings_i18n.conf | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/emqx_authz/i18n/emqx_authz_api_cache_i18n.conf b/apps/emqx_authz/i18n/emqx_authz_api_cache_i18n.conf index 25bf5273e..31ad90fa1 100644 --- a/apps/emqx_authz/i18n/emqx_authz_api_cache_i18n.conf +++ b/apps/emqx_authz/i18n/emqx_authz_api_cache_i18n.conf @@ -1,6 +1,8 @@ emqx_authz_api_cache { authorization_cache_delete { - en: """Clean all authorization cache in the cluster.""" - zh: """清除集群中所有鉴权数据缓存""" + desc { + en: """Clean all authorization cache in the cluster.""" + zh: """清除集群中所有鉴权数据缓存""" + } } } diff --git a/apps/emqx_authz/i18n/emqx_authz_api_settings_i18n.conf b/apps/emqx_authz/i18n/emqx_authz_api_settings_i18n.conf index 72249e236..c739bedbb 100644 --- a/apps/emqx_authz/i18n/emqx_authz_api_settings_i18n.conf +++ b/apps/emqx_authz/i18n/emqx_authz_api_settings_i18n.conf @@ -1,11 +1,15 @@ emqx_authz_api_settings { authorization_settings_get { - en: """Get authorization settings""" - zh: """获取鉴权配置""" + desc { + en: """Get authorization settings""" + zh: """获取鉴权配置""" + } } authorization_settings_put { - en: """Update authorization settings""" - zh: """更新鉴权配置""" + desc { + en: """Update authorization settings""" + zh: """更新鉴权配置""" + } } } From 908019fff3d542a183c336bf405e9ba166e9e819 Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Fri, 22 Apr 2022 17:28:28 +0800 Subject: [PATCH 2/5] fix: only copy conf from ready node --- apps/emqx_conf/src/emqx_conf_app.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/emqx_conf/src/emqx_conf_app.erl b/apps/emqx_conf/src/emqx_conf_app.erl index b7e318665..7d596a737 100644 --- a/apps/emqx_conf/src/emqx_conf_app.erl +++ b/apps/emqx_conf/src/emqx_conf_app.erl @@ -39,7 +39,7 @@ init_conf() -> emqx_app:set_init_config_load_done(). copy_override_conf_from_core_node() -> - case nodes() of + case mria_mnesia:running_nodes() -- [node()] of [] -> %% The first core nodes is self. ?SLOG(debug, #{msg => "skip_copy_overide_conf_from_core_node"}), {ok, -1}; From 11a404842e358bc5d05755e1a4e4692c45333ff4 Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Fri, 22 Apr 2022 17:28:57 +0800 Subject: [PATCH 3/5] fix: don't show quic in dashboard --- apps/emqx/src/emqx_limiter/src/emqx_limiter_schema.erl | 2 +- apps/emqx/src/emqx_listeners.erl | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/emqx/src/emqx_limiter/src/emqx_limiter_schema.erl b/apps/emqx/src/emqx_limiter/src/emqx_limiter_schema.erl index 0ace62ac0..e6d63a7bf 100644 --- a/apps/emqx/src/emqx_limiter/src/emqx_limiter_schema.erl +++ b/apps/emqx/src/emqx_limiter/src/emqx_limiter_schema.erl @@ -86,7 +86,7 @@ roots() -> [limiter]. fields(limiter) -> [ {bytes_in, sc(ref(limiter_opts), #{desc => ?DESC(bytes_in)})}, - {message_in, sc(ref(limiter_opts), #{description => ?DESC(message_in)})}, + {message_in, sc(ref(limiter_opts), #{desc => ?DESC(message_in)})}, {connection, sc(ref(limiter_opts), #{desc => ?DESC(connection)})}, {message_routing, sc(ref(limiter_opts), #{desc => ?DESC(message_routing)})}, {batch, sc(ref(limiter_opts), #{desc => ?DESC(batch)})} diff --git a/apps/emqx/src/emqx_listeners.erl b/apps/emqx/src/emqx_listeners.erl index f3562572f..228b1ee96 100644 --- a/apps/emqx/src/emqx_listeners.erl +++ b/apps/emqx/src/emqx_listeners.erl @@ -63,7 +63,12 @@ id_example() -> 'tcp:default'. %% @doc List configured listeners. -spec list_raw() -> [{ListenerId :: atom(), Type :: binary(), ListenerConf :: map()}]. list_raw() -> - [{listener_id(Type, LName), Type, LConf} || {Type, LName, LConf} <- do_list_raw()]. + [ + {listener_id(Type, LName), Type, LConf} + || %% FIXME: quic is not supported update vi dashboard yet + {Type, LName, LConf} <- do_list_raw(), + Type =/= <<"quic">> + ]. list() -> Listeners = maps:to_list(emqx:get_config([listeners], #{})), From 52552c432c7dff6e1e9f4a9d4cfade48602b6370 Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Fri, 22 Apr 2022 18:02:02 +0800 Subject: [PATCH 4/5] chore: upgrade dashboard to v0.30.0 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 17437e5f9..3c31d62ab 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ export EMQX_DEFAULT_BUILDER = ghcr.io/emqx/emqx-builder/5.0-10:1.13.3-24.2.1-1-a export EMQX_DEFAULT_RUNNER = alpine:3.15.1 export OTP_VSN ?= $(shell $(CURDIR)/scripts/get-otp-vsn.sh) export ELIXIR_VSN ?= $(shell $(CURDIR)/scripts/get-elixir-vsn.sh) -export EMQX_DASHBOARD_VERSION ?= v0.29.0 +export EMQX_DASHBOARD_VERSION ?= v0.30.0 export DOCKERFILE := deploy/docker/Dockerfile export EMQX_REL_FORM ?= tgz ifeq ($(OS),Windows_NT) From 1fab779db879155023e8dc22e3a807d2999f964b Mon Sep 17 00:00:00 2001 From: JimMoen Date: Fri, 22 Apr 2022 19:26:44 +0800 Subject: [PATCH 5/5] fix(i18n): rm double quotes in i18n confs, add missing translation --- apps/emqx/i18n/emqx_schema_i18n.conf | 4 ++-- .../i18n/emqx_authz_schema_i18n.conf | 23 ++++++++++++++++--- .../i18n/emqx_dashboard_schema.conf | 4 ++-- .../emqx_gateway/i18n/emqx_coap_api_i18n.conf | 4 ++-- .../i18n/emqx_gateway_schema_i18n.conf | 2 +- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/apps/emqx/i18n/emqx_schema_i18n.conf b/apps/emqx/i18n/emqx_schema_i18n.conf index 5e724238b..c1df430db 100644 --- a/apps/emqx/i18n/emqx_schema_i18n.conf +++ b/apps/emqx/i18n/emqx_schema_i18n.conf @@ -618,7 +618,7 @@ mqtt 下所有的配置作为全局的默认值存在,它可以被 zone< mqtt_max_clientid_len { desc { - en: """"Maximum allowed length of MQTT clientId.""" + en: """Maximum allowed length of MQTT clientId.""" zh: """允许的最大 MQTT Client ID 长度""" } } @@ -824,7 +824,7 @@ Only works for the TLS connection.""" broker { desc { - en: """"Message broker options.""" + en: """Message broker options.""" zh: """Broker 相关配置项。""" } } diff --git a/apps/emqx_authz/i18n/emqx_authz_schema_i18n.conf b/apps/emqx_authz/i18n/emqx_authz_schema_i18n.conf index 39cc3abb2..7860dd7f0 100644 --- a/apps/emqx_authz/i18n/emqx_authz_schema_i18n.conf +++ b/apps/emqx_authz/i18n/emqx_authz_schema_i18n.conf @@ -20,18 +20,35 @@ NOTE: The source elements are identified by their 'type'. It is NOT allowed to configure two or more sources of the same type. """ - zh: """""" + zh: """ +鉴权数据源.
+鉴权(ACL)数据源的列表. +它被设计为一个数组,而不是一个散列映射, +所以可以作为链式访问控制.
+ +当授权一个 'publish' 或 'subscribe' 行为时, +该配置列表中的所有数据源将按顺序进行检查。 +如果在某个客户端未找到时(使用 ClientID 或 Username), +将会移动到下一个数据源. 直至得到 'allow' 或 'deny' 的结果.
+ +如果在任何数据源中都未找到对应的客户端信息, +配置的默认行为 ('authorization.no_match') 将生效.
+ +注意: +数据源使用 'type' 进行标识. +使用同一类型的数据源多于一次不被允许. +""" } label { en: """sources""" - zh: """""" + zh: """数据源""" } } authorization { desc { en: """Configuration related to the client authorization.""" - zh: """""" + zh: """客户端授权相关配置""" } label { en: """authorization""" diff --git a/apps/emqx_dashboard/i18n/emqx_dashboard_schema.conf b/apps/emqx_dashboard/i18n/emqx_dashboard_schema.conf index d7b2055bb..345b678cb 100644 --- a/apps/emqx_dashboard/i18n/emqx_dashboard_schema.conf +++ b/apps/emqx_dashboard/i18n/emqx_dashboard_schema.conf @@ -17,7 +17,7 @@ but use the same port.""" } sample_interval { desc { - en: """How often to update metrics displayed in the dashboard.
" + en: """How often to update metrics displayed in the dashboard.
Note: `sample_interval` should be a divisor of 60.""" zh: """更新仪表板中显示的指标的时间间隔。""" } @@ -154,7 +154,7 @@ Note: `sample_interval` should be a divisor of 60.""" } default_password { desc { - en: """The initial default password for dashboard 'admin' user.
" + en: """The initial default password for dashboard 'admin' user.
For safety, it should be changed as soon as possible.""" zh: """默认的仪表板用户密码
为了安全,应该尽快修改密码。""" diff --git a/apps/emqx_gateway/i18n/emqx_coap_api_i18n.conf b/apps/emqx_gateway/i18n/emqx_coap_api_i18n.conf index 022964fc3..77ca40c00 100644 --- a/apps/emqx_gateway/i18n/emqx_coap_api_i18n.conf +++ b/apps/emqx_gateway/i18n/emqx_coap_api_i18n.conf @@ -16,7 +16,7 @@ emqx_coap_api { method { desc { - en: """"Request method type""" + en: """Request method type""" zh: """请求 Method 类型""" } } @@ -30,7 +30,7 @@ emqx_coap_api { content_type { desc { - en: """"Payload type" """ + en: """Payload type""" zh: """Payload 类型""" } } diff --git a/apps/emqx_gateway/i18n/emqx_gateway_schema_i18n.conf b/apps/emqx_gateway/i18n/emqx_gateway_schema_i18n.conf index 3e87b8763..fb9a5377d 100644 --- a/apps/emqx_gateway/i18n/emqx_gateway_schema_i18n.conf +++ b/apps/emqx_gateway/i18n/emqx_gateway_schema_i18n.conf @@ -220,7 +220,7 @@ For example, after receiving an update message from a client, any messages withi lwm2m_update_msg_publish_condition { desc { - en: """"Policy for publishing UPDATE event message. + en: """Policy for publishing UPDATE event message. - always: send update events as long as the UPDATE request is received. - contains_object_list: send update events only if the UPDATE request carries any Object List """