Skip to content

Commit

Permalink
Merge branch 'master' into feature/instrument
Browse files Browse the repository at this point in the history
  • Loading branch information
chrzaszcz committed Apr 16, 2024
2 parents a629f02 + 4c125a0 commit a8a8464
Show file tree
Hide file tree
Showing 53 changed files with 788 additions and 367 deletions.
5 changes: 3 additions & 2 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2.1

references:
- &OTP25 mongooseim/cimg-erlang:25.3.2.6
- &OTP26 mongooseim/cimg-erlang:26.1.2
- &OTP25 mongooseim/cimg-erlang:25.3.2.9
- &OTP26 mongooseim/cimg-erlang:26.2.2
- &ENTRYPOINT ["/bin/sh", "-c", "eval ${INSTALL_DEPS_CMD:-echo} && echo __INJECT_FILES__ | eval ${BASE32DEC:-base32 --decode} | bash"]
# Caches created via the save_cache step are stored for up to 15 days
- &CERT_KEY certs-cache-{{ checksum "certs_cache_key" }}-v3
Expand Down Expand Up @@ -961,6 +961,7 @@ workflows:

- small_tests_26
- internal_mnesia_26
- pgsql_cets_26
- pgsql_mnesia_26
- mysql_redis_26
- mssql_mnesia_26
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@ jobs:
## the full list of supported (prebuilt) OTP versions for ubuntu-22.04 runners
## can be found here:
## https://builds.hex.pm/builds/otp/ubuntu-22.04/builds.txt
otp: [ '25.3.2.6', '26.1.2' ]
otp: [ '25.3.2.9', '26.2.2' ]
runs-on: ubuntu-22.04
env:
PRESET: 'small_tests'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: erlef/setup-beam@v1.16.0
with:
otp-version: ${{ matrix.otp }}
Expand Down Expand Up @@ -78,6 +80,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/big-tests
with:
otp: ${{matrix.otp}}
Expand Down Expand Up @@ -106,6 +110,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ./.github/actions/big-tests
with:
otp: ${{matrix.otp}}
Expand Down Expand Up @@ -138,6 +144,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: erlef/setup-beam@v1.16.0
with:
otp-version: ${{matrix.otp}}
Expand All @@ -152,6 +160,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: erlef/setup-beam@v1.16.0
with:
otp-version: ${{matrix.otp}}
Expand All @@ -166,6 +176,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: erlef/setup-beam@v1.16.0
with:
otp-version: ${{matrix.otp}}
Expand All @@ -183,4 +195,6 @@ jobs:
pkg_PLATFORM: ${{matrix.pkg}}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: tools/test.sh -p pkg
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
# [MongooseIM 6.2.1](https://github.com/esl/MongooseIM/releases/tag/6.2.1) - 2024-04-12

## Highlights

- Enhanced CETS
- Pools configuration
- Traffic shapers update
- Support for MAM v1.1.0
- More reliable testing
- Various improvements and fixes

## All changes

