From 62df9f03ada00cb58ca6c3eebf9a2948e4d19ecc Mon Sep 17 00:00:00 2001 From: Zaiming Shi Date: Thu, 17 Jun 2021 16:46:45 +0200 Subject: [PATCH] fix(emqx_schema): add 'sensitive' flag for passowrd configs --- apps/emqx/src/emqx_schema.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/emqx/src/emqx_schema.erl b/apps/emqx/src/emqx_schema.erl index bee052926..cb631ea22 100644 --- a/apps/emqx/src/emqx_schema.erl +++ b/apps/emqx/src/emqx_schema.erl @@ -113,7 +113,11 @@ fields("rlog") -> fields("node") -> [ {"name", t(string(), "vm_args.-name", "emqx@127.0.0.1", "EMQX_NODE_NAME")} , {"ssl_dist_optfile", t(string(), "vm_args.-ssl_dist_optfile", undefined)} - , {"cookie", t(string(), "vm_args.-setcookie", "emqxsecretcookie", "EMQX_NODE_COOKIE")} + , {"cookie", hoconsc:t(string(), #{mapping => "vm_args.-setcookie", + default => "emqxsecretcookie", + sensitive => true, + override_env => "EMQX_NODE_COOKIE" + })} , {"data_dir", t(string(), "emqx.data_dir", undefined)} , {"heartbeat", t(flag(), undefined, false)} , {"async_threads", t(range(1, 1024), "vm_args.+A", undefined)} @@ -1098,7 +1102,10 @@ ssl(Mapping, Defaults) -> , {"honor_cipher_order", t(flag(), M("honor_cipher_order"), D("honor_cipher_order"))} , {"handshake_timeout", t(duration(), M("handshake_timeout"), D("handshake_timeout"))} , {"depth", t(integer(), M("depth"), D("depth"))} - , {"password", t(string(), M("key_password"), D("key_password"))} + , {"password", hoconsc:t(string(), #{mapping => M("key_password"), + default => D("key_password"), + sensitive => true + })} , {"dhfile", t(string(), M("dhfile"), D("dhfile"))} , {"server_name_indication", t(union(disable, string()), M("server_name_indication"), D("server_name_indication"))}