Merge branch 'dev' of github.com:emqtt/emqtt into dev
This commit is contained in:
commit
80f0ebe3b3
|
@ -1,3 +1,9 @@
|
||||||
[submodule "plugins/emqttd_dashboard"]
|
[submodule "plugins/emqttd_dashboard"]
|
||||||
path = plugins/emqttd_dashboard
|
path = plugins/emqttd_dashboard
|
||||||
url = https://github.com/emqtt/emqttd_dashboard.git
|
url = https://github.com/emqtt/emqttd_dashboard.git
|
||||||
|
[submodule "plugins/emysql"]
|
||||||
|
path = plugins/emysql
|
||||||
|
url = https://github.com/erylee/emysql.git
|
||||||
|
[submodule "plugins/emqttd_plugin_mysql"]
|
||||||
|
path = plugins/emqttd_plugin_mysql
|
||||||
|
url = https://github.com/emqtt/emqttd_plugin_mysql.git
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -29,11 +29,14 @@ edoc:
|
||||||
@$(REBAR) doc
|
@$(REBAR) doc
|
||||||
|
|
||||||
rel: compile
|
rel: compile
|
||||||
@cd rel && ../rebar generate -f
|
@cd rel && $(REBAR) generate -f
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
@for plugin in ./plugins/* ; do \
|
@for plugin in ./plugins/* ; do \
|
||||||
|
if [ -d $${plugin} ]; then \
|
||||||
|
echo "copy $${plugin}"; \
|
||||||
cp -R $${plugin} $(DIST)/plugins/ && rm -rf $(DIST)/$${plugin}/src/ ; \
|
cp -R $${plugin} $(DIST)/plugins/ && rm -rf $(DIST)/$${plugin}/src/ ; \
|
||||||
|
fi \
|
||||||
done
|
done
|
||||||
|
|
||||||
dist: rel plugins
|
dist: rel plugins
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
Please see [Plugin Design](https://github.com/emqtt/emqttd/wiki/Plugin%20Design).
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 2d3c9aeabeb5289b9ae27c503f017ad71bd81174
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 892810dbc853ba147f9acabecd52bb51218275e2
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 38927104b44b3f8d237bcf3a2b50f2e0608291b3
|
|
@ -141,13 +141,6 @@ case "$1" in
|
||||||
echo $RES
|
echo $RES
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Sanity check the plugins.config file
|
|
||||||
RES=`$NODETOOL_LITE chkconfig $RUNNER_ETC_DIR/plugins.config`
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
echo "Error reading $RUNNER_ETC_DIR/plugins.config"
|
|
||||||
echo $RES
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
HEART_COMMAND="$RUNNER_SCRIPT_DIR/$SCRIPT start"
|
HEART_COMMAND="$RUNNER_SCRIPT_DIR/$SCRIPT start"
|
||||||
export HEART_COMMAND
|
export HEART_COMMAND
|
||||||
mkdir -p $PIPE_DIR
|
mkdir -p $PIPE_DIR
|
||||||
|
@ -265,13 +258,6 @@ case "$1" in
|
||||||
echo $RES
|
echo $RES
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Sanity check the plugins.config file
|
|
||||||
RES=`$NODETOOL_LITE chkconfig $RUNNER_ETC_DIR/plugins.config`
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
echo "Error reading $RUNNER_ETC_DIR/plugins.config"
|
|
||||||
echo $RES
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# Setup beam-required vars
|
# Setup beam-required vars
|
||||||
ROOTDIR=$RUNNER_BASE_DIR
|
ROOTDIR=$RUNNER_BASE_DIR
|
||||||
ERL_LIBS=$ROOTDIR/plugins
|
ERL_LIBS=$ROOTDIR/plugins
|
||||||
|
@ -279,7 +265,7 @@ case "$1" in
|
||||||
EMU=beam
|
EMU=beam
|
||||||
PROGNAME=`echo $0 | sed 's/.*\///'`
|
PROGNAME=`echo $0 | sed 's/.*\///'`
|
||||||
CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$SCRIPT \
|
CMD="$BINDIR/erlexec -boot $RUNNER_BASE_DIR/releases/$APP_VSN/$SCRIPT \
|
||||||
-embedded -config $RUNNER_ETC_DIR/emqttd.config -config $RUNNER_ETC_DIR/plugins.config \
|
-embedded -config $RUNNER_ETC_DIR/emqttd.config \
|
||||||
-pa $RUNNER_LIB_DIR/basho-patches \
|
-pa $RUNNER_LIB_DIR/basho-patches \
|
||||||
-args_file $RUNNER_ETC_DIR/vm.args -- ${1+"$@"}"
|
-args_file $RUNNER_ETC_DIR/vm.args -- ${1+"$@"}"
|
||||||
export EMU
|
export EMU
|
||||||
|
@ -305,13 +291,6 @@ case "$1" in
|
||||||
echo $RES
|
echo $RES
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Sanity check the plugins.config file
|
|
||||||
RES=`$NODETOOL_LITE chkconfig $RUNNER_ETC_DIR/plugins.config`
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
echo "Error reading $RUNNER_ETC_DIR/plugins.config"
|
|
||||||
echo $RES
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "config is OK"
|
echo "config is OK"
|
||||||
;;
|
;;
|
||||||
escript)
|
escript)
|
||||||
|
|
|
@ -165,7 +165,7 @@
|
||||||
%% Plugins
|
%% Plugins
|
||||||
{plugins, [
|
{plugins, [
|
||||||
{dir, "./plugins"},
|
{dir, "./plugins"},
|
||||||
{loaded_file, "./data/loaded_plugins"}
|
{loaded_file, "./data/plugins.config"}
|
||||||
]},
|
]},
|
||||||
%% Listeners
|
%% Listeners
|
||||||
{listeners, [
|
{listeners, [
|
||||||
|
|
|
@ -1,26 +1 @@
|
||||||
[
|
emqttd_dashboard.
|
||||||
% {emysql, [
|
|
||||||
% {pool_size, 4},
|
|
||||||
% {host, "localhost"},
|
|
||||||
% {port, 3306},
|
|
||||||
% {username, "root"},
|
|
||||||
% {password, "public"},
|
|
||||||
% {database, "mqtt"},
|
|
||||||
% {encoding, utf8}
|
|
||||||
% ]},
|
|
||||||
% {emqttd_auth_mysql, [
|
|
||||||
% {user_table, mqtt_users},
|
|
||||||
% {password_hash, plain},
|
|
||||||
% {field_mapper, [
|
|
||||||
% {username, username},
|
|
||||||
% {password, password}
|
|
||||||
% ]}
|
|
||||||
% ]},
|
|
||||||
% {emqttd_dashboard, [
|
|
||||||
% {listener,
|
|
||||||
% {emqttd_dashboard, 18083, [
|
|
||||||
% {acceptors, 4},
|
|
||||||
% {max_clients, 512}]}}
|
|
||||||
% ]}
|
|
||||||
%
|
|
||||||
].
|
|
||||||
|
|
|
@ -87,7 +87,6 @@
|
||||||
{template, "files/acl.config", "etc/acl.config"},
|
{template, "files/acl.config", "etc/acl.config"},
|
||||||
{template, "files/rewrite.config", "etc/rewrite.config"},
|
{template, "files/rewrite.config", "etc/rewrite.config"},
|
||||||
{template, "files/clients.config", "etc/clients.config"},
|
{template, "files/clients.config", "etc/clients.config"},
|
||||||
{template, "files/plugins.config", "etc/plugins.config"},
|
|
||||||
{template, "files/vm.args", "etc/vm.args"},
|
{template, "files/vm.args", "etc/vm.args"},
|
||||||
{copy, "files/loaded_plugins", "data/loaded_plugins"}
|
{copy, "files/plugins.config", "data/plugins.config"}
|
||||||
]}.
|
]}.
|
||||||
|
|
|
@ -213,8 +213,9 @@ read_loaded() ->
|
||||||
write_loaded(AppNames) ->
|
write_loaded(AppNames) ->
|
||||||
case file:open(env(loaded_file), [binary, write]) of
|
case file:open(env(loaded_file), [binary, write]) of
|
||||||
{ok, Fd} ->
|
{ok, Fd} ->
|
||||||
Line = list_to_binary(io_lib:format("~w.~n", [AppNames])),
|
lists:foreach(fun(Name) ->
|
||||||
file:write(Fd, Line);
|
file:write(Fd, iolist_to_binary(io_lib:format("~s.~n", [Name])))
|
||||||
|
end, AppNames);
|
||||||
{error, Error} ->
|
{error, Error} ->
|
||||||
{error, Error}
|
{error, Error}
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -57,6 +57,6 @@ start_session(CleanSess, ClientId, ClientPid) ->
|
||||||
init([]) ->
|
init([]) ->
|
||||||
{ok, {{simple_one_for_one, 10, 10},
|
{ok, {{simple_one_for_one, 10, 10},
|
||||||
[{session, {emqttd_session, start_link, []},
|
[{session, {emqttd_session, start_link, []},
|
||||||
transient, 10000, worker, [emqttd_session]}]}}.
|
temporary, 10000, worker, [emqttd_session]}]}}.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue