Просмотр исходного кода

Merge branch 'emqx-main-v4.3' into main-v4.3

曹文涛 4 лет назад
Родитель
Сommit
9dcb93ed7d
54 измененных файлов с 301 добавлено и 236 удалено
  1. 10 31
      .github/workflows/build_packages.yaml
  2. 1 9
      .github/workflows/run_fvt_tests.yaml
  3. 5 5
      CHANGES-4.3.md
  4. 11 1
      Makefile
  5. 1 1
      NOTICE
  6. 13 13
      README-CN.md
  7. 13 13
      README-JP.md
  8. 9 9
      README-RU.md
  9. 11 11
      README.md
  10. 8 8
      Windows.md
  11. 2 2
      apps/emqx_auth_http/README.md
  12. 2 2
      apps/emqx_auth_jwt/README.md
  13. 2 2
      apps/emqx_auth_ldap/README.md
  14. 2 2
      apps/emqx_auth_mongo/README.md
  15. 1 1
      apps/emqx_auth_mysql/README.md
  16. 1 1
      apps/emqx_auth_pgsql/README.md
  17. 2 2
      apps/emqx_auth_redis/README.md
  18. 13 13
      apps/emqx_bridge_mqtt/README.md
  19. 13 13
      apps/emqx_bridge_mqtt/docs/guide.rst
  20. 2 2
      apps/emqx_coap/README.md
  21. 2 2
      apps/emqx_exhook/README.md
  22. 2 2
      apps/emqx_exhook/docs/design-cn.md
  23. 2 2
      apps/emqx_exproto/README.md
  24. 4 4
      apps/emqx_exproto/docs/design-cn.md
  25. 1 1
      apps/emqx_lua_hook/README.md
  26. 2 2
      apps/emqx_lwm2m/README.md
  27. 1 1
      apps/emqx_management/README.md
  28. 3 3
      apps/emqx_prometheus/README.md
  29. 2 2
      apps/emqx_recon/README.md
  30. 2 2
      apps/emqx_retainer/README.md
  31. 1 1
      apps/emqx_rule_engine/README.md
  32. 3 3
      apps/emqx_rule_engine/docs/design.md
  33. 2 2
      apps/emqx_sn/README.md
  34. 2 2
      apps/emqx_stomp/README.md
  35. 2 2
      apps/emqx_web_hook/README.md
  36. 1 1
      bin/emqx
  37. 1 1
      bin/node_dump
  38. 5 2
      build
  39. 1 1
      deploy/charts/emqx/Chart.yaml
  40. 30 30
      deploy/charts/emqx/README.md
  41. 6 6
      deploy/charts/emqx/values.yaml
  42. 3 1
      deploy/docker/Dockerfile
  43. 10 10
      deploy/docker/README.md
  44. 1 1
      deploy/docker/docker-entrypoint.sh
  45. 1 1
      etc/emqx_cloud/vm.args
  46. 1 1
      etc/emqx_edge/vm.args
  47. 1 1
      lib-ce/emqx_dashboard/README.md
  48. 2 2
      lib-extra/README.md
  49. 1 1
      pkg-vsn.sh
  50. 1 0
      scripts/find-props.sh
  51. 1 0
      scripts/find-suites.sh
  52. 70 0
      scripts/relup-base-packages.sh
  53. 7 4
      scripts/relup-base-vsns.sh
  54. 5 1
      scripts/shellcheck.sh

+ 10 - 31
.github/workflows/build_packages.yaml

@@ -1,6 +1,13 @@
 name: Cross build packages
 
+concurrency:
+  group: build-${{ github.event_name }}-${{ github.ref }}
+  cancel-in-progress: true
+
 on:
+  push:
+    branches:
+      - 'main-v4.**'
   schedule:
     - cron:  '0 */6 * * *'
   release:
@@ -15,7 +22,6 @@ jobs:
 
     outputs:
       profiles: ${{ steps.set_profile.outputs.profiles}}
-      old_vsns: ${{ steps.set_profile.outputs.old_vsns}}
 
     steps:
       - uses: actions/checkout@v2
@@ -28,12 +34,8 @@ jobs:
         run: |
           cd source
           if make emqx-ee --dry-run > /dev/null 2>&1; then
-            old_vsns="$(./scripts/relup-base-vsns.sh enterprise | xargs)"
-            echo "::set-output name=old_vsns::$old_vsns"
             echo "::set-output name=profiles::[\"emqx-ee\"]"
           else
-            old_vsns="$(./scripts/relup-base-vsns.sh community | xargs)"
-            echo "::set-output name=old_vsns::$old_vsns"
             echo "::set-output name=profiles::[\"emqx\", \"emqx-edge\"]"
           fi
       - name: get_all_deps
@@ -216,6 +218,7 @@ jobs:
     needs: prepare
 
     strategy:
+      fail-fast: false
       matrix:
         profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
         arch:
@@ -269,32 +272,6 @@ jobs:
         path: .
     - name: unzip source code
       run: unzip -q source.zip
-    - name: downloads old emqx zip packages
-      env:
-        PROFILE: ${{ matrix.profile }}
-        ARCH: ${{ matrix.arch }}
-        SYSTEM: ${{ matrix.os }}
-        OLD_VSNS: ${{ needs.prepare.outputs.old_vsns }}
-      run: |
-        set -e -x -u
-        broker=$PROFILE
-        if [ $PROFILE = "emqx" ];then
-            broker="emqx-ce"
-        fi
-        if [ ! -z "$(echo $SYSTEM | grep -oE 'raspbian')" ]; then
-            export ARCH="arm"
-        fi
-
-        mkdir -p source/_upgrade_base
-        cd source/_upgrade_base
-        old_vsns=($(echo $OLD_VSNS | tr ' ' ' '))
-        for tag in ${old_vsns[@]}; do
-          if [ ! -z "$(echo $(curl -I -m 10 -o /dev/null -s -w %{http_code} https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip) | grep -oE "^[23]+")" ];then
-            wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip
-            wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$broker/$tag/$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip.sha256
-            echo "$(cat $PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip.sha256) $PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip" | sha256sum -c || exit 1
-          fi
-        done
     - name: build emqx packages
       env:
         ERL_OTP: erl23.2.7.2-emqx-3
@@ -342,6 +319,7 @@ jobs:
     needs: prepare
 
     strategy:
+      fail-fast: false
       matrix:
         profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
         registry:
@@ -439,6 +417,7 @@ jobs:
     needs: [prepare, mac, linux, docker]
 
     strategy:
+      fail-fast: false
       matrix:
         profile: ${{fromJSON(needs.prepare.outputs.profiles)}}
 

+ 1 - 9
.github/workflows/run_fvt_tests.yaml

@@ -239,6 +239,7 @@ jobs:
           name: Checkout
           with:
             path: emqx
+            fetch-depth: 0
         - name: Prepare credentials
           run: |
             if [ "$PROFILE" = "emqx-ee" ]; then
@@ -246,15 +247,6 @@ jobs:
               git config --global credential.helper store
               echo "${{ secrets.CI_GIT_TOKEN }}" >> emqx/scripts/git-token
             fi
-        - name: Download bases
-          run: |
-            set -e -x -u
-            mkdir -p emqx/_upgrade_base
-            cd emqx/_upgrade_base
-            old_vsns=($(echo $OLD_VSNS | tr ' ' ' '))
-            for old_vsn in ${old_vsns[@]}; do
-              wget --no-verbose https://s3-us-west-2.amazonaws.com/packages.emqx/$BROKER/$old_vsn/$PROFILE-ubuntu20.04-${old_vsn#[e|v]}-amd64.zip
-            done
         - name: Build emqx
           run: make -C emqx ${PROFILE}-zip
         - uses: actions/upload-artifact@v2

+ 5 - 5
CHANGES-4.3.md

@@ -1,6 +1,6 @@
-# EMQ X 4.3 Changes
+# EMQX 4.3 Changes
 
-Started tracking changes in CHANGE.md since EMQ X v4.3.11
+Started tracking changes in CHANGE.md since EMQX v4.3.11
 
 NOTE: Keep prepending to the head of the file instead of the tail
 
@@ -53,9 +53,9 @@ Important notes:
 
 ### Important changes
 
