Przeglądaj źródła

chore(gw): remove needless files

JianBo He 4 lat temu
rodzic
commit
835eb84b5d

Plik diff jest za duży
+ 0 - 82
apps/emqx_gateway/etc/emqx_coap.conf


Plik diff jest za duży
+ 0 - 149
apps/emqx_gateway/etc/emqx_lwm2m.conf


+ 0 - 90
apps/emqx_gateway/etc/priv/emqx_coap.schema

@@ -1,90 +0,0 @@
-%%-*- mode: erlang -*-
-%% emqx_coap config mapping
-{mapping, "coap.bind.udp.$number", "emqx_coap.bind_udp", [
-  {datatype, ip},
-  {default, "0.0.0.0:5683"}
-]}.
-
-{mapping, "coap.enable_stats", "emqx_coap.enable_stats", [
-  {datatype, flag}
-]}.
-
-{mapping, "coap.bind.dtls.$number", "emqx_coap.bind_dtls", [
-  {datatype, ip},
-  {default, "0.0.0.0:5684"}
-]}.
-
-{mapping, "coap.dtls.keyfile", "emqx_coap.dtls_opts", [
-  {datatype, string}
-]}.
-
-{mapping, "coap.dtls.certfile", "emqx_coap.dtls_opts", [
-  {datatype, string}
-]}.
-
-{mapping, "coap.dtls.verify", "emqx_coap.dtls_opts", [
-  {default, verify_none},
-  {datatype, {enum, [verify_none, verify_peer]}}
-]}.
-
-{mapping, "coap.dtls.cacertfile", "emqx_coap.dtls_opts", [
-  {datatype, string}
-]}.
-
-{mapping, "coap.dtls.fail_if_no_peer_cert", "emqx_coap.dtls_opts", [
-  {datatype, {enum, [true, false]}}
-]}.
-
-{mapping, "coap.dtls.ciphers", "emqx_coap.dtls_opts", [
-  {datatype, string}
-]}.
-
-{translation, "emqx_coap.bind_udp", fun(Conf) ->
-  Options = cuttlefish_variable:filter_by_prefix("coap.bind.udp", Conf),
-  lists:map(fun({_, Bind}) ->
-    {Ip, Port} = cuttlefish_datatypes:from_string(Bind, ip),
-    Opts = case inet:parse_address(Ip) of
-    {ok, {_,_,_,_} = Address} ->
-      [inet, {ip, Address}];
-    {ok, {_,_,_,_,_,_,_,_} = Address} ->
-      [inet6, {ip, Address}]
-    end,
-    {Port, Opts}
-  end, Options)
-end}.
-
-{translation, "emqx_coap.bind_dtls", fun(Conf) ->
-  Options = cuttlefish_variable:filter_by_prefix("coap.bind.dtls", Conf),
-  lists:map(fun({_, Bind}) ->
-    {Ip, Port} = cuttlefish_datatypes:from_string(Bind, ip),
-    Opts = case inet:parse_address(Ip) of
-    {ok, {_,_,_,_} = Address} ->
-      [inet, {ip, Address}];
-    {ok, {_,_,_,_,_,_,_,_} = Address} ->
-      [inet6, {ip, Address}]
-    end,
-    {Port, Opts}
-  end, Options)
-end}.
-
-{translation, "emqx_coap.dtls_opts", fun(Conf) ->
-  Filter  = fun(Opts) -> [{K, V} || {K, V} <- Opts, V =/= undefined] end,
-
-  %% Ciphers
-  SplitFun = fun(undefined) -> undefined; (S) -> string:tokens(S, ",") end,
-  Ciphers =
-      case cuttlefish:conf_get("coap.dtls.ciphers", Conf, undefined) of
-          undefined ->
-              lists:append([ssl:cipher_suites(all, V, openssl) || V <- ['dtlsv1.2', 'dtlsv1']]);
-          C ->
-              SplitFun(C)
-      end,
-
-  Filter([{verify, cuttlefish:conf_get("coap.dtls.verify", Conf, undefined)},
-          {keyfile, cuttlefish:conf_get("coap.dtls.keyfile", Conf, undefined)},
-          {certfile, cuttlefish:conf_get("coap.dtls.certfile", Conf, undefined)},
-          {cacertfile, cuttlefish:conf_get("coap.dtls.cacertfile", Conf, undefined)},
-          {fail_if_no_peer_cert, cuttlefish:conf_get("coap.dtls.fail_if_no_peer_cert", Conf, undefined)},
-          {ciphers, Ciphers}])
-end}.
-

