From 35662c2c48146cc1fdcce3024e76bbd97ea7aa1c Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Tue, 20 Feb 2024 14:58:52 +0100 Subject: [PATCH] fix(schema): validate cluster strategy and node name If cluster strategy is configured as `dns`, the node name must be IP address --- apps/emqx_conf/src/emqx_conf_schema.erl | 59 +++++++++++++++- .../emqx_conf/test/emqx_conf_schema_tests.erl | 69 +++++++++++++++++++ changes/ce/fix-12541.en.md | 3 + 3 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 changes/ce/fix-12541.en.md diff --git a/apps/emqx_conf/src/emqx_conf_schema.erl b/apps/emqx_conf/src/emqx_conf_schema.erl index 914470ba47..5229abf102 100644 --- a/apps/emqx_conf/src/emqx_conf_schema.erl +++ b/apps/emqx_conf/src/emqx_conf_schema.erl @@ -42,6 +42,8 @@ %% internal exports for `emqx_enterprise_schema' only. -export([ensure_unicode_path/2, convert_rotation/2, log_handler_common_confs/2]). +-define(DEFAULT_NODE_NAME, <<"emqx@127.0.0.1">>). + %% Static apps which merge their configs into the merged emqx.conf %% The list can not be made a dynamic read at run-time as it is used %% by nodetool to generate app.