From a54b4ddfd0a903c4e4ad389ebfcfd4f2925b2994 Mon Sep 17 00:00:00 2001 From: k32 <10274441+k32@users.noreply.github.com> Date: Wed, 2 Feb 2022 13:58:27 +0100 Subject: [PATCH] fix(emqx_schema): Set gen_rpc_client_driver automatically --- apps/emqx_conf/src/emqx_conf_schema.erl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/emqx_conf/src/emqx_conf_schema.erl b/apps/emqx_conf/src/emqx_conf_schema.erl index 5b98082a2..e63745402 100644 --- a/apps/emqx_conf/src/emqx_conf_schema.erl +++ b/apps/emqx_conf/src/emqx_conf_schema.erl @@ -459,13 +459,15 @@ fields("rpc") -> , {"keyfile", sc(file(), #{ mapping => "gen_rpc.keyfile" - , desc => "Path to the private key file for the rpc.certfile." + , desc => "Path to the private key file for the rpc.certfile.
" + "Note: contents of this file are secret, so it's necessary to set permissions to 600." })} , {"cacertfile", sc(file(), #{ mapping => "gen_rpc.cacertfile" , desc => "Path to certification authority TLS certificate file used to validate " - "rpc.certfile." + "rpc.certfile.
" + "Note: certificates of all nodes in the cluster must be signed by the same CA." })} , {"send_timeout", sc(emqx_schema:duration(), @@ -603,7 +605,7 @@ fields("authorization") -> emqx_schema:fields("authorization") ++ emqx_authz_schema:fields("authorization"). -translations() -> ["ekka", "kernel", "emqx"]. +translations() -> ["ekka", "kernel", "emqx", "gen_rpc"]. translation("ekka") -> [ {"cluster_discovery", fun tr_cluster_discovery/1}]; @@ -614,8 +616,14 @@ translation("emqx") -> [ {"config_files", fun tr_config_files/1} , {"cluster_override_conf_file", fun tr_cluster_override_conf_file/1} , {"local_override_conf_file", fun tr_local_override_conf_file/1} + ]; +translation("gen_rpc") -> + [ {"default_client_driver", fun tr_default_config_driver/1} ]. +tr_default_config_driver(Conf) -> + conf_get("rpc.driver", Conf). + tr_config_files(Conf) -> case conf_get("emqx.config_files", Conf) of [_ | _] = Files ->