+ 0 - 38
apps/emqx_gateway/etc/priv/emqx_exhook.schema

@@ -1,38 +0,0 @@
-%%-*- mode: erlang -*-
-
-{mapping, "exhook.server.$name.url", "emqx_exhook.servers", [
-  {datatype, string}
-]}.
-
-{mapping, "exhook.server.$name.ssl.cacertfile", "emqx_exhook.servers", [
-  {datatype, string}
-]}.
-
-{mapping, "exhook.server.$name.ssl.certfile", "emqx_exhook.servers", [
-  {datatype, string}
-]}.
-
-{mapping, "exhook.server.$name.ssl.keyfile", "emqx_exhook.servers", [
-  {datatype, string}
-]}.
-
-{translation, "emqx_exhook.servers", fun(Conf) ->
-  Filter  = fun(Opts) -> [{K, V} || {K, V} <- Opts, V =/= undefined] end,
-  ServerOptions = fun(Prefix) ->
-                      case http_uri:parse(cuttlefish:conf_get(Prefix ++ ".url", Conf)) of
-                          {ok, {http, _, Host, Port, _, _}} ->
-                              [{scheme, http}, {host, Host}, {port, Port}];
-                          {ok, {https, _, Host, Port, _, _}} ->
-                              [{scheme, https}, {host, Host}, {port, Port},
-                               {ssl_options,
-                                 Filter([{ssl, true},
-                                         {certfile, cuttlefish:conf_get(Prefix ++ ".ssl.certfile", Conf, undefined)},
-                                         {keyfile, cuttlefish:conf_get(Prefix ++ ".ssl.keyfile", Conf, undefined)},
-                                         {cacertfile, cuttlefish:conf_get(Prefix ++ ".ssl.cacertfile", Conf, undefined)}
-                                        ])}];
-                          _ -> error(invalid_server_options)
-                      end
-                  end,
-  [{list_to_atom(Name), ServerOptions("exhook.server." ++ Name)}
-   || {["exhook", "server", Name, "url"], _} <- cuttlefish_variable:filter_by_prefix("exhook.server", Conf)]
-end}.

+ 0 - 220
apps/emqx_gateway/etc/priv/emqx_lwm2m.schema

