From f7e7c2e8513c8a2a410fa9be3592ad323967950e Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Mon, 28 Nov 2016 09:56:03 +0800 Subject: [PATCH 01/40] update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a3c80b552..7cf2d7a7c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -## Overview [![Build Status](https://travis-ci.org/emqtt/emqttd.svg?branch=master)](https://travis-ci.org/emqtt/emqttd) +# *EMQ* - Erlang MQTT Broker [![Build Status](https://travis-ci.org/emqtt/emqttd.svg?branch=master)](https://travis-ci.org/emqtt/emqttd) -emqttd is a massively scalable and clusterable MQTT V3.1/V3.1.1 broker written in Erlang/OTP. +*EMQ* is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP. emqttd is fully open source and licensed under the Apache Version 2.0. emqttd implements both MQTT V3.1 and V3.1.1 protocol specifications, and supports WebSocket, STOMP, SockJS, CoAP and MQTT-SN at the same time. From 56758077d80302590b61fa1dbf219d380299f42f Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Mon, 28 Nov 2016 13:08:51 +0800 Subject: [PATCH 02/40] add CONTRIBUTORS.md --- CONTRIBUTORS.md | 26 +++++++++ README.md | 138 ++++++++++++++---------------------------------- 2 files changed, 65 insertions(+), 99 deletions(-) create mode 100644 CONTRIBUTORS.md diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 000000000..0e2b17bb8 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,26 @@ + +* [@callbay](https://github.com/callbay) + +* [@lsxredrain](https://github.com/lsxredrain) + +* [@hejin1026](https://github.com/hejin1026) + +* [@desoulter](https://github.com/desoulter) + +* [@turtleDeng](https://github.com/turtleDeng) + +* [@Hades32](https://github.com/Hades32) + +* [@huangdan](https://github.com/huangdan) + +* [@phanimahesh](https://github.com/phanimahesh) + +* [@dvliman](https://github.com/dvliman) + +* [@vowstar](https://github.com/vowstar) + +* [@TheWaWaR](https://github.com/TheWaWaR) + +* [@hejin1026](https://github.com/hejin1026) + +* [@farhadi](https://github.com/farhadi) diff --git a/README.md b/README.md index 7cf2d7a7c..9f952ed2e 100644 --- a/README.md +++ b/README.md @@ -3,31 +3,18 @@ *EMQ* is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP. -emqttd is fully open source and licensed under the Apache Version 2.0. emqttd implements both MQTT V3.1 and V3.1.1 protocol specifications, and supports WebSocket, STOMP, SockJS, CoAP and MQTT-SN at the same time. +*EMQ* is fully open source and licensed under the Apache Version 2.0. *EMQ* implements both MQTT V3.1 and V3.1.1 protocol specifications, and supports MQTT-SN, CoAP, WebSocket, STOMP and SockJS at the same time. -emqttd requires Erlang R18+ to build since 1.1 release. +The *EMQ* project provides a scalable, reliable, enterprise-grade MQTT message Hub for IoT, M2M, Smart Hardware and Mobile Messaging Applications. -Follow us on Twitter: [@emqtt](https://twitter.com/emqtt) +The 1.0 release of the *EMQ* broker is scaling to 1.3 million concurrent MQTT connections on a 12 Core, 32G CentOS server. -## Cluster - -The **q.emqtt.com** hosts a public emqttd cluster on [QingCloud](https://qingcloud.com): - -![qing_cluster](http://emqtt.io/static/img/public_cluster.png) - -## Goals - -The emqttd project is aimed to implement a scalable, distributed, extensible open-source MQTT broker for IoT, M2M and Mobile applications that hope to handle millions of concurrent MQTT clients. - -* Easy to install -* Massively scalable -* Easy to extend -* Solid stable +The Company behind the open source *EMQ* broker: [emqtt.io](http://emqtt.io). Follow us on Twitter: [@emqtt](https://twitter.com/emqtt) ## Features -* Full MQTT V3.1/V3.1.1 protocol specification support -* QoS0, QoS1, QoS2 Publish and Subscribe +* Full MQTT V3.1/V3.1.1 support +* QoS0, QoS1, QoS2 Publish/Subscribe * Session Management and Offline Messages * Retained Message * Last Will Message @@ -42,17 +29,44 @@ The emqttd project is aimed to implement a scalable, distributed, extensible ope * IpAddress Authentication * Username and Password Authentication * Access control based on IpAddress, ClientID, Username -* Authentication with LDAP, Redis, MySQL, PostgreSQL and HTTP API -* Cluster brokers on several servers +* LDAP Authentication/ACL +* HTTP Authentication/ACL +* MySQL Authentication/ACL +* Redis Authentication/ACL +* PostgreSQL Authentication/ACL +* MongoDB Authentication/ACL +* Cluster brokers on several nodes * Bridge brokers locally or remotely * mosquitto, RSMB bridge -* Extensible architecture with Hooks, Modules and Plugins +* Extensible architecture with Hooks and Plugins * Passed eclipse paho interoperability tests * Local Subscription * Shared Subscription +## Installation + +The *EMQ* broker is cross-platform, which could be deployed on Linux, FreeBSD, Mac, Windows and even Raspberry Pi. + +Download the binary package for your platform from http://emqtt.io/downloads. + +Documentation on [emqtt.io/docs/v2/](http://emqtt.io/docs/v2/), [docs.emqtt.com](http://docs.emqtt.com/en/latest/) for installation and configuration guide. + +## Build From Source + +The *EMQ* broker requires Erlang/OTP R18+ to build. + +``` +git clone https://github.com/emqtt/emq-relx.git + +cd emq-relx && make + +cd _rel/emqttd && ./bin/emqttd console +``` + ## Plugins +The *EMQ* broker is highly extensible, with many hooks and plugins for customizing the authentication/ACL and integrating with other systems: + Plugin | Description -----------------------------------------------------------------------|-------------------------------------- [emq_plugin_template](https://github.com/emqtt/emq_plugin_template) | Plugin template and demo @@ -76,98 +90,24 @@ Plugin | Descrip [emq_reloader](https://github.com/emqtt/emq_reloader) | Reloader Plugin [emq_sockjs](https://github.com/emqtt/emq_sockjs) | SockJS(Stomp) Plugin -## Dashboard - -A Web Dashboard will be loaded when the emqttd broker started successfully. - -The Dashboard helps monitor broker's running status, statistics and metrics of MQTT packets. - -Default Address: http://localhost:18083 - -Default Login/Password: admin/public - -## Design - -![emqttd architecture](http://emqtt.io/static/img/architecture.png) - -## QuickStart - -Download binary package for Linux, Mac and Freebsd from [http://emqtt.io/downloads](http://emqtt.io/downloads). - -Installing on Ubuntu64, for example: - -```sh -unzip emqttd-ubuntu64-2.0-rc.2-20161019.zip && cd emqttd - -# start console -./bin/emqttd console - -# start as daemon -./bin/emqttd start - -# check status -./bin/emqttd_ctl status - -# stop -./bin/emqttd stop -``` - -Installing from source: - -``` -git clone https://github.com/emqtt/emq-relx.git - -cd emq-relx && make - -cd _rel/emqttd && ./bin/emqttd console -``` - -## Documents - -Read Documents on [emqttd-docs.rtfd.org](http://emqttd-docs.rtfd.org) for installation and configuration guide. - -## Benchmark - -Latest release of emqttd broker is scaling to 1.3 million MQTT connections on a 12 Core, 32G CentOS server. - -Benchmark 0.12.0-beta on a CentOS6 server with 8 Core, 32G memory from QingCloud: - -250K Connections, 250K Topics, 250K Subscriptions, 4K Qos1 Messages/Sec In, 20K Qos1 Messages/Sec Out, 8M+(bps) In, 40M+(bps) Out Traffic - -Consumed about 3.6G memory and 400+% CPU. - -Benchmark Report: [benchmark for 0.12.0 release](https://github.com/emqtt/emqttd/wiki/benchmark-for-0.12.0-release) - ## Supports * Twitter: [@emqtt](https://twitter.com/emqtt) * Homepage: http://emqtt.io * Downloads: http://emqtt.io/downloads -* Wiki: https://github.com/emqtt/emqttd/wiki +* Documentation: http://emqtt.io/docs/v2/ * Forum: https://groups.google.com/d/forum/emqtt * Mailing List: * Issues: https://github.com/emqtt/emqttd/issues * QQ Group: 12222225 -## Contributors - -* [@callbay](https://github.com/callbay) -* [@lsxredrain](https://github.com/lsxredrain) -* [@hejin1026](https://github.com/hejin1026) -* [@desoulter](https://github.com/desoulter) -* [@turtleDeng](https://github.com/turtleDeng) -* [@Hades32](https://github.com/Hades32) -* [@huangdan](https://github.com/huangdan) -* [@phanimahesh](https://github.com/phanimahesh) -* [@dvliman](https://github.com/dvliman) - ## Partners [QingCloud](https://qingcloud.com) is the world’s first IaaS provider that can deliver any number of IT resources in seconds and adopts a second-based billing system. QingCloud is committed to providing a reliable, secure, on-demand and real-time IT resource platform with excellent performance, which includes all components of a complete IT infrastructure system: computing, storage, networking and security. -## Author +The **q.emqtt.com** hosts a public Four-Node *EMQ* cluster on [QingCloud](https://qingcloud.com): -Feng Lee +![qing_cluster](http://emqtt.io/static/img/public_cluster.png) ## License From 795185c8a4dd93aac5d7db2a05040c0f381227d7 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Mon, 28 Nov 2016 13:21:03 +0800 Subject: [PATCH 03/40] fix documentation for install --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9f952ed2e..59a0ca2d5 100644 --- a/README.md +++ b/README.md @@ -45,11 +45,11 @@ The Company behind the open source *EMQ* broker: [emqtt.io](http://emqtt.io). Fo ## Installation -The *EMQ* broker is cross-platform, which could be deployed on Linux, FreeBSD, Mac, Windows and even Raspberry Pi. +The *EMQ* broker is cross-platform, which can be deployed on Linux, Unix, Mac, Windows and even Raspberry Pi. Download the binary package for your platform from http://emqtt.io/downloads. -Documentation on [emqtt.io/docs/v2/](http://emqtt.io/docs/v2/), [docs.emqtt.com](http://docs.emqtt.com/en/latest/) for installation and configuration guide. +Documentation on [emqtt.io/docs/v2/](http://emqtt.io/docs/v2/install.html), [docs.emqtt.com](http://docs.emqtt.com/en/latest/install.html) for installation and configuration guide. ## Build From Source From 62af23ec2e21591099eb6e8dfe0fb6c0b42c935b Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Mon, 28 Nov 2016 13:26:54 +0800 Subject: [PATCH 04/40] (Erlang MQTT Broker) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59a0ca2d5..08007bf91 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # *EMQ* - Erlang MQTT Broker [![Build Status](https://travis-ci.org/emqtt/emqttd.svg?branch=master)](https://travis-ci.org/emqtt/emqttd) -*EMQ* is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP. +*EMQ(Erlang MQTT Broker)* is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP. *EMQ* is fully open source and licensed under the Apache Version 2.0. *EMQ* implements both MQTT V3.1 and V3.1.1 protocol specifications, and supports MQTT-SN, CoAP, WebSocket, STOMP and SockJS at the same time. From 6e0d50597a0f5960f61d9a6ebf8ab1bddd414d38 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Mon, 28 Nov 2016 13:39:38 +0800 Subject: [PATCH 05/40] space --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 08007bf91..dbfa3485e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # *EMQ* - Erlang MQTT Broker [![Build Status](https://travis-ci.org/emqtt/emqttd.svg?branch=master)](https://travis-ci.org/emqtt/emqttd) -*EMQ(Erlang MQTT Broker)* is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP. +*EMQ (Erlang MQTT Broker)* is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP. *EMQ* is fully open source and licensed under the Apache Version 2.0. *EMQ* implements both MQTT V3.1 and V3.1.1 protocol specifications, and supports MQTT-SN, CoAP, WebSocket, STOMP and SockJS at the same time. From 78e4c342ff08615c05a58fbfe333a1cb087e1f96 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Mon, 28 Nov 2016 15:34:47 +0800 Subject: [PATCH 06/40] review --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dbfa3485e..658a83201 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ *EMQ* is fully open source and licensed under the Apache Version 2.0. *EMQ* implements both MQTT V3.1 and V3.1.1 protocol specifications, and supports MQTT-SN, CoAP, WebSocket, STOMP and SockJS at the same time. -The *EMQ* project provides a scalable, reliable, enterprise-grade MQTT message Hub for IoT, M2M, Smart Hardware and Mobile Messaging Applications. +*EMQ* provides a scalable, reliable, enterprise-grade MQTT message Hub for IoT, M2M, Smart Hardware and Mobile Messaging Applications. -The 1.0 release of the *EMQ* broker is scaling to 1.3 million concurrent MQTT connections on a 12 Core, 32G CentOS server. +The 1.0 release of the EMQ broker has scaled to 1.3 million concurrent MQTT connections on a 12 Core, 32G CentOS server. -The Company behind the open source *EMQ* broker: [emqtt.io](http://emqtt.io). Follow us on Twitter: [@emqtt](https://twitter.com/emqtt) +Please visit [emqtt.io](http://emqtt.io) for more service. Follow us on Twitter: [@emqtt](https://twitter.com/emqtt) ## Features From 1421a43da410577b911f31d02469bccc8ed1a2a2 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Tue, 29 Nov 2016 13:17:45 +0800 Subject: [PATCH 07/40] 2.0.1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a6c9af81f..a2248cc59 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PROJECT = emqttd PROJECT_DESCRIPTION = Erlang MQTT Broker -PROJECT_VERSION = 2.0 +PROJECT_VERSION = 2.0.1 DEPS = gproc lager gen_logger esockd mochiweb ## getopt pbkdf2 clique time_compat rand_compat From 6f2cdca40835c9498c3364c32b24adfc16be0381 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Wed, 30 Nov 2016 21:41:03 +0800 Subject: [PATCH 08/40] *EMQ* --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 658a83201..95a0a0d54 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # *EMQ* - Erlang MQTT Broker [![Build Status](https://travis-ci.org/emqtt/emqttd.svg?branch=master)](https://travis-ci.org/emqtt/emqttd) -*EMQ (Erlang MQTT Broker)* is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP. +*EMQ* (Erlang MQTT Broker) is a distributed, massively scalable, highly extensible MQTT message broker written in Erlang/OTP. *EMQ* is fully open source and licensed under the Apache Version 2.0. *EMQ* implements both MQTT V3.1 and V3.1.1 protocol specifications, and supports MQTT-SN, CoAP, WebSocket, STOMP and SockJS at the same time. From 0b9339105086246de0b1e6211006590039826ba1 Mon Sep 17 00:00:00 2001 From: turtled Date: Thu, 1 Dec 2016 10:39:14 +0800 Subject: [PATCH 09/40] fix issue#151 --- src/emqttd_session.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/emqttd_session.erl b/src/emqttd_session.erl index f53f363a4..b6add0581 100644 --- a/src/emqttd_session.erl +++ b/src/emqttd_session.erl @@ -332,10 +332,16 @@ handle_cast({unsubscribe, TopicTable}, Session = #session{client_id = Client end, Subscriptions, TopicTable), hibernate(Session#session{subscriptions = Subscriptions1}); -handle_cast({destroy, ClientId}, Session = #session{client_id = ClientId}) -> +handle_cast({destroy, ClientId}, Session = #session{client_id = ClientId, client_pid = undefined}) -> ?LOG(warning, "destroyed", [], Session), shutdown(destroy, Session); +%% +handle_cast({destroy, ClientId}, Session = #session{client_id = ClientId, client_pid = OldClientPid}) -> + ?LOG(warning, "kickedout~p", [OldClientPid], Session), + shutdown(conflict, Session); + + handle_cast({resume, ClientId, ClientPid}, Session = #session{client_id = ClientId, client_pid = OldClientPid, clean_sess = CleanSess, From fc14f4a3b6fad4d228000fce001ac659037121b9 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Thu, 1 Dec 2016 15:18:05 +0800 Subject: [PATCH 10/40] rename route table --- src/emqttd_router.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emqttd_router.erl b/src/emqttd_router.erl index bcbbb42e8..5a77c9914 100644 --- a/src/emqttd_router.erl +++ b/src/emqttd_router.erl @@ -284,11 +284,11 @@ code_change(_OldVsn, State, _Extra) -> clean_routes_(Node) -> Pattern = #mqtt_route{_ = '_', node = Node}, Clean = fun() -> - [mnesia:delete_object(route, R, write) || - R <- mnesia:match_object(route, Pattern, write)] + [mnesia:delete_object(mqtt_route, R, write) || + R <- mnesia:match_object(mqtt_route, Pattern, write)] end, mnesia:transaction(Clean). update_stats_() -> - emqttd_stats:setstats('routes/count', 'routes/max', mnesia:table_info(route, size)). + emqttd_stats:setstats('routes/count', 'routes/max', mnesia:table_info(mqtt_route, size)). From 281ab7b9293325763b75cd7bf810681d6ef00330 Mon Sep 17 00:00:00 2001 From: turtled Date: Thu, 1 Dec 2016 17:05:08 +0800 Subject: [PATCH 11/40] fixed stop appliaction error log --- src/emqttd.erl | 8 +++++++- src/emqttd_session.erl | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/emqttd.erl b/src/emqttd.erl index c360a5870..587a46306 100644 --- a/src/emqttd.erl +++ b/src/emqttd.erl @@ -22,7 +22,7 @@ -include("emqttd_protocol.hrl"). --export([start/0, env/1, env/2, is_running/1]). +-export([start/0, env/1, env/2, is_running/1, stop/0]). %% PubSub API -export([subscribe/1, subscribe/2, subscribe/3, publish/1, @@ -57,6 +57,12 @@ -spec(start() -> ok | {error, any()}). start() -> application:start(?APP). +%% @doc Stop emqttd application. +-spec(stop() -> ok | {error, any()}). +stop() -> + emqttd_plugins:unload(), + init:stop(). + %% @doc Environment -spec(env(Key:: atom()) -> {ok, any()} | undefined). env(Key) -> application:get_env(?APP, Key). diff --git a/src/emqttd_session.erl b/src/emqttd_session.erl index b6add0581..99de19d50 100644 --- a/src/emqttd_session.erl +++ b/src/emqttd_session.erl @@ -338,7 +338,7 @@ handle_cast({destroy, ClientId}, Session = #session{client_id = ClientId, client %% handle_cast({destroy, ClientId}, Session = #session{client_id = ClientId, client_pid = OldClientPid}) -> - ?LOG(warning, "kickedout~p", [OldClientPid], Session), + ?LOG(warning, "kicked out~p", [OldClientPid], Session), shutdown(conflict, Session); From 2181bd7850f4ea2783fa11dca609ab231b7a0c86 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Thu, 1 Dec 2016 19:12:45 +0800 Subject: [PATCH 12/40] unload --- src/emqttd.erl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/emqttd.erl b/src/emqttd.erl index 587a46306..8128d0789 100644 --- a/src/emqttd.erl +++ b/src/emqttd.erl @@ -14,7 +14,7 @@ %% limitations under the License. %%-------------------------------------------------------------------- -%% Facade Module for The EMQTT Broker +%% Facade Module for The EMQ Broker -module(emqttd). @@ -59,9 +59,7 @@ start() -> application:start(?APP). %% @doc Stop emqttd application. -spec(stop() -> ok | {error, any()}). -stop() -> - emqttd_plugins:unload(), - init:stop(). +stop() -> application:stop(?APP). %% @doc Environment -spec(env(Key:: atom()) -> {ok, any()} | undefined). From d62593a9c66fd4e15b5767957f93eec4fc8de5e5 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Fri, 2 Dec 2016 09:17:06 +0800 Subject: [PATCH 13/40] kickout --- src/emqttd_session.erl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/emqttd_session.erl b/src/emqttd_session.erl index 99de19d50..2313cadb7 100644 --- a/src/emqttd_session.erl +++ b/src/emqttd_session.erl @@ -336,12 +336,10 @@ handle_cast({destroy, ClientId}, Session = #session{client_id = ClientId, client ?LOG(warning, "destroyed", [], Session), shutdown(destroy, Session); -%% handle_cast({destroy, ClientId}, Session = #session{client_id = ClientId, client_pid = OldClientPid}) -> - ?LOG(warning, "kicked out~p", [OldClientPid], Session), + ?LOG(warning, "kickout ~p", [OldClientPid], Session), shutdown(conflict, Session); - handle_cast({resume, ClientId, ClientPid}, Session = #session{client_id = ClientId, client_pid = OldClientPid, clean_sess = CleanSess, From 03e2e7b8398734e103ac0e0288163b3080801de7 Mon Sep 17 00:00:00 2001 From: Feng Date: Sun, 4 Dec 2016 14:23:46 +0800 Subject: [PATCH 14/40] 2.0.2 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a2248cc59..d266170d9 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PROJECT = emqttd PROJECT_DESCRIPTION = Erlang MQTT Broker -PROJECT_VERSION = 2.0.1 +PROJECT_VERSION = 2.0.2 DEPS = gproc lager gen_logger esockd mochiweb ## getopt pbkdf2 clique time_compat rand_compat From 198fe84d91e6523ac911d3eb1baff8747ff4aa7b Mon Sep 17 00:00:00 2001 From: Feng Date: Sun, 4 Dec 2016 14:31:14 +0800 Subject: [PATCH 15/40] clean deps --- Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile b/Makefile index d266170d9..e8cf540a3 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,6 @@ PROJECT_DESCRIPTION = Erlang MQTT Broker PROJECT_VERSION = 2.0.2 DEPS = gproc lager gen_logger esockd mochiweb -## getopt pbkdf2 clique time_compat rand_compat dep_gproc = git https://github.com/uwiger/gproc dep_getopt = git https://github.com/jcomellas/getopt v0.8.2 @@ -11,10 +10,6 @@ dep_lager = git https://github.com/basho/lager master dep_gen_logger = git https://github.com/emqtt/gen_logger dep_esockd = git https://github.com/emqtt/esockd master dep_mochiweb = git https://github.com/emqtt/mochiweb -#dep_clique = git https://github.com/basho/clique -#dep_pbkdf2 = git https://github.com/basho/erlang-pbkdf2 2.0.0 -#dep_time_compat = git https://github.com/lasp-lang/time_compat -#dep_rand_compat = git https://github.com/lasp-lang/rand_compat TEST_DEPS = cuttlefish dep_cuttlefish = git https://github.com/emqtt/cuttlefish From fb50fbd13dab6de748542bd179d655bbae46caff Mon Sep 17 00:00:00 2001 From: huangdan Date: Sun, 4 Dec 2016 19:55:56 +0800 Subject: [PATCH 16/40] node_down clean_routes --- test/emqttd_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/emqttd_SUITE.erl b/test/emqttd_SUITE.erl index aeed5051f..c95a8b25e 100644 --- a/test/emqttd_SUITE.erl +++ b/test/emqttd_SUITE.erl @@ -480,7 +480,7 @@ cluster_node_down(_) -> [<<"#">>, <<"a/b/c">>] = [Topic || #mqtt_route{topic = Topic} <- Routes], slave:stop(Z), timer:sleep(1000), - Routes = lists:sort(emqttd_router:match(<<"a/b/c">>)). + [] = lists:sort(emqttd_router:match(<<"a/b/c">>)). set_alarms(_) -> AlarmTest = #mqtt_alarm{id = <<"1">>, severity = error, title="alarm title", summary="alarm summary"}, From 02067855777d39efc2f004bed23dea3a76d6ab8c Mon Sep 17 00:00:00 2001 From: turtled Date: Mon, 5 Dec 2016 15:00:09 +0800 Subject: [PATCH 17/40] fix ws metrics --- src/emqttd_ws.erl | 1 + src/emqttd_ws_client.erl | 1 + 2 files changed, 2 insertions(+) diff --git a/src/emqttd_ws.erl b/src/emqttd_ws.erl index 58cb6dc43..aba43dfee 100644 --- a/src/emqttd_ws.erl +++ b/src/emqttd_ws.erl @@ -55,6 +55,7 @@ ws_loop([<<>>], State, _ReplyChannel) -> ws_loop(Data, State = #wsocket_state{peer = Peer, client_pid = ClientPid, parser_fun = ParserFun}, ReplyChannel) -> ?WSLOG(debug, Peer, "RECV ~p", [Data]), + emqttd_metrics:inc('bytes/received', size(Data)), case catch ParserFun(iolist_to_binary(Data)) of {more, NewParser} -> State#wsocket_state{parser_fun = NewParser}; diff --git a/src/emqttd_ws_client.erl b/src/emqttd_ws_client.erl index 3ea9cdbdd..f9cce71d0 100644 --- a/src/emqttd_ws_client.erl +++ b/src/emqttd_ws_client.erl @@ -107,6 +107,7 @@ handle_cast({unsubscribe, Topics}, State) -> end, State); handle_cast({received, Packet}, State = #wsclient_state{peer = Peer, proto_state = ProtoState}) -> + emqttd_metrics:received(Packet), case emqttd_protocol:received(Packet, ProtoState) of {ok, ProtoState1} -> noreply(State#wsclient_state{proto_state = ProtoState1}); From e550b80974b8364cea60755a2fb156929da45468 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Tue, 6 Dec 2016 15:17:21 +0800 Subject: [PATCH 18/40] fix issue#796 --- priv/emq.schema | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/priv/emq.schema b/priv/emq.schema index 9e0846159..e128d1872 100644 --- a/priv/emq.schema +++ b/priv/emq.schema @@ -471,7 +471,7 @@ end}. %%-------------------------------------------------------------------- {mapping, "mqtt.listener.tcp", "emqttd.listeners", [ - {default, 1883}, + %% {default, 1883}, {datatype, [integer, ip]} ]}. @@ -517,7 +517,7 @@ end}. ]}. {mapping, "mqtt.listener.ssl", "emqttd.listeners", [ - {default, 8883}, + %% {default, 8883}, {datatype, [integer, ip]} ]}. @@ -561,7 +561,7 @@ end}. ]}. {mapping, "mqtt.listener.http", "emqttd.listeners", [ - {default, 8883}, + %% {default, 8083}, {datatype, [integer, ip]} ]}. @@ -576,9 +576,8 @@ end}. ]}. {mapping, "mqtt.listener.https", "emqttd.listeners", [ - {default, undefined}, + %%{default, 8084}, {datatype, [integer, ip]}, - hidden ]}. {mapping, "mqtt.listener.https.acceptors", "emqttd.listeners", [ From 0f55fafcb37bbd74621e8582b799794b2778060a Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Tue, 6 Dec 2016 15:24:15 +0800 Subject: [PATCH 19/40] rm 'hidden' --- priv/emq.schema | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/priv/emq.schema b/priv/emq.schema index e128d1872..1722522c4 100644 --- a/priv/emq.schema +++ b/priv/emq.schema @@ -270,8 +270,7 @@ end}. %% @doc Allow Anonymous {mapping, "mqtt.allow_anonymous", "emqttd.allow_anonymous", [ {default, false}, - {datatype, {enum, [true, false]}}, - hidden + {datatype, {enum, [true, false]}} ]}. %% @doc Default ACL File @@ -283,8 +282,7 @@ end}. %% @doc Cache ACL for PUBLISH {mapping, "mqtt.cache_acl", "emqttd.cache_acl", [ {default, true}, - {datatype, {enum, [true, false]}}, - hidden + {datatype, {enum, [true, false]}} ]}. %%-------------------------------------------------------------------- @@ -351,8 +349,7 @@ end}. %% @doc Topic Priority: 0~255, Default is 0 {mapping, "mqtt.queue.priority", "emqttd.queue", [ {default, ""}, - {datatype, string}, - hidden + {datatype, string} ]}. %% @doc Max queue length. Enqueued messages when persistent client disconnected, or inflight window is full. @@ -364,15 +361,13 @@ end}. %% @doc Low-water mark of queued messages {mapping, "mqtt.queue.low_watermark", "emqttd.queue", [ {default, "20%"}, - {datatype, string}, - hidden + {datatype, string} ]}. %% @doc High-water mark of queued messages {mapping, "mqtt.queue.high_watermark", "emqttd.queue", [ {default, "60%"}, - {datatype, string}, - hidden + {datatype, string} ]}. %% @doc Queue Qos0 messages? @@ -425,8 +420,7 @@ end}. {mapping, "mqtt.pubsub.async", "emqttd.pubsub", [ {default, true}, - {datatype, {enum, [true, false]}}, - hidden + {datatype, {enum, [true, false]}} ]}. {translation, "emqttd.pubsub", fun(Conf) -> @@ -487,8 +481,7 @@ end}. {mapping, "mqtt.listener.tcp.rate_limit", "emqttd.listeners", [ {default, undefined}, - {datatype, string}, - hidden + {datatype, string} ]}. {mapping, "mqtt.listener.tcp.backlog", "emqttd.listeners", [ @@ -577,7 +570,7 @@ end}. {mapping, "mqtt.listener.https", "emqttd.listeners", [ %%{default, 8084}, - {datatype, [integer, ip]}, + {datatype, [integer, ip]} ]}. {mapping, "mqtt.listener.https.acceptors", "emqttd.listeners", [ From 49ebed5b0b58228d5749168ba927969bcae2ce20 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Wed, 7 Dec 2016 18:37:47 +0800 Subject: [PATCH 20/40] iolist_size --- src/emqttd_client.erl | 4 ++-- src/emqttd_ws.erl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emqttd_client.erl b/src/emqttd_client.erl index 12bd2942a..931343efe 100644 --- a/src/emqttd_client.erl +++ b/src/emqttd_client.erl @@ -92,7 +92,7 @@ init([OriginConn, MqttEnv]) -> SendFun = fun(Packet) -> Data = emqttd_serializer:serialize(Packet), ?LOG(debug, "SEND ~p", [Data], #client_state{connname = ConnName}), - emqttd_metrics:inc('bytes/sent', size(Data)), + emqttd_metrics:inc('bytes/sent', iolist_size(Data)), try Connection:async_send(Data) of true -> ok catch @@ -184,7 +184,7 @@ handle_info(activate_sock, State) -> hibernate(run_socket(State#client_state{conn_state = running})); handle_info({inet_async, _Sock, _Ref, {ok, Data}}, State) -> - Size = size(Data), + Size = iolist_size(Data), ?LOG(debug, "RECV ~p", [Data], State), emqttd_metrics:inc('bytes/received', Size), received(Data, rate_limit(Size, State#client_state{await_recv = false})); diff --git a/src/emqttd_ws.erl b/src/emqttd_ws.erl index aba43dfee..cd48a45c1 100644 --- a/src/emqttd_ws.erl +++ b/src/emqttd_ws.erl @@ -55,7 +55,7 @@ ws_loop([<<>>], State, _ReplyChannel) -> ws_loop(Data, State = #wsocket_state{peer = Peer, client_pid = ClientPid, parser_fun = ParserFun}, ReplyChannel) -> ?WSLOG(debug, Peer, "RECV ~p", [Data]), - emqttd_metrics:inc('bytes/received', size(Data)), + emqttd_metrics:inc('bytes/received', iolist_size(Data)), case catch ParserFun(iolist_to_binary(Data)) of {more, NewParser} -> State#wsocket_state{parser_fun = NewParser}; From 7abc667f7df69011a1add7877f3b9bc47a6a8a41 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Wed, 7 Dec 2016 19:15:44 +0800 Subject: [PATCH 21/40] iolist_size/1 --- src/emqttd_ws_client.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emqttd_ws_client.erl b/src/emqttd_ws_client.erl index f9cce71d0..1fc9fa60f 100644 --- a/src/emqttd_ws_client.erl +++ b/src/emqttd_ws_client.erl @@ -69,7 +69,7 @@ init([MqttEnv, WsPid, Req, ReplyChannel]) -> %% SendFun = fun(Payload) -> ReplyChannel({binary, Payload}) end, SendFun = fun(Packet) -> Data = emqttd_serializer:serialize(Packet), - emqttd_metrics:inc('bytes/sent', size(Data)), + emqttd_metrics:inc('bytes/sent', iolist_size(Data)), ReplyChannel({binary, Data}) end, ProtoState = emqttd_protocol:init(Peername, SendFun, From 470a93393864572fe85b08b2286a4ba5e7b33a6a Mon Sep 17 00:00:00 2001 From: huangdan Date: Thu, 8 Dec 2016 18:06:48 +0800 Subject: [PATCH 22/40] Shared Subscription CLI --- src/emqttd_cli.erl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/emqttd_cli.erl b/src/emqttd_cli.erl index 16c6adb8d..0ec4f3680 100644 --- a/src/emqttd_cli.erl +++ b/src/emqttd_cli.erl @@ -528,6 +528,10 @@ print({ClientId, _ClientPid, _Persistent, SessInfo}) -> print(subscription, {Sub, Topic}) when is_pid(Sub) -> ?PRINT("~p -> ~s~n", [Sub, Topic]); +print(subscription, {Sub, {_Share, Topic}}) when is_pid(Sub) -> + ?PRINT("~p -> ~s~n", [Sub, Topic]); +print(subscription, {Sub, {_Share, Topic}}) -> + ?PRINT("~s -> ~s~n", [Sub, Topic]); print(subscription, {Sub, Topic}) -> ?PRINT("~s -> ~s~n", [Sub, Topic]). From fa99cdcaa55ec9760d86fd5188af3f061fcaafd2 Mon Sep 17 00:00:00 2001 From: huangdan Date: Thu, 8 Dec 2016 19:34:38 +0800 Subject: [PATCH 23/40] Local Subscription Routes show --- src/emqttd_cli.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/emqttd_cli.erl b/src/emqttd_cli.erl index 0ec4f3680..547f25e81 100644 --- a/src/emqttd_cli.erl +++ b/src/emqttd_cli.erl @@ -195,7 +195,8 @@ sessions(_) -> %%-------------------------------------------------------------------- %% @doc Routes Command routes(["list"]) -> - if_could_print(mqtt_route, fun print/1); + Routes = emqttd_router:dump(), + foreach(fun print/1, Routes); routes(["show", Topic]) -> print(mnesia:dirty_read(mqtt_route, bin(Topic))); @@ -506,9 +507,14 @@ print(#mqtt_client{client_id = ClientId, clean_sess = CleanSess, username = User %% print(#mqtt_topic{topic = Topic, flags = Flags}) -> %% ?PRINT("~s: ~s~n", [Topic, string:join([atom_to_list(F) || F <- Flags], ",")]); - +print({route, Routes}) -> + foreach(fun print/1, Routes); +print({local_route, Routes}) -> + foreach(fun print/1, Routes); print(#mqtt_route{topic = Topic, node = Node}) -> ?PRINT("~s -> ~s~n", [Topic, Node]); +print({Topic, Node}) -> + ?PRINT("~s -> ~s~n", [Topic, Node]); print({ClientId, _ClientPid, _Persistent, SessInfo}) -> InfoKeys = [clean_sess, From ed730f6827f64563db496d3f4146f7b0ad72ab6e Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Mon, 12 Dec 2016 19:25:49 +0800 Subject: [PATCH 24/40] Fix issue#814 - Cannot remove a 'DOWN' node from the cluster --- rebar.config | 2 +- src/emqttd_cluster.erl | 6 ++++-- src/emqttd_mnesia.erl | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rebar.config b/rebar.config index a95234dee..c9e0dbcf0 100644 --- a/rebar.config +++ b/rebar.config @@ -1,4 +1,4 @@ {deps, [ -{gproc,".*",{git,"https://github.com/uwiger/gproc",""}},{lager,".*",{git,"https://github.com/basho/lager","master"}},{gen_logger,".*",{git,"https://github.com/emqtt/gen_logger",""}},{esockd,".*",{git,"https://github.com/emqtt/esockd","emq20"}},{mochiweb,".*",{git,"https://github.com/emqtt/mochiweb",""}} +{gproc,".*",{git,"https://github.com/uwiger/gproc",""}},{lager,".*",{git,"https://github.com/basho/lager","master"}},{gen_logger,".*",{git,"https://github.com/emqtt/gen_logger",""}},{esockd,".*",{git,"https://github.com/emqtt/esockd","master"}},{mochiweb,".*",{git,"https://github.com/emqtt/mochiweb",""}} ]}. {erl_opts, [{parse_transform,lager_transform}]}. diff --git a/src/emqttd_cluster.erl b/src/emqttd_cluster.erl index 834de2d71..d5494a6b9 100644 --- a/src/emqttd_cluster.erl +++ b/src/emqttd_cluster.erl @@ -77,8 +77,10 @@ remove(Node) -> ok -> rpc:call(Node, ?MODULE, reboot, []); Error -> Error end; - Error -> - {error, Error} + {badrpc, nodedown} -> + emqttd_mnesia:remove_from_cluster(Node); + {badrpc, Reason} -> + {error, Reason} end. %% @doc Cluster status diff --git a/src/emqttd_mnesia.erl b/src/emqttd_mnesia.erl index 4b58d88d1..768d27cf0 100644 --- a/src/emqttd_mnesia.erl +++ b/src/emqttd_mnesia.erl @@ -187,8 +187,8 @@ remove_from_cluster(Node) when Node =/= node() -> ensure_ok(del_schema_copy(Node)), ensure_ok(rpc:call(Node, ?MODULE, delete_schema, [])); {true, false} -> - ensure_ok(del_schema_copy(Node)), - ensure_ok(rpc:call(Node, ?MODULE, delete_schema, [])); + ensure_ok(del_schema_copy(Node)); + %ensure_ok(rpc:call(Node, ?MODULE, delete_schema, [])); {false, _} -> {error, node_not_in_cluster} end. From ce2261d446fa4ba906d812041c4ad808af3cfed0 Mon Sep 17 00:00:00 2001 From: Feng Date: Mon, 12 Dec 2016 23:10:34 +0800 Subject: [PATCH 25/40] Version 2.0.3 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e8cf540a3..312918bbd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PROJECT = emqttd PROJECT_DESCRIPTION = Erlang MQTT Broker -PROJECT_VERSION = 2.0.2 +PROJECT_VERSION = 2.0.3 DEPS = gproc lager gen_logger esockd mochiweb From 8c1f5d7ec1cde8ecbc60b9a55f35ed1ccc2c5144 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Tue, 13 Dec 2016 10:27:05 +0800 Subject: [PATCH 26/40] Unauthorized --- src/emqttd_http.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emqttd_http.erl b/src/emqttd_http.erl index 2f1d32a44..e25f43e38 100644 --- a/src/emqttd_http.erl +++ b/src/emqttd_http.erl @@ -46,7 +46,7 @@ handle_request('GET', "/status", Req) -> handle_request('POST', "/mqtt/publish", Req) -> case authorized(Req) of true -> http_publish(Req); - false -> Req:respond({401, [], <<"Fobbiden">>}) + false -> Req:respond({401, [], <<"Unauthorized">>}) end; %%-------------------------------------------------------------------- From 696647f2cfcc4d5e85e82f2a93f93eceaf393552 Mon Sep 17 00:00:00 2001 From: turtled Date: Tue, 13 Dec 2016 15:57:22 +0800 Subject: [PATCH 27/40] fixed #413 --- src/emqttd_ws_client.erl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/emqttd_ws_client.erl b/src/emqttd_ws_client.erl index 1fc9fa60f..12968dceb 100644 --- a/src/emqttd_ws_client.erl +++ b/src/emqttd_ws_client.erl @@ -62,6 +62,7 @@ unsubscribe(CPid, Topics) -> %%-------------------------------------------------------------------- init([MqttEnv, WsPid, Req, ReplyChannel]) -> + process_flag(trap_exit, true), true = link(WsPid), {ok, Peername} = Req:get(peername), Headers = mochiweb_headers:to_list( @@ -171,6 +172,13 @@ handle_info({keepalive, check}, State = #wsclient_state{peer = Peer, shutdown(keepalive_error, State) end; +handle_info({'EXIT', WsPid, normal}, State = #wsclient_state{ws_pid = WsPid}) -> + stop(normal, State); + +handle_info({'EXIT', WsPid, Reason}, State = #wsclient_state{peer = Peer, ws_pid = WsPid}) -> + ?WSLOG(error, Peer, "shutdown: ~p",[Reason]), + shutdown(Reason, State); + handle_info(Info, State = #wsclient_state{peer = Peer}) -> ?WSLOG(critical, Peer, "Unexpected Info: ~p", [Info]), noreply(State). From 15a2b265be663fc981e55968796011cbf0d7315c Mon Sep 17 00:00:00 2001 From: turtled Date: Tue, 13 Dec 2016 16:57:18 +0800 Subject: [PATCH 28/40] fixed cluster fail --- src/emqttd_cluster.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emqttd_cluster.erl b/src/emqttd_cluster.erl index d5494a6b9..33eda2499 100644 --- a/src/emqttd_cluster.erl +++ b/src/emqttd_cluster.erl @@ -30,12 +30,12 @@ join(Node) when Node =:= node() -> {error, {cannot_join_with_self, Node}}; join(Node) when is_atom(Node) -> - case {is_clustered(Node), emqttd:is_running(Node)} of - {false, true} -> + case {net_adm:ping(Node), is_clustered(Node), emqttd:is_running(Node)} of + {pong, false, true} -> prepare(), ok = emqttd_mnesia:join_cluster(Node), reboot(); - {false, false} -> + {_, false, false} -> {error, {node_not_running, Node}}; - {true, _} -> + {_, true, _} -> {error, {already_clustered, Node}} end. From aa46cc0145fbb44559cd416c565faa639a2efe48 Mon Sep 17 00:00:00 2001 From: huangdan Date: Wed, 14 Dec 2016 13:45:59 +0800 Subject: [PATCH 29/40] ssl-oneway ct --- Makefile | 9 ++- test/emqttd_SUITE.erl | 65 ++++++++++++-------- test/emqttd_SUITE_data/certs/cacert.pem | 17 +++++ test/emqttd_SUITE_data/certs/cert.pem | 18 ++++++ test/emqttd_SUITE_data/certs/client-cert.pem | 18 ++++++ test/emqttd_SUITE_data/certs/client-key.pem | 27 ++++++++ test/emqttd_SUITE_data/certs/key.pem | 27 ++++++++ test/emqttd_SUITE_data/emqttd.conf | 4 +- 8 files changed, 155 insertions(+), 30 deletions(-) create mode 100644 test/emqttd_SUITE_data/certs/cacert.pem create mode 100644 test/emqttd_SUITE_data/certs/cert.pem create mode 100644 test/emqttd_SUITE_data/certs/client-cert.pem create mode 100644 test/emqttd_SUITE_data/certs/client-key.pem create mode 100644 test/emqttd_SUITE_data/certs/key.pem diff --git a/Makefile b/Makefile index 312918bbd..e2f1bdfeb 100644 --- a/Makefile +++ b/Makefile @@ -11,11 +11,14 @@ dep_gen_logger = git https://github.com/emqtt/gen_logger dep_esockd = git https://github.com/emqtt/esockd master dep_mochiweb = git https://github.com/emqtt/mochiweb -TEST_DEPS = cuttlefish -dep_cuttlefish = git https://github.com/emqtt/cuttlefish - ERLC_OPTS += +'{parse_transform, lager_transform}' +TEST_DEPS = cuttlefish emqttc +dep_cuttlefish = git https://github.com/emqtt/cuttlefish +dep_emqttc = git https://github.com/emqtt/emqttc + +NO_AUTOPATCH = cuttlefish + TEST_ERLC_OPTS += +debug_info TEST_ERLC_OPTS += +'{parse_transform, lager_transform}' diff --git a/test/emqttd_SUITE.erl b/test/emqttd_SUITE.erl index c95a8b25e..4ae7884e3 100644 --- a/test/emqttd_SUITE.erl +++ b/test/emqttd_SUITE.erl @@ -31,20 +31,19 @@ all() -> {group, pubsub}, {group, router}, {group, session}, - %%{group, retainer}, {group, broker}, {group, metrics}, {group, stats}, {group, hook}, {group, http}, {group, cluster}, - %%{group, backend}, {group, alarms}, {group, cli}]. groups() -> [{protocol, [sequence], - [mqtt_connect]}, + [mqtt_connect, + mqtt_ssl_oneway]}, {pubsub, [sequence], [subscribe_unsubscribe, publish, pubsub, @@ -66,8 +65,6 @@ groups() -> {hook, [sequence], [add_delete_hook, run_hooks]}, - {backend, [sequence], - []}, {http, [sequence], [request_status, request_publish @@ -101,7 +98,6 @@ groups() -> init_per_suite(Config) -> application:start(lager), DataDir = proplists:get_value(data_dir, Config), - peg_com(DataDir), start_apps(emqttd, DataDir), Config. @@ -129,6 +125,25 @@ connect_broker_(Packet, RecvSize) -> gen_tcp:close(Sock), Data. +mqtt_ssl_oneway(_) -> + {ok, SslOneWay} = emqttc:start_link([{host, "localhost"}, + {port, 8883}, + {client_id, <<"ssloneway">>}, ssl]), + timer:sleep(100), + emqttc:subscribe(SslOneWay, <<"topic">>, qos1), + + {ok, Pub} = emqttc:start_link([{host, "localhost"}, + {client_id, <<"pub">>}]), + timer:sleep(10), + emqttc:publish(Pub, <<"topic">>, <<"SSL oneWay test">>, [{qos, 1}]), + timer:sleep(10), + receive {publish, _Topic, RM} -> + ?assertEqual(<<"SSL oneWay test">>, RM) + after 1000 -> false + end, + emqttc:disconnect(SslOneWay), + emqttc:disconnect(Pub). + %%-------------------------------------------------------------------- %% PubSub Test %%-------------------------------------------------------------------- @@ -597,27 +612,27 @@ start_apps(App, DataDir) -> Schema = cuttlefish_schema:files([filename:join([DataDir, atom_to_list(App) ++ ".schema"])]), Conf = conf_parse:file(filename:join([DataDir, atom_to_list(App) ++ ".conf"])), NewConfig = cuttlefish_generator:map(Schema, Conf), - Vals = proplists:get_value(App, NewConfig), + Vals = merge_opts(App, DataDir, proplists:get_value(App, NewConfig)), [application:set_env(App, Par, Value) || {Par, Value} <- Vals], application:ensure_all_started(App). -peg_com(DataDir) -> - ParsePeg = file2(3, DataDir, "conf_parse.peg"), - neotoma:file(ParsePeg), - ParseErl = file2(3, DataDir, "conf_parse.erl"), - compile:file(ParseErl, []), - - DurationPeg = file2(3, DataDir, "cuttlefish_duration_parse.peg"), - neotoma:file(DurationPeg), - DurationErl = file2(3, DataDir, "cuttlefish_duration_parse.erl"), - compile:file(DurationErl, []). - - -file2(Times, Dir, FileName) when Times < 1 -> - filename:join([Dir, "deps", "cuttlefish","src", FileName]); - -file2(Times, Dir, FileName) -> - Dir1 = filename:dirname(Dir), - file2(Times - 1, Dir1, FileName). +merge_opts(emqttd, DataDir, Vals) -> + Listeners = proplists:get_value(listeners, Vals), + NewListeners = lists:foldl(fun({Protocol, Port, Opts} = Listener, Acc) -> + case Protocol of + ssl -> + SslOpts = proplists:get_value(ssl, Opts), + Keyfile = filename:join([DataDir, proplists:get_value(keyfile, SslOpts)]), + Certfile = filename:join([DataDir, proplists:get_value(certfile, SslOpts)]), + TupleList2 = lists:keyreplace(keyfile, 1, SslOpts, {keyfile, Keyfile}), + TupleList3 = lists:keyreplace(certfile, 1, TupleList2, {certfile, Certfile}), + [{Protocol, Port, [{ssl, TupleList3}]} | Acc]; + _ -> + [Listener | Acc] + end + end, [], Listeners), + lists:keyreplace(listeners, 1, Vals, {listeners, NewListeners}); +merge_opts(_, _, Vals) -> + Vals. diff --git a/test/emqttd_SUITE_data/certs/cacert.pem b/test/emqttd_SUITE_data/certs/cacert.pem new file mode 100644 index 000000000..ca4948ed9 --- /dev/null +++ b/test/emqttd_SUITE_data/certs/cacert.pem @@ -0,0 +1,17 @@ +-----BEGIN CERTIFICATE----- +MIICxjCCAa6gAwIBAgIJAPhU8tv3KMe/MA0GCSqGSIb3DQEBCwUAMBMxETAPBgNV +BAMMCE15VGVzdENBMB4XDTE2MTAzMTA3MTU0NVoXDTE3MTAzMTA3MTU0NVowEzER +MA8GA1UEAwwITXlUZXN0Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQCtPcDnmjiVl7ScDhYvGaW+PUgfp7P5cM39mnrW6fkxhA0tgunWpWlYVKbcuh5y +4bTNYrOQpcFO3Zg62tva4XEL8O1huqTlGsAeysZ3vWE4/8NGN/3wZy0TKDvwiwOB +tbS3C5wcRQZohExL6yEL4XzDGk44x2mIs8/NzeG7Zycqybh9tsCJiHbLiTxnLa24 +v5USOtlvWye0hA0yUUqc2k7tKVmIMT4A4ulMb2sDVRrSLjyFDTI0c8grlPLfKbG8 +gpYLsHn9aAjqviyvmJdRLxwauqn+ghNWn1TyZwgAUxpoTtWeC0ilzEt18RP8vZjm +eCbEP4qQDDvSCdLrie5CezyxAgMBAAGjHTAbMAwGA1UdEwQFMAMBAf8wCwYDVR0P +BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4IBAQBJ/I/QJjU+mgkIaaHImFcIYFrfBirC +vDiWo2W+zRh7CbcSf+jsksI99d230ixSDY36CPLKZeZhELST7xWKEELKbPdNbtOO +EM10+XteLSXKVNGXfrEbW973eum3FGLobMA9OcH6+qDaf08pibe7kuv10aAgSs/I +0Qg5H/UTAKQJKO9hhOgERM/FettuF+WGJaaZZZb9Y2YYBNRf/GtM8KHCjpCX9+XD +kdeQGO8Hn10H9tOmggyfdIpsunBcs2/6/exCp8RPBWurN2GSW2RcnS5xVL0r+SVW +VOhSDy1JwnNPczpqkqE74qAbAah0dTJFcFWzeGLVk7Kp+2pissAiU3gg +-----END CERTIFICATE----- diff --git a/test/emqttd_SUITE_data/certs/cert.pem b/test/emqttd_SUITE_data/certs/cert.pem new file mode 100644 index 000000000..58aa2c4ef --- /dev/null +++ b/test/emqttd_SUITE_data/certs/cert.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC9jCCAd6gAwIBAgIBATANBgkqhkiG9w0BAQsFADATMREwDwYDVQQDDAhNeVRl +c3RDQTAeFw0xNjEwMzEwNzE1NDVaFw0xNzEwMzEwNzE1NDVaMDkxJjAkBgNVBAMT +HWRlbmdoYWlndWlkZU1hY0Jvb2stQWlyLmxvY2FsMQ8wDQYDVQQKEwZzZXJ2ZXIw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4Ena4vgWrzwUB0hGW1v0v +K986FhU5ZdYz5H5MGonfWwv89nR2DlftSDXEvKFyc2MT81GGm16VJv3mVpQJLuKA +xLBLY7a1zSrJdugXWy+mgJJTPW6KjTY4jPtfCl6x/yVr8YclVa8XO0JFzOme2LMV +Ylc/ixVEa66UpxRNrg5yWHS26KcB1lE3GLERoRBKF7nsyGqGY4X9TypBwglCVoqK +3dKVGwCvFur+oPnt/C5pwR6UmUV/Ppf1EaRD7Po+xcyJSeCvszG3FH4iHsDHnjLe +DR6lxouvMCb+aKJi9d0xowOjhbKoFMF179t4SVnptQeq+U6ui3cPKUjia7Zh1tZT +AgMBAAGjLzAtMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgUgMBMGA1UdJQQMMAoGCCsG +AQUFBwMBMA0GCSqGSIb3DQEBCwUAA4IBAQB2jlDPiZfP/whsvvFn43g37QMwX5ST +Z5OpmEFnFjAH3ec0PPqPrKYEu00q5wEC+8L6uVH8FHOFf11JLH4wl11/C/mvE92D +qZtGG8KCnG2+rk5OJPGX+28Z+OnCZlXOjQ8qd2x5KtIW50JuXJ3cbDRHtF/TVanm +Exu+TCBeToNwbcU2sfQnbljkUTj4idUFz0pq3uvw3dA4R1J2foungPAYXSWcVhtb +RYtG8epIvkAyyUE5nY3kC05AUml6gSZkrJiYM5I1IJTX1lQ7Pv2yxRBZUtTx33rP +ccnsW6tbHTDBG8UDHx4LKHErdWFgCJWI81EUEcTip9g2zCOGTWKnpz+z +-----END CERTIFICATE----- diff --git a/test/emqttd_SUITE_data/certs/client-cert.pem b/test/emqttd_SUITE_data/certs/client-cert.pem new file mode 100644 index 000000000..e1690d9aa --- /dev/null +++ b/test/emqttd_SUITE_data/certs/client-cert.pem @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE----- +MIIC9jCCAd6gAwIBAgIBAjANBgkqhkiG9w0BAQsFADATMREwDwYDVQQDDAhNeVRl +c3RDQTAeFw0xNjEwMzEwNzE1NDZaFw0xNzEwMzEwNzE1NDZaMDkxJjAkBgNVBAMT +HWRlbmdoYWlndWlkZU1hY0Jvb2stQWlyLmxvY2FsMQ8wDQYDVQQKEwZjbGllbnQw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCmPMkieMtJO4PGIQG30uxI +SEoRJoF2w0ufFhZGYCEaqFlHaSoc6nTiCUmnxadDpjkNBs4R6RDfM9zPJ0QdgSFO +OJsWgQEHym/EQTcEx11+/2NDZWMJyZdpWZlU57SwHfWDwYa2XFX1bV+pAvhB8cli +wCkygTwp1cZcwQpb8TfZySy8r5mwrWq2nhCQPtYqMxjNjpR/UeeZzt+Uh3CEXQ8h +omjGinDXnnGwrYwBEP9G6fzTvyCWTyrsWC1Q37oAMzbkwFRoIBSAQWXBv9hgI08s +IBYvXnRGKWOJZGxAP4a4TvpFS+nqi+fFVn4ktUfcH3PoSMh7PKavrFT2hQaryLt1 +AgMBAAGjLzAtMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgeAMBMGA1UdJQQMMAoGCCsG +AQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IBAQAeimI8AQBFWiE9/Nf/0radux355mod +5vPLbKn6I6nzb/sS/Ug8SMoFnkhncwj+XOgTSliUyWcwOB11UDVJbUIkB/x+Qo3w +hvrATTdby2WdFNQvH4X7PmP8asDDN7ZxoLyRmuhjL4avJ3giwRcuQK4cB35b+Lb2 +p1e7hW81RaV7OEc0o4/vJgPvv9N7wvUuipwJns6PrN7VDn99lT8zWrt2pQ06e2mk +jDuXulVpiUtLHJhTnABkCaKiHWCYAFfMjFeRb3gUXKqShzOyDSGWY91YMID/HE4r +sVLm2mD1zurue8EmYtQQ6uiJIW9SzvshMHG6EA5QWA1ytoalfePbvf+c +-----END CERTIFICATE----- diff --git a/test/emqttd_SUITE_data/certs/client-key.pem b/test/emqttd_SUITE_data/certs/client-key.pem new file mode 100644 index 000000000..74cf487cb --- /dev/null +++ b/test/emqttd_SUITE_data/certs/client-key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEApjzJInjLSTuDxiEBt9LsSEhKESaBdsNLnxYWRmAhGqhZR2kq +HOp04glJp8WnQ6Y5DQbOEekQ3zPczydEHYEhTjibFoEBB8pvxEE3BMddfv9jQ2Vj +CcmXaVmZVOe0sB31g8GGtlxV9W1fqQL4QfHJYsApMoE8KdXGXMEKW/E32cksvK+Z +sK1qtp4QkD7WKjMYzY6Uf1Hnmc7flIdwhF0PIaJoxopw155xsK2MARD/Run8078g +lk8q7FgtUN+6ADM25MBUaCAUgEFlwb/YYCNPLCAWL150RiljiWRsQD+GuE76RUvp +6ovnxVZ+JLVH3B9z6EjIezymr6xU9oUGq8i7dQIDAQABAoIBAFkHEMjPXD96ChZf +suXZpgUIAfKxZoBOEv+9+mvyK4h1RGsEHTOjNLmhM7sQFYYbTU52qIHbCdgflE+0 +vbv3XfjgQ96HdB/SAI1gR7DdfGr5JxX/BE1HkzkubPmVpaT0RnoreJPNW5O24ZZI +KuBWNv4V33pWz/uvqy4djAi1ZK3TPDhn9cVCMwV/ISCPlofrNDB/4ZNOMeaQgiR+ +sGqv+Q0ok2ao7Y04QHPh5i+5o+5oBoiJAO/49q9uPdpO181/8H71jll0QL+h5Off +nyWkAAOcgEeX9T4ZnfTUivGdSwB/Y+LS97Ozdr6kp5Fdk8WdDn0DL4fHRrnJ4IJD +EIAn/sECgYEA2oOCRBMccr49wbu+cKlkICt/4ARzJWKysdLlK0tYQknkDK1bzoHO +9JerRJL4E9bKp8zNlobfP1hWV0TFpwYsK3RvZoLvCwaSHeqUCZ4wQvKrWP1FieJ2 +5kjO5iMvXiy/kNHdTEXsj0x6RKuUSVgzNIuILvCCQ9Z7JVa/3NWS1SkCgYEAwsF0 +TWxCjryQv8y4mFSUlyF+y+ntnWAvpe/1Wv3+dNdhsccUfcq3zPMuLEj5DEoIvlTy +jLkFLVJ468Ou7S1oSVetVT3wWoLP2eFDEU/sYjjPdf4IMSO1jWIPLC3WV7zsFb62 +jwG2en1qfz8AxrVl+zj4lWCbgA9Soi41NMiCUW0CgYEAokQEST8T4hVp0OL1Qb5Y +bxc+Z4GGbF3Fqw2cRrE1wkwSwGNACLMWl0XF1i95b2oSpdcNWFmhkO2teDLGwAhy +ZnaZfzt9/ecMPJEFC7tfxWdlXLj/mawFdW7dzcKVG08JlqZxuoE2cRduuG3duTV5 +GO0A3TKW2X99hTXNVlV3KzkCgYEAsaE8cHkzY3h9FVKlctqCBC3atiWQQZ+/Fbv8 +rpdHBE6Fnl4TRIAmj9mk3WNZM2o6+04DQ3JlVGcKPw7ldxGZMnuzbjHmDMeOyAx6 +3UlmMlfacKXX1unY5zDu4b6U5sU7FsIxQ9GuG55UCebu0E4Wy8G0iJnqeix/k8hN +Yu0WXykCgYEAo0kIm7sh9j0+r419Lo2kT4zlzFlNdJEa4+lFVISRqouDuhUO8VFE +/ZpGRcqIM7dH6iBM2Htasf7l/hyWKzDEvWCEpa4icicFYAJ92AgK7UBWbNbhueof +PyVx5G2o7amvyZNtJYUo4TpJ9eH5YbsBRBqWCJcBUAfrItrprxB1LMs= +-----END RSA PRIVATE KEY----- diff --git a/test/emqttd_SUITE_data/certs/key.pem b/test/emqttd_SUITE_data/certs/key.pem new file mode 100644 index 000000000..7001093ef --- /dev/null +++ b/test/emqttd_SUITE_data/certs/key.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEAuBJ2uL4Fq88FAdIRltb9LyvfOhYVOWXWM+R+TBqJ31sL/PZ0 +dg5X7Ug1xLyhcnNjE/NRhptelSb95laUCS7igMSwS2O2tc0qyXboF1svpoCSUz1u +io02OIz7Xwpesf8la/GHJVWvFztCRczpntizFWJXP4sVRGuulKcUTa4Oclh0tuin +AdZRNxixEaEQShe57MhqhmOF/U8qQcIJQlaKit3SlRsArxbq/qD57fwuacEelJlF +fz6X9RGkQ+z6PsXMiUngr7MxtxR+Ih7Ax54y3g0epcaLrzAm/miiYvXdMaMDo4Wy +qBTBde/beElZ6bUHqvlOrot3DylI4mu2YdbWUwIDAQABAoIBADXYWNhT5c7LYTiW +HcUVIL0CxWr1eMHwk0dcyME0Zi5rMMePxKOgMIJdxDTHxSZ4sHvuimOo4XMaE92k +Z+uDxohKgROcmJ735FNIsD3c08SOCb/F0adABaNnQkUcAHVrIKRB4/m85doS4KEQ +fyqTU1enC8Svx8nbAhfEBEFw8BLsZD9UnQAEAU5W9S5aKPHNrYRDz5UE0ZP28ixC +4PtCew96uCqA0u+xZnWCGawF27FD9P88pcYSJqebF1iFYkXrAwdhAbqewHOqQJXf +KJpbpjflBvZr/oTVZ3GAnnHnZDiusFmCKIHB9dKimHMdTFVIU2ikOeJZLtgXsBjb +Wn3Fa8kCgYEA2fK0t9NPmELw43D7VoCNeUmu6KmLLd7CeRiQ/OkPLKTqrudnUZGi +uMinPFijGTLX3SmByAVOkzMKBQOYF+eB1X24kbRLmL4JKzr04hSqOKqG5gJctC+x +V5qQX7ZxrNxFRiSodILbnQN/z1gwZMfrAU0t0EKIKjZR3lpj8CELv1cCgYEA2DWn +9V6PCZPcHzoFabhb8DJFglUTHk0zINVe97qldvMvn0MgsjgyS2j954nX8ef7uE1O +Cf+9nN709Fu8kEC7/KzWXxP3/O58TfJ6NivCQSr5i0OJLumQMVNrS+u/VG1PaVbS +2oCwP3QFayOxZSj9wq2MARd1JkqzHmi8skZLz2UCgYEAgtnv3En3CLBwFe14SPgH +eGFfrPpVwGV0luXD7sQyQxiEehwecN+iNZTqqxWAXpmi9np8G83r3f6PrnD4+Kka +z0Wa8Yewt3So5paP/chwZnMjaKbUZ64WqET5Fy3fU+wvfyx1IvaJydwW+TK2Y1uP +4Yknz1iSjd1tC7VzOPFuLyMCgYBrTFWKQ98glayMIrNFACVAUvKD98yBITbaeImk +z5AGNDHSC/JR/+mV2wkGuzXb65DUqiisdaqYC13tVwmBXV7tyqiojrRnZcNyu39D +GvxQcw9cuat/CJJyqD97cgeF0qmyUVBa97qAAwgdX51N4sXss0vjzsxosHGsCbZ7 +kr9UsQKBgQCMTtdCeA+uK/OeJtzf4CYZKR9xllQ+P6gCtbQ7WHuLBX/x+ZhvTC0p +qVLVWwFsJ6ivc1f74sy8hZPiePk9fqAqA1JIjDHrof0M3TxRVFvB7dej5XIYVirn +521DyZGfE+N7HA7qW5cGKZT0+UYLVp4gnv88nNKDuS18lafy8JRrfQ== +-----END RSA PRIVATE KEY----- diff --git a/test/emqttd_SUITE_data/emqttd.conf b/test/emqttd_SUITE_data/emqttd.conf index e4434283a..4aaa60eff 100644 --- a/test/emqttd_SUITE_data/emqttd.conf +++ b/test/emqttd_SUITE_data/emqttd.conf @@ -207,8 +207,8 @@ mqtt.listener.ssl.max_clients = 512 ## Configuring SSL Options ## See http://erlang.org/doc/man/ssl.html mqtt.listener.ssl.handshake_timeout = 15 -mqtt.listener.ssl.keyfile = etc/certs/key.pem -mqtt.listener.ssl.certfile = etc/certs/cert.pem +mqtt.listener.ssl.keyfile = certs/key.pem +mqtt.listener.ssl.certfile = certs/cert.pem ## mqtt.listener.ssl.cacertfile = etc/certs/cacert.pem ## mqtt.listener.ssl.verify = verify_peer ## mqtt.listener.ssl.fail_if_no_peer_cert = true From 776e6d9266fafee73b5b21a22c1d04081dc588dc Mon Sep 17 00:00:00 2001 From: huangdan Date: Wed, 14 Dec 2016 16:55:05 +0800 Subject: [PATCH 30/40] sslmut ct --- test/emqttd_SUITE.erl | 80 +++++++++++++++++++++++++++++++------------ 1 file changed, 59 insertions(+), 21 deletions(-) diff --git a/test/emqttd_SUITE.erl b/test/emqttd_SUITE.erl index 4ae7884e3..2df2ccfd8 100644 --- a/test/emqttd_SUITE.erl +++ b/test/emqttd_SUITE.erl @@ -26,6 +26,15 @@ -define(CONTENT_TYPE, "application/x-www-form-urlencoded"). +-define(MQTT_SSL_MUTWAY, [{cacertfile, "certs/cacert.pem"}, + {verify, verify_peer}, + {fail_if_no_peer_cert, true}]). + +-define(MQTT_SSL_CLIENT, [{keyfile, "certs/client-key.pem"}, + {cacertfile, "certs/cacert.pem"}, + {certfile, "certs/client-cert.pem"}]). + + all() -> [{group, protocol}, {group, pubsub}, @@ -43,7 +52,8 @@ all() -> groups() -> [{protocol, [sequence], [mqtt_connect, - mqtt_ssl_oneway]}, + mqtt_ssl_oneway, + mqtt_ssl_mutway]}, {pubsub, [sequence], [subscribe_unsubscribe, publish, pubsub, @@ -98,8 +108,11 @@ groups() -> init_per_suite(Config) -> application:start(lager), DataDir = proplists:get_value(data_dir, Config), - start_apps(emqttd, DataDir), - Config. + NewConfig = emqttd_config(DataDir), + Vals = change_opts(ssl_oneway, DataDir, proplists:get_value(emqttd, NewConfig)), + [application:set_env(emqttd, Par, Value) || {Par, Value} <- Vals], + application:ensure_all_started(emqttd), + [{config, NewConfig} | Config]. end_per_suite(_Config) -> application:stop(emqttd), @@ -134,9 +147,6 @@ mqtt_ssl_oneway(_) -> {ok, Pub} = emqttc:start_link([{host, "localhost"}, {client_id, <<"pub">>}]), - timer:sleep(10), - emqttc:publish(Pub, <<"topic">>, <<"SSL oneWay test">>, [{qos, 1}]), - timer:sleep(10), receive {publish, _Topic, RM} -> ?assertEqual(<<"SSL oneWay test">>, RM) after 1000 -> false @@ -144,6 +154,32 @@ mqtt_ssl_oneway(_) -> emqttc:disconnect(SslOneWay), emqttc:disconnect(Pub). +mqtt_ssl_mutway(Config) -> + emqttd_cluster:prepare(), + DataDir = proplists:get_value(data_dir, Config), + EmqConfig = proplists:get_value(config, Config), + Vals = change_opts(ssl_mut, DataDir, proplists:get_value(emqttd, EmqConfig)), + [application:set_env(emqttd, Par, Value) || {Par, Value} <- Vals], + emqttd_cluster:reboot(), + + ClientSSl = [{Key, filename:join([DataDir, File])} || + {Key, File} <- ?MQTT_SSL_CLIENT ], + {ok, SslMutWay} = emqttc:start_link([{host, "localhost"}, + {port, 8883}, + {client_id, <<"sslmut">>}, + {ssl, ClientSSl}]), + {ok, Sub} = emqttc:start_link([{host, "localhost"}, + {client_id, <<"sub">>}]), + emqttc:subscribe(Sub, <<"topic">>, qos1), + emqttc:publish(SslMutWay, <<"topic">>, <<"ssl client pub message">>, [{qos, 1}]), + timer:sleep(10), + receive {publish, _Topic, RM} -> + ?assertEqual(<<"ssl client pub message">>, RM) + after 1000 -> false + end, + emqttc:disconnect(SslMutWay), + emqttc:disconnect(Sub). + %%-------------------------------------------------------------------- %% PubSub Test %%-------------------------------------------------------------------- @@ -607,16 +643,12 @@ slave(emqttd, Node) -> slave(node, Node) -> {ok, N} = slave:start(host(), Node, "-pa ../../ebin -pa ../../deps/*/ebin"), N. +emqttd_config(DataDir) -> + Schema = cuttlefish_schema:files([filename:join([DataDir, "emqttd.schema"])]), + Conf = conf_parse:file(filename:join([DataDir, "emqttd.conf"])), + cuttlefish_generator:map(Schema, Conf). -start_apps(App, DataDir) -> - Schema = cuttlefish_schema:files([filename:join([DataDir, atom_to_list(App) ++ ".schema"])]), - Conf = conf_parse:file(filename:join([DataDir, atom_to_list(App) ++ ".conf"])), - NewConfig = cuttlefish_generator:map(Schema, Conf), - Vals = merge_opts(App, DataDir, proplists:get_value(App, NewConfig)), - [application:set_env(App, Par, Value) || {Par, Value} <- Vals], - application:ensure_all_started(App). - -merge_opts(emqttd, DataDir, Vals) -> +change_opts(SslType, DataDir, Vals) -> Listeners = proplists:get_value(listeners, Vals), NewListeners = lists:foldl(fun({Protocol, Port, Opts} = Listener, Acc) -> case Protocol of @@ -624,15 +656,21 @@ merge_opts(emqttd, DataDir, Vals) -> SslOpts = proplists:get_value(ssl, Opts), Keyfile = filename:join([DataDir, proplists:get_value(keyfile, SslOpts)]), Certfile = filename:join([DataDir, proplists:get_value(certfile, SslOpts)]), - TupleList2 = lists:keyreplace(keyfile, 1, SslOpts, {keyfile, Keyfile}), - TupleList3 = lists:keyreplace(certfile, 1, TupleList2, {certfile, Certfile}), + TupleList1 = lists:keyreplace(keyfile, 1, SslOpts, {keyfile, Keyfile}), + TupleList2 = lists:keyreplace(certfile, 1, TupleList1, {certfile, Certfile}), + TupleList3 = + case SslType of + ssl_mut -> + CAfile = filename:join([DataDir, proplists:get_value(cacertfile, ?MQTT_SSL_MUTWAY)]), + MutSslList = lists:keyreplace(cacertfile, 1, ?MQTT_SSL_MUTWAY, {cacertfile, CAfile}), + lists:merge(TupleList2, MutSslList); + _ -> + TupleList2 + end, [{Protocol, Port, [{ssl, TupleList3}]} | Acc]; _ -> [Listener | Acc] end end, [], Listeners), - lists:keyreplace(listeners, 1, Vals, {listeners, NewListeners}); - -merge_opts(_, _, Vals) -> - Vals. + lists:keyreplace(listeners, 1, Vals, {listeners, NewListeners}). From 737a89d5e851c1a05ce26cbe407ffc6d956bea2d Mon Sep 17 00:00:00 2001 From: turtled Date: Wed, 14 Dec 2016 18:09:41 +0800 Subject: [PATCH 31/40] rm net_adm:ping --- src/emqttd_cluster.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emqttd_cluster.erl b/src/emqttd_cluster.erl index 33eda2499..d5494a6b9 100644 --- a/src/emqttd_cluster.erl +++ b/src/emqttd_cluster.erl @@ -30,12 +30,12 @@ join(Node) when Node =:= node() -> {error, {cannot_join_with_self, Node}}; join(Node) when is_atom(Node) -> - case {net_adm:ping(Node), is_clustered(Node), emqttd:is_running(Node)} of - {pong, false, true} -> + case {is_clustered(Node), emqttd:is_running(Node)} of + {false, true} -> prepare(), ok = emqttd_mnesia:join_cluster(Node), reboot(); - {_, false, false} -> + {false, false} -> {error, {node_not_running, Node}}; - {_, true, _} -> + {true, _} -> {error, {already_clustered, Node}} end. From b9220490bf7e9bceeb22e0df0fa9890495c91d9b Mon Sep 17 00:00:00 2001 From: huangdan Date: Wed, 14 Dec 2016 19:11:37 +0800 Subject: [PATCH 32/40] code format --- test/emqttd_SUITE.erl | 108 +++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/test/emqttd_SUITE.erl b/test/emqttd_SUITE.erl index 2df2ccfd8..c5f423979 100644 --- a/test/emqttd_SUITE.erl +++ b/test/emqttd_SUITE.erl @@ -27,12 +27,12 @@ -define(CONTENT_TYPE, "application/x-www-form-urlencoded"). -define(MQTT_SSL_MUTWAY, [{cacertfile, "certs/cacert.pem"}, - {verify, verify_peer}, - {fail_if_no_peer_cert, true}]). + {verify, verify_peer}, + {fail_if_no_peer_cert, true}]). -define(MQTT_SSL_CLIENT, [{keyfile, "certs/client-key.pem"}, - {cacertfile, "certs/cacert.pem"}, - {certfile, "certs/client-cert.pem"}]). + {cacertfile, "certs/cacert.pem"}, + {certfile, "certs/client-cert.pem"}]). all() -> @@ -52,8 +52,8 @@ all() -> groups() -> [{protocol, [sequence], [mqtt_connect, - mqtt_ssl_oneway, - mqtt_ssl_mutway]}, + mqtt_ssl_oneway, + mqtt_ssl_twoway]}, {pubsub, [sequence], [subscribe_unsubscribe, publish, pubsub, @@ -139,41 +139,39 @@ connect_broker_(Packet, RecvSize) -> Data. mqtt_ssl_oneway(_) -> - {ok, SslOneWay} = emqttc:start_link([{host, "localhost"}, - {port, 8883}, - {client_id, <<"ssloneway">>}, ssl]), + {ok, SslOneWay} = emqttc:start_link([{host, "localhost"}, + {port, 8883}, + {client_id, <<"ssloneway">>}, ssl]), timer:sleep(100), emqttc:subscribe(SslOneWay, <<"topic">>, qos1), - - {ok, Pub} = emqttc:start_link([{host, "localhost"}, - {client_id, <<"pub">>}]), - receive {publish, _Topic, RM} -> + {ok, Pub} = emqttc:start_link([{host, "localhost"}, + {client_id, <<"pub">>}]), + receive {publish, _Topic, RM} -> ?assertEqual(<<"SSL oneWay test">>, RM) after 1000 -> false end, emqttc:disconnect(SslOneWay), emqttc:disconnect(Pub). -mqtt_ssl_mutway(Config) -> - emqttd_cluster:prepare(), +mqtt_ssl_twoway(Config) -> + emqttd_cluster:prepare(), DataDir = proplists:get_value(data_dir, Config), - EmqConfig = proplists:get_value(config, Config), - Vals = change_opts(ssl_mut, DataDir, proplists:get_value(emqttd, EmqConfig)), + EmqConfig = proplists:get_value(config, Config), + Vals = change_opts(ssl_mut, DataDir, proplists:get_value(emqttd, EmqConfig)), [application:set_env(emqttd, Par, Value) || {Par, Value} <- Vals], - emqttd_cluster:reboot(), - - ClientSSl = [{Key, filename:join([DataDir, File])} || - {Key, File} <- ?MQTT_SSL_CLIENT ], - {ok, SslMutWay} = emqttc:start_link([{host, "localhost"}, - {port, 8883}, - {client_id, <<"sslmut">>}, - {ssl, ClientSSl}]), - {ok, Sub} = emqttc:start_link([{host, "localhost"}, - {client_id, <<"sub">>}]), + emqttd_cluster:reboot(), + ClientSSl = [{Key, filename:join([DataDir, File])} || + {Key, File} <- ?MQTT_SSL_CLIENT ], + {ok, SslMutWay} = emqttc:start_link([{host, "localhost"}, + {port, 8883}, + {client_id, <<"sslmut">>}, + {ssl, ClientSSl}]), + {ok, Sub} = emqttc:start_link([{host, "localhost"}, + {client_id, <<"sub">>}]), emqttc:subscribe(Sub, <<"topic">>, qos1), emqttc:publish(SslMutWay, <<"topic">>, <<"ssl client pub message">>, [{qos, 1}]), - timer:sleep(10), - receive {publish, _Topic, RM} -> + timer:sleep(10), + receive {publish, _Topic, RM} -> ?assertEqual(<<"ssl client pub message">>, RM) after 1000 -> false end, @@ -643,34 +641,36 @@ slave(emqttd, Node) -> slave(node, Node) -> {ok, N} = slave:start(host(), Node, "-pa ../../ebin -pa ../../deps/*/ebin"), N. + emqttd_config(DataDir) -> - Schema = cuttlefish_schema:files([filename:join([DataDir, "emqttd.schema"])]), + Schema = cuttlefish_schema:files([filename:join([DataDir, "emqttd.schema"])]), Conf = conf_parse:file(filename:join([DataDir, "emqttd.conf"])), cuttlefish_generator:map(Schema, Conf). change_opts(SslType, DataDir, Vals) -> - Listeners = proplists:get_value(listeners, Vals), - NewListeners = lists:foldl(fun({Protocol, Port, Opts} = Listener, Acc) -> - case Protocol of - ssl -> - SslOpts = proplists:get_value(ssl, Opts), - Keyfile = filename:join([DataDir, proplists:get_value(keyfile, SslOpts)]), - Certfile = filename:join([DataDir, proplists:get_value(certfile, SslOpts)]), - TupleList1 = lists:keyreplace(keyfile, 1, SslOpts, {keyfile, Keyfile}), - TupleList2 = lists:keyreplace(certfile, 1, TupleList1, {certfile, Certfile}), - TupleList3 = - case SslType of - ssl_mut -> - CAfile = filename:join([DataDir, proplists:get_value(cacertfile, ?MQTT_SSL_MUTWAY)]), - MutSslList = lists:keyreplace(cacertfile, 1, ?MQTT_SSL_MUTWAY, {cacertfile, CAfile}), - lists:merge(TupleList2, MutSslList); - _ -> - TupleList2 - end, - [{Protocol, Port, [{ssl, TupleList3}]} | Acc]; - _ -> - [Listener | Acc] - end - end, [], Listeners), - lists:keyreplace(listeners, 1, Vals, {listeners, NewListeners}). + Listeners = proplists:get_value(listeners, Vals), + NewListeners = + lists:foldl(fun({Protocol, Port, Opts} = Listener, Acc) -> + case Protocol of + ssl -> + SslOpts = proplists:get_value(ssl, Opts), + Keyfile = filename:join([DataDir, proplists:get_value(keyfile, SslOpts)]), + Certfile = filename:join([DataDir, proplists:get_value(certfile, SslOpts)]), + TupleList1 = lists:keyreplace(keyfile, 1, SslOpts, {keyfile, Keyfile}), + TupleList2 = lists:keyreplace(certfile, 1, TupleList1, {certfile, Certfile}), + TupleList3 = + case SslType of + ssl_mut -> + CAfile = filename:join([DataDir, proplists:get_value(cacertfile, ?MQTT_SSL_MUTWAY)]), + MutSslList = lists:keyreplace(cacertfile, 1, ?MQTT_SSL_MUTWAY, {cacertfile, CAfile}), + lists:merge(TupleList2, MutSslList); + _ -> + TupleList2 + end, + [{Protocol, Port, [{ssl, TupleList3}]} | Acc]; + _ -> + [Listener | Acc] + end + end, [], Listeners), + lists:keyreplace(listeners, 1, Vals, {listeners, NewListeners}). From 4c9e031ece464ffcff2798069b08a3c7a3512e52 Mon Sep 17 00:00:00 2001 From: huangdan Date: Wed, 14 Dec 2016 19:14:03 +0800 Subject: [PATCH 33/40] code format --- test/emqttd_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/emqttd_SUITE.erl b/test/emqttd_SUITE.erl index c5f423979..c9b96be5c 100644 --- a/test/emqttd_SUITE.erl +++ b/test/emqttd_SUITE.erl @@ -668,7 +668,7 @@ change_opts(SslType, DataDir, Vals) -> TupleList2 end, [{Protocol, Port, [{ssl, TupleList3}]} | Acc]; - _ -> + _ -> [Listener | Acc] end end, [], Listeners), From 421ae007e8dd7333fcb2d3e7cc6929c00c579e7a Mon Sep 17 00:00:00 2001 From: huangdan Date: Wed, 14 Dec 2016 19:15:32 +0800 Subject: [PATCH 34/40] code format --- test/emqttd_SUITE.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/emqttd_SUITE.erl b/test/emqttd_SUITE.erl index c9b96be5c..be8cfb965 100644 --- a/test/emqttd_SUITE.erl +++ b/test/emqttd_SUITE.erl @@ -108,11 +108,11 @@ groups() -> init_per_suite(Config) -> application:start(lager), DataDir = proplists:get_value(data_dir, Config), - NewConfig = emqttd_config(DataDir), + NewConfig = emqttd_config(DataDir), Vals = change_opts(ssl_oneway, DataDir, proplists:get_value(emqttd, NewConfig)), [application:set_env(emqttd, Par, Value) || {Par, Value} <- Vals], application:ensure_all_started(emqttd), - [{config, NewConfig} | Config]. + [{config, NewConfig} | Config]. end_per_suite(_Config) -> application:stop(emqttd), @@ -664,7 +664,7 @@ change_opts(SslType, DataDir, Vals) -> CAfile = filename:join([DataDir, proplists:get_value(cacertfile, ?MQTT_SSL_MUTWAY)]), MutSslList = lists:keyreplace(cacertfile, 1, ?MQTT_SSL_MUTWAY, {cacertfile, CAfile}), lists:merge(TupleList2, MutSslList); - _ -> + _ -> TupleList2 end, [{Protocol, Port, [{ssl, TupleList3}]} | Acc]; From 39c35c79dec29fbf331b7221f6f9a6c3a127fce8 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Wed, 14 Dec 2016 19:23:22 +0800 Subject: [PATCH 35/40] 2.0.4 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e2f1bdfeb..49067e209 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PROJECT = emqttd PROJECT_DESCRIPTION = Erlang MQTT Broker -PROJECT_VERSION = 2.0.3 +PROJECT_VERSION = 2.0.4 DEPS = gproc lager gen_logger esockd mochiweb From d7c5706b179584af61d21eaa5945a2109dd535b0 Mon Sep 17 00:00:00 2001 From: huangdan Date: Wed, 14 Dec 2016 21:00:50 +0800 Subject: [PATCH 36/40] code review --- test/emqttd_SUITE.erl | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/test/emqttd_SUITE.erl b/test/emqttd_SUITE.erl index be8cfb965..45fa13c50 100644 --- a/test/emqttd_SUITE.erl +++ b/test/emqttd_SUITE.erl @@ -26,7 +26,7 @@ -define(CONTENT_TYPE, "application/x-www-form-urlencoded"). --define(MQTT_SSL_MUTWAY, [{cacertfile, "certs/cacert.pem"}, +-define(MQTT_SSL_TWOWAY, [{cacertfile, "certs/cacert.pem"}, {verify, verify_peer}, {fail_if_no_peer_cert, true}]). @@ -142,10 +142,12 @@ mqtt_ssl_oneway(_) -> {ok, SslOneWay} = emqttc:start_link([{host, "localhost"}, {port, 8883}, {client_id, <<"ssloneway">>}, ssl]), - timer:sleep(100), + timer:sleep(10), emqttc:subscribe(SslOneWay, <<"topic">>, qos1), {ok, Pub} = emqttc:start_link([{host, "localhost"}, {client_id, <<"pub">>}]), + emqttc:publish(Pub, <<"topic">>, <<"SSL oneWay test">>, [{qos, 1}]), + timer:sleep(10), receive {publish, _Topic, RM} -> ?assertEqual(<<"SSL oneWay test">>, RM) after 1000 -> false @@ -156,26 +158,26 @@ mqtt_ssl_oneway(_) -> mqtt_ssl_twoway(Config) -> emqttd_cluster:prepare(), DataDir = proplists:get_value(data_dir, Config), - EmqConfig = proplists:get_value(config, Config), - Vals = change_opts(ssl_mut, DataDir, proplists:get_value(emqttd, EmqConfig)), + EmqConfig = proplists:get_value(config, Config), + Vals = change_opts(ssl_twoway, DataDir, proplists:get_value(emqttd, EmqConfig)), [application:set_env(emqttd, Par, Value) || {Par, Value} <- Vals], emqttd_cluster:reboot(), ClientSSl = [{Key, filename:join([DataDir, File])} || - {Key, File} <- ?MQTT_SSL_CLIENT ], - {ok, SslMutWay} = emqttc:start_link([{host, "localhost"}, + {Key, File} <- ?MQTT_SSL_CLIENT ], + {ok, SslTwoWay} = emqttc:start_link([{host, "localhost"}, {port, 8883}, - {client_id, <<"sslmut">>}, + {client_id, <<"ssltwoway">>}, {ssl, ClientSSl}]), {ok, Sub} = emqttc:start_link([{host, "localhost"}, {client_id, <<"sub">>}]), emqttc:subscribe(Sub, <<"topic">>, qos1), - emqttc:publish(SslMutWay, <<"topic">>, <<"ssl client pub message">>, [{qos, 1}]), + emqttc:publish(SslTwoWay, <<"topic">>, <<"ssl client pub message">>, [{qos, 1}]), timer:sleep(10), receive {publish, _Topic, RM} -> ?assertEqual(<<"ssl client pub message">>, RM) after 1000 -> false end, - emqttc:disconnect(SslMutWay), + emqttc:disconnect(SslTwoWay), emqttc:disconnect(Sub). %%-------------------------------------------------------------------- @@ -651,8 +653,8 @@ change_opts(SslType, DataDir, Vals) -> Listeners = proplists:get_value(listeners, Vals), NewListeners = lists:foldl(fun({Protocol, Port, Opts} = Listener, Acc) -> - case Protocol of - ssl -> + case Protocol of + ssl -> SslOpts = proplists:get_value(ssl, Opts), Keyfile = filename:join([DataDir, proplists:get_value(keyfile, SslOpts)]), Certfile = filename:join([DataDir, proplists:get_value(certfile, SslOpts)]), @@ -660,17 +662,16 @@ change_opts(SslType, DataDir, Vals) -> TupleList2 = lists:keyreplace(certfile, 1, TupleList1, {certfile, Certfile}), TupleList3 = case SslType of - ssl_mut -> - CAfile = filename:join([DataDir, proplists:get_value(cacertfile, ?MQTT_SSL_MUTWAY)]), - MutSslList = lists:keyreplace(cacertfile, 1, ?MQTT_SSL_MUTWAY, {cacertfile, CAfile}), - lists:merge(TupleList2, MutSslList); + ssl_twoway-> + CAfile = filename:join([DataDir, proplists:get_value(cacertfile, ?MQTT_SSL_TWOWAY)]), + MutSslList = lists:keyreplace(cacertfile, 1, ?MQTT_SSL_TWOWAY, {cacertfile, CAfile}), + lists:merge(TupleList2, MutSslList); _ -> TupleList2 - end, + end, [{Protocol, Port, [{ssl, TupleList3}]} | Acc]; _ -> [Listener | Acc] end end, [], Listeners), lists:keyreplace(listeners, 1, Vals, {listeners, NewListeners}). - From 9f56370f6bd15428cdd25471ced842342cc34adc Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Tue, 20 Dec 2016 11:40:53 +0800 Subject: [PATCH 37/40] 2.0.5 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 49067e209..ddbb4d606 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PROJECT = emqttd PROJECT_DESCRIPTION = Erlang MQTT Broker -PROJECT_VERSION = 2.0.4 +PROJECT_VERSION = 2.0.5 DEPS = gproc lager gen_logger esockd mochiweb From 435d91c111cca84af116c4ed9b0e9ca2ba6cef2a Mon Sep 17 00:00:00 2001 From: Feng Date: Sat, 7 Jan 2017 18:37:24 +0800 Subject: [PATCH 38/40] Version 2.0.6 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ddbb4d606..a4591784e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PROJECT = emqttd PROJECT_DESCRIPTION = Erlang MQTT Broker -PROJECT_VERSION = 2.0.5 +PROJECT_VERSION = 2.0.6 DEPS = gproc lager gen_logger esockd mochiweb From 2e966a8cbd32cfb44ced08623158ba13da3f1ca6 Mon Sep 17 00:00:00 2001 From: huangdan Date: Wed, 11 Jan 2017 13:24:40 +0800 Subject: [PATCH 39/40] Mod Copyright (c) 2012-2017 --- include/emqttd.hrl | 4 ++-- include/emqttd_cli.hrl | 2 +- include/emqttd_internal.hrl | 2 +- include/emqttd_protocol.hrl | 2 +- include/emqttd_trie.hrl | 2 +- src/emqttd.erl | 2 +- src/emqttd_access_control.erl | 2 +- src/emqttd_access_rule.erl | 2 +- src/emqttd_acl_internal.erl | 2 +- src/emqttd_acl_mod.erl | 2 +- src/emqttd_alarm.erl | 2 +- src/emqttd_app.erl | 2 +- src/emqttd_auth_mod.erl | 2 +- src/emqttd_base62.erl | 2 +- src/emqttd_boot.erl | 2 +- src/emqttd_bridge.erl | 2 +- src/emqttd_bridge_sup.erl | 2 +- src/emqttd_bridge_sup_sup.erl | 2 +- src/emqttd_broker.erl | 2 +- src/emqttd_cli.erl | 2 +- src/emqttd_client.erl | 2 +- src/emqttd_cluster.erl | 2 +- src/emqttd_cm.erl | 2 +- src/emqttd_cm_sup.erl | 2 +- src/emqttd_ctl.erl | 2 +- src/emqttd_gen_mod.erl | 2 +- src/emqttd_guid.erl | 2 +- src/emqttd_http.erl | 2 +- src/emqttd_keepalive.erl | 2 +- src/emqttd_message.erl | 2 +- src/emqttd_metrics.erl | 2 +- src/emqttd_mnesia.erl | 2 +- src/emqttd_mod_sup.erl | 2 +- src/emqttd_mqueue.erl | 2 +- src/emqttd_net.erl | 2 +- src/emqttd_node.erl | 2 +- src/emqttd_opts.erl | 2 +- src/emqttd_packet.erl | 2 +- src/emqttd_parser.erl | 2 +- src/emqttd_plugins.erl | 2 +- src/emqttd_pool_sup.erl | 2 +- src/emqttd_pooler.erl | 2 +- src/emqttd_protocol.erl | 2 +- src/emqttd_pubsub.erl | 2 +- src/emqttd_pubsub_sup.erl | 2 +- src/emqttd_router.erl | 2 +- src/emqttd_serializer.erl | 2 +- src/emqttd_server.erl | 2 +- src/emqttd_session.erl | 2 +- src/emqttd_session_sup.erl | 2 +- src/emqttd_sm.erl | 2 +- src/emqttd_sm_helper.erl | 2 +- src/emqttd_sm_sup.erl | 2 +- src/emqttd_stats.erl | 2 +- src/emqttd_sup.erl | 2 +- src/emqttd_sysmon.erl | 2 +- src/emqttd_sysmon_sup.erl | 2 +- src/emqttd_time.erl | 2 +- src/emqttd_topic.erl | 2 +- src/emqttd_trace.erl | 2 +- src/emqttd_trace_sup.erl | 2 +- src/emqttd_trie.erl | 2 +- src/emqttd_vm.erl | 2 +- src/emqttd_ws.erl | 2 +- src/emqttd_ws_client.erl | 2 +- src/emqttd_ws_client_sup.erl | 2 +- src/lager_emqtt_backend.erl | 2 +- test/emqttd_SUITE.erl | 2 +- test/emqttd_access_SUITE.erl | 2 +- test/emqttd_acl_test_mod.erl | 2 +- test/emqttd_auth_anonymous_test_mod.erl | 2 +- test/emqttd_auth_dashboard.erl | 2 +- test/emqttd_lib_SUITE.erl | 2 +- test/emqttd_mod_SUITE.erl | 2 +- test/emqttd_mqueue_SUITE.erl | 2 +- test/emqttd_net_SUITE.erl | 2 +- test/emqttd_protocol_SUITE.erl | 2 +- test/emqttd_topic_SUITE.erl | 2 +- test/emqttd_trie_SUITE.erl | 2 +- test/emqttd_vm_SUITE.erl | 2 +- 80 files changed, 81 insertions(+), 81 deletions(-) diff --git a/include/emqttd.hrl b/include/emqttd.hrl index 75a030c2e..53350ed6d 100644 --- a/include/emqttd.hrl +++ b/include/emqttd.hrl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ %% Banner %%-------------------------------------------------------------------- --define(COPYRIGHT, "Copyright (C) 2012-2016, Feng Lee "). +-define(COPYRIGHT, "Copyright (C) 2012-2017, Feng Lee "). -define(LICENSE_MESSAGE, "Licensed under the Apache License, Version 2.0"). diff --git a/include/emqttd_cli.hrl b/include/emqttd_cli.hrl index f8245f9a8..461306747 100644 --- a/include/emqttd_cli.hrl +++ b/include/emqttd_cli.hrl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/include/emqttd_internal.hrl b/include/emqttd_internal.hrl index 56522a62f..06102e26a 100644 --- a/include/emqttd_internal.hrl +++ b/include/emqttd_internal.hrl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/include/emqttd_protocol.hrl b/include/emqttd_protocol.hrl index 8a5e5d0ca..9ed3a993b 100644 --- a/include/emqttd_protocol.hrl +++ b/include/emqttd_protocol.hrl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/include/emqttd_trie.hrl b/include/emqttd_trie.hrl index e701d90cd..bd4184ad8 100644 --- a/include/emqttd_trie.hrl +++ b/include/emqttd_trie.hrl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2016 Feng Lee . +%% Copyright (c) 2016-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd.erl b/src/emqttd.erl index 8128d0789..23db807cc 100644 --- a/src/emqttd.erl +++ b/src/emqttd.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_access_control.erl b/src/emqttd_access_control.erl index 688e244a4..7aea58e79 100644 --- a/src/emqttd_access_control.erl +++ b/src/emqttd_access_control.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_access_rule.erl b/src/emqttd_access_rule.erl index 88395b182..1590d2efe 100644 --- a/src/emqttd_access_rule.erl +++ b/src/emqttd_access_rule.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_acl_internal.erl b/src/emqttd_acl_internal.erl index 610cf91a3..74ab8519a 100644 --- a/src/emqttd_acl_internal.erl +++ b/src/emqttd_acl_internal.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_acl_mod.erl b/src/emqttd_acl_mod.erl index 2eb09a0fe..44c775460 100644 --- a/src/emqttd_acl_mod.erl +++ b/src/emqttd_acl_mod.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_alarm.erl b/src/emqttd_alarm.erl index 4ba752035..1ff4a5ae9 100644 --- a/src/emqttd_alarm.erl +++ b/src/emqttd_alarm.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_app.erl b/src/emqttd_app.erl index 048a196cd..bdbfc4a54 100644 --- a/src/emqttd_app.erl +++ b/src/emqttd_app.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_auth_mod.erl b/src/emqttd_auth_mod.erl index 845d5a0fb..d6d4a55b0 100644 --- a/src/emqttd_auth_mod.erl +++ b/src/emqttd_auth_mod.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_base62.erl b/src/emqttd_base62.erl index 1e9d0a1a2..5895fa245 100644 --- a/src/emqttd_base62.erl +++ b/src/emqttd_base62.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2016 Feng Lee . +%% Copyright (c) 2016-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_boot.erl b/src/emqttd_boot.erl index e2ca2b931..043eb08c3 100644 --- a/src/emqttd_boot.erl +++ b/src/emqttd_boot.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_bridge.erl b/src/emqttd_bridge.erl index de51b8f5d..3dca7bf0f 100644 --- a/src/emqttd_bridge.erl +++ b/src/emqttd_bridge.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_bridge_sup.erl b/src/emqttd_bridge_sup.erl index 64c3fcf83..dd418b2f6 100644 --- a/src/emqttd_bridge_sup.erl +++ b/src/emqttd_bridge_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_bridge_sup_sup.erl b/src/emqttd_bridge_sup_sup.erl index 109f94764..47e246273 100644 --- a/src/emqttd_bridge_sup_sup.erl +++ b/src/emqttd_bridge_sup_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_broker.erl b/src/emqttd_broker.erl index 409fe5c8b..96dd7d553 100644 --- a/src/emqttd_broker.erl +++ b/src/emqttd_broker.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_cli.erl b/src/emqttd_cli.erl index 547f25e81..085032b24 100644 --- a/src/emqttd_cli.erl +++ b/src/emqttd_cli.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_client.erl b/src/emqttd_client.erl index 931343efe..6f15bdf8c 100644 --- a/src/emqttd_client.erl +++ b/src/emqttd_client.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_cluster.erl b/src/emqttd_cluster.erl index d5494a6b9..7c83c079c 100644 --- a/src/emqttd_cluster.erl +++ b/src/emqttd_cluster.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_cm.erl b/src/emqttd_cm.erl index da98dedd6..6b40a480f 100644 --- a/src/emqttd_cm.erl +++ b/src/emqttd_cm.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_cm_sup.erl b/src/emqttd_cm_sup.erl index 0def00005..dfa623cc3 100644 --- a/src/emqttd_cm_sup.erl +++ b/src/emqttd_cm_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_ctl.erl b/src/emqttd_ctl.erl index 1cd5d3055..c0b7dcf70 100644 --- a/src/emqttd_ctl.erl +++ b/src/emqttd_ctl.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_gen_mod.erl b/src/emqttd_gen_mod.erl index 043c6e177..b201f7bdd 100644 --- a/src/emqttd_gen_mod.erl +++ b/src/emqttd_gen_mod.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_guid.erl b/src/emqttd_guid.erl index 03a4e6904..a4c2d1ea4 100644 --- a/src/emqttd_guid.erl +++ b/src/emqttd_guid.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_http.erl b/src/emqttd_http.erl index e25f43e38..69b9f827a 100644 --- a/src/emqttd_http.erl +++ b/src/emqttd_http.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_keepalive.erl b/src/emqttd_keepalive.erl index 0e79622c4..54a4d20e5 100644 --- a/src/emqttd_keepalive.erl +++ b/src/emqttd_keepalive.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_message.erl b/src/emqttd_message.erl index 7dfc4fdc6..ec4a02479 100644 --- a/src/emqttd_message.erl +++ b/src/emqttd_message.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_metrics.erl b/src/emqttd_metrics.erl index 651e5037a..6f7a53f5a 100644 --- a/src/emqttd_metrics.erl +++ b/src/emqttd_metrics.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_mnesia.erl b/src/emqttd_mnesia.erl index 768d27cf0..52dca1d1b 100644 --- a/src/emqttd_mnesia.erl +++ b/src/emqttd_mnesia.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_mod_sup.erl b/src/emqttd_mod_sup.erl index a0f3cb9d3..57b13bc37 100644 --- a/src/emqttd_mod_sup.erl +++ b/src/emqttd_mod_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_mqueue.erl b/src/emqttd_mqueue.erl index a554c9c83..53f37206f 100644 --- a/src/emqttd_mqueue.erl +++ b/src/emqttd_mqueue.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_net.erl b/src/emqttd_net.erl index a57e4a6ec..8278e1f74 100644 --- a/src/emqttd_net.erl +++ b/src/emqttd_net.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_node.erl b/src/emqttd_node.erl index 0b492253f..e48f71fae 100644 --- a/src/emqttd_node.erl +++ b/src/emqttd_node.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_opts.erl b/src/emqttd_opts.erl index b2250bad6..8f5f3fea5 100644 --- a/src/emqttd_opts.erl +++ b/src/emqttd_opts.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_packet.erl b/src/emqttd_packet.erl index 618b6730b..38de31fe0 100644 --- a/src/emqttd_packet.erl +++ b/src/emqttd_packet.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_parser.erl b/src/emqttd_parser.erl index 139c5c1fb..d6c09c42e 100644 --- a/src/emqttd_parser.erl +++ b/src/emqttd_parser.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_plugins.erl b/src/emqttd_plugins.erl index 0657b7799..78b543440 100644 --- a/src/emqttd_plugins.erl +++ b/src/emqttd_plugins.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_pool_sup.erl b/src/emqttd_pool_sup.erl index b47199cb0..e06d09e8f 100644 --- a/src/emqttd_pool_sup.erl +++ b/src/emqttd_pool_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_pooler.erl b/src/emqttd_pooler.erl index a028b0046..2701c470e 100644 --- a/src/emqttd_pooler.erl +++ b/src/emqttd_pooler.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_protocol.erl b/src/emqttd_protocol.erl index 038d30b91..e892c6158 100644 --- a/src/emqttd_protocol.erl +++ b/src/emqttd_protocol.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_pubsub.erl b/src/emqttd_pubsub.erl index f4d6859a4..83a080ff6 100644 --- a/src/emqttd_pubsub.erl +++ b/src/emqttd_pubsub.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_pubsub_sup.erl b/src/emqttd_pubsub_sup.erl index 988dc6553..882fce57c 100644 --- a/src/emqttd_pubsub_sup.erl +++ b/src/emqttd_pubsub_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_router.erl b/src/emqttd_router.erl index 5a77c9914..e0e3962a2 100644 --- a/src/emqttd_router.erl +++ b/src/emqttd_router.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_serializer.erl b/src/emqttd_serializer.erl index 00573067f..f08ed7eef 100644 --- a/src/emqttd_serializer.erl +++ b/src/emqttd_serializer.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_server.erl b/src/emqttd_server.erl index 83903736e..f21bd5d4b 100644 --- a/src/emqttd_server.erl +++ b/src/emqttd_server.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_session.erl b/src/emqttd_session.erl index 2313cadb7..a73503479 100644 --- a/src/emqttd_session.erl +++ b/src/emqttd_session.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_session_sup.erl b/src/emqttd_session_sup.erl index 394cb84d0..88766b11a 100644 --- a/src/emqttd_session_sup.erl +++ b/src/emqttd_session_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_sm.erl b/src/emqttd_sm.erl index 3a978b3fd..704242b2d 100644 --- a/src/emqttd_sm.erl +++ b/src/emqttd_sm.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_sm_helper.erl b/src/emqttd_sm_helper.erl index aa6a7e365..97b356c8d 100644 --- a/src/emqttd_sm_helper.erl +++ b/src/emqttd_sm_helper.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_sm_sup.erl b/src/emqttd_sm_sup.erl index 1935bcfde..c43f89f80 100644 --- a/src/emqttd_sm_sup.erl +++ b/src/emqttd_sm_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_stats.erl b/src/emqttd_stats.erl index 9ffc08299..cae57207f 100644 --- a/src/emqttd_stats.erl +++ b/src/emqttd_stats.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_sup.erl b/src/emqttd_sup.erl index 709f30adb..59ffde2ea 100644 --- a/src/emqttd_sup.erl +++ b/src/emqttd_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_sysmon.erl b/src/emqttd_sysmon.erl index 43db85de6..7c338a842 100644 --- a/src/emqttd_sysmon.erl +++ b/src/emqttd_sysmon.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_sysmon_sup.erl b/src/emqttd_sysmon_sup.erl index 9ba73b41e..0131c42db 100644 --- a/src/emqttd_sysmon_sup.erl +++ b/src/emqttd_sysmon_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_time.erl b/src/emqttd_time.erl index 0ade04f6f..49cf4965c 100644 --- a/src/emqttd_time.erl +++ b/src/emqttd_time.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_topic.erl b/src/emqttd_topic.erl index 2a198c2e1..0afeacae8 100644 --- a/src/emqttd_topic.erl +++ b/src/emqttd_topic.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_trace.erl b/src/emqttd_trace.erl index ad938c502..069f44937 100644 --- a/src/emqttd_trace.erl +++ b/src/emqttd_trace.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_trace_sup.erl b/src/emqttd_trace_sup.erl index f0402a257..22736b1a2 100644 --- a/src/emqttd_trace_sup.erl +++ b/src/emqttd_trace_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_trie.erl b/src/emqttd_trie.erl index 7266ea4b6..23bb40bcf 100644 --- a/src/emqttd_trie.erl +++ b/src/emqttd_trie.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_vm.erl b/src/emqttd_vm.erl index bdc6cef40..abf4d3b78 100644 --- a/src/emqttd_vm.erl +++ b/src/emqttd_vm.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_ws.erl b/src/emqttd_ws.erl index cd48a45c1..a5b3b344f 100644 --- a/src/emqttd_ws.erl +++ b/src/emqttd_ws.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_ws_client.erl b/src/emqttd_ws_client.erl index 12968dceb..bd416fa27 100644 --- a/src/emqttd_ws_client.erl +++ b/src/emqttd_ws_client.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/emqttd_ws_client_sup.erl b/src/emqttd_ws_client_sup.erl index 3af715337..d01055115 100644 --- a/src/emqttd_ws_client_sup.erl +++ b/src/emqttd_ws_client_sup.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/src/lager_emqtt_backend.erl b/src/lager_emqtt_backend.erl index c98e87de9..214182b8d 100644 --- a/src/lager_emqtt_backend.erl +++ b/src/lager_emqtt_backend.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_SUITE.erl b/test/emqttd_SUITE.erl index 45fa13c50..a7ab2fb5f 100644 --- a/test/emqttd_SUITE.erl +++ b/test/emqttd_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_access_SUITE.erl b/test/emqttd_access_SUITE.erl index e127cf601..5ab7e992b 100644 --- a/test/emqttd_access_SUITE.erl +++ b/test/emqttd_access_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_acl_test_mod.erl b/test/emqttd_acl_test_mod.erl index c9ddf057e..196337fa4 100644 --- a/test/emqttd_acl_test_mod.erl +++ b/test/emqttd_acl_test_mod.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_auth_anonymous_test_mod.erl b/test/emqttd_auth_anonymous_test_mod.erl index 8424b467a..8e93be0bc 100644 --- a/test/emqttd_auth_anonymous_test_mod.erl +++ b/test/emqttd_auth_anonymous_test_mod.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_auth_dashboard.erl b/test/emqttd_auth_dashboard.erl index d36390a09..0e509c08a 100644 --- a/test/emqttd_auth_dashboard.erl +++ b/test/emqttd_auth_dashboard.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_lib_SUITE.erl b/test/emqttd_lib_SUITE.erl index 51dd499ba..e51e778f0 100644 --- a/test/emqttd_lib_SUITE.erl +++ b/test/emqttd_lib_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_mod_SUITE.erl b/test/emqttd_mod_SUITE.erl index 9240b8a3f..a258eabe0 100644 --- a/test/emqttd_mod_SUITE.erl +++ b/test/emqttd_mod_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2016 Feng Lee . +%% Copyright (c) 2016-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_mqueue_SUITE.erl b/test/emqttd_mqueue_SUITE.erl index 76ab62044..eaa0ecc68 100644 --- a/test/emqttd_mqueue_SUITE.erl +++ b/test/emqttd_mqueue_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_net_SUITE.erl b/test/emqttd_net_SUITE.erl index 22641c2b2..7d70f4291 100644 --- a/test/emqttd_net_SUITE.erl +++ b/test/emqttd_net_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2016 Feng Lee . +%% Copyright (c) 2016-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_protocol_SUITE.erl b/test/emqttd_protocol_SUITE.erl index 96b969278..49189bb90 100644 --- a/test/emqttd_protocol_SUITE.erl +++ b/test/emqttd_protocol_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_topic_SUITE.erl b/test/emqttd_topic_SUITE.erl index 5692dbb43..f8be7df1a 100644 --- a/test/emqttd_topic_SUITE.erl +++ b/test/emqttd_topic_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2016 Feng Lee . +%% Copyright (c) 2016-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_trie_SUITE.erl b/test/emqttd_trie_SUITE.erl index ceda3abcb..37d247755 100644 --- a/test/emqttd_trie_SUITE.erl +++ b/test/emqttd_trie_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. diff --git a/test/emqttd_vm_SUITE.erl b/test/emqttd_vm_SUITE.erl index a26bde4f4..ba56ef97f 100644 --- a/test/emqttd_vm_SUITE.erl +++ b/test/emqttd_vm_SUITE.erl @@ -1,5 +1,5 @@ %%-------------------------------------------------------------------- -%% Copyright (c) 2012-2016 Feng Lee . +%% Copyright (c) 2012-2017 Feng Lee . %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. From 9e0d8de37c89a17e4900d60b09486a2a549909ce Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Wed, 11 Jan 2017 15:29:24 +0800 Subject: [PATCH 40/40] Bump version to 2.0.7 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a4591784e..82dc2a0d5 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PROJECT = emqttd PROJECT_DESCRIPTION = Erlang MQTT Broker -PROJECT_VERSION = 2.0.6 +PROJECT_VERSION = 2.0.7 DEPS = gproc lager gen_logger esockd mochiweb