From 076f3e3068635ece2cef04c1c4edaa4b9658c798 Mon Sep 17 00:00:00 2001 From: Gilbert Wong Date: Tue, 12 Mar 2019 22:47:11 +0800 Subject: [PATCH] Fix schema bug --- etc/emqx.conf | 36 ------------------------------------ priv/emqx.schema | 28 +++++----------------------- 2 files changed, 5 insertions(+), 59 deletions(-) diff --git a/etc/emqx.conf b/etc/emqx.conf index 5361ab7da..758b0208b 100644 --- a/etc/emqx.conf +++ b/etc/emqx.conf @@ -779,16 +779,6 @@ listener.tcp.external.active_n = 100 ## Value: String listener.tcp.external.zone = external -## Mountpoint of the MQTT/TCP Listener. All the topics will be prefixed -## with the mountpoint path if this option is enabled. -## -## Variables in mountpoint path: -## - %c: clientid -## - %u: username -## -## Value: String -## listener.tcp.external.mountpoint = devicebound/ - ## Rate limit for the external MQTT/TCP connections. Format is 'rate,burst'. ## ## Value: rate,burst @@ -918,13 +908,6 @@ listener.tcp.internal.active_n = 1000 ## Value: String listener.tcp.internal.zone = internal -## Mountpoint of the MQTT/TCP Listener. -## -## See: listener.tcp.$name.mountpoint -## -## Value: String -## listener.tcp.internal.mountpoint = internal/ - ## Rate limit for the internal MQTT/TCP connections. ## ## See: listener.tcp.$name.rate_limit @@ -1030,11 +1013,6 @@ listener.ssl.external.active_n = 100 ## Value: String listener.ssl.external.zone = external -## Mountpoint of the MQTT/SSL Listener. -## -## Value: String -## listener.ssl.external.mountpoint = devicebound/ - ## The access control rules for the MQTT/SSL listener. ## ## See: listener.tcp.$name.access @@ -1281,13 +1259,6 @@ listener.ws.external.max_conn_rate = 1000 ## Value: String listener.ws.external.zone = external -## Mountpoint of the MQTT/WebSocket Listener. -## -## See: listener.tcp.$name.mountpoint -## -## Value: String -## listener.ws.external.mountpoint = devicebound/ - ## The access control for the MQTT/WebSocket listener. ## ## See: listener.tcp.$name.access @@ -1427,13 +1398,6 @@ listener.wss.external.max_conn_rate = 1000 ## Value: String listener.wss.external.zone = external -## Mountpoint of the MQTT/WebSocket/SSL Listener. -## -## See: listener.tcp.$name.mountpoint -## -## Value: String -## listener.wss.external.mountpoint = devicebound/ - ## The access control rules for the MQTT/WebSocket/SSL listener. ## ## See: listener.tcp.$name.access. diff --git a/priv/emqx.schema b/priv/emqx.schema index 5161d5e94..5dbbdfca0 100644 --- a/priv/emqx.schema +++ b/priv/emqx.schema @@ -866,15 +866,16 @@ end}. {force_shutdown_policy, ShutdownPolicy}; ("mqueue_priorities", Val) -> case Val of - "none" -> none; % NO_PRIORITY_TABLE + "none" -> {mqueue_priorities, none}; % NO_PRIORITY_TABLE _ -> - lists:foldl(fun(T, Acc) -> + MqueuePriorities = lists:foldl(fun(T, Acc) -> %% NOTE: space in "= " is intended - [{Topic, Prio}] = string:tokens(T, "= "), + [Topic, Prio] = string:tokens(T, "= "), P = list_to_integer(Prio), (P < 0 orelse P > 255) andalso error({bad_priority, Topic, Prio}), maps:put(iolist_to_binary(Topic), P, Acc) - end, string:tokens(Val, ",")) + end, #{}, string:tokens(Val, ",")), + {mqueue_priorities, MqueuePriorities} end; ("mountpoint", Val) -> {mountpoint, iolist_to_binary(Val)}; @@ -924,10 +925,6 @@ end}. {datatype, string} ]}. -{mapping, "listener.tcp.$name.mountpoint", "emqx.listeners", [ - {datatype, string} -]}. - {mapping, "listener.tcp.$name.rate_limit", "emqx.listeners", [ {default, undefined}, {datatype, string} @@ -1024,10 +1021,6 @@ end}. {datatype, string} ]}. -{mapping, "listener.ssl.$name.mountpoint", "emqx.listeners", [ - {datatype, string} -]}. - {mapping, "listener.ssl.$name.rate_limit", "emqx.listeners", [ {default, undefined}, {datatype, string} @@ -1174,10 +1167,6 @@ end}. {datatype, string} ]}. -{mapping, "listener.ws.$name.mountpoint", "emqx.listeners", [ - {datatype, string} -]}. - {mapping, "listener.ws.$name.rate_limit", "emqx.listeners", [ {default, undefined}, {datatype, string} @@ -1280,10 +1269,6 @@ end}. {datatype, string} ]}. -{mapping, "listener.wss.$name.mountpoint", "emqx.listeners", [ - {datatype, string} -]}. - {mapping, "listener.wss.$name.rate_limit", "emqx.listeners", [ {datatype, string} ]}. @@ -1423,8 +1408,6 @@ end}. end end, - MountPoint = fun(undefined) -> undefined; (S) -> list_to_binary(S) end, - Ratelimit = fun(undefined) -> undefined; (S) -> @@ -1442,7 +1425,6 @@ end}. {rate_limit, Ratelimit(cuttlefish:conf_get(Prefix ++ ".rate_limit", Conf, undefined))}, {proxy_protocol, cuttlefish:conf_get(Prefix ++ ".proxy_protocol", Conf, undefined)}, {proxy_protocol_timeout, cuttlefish:conf_get(Prefix ++ ".proxy_protocol_timeout", Conf, undefined)}, - {mountpoint, MountPoint(cuttlefish:conf_get(Prefix ++ ".mountpoint", Conf, undefined))}, {verify_protocol_header, cuttlefish:conf_get(Prefix ++ ".verify_protocol_header", Conf, undefined)}, {peer_cert_as_username, cuttlefish:conf_get(Prefix ++ ".peer_cert_as_username", Conf, undefined)}, {proxy_port_header, cuttlefish:conf_get(Prefix ++ ".proxy_port_header", Conf, undefined)},