Commit Graph

7956 Commits

Author SHA1 Message Date
Thales Macedo Garitezi
c14e8db869
style(format): format elixir files 2021-12-27 10:51:12 -03:00
Thales Macedo Garitezi
a4fd777d77
chore(mix): take into account different release/package/edition types 2021-12-27 09:57:56 -03:00
Thales Macedo Garitezi
cc652c3343
ci(mix): add elixir deps check
Checks whether there are discrepancies between rebar3 and mix deps.
2021-12-24 14:44:49 -03:00
Thales Macedo Garitezi
0655572f64
chore(mix): fix: use Elixir's own rpc-eval call for "eval" 2021-12-24 11:40:30 -03:00
Thales Macedo Garitezi
08571f0914
chore(mix): fix: vm.args is actually a template file 2021-12-24 09:59:53 -03:00
Thales Macedo Garitezi
4977921cdb
chore(mix): produce tar and copy more files to release 2021-12-24 09:59:30 -03:00
Thales Macedo Garitezi
4287a8f88d
chore(mix): auto-discover umbrella apps 2021-12-24 08:22:26 -03:00
Thales Macedo Garitezi
f3bbcd2c79
chore(nodetool): always print result 2021-12-24 08:21:21 -03:00
Thales Macedo Garitezi
67cca5d3a1
chore(mix): use the same script in mix release as in rebar release
Surprisingly enough, by doing small cirurgical changes in the existing
EMQX control scripts, we are able to get it running with Elixir and
with existing functionalities (`console`, `remote_console`, `start`,
`stop`, `ctl`, `foreground`, `eval`).
2021-12-23 17:20:04 -03:00
Thales Macedo Garitezi
11c169501e
chore(mix): fix app dependencies and reboot apps (emqx_conf)
While declaring `emqx_conf` as an application dependency of
`emqx_resource` worked for releases, it messed up the startup
relationship during tests.  Since only removing `emqx_conf` from the
`applications` key in `emqx_resource` breaks the list of apps that
need to be rebooted on config changes (since `emqx_conf` is not on any
apps dependencies list, it was not being added to the final
topologically sorted list), we now always add it as a vertex to ensure
its presence there.  This (apparently) makes the rebar3 release, the
mix release and test runs behave normally.
2021-12-23 13:48:28 -03:00
Thales Macedo Garitezi
238895a301
chore(mix): correctly define release version
With this, we no longer need the last hack in `mix_release.sh`.

A version schema with 3 parts (Major.Minor.Patch) is required by
Elixir:

https://hexdocs.pm/elixir/1.13.1/Version.html#module-versions
2021-12-22 15:43:43 -03:00
Thales Macedo Garitezi
014b6d3cfd
chore(shellcheck): fix shellcheck linting warnings 2021-12-22 15:43:43 -03:00
Thales Macedo Garitezi
e137555052
fix(tests): fix include paths that were moved 2021-12-22 15:15:19 -03:00
Thales Macedo Garitezi
68cbded7c6
fix(dialyzer): fix dialyzer warnings
Adding hocon to emqx solves the issue, since other offending apps
depend on emqx.  The warnings were that it was not able to find info
on the `hocon_schema` behaviour.

Example:
```
Callback info about the hocon_schema behaviour is not available
```
2021-12-22 15:15:19 -03:00
Thales Macedo Garitezi
62024854e5
chore(mix): wrap produced script and set required variables
We create a shim script that calls the one produced by Mix Release,
creating and setting the required configurations.
2021-12-22 15:15:19 -03:00
Thales Macedo Garitezi
a5939790c5
refactor(bin): extract common script functionalities into separate files
In order for us to reuse most of the functionalities implemented in
`bin/eqmx` also in the Elixir release script, common variable and
function definitions are extracted in separated bash files that can be
sourced by both Rebar and Elixir release scripts.
2021-12-22 10:35:06 -03:00
Thales Macedo Garitezi
93d603e336
chore(mix): copy more required files to release
This adds a few more required file copying/templating to the release
build step.
2021-12-22 09:46:40 -03:00
Thales Macedo Garitezi
34d6dbca61
chore(mix): simplify build by using rebar3 for umbrella apps
By treating the apps in the umbrella as dependencies to be managed and
built by rebar3, we can simplify the maintenance of the release, at
the cost of increased build times: using Mix as before, it could track
changed files better than using rebar.  But the complexity and
possibility of discrepancies make it using rebar much more compelling.
2021-12-22 09:40:01 -03:00
Thales Macedo Garitezi
2ff46a6dbb
chore(mix): create a few more required files during release
Since Mix does not support hot upgrades out of the box, it does not
create a `RELEASES` file by default.  Here, we introduce functionality
similar to what `relx` does in order for that file to be generated.

fdc8d7237e/src/rlx_assemble.erl (L928-L948)

