Skip to content

Commit

Permalink
Merge pull request #676 from esl/rel-1.6
Browse files Browse the repository at this point in the history
MongooseIM 1.6.2
  • Loading branch information
michalwski committed Feb 15, 2016
2 parents 1173328 + 868149d commit 584b901
Show file tree
Hide file tree
Showing 129 changed files with 5,086 additions and 1,806 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ apps/ejabberd/include/EJABBERD-MIB.hrl
apps/ejabberd/priv/mibs/EJABBERD-MIB.bin
apps/ejabberd/ebin/ejabberd.app

Mnesia.mongooseim@*
compile.log
ct.log
deps.log
quick_compile.log
dialyzer
configure.out
*.d
.rebar3
test/ejabberd_tests/get-deps.log
test/ejabberd_tests/quicktest.log
tags
site

# Dialyzer
.mongooseim_combo_dialyzer.plt

Expand Down
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ env:

matrix:
include:
- otp_release: R15B03
env: PRESET=internal_mnesia DB=mnesia REL_CONFIG=minimal
- otp_release: R16B03
env: PRESET=internal_mnesia DB=mnesia REL_CONFIG=minimal
- otp_release: 18.1
env: PRESET=internal_mnesia DB=mnesia REL_CONFIG=minimal

after_failure:
- tools/travis-upload-ct-reports.sh

notifications:
webhooks:
# trigger Buildtime Trend Service to parse Travis CI log
- https://buildtimetrend.herokuapp.com/travis
Binary file added .travis_deploy_rsa.enc
Binary file not shown.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
# MongooseIM 1.6.2

2016-02-12

This release includes:

- finished Riak backends for all modules storing persistent data:
- mod_offline [#594](https://github.com/esl/MongooseIM/pull/594)
- mod_privacy [#618](https://github.com/esl/MongooseIM/pull/618)
- MAM ([XEP-0313](https://xmpp.org/extensions/xep-0313.html)) for MUCs ([XEP-0045](https://xmpp.org/extensions/xep-0045.html)) [#622](https://github.com/esl/MongooseIM/pull/622)
- XMPP improvements:
- support for MAM ([XEP-0313](https://xmpp.org/extensions/xep-0313.html)) versions 0.3, 0.4.1 and 0.5 [#668](https://github.com/esl/MongooseIM/pull/668)
- support for Dialback Key Generation and Validation ([XEP-0185](https://xmpp.org/extensions/xep-0185.html)) [#665](https://github.com/esl/MongooseIM/pull/665)
- test improvements: [#602](https://github.com/esl/MongooseIM/pull/602), [#621](https://github.com/esl/MongooseIM/pull/621),[#637](https://github.com/esl/MongooseIM/pull/637), [#654](https://github.com/esl/MongooseIM/pull/654)
- dropped support for Erlang/OTP older than R16B03-1: [#613](https://github.com/esl/MongooseIM/pull/613), [#636](https://github.com/esl/MongooseIM/pull/636)
- updated cowboy to 1.0.4
- other improvements and code cleanup
- [complete list of merged PRs](https://github.com/esl/MongooseIM/pulls?utf8=✓&q=is%3Apr+base%3Amaster+merged%3A%222015-12-05..2016-02-12%22+sort%3Acreated-asc+)
- [complete list of closed issues](https://github.com/esl/MongooseIM/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aclosed+closed%3A%222015-12-05..2016-02-12%22+)

Special thanks to our contributors: @gbour, @bartekgorny, @jfjalburquerque

This release repo [history](https://github.com/esl/MongooseIM/graphs/contributors?from=2015-12-06&to=2016-02-12&type=c)


# MongooseIM 1.6.1

2015-12-07

This release includes:

- more Riak backends:
- mod_roster [#572](https://github.com/esl/MongooseIM/pull/572)
- mod_last [#567](https://github.com/esl/MongooseIM/pull/567)
Expand Down
29 changes: 3 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,38 +125,15 @@ fake_cert.pem:
fake_server.pem:
cat fake_cert.pem fake_key.pem > fake_server.pem

COMBO_PLT = .mongooseim_combo_dialyzer.plt
# We skip some deps, because they're Dialyzer-broken
BANNED_DEPS = meck edown
BANNED_PATHS = $(addsuffix /ebin, $(addprefix deps/, $(BANNED_DEPS)))
DEPS_LIBS = $(filter-out $(BANNED_PATHS), $(wildcard deps/*/ebin))
MONGOOSE_LIBS = $(wildcard apps/ejabberd/ebin/*.beam)

OTP_APPS = compiler crypto erts kernel stdlib mnesia ssl ssh xmerl public_key tools sasl hipe edoc syntax_tools runtime_tools inets webtool asn1
DIALYZER_APPS = ejabberd mysql pgsql
DIALYZER_APPS_PATHS = $(addsuffix /ebin, $(addprefix apps/, $(DIALYZER_APPS)))

check_plt:
dialyzer --check_plt --plt $(COMBO_PLT)

build_plt:
dialyzer --build_plt --apps $(OTP_APPS) --output_plt $(COMBO_PLT) $(DEPS_LIBS)

dialyzer: check_plt dialyzer_quick

dialyzer_quick:
dialyzer -n -Wno_return -Wno_unused -Wno_undefined_callbacks --fullpath --plt $(COMBO_PLT) $(DIALYZER_APPS_PATHS)
# fgrep -v -f ./dialyzer.ignore-warnings | tee dialyzer.log
include dialyzer.mk

xeplist: escript
escript $(XEP_TOOL)/xep_tool.escript markdown $(EJD_EBIN)

cleanplt:
rm $(COMBO_PLT)


test_deps:
cd test/ejabberd_tests; make get-deps

%:
@:

include tools/cd_tools/cd-targets
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
MongooseIM [![Build Status](https://travis-ci.org/esl/MongooseIM.svg?branch=master)](https://travis-ci.org/esl/MongooseIM) [![Documentation Status](https://readthedocs.org/projects/mongooseim/badge/?version=latest)](http://mongooseim.readthedocs.org/en/latest/?badge=latest) [![Coverage Status](https://img.shields.io/coveralls/esl/MongooseIM.svg)](https://coveralls.io/r/esl/MongooseIM?branch=master)
MongooseIM [![Build Status](https://travis-ci.org/esl/MongooseIM.svg?branch=master)](https://travis-ci.org/esl/MongooseIM) [![Documentation Status](https://readthedocs.org/projects/mongooseim/badge/?version=latest)](http://mongooseim.readthedocs.org/en/latest/?badge=latest) [![Coverage Status](https://img.shields.io/coveralls/esl/MongooseIM.svg)](https://coveralls.io/r/esl/MongooseIM?branch=master) [![Buildtime trend](https://buildtimetrend.herokuapp.com/badge/esl/MongooseIM/latest)](https://buildtimetrend.herokuapp.com/dashboard/esl/MongooseIM/)

============
<img align="left" src="https://www.erlang-solutions.com/sites/all/themes/erlang/img/mongoose/MongooseIM_blue.png"</img>

Expand Down Expand Up @@ -77,9 +78,9 @@ Features and supported standards
|[0085 - Chat State Notifications](http://xmpp.org/extensions/xep-0085.html)|[0086 - Error Condition Mappings](http://xmpp.org/extensions/xep-0086.html) | [0093 - Roster Item Exchange](http://xmpp.org/extensions/xep-0093.html)| [0114 - Jabber Component Protocol](http://xmpp.org/extensions/xep-0114.html)|
|[0124 - Bidirectional-streams Over Synchronous HTTP (BOSH)](http://xmpp.org/extensions/xep-0124.html)|[0126 - Invisibility](http://xmpp.org/extensions/xep-0126.html)| [0138 - Stream Compression](http://xmpp.org/extensions/xep-0138.html) | [0153 - vCard-Based Avatars](http://xmpp.org/extensions/xep-0153.html)|
|[0157 - Contact Addresses for XMPP Services](http://xmpp.org/extensions/xep-0157.html)| [0160 - Best Practices for Handling Offline Messages](http://xmpp.org/extensions/xep-0160.html)| [0170 - Recommended Order of Stream Feature Negotiation](http://xmpp.org/extensions/xep-0170.html)| [0175 - Best Practices for Use of SASL ANONYMOUS](http://xmpp.org/extensions/xep-0175.html)|
|[0184 - Message Delivery Receipts](http://xmpp.org/extensions/xep-0184.html)| [0198 - Stream Management](http://xmpp.org/extensions/xep-0198.html)| [0199 - XMPP Ping](http://xmpp.org/extensions/xep-0199.html)|[0202 - Entity Time](http://www.xmpp.org/extensions/xep-0202.html) | [0203 - Delayed Delivery](http://xmpp.org/extensions/xep-0203.html)|
|[0206 - XMPP Over BOSH](http://xmpp.org/extensions/xep-0206.html)| [0212 - XMPP Basic Server 2008](http://xmpp.org/extensions/xep-0212.html)| [0237 - Roster Versioning](http://xmpp.org/extensions/xep-0237.html)| [0279 - Server IP Check](http://xmpp.org/extensions/xep-0279.html)|
|[0280 - Message Carbons](http://xmpp.org/extensions/xep-0280.html)| [0313 - Message Archive Management v0.2 ](http://xmpp.org/extensions/attic/xep-0313-0.2.html)|
|[0185: Dialback Key Generation and Validation](http://www.xmpp.org/extensions/xep-0185.html)| [0184 - Message Delivery Receipts](http://xmpp.org/extensions/xep-0184.html)| [0198 - Stream Management](http://xmpp.org/extensions/xep-0198.html)| [0199 - XMPP Ping](http://xmpp.org/extensions/xep-0199.html)|
|[0202 - Entity Time](http://www.xmpp.org/extensions/xep-0202.html) | [0203 - Delayed Delivery](http://xmpp.org/extensions/xep-0203.html)| [0206 - XMPP Over BOSH](http://xmpp.org/extensions/xep-0206.html)| [0212 - XMPP Basic Server 2008](http://xmpp.org/extensions/xep-0212.html)|
|[0237 - Roster Versioning](http://xmpp.org/extensions/xep-0237.html)| [0279 - Server IP Check](http://xmpp.org/extensions/xep-0279.html)| [0280 - Message Carbons](http://xmpp.org/extensions/xep-0280.html)| [0313 - Message Archive Management v0.2 ](http://xmpp.org/extensions/attic/xep-0313-0.2.html)|


How to build
Expand All @@ -90,11 +91,10 @@ How to build
* GNU Make,
* GCC,
* Libexpat 1.95 or higher,
* Erlang/OTP R15B02 or higher,
* Reltool 0.5.4 or higher,
* Erlang/OTP R16B03-1 or higher,
* Reltool 0.6.4.1 or higher,
* OpenSSL 0.9.8 or higher, for STARTTLS, SASL and SSL encryption,
* Zlib 1.2.3 or higher for Stream Compression support (XEP-0138). Optional,
* PAM library. Optional. For Pluggable Authentication Modules (PAM).
* Zlib 1.2.3 or higher for Stream Compression support (XEP-0138). Optional.

2. Compiling on UNIX-like systems.

Expand Down Expand Up @@ -229,3 +229,7 @@ We recommend following client libraries:
* iOS, Objective-C: [XMPPframework](https://github.com/robbiehanson/XMPPFramework)
* Android, Java: [Smack](https://github.com/igniterealtime/Smack)
* Web, JavaScript: [Stanza.io](https://github.com/otalk/stanza.io)




2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.1
1.6.2
7 changes: 0 additions & 7 deletions apps/ejabberd/include/ejabberd.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,6 @@
info
}).

-ifdef(no_binary_to_integer).

-import(ejabberd_binary, [binary_to_integer/1,
integer_to_binary/1]).

-endif. % ifdef no_binary_to_integer

-record(scram,
{storedkey = <<"">>,
serverkey = <<"">>,
Expand Down
2 changes: 2 additions & 0 deletions apps/ejabberd/include/jlib.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
-define(NS_ADMIN, <<"http://jabber.org/protocol/admin">>).
-define(NS_SERVERINFO, <<"http://jabber.org/network/serverinfo">>).
-define(NS_MAM, <<"urn:xmpp:mam:tmp">>).
-define(NS_MAM_03, <<"urn:xmpp:mam:0">>). % MAM 0.3
-define(NS_MAM_04, <<"urn:xmpp:mam:1">>). % MAM 0.4.1 or 0.5

-define(NS_RSM, <<"http://jabber.org/protocol/rsm">>).
-define(NS_EJABBERD_CONFIG,<<"ejabberd:config">>).
Expand Down
1 change: 1 addition & 0 deletions apps/ejabberd/include/mod_muc_room.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
password = <<>>,
anonymous = true :: boolean(),
max_users = ?MAX_USERS_DEFAULT :: pos_integer() | none,
maygetmemberlist = [],
logging = false :: boolean()
}).

Expand Down
28 changes: 28 additions & 0 deletions apps/ejabberd/priv/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -161,23 +161,50 @@ CREATE TABLE roster_version (
-- ALTER TABLE rosterusers ADD COLUMN askmessage text AFTER ask;
-- UPDATE rosterusers SET askmessage = '';
-- ALTER TABLE rosterusers ALTER COLUMN askmessage SET NOT NULL;
--
-- NOTE: A "minified" JID is an encoded form of JID storing only
-- the difference between a user's JID and the real JID.
-- Consult with mod_mam_utils:jid_to_opt_binary/2
--
-- How it works. We produce encoded_jid using information from
-- archive_jid and real_jid:
-- | archive_jid | real_jid | encoded_jid
-- | ---------------- | --------------- | --------------------
-- | alice@host | alice@host |
-- | alice@host | alice@host/r1 | /r1
-- | alice@host | bob@host | bob
-- | alice@host | bob@host/r1 | bob/r1
-- | alice@host | kate@example | example:kate
-- | alice@host | kate@example/r1 | example@kate/r1
--
--
-- SIMPLE FORMAT
-- =============
--
-- Differences between old and simple format:
-- - message is stored as XML
-- - remote_bare_jid is not "minified"
-- To enable simple format pass {simple, true} as an option for mod_mam_odbc_arch
CREATE TABLE mam_message(
-- Message UID (64 bits)
-- A server-assigned UID that MUST be unique within the archive.
id BIGINT UNSIGNED NOT NULL,
user_id INT UNSIGNED NOT NULL,
-- FromJID used to form a message without looking into stanza.
-- This value will be send to the client "as is".
-- This JID is "minified".
from_jid varchar(250) CHARACTER SET binary NOT NULL,
-- The remote JID that the stanza is to (for an outgoing message) or from (for an incoming message).
-- This field is for sorting and filtering.
-- This JID is "minified".
remote_bare_jid varchar(250) CHARACTER SET binary NOT NULL,
remote_resource varchar(250) CHARACTER SET binary NOT NULL,
-- I - incoming, remote_jid is a value from From.
-- O - outgoing, remote_jid is a value from To.
-- Has no meaning for MUC-rooms.
direction ENUM('I','O') NOT NULL,
-- Term-encoded message packet
-- Don't try to decode it using MySQL tools
message blob NOT NULL,
PRIMARY KEY (user_id, id),
INDEX i_mam_message_rem USING BTREE (user_id, remote_bare_jid, id),
Expand All @@ -189,6 +216,7 @@ CREATE TABLE mam_message(
-- See for more information
-- http://dev.mysql.com/doc/refman/5.1/en/partitioning-hash.html


CREATE TABLE mam_config(
user_id INT UNSIGNED NOT NULL,
-- If empty, than it is a default behaviour.
Expand Down
8 changes: 3 additions & 5 deletions apps/ejabberd/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
{i, ["include"]},
{d, xml_nif},
{parse_transform, lager_transform},
{platform_define, "^R1[56]", latin1_characters},
{platform_define, "^R15", no_binary_to_integer},
{platform_define, "^R15", no_crypto_hmac}, %% Ref: OTP commit ffef856
{platform_define, "^R1[56]", only_builtin_types}]}. %% Ref: OTP commit b66e75c
{platform_define, "^R1[6]", latin1_characters},
{platform_define, "^R1[6]", only_builtin_types}]}. %% Ref: OTP commit b66e75c

{require_otp_vsn, "R?1[5678]"}.
{require_otp_vsn, "R?1[678]"}.

{port_specs,
[{".*", "priv/lib/tls_drv.so", ["c_src/tls_drv.c"], [{env, [{"LDFLAGS", "$LDFLAGS -lssl"}]}]},
Expand Down
18 changes: 11 additions & 7 deletions apps/ejabberd/src/acl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
to_record/3,
add/3,
delete/3,
match_rule/3]).
match_rule/3,
match_rule/4]).

-include("ejabberd.hrl").

Expand Down Expand Up @@ -120,24 +121,27 @@ normalize_spec(none) ->
-spec match_rule(Host :: host(),
Rule :: rule(),
JID :: ejabberd:jid()) -> allow | deny | term().
match_rule(_, all, _) ->
match_rule(Host, Rule, JID) ->
match_rule(Host, Rule, JID, deny).

match_rule(_, all, _, Default) ->
allow;
match_rule(_, none, _) ->
match_rule(_, none, _, Default) ->
deny;
match_rule(global, Rule, JID) ->
match_rule(global, Rule, JID, Default) ->
case ejabberd_config:get_global_option({access, Rule, global}) of
undefined ->
deny;
Default;
GACLs ->
match_acls(GACLs, JID, global)
end;
match_rule(Host, Rule, JID) ->
match_rule(Host, Rule, JID, Default) ->
GlobalACLs = ejabberd_config:get_global_option({access, Rule, global}),
HostACLs = ejabberd_config:get_global_option({access, Rule, Host}),

case {GlobalACLs, HostACLs} of
{undefined, undefined} ->
deny;
Default;
{undefined, HostACLs} ->
match_acls(HostACLs, JID, Host);
{GlobalACLs, undefined} ->
Expand Down
14 changes: 1 addition & 13 deletions apps/ejabberd/src/ejabberd.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
-xep([{xep, 212}, {version, "1.0"}]).
-export([start/0,
stop/0,
ensure_started/1,
get_pid_file/0,
get_so_path/0,
get_bin_path/0]).
Expand Down Expand Up @@ -90,18 +89,7 @@
-export_type([dict_t/0, queue_t/0, set_t/0]).

start() ->
ensure_started(ejabberd).

ensure_started(AppName) ->
case application:start(AppName) of
ok ->
ok;
{error, {already_started, AppName}} ->
ok;
{error, {not_started, AppName2}} ->
ok = ensure_started(AppName2),
ensure_started(AppName)
end.
application:ensure_all_started(ejabberd).

stop() ->
application:stop(ejabberd).
Expand Down
4 changes: 2 additions & 2 deletions apps/ejabberd/src/ejabberd_admin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ get_loglevel() ->
%%% Purge DB
%%%

-spec delete_expired_messages() -> 'ok'.
-spec delete_expired_messages() -> {ok, iolist()} | {error, iolist()}.
delete_expired_messages() ->
case mod_offline:remove_expired_messages(?MYNAME) of
{ok, C} ->
Expand All @@ -242,7 +242,7 @@ delete_expired_messages() ->
{error, io_lib:format("Can't delete expired messages: ~n~p", [Reason])}
end.

-spec delete_old_messages(Days :: integer()) -> 'ok'.
-spec delete_old_messages(Days :: integer()) -> {ok, iolist()} | {error, iolist()}.
delete_old_messages(Days) ->
case mod_offline:remove_old_messages(?MYNAME, Days) of
{ok, C} ->
Expand Down
7 changes: 5 additions & 2 deletions apps/ejabberd/src/ejabberd_auth_http.erl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ remove_user_req(LUser, LServer, Password, Method) ->
{ok, BodyOrCreated :: binary() | created} | {error, invalid_jid | http_error_atom() | binary()}.
make_req(_, _, LUser, LServer, _) when LUser == error orelse LServer == error ->
{error, invalid_jid};
make_req(Method, Path, LUser, LServer, Password) ->
make_req(Method, Path, LUser, LServer, Password) ->
AuthOpts = ejabberd_config:get_local_option(auth_opts, LServer),
BasicAuth = case lists:keyfind(basic_auth, 1, AuthOpts) of
{_, BasicAuth0} -> BasicAuth0;
Expand Down Expand Up @@ -296,7 +296,10 @@ login(_User, _Server) ->
get_password(_User, _Server, _DefaultValue) ->
erlang:error(not_implemented).

stop(_Host) ->
stop(Host) ->
Id = {ejabberd_auth_http_sup, Host},
supervisor:terminate_child(ejabberd_sup, Id),
supervisor:delete_child(ejabberd_sup, Id),
ok.

is_external(Host) ->
Expand Down
Loading

0 comments on commit 584b901

Please sign in to comment.