Skip to content
Closed
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d885620
feature: OTP version upgrade to 27
Feb 19, 2025
a3fcc1a
fix: remove log format file and update dependency url for eleveldb
Feb 23, 2025
d35a992
fix: unable to stp application and unable to subscribe
Feb 25, 2025
0f3ac3e
chore: formatting fix
Feb 25, 2025
5ee3755
test: fix test method deprecations
Mar 2, 2025
5ce541a
feature: test build on different os and OTP versions
Mar 2, 2025
aec35e7
test: fix tests breaking due to ordering
Mar 3, 2025
12428c9
chore: skip make db-setup for build to pipeline to run
Mar 3, 2025
0501a38
chore: formatting fix
Mar 3, 2025
a689c48
ignore dialyzer results
Mar 4, 2025
15e14b6
test: jwerl url update
Mar 4, 2025
749d67c
test: fix vmq_diversity suites
Mar 5, 2025
2bc870c
test: fixed test suites and cluster suite WIP
Mar 13, 2025
55729d3
test: fix breaking test suites
Mar 19, 2025
ec75ea7
test: fix breaking suites
Mar 19, 2025
9a3b6fc
disabling dialyzer again
Mar 19, 2025
ca0b157
fix: multiple test fix
Mar 19, 2025
efae016
chore: typo fix
Mar 19, 2025
ef168f5
WIP try coverage on ubuntu 22.04
Mar 19, 2025
5d13598
test: fix simple_prometheus_test testcase
Mar 19, 2025
5d20471
fix: fixed postgres breaking test and removed OTP 23 from pr checks
Mar 25, 2025
a69bc37
chore: formatting fix
Mar 25, 2025
3a9ea5a
fix: eccs testcase fix for vmq_schema_SUITE
Mar 25, 2025
cfd1190
fix: ignore dialyzer in rebar config
yashGojek Mar 28, 2025
458e6b6
fix: remove clique overrride
yashGojek Mar 28, 2025
f6e76e2
chore: remove fail on warnings
yashGojek Mar 28, 2025
3812a8d
fix: depenedency update for sidecar
yashGojek Mar 28, 2025
ad337e3
chore: cleanup
yashGojek Mar 28, 2025
e31481e
fix: remove unwanted lock file in apps
yashGojek Mar 31, 2025
6b0722b
fix: add libraries missing in otp 27 alpine image
yashGojek Apr 8, 2025
3df4242
fix: add libraries missing in otp 27 alpine image
yashGojek Apr 8, 2025
df5a991
fix: add libraries missing in otp 27 alpine image
yashGojek Apr 8, 2025
c5b52dc
fix: add libraries missing in otp 27 alpine image
yashGojek Apr 8, 2025
c982712
fix: upgrade alpine version
yashGojek Apr 8, 2025
6c6e5ef
fix: listener show cmd error
yashGojek Apr 8, 2025
aa2c136
fix: listener func issue
yashGojek Apr 8, 2025
bb9f725
fix: listener fix for sidecar
yashGojek Apr 10, 2025
fe58fd5
chore: Remove .DS_Store from repo
yashGojek Apr 17, 2025
15b393d
chore: formatting fix and remove unwanted changes
yashGojek Apr 17, 2025
1eef88e
chore: revert unwanted changes and fix formatting
yashGojek Apr 17, 2025
65c5bd0
fix: systog dependency added
yashGojek Apr 18, 2025
8961792
fix: revert apk changes for alpine runitime container
yashGojek Apr 21, 2025
47bc5fe
fix: revert unwanted schema changes
yashGojek Apr 21, 2025
2d57766
chore: remove unwanted changes
yashGojek Apr 24, 2025
9141563
chore: remove unwanted changes
yashGojek Apr 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 79 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,33 @@ on:
- published
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
# Default OTP version used for current releases
DEFAULT_RELEASE_OTP: 27

jobs:
code_checks:
name: Check code style and quality
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: 23.0
otp-version: ${{ env.DEFAULT_RELEASE_OTP }}
version-type: strict
- run: sudo apt-get -y install libsnappy-dev
- name: Check code formatting (erlfmt)
run: ./rebar3 fmt -c
- name: Run dialyzer type checker
run: ./rebar3 dialyzer
continue-on-error: true
coverage:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 90
needs: code_checks
services:
postgres:
Expand Down Expand Up @@ -68,11 +78,75 @@ jobs:
- uses: actions/checkout@v2.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: 23.0
otp-version: 27.0
version-type: strict
- run: sudo apt-get -y install libsnappy-dev
- run: sudo apt-get -y install pcregrep
- run: make rel
- run: make db-setup
# - run: make db-setup
- run: pwd
- run: sh ./run-tests-with-retry.sh .