-* Debian/Ubuntu package (deb) installed EMQ X now runs on systemd [#6389]<br>
+* Debian/Ubuntu package (deb) installed EMQX now runs on systemd [#6389]<br>
   This is to take advantage of systemd's supervision functionality to ensure
-  EMQ X service is restarted after crashes.
+  EMQX service is restarted after crashes.
 
 ### Minor changes
 
@@ -71,7 +71,7 @@ Important notes:
 
 * Fix session takeover race condition which may lead to message loss [#6396]
 
-* EMQ X docker images are pushed to aws public ecr in an automated CI job [#6271]<br>
+* EMQX docker images are pushed to aws public ecr in an automated CI job [#6271]<br>
   `docker pull public.ecr.aws/emqx/emqx:4.3.10`
 
 * Fix webhook URL path to allow rule-engine variable substitution [#6399]

+ 11 - 1
Makefile

@@ -3,6 +3,7 @@ REBAR_VERSION = 3.14.3-emqx-8
 REBAR = $(CURDIR)/rebar3
 BUILD = $(CURDIR)/build
 SCRIPTS = $(CURDIR)/scripts
+export EMQX_RELUP ?= true
 export EMQX_EXTRA_PLUGINS = emqx_plugin_kafka
 export EMQX_DEFAULT_BUILDER = emqx/build-env:erl23.2.7.2-emqx-3-alpine
 export EMQX_DEFAULT_RUNNER = alpine:3.12
@@ -126,10 +127,19 @@ COMMON_DEPS := $(REBAR) get-dashboard $(CONF_SEGS)
 $(REL_PROFILES:%=%-rel) $(PKG_PROFILES:%=%-rel): $(COMMON_DEPS)
 	@$(BUILD) $(subst -rel,,$(@)) rel
 
+## download relup base packages
+.PHONY: $(REL_PROFILES:%=%-relup-downloads)
+define download-relup-packages
+$1-relup-downloads:
+	@if [ "$${EMQX_RELUP}" = "true" ]; then $(CURDIR)/scripts/relup-base-packages.sh $1; fi
+endef
+ALL_ZIPS = $(REL_PROFILES)
+$(foreach zt,$(ALL_ZIPS),$(eval $(call download-relup-packages,$(zt))))
+
 ## relup target is to create relup instructions
 .PHONY: $(REL_PROFILES:%=%-relup)
 define gen-relup-target
-$1-relup: $(COMMON_DEPS)
+$1-relup: $1-relup-downloads $(COMMON_DEPS)
 	@$(BUILD) $1 relup
 endef
 ALL_ZIPS = $(REL_PROFILES)

+ 1 - 1
NOTICE

@@ -1,4 +1,4 @@
-EMQ X, a highly scalable, highly available distributed MQTT messaging broker for IoT.
+EMQX, a highly scalable, highly available distributed MQTT messaging broker for IoT.
 Copyright (c) 2017-2021 EMQ Technologies Co., Ltd. All Rights Reserved.
 
 This product contains code developed at EMQ Technologies Co., Ltd.

+ 13 - 13
README-CN.md

@@ -1,4 +1,4 @@
-# EMQ X Broker
+# EMQX Broker
 
 [![GitHub Release](https://img.shields.io/github/release/emqx/emqx?color=brightgreen)](https://github.com/emqx/emqx/releases)
 [![Build Status](https://travis-ci.org/emqx/emqx.svg)](https://travis-ci.org/emqx/emqx)
@@ -13,20 +13,20 @@
 
 [English](./README.md) | 简体中文 | [日本語](./README-JP.md) | [русский](./README-RU.md)
 
-*EMQ X* 是一款完全开源,高度可伸缩,高可用的分布式 MQTT 消息服务器,适用于 IoT、M2M 和移动应用程序,可处理千万级别的并发客户端。
+*EMQX* 是一款完全开源,高度可伸缩,高可用的分布式 MQTT 消息服务器,适用于 IoT、M2M 和移动应用程序,可处理千万级别的并发客户端。
 
-从 3.0 版本开始,*EMQ X* 完整支持 MQTT V5.0 协议规范,向下兼容 MQTT V3.1 和 V3.1.1,并支持 MQTT-SN、CoAP、LwM2M、WebSocket 和 STOMP 等通信协议。EMQ X 3.0 单集群可支持千万级别的 MQTT 并发连接。
+从 3.0 版本开始,*EMQX* 完整支持 MQTT V5.0 协议规范,向下兼容 MQTT V3.1 和 V3.1.1,并支持 MQTT-SN、CoAP、LwM2M、WebSocket 和 STOMP 等通信协议。EMQX 3.0 单集群可支持千万级别的 MQTT 并发连接。
 
-- 新功能的完整列表,请参阅 [EMQ X Release Notes](https://github.com/emqx/emqx/releases)。
-- 获取更多信息,请访问 [EMQ X 官网](https://www.emqx.cn/)。
+- 新功能的完整列表,请参阅 [EMQX Release Notes](https://github.com/emqx/emqx/releases)。
+- 获取更多信息,请访问 [EMQX 官网](https://www.emqx.cn/)。
 
 ## 安装
 
-*EMQ X* 是跨平台的,支持 Linux、Unix、macOS 以及 Windows。这意味着 *EMQ X* 可以部署在 x86_64 架构的服务器上,也可以部署在 Raspberry Pi 这样的 ARM 设备上。
+*EMQX* 是跨平台的,支持 Linux、Unix、macOS 以及 Windows。这意味着 *EMQX* 可以部署在 x86_64 架构的服务器上,也可以部署在 Raspberry Pi 这样的 ARM 设备上。
 
-Windows 上编译和运行 *EMQ X* 的详情参考:[Windows.md](./Windows.md)
+Windows 上编译和运行 *EMQX* 的详情参考:[Windows.md](./Windows.md)
 
-#### EMQ X Docker 镜像安装
+#### EMQX Docker 镜像安装
 
 ```
 docker run -d --name emqx -p 1883:1883 -p 8081:8081 -p 8083:8083 -p 8883:8883 -p 8084:8084 -p 18083:18083 emqx/emqx
@@ -34,14 +34,14 @@ docker run -d --name emqx -p 1883:1883 -p 8081:8081 -p 8083:8083 -p 8883:8883 -p
 
 #### 二进制软件包安装
 
-需从 [EMQ X 下载](https://www.emqx.cn/downloads) 页面获取相应操作系统的二进制软件包。
+需从 [EMQX 下载](https://www.emqx.cn/downloads) 页面获取相应操作系统的二进制软件包。
 
 - [单节点安装文档](https://docs.emqx.cn/broker/latest/getting-started/install.html)
 - [集群配置文档](https://docs.emqx.cn/broker/latest/advanced/cluster.html)
 
 ## 从源码构建
 
-3.0 版本开始,构建 *EMQ X* 需要 Erlang/OTP R21+。
+3.0 版本开始,构建 *EMQX* 需要 Erlang/OTP R21+。
 
 4.3 及以后的版本:
 
@@ -77,7 +77,7 @@ _build/emqx/rel/emqx/bin/emqx console
 ./bin/emqx stop
 ```
 
-*EMQ X* 启动,可以使用浏览器访问 http://localhost:18083 来查看 Dashboard。
+*EMQX* 启动,可以使用浏览器访问 http://localhost:18083 来查看 Dashboard。
 
 ## 测试
 
@@ -108,7 +108,7 @@ DIALYZER_ANALYSE_APP=emqx_lwm2m,emqx_auth_jwt,emqx_auth_ldap make dialyzer
 
 ### FAQ
 
-访问 [EMQ X FAQ](https://docs.emqx.cn/broker/latest/faq/faq.html) 以获取常见问题的帮助。
+访问 [EMQX FAQ](https://docs.emqx.cn/broker/latest/faq/faq.html) 以获取常见问题的帮助。
 
 ### 问答
 
@@ -117,7 +117,7 @@ DIALYZER_ANALYSE_APP=emqx_lwm2m,emqx_auth_jwt,emqx_auth_ldap make dialyzer
 
 ### 参与设计
 
-如果对 EMQ X 有改进建议,可以向[EIP](https://github.com/emqx/eip) 提交 PR 和 ISSUE
+如果对 EMQX 有改进建议,可以向[EIP](https://github.com/emqx/eip) 提交 PR 和 ISSUE
 
 ### 插件开发
 

+ 13 - 13
README-JP.md

@@ -1,4 +1,4 @@
-# EMQ X Broker
+# EMQX Broker
 
 [![GitHub Release](https://img.shields.io/github/release/emqx/emqx?color=brightgreen)](https://github.com/emqx/emqx/releases)
 [![Build Status](https://travis-ci.org/emqx/emqx.svg)](https://travis-ci.org/emqx/emqx)
@@ -12,22 +12,22 @@
 
 [English](./README.md) | [简体中文](./README-CN.md) | 日本語 | [русский](./README-RU.md)
 
-*EMQ X* は、高い拡張性と可用性をもつ、分散型のMQTTブローカーです。数千万のクライアントを同時に処理するIoT、M2M、モバイルアプリケーション向けです。
+*EMQX* は、高い拡張性と可用性をもつ、分散型のMQTTブローカーです。数千万のクライアントを同時に処理するIoT、M2M、モバイルアプリケーション向けです。
 
-version 3.0 以降、*EMQ X* は MQTT V5.0 の仕様を完全にサポートしており、MQTT V3.1およびV3.1.1とも下位互換性があります。
+version 3.0 以降、*EMQX* は MQTT V5.0 の仕様を完全にサポートしており、MQTT V3.1およびV3.1.1とも下位互換性があります。
 MQTT-SN、CoAP、LwM2M、WebSocket、STOMPなどの通信プロトコルをサポートしています。 MQTTの同時接続数は1つのクラスター上で1,000万以上にまでスケールできます。
 
-- 新機能の一覧については、[EMQ Xリリースノート](https://github.com/emqx/emqx/releases)を参照してください。
-- 詳細はこちら[EMQ X公式ウェブサイト](https://www.emqx.io/)をご覧ください。
+- 新機能の一覧については、[EMQXリリースノート](https://github.com/emqx/emqx/releases)を参照してください。
+- 詳細はこちら[EMQX公式ウェブサイト](https://www.emqx.io/)をご覧ください。
 
 ## インストール
 
-*EMQ X* はクロスプラットフォームで、Linux、Unix、macOS、Windowsをサポートしています。
-そのため、x86_64アーキテクチャサーバー、またはRaspberryPiなどのARMデバイスに *EMQ X* をデプロイすることもできます。
+*EMQX* はクロスプラットフォームで、Linux、Unix、macOS、Windowsをサポートしています。
+そのため、x86_64アーキテクチャサーバー、またはRaspberryPiなどのARMデバイスに *EMQX* をデプロイすることもできます。
 
-Windows上における *EMQ X* のビルドと実行については、[Windows.md](./Windows.md)をご参照ください。
+Windows上における *EMQX* のビルドと実行については、[Windows.md](./Windows.md)をご参照ください。
 
-#### Docker イメージによる EMQ X のインストール
+#### Docker イメージによる EMQX のインストール
 
 ```
 docker run -d --name emqx -p 1883:1883 -p 8083:8083 -p 8883:8883 -p 8084:8084 -p 18083:18083 emqx/emqx
@@ -35,14 +35,14 @@ docker run -d --name emqx -p 1883:1883 -p 8083:8083 -p 8883:8883 -p 8084:8084 -p
 
 #### バイナリパッケージによるインストール
 
-それぞれのOSに対応したバイナリソフトウェアパッケージは、[EMQ Xのダウンロード](https://www.emqx.io/downloads)ページから取得できます。
+それぞれのOSに対応したバイナリソフトウェアパッケージは、[EMQXのダウンロード](https://www.emqx.io/downloads)ページから取得できます。
 
 - [シングルノードインストール](https://docs.emqx.io/broker/latest/en/getting-started/installation.html)
 - [マルチノードインストール](https://docs.emqx.io/broker/latest/en/advanced/cluster.html)
 
 ## ソースからビルド
 
-version 3.0 以降の *EMQ X* をビルドするには Erlang/OTP R21+ が必要です。
+version 3.0 以降の *EMQX* をビルドするには Erlang/OTP R21+ が必要です。
 
 version 4.3 以降の場合:
 
@@ -71,7 +71,7 @@ emqx をソースコードからビルドした場合は、
 ./bin/emqx stop
 ```
 
-*EMQ X* の起動後、ブラウザで http://localhost:18083 にアクセスするとダッシュボードが表示されます。
+*EMQX* の起動後、ブラウザで http://localhost:18083 にアクセスするとダッシュボードが表示されます。
 
 ## テスト
 
@@ -102,7 +102,7 @@ DIALYZER_ANALYSE_APP=emqx_lwm2m,emqx_auth_jwt,emqx_auth_ldap make dialyzer
 
 ### FAQ
 
-よくある質問については、[EMQ X FAQ](https://docs.emqx.io/broker/latest/en/faq/faq.html)をご確認ください。
+よくある質問については、[EMQX FAQ](https://docs.emqx.io/broker/latest/en/faq/faq.html)をご確認ください。
 
 ### 質問する
 

Разница между файлами не показана из-за своего большого размера
+ 9 - 9
README-RU.md


+ 11 - 11
README.md

@@ -1,4 +1,4 @@
-# EMQ X Broker
+# EMQX Broker
 
 [![GitHub Release](https://img.shields.io/github/release/emqx/emqx?color=brightgreen)](https://github.com/emqx/emqx/releases)
 [![Build Status](https://travis-ci.org/emqx/emqx.svg)](https://travis-ci.org/emqx/emqx)
@@ -12,20 +12,20 @@
 
 English | [简体中文](./README-CN.md) | [日本語](./README-JP.md) | [русский](./README-RU.md)
 
-*EMQ X* broker is a fully open source, highly scalable, highly available distributed MQTT messaging broker for IoT, M2M and Mobile applications that can handle tens of millions of concurrent clients.
+*EMQX* broker is a fully open source, highly scalable, highly available distributed MQTT messaging broker for IoT, M2M and Mobile applications that can handle tens of millions of concurrent clients.
 
-Starting from 3.0 release, *EMQ X* broker fully supports MQTT V5.0 protocol specifications and backward compatible with MQTT V3.1 and V3.1.1,  as well as other communication protocols such as MQTT-SN, CoAP, LwM2M, WebSocket and STOMP. The 3.0 release of the *EMQ X* broker can scaled to 10+ million concurrent MQTT connections on one cluster.
+Starting from 3.0 release, *EMQX* broker fully supports MQTT V5.0 protocol specifications and backward compatible with MQTT V3.1 and V3.1.1,  as well as other communication protocols such as MQTT-SN, CoAP, LwM2M, WebSocket and STOMP. The 3.0 release of the *EMQX* broker can scaled to 10+ million concurrent MQTT connections on one cluster.
 
-- For full list of new features, please read [EMQ X Release Notes](https://github.com/emqx/emqx/releases).
-- For more information, please visit [EMQ X homepage](https://www.emqx.io).
+- For full list of new features, please read [EMQX Release Notes](https://github.com/emqx/emqx/releases).
+- For more information, please visit [EMQX homepage](https://www.emqx.io).
 
 ## Installation
 
-The *EMQ X* broker is cross-platform, which supports Linux, Unix, macOS and Windows. It means *EMQ X* can be deployed on x86_64 architecture servers and ARM devices like Raspberry Pi.
+The *EMQX* broker is cross-platform, which supports Linux, Unix, macOS and Windows. It means *EMQX* can be deployed on x86_64 architecture servers and ARM devices like Raspberry Pi.
 
-See more details for building and running *EMQ X* on Windows in [Windows.md](./Windows.md)
+See more details for building and running *EMQX* on Windows in [Windows.md](./Windows.md)
 
-#### Installing via EMQ X Docker Image
+#### Installing via EMQX Docker Image
 
 ```
 docker run -d --name emqx -p 1883:1883 -p 8081:8081 -p 8083:8083 -p 8883:8883 -p 8084:8084 -p 18083:18083 emqx/emqx
@@ -33,7 +33,7 @@ docker run -d --name emqx -p 1883:1883 -p 8081:8081 -p 8083:8083 -p 8883:8883 -p
 
 #### Installing via Binary Package
 
-Get the binary package of the corresponding OS from [EMQ X Download](https://www.emqx.io/downloads) page.
+Get the binary package of the corresponding OS from [EMQX Download](https://www.emqx.io/downloads) page.
 
 - [Single Node Install](https://docs.emqx.io/en/broker/latest/getting-started/install.html)
 - [Multi Node Install](https://docs.emqx.io/en/broker/latest/advanced/cluster.html)
@@ -41,7 +41,7 @@ Get the binary package of the corresponding OS from [EMQ X Download](https://www
 
 ## Build From Source
 
-The *EMQ X* broker requires Erlang/OTP R21+ to build since 3.0 release.
+The *EMQX* broker requires Erlang/OTP R21+ to build since 3.0 release.
 
 For 4.3 and later versions.
 
@@ -110,7 +110,7 @@ DIALYZER_ANALYSE_APP=emqx_lwm2m,emqx_auth_jwt,emqx_auth_ldap make dialyzer
 
 ### FAQ
 
-Visiting [EMQ X FAQ](https://docs.emqx.io/en/broker/latest/faq/faq.html) to get help of common problems.
+Visiting [EMQX FAQ](https://docs.emqx.io/en/broker/latest/faq/faq.html) to get help of common problems.
 
 
 ### Questions

+ 8 - 8
Windows.md

@@ -1,4 +1,4 @@
-# Build and run EMQ X on Windows
+# Build and run EMQX on Windows
 
 NOTE: The instructions and examples are based on Windows 10.
 
@@ -6,7 +6,7 @@ NOTE: The instructions and examples are based on Windows 10.
 
 ### Visual studio for C/C++ compile and link
 
-EMQ X includes Erlang NIF (Native Implmented Function) components, implemented
+EMQX includes Erlang NIF (Native Implmented Function) components, implemented
 in C/C++. To compile and link C/C++ libraries, the easiest way is perhaps to
 install Visual Studio.
 
@@ -51,7 +51,7 @@ Eshell V11.1.4  (abort with ^G)
 
 ### bash
 
-All EMQ X build/run scripts are either in `bash` or `escript`.
+All EMQX build/run scripts are either in `bash` or `escript`.
 `escript` is installed as a part of Erlang. To install a `bash`
 environment in Windows, there are quite a few options.
 
@@ -68,7 +68,7 @@ Cygwin is what we tested with.
 
 ### Other tools
 
-Some of the unix world tools are required to build EMQ X.  Including:
+Some of the unix world tools are required to build EMQX.  Including:
 
 * git
 * curl
@@ -84,7 +84,7 @@ When using scoop:
 scoop install git curl make jq zip unzip
 ```
 
-## Build EMQ X source code
+## Build EMQX source code
 
 * Clone the repo: `git clone https://github.com/emqx/emqx.git`
 
@@ -112,11 +112,11 @@ scoop install git curl make jq zip unzip
   To fix it, Visual Studio's bin paths should be ordered prior to Cygwin's (or similar installation's)
   bin paths in `Path` environment variable.
 
-## Run EMQ X
+## Run EMQX
 
-To start EMQ X broker.
+To start EMQX broker.
 
-Execute `_build\emqx\rel\emqx>.\bin\emqx console` or `_build\emqx\rel\emqx>.\bin\emqx start` to start EMQ X.
+Execute `_build\emqx\rel\emqx>.\bin\emqx console` or `_build\emqx\rel\emqx>.\bin\emqx start` to start EMQX.
 
 Then execute `_build\emqx\rel\emqx>.\bin\emqx_ctl status` to check status.
 If everything works fine, it should print out

+ 2 - 2
apps/emqx_auth_http/README.md

@@ -1,7 +1,7 @@
 emqx_auth_http
 ==============
 
-EMQ X HTTP Auth/ACL Plugin
+EMQX HTTP Auth/ACL Plugin
 
 Build
 -----
@@ -96,5 +96,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.
 

+ 2 - 2
apps/emqx_auth_jwt/README.md

@@ -1,7 +1,7 @@
 
 # emqx-auth-jwt
 
-EMQ X JWT Authentication Plugin
+EMQX JWT Authentication Plugin
 
 Build
 -----
@@ -87,4 +87,4 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.

+ 2 - 2
apps/emqx_auth_ldap/README.md

@@ -1,7 +1,7 @@
 emqx_auth_ldap
 ==============
 
-EMQ X LDAP Authentication Plugin
+EMQX LDAP Authentication Plugin
 
 Build
 -----
@@ -92,5 +92,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.
 

+ 2 - 2
apps/emqx_auth_mongo/README.md

@@ -1,7 +1,7 @@
 emqx_auth_mongo
 ===============
 
-EMQ X Authentication/ACL with MongoDB
+EMQX Authentication/ACL with MongoDB
 
 Build the Plugin
 ----------------
@@ -188,5 +188,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.
 

+ 1 - 1
apps/emqx_auth_mysql/README.md

@@ -164,4 +164,4 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.

+ 1 - 1
apps/emqx_auth_pgsql/README.md

@@ -179,5 +179,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.
 

+ 2 - 2
apps/emqx_auth_redis/README.md

@@ -1,7 +1,7 @@
 emqx_auth_redis
 ===============
 
-EMQ X Redis Authentication/ACL Plugin
+EMQX Redis Authentication/ACL Plugin
 
 Features
 ---------
@@ -167,5 +167,5 @@ Load Plugin
 Author
 ------
 
-EMQ X Team.
+EMQX Team.
 

+ 13 - 13
apps/emqx_bridge_mqtt/README.md

@@ -1,13 +1,13 @@
 # EMQ Bridge MQTT
 
-The concept of **Bridge** means that EMQ X supports forwarding messages
+The concept of **Bridge** means that EMQX supports forwarding messages
 of one of its own topics to another MQTT Broker in some way.
 
 **Bridge** differs from **Cluster** in that the bridge does not
 replicate the topic trie and routing tables and only forwards MQTT
 messages based on bridging rules.
 
-At present, the bridging methods supported by EMQ X are as follows:
+At present, the bridging methods supported by EMQX are as follows:
 
 -   RPC bridge: RPC Bridge only supports message forwarding and does not
     support subscribing to the topic of remote nodes to synchronize
@@ -19,7 +19,7 @@ These concepts are shown below:
 
 ![bridge](docs/images/bridge.png)
 
-In addition, the EMQ X message broker supports multi-node bridge mode interconnection
+In addition, the EMQX message broker supports multi-node bridge mode interconnection
 
 ```
               ---------                     ---------                     ---------
@@ -27,7 +27,7 @@ Publisher --> | Node1 | --Bridge Forward--> | Node2 | --Bridge Forward--> | Node
               ---------                     ---------                     ---------
 ```
 
-In EMQ X, bridge is configured by modifying `etc/emqx.conf`. EMQ X distinguishes between different bridges based on different names. E.g
+In EMQX, bridge is configured by modifying `etc/emqx.conf`. EMQX distinguishes between different bridges based on different names. E.g
 
 ```
 ## Bridge address: node name for local bridge, host:port for remote.
@@ -38,7 +38,7 @@ This configuration declares a bridge named `aws` and specifies that it is bridge
 
 In case of creating multiple bridges, it is convenient to replicate all configuration items of the first bridge, and modify the bridge name and other configuration items if necessary (such as bridge.$name.address, where $name refers to the name of bridge)
 
-The next two sections describe how to create a bridge in RPC and MQTT mode respectively and create a forwarding rule that forwards the messages from sensors. Assuming that two EMQ X nodes are running on two hosts:
+The next two sections describe how to create a bridge in RPC and MQTT mode respectively and create a forwarding rule that forwards the messages from sensors. Assuming that two EMQX nodes are running on two hosts:
 
 
 | Name | Node              | MQTT Port |
@@ -47,7 +47,7 @@ The next two sections describe how to create a bridge in RPC and MQTT mode respe
 | emqx2| emqx2@192.168.1.2 | 1883      |
 
 
-## EMQ X RPC Bridge Configuration
+## EMQX RPC Bridge Configuration
 
 The following is the basic configuration of RPC bridging. A simplest RPC bridging only requires the following three items
 
@@ -72,13 +72,13 @@ Limitations of RPC bridging:
 
 1. The RPC bridge of emqx can only forward local messages to the remote node, and cannot synchronize the messages of the remote node to the local node;
 
-2. RPC bridge can only bridge two EMQ X broker together and cannot bridge EMQ X broker to other MQTT brokers.
+2. RPC bridge can only bridge two EMQX broker together and cannot bridge EMQX broker to other MQTT brokers.
 
-## EMQ X MQTT Bridge Configuration
+## EMQX MQTT Bridge Configuration
 
-EMQ X 3.0 officially introduced MQTT bridge, so that EMQ X can bridge any MQTT broker. Because of the characteristics of the MQTT protocol, EMQ X can subscribe to the remote mqtt broker's topic through MQTT bridge, and then synchronize the remote MQTT broker's message to the local.
+EMQX 3.0 officially introduced MQTT bridge, so that EMQX can bridge any MQTT broker. Because of the characteristics of the MQTT protocol, EMQX can subscribe to the remote mqtt broker's topic through MQTT bridge, and then synchronize the remote MQTT broker's message to the local.
 
-EMQ X MQTT bridging principle: Create an MQTT client on the EMQ X broker, and connect this MQTT client to the remote MQTT broker. Therefore, in the MQTT bridge configuration, following fields may be set for the EMQ X to connect to the remote broker as an mqtt client
+EMQX MQTT bridging principle: Create an MQTT client on the EMQX broker, and connect this MQTT client to the remote MQTT broker. Therefore, in the MQTT bridge configuration, following fields may be set for the EMQX to connect to the remote broker as an mqtt client
 
 ```
 ## Bridge Address: Use node name for rpc bridging, use host:port for mqtt connection
@@ -159,7 +159,7 @@ bridge.mqtt.emqx2.max_inflight_batches = 32
 
 ## Bridge Cache Configuration
 
-The bridge of EMQ X has a message caching mechanism. The caching mechanism is applicable to both RPC bridging and MQTT bridging. When the bridge is disconnected (such as when the network connection is unstable), the messages with a topic specified in `forwards` can be cached to the local message queue. Until the bridge is restored, these messages are re-forwarded to the remote node. The configuration of the cache queue is as follows
+The bridge of EMQX has a message caching mechanism. The caching mechanism is applicable to both RPC bridging and MQTT bridging. When the bridge is disconnected (such as when the network connection is unstable), the messages with a topic specified in `forwards` can be cached to the local message queue. Until the bridge is restored, these messages are re-forwarded to the remote node. The configuration of the cache queue is as follows
 
 ```
 ## emqx_bridge internal number of messages used for batch
@@ -179,9 +179,9 @@ bridge.mqtt.emqx2.queue.replayq_seg_bytes = 10MB
 
 `bridge.mqtt.emqx2.queue.replayq_seg_bytes` is used to specify the size of the largest single file of the message queue that is cached on disk. If the message queue size exceeds the specified value, a new file is created to store the message queue.
 
-## CLI for EMQ X Bridge MQTT
+## CLI for EMQX Bridge MQTT
 
-CLI for EMQ X Bridge MQTT:
+CLI for EMQX Bridge MQTT:
 
 ``` bash
 $ cd emqx1/ && ./bin/emqx_ctl bridges

+ 13 - 13
apps/emqx_bridge_mqtt/docs/guide.rst

@@ -2,14 +2,14 @@
 EMQ Bridge MQTT
 ===============
 
-The concept of **Bridge** means that EMQ X supports forwarding messages
+The concept of **Bridge** means that EMQX supports forwarding messages
 of one of its own topics to another MQTT Broker in some way.
 
 **Bridge** differs from **Cluster** in that the bridge does not
 replicate the topic trie and routing tables and only forwards MQTT
 messages based on bridging rules.
 
-At present, the bridging methods supported by EMQ X are as follows:
+At present, the bridging methods supported by EMQX are as follows:
 
 
 * RPC bridge: RPC Bridge only supports message forwarding and does not
@@ -26,7 +26,7 @@ These concepts are shown below:
    :alt: bridge
 
 
-In addition, the EMQ X message broker supports multi-node bridge mode interconnection
+In addition, the EMQX message broker supports multi-node bridge mode interconnection
 
 .. code-block::
 
@@ -34,7 +34,7 @@ In addition, the EMQ X message broker supports multi-node bridge mode interconne
    Publisher --> | Node1 | --Bridge Forward--> | Node2 | --Bridge Forward--> | Node3 | --> Subscriber
                  ---------                     ---------                     ---------
 
-In EMQ X, bridge is configured by modifying ``etc/emqx.conf``. EMQ X distinguishes between different bridges based on different names. E.g
+In EMQX, bridge is configured by modifying ``etc/emqx.conf``. EMQX distinguishes between different bridges based on different names. E.g
 
 .. code-block::
 
@@ -45,7 +45,7 @@ This configuration declares a bridge named ``aws`` and specifies that it is brid
 
 In case of creating multiple bridges, it is convenient to replicate all configuration items of the first bridge, and modify the bridge name and other configuration items if necessary (such as bridge.$name.address, where $name refers to the name of bridge)
 
-The next two sections describe how to create a bridge in RPC and MQTT mode respectively and create a forwarding rule that forwards the messages from sensors. Assuming that two EMQ X nodes are running on two hosts:
+The next two sections describe how to create a bridge in RPC and MQTT mode respectively and create a forwarding rule that forwards the messages from sensors. Assuming that two EMQX nodes are running on two hosts:
 
 .. list-table::
    :header-rows: 1
@@ -61,7 +61,7 @@ The next two sections describe how to create a bridge in RPC and MQTT mode respe
      - 1883
 
 
-EMQ X RPC Bridge Configuration
+EMQX RPC Bridge Configuration
 ------------------------------
 
 The following is the basic configuration of RPC bridging. A simplest RPC bridging only requires the following three items
@@ -90,14 +90,14 @@ Limitations of RPC bridging:
    The RPC bridge of emqx can only forward local messages to the remote node, and cannot synchronize the messages of the remote node to the local node;
 
 #. 
-   RPC bridge can only bridge two EMQ X broker together and cannot bridge EMQ X broker to other MQTT brokers.
+   RPC bridge can only bridge two EMQX broker together and cannot bridge EMQX broker to other MQTT brokers.
 
-EMQ X MQTT Bridge Configuration
+EMQX MQTT Bridge Configuration
 -------------------------------
 
-EMQ X 3.0 officially introduced MQTT bridge, so that EMQ X can bridge any MQTT broker. Because of the characteristics of the MQTT protocol, EMQ X can subscribe to the remote mqtt broker's topic through MQTT bridge, and then synchronize the remote MQTT broker's message to the local.
+EMQX 3.0 officially introduced MQTT bridge, so that EMQX can bridge any MQTT broker. Because of the characteristics of the MQTT protocol, EMQX can subscribe to the remote mqtt broker's topic through MQTT bridge, and then synchronize the remote MQTT broker's message to the local.
 
-EMQ X MQTT bridging principle: Create an MQTT client on the EMQ X broker, and connect this MQTT client to the remote MQTT broker. Therefore, in the MQTT bridge configuration, following fields may be set for the EMQ X to connect to the remote broker as an mqtt client
+EMQX MQTT bridging principle: Create an MQTT client on the EMQX broker, and connect this MQTT client to the remote MQTT broker. Therefore, in the MQTT bridge configuration, following fields may be set for the EMQX to connect to the remote broker as an mqtt client
 
 .. code-block::
 
@@ -179,7 +179,7 @@ EMQ X MQTT bridging principle: Create an MQTT client on the EMQ X broker, and co
 Bridge Cache Configuration
 --------------------------
 
-The bridge of EMQ X has a message caching mechanism. The caching mechanism is applicable to both RPC bridging and MQTT bridging. When the bridge is disconnected (such as when the network connection is unstable), the messages with a topic specified in ``forwards`` can be cached to the local message queue. Until the bridge is restored, these messages are re-forwarded to the remote node. The configuration of the cache queue is as follows
+The bridge of EMQX has a message caching mechanism. The caching mechanism is applicable to both RPC bridging and MQTT bridging. When the bridge is disconnected (such as when the network connection is unstable), the messages with a topic specified in ``forwards`` can be cached to the local message queue. Until the bridge is restored, these messages are re-forwarded to the remote node. The configuration of the cache queue is as follows
 
 .. code-block::
 
@@ -199,10 +199,10 @@ The bridge of EMQ X has a message caching mechanism. The caching mechanism is ap
 
 ``bridge.mqtt.emqx2.queue.replayq_seg_bytes`` is used to specify the size of the largest single file of the message queue that is cached on disk. If the message queue size exceeds the specified value, a new file is created to store the message queue.
 
-CLI for EMQ X Bridge MQTT
+CLI for EMQX Bridge MQTT
 -------------------------
 
-CLI for EMQ X Bridge MQTT:
+CLI for EMQX Bridge MQTT:
 
 .. code-block:: bash
 

+ 2 - 2
apps/emqx_coap/README.md

@@ -1,7 +1,7 @@
 
 # emqx-coap
 
-emqx-coap is a CoAP Gateway for EMQ X Broker. It translates CoAP messages into MQTT messages and make it possible to communiate between CoAP clients and MQTT clients.
+emqx-coap is a CoAP Gateway for EMQX Broker. It translates CoAP messages into MQTT messages and make it possible to communiate between CoAP clients and MQTT clients.
 
 ### Client Usage Example
 libcoap is an excellent coap library which has a simple client tool. It is recommended to use libcoap as a coap client.
@@ -252,5 +252,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.
 

+ 2 - 2
apps/emqx_exhook/README.md

@@ -1,6 +1,6 @@
 # emqx_exhook
 
-The `emqx_exhook` extremly enhance the extensibility for EMQ X. It allow using an others programming language to mount the hooks intead of erlang.
+The `emqx_exhook` extremly enhance the extensibility for EMQX. It allow using an others programming language to mount the hooks intead of erlang.
 
 ## Feature
 
@@ -10,7 +10,7 @@ The `emqx_exhook` extremly enhance the extensibility for EMQ X. It allow using a
 ## Architecture
 
 ```
-EMQ X                                      Third-party Runtime
+EMQX                                      Third-party Runtime
 +========================+                 +========+==========+
 |    ExHook              |                 |        |          |
 |   +----------------+   |      gRPC       | gRPC   |  User's  |

+ 2 - 2
apps/emqx_exhook/docs/design-cn.md

@@ -2,7 +2,7 @@
 
 ## 动机
 
-在 EMQ X Broker v4.1-v4.2 中,我们发布了 2 个插件来扩展 emqx 的编程能力:
+在 EMQX Broker v4.1-v4.2 中,我们发布了 2 个插件来扩展 emqx 的编程能力:
 
 1. `emqx-extension-hook` 提供了使用 Java, Python 向 Broker 挂载钩子的功能
 2. `emqx-exproto` 提供了使用 Java,Python 编写用户自定义协议接入插件的功能
@@ -26,7 +26,7 @@
 架构如下:
 
 ```
-  EMQ X                                    
+  EMQX
 +========================+                 +========+==========+
 |    ExHook              |                 |        |          |
 |   +----------------+   |      gRPC       | gRPC   |  User's  |

+ 2 - 2
apps/emqx_exproto/README.md

@@ -1,6 +1,6 @@
 # emqx-exproto
 
-The `emqx_exproto` extremly enhance the extensibility for EMQ X. It allow using an others programming language to **replace the protocol handling layer in EMQ X Broker**.
+The `emqx_exproto` extremly enhance the extensibility for EMQX. It allow using an others programming language to **replace the protocol handling layer in EMQX Broker**.
 
 ## Feature
 
@@ -9,7 +9,7 @@ The `emqx_exproto` extremly enhance the extensibility for EMQ X. It allow using
 
 ## Architecture
 
-![EMQ X ExProto Arch](./docs/images/exproto-arch.jpg)
+![EMQX ExProto Arch](./docs/images/exproto-arch.jpg)
 
 ## Usage
 

+ 4 - 4
apps/emqx_exproto/docs/design-cn.md

@@ -2,7 +2,7 @@
 
 `emqx-exproto` 插件用于协议解析的多语言支持。它能够允许其他编程语言(例如:Python,Java 等)直接处理数据流实现协议的解析,并提供 Pub/Sub 接口以实现与系统其它组件的通信。
 
-该插件给 EMQ X 带来的扩展性十分的强大,它能以你熟悉语言处理任何的私有协议,并享受由 EMQ X 系统带来的高连接,和高并发的优点。
+该插件给 EMQX 带来的扩展性十分的强大,它能以你熟悉语言处理任何的私有协议,并享受由 EMQX 系统带来的高连接,和高并发的优点。
 
 ## 特性
 
@@ -25,12 +25,12 @@
     - 提供 `Send` 接口。供外部模块调用,**用于发送数据包**。
     - 提供 `Close` 接口。供外部模块调用,**用于主动关闭连接**。
 
-2. **协议/会话层:**该部分主要**提供 PUB/SUB 接口**,以实现与 EMQ X Broker 系统的消息互通。包括:
+2. **协议/会话层:**该部分主要**提供 PUB/SUB 接口**,以实现与 EMQX Broker 系统的消息互通。包括:
 
     - 提供 `Authenticate` 接口。供外部模块调用,用于向集群注册客户端。
     - 提供 `StartTimer` 接口。供外部模块调用,用于为该连接进程启动心跳等定时器。
-    - 提供 `Publish` 接口。供外部模块调用,用于发布消息 EMQ X Broker 中。
-    - 提供 `Subscribe` 接口。供外部模块调用,用于订阅某主题,以实现从 EMQ X Broker 中接收某些下行消息。
+    - 提供 `Publish` 接口。供外部模块调用,用于发布消息 EMQX Broker 中。
+    - 提供 `Subscribe` 接口。供外部模块调用,用于订阅某主题,以实现从 EMQX Broker 中接收某些下行消息。
     - 提供 `Unsubscribe` 接口。供外部模块调用,用于取消订阅某主题。
     - 调用 `OnTimerTimeout` 回调。用于处理定时器超时的事件。
     - 调用 `OnReceivedMessages` 回调。用于接收下行消息(在订阅主题成功后,如果主题上有消息,便会回调该方法)

+ 1 - 1
apps/emqx_lua_hook/README.md

@@ -334,5 +334,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.
 

+ 2 - 2
apps/emqx_lwm2m/README.md

@@ -1,5 +1,5 @@
 
-# LwM2M Gateway for the EMQ X Broker.
+# LwM2M Gateway for the EMQX Broker.
 
 [The LwM2M Specifications](http://www.openmobilealliance.org/release/LightweightM2M) is a Lightweight Machine to Machine protocol.
 
@@ -354,4 +354,4 @@ Apache License Version 2.0
 
 ## Author
 
-EMQ X-Men Team.
+EMQX-Men Team.

+ 1 - 1
apps/emqx_management/README.md

@@ -1,7 +1,7 @@
 
 # emqx-management
 
-EMQ X Management API
+EMQX Management API
 
 ## How to Design RESTful API?
 

+ 3 - 3
apps/emqx_prometheus/README.md

@@ -1,6 +1,6 @@
 # emqx-prometheus
 
-EMQ X Prometheus Agent
+EMQX Prometheus Agent
 
 ## push emqx stats/metrics to prometheus PushGateway
 
@@ -48,7 +48,7 @@ json data
 ```
 
 
-## Before EMQ X v4.0.0
+## Before EMQX v4.0.0
 The prometheus data simple is:
 
 
@@ -279,5 +279,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.
 

+ 2 - 2
apps/emqx_recon/README.md

@@ -2,7 +2,7 @@
 emqx-recon
 ==========
 
-EMQ X Recon Debug/Optimize Plugin
+EMQX Recon Debug/Optimize Plugin
 
 emqx_recon.conf
 ----=----------
@@ -57,5 +57,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.
 

+ 2 - 2
apps/emqx_retainer/README.md

@@ -1,5 +1,5 @@
 
-EMQ X Retainer
+EMQX Retainer
 ==============
 
 The retainer plugin is responsible for storing retained MQTT messages.
@@ -55,5 +55,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team
+EMQX Team
 

+ 1 - 1
apps/emqx_rule_engine/README.md

@@ -1,7 +1,7 @@
 
 # emqx-rule-engine
 
-IoT Rule Engine for EMQ X Broker.
+IoT Rule Engine for EMQX Broker.
 
 ## Concept
 

+ 3 - 3
apps/emqx_rule_engine/docs/design.md

@@ -1,7 +1,7 @@
 
-# EMQ X Rule Engine
+# EMQX Rule Engine
 
-This is the design guide of message routing rule engine for the EMQ X Broker.
+This is the design guide of message routing rule engine for the EMQX Broker.
 
 ## Concept
 
@@ -149,7 +149,7 @@ The properties and behaviors of resources is defined by resource types. A resour
 
 ### Resource Type Provider
 
-Provider of resource type is a EMQ X Plugin.
+Provider of resource type is a EMQX Plugin.
 
 ### Resource Manager
 

+ 2 - 2
apps/emqx_sn/README.md

@@ -1,7 +1,7 @@
 emqx-sn
 =======
 
-EMQ X MQTT-SN Gateway.
+EMQX MQTT-SN Gateway.
 
 Configure Plugin
 ----------------
@@ -113,5 +113,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X-Men Team.
+EMQX-Men Team.
 

+ 2 - 2
apps/emqx_stomp/README.md

@@ -2,7 +2,7 @@
 emqx-stomp
 ==========
 
-The plugin adds STOMP 1.0/1.1/1.2 protocol supports to the EMQ X broker.
+The plugin adds STOMP 1.0/1.1/1.2 protocol supports to the EMQX broker.
 
 The STOMP clients could PubSub to the MQTT clients.
 
@@ -73,5 +73,5 @@ Apache License Version 2.0
 Author
 ------
 
-EMQ X Team.
+EMQX Team.
 

+ 2 - 2
apps/emqx_web_hook/README.md

@@ -1,9 +1,9 @@
 
 # emqx-web-hook
 
-EMQ X WebHook plugin.
+EMQX WebHook plugin.
 
-Please see: [EMQ X - WebHook](https://docs.emqx.io/broker/latest/en/advanced/webhook.html)
+Please see: [EMQX - WebHook](https://docs.emqx.io/broker/latest/en/advanced/webhook.html)
 
 ## emqx_web_hook.conf
 

+ 1 - 1
bin/emqx

@@ -44,7 +44,7 @@ if ! check_eralng_start >/dev/null 2>&1; then
         echoerr "FATAL: Unable to start Erlang."
         echoerr "Please make sure openssl-1.1.1 (libcrypto) and libncurses are installed."
         echoerr "Also ensure it's running on the correct platform,"
-        echoerr "this EMQ X release is built for $BUILT_ON"
+        echoerr "this EMQX release is built for $BUILT_ON"
         exit 1
     fi
     echoerr "WARNING: There seem to be missing dynamic libs from the OS. Using libs from ${DYNLIBS_DIR}"

+ 1 - 1
bin/node_dump

@@ -24,7 +24,7 @@ collect() {
 }
 
 show_help() {
-    echo "Collect information about the EMQ X node
+    echo "Collect information about the EMQX node
 
 USAGE:
 

+ 5 - 2
build

@@ -4,6 +4,9 @@
 # arg1: profile, e.g. emqx | emqx-edge | emqx-pkg | emqx-edge-pkg
 # arg2: artifact, e.g. rel | relup | zip | pkg
 
+if [[ -n "$DEBUG" ]]; then
+    set -x
+fi
 set -euo pipefail
 
 PROFILE="$1"
@@ -71,8 +74,8 @@ make_relup() {
                 tmp_dir="$(mktemp -d -t emqx.XXXXXXX)"
                 unzip -q "$zip" "emqx/releases/*" -d "$tmp_dir"
                 unzip -q "$zip" "emqx/lib/*" -d "$tmp_dir"
-                cp -r -n "$tmp_dir/emqx/releases"/* "$releases_dir"
-                cp -r -n "$tmp_dir/emqx/lib"/* "$lib_dir"
+                cp -r -n "$tmp_dir/emqx/releases"/* "$releases_dir" || true
+                cp -r -n "$tmp_dir/emqx/lib"/* "$lib_dir" || true
                 rm -rf "$tmp_dir"
             fi
             releases+=( "$base_vsn" )

+ 1 - 1
deploy/charts/emqx/Chart.yaml

@@ -1,6 +1,6 @@
 apiVersion: v2
 name: emqx
-description: A Helm chart for EMQ X
+description: A Helm chart for EMQX
 # A chart can be either an 'application' or a 'library' chart.
 #
 # Application charts are a collection of templates that can be packaged into versioned archives

+ 30 - 30
deploy/charts/emqx/README.md

@@ -1,5 +1,5 @@
 # Introduction
-This chart bootstraps an [EMQ X](https://www.emqx.io/) deployment on a [Kubernetes](https://kubernetes.io/) (K8s) cluster using the [Helm](https://helm.sh/) package manager.
+This chart bootstraps an [EMQX](https://www.emqx.io/) deployment on a [Kubernetes](https://kubernetes.io/) (K8s) cluster using the [Helm](https://helm.sh/) package manager.
 
 # Prerequisites
 + [Kubernetes](https://kubernetes.io/) 1.6+
@@ -31,21 +31,21 @@ $ helm del my-emqx
 # Configuration
 The following sections describe the configurable parameters of the chart and their default values.
 ## [K8s]((https://kubernetes.io/)) specific settings
-The following table lists the configurable K8s parameters of the [EMQ X](https://www.emqx.io/) chart and their default values.
+The following table lists the configurable K8s parameters of the [EMQX](https://www.emqx.io/) chart and their default values.
 Parameter  | Description | Default Value
 ---        |  ---        | ---
 `replicaCount` | It is recommended to have odd number of nodes in a cluster, otherwise the emqx cluster cannot be automatically healed in case of net-split. | `3`
-`image.tag` | EMQ X Image tag (defaults to `.Chart.AppVersion`) | `nil`
-`image.repository` | EMQ X Image repository | `emqx/emqx`
+`image.tag` | EMQX Image tag (defaults to `.Chart.AppVersion`) | `nil`
+`image.repository` | EMQX Image repository | `emqx/emqx`
 `image.pullPolicy`  | The image pull policy  | `IfNotPresent`
 `image.pullSecrets `  | The image pull secrets (does not add image pull secrets to deployed pods)  |``[]``
 `recreatePods` | Forces the recreation of pods during upgrades, which can be useful to always apply the most recent configuration. | `false`
-`persistence.enabled` | Enable EMQ X persistence using PVC | `false`
+`persistence.enabled` | Enable EMQX persistence using PVC | `false`
 `persistence.storageClass` | Storage class of backing PVC (uses alpha storage class annotation) | `nil`
-`persistence.existingClaim` | EMQ X data Persistent Volume existing claim name, evaluated as a template | `""`
-`persistence.accessMode` | PVC Access Mode for EMQ X volume | `ReadWriteOnce`
-`persistence.size` | PVC Storage Request for EMQ X volume | `20Mi`
-`initContainers` | Containers that run before the creation of EMQ X containers. They can contain utilities or setup scripts. |`{}`
+`persistence.existingClaim` | EMQX data Persistent Volume existing claim name, evaluated as a template | `""`
+`persistence.accessMode` | PVC Access Mode for EMQX volume | `ReadWriteOnce`
+`persistence.size` | PVC Storage Request for EMQX volume | `20Mi`
+`initContainers` | Containers that run before the creation of EMQX containers. They can contain utilities or setup scripts. |`{}`
 `resources` | CPU/Memory resource requests/limits |`{}`
 `nodeSelector` | Node labels for pod assignment |`{}`
 `tolerations` | Toleration labels for pod assignment |``[]``
@@ -67,32 +67,32 @@ Parameter  | Description | Default Value
 `service.loadBalancerSourceRanges` |	Address(es) that are allowed when service is LoadBalancer |	`[]`
 `service.externalIPs` |	ExternalIPs for the service |	`[]`
 `service.annotations` |	Service annotations (evaluated as a template) |	`{}`
-`ingress.dashboard.enabled` |	Enable ingress for EMQ X Dashboard |	false
-`ingress.dashboard.ingressClassName` |	Set the ingress class for EMQ X Dashboard
-`ingress.dashboard.path` | Ingress path for EMQ X Dashboard |	`/`
-`ingress.dashboard.hosts` | Ingress hosts for EMQ X Mgmt API |	dashboard.emqx.local
-`ingress.dashboard.tls` | Ingress tls for EMQ X Mgmt API |	`[]`
-`ingress.dashboard.annotations` | Ingress annotations for EMQ X Mgmt API |	`{}`
-`ingress.mgmt.enabled` |	Enable ingress for EMQ X Mgmt API |	`false`
-`ingress.mqtt.ingressClassName` |	Set the ingress class for EMQ X Mgmt API | `nil`
-`ingress.mgmt.path` | Ingress path for EMQ X Mgmt API | `/`
-`ingress.mgmt.hosts` | Ingress hosts for EMQ X Mgmt API |	`api.emqx.local`
-`ingress.mgmt.tls` | Ingress tls for EMQ X Mgmt API |	`[]`
-`ingress.mgmt.annotations` | Ingress annotations for EMQ X Mgmt API |	`{}`
-`ingress.wss.enabled` |	Enable ingress for EMQ X Mgmt API |	`false`
-`ingress.wss.ingressClassName` |	Set the ingress class for EMQ X Mgmt API | `nil`
-`ingress.wss.path` | Ingress path for EMQ X WSS |	`/`
-`ingress.wss.hosts` | Ingress hosts for EMQ X WSS |    `wss.emqx.local`
-`ingress.wss.tls` | Ingress tls for EMQ X WSS |	`[]`
-`ingress.wss.annotations` | Ingress annotations for EMQ X WSS |	`{}`
+`ingress.dashboard.enabled` |	Enable ingress for EMQX Dashboard |	false
+`ingress.dashboard.ingressClassName` |	Set the ingress class for EMQX Dashboard
+`ingress.dashboard.path` | Ingress path for EMQX Dashboard |	`/`
+`ingress.dashboard.hosts` | Ingress hosts for EMQX Mgmt API |	dashboard.emqx.local
+`ingress.dashboard.tls` | Ingress tls for EMQX Mgmt API |	`[]`
+`ingress.dashboard.annotations` | Ingress annotations for EMQX Mgmt API |	`{}`
+`ingress.mgmt.enabled` |	Enable ingress for EMQX Mgmt API |	`false`
+`ingress.mqtt.ingressClassName` |	Set the ingress class for EMQX Mgmt API | `nil`
+`ingress.mgmt.path` | Ingress path for EMQX Mgmt API | `/`
+`ingress.mgmt.hosts` | Ingress hosts for EMQX Mgmt API |	`api.emqx.local`
+`ingress.mgmt.tls` | Ingress tls for EMQX Mgmt API |	`[]`
+`ingress.mgmt.annotations` | Ingress annotations for EMQX Mgmt API |	`{}`
+`ingress.wss.enabled` |	Enable ingress for EMQX Mgmt API |	`false`
+`ingress.wss.ingressClassName` |	Set the ingress class for EMQX Mgmt API | `nil`
+`ingress.wss.path` | Ingress path for EMQX WSS |	`/`
+`ingress.wss.hosts` | Ingress hosts for EMQX WSS |    `wss.emqx.local`
+`ingress.wss.tls` | Ingress tls for EMQX WSS |	`[]`
+`ingress.wss.annotations` | Ingress annotations for EMQX WSS |	`{}`
 `extraEnv` | Aditional container env vars | `[]`
 `extraEnvFrom` | Aditional container env from vars (eg. [config map](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/), [secrets](https://kubernetes.io/docs/concepts/configuration/secret/) | `[]`
 `extraArgs` | Additional container executable arguments | `[]`
 `extraVolumes` | Additional container volumes (eg. for mounting certs from secrets) | `[]`
 `extraVolumeMounts` | Additional container volume mounts (eg. for mounting certs from secrets) | `[]`
 
-## EMQ X specific settings
-The following table lists the configurable [EMQ X](https://www.emqx.io/)-specific parameters of the chart and their default values.
+## EMQX specific settings
+The following table lists the configurable [EMQX](https://www.emqx.io/)-specific parameters of the chart and their default values.
 Parameter  | Description | Default Value
 ---        |  ---        | ---
 `emqxConfig` | Map of [configuration](https://www.emqx.io/docs/en/latest/configuration/configuration.html) items expressed as [environment variables](https://www.emqx.io/docs/en/v4.3/configuration/environment-variable.html) (prefix can be omitted) or using the configuration files [namespaced dotted notation](https://www.emqx.io/docs/en/latest/configuration/configuration.html) | `nil`
@@ -104,7 +104,7 @@ Parameter  | Description | Default Value
 # Examples
 This section provides some examples for the configuration of common scenarios.
 ## Enable Websockets SSL via [nginx-ingress community controller](https://kubernetes.github.io/ingress-nginx/)
-The following settings describe a working scenario for acessing [EMQ X](https://www.emqx.io/) Websockets with SSL termination at the [nginx-ingress community controller](https://kubernetes.github.io/ingress-nginx/).
+The following settings describe a working scenario for acessing [EMQX](https://www.emqx.io/) Websockets with SSL termination at the [nginx-ingress community controller](https://kubernetes.github.io/ingress-nginx/).
 ```yaml
 ingress:
   wss:

+ 6 - 6
deploy/charts/emqx/values.yaml

@@ -62,13 +62,13 @@ resources: {}
   #   cpu: 500m
   #   memory: 512Mi
 
-# Containers that run before the creation of EMQ X containers. They can contain utilities or setup scripts.
+# Containers that run before the creation of EMQX containers. They can contain utilities or setup scripts.
 initContainers: {}
   # - name: mysql-probe
   #   image: alpine
   #   command: ["sh", "-c", "for i in $(seq 1 300); do nc -zvw1 mysql 3306 && exit 0 || sleep 3; done; exit 1"]
 
-## EMQ X configuration item, see the documentation (https://hub.docker.com/r/emqx/emqx)
+## EMQX configuration item, see the documentation (https://hub.docker.com/r/emqx/emqx)
 emqxConfig:
   EMQX_CLUSTER__K8S__APISERVER: "https://kubernetes.default.svc:443"
   ## The address type is used to extract host from k8s service.
@@ -119,7 +119,7 @@ emqxLoadedModules: >
   {emqx_mod_subscription, false}.
   {emqx_mod_topic_metrics, false}.
 
-## EMQ X Enterprise Edition requires manual creation of a Secret containing the licensed content. Write the name of Secret to the value of "emqxLicenseSecretName"
+## EMQX Enterprise Edition requires manual creation of a Secret containing the licensed content. Write the name of Secret to the value of "emqxLicenseSecretName"
 ## Example:
 ##   kubectl create secret generic emqx-license-secret-name --from-file=/path/to/emqx.lic
 emqxLicenseSecretName:
@@ -188,7 +188,7 @@ ingress:
   ## Ingress shared annotations
   annotations: {}
 
-  ## ingress for EMQ X Dashboard
+  ## ingress for EMQX Dashboard
   dashboard:
     enabled: false
     annotations: {}
@@ -199,7 +199,7 @@ ingress:
     - dashboard.emqx.local
     tls: []
 
-  ## ingress for EMQ X Mgmt API
+  ## ingress for EMQX Mgmt API
   mgmt:
     enabled: false
     annotations: {}
@@ -210,7 +210,7 @@ ingress:
     - api.emqx.local
     tls: []
 
-  ## ingress for EMQ X Mgmt API
+  ## ingress for EMQX Mgmt API
   wss:
     enabled: false
     # ingressClassName: nginx

+ 3 - 1
deploy/docker/Dockerfile

@@ -28,6 +28,8 @@ COPY . /emqx
 ARG PKG_VSN
 ARG EMQX_NAME=emqx
 
+ENV EMQX_RELUP=false
+
 RUN cd /emqx \
     && rm -rf _build/$EMQX_NAME/lib \
     && make $EMQX_NAME
@@ -43,7 +45,7 @@ LABEL org.label-schema.docker.dockerfile="Dockerfile" \
     org.label-schema.url="https://emqx.io" \
     org.label-schema.vcs-type="Git" \
     org.label-schema.vcs-url="https://github.com/emqx/emqx" \
-    maintainer="EMQ X Team <support@emqx.io>"
+    maintainer="EMQX Team <support@emqx.io>"
 
 ARG EMQX_NAME=emqx
 

+ 10 - 10
deploy/docker/README.md

@@ -17,11 +17,11 @@
 
   [the latest release](https://github.com/docker/docker-ce/releases/latest)
 
-# What is EMQ X
+# What is EMQX
 
-[EMQ X  MQTT broker](https://emqx.io/products/broker) is a fully open source, highly scalable, highly available distributed MQTT messaging broker for IoT, M2M and Mobile applications that can handle tens of millions of concurrent clients.
+[EMQX  MQTT broker](https://emqx.io/products/broker) is a fully open source, highly scalable, highly available distributed MQTT messaging broker for IoT, M2M and Mobile applications that can handle tens of millions of concurrent clients.
 
-Starting from 3.0 release, *EMQ X* broker fully supports MQTT V5.0 protocol specifications and backward compatible with MQTT V3.1 and V3.1.1,  as well as other communication protocols such as MQTT-SN, CoAP, LwM2M, WebSocket and STOMP. The 3.0 release of the *EMQ X* broker can scaled to 10+ million concurrent MQTT connections on one cluster.
+Starting from 3.0 release, *EMQX* broker fully supports MQTT V5.0 protocol specifications and backward compatible with MQTT V3.1 and V3.1.1,  as well as other communication protocols such as MQTT-SN, CoAP, LwM2M, WebSocket and STOMP. The 3.0 release of the *EMQX* broker can scaled to 10+ million concurrent MQTT connections on one cluster.
 
 # How to use this image
 
@@ -39,7 +39,7 @@ The emqx broker runs as linux user `emqx` in the docker container.
 
 ### Configuration
 
-Use the environment variable to configure the EMQ X docker container.
+Use the environment variable to configure the EMQX docker container.
 
 By default, the environment variables with ``EMQX_`` prefix are mapped to key-value pairs in configuration files.
 
@@ -72,9 +72,9 @@ EMQX_HOST
 
 These environment variables will ignore for configuration file.
 
-#### EMQ X Configuration
+#### EMQX Configuration
 
-> NOTE: All EMQ X Configuration in [etc/emqx.conf](https://github.com/emqx/emqx/blob/main-v4.3/etc/emqx.conf) could config by environment. The following list is just an example, not a complete configuration.
+> NOTE: All EMQX Configuration in [etc/emqx.conf](https://github.com/emqx/emqx/blob/main-v4.3/etc/emqx.conf) could config by environment. The following list is just an example, not a complete configuration.
 
 | Options                    | Default            | Mapped                    | Description                           |
 | ---------------------------| ------------------ | ------------------------- | ------------------------------------- |
@@ -148,7 +148,7 @@ EMQX_LOADED_PLUGINS="emqx_auth_redis emqx_auth_mysql"
 EMQX_LOADED_PLUGINS="emqx_auth_redis | emqx_auth_mysql"
 ```
 
-#### EMQ X Plugins Configuration
+#### EMQX Plugins Configuration
 
 The environment variables which with ``EMQX_`` prefix are mapped to all emqx plugins' configuration file, ``.`` get replaced by ``__``.
 
@@ -200,7 +200,7 @@ docker run -d --name emqx -p 18083:18083 -p 1883:1883 -p 4369:4369 \
 
 ### Cluster
 
-EMQ X supports a variety of clustering methods, see our [documentation](https://docs.emqx.io/broker/latest/en/advanced/cluster.html#emqx-service-discovery) for details.
+EMQX supports a variety of clustering methods, see our [documentation](https://docs.emqx.io/broker/latest/en/advanced/cluster.html#emqx-service-discovery) for details.
 
 Let's create a static node list cluster from docker-compose.
 
@@ -256,7 +256,7 @@ Let's create a static node list cluster from docker-compose.
 
 ### Persistence
 
-If you want to persist the EMQ X docker container, you need to keep the following directories:
+If you want to persist the EMQX docker container, you need to keep the following directories:
 
 + `/opt/emqx/data`
 + `/opt/emqx/etc`
@@ -316,7 +316,7 @@ docker run -d --name emqx -p 18083:18083 -p 1883:1883 -p 4369:4369 \
 
 ```
 
-> REMEMBER: DO NOT RUN EMQ X DOCKER PRIVILEGED OR MOUNT SYSTEM PROC IN CONTAINER TO TUNE LINUX KERNEL, IT IS UNSAFE.
+> REMEMBER: DO NOT RUN EMQX DOCKER PRIVILEGED OR MOUNT SYSTEM PROC IN CONTAINER TO TUNE LINUX KERNEL, IT IS UNSAFE.
 
 ### Thanks
 

+ 1 - 1
deploy/docker/docker-entrypoint.sh

@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 ## EMQ docker image start script
 # Huang Rui <vowstar@gmail.com>
-# EMQ X Team <support@emqx.io>
+# EMQX Team <support@emqx.io>
 
 ## Shell setting
 if [[ -n "$DEBUG" ]]; then

+ 1 - 1
etc/emqx_cloud/vm.args

@@ -1,5 +1,5 @@
 ######################################################################
-## Erlang VM Args for EMQ X Broker
+## Erlang VM Args
 ######################################################################
 
 ## NOTE:

+ 1 - 1
etc/emqx_edge/vm.args

@@ -1,5 +1,5 @@
 ######################################################################
-## Erlang VM Args for EMQ X Edge
+## Erlang VM Args
 ######################################################################
 
 ## NOTE:

+ 1 - 1
lib-ce/emqx_dashboard/README.md

@@ -2,7 +2,7 @@
 emqx-dashboard
 ==============
 
-Dashboard for the EMQ X Broker.
+Dashboard for the EMQX Broker.
 
 REST API
 --------

+ 2 - 2
lib-extra/README.md

@@ -1,4 +1,4 @@
-# EMQ X Extra plugin apps
+# EMQX Extra plugin apps
 
 This directory keeps a `plugins` file which defines all the approved
 external plugins from open-source community.
@@ -20,7 +20,7 @@ e.g. For an Erlang plugin named `plugin_foo`:
 ```
 
 Note: The `-emqx_plugin(?MODULE)` attribute should be added to
-`<plugin-name>_app.erl` file to indicate that this is an EMQ X Broker plugin.
+`<plugin-name>_app.erl` file to indicate that this is an EMQX Broker plugin.
 
 For example:
 ```erlang

+ 1 - 1
pkg-vsn.sh

@@ -18,7 +18,7 @@ RELEASE="$(grep -E "define.+EMQX_RELEASE.+${EDITION}" include/emqx_release.hrl |
 git_exact_vsn() {
     local tag
     tag="$(git describe --tags --match "[e|v]*" --exact 2>/dev/null)"
-    echo "$tag" | sed 's/^[v|e]//g'
+    echo "${tag#[e|v]}"
 }
 
 GIT_EXACT_VSN="$(git_exact_vsn)"

+ 1 - 0
scripts/find-props.sh

@@ -13,4 +13,5 @@ if [ "$1" != "emqx" ]; then
     BASEDIR="$1"
 fi
 
+# shellcheck disable=SC2038
 find "${BASEDIR}/test/props" -name "prop_*.erl" 2>/dev/null | xargs -I{} basename {} .erl | xargs | tr ' ' ','

+ 1 - 0
scripts/find-suites.sh

@@ -12,4 +12,5 @@ TESTDIR="test"
 if [ "$1" != "emqx" ]; then
     TESTDIR="$1/test"
 fi
+# shellcheck disable=SC2038
 find "${TESTDIR}" -name "*_SUITE.erl" 2>/dev/null | xargs | tr ' ' ','

+ 70 - 0
scripts/relup-base-packages.sh

@@ -0,0 +1,70 @@
+#!/usr/bin/env bash
+
+## This script helps to download relup base version packages
+
+if [[ -n "$DEBUG" ]]; then
+    set -x
+fi
+set -euo pipefail
+
+PROFILE="${1}"
+if [ "$PROFILE" = "" ]; then
+    PROFILE="emqx"
+fi
+
+case $PROFILE in
+    "emqx")
+        DIR='broker'
+        EDITION='community'
+        ;;
+    "emqx-ee")
+        DIR='enterprise'
+        EDITION='enterprise'
+        ;;
+    "emqx-edge")
+        DIR='edge'
+        EDITION='edge'
+        ;;
+esac
+
+SYSTEM="${SYSTEM:-$(./scripts/get-distro.sh)}"
+
+ARCH="${ARCH:-$(uname -m)}"
+case "$ARCH" in
+    x86_64)
+        ARCH='amd64'
+        ;;
+    aarch64)
+        ARCH='arm64'
+        ;;
+    arm*)
+        ARCH=arm
+        ;;
+esac
+
+SHASUM="sha256sum"
+if [ "$SYSTEM" = "macos" ]; then
+    SHASUM="shasum -a 256"
+fi
+
+# ensure dir
+cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
+
+mkdir -p _upgrade_base
+pushd _upgrade_base
+
+for tag in $(../scripts/relup-base-vsns.sh $EDITION | xargs echo -n); do
+    filename="$PROFILE-$SYSTEM-${tag#[e|v]}-$ARCH.zip"
+    url="https://www.emqx.com/downloads/$DIR/$tag/$filename"
+    echo "downloading ${filename} ..."
+    if [ ! -f "$filename" ] && curl -I -m 10 -o /dev/null -s -w "%{http_code}" "${url}" | grep -q -oE "^[23]+" ; then
+        curl -L -o "${filename}" "${url}"
+        if [ "$SYSTEM" != "centos6" ]; then
+            curl -L -o "${filename}.sha256" "${url}.sha256"
+            ## https://askubuntu.com/questions/1202208/checking-sha256-checksum
+            echo "$(cat "${filename}.sha256")  ${filename}" | $SHASUM -c || exit 1
+        fi
+    fi
+done
+
+popd

+ 7 - 4
scripts/relup-base-vsns.sh

@@ -1,8 +1,11 @@
 #!/usr/bin/env bash
 set -euo pipefail
 
+# ensure dir
+cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
+
 ## This script prints the relup upgrade base versions
-## for the given EMQ X edition (specified as first arg)
+## for the given EMQX edition (specified as first arg)
 ##
 ## The second argument is the current release version
 ## if not provided, it's taken from pkg-vsn.sh
@@ -17,8 +20,8 @@ parse_semver() {
     echo "$1" | tr '.|-' ' '
 }
 
-PROFILE="${1:-}"
-[ -z "${PROFILE}" ] && usage
+EDITION="${1:-}"
+[ -z "${EDITION}" ] && usage
 
 ## Get the current release version
 ## e.g.
@@ -46,7 +49,7 @@ else
     IS_RELEASE=false
 fi
 
-case "${PROFILE}" in
+case "${EDITION}" in
     *enterprise*)
         GIT_TAG_PREFIX="e"
         ;;

+ 5 - 1
scripts/shellcheck.sh

@@ -3,7 +3,11 @@
 set -euo pipefail
 
 target_files=()
-while IFS='' read -r line; do target_files+=("$line"); done < <(grep -r -l --exclude-dir=.git --exclude-dir=_build "#!/bin/" .)
+while IFS='' read -r line;
+do
+  target_files+=("$line");
+done < <(git grep -r -l '^#!/\(bin/\|usr/bin/env bash\)' .)
+
 return_code=0
 for i in "${target_files[@]}"; do
   echo checking "$i" ...