Commit Graph

209 Commits

Author SHA1 Message Date
Thales Macedo Garitezi 465e73cac0 feat: deny upgrades for now 2022-12-27 13:10:12 -03:00
Thales Macedo Garitezi 86a4010b8d refactor(review): use `lists:flatten/1` 2022-12-27 11:14:57 -03:00
Thales Macedo Garitezi 5428d46694 feat: log the upgrade script being used for visibility 2022-12-27 11:14:57 -03:00
Thales Macedo Garitezi 7c6bb63ce9 feat(upgrade): add forward version check for upgrade script
https://emqx.atlassian.net/browse/EMQX-6978

[Related EIP](c4864eeccb/active/0022-forward-check-install-upgrade-script.md)

Currently, when performing a hot upgrade, the scripts that are run are
those from the currently installed EMQX version. It has a validation
that prevents upgrade between different minor versions. If we want to
allow an upgrade from, say, 5.0.x to 5.1.y, then the scripts in
already released packages will deny such operation. Also, if an
upgrade installation script contains a bug in the current, it will
never be able to execute properly without manual patching.

By attempting to execute the scripts from the target version, we may
add fixes and new validations to new EMQX versions and have them
executed by older versions.
2022-12-23 17:50:33 -03:00
Ivan Dyachkov 4a9be95f6d chore: fix logging in bin/emqx on non-tty 2022-12-19 14:58:59 +01:00
Ivan Dyachkov e8073f9e7d chore: fix RUNNER_ROOT_DIR detection on MacOS 2022-12-19 13:07:18 +01:00
Zaiming (Stone) Shi 56066a03b5 Merge remote-tracking branch 'origin/release-50' into 1214-sync-master-upstreams 2022-12-14 20:04:20 +01:00
Zaiming (Stone) Shi 74ce4ec606 fix(bin/emqx): typo in bin/emqx usage info 2022-12-14 20:01:17 +01:00
Ivan Dyachkov ec826f03c9 chore: colorize warning and error logs 2022-12-07 14:42:09 +01:00
Ivan Dyachkov 9e1b3fb47e chore: remove exclamation marks around warngings in bin/emqx 2022-12-07 14:04:25 +01:00
Ivan Dyachkov 04d3385229 chore: ensure default stat on macos when resolving running root dir 2022-12-07 14:02:35 +01:00
firest c430218e26 chore: make remsh node name away from the atom DOS attack
The remsh node name is generated to be unique, this may cause atom leakage, so we need to change the generation rule to limit the total of these names
2022-11-17 16:41:26 +08:00
Ivan Dyachkov b3a7fd26dc chore: stat to resolve script dir on macos and realpath otherwise 2022-10-05 11:39:07 +02:00
Zaiming (Stone) Shi f272495b8e fix(bin/emqx): ensure log dir is created by runner user 2022-09-16 09:49:55 +08:00
Thales Macedo Garitezi d4416dc581 chore: drop support for license files (ee5.0)
Related issue: EMQX-7247

EMQX ee5.0 is to drop support for both the old license format (x509)
and for files containing the new format.
2022-09-14 09:44:59 -03:00
Ivan Dyachkov 7cfca31aaf build: sign binary files in macos package 2022-09-12 21:50:00 +02:00
Ivan Dyachkov bc850281f2 build: use realpath instead of readlink
realpath works the same way in GNU and BSD systems
2022-09-07 21:31:58 +02:00
Zaiming (Stone) Shi ac840e318e refactor(cookie): Warning message when boot with default Erlang cookie 2022-09-06 18:58:35 +02:00
Zaiming (Stone) Shi 809f2ede09 fix(bin/emqx): ensure no crash dump when checking compatibility 2022-08-11 22:05:03 +02:00
Thales Macedo Garitezi 80d35feb33 fix(license): change schema to allow updating license to different type
Before this change, if a license in `emqx.conf` was of type
`key`/`file` and then changed to the opposite type, such change would
be saved to `{cluster,local}-overrides.conf`.  When the node restarts
after that, the configs are merged naively and becomes invalid, as it
contains both the `key` and `file` keys, and crashes.
2022-07-28 17:29:59 -03:00
Chris 24f88679ae feat: Added emqx command to check configs 2022-07-25 11:01:08 +02:00
William Yang a6f14c255d feat: add emqx_cluster_rescue 2022-07-15 15:47:52 +02:00
Zhongwen Deng 0ee732c076 fix: typo error +ssl_dist_optfile to \-ssl_dist_optfile 2022-07-02 17:19:21 +08:00
Zaiming (Stone) Shi b3f16ccb36 fix: Erlang distribution over TLS 2022-06-28 21:49:02 +02:00
Zaiming (Stone) Shi 2457143645 fix(windows): log to console when running in console mode 2022-06-17 07:51:59 +02:00
Zaiming (Stone) Shi 41808fc2a2 chore: add a comment to describe why setting ESCRIPT_NAME 2022-06-11 14:41:01 +02:00
Zaiming (Stone) Shi 8151f79f45 fix(bin/emqx): turn off debug print when need to capture stderror 2022-05-31 16:31:16 +02:00
Zaiming (Stone) Shi c56fbb0d5d fix(emqx.cmd): write_ini should be done before invoking Erlang
Otherwise erl.exe may turn to C:\System Files to load dll modules
2022-05-31 15:03:31 +02:00
Thales Macedo Garitezi b1d3b9ba04
style: strange style forced by git? 2022-05-26 14:55:05 -03:00
Thales Macedo Garitezi d0c5de1da6
chore(config): move db configs under cluster/node keys 2022-05-26 14:02:22 -03:00
Shawn b9a9da3208 fix(relup): improve the error code and log messages 2022-05-25 10:58:06 +08:00
Shawn f036a946a8 fix: only support .tar.gz files when hot upgrade 2022-05-25 01:59:52 +08:00
Shawn b942fde836 fix: porting the install_upgrade.escript from v4.4 2022-05-24 15:05:08 +08:00
DDDHuang 809c0bede7 fix: check node name, regular expression 2022-05-19 09:52:00 +08:00
Zhongwen Deng 41268dba01 fix: can't get emqx's priv_dir when whitespace in install path 2022-05-05 15:59:14 +08:00
Thales Macedo Garitezi e59bea03ad
Merge pull request #7765 from thalesmg/node-dump-license-info
feat(node_dump): add license info to node_dump
2022-04-26 09:04:12 -03:00
Thales Macedo Garitezi 208cc0fad8
feat(node_dump): add license info to node_dump 2022-04-25 11:42:20 -03:00
Zaiming (Stone) Shi 12d7975c36
Merge pull request #7733 from thalesmg/fix-node-dump-root
fix(node_dump): define `RUNNER_ROOT_DIR` before sourcing vars
2022-04-23 10:56:24 +01:00
Shawn 7ee0887237 fix: ./bin/emqx_ctl status failed
The CLI emqx_ctl fails:

```
./bin/emqx_ctl status

Node not initialized?
Generated config file vm.*.args is not found for command 'ctl'
in config dir: /Users/liuxy/code/emqx50/_build/emqx/rel/emqx/-emqx_data_dir /Users/liuxy/code/emqx50/_build/emqx/rel/emqx/data --/configs
In case the file has been deleted while the node is running,
set environment variable 'EMQX_NODE__NAME' to continue
```
2022-04-23 15:07:58 +08:00
Thales Macedo Garitezi a6e458b23e
fix(node_dump): define `RUNNER_ROOT_DIR` before sourcing vars
`emqx_vars` requires `RUNNER_ROOT_DIR` to be defined before being
sourced.
2022-04-22 17:31:36 -03:00
Zaiming (Stone) Shi ce902b5405 refactor(bin/emqx): speed up boot
The main slow-down is the overheads of booting up beam with the
'start_clean' boot file (which loads all modules).

Prior to this change, beam is started multiple times in order to
resolve configuration values.

After this change:
* For boot commands such as 'start', 'console' and
  'foreground', it starts beam twice:
  - 1st is to check platform compatibility
  - 2nd is to resolve all configs required for boot in a batch
* For non-boot commands, such as 'ctl' and 'ping', it does not
  require to start beam for config resolution at all
2022-04-22 11:35:50 +02:00
Zaiming (Stone) Shi 6b0f56d4d6 fix(windows): start console mode in erl but not werl
otherwise there is no way to debug a boot
2022-04-22 08:21:07 +02:00
Zaiming (Stone) Shi 18cebd9be7 feat: parameterise console flavor
so we can start an Erlang console in a Elixir release
by: env EMQX_CONSOLE_FLAVOR=erl ./bin/emqx console
2022-04-13 23:29:17 +02:00
Zaiming (Stone) Shi 82ef4c87e5 fix(bin/emqx): configure mnesia dir in vm.args file 2022-04-13 21:55:05 +02:00
Zaiming (Stone) Shi 3c03c0cfc1 feat(bin/emqx): make possible to boot Erlang node from Elixir build 2022-04-13 21:55:05 +02:00
Zaiming (Stone) Shi 2dbc65cfe3 fix(bin/emqx): make possible to start in path with space 2022-04-13 21:55:05 +02:00
Zaiming (Stone) Shi 72405f977c refactor(bin/emqx): remove unnecessary intermediate env variables 2022-04-13 13:50:56 +02:00
Zaiming (Stone) Shi c8242816b0 refactor(bin/emqx): no need to template-render RUNNER_ROOT_DIR 2022-04-13 13:50:25 +02:00
Zaiming (Stone) Shi c62f7e5baa chore: fix typos in bin/emqx 2022-04-13 13:50:25 +02:00
Thales Macedo Garitezi b5ac56ba50
feat(db): check if OTP has mnesia_hook, otherwise fallback to mnesia
Adds a check to `bin/emqx` to see if the OTP version being used has
support for `mnesia_hook`, which is required by Mria for using the
RLOG backend.  If OTP is not compatible and the user tries to use
RLOG, a warning is printed during startup and the configuration falls
back to using the Mnesia backend.
2022-04-11 14:33:16 -03:00