### Added
- RDBMS backend for `mod_caps` (#4211)
- Commit hash to GraphQL server status (#4221, #4262)
- Erlang Doctor debugging tool (#4248)
- Pools:
- By host type (#4229)
- By host config (#4235)
- Names to `mongoose_rdbms` (#4231)

### Changed
- Improved shapers (#4187, #4203, #4213)
- Enhanced discovery requests handling (#4194)
- User-friendly errors for internal databases in the GraphQL API (#4192)
- Increase `idle_timeout` for SSE (#4196)
- Presence management refactor (#4207)
- MAM implementation update to version 1.1.0 (#4218, #4225)
- Roster management refactor (#4209)

### Fixed
- CETS improvements:
- Pause on all nodes (#4204)
- Node cleanup (#4234, #4250, #4251)
- Unnecessary logs removal (#4205)
- Node discovery (#4255, #4256)
- MAM lookup error handling (#4191)
- MUC Light `id` definition for MariaDB (#4195)
- `max_stanza_size` issue (#4197)
- Duplicate migration files (#4230)
- Invalid MAM IDs parsing and overflow (#4242)
- Certificate options verification on HTTPS (#4236)
- GitHub Actions status badge (#4261)

### Other
- Testing improvements/fixes (#4176, #4202, #4212, #4237, #4239, #4243, #4241, #4246, #4257, #4259, #4260)
- Update migration guide (#4258)

## Commits, merged PRs and closed issues
- [List of merged PRs](https://github.com/esl/MongooseIM/pulls?q=is%3Apr+is%3Amerged+milestone%3A6.2.1)

- [List of closed issues](https://github.com/esl/MongooseIM/issues?q=is%3Aissue+is%3Aclosed+closed%3A2023-12-13..2024-04-12)

- [Repository history for this release](https://github.com/esl/MongooseIM/graphs/contributors?from=2023-12-13&to=2024-04-12&type=c)

- [List of merged PRs based on merge date](https://github.com/esl/MongooseIM/pulls?q=is%3Apr+base%3Amaster+merged%3A%222023-12-13..2024-04-12%22+sort%3Acreated-asc+)

# [MongooseIM 6.2.0](https://github.com/esl/MongooseIM/releases/tag/6.2.0) - 2023-12-13

## Highlights
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# MongooseIM platform

[![GitHub release](https://img.shields.io/github/release/esl/MongooseIM.svg)](https://github.com/esl/MongooseIM/releases)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/esl/MongooseIM/tree/rel-6.1.svg?style=shield)](https://app.circleci.com/pipelines/github/esl/MongooseIM?branch=rel-6.1)
[![Codecov](https://codecov.io/gh/esl/MongooseIM/branch/rel-6.1/graph/badge.svg)](https://app.codecov.io/gh/esl/MongooseIM/tree/rel-6.1)
[![GitHub Actions](https://github.com/esl/MongooseIM/workflows/CI/badge.svg?branch=rel-6.1)](https://github.com/esl/MongooseIM/actions/workflows/ci.yml?query=branch%3Arel-6.1)
[![Coveralls](https://coveralls.io/repos/github/esl/MongooseIM/badge.svg?branch=rel-6.1)](https://coveralls.io/github/esl/MongooseIM?branch=rel-6.1)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/esl/MongooseIM/tree/rel-6.2.svg?style=shield)](https://app.circleci.com/pipelines/github/esl/MongooseIM?branch=rel-6.2)
[![Codecov](https://codecov.io/gh/esl/MongooseIM/branch/rel-6.2/graph/badge.svg)](https://app.codecov.io/gh/esl/MongooseIM/tree/rel-6.2)
[![GitHub Actions](https://github.com/esl/MongooseIM/actions/workflows/ci.yml/badge.svg?branch=rel-6.2)](https://github.com/esl/MongooseIM/actions/workflows/ci.yml?query=branch%3Arel-6.2)
[![Coveralls](https://coveralls.io/repos/github/esl/MongooseIM/badge.svg?branch=rel-6.2)](https://coveralls.io/github/esl/MongooseIM?branch=rel-6.2)

* [Getting started](https://esl.github.io/MongooseDocs/latest/getting-started/Installation/)
* [Developer's guide](https://esl.github.io/MongooseDocs/latest/developers-guide/Testing-MongooseIM/)
Expand Down Expand Up @@ -63,6 +63,7 @@ Check out our test results:
See the documentation for the latest releases:

* [Master](https://esl.github.io/MongooseDocs/latest/)
* [6.2.1](https://esl.github.io/MongooseDocs/6.2.1/)
* [6.2.0](https://esl.github.io/MongooseDocs/6.2.0/)
* [6.1.0](https://esl.github.io/MongooseDocs/6.1.0/)
* [6.0.0](https://esl.github.io/MongooseDocs/6.0.0/)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.2.0
6.2.1
60 changes: 60 additions & 0 deletions big_tests/tests/ca_certificate_helper.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
-module(ca_certificate_helper).

-compile([export_all, nowarn_export_all]).

-include_lib("common_test/include/ct.hrl").

generate_cert(Config, #{cn := User} = CertSpec, BasicTemplateValues) ->
ConfigTemplate = filename:join(?config(mim_data_dir, Config), "openssl-user.cnf"),
{ok, Template} = file:read_file(ConfigTemplate),
XMPPAddrs = maps:get(xmpp_addrs, CertSpec, undefined),
TemplateValues = maps:merge(BasicTemplateValues, prepare_template_values(User, XMPPAddrs)),
OpenSSLConfig = bbmustache:render(Template, TemplateValues),
UserConfig = filename:join(?config(priv_dir, Config), User ++ ".cfg"),
ct:log("OpenSSL config: ~ts~n~ts", [UserConfig, OpenSSLConfig]),
file:write_file(UserConfig, OpenSSLConfig),
UserKey = filename:join(?config(priv_dir, Config), User ++ "_key.pem"),
case maps:get(signed, CertSpec, ca) of
ca -> generate_ca_signed_cert(Config, User, UserConfig, UserKey);
self -> generate_self_signed_cert(Config, User, UserConfig, UserKey)
end.

prepare_template_values(User, XMPPAddrsIn) ->
XMPPAddrs = maybe_prepare_xmpp_addresses(XMPPAddrsIn),
#{"cn" => User, "xmppAddrs" => XMPPAddrs}.

maybe_prepare_xmpp_addresses(undefined) ->
"";
maybe_prepare_xmpp_addresses(Addrs) when is_list(Addrs) ->
AddrsWithSeq = lists:enumerate(Addrs),
Entries = [make_xmpp_addr_entry(I, Addr) || {I, Addr} <- AddrsWithSeq],
string:join(Entries, "\n").

make_xmpp_addr_entry(I, Addr) ->
% id-on-xmppAddr OID is specified in the openssl-user.cnf config file
"otherName." ++ integer_to_list(I) ++ " = id-on-xmppAddr;UTF8:" ++ Addr.


generate_ca_signed_cert(Config, Filename, ConfigCfg, KeyFilename) ->
Csr = filename:join(?config(priv_dir, Config), Filename ++ ".csr"),
Cmd = ["openssl req -config ", ConfigCfg, " -newkey rsa:2048 -sha256 -nodes -out ",
Csr, " -keyout ", KeyFilename, " -outform PEM"],
Out = os:cmd(Cmd),
ct:log("generate_ca_signed_cert 1:~nCmd ~p~nOut ~ts", [Cmd, Out]),
Cert = filename:join(?config(priv_dir, Config), Filename ++ "_cert.pem"),
SignCmd = filename:join(?config(mim_data_dir, Config), "sign_cert.sh"),
Cmd2 = [SignCmd, " --req ", Csr, " --out ", Cert],
SSLDir = filename:join([path_helper:repo_dir(Config), "tools", "ssl"]),
OutLog = os:cmd("cd " ++ SSLDir ++ " && " ++ Cmd2),
ct:log("generate_ca_signed_cert 2:~nCmd ~p~nOut ~ts", [Cmd2, OutLog]),
#{key => KeyFilename,
cert => Cert}.

generate_self_signed_cert(Config, Filename, ConfigCfg, KeyFilename) ->
Cert = filename:join(?config(priv_dir, Config), Filename ++ "_self_signed_cert.pem"),
Cmd = ["openssl req -config ", ConfigCfg, " -newkey rsa:2048 -sha256 -nodes -out ",
Cert, " -keyout ", KeyFilename, " -x509 -outform PEM -extensions client_req_extensions"],
OutLog = os:cmd(Cmd),
ct:log("generate_self_signed_cert:~nCmd ~p~nOut ~ts", [Cmd, OutLog]),
#{key => KeyFilename,
cert => Cert}.
Loading

0 comments on commit a8a8464

Please sign in to comment.