tests:
name: Test on ${{ matrix.os }} with OTP ${{ matrix.otp }}
runs-on: ${{ matrix.os }}
timeout-minutes: 90

strategy:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
otp:
- "27.0"
- "26.0"
- "25.0"
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USER: vmq_test_user
POSTGRES_PASSWORD: vmq_test_password
POSTGRES_DB: vmq_test_database
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached
ports:
- 11211:11211
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redissentinel:
image: bitnami/redis-sentinel
ports:
- 26379:26379
options: >-
--health-cmd "redis-cli -p 26379 ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2.0.0
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
- run: sudo apt-get -y install libsnappy-dev
- run: sudo apt-get -y install pcregrep
- run: make rel
# - run: make db-setup
- run: pwd
- run: sh ./run-tests-with-retry.sh .
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ vernemq.iml

.vscode/
erlang_ls.config

*.DS_Store
Comment thread
yashGojek marked this conversation as resolved.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ language: erlang
install: true
otp_release:
- 22.0
- 22.2
- 22.3
- 23.0
- 24.0
- 25.0
- 26.0
- 27.0
cache:
directories:
- plts
Expand Down
4 changes: 2 additions & 2 deletions apps/vmq_acl/src/vmq_acl_cli.erl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ register() ->
"vmq_acl.acl_reload_interval"
],
[
clique:register_config([Key], fun register_config_callback/3)
clique:register_config([Key], fun register_config_callback/2)
|| Key <- ConfigKeys
],
ok = clique:register_config_whitelist(ConfigKeys).

register_config_callback(_, _, _) ->
register_config_callback(_, _) ->
vmq_acl_reloader:change_config_now().
19 changes: 19 additions & 0 deletions apps/vmq_commons/src/vmq_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
set_interval/2,
extract_version/1
]).
-export([mqtt_version_to_string/1]).

ts() ->
{Mega, Sec, Micro} = os:timestamp(),
Expand Down Expand Up @@ -99,3 +100,21 @@ extract_version_test(_) ->
?_assertEqual(nomatch, extract_version("new_line_test_file.acl"))
].
-endif.

mqtt_version_to_string([]) ->
"";
mqtt_version_to_string(VersionList) ->
VersionString = lists:map(
fun(Version) ->
case Version of
3 -> "mqtt 3.1";
4 -> "mqtt 3.1.1";
5 -> "mqtt 5";
131 -> "mqtt 3.1 (bridge)";
132 -> "mqtt 3.1.1 (bridge)";
_ -> "unknown"
end
end,
VersionList
),
string:join(VersionString, ", ").
56 changes: 56 additions & 0 deletions apps/vmq_diversity/priv/vmq_diversity.schema
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,34 @@
{commented, "{{platform_etc_dir}}/keyfile.pem"}
]}.

%% @doc Setting the depth for CA chains
{mapping, "vmq_diversity.postgres.ssl.depth", "vmq_diversity.db_config.postgres.depth", [
{default, 3},
{datatype, integer},
hidden
]}.

%% @doc Allow the plugin to open SSL connections to remote DB with wildcard certs
{mapping, "vmq_diversity.postgres.ssl.customize_hostname_check", "vmq_diversity.db_config.postgres.customize_hostname_check", [
{datatype, {enum, ['https']}},
{default, 'https'},
{commented, on}
]}.
%% @doc Whether the client verifies the server cert or not.
%% Use "verify_peer" in production.
{mapping, "vmq_diversity.postgres.ssl.verify", "vmq_diversity.db_config.postgres.verify", [
{default, 'verify_peer'},
{datatype, {enum, ['verify_none',
'verify_peer']}}
]}.

%% @doc Whether to use the System CAs (public_key:cacerts_get/0).
%% Can be used as an alternative to provide a CAcertfile
{mapping, "vmq_diversity.postgres.ssl.use_system_cas", "vmq_diversity.db_config.postgres.use_system_cas", [
{default, on},
{datatype, flag}
]}.

%% @doc The password hashing method to use in PostgreSQL:
{mapping, "vmq_diversity.postgres.password_hash_method", "vmq_diversity.db_config.postgres.password_hash_method",
[{datatype, {enum, [crypt, bcrypt]}},
Expand Down Expand Up @@ -184,6 +212,34 @@
{commented, "{{platform_etc_dir}}/keyfile.pem"}
]}.

%% @doc Setting the depth for CA chains
{mapping, "vmq_diversity.cockroachdb.ssl.depth", "vmq_diversity.db_config.cockroachdb.depth", [
{default, 3},
{datatype, integer},
hidden
]}.

