parent
8f35d13e17
commit
5689ad3485
|
@ -525,20 +525,20 @@ zone.external.idle_timeout = 15s
|
||||||
|
|
||||||
## Publish limit for the external MQTT connections.
|
## Publish limit for the external MQTT connections.
|
||||||
##
|
##
|
||||||
## Value: rate,burst
|
## Value: Number,Duration
|
||||||
## Default: 10 messages per second, and 100 messages burst.
|
## Example: 10 messages per minute.
|
||||||
## zone.external.publish_limit = 10,100
|
zone.external.publish_limit = 10,1m
|
||||||
|
|
||||||
## Enable ban check.
|
|
||||||
##
|
|
||||||
## Value: Flag
|
|
||||||
zone.external.enable_ban = on
|
|
||||||
|
|
||||||
## Enable ACL check.
|
## Enable ACL check.
|
||||||
##
|
##
|
||||||
## Value: Flag
|
## Value: Flag
|
||||||
zone.external.enable_acl = on
|
zone.external.enable_acl = on
|
||||||
|
|
||||||
|
## Enable ban check.
|
||||||
|
##
|
||||||
|
## Value: Flag
|
||||||
|
zone.external.enable_ban = on
|
||||||
|
|
||||||
## Enable per connection statistics.
|
## Enable per connection statistics.
|
||||||
##
|
##
|
||||||
## Value: on | off
|
## Value: on | off
|
||||||
|
@ -766,7 +766,7 @@ listener.tcp.external.zone = external
|
||||||
##
|
##
|
||||||
## Value: rate,burst
|
## Value: rate,burst
|
||||||
## Unit: Bps
|
## Unit: Bps
|
||||||
## listener.tcp.external.rate_limit = 1024,4096
|
listener.tcp.external.rate_limit = 1024,4096
|
||||||
|
|
||||||
## The access control rules for the MQTT/TCP listener.
|
## The access control rules for the MQTT/TCP listener.
|
||||||
##
|
##
|
||||||
|
|
|
@ -676,14 +676,14 @@ end}.
|
||||||
{datatype, {enum, [allow, deny]}}
|
{datatype, {enum, [allow, deny]}}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
%% @doc Enable Ban.
|
%% @doc Enable ACL check.
|
||||||
{mapping, "zone.$name.enable_ban", "emqx.zones", [
|
{mapping, "zone.$name.enable_acl", "emqx.zones", [
|
||||||
{default, off},
|
{default, off},
|
||||||
{datatype, flag}
|
{datatype, flag}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
%% @doc Enable ACL check.
|
%% @doc Enable Ban.
|
||||||
{mapping, "zone.$name.enable_acl", "emqx.zones", [
|
{mapping, "zone.$name.enable_ban", "emqx.zones", [
|
||||||
{default, off},
|
{default, off},
|
||||||
{datatype, flag}
|
{datatype, flag}
|
||||||
]}.
|
]}.
|
||||||
|
@ -696,7 +696,6 @@ end}.
|
||||||
|
|
||||||
%% @doc Publish limit of the MQTT connections.
|
%% @doc Publish limit of the MQTT connections.
|
||||||
{mapping, "zone.$name.publish_limit", "emqx.zones", [
|
{mapping, "zone.$name.publish_limit", "emqx.zones", [
|
||||||
{default, undefined},
|
|
||||||
{datatype, string}
|
{datatype, string}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
|
@ -850,6 +849,15 @@ end}.
|
||||||
{mqtt_wildcard_subscription, Val};
|
{mqtt_wildcard_subscription, Val};
|
||||||
("shared_subscription", Val) ->
|
("shared_subscription", Val) ->
|
||||||
{mqtt_shared_subscription, Val};
|
{mqtt_shared_subscription, Val};
|
||||||
|
("publish_limit", Val) ->
|
||||||
|
[Limit, Duration] = string:tokens(Val, ", "),
|
||||||
|
PubLimit = case cuttlefish_duration:parse(Duration, s) of
|
||||||
|
Secs when is_integer(Secs) ->
|
||||||
|
{list_to_integer(Limit) / Secs, list_to_integer(Limit)};
|
||||||
|
{error, Reason} ->
|
||||||
|
error(Reason)
|
||||||
|
end,
|
||||||
|
{publish_limit, PubLimit};
|
||||||
("force_gc_policy", Val) ->
|
("force_gc_policy", Val) ->
|
||||||
[Count, Bytes] = string:tokens(Val, "| "),
|
[Count, Bytes] = string:tokens(Val, "| "),
|
||||||
GcPolicy = case cuttlefish_bytesize:parse(Bytes) of
|
GcPolicy = case cuttlefish_bytesize:parse(Bytes) of
|
||||||
|
@ -862,12 +870,12 @@ end}.
|
||||||
("force_shutdown_policy", Val) ->
|
("force_shutdown_policy", Val) ->
|
||||||
[Len, Siz] = string:tokens(Val, "| "),
|
[Len, Siz] = string:tokens(Val, "| "),
|
||||||
ShutdownPolicy = case cuttlefish_bytesize:parse(Siz) of
|
ShutdownPolicy = case cuttlefish_bytesize:parse(Siz) of
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
error(Reason);
|
error(Reason);
|
||||||
Siz1 ->
|
Siz1 ->
|
||||||
#{message_queue_len => list_to_integer(Len),
|
#{message_queue_len => list_to_integer(Len),
|
||||||
total_heap_size => Siz1}
|
total_heap_size => Siz1}
|
||||||
end,
|
end,
|
||||||
{force_shutdown_policy, ShutdownPolicy};
|
{force_shutdown_policy, ShutdownPolicy};
|
||||||
(Opt, Val) ->
|
(Opt, Val) ->
|
||||||
{list_to_atom(Opt), Val}
|
{list_to_atom(Opt), Val}
|
||||||
|
|
Loading…
Reference in New Issue