@@ -1,220 +0,0 @@
-%% -*-: erlang -*-
-
-{mapping, "lwm2m.bind.udp.$number", "emqx_lwm2m.bind_udp", [
-  {datatype, ip},
-  {default, "0.0.0.0:5683"}
-]}.
-
-{mapping, "lwm2m.bind.dtls.$number", "emqx_lwm2m.bind_dtls", [
-  {datatype, ip},
-  {default, "0.0.0.0:5684"}
-]}.
-
-{mapping, "lwm2m.lifetime_min", "emqx_lwm2m.lifetime_min", [
-  {datatype, {duration, s}},
-  {default, 0}
-]}.
-
-{mapping, "lwm2m.lifetime_max", "emqx_lwm2m.lifetime_max", [
-  {datatype, {duration, s}},
-  {default, 315360000} %% 10 years
-]}.
-
-{mapping, "lwm2m.qmode_time_window", "emqx_lwm2m.qmode_time_window", [
-  {datatype, integer},
-  {default, 0}
-]}.
-
-{mapping, "lwm2m.auto_observe", "emqx_lwm2m.auto_observe", [
-  {datatype, string},
-  {default, "off"}  %% BACKW: v4.3.0
-]}.
-
-{mapping, "lwm2m.lb", "emqx_lwm2m.options", [
-  {datatype, atom},
-  {default, undefined}
-]}.
-
-{mapping, "lwm2m.opts.$name", "emqx_lwm2m.options", [
-  {datatype, bytesize}
-]}.
-
-{translation, "emqx_lwm2m.auto_observe", fun(Conf) ->
-  case cuttlefish:conf_get("lwm2m.auto_observe", Conf, "off") of
-    "off" -> false; %% BACKW: v4.3.0
-    "on"  -> true;  %% BACKW: v4.3.0
-    Str -> string:tokens(Str, ", ")
-  end
-end}.
-
-{translation, "emqx_lwm2m.bind_udp", fun(Conf) ->
-  Options = cuttlefish_variable:filter_by_prefix("lwm2m.bind.udp", Conf),
-  lists:map(fun({_, Bind}) ->
-    {Ip, Port} = cuttlefish_datatypes:from_string(Bind, ip),
-    Opts = case inet:parse_address(Ip) of
-             {ok, {_,_,_,_} = Address} ->
-               [inet, {ip, Address}];
-             {ok, {_,_,_,_,_,_,_,_} = Address} ->
-               [inet6, {ip, Address}]
-           end,
-    {Port, Opts}
-  end, Options)
-end}.
-
-{translation, "emqx_lwm2m.bind_dtls", fun(Conf) ->
-  Options = cuttlefish_variable:filter_by_prefix("lwm2m.bind.dtls", Conf),
-  lists:map(fun({_, Bind}) ->
-    {Ip, Port} = cuttlefish_datatypes:from_string(Bind, ip),
-    Opts = case inet:parse_address(Ip) of
-             {ok, {_,_,_,_} = Address} ->
-               [inet, {ip, Address}];
-             {ok, {_,_,_,_,_,_,_,_} = Address} ->
-               [inet6, {ip, Address}]
-           end,
-    {Port, Opts}
-  end, Options)
-end}.
-
-{translation, "emqx_lwm2m.options", fun(Conf) ->
-  Options = cuttlefish_variable:filter_by_prefix("lwm2m.opts", Conf),
-  Opts = lists:map(fun({[_,_, Key], Value}) ->
-    {list_to_atom(Key), Value}
-  end, Options),
-
-  case cuttlefish:conf_get("lwm2m.lb", Conf, undefined) of
-      undefined -> ignore;
-      _ ->
-          cuttlefish:warn("The 'lwm2m.lb' option has removed from v4.2.0!")
-  end,
-
-  Opts
-end}.
-
-{mapping, "lwm2m.mountpoint", "emqx_lwm2m.mountpoint", [
-  {datatype, string},
-  {default, ""}
-]}.
-
-{mapping, "lwm2m.topics.command", "emqx_lwm2m.topics", [
-  {datatype, string},
-  {default, "lwm2m/%e/dn/#"}
-]}.
-
-{mapping, "lwm2m.topics.response", "emqx_lwm2m.topics", [
-  {datatype, string},
-  {default, "lwm2m/%e/up/resp"}
-]}.
-
-{mapping, "lwm2m.topics.notify", "emqx_lwm2m.topics", [
-  {datatype, string},
-  {default, "lwm2m/%e/up/notify"}
-]}.
-
-{mapping, "lwm2m.topics.register", "emqx_lwm2m.topics", [
-  {datatype, string},
-  {default, "lwm2m/%e/up/resp"}
-]}.
-
-{mapping, "lwm2m.topics.update", "emqx_lwm2m.topics", [
-  {datatype, string},
-  {default, "lwm2m/%e/up/resp"}
-]}.
-
-{mapping, "lwm2m.update_msg_publish_condition", "emqx_lwm2m.update_msg_publish_condition", [
-  {datatype, {enum, [contains_object_list, always]}},
-  {default, contains_object_list}
-]}.
-
-{translation, "emqx_lwm2m.topics", fun(Conf) ->
-  Topics = cuttlefish_variable:filter_by_prefix("lwm2m.topics", Conf),
-  Opts = lists:map(fun({[_,_, Key], Value}) ->
-              {list_to_atom(Key), Value}
-            end, Topics),
-  Opts
-end}.
-
-{mapping, "lwm2m.xml_dir", "emqx_lwm2m.xml_dir", [
-  {datatype, string}
-]}.
-
-%% Plan to remove v5.0-alpha.1, please use lwm2m.dtls_opts.keyfile instead
-{mapping, "lwm2m.keyfile", "emqx_lwm2m.dtls_opts", [
-  {datatype, string}
-]}.
-
-%% Plan to remove v5.0-alpha.1, please use lwm2m.dtls_opts.certfile instead
-{mapping, "lwm2m.certfile", "emqx_lwm2m.dtls_opts", [
-  {datatype, string}
-]}.
-
-{mapping, "lwm2m.dtls.keyfile", "emqx_lwm2m.dtls_opts", [
-  {datatype, string}
-]}.
-
-{mapping, "lwm2m.dtls.certfile", "emqx_lwm2m.dtls_opts", [
-  {datatype, string}
-]}.
-
-{mapping, "lwm2m.dtls.verify", "emqx_lwm2m.dtls_opts", [
-  {default, verify_none},
-  {datatype, {enum, [verify_none, verify_peer]}}
-]}.
-
-{mapping, "lwm2m.dtls.cacertfile", "emqx_lwm2m.dtls_opts", [
-  {datatype, string}
-]}.
-
-{mapping, "lwm2m.dtls.fail_if_no_peer_cert", "emqx_lwm2m.dtls_opts", [
-  {datatype, {enum, [true, false]}}
-]}.
-
-{mapping, "lwm2m.dtls.ciphers", "emqx_lwm2m.dtls_opts", [
-  {datatype, string}
-]}.
-
-{mapping, "lwm2m.dtls.psk_ciphers", "emqx_lwm2m.dtls_opts", [
-  {datatype, string}
-]}.
-
-{translation, "emqx_lwm2m.dtls_opts", fun(Conf) ->
-  Filter  = fun(Opts) -> [{K, V} || {K, V} <- Opts, V =/= undefined] end,
-
-  %% compatible with before v4.2
-  %% It plan to remove at v5.0-alpha.1
-  OldKey = cuttlefish:conf_get("lwm2m.keyfile", Conf, undefined),
-  OldCert = cuttlefish:conf_get("lwm2m.certfile", Conf, undefined),
-
-  %% Ciphers
-  SplitFun = fun(undefined) -> undefined; (S) -> string:tokens(S, ",") end,
-  Ciphers =
-      case cuttlefish:conf_get("lwm2m.dtls.ciphers", Conf, undefined) of
-          undefined ->
-              [];
-          C ->
-              [{ciphers, SplitFun(C)}]
-      end,
-  PskCiphers =
-      case cuttlefish:conf_get("lwm2m.dtls.psk_ciphers", Conf, undefined) of
-          undefined ->
-              [];
-          C2 ->
-              Psk = lists:map(fun("PSK-AES128-CBC-SHA") -> {psk, aes_128_cbc, sha};
-                                     ("PSK-AES256-CBC-SHA") -> {psk, aes_256_cbc, sha};
-                                     ("PSK-3DES-EDE-CBC-SHA") -> {psk, '3des_ede_cbc', sha};
-                                     ("PSK-RC4-SHA") -> {psk, rc4_128, sha}
-                                  end, SplitFun(C2)),
-              [{ciphers, Psk}, {user_lookup_fun, {fun emqx_psk:lookup/3, <<>>}}]
-      end,
-  Ciphers /= []
-      andalso PskCiphers /= []
-         andalso cuttlefish:invalid("The 'lwm2m.dtls.ciphers' and 'lwm2m.dtls.psk_ciphers' cannot exist simultaneously."),
-
-  NCiphers = Ciphers ++ PskCiphers,
-
-  Filter([{verify, cuttlefish:conf_get("lwm2m.dtls.verify", Conf, undefined)},
-          {keyfile, cuttlefish:conf_get("lwm2m.dtls.keyfile", Conf, OldKey)},
-          {certfile, cuttlefish:conf_get("lwm2m.dtls.certfile", Conf, OldCert)},
-          {cacertfile, cuttlefish:conf_get("lwm2m.dtls.cacertfile", Conf, undefined)},
-          {fail_if_no_peer_cert, cuttlefish:conf_get("lwm2m.dtls.fail_if_no_peer_cert", Conf, undefined)} | NCiphers])
-end}.
-