diff --git a/apps/emqx/rebar.config b/apps/emqx/rebar.config index 0c0a09cc0..c5b591a79 100644 --- a/apps/emqx/rebar.config +++ b/apps/emqx/rebar.config @@ -29,7 +29,7 @@ {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.9.3"}}}, {ekka, {git, "https://github.com/emqx/ekka", {tag, "0.13.2"}}}, {gen_rpc, {git, "https://github.com/emqx/gen_rpc", {tag, "2.8.1"}}}, - {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.28.3"}}}, + {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.29.0"}}}, {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}}, {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}}, {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "1.0.0"}}} diff --git a/apps/emqx_prometheus/rebar.config b/apps/emqx_prometheus/rebar.config index 2a0f20495..66afda52e 100644 --- a/apps/emqx_prometheus/rebar.config +++ b/apps/emqx_prometheus/rebar.config @@ -4,7 +4,7 @@ {emqx, {path, "../emqx"}}, %% FIXME: tag this as v3.1.3 {prometheus, {git, "https://github.com/deadtrickster/prometheus.erl", {tag, "v4.8.1"}}}, - {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.28.3"}}} + {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.29.0"}}} ]}. {edoc_opts, [{preprocess, true}]}. diff --git a/bin/emqx b/bin/emqx index 0d27d7168..cac5cf655 100755 --- a/bin/emqx +++ b/bin/emqx @@ -169,6 +169,9 @@ usage() { echo " --no-permanent Install release package VERSION but" echo " don't make it permanent" ;; + check_config) + echo "Checks the EMQX config without generating any files" + ;; *) echo "Usage: $REL_NAME COMMAND [help]" echo '' @@ -184,6 +187,7 @@ usage() { echo " Up/Down-grade: upgrade | downgrade | install | uninstall" echo " Install info: ertspath | root_dir" echo " Runtime info: pid | ping | versions" + echo " Validate Config: check_config" echo " Advanced: console_clean | escript | rpc | rpcterms | eval | eval-erl" echo '' echo "Execute '$REL_NAME COMMAND help' for more information" @@ -211,7 +215,7 @@ fi ## IS_BOOT_COMMAND is set for later to inspect node name and cookie from hocon config (or env variable) case "${COMMAND}" in - start|console|console_clean|foreground) + start|console|console_clean|foreground|check_config) IS_BOOT_COMMAND='yes' ;; ertspath) @@ -525,6 +529,12 @@ relx_start_command() { "$START_OPTION" } +# Function to check configs without generating them +check_config() { + ## this command checks the configs without generating any files + call_hocon -v -s "$SCHEMA_MOD" -c "$EMQX_ETC_DIR"/emqx.conf check_schema +} + # Function to generate app.config and vm.args # sets two environment variables CONF_FILE and ARGS_FILE generate_config() { @@ -1030,6 +1040,10 @@ case "${COMMAND}" in shift relx_nodetool "eval" "$@" ;; + + check_config) + check_config + ;; *) usage "$COMMAND" exit 1 diff --git a/mix.exs b/mix.exs index fc802cb5e..714279cfd 100644 --- a/mix.exs +++ b/mix.exs @@ -66,7 +66,7 @@ defmodule EMQXUmbrella.MixProject do # in conflict by emqtt and hocon {:getopt, "1.0.2", override: true}, {:snabbkaffe, github: "kafka4beam/snabbkaffe", tag: "1.0.0", override: true}, - {:hocon, github: "emqx/hocon", tag: "0.28.3", override: true}, + {:hocon, github: "emqx/hocon", tag: "0.29.0", override: true}, {:emqx_http_lib, github: "emqx/emqx_http_lib", tag: "0.5.1", override: true}, {:esasl, github: "emqx/esasl", tag: "0.2.0"}, {:jose, github: "potatosalad/erlang-jose", tag: "1.11.2"}, diff --git a/rebar.config b/rebar.config index 37dce676d..58b4b079b 100644 --- a/rebar.config +++ b/rebar.config @@ -67,7 +67,7 @@ , {system_monitor, {git, "https://github.com/ieQu1/system_monitor", {tag, "3.0.3"}}} , {getopt, "1.0.2"} , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "1.0.0"}}} - , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.28.3"}}} + , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.29.0"}}} , {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.5.1"}}} , {esasl, {git, "https://github.com/emqx/esasl", {tag, "0.2.0"}}} , {jose, {git, "https://github.com/potatosalad/erlang-jose", {tag, "1.11.2"}}}