%% @doc Allow the plugin to open SSL connections to remote DB with wildcard certs
{mapping, "vmq_diversity.cockroachdb.ssl.customize_hostname_check", "vmq_diversity.db_config.cockroachdb.customize_hostname_check", [
{datatype, {enum, ['https']}},
{default, 'https'},
{commented, on}
]}.
%% @doc Whether the client verifies the server cert or not.
%% Use "verify_peer" in production.
{mapping, "vmq_diversity.cockroachdb.ssl.verify", "vmq_diversity.db_config.cockroachdb.verify", [
{default, 'verify_peer'},
{datatype, {enum, ['verify_none',
'verify_peer']}}
]}.

%% @doc Whether to use the System CAs (public_key:cacerts_get/0).
%% Can be used as an alternative to provide a CAcertfile
{mapping, "vmq_diversity.cockroachdb.ssl.use_system_cas", "vmq_diversity.db_config.cockroachdb.use_system_cas", [
{default, on},
{datatype, flag}
]}.

%% @doc The password hashing method to use in CockroachDB:
{mapping, "vmq_diversity.cockroachdb.password_hash_method", "vmq_diversity.db_config.cockroachdb.password_hash_method",
[{datatype, {enum, [sha256, bcrypt]}},
Expand Down
21 changes: 9 additions & 12 deletions apps/vmq_diversity/rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@
]}.
{deps, [
{poolboy, "1.5.2"},
{epgsql, "4.3.0"},
{eredis, "1.2.0"},
{epgsql, "4.7.1"},
{eredis, "1.7.1"},
hackney,
{jsx, "2.10.0"},
%% bcrypt fails to build on OSX previous to https://github.com/erlangpack/bcrypt/pull/17
%% TODO: Use bcrypt from hex.pm, once commit 550281173c2f4e414b6da6711e4eb23e4e7884d1 is merged
{bcrypt, {git, "https://github.com/erlangpack/bcrypt.git", {branch, "master"}}},
{clique, {git, "https://github.com/vernemq/clique.git", {branch, "rel_0.3.6-verne"}}},
{jsx, "3.1.0"},
bcrypt,
{clique, {git, "https://github.com/vernemq/clique.git", {tag, "0.3.7-verne"}}},
{gen_server2, {git, "https://github.com/erlio/gen_server2.git", {branch, "master"}}},
{luerl, {git, "https://github.com/rvirding/luerl.git", {branch, "develop"}}},
{emysql,
{git, "https://github.com/vernemq/Emysql.git", "f9e72697842e0665c274867392a497ffdf6c52e6"}},
{emysql, {git, "https://github.com/vernemq/Emysql.git", {ref, "f9e7269"}}},
%%Eonblast hasn't merged the Erlang 18 related PR from djustinek
%%{emysql, {git, "https://github.com/Eonblast/Emysql.git", {tag, "v0.4.1"}}},
{mongodb, {git, "https://github.com/comtihon/mongodb-erlang.git", {branch, "master"}}},
{mcd, {git, "https://github.com/EchoTeam/mcd.git", {ref, "b5b4a32"}}}
{mongodb, {git, "https://github.com/emqx/mongodb-erlang.git", {tag, "v3.0.23"}}},
{mcd, {git, "https://github.com/mths1/mcd.git", {branch, "master"}}}
]}.

{overrides, [
Expand All @@ -29,7 +26,7 @@
[
{deps, [
{bson, {git, "https://github.com/vintenove/bson-erlang", {branch, "master"}}},
{pbkdf2, {git, "https://github.com/basho/erlang-pbkdf2.git", {tag, "2.0.0"}}}
{pbkdf2, {git, "https://github.com/basho/erlang-pbkdf2.git", {tag, "2.1.0"}}}
]},
{plugins, []}
]}
Expand Down
2 changes: 1 addition & 1 deletion apps/vmq_diversity/src/vmq_diversity_bcrypt.erl
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ gen_salt(_, St) ->
{[list_to_binary(Salt)], St}.

hashpw([Pass, Salt], St) when is_binary(Pass) and is_binary(Salt) ->
{ok, Hash} = bcrypt:hashpw(Pass, Salt),
{ok, Hash} = bcrypt:hashpw(Pass, binary:bin_to_list(Salt)),
{[list_to_binary(Hash)], St}.
4 changes: 2 additions & 2 deletions apps/vmq_diversity/src/vmq_diversity_cli.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ register_config() ->
ConfigKeys =
["vmq_diversity.keep_state"],
[
clique:register_config([Key], fun register_config_callback/3)
clique:register_config([Key], fun register_config_callback/2)
|| Key <- ConfigKeys
],
ok = clique:register_config_whitelist(ConfigKeys).

register_config_callback(_, _, _) ->
register_config_callback(_, _) ->
ok.

register_cli_usage() ->
Expand Down
Loading
Loading