From 91150e6d831d93ab508078769dc9c789fe7ba2c6 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 22 May 2023 23:07:47 +0200 Subject: [PATCH] chore: allow special chars in log dir the current valdiator does not allow space and ':' in log file path which is an unresonable restriction --- apps/emqx_conf/src/emqx_conf.app.src | 2 +- apps/emqx_conf/src/emqx_conf_schema.erl | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/apps/emqx_conf/src/emqx_conf.app.src b/apps/emqx_conf/src/emqx_conf.app.src index e6c3d9cd9..c31a16b9b 100644 --- a/apps/emqx_conf/src/emqx_conf.app.src +++ b/apps/emqx_conf/src/emqx_conf.app.src @@ -1,6 +1,6 @@ {application, emqx_conf, [ {description, "EMQX configuration management"}, - {vsn, "0.1.19"}, + {vsn, "0.1.20"}, {registered, []}, {mod, {emqx_conf_app, []}}, {applications, [kernel, stdlib, emqx_ctl]}, diff --git a/apps/emqx_conf/src/emqx_conf_schema.erl b/apps/emqx_conf/src/emqx_conf_schema.erl index 94cbfb221..76213c690 100644 --- a/apps/emqx_conf/src/emqx_conf_schema.erl +++ b/apps/emqx_conf/src/emqx_conf_schema.erl @@ -893,8 +893,7 @@ fields("log_file_handler") -> #{ desc => ?DESC("log_file_handler_file"), default => <<"${EMQX_LOG_DIR}/emqx.log">>, - converter => fun emqx_schema:naive_env_interpolation/1, - validator => fun validate_file_location/1 + converter => fun emqx_schema:naive_env_interpolation/1 } )}, {"rotation", @@ -1333,11 +1332,6 @@ emqx_schema_high_prio_roots() -> )}, lists:keyreplace("authorization", 1, Roots, Authz). -validate_file_location(File) -> - ValidFile = "^[/\\_a-zA-Z0-9\\.\\-]*$", - Error = "Invalid file name: " ++ ValidFile, - validator_string_re(File, ValidFile, Error). - validate_time_offset(Offset) -> ValidTimeOffset = "^([\\-\\+][0-1][0-9]:[0-6][0-9]|system|utc)$", Error =