The `RELEASES` file, in its turn, is required for `nodetool` to work
properly, and `nodetool` is required for us to generate several
required config files using `hocon`.  Since the `start{_clean}.boot`
file used by the files generated by Elixir must be explicitly defined
in the `RELEASE_LIB` `boot_var`, we apply a small patch in the
existing `nodetool` in order to inject that required parameter when
calling the escript.
2021-12-21 17:28:39 -03:00
Thales Macedo Garitezi
917575de5a
chore(mix): minimal elixir mix release build
This commit enables a minimal working build of EMQX release using
Mix.  However, to properly start the release, several configuration
steps are still missing.  A `mix_release.sh` script does a few hacks
to get the release built with Mix to start properly, by first assuming
that `make emqx` has been run prior to the release, ran once to
generate the `app.*.config` files, and then it copies that and some
other files to the expected places.

Also, `emqx_telemetry` hangs the start procedure because it thinks
it's in an official release and tries to make a request.  We disable
it temporarily via config just to get a working build for now.
2021-12-21 13:51:22 -03:00
tigercl
a9b443ae34
Merge pull request #6491 from tigercl/chore/dashboard-vsn
chore(dashboard): update dashboard version
2021-12-20 15:34:09 +08:00
zhouzb
bac2fa6905 chore(dashboard): update dashboard version 2021-12-20 15:24:49 +08:00
JianBo He
db08cee20f
Merge pull request #6456 from HJianBo/gw-review-r1 2021-12-20 13:48:24 +08:00
Shawn
efb0365cdd
Merge pull request #6481 from terry-xiaoyu/fix_rule_apis
fix(connector): some desc for connector APIs
2021-12-20 13:46:29 +08:00
Shawn
27de3139a4 fix(http_connect): don't check status on_start 2021-12-20 11:36:52 +08:00
zhongwencool
f7a55d3f8d
Merge pull request #6238 from zhongwencool/fix-keepalive-ct-failed
fix: keepalive ct failed
2021-12-20 11:00:20 +08:00
JianBo He
5b1ed76a44 chore(gw-frame): export types for dialyzer check 2021-12-20 10:59:16 +08:00
tigercl
aceb4f1930
Merge pull request #6273 from Rory-Z/ci/add-push-ecr-for-5.0
ci: add new steps for push ecr image when release
2021-12-20 10:27:53 +08:00
Shawn
a879ec0f3a feat(resource): add option 'force_create' to emqx_resource:create/4 2021-12-20 10:26:27 +08:00
zhongwencool
96ee51fe57
Merge pull request #6460 from zmstone/feat-add-plugin-mgmt
refactor(plugins): refactor plugins configuration interface
2021-12-20 09:24:38 +08:00
Shawn
05e24b457a fix(bridge): update emqx_bridge.conf 2021-12-18 20:53:14 +08:00
Shawn
a9c9d9d805 fix(rule): rename enabled to enable 2021-12-18 20:28:14 +08:00
Shawn
cfaad15364 fix(connector): update the connector config failed 2021-12-18 20:19:34 +08:00
Shawn
a44e18e869 fix(bridge): filter out some extra fields from the request body 2021-12-18 19:19:58 +08:00
Shawn
11e8e0db69 fix(bridge): stop http failed due to econnrefused 2021-12-18 15:33:25 +08:00
Shawn
f08f37ec9c fix(bridge): create bridge failed but the config was saved 2021-12-18 11:19:22 +08:00
Shawn
20091f8d2a fix(connector): some desc for connector APIs 2021-12-18 09:52:15 +08:00
Shawn
b2e7a6a249
Merge pull request #6473 from terry-xiaoyu/fix_connector_apis
fix(connector): add type and name in repsonse of GET /connectors
2021-12-18 09:35:45 +08:00
Shawn
494c08f849 refactor(rule): add name field to request body of POST /rules 2021-12-18 06:34:44 +08:00
Ilya Averyanov
7cceecc11e
Merge pull request #6446 from savonarola/test-authz-more
Test authz more
2021-12-17 19:06:52 +03:00
k32
93acf8a3a7
Merge pull request #6451 from k32/dev/fix-dispatch-when-emqx-is-stopped
fix(broker): Check broker status before dispatch
2021-12-17 15:19:34 +01:00
Shawn
673a545aa2 fix(dialyzer): bad type specs 2021-12-17 22:15:56 +08:00
Shawn
7bcd38c101 fix(bridge): update qos fields for swagger examples 2021-12-17 21:41:25 +08:00
Shawn
0699682f38 refactor(bridges): rename some config entries for MQTT bridge 2021-12-17 21:22:04 +08:00
Ilya Averyanov
e24cdb067c chore(authz): fix Mysql variable substitution 2021-12-17 14:20:53 +03:00
Ilya Averyanov
462ec39cb1 chore(authz): test Postgresql backend with real Postgresql 2021-12-17 14:20:50 +03:00
Ilya Averyanov
0a1a68245d chore(authz): test Mysql backend with real Mysql 2021-12-17 14:18:54 +03:00
Ilya Averyanov
a21f67a67e chore(authz): test Mongo backend with real Mongo 2021-12-17 14:18:54 +03:00
Ilya Averyanov
28c319b6c4 chore(authz): test Mongo backend with real Mongo 2021-12-17 14:18:54 +03:00
Ilya Averyanov
6ad71a483e chore(authz): test Redis backend with real Redis 2021-12-17 14:18:54 +03:00