diff --git a/apps/emqx/include/emqx_release.hrl b/apps/emqx/include/emqx_release.hrl index cdf2eefa7..1783e7c05 100644 --- a/apps/emqx/include/emqx_release.hrl +++ b/apps/emqx/include/emqx_release.hrl @@ -32,10 +32,10 @@ %% `apps/emqx/src/bpapi/README.md' %% Community edition --define(EMQX_RELEASE_CE, "5.0.20"). +-define(EMQX_RELEASE_CE, "5.0.21"). %% Enterprise edition --define(EMQX_RELEASE_EE, "5.0.2-alpha.1"). +-define(EMQX_RELEASE_EE, "5.0.2-alpha.2"). %% the HTTP API version -define(EMQX_API_VERSION, "5.0"). diff --git a/apps/emqx_conf/src/emqx_conf.erl b/apps/emqx_conf/src/emqx_conf.erl index c64062861..33214946d 100644 --- a/apps/emqx_conf/src/emqx_conf.erl +++ b/apps/emqx_conf/src/emqx_conf.erl @@ -162,7 +162,7 @@ gen_schema_json(Dir, I18nFile, SchemaModule, Lang) -> ok = file:write_file(SchemaJsonFile, IoData). gen_api_schema_json(Dir, I18nFile, Lang) -> - emqx_dashboard:init_i18n(I18nFile, Lang), + emqx_dashboard:init_i18n(I18nFile, list_to_binary(Lang)), gen_api_schema_json_hotconf(Dir, Lang), gen_api_schema_json_bridge(Dir, Lang), emqx_dashboard:clear_i18n(). diff --git a/apps/emqx_dashboard/src/emqx_dashboard.erl b/apps/emqx_dashboard/src/emqx_dashboard.erl index 060045603..f0344dd5a 100644 --- a/apps/emqx_dashboard/src/emqx_dashboard.erl +++ b/apps/emqx_dashboard/src/emqx_dashboard.erl @@ -133,8 +133,8 @@ get_i18n() -> application:get_env(emqx_dashboard, i18n). init_i18n(File, Lang) when is_atom(Lang) -> - init_i18n(File, atom_to_list(Lang)); -init_i18n(File, Lang) when is_list(Lang) -> + init_i18n(File, atom_to_binary(Lang)); +init_i18n(File, Lang) when is_binary(Lang) -> Cache = hocon_schema:new_desc_cache(File), application:set_env(emqx_dashboard, i18n, #{lang => Lang, cache => Cache}). diff --git a/apps/emqx_dashboard/test/emqx_dashboard_SUITE.erl b/apps/emqx_dashboard/test/emqx_dashboard_SUITE.erl index 8190b7c54..906d57e9d 100644 --- a/apps/emqx_dashboard/test/emqx_dashboard_SUITE.erl +++ b/apps/emqx_dashboard/test/emqx_dashboard_SUITE.erl @@ -155,6 +155,18 @@ t_rest_api(_Config) -> emqx_dashboard_admin:add_user(<<"admin">>, Password, <<"administrator">>), ok. +t_swagger_json(_Config) -> + Url = ?HOST ++ "/api-docs/swagger.json", + %% with auth + Auth = auth_header_(<<"admin">>, <<"public_www1">>), + {ok, 200, Body1} = request_api(get, Url, Auth), + ?assert(jsx:is_json(Body1)), + %% without auth + {ok, {{"HTTP/1.1", 200, "OK"}, _Headers, Body2}} = + httpc:request(get, {Url, []}, [], [{body_format, binary}]), + ?assertEqual(Body1, Body2), + ok. + t_cli(_Config) -> [mria:dirty_delete(?ADMIN, Admin) || Admin <- mnesia:dirty_all_keys(?ADMIN)], emqx_dashboard_cli:admins(["add", "username", "password_ww2"]), diff --git a/changes/ce/feat-10065.en.md b/changes/ce/feat-10065.en.md deleted file mode 100644 index ae182f3c8..000000000 --- a/changes/ce/feat-10065.en.md +++ /dev/null @@ -1 +0,0 @@ -Add deb package support for `raspbian9` and `raspbian10`. diff --git a/changes/ce/feat-10065.zh.md b/changes/ce/feat-10065.zh.md deleted file mode 100644 index 366276333..000000000 --- a/changes/ce/feat-10065.zh.md +++ /dev/null @@ -1 +0,0 @@ -为 `raspbian9` 及 `raspbian10` 增加 deb 包支持。 diff --git a/changes/ce/feat-10128.en.md b/changes/ce/feat-10128.en.md deleted file mode 100644 index 705e36137..000000000 --- a/changes/ce/feat-10128.en.md +++ /dev/null @@ -1 +0,0 @@ -Add support for OCSP stapling and CRL check for SSL MQTT listeners. diff --git a/changes/ce/feat-10128.zh.md b/changes/ce/feat-10128.zh.md deleted file mode 100644 index d875bd2ff..000000000 --- a/changes/ce/feat-10128.zh.md +++ /dev/null @@ -1 +0,0 @@ -为 SSL MQTT 监听器增加对 OCSP Stapling 的支持。 diff --git a/changes/ce/feat-10139.en.md b/changes/ce/feat-10139.en.md new file mode 100644 index 000000000..3c49ceac3 --- /dev/null +++ b/changes/ce/feat-10139.en.md @@ -0,0 +1,3 @@ +Add `extraVolumeMounts` to EMQX Helm Chart, it will have the ability to mount the user-own files into the EMQX instance, for example, ACL rule files as mentioned in [#9052](https://github.com/emqx/emqx/issues/9052) + +Done of [#10116](https://github.com/emqx/emqx/issues/10116) diff --git a/changes/ce/feat-10139.zh.md b/changes/ce/feat-10139.zh.md new file mode 100644 index 000000000..f7920a127 --- /dev/null +++ b/changes/ce/feat-10139.zh.md @@ -0,0 +1,3 @@ +将 `extraVolumeMounts` 添加到 EMQX Helm Chart 中,它将能够挂载用户自己的文件到 EMQX 实例中,例如在 [#9052](https://github.com/emqx/emqx/issues/9052) 中提到的 ACL 规则文件。 + +完成了 [#10116](https://github.com/emqx/emqx/issues/10116) diff --git a/deploy/charts/emqx-enterprise/README.md b/deploy/charts/emqx-enterprise/README.md index 258c9c075..df3be6766 100644 --- a/deploy/charts/emqx-enterprise/README.md +++ b/deploy/charts/emqx-enterprise/README.md @@ -57,6 +57,8 @@ The following table lists the configurable parameters of the emqx chart and thei | `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 | {} | +| `extraVolumeMounts` | Additional volumeMounts to the default backend container. | [] | +| `extraVolumes` | Additional volumes to the default backend pod.| [] | | `nodeSelector` | Node labels for pod assignment | `{}` | | `tolerations` | Toleration labels for pod assignment | `[]` | | `affinity` | Map of node/pod affinities | `{}` | diff --git a/deploy/charts/emqx-enterprise/templates/StatefulSet.yaml b/deploy/charts/emqx-enterprise/templates/StatefulSet.yaml index 91b6b1cb2..00751aceb 100644 --- a/deploy/charts/emqx-enterprise/templates/StatefulSet.yaml +++ b/deploy/charts/emqx-enterprise/templates/StatefulSet.yaml @@ -74,12 +74,15 @@ spec: secret: secretName: {{ .Values.emqxLicenseSecretName }} {{- end }} + {{- if .Values.extraVolumes }} + {{- toYaml .Values.extraVolumes | nindent 8 }} + {{- end }} {{- if .Values.podSecurityContext.enabled }} securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} {{- end }} {{- if .Values.initContainers }} initContainers: -{{ toYaml .Values.initContainers | indent 8 }} + {{- toYaml .Values.initContainers | nindent 8 }} {{- end }} {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -138,6 +141,9 @@ spec: subPath: "emqx.lic" readOnly: true {{- end }} + {{- if .Values.extraVolumeMounts }} + {{- toYaml .Values.extraVolumeMounts | nindent 12 }} + {{- end }} readinessProbe: httpGet: path: /status diff --git a/deploy/charts/emqx-enterprise/values.yaml b/deploy/charts/emqx-enterprise/values.yaml index 9ae863219..71569b9a3 100644 --- a/deploy/charts/emqx-enterprise/values.yaml +++ b/deploy/charts/emqx-enterprise/values.yaml @@ -62,6 +62,17 @@ resources: {} # cpu: 500m # memory: 512Mi +extraVolumeMounts: [] +## Additional volumeMounts to the default backend container. +# - name: my-owner-acl +# mountPath: /opt/emqx/etc/acl.conf +# subPath: acl.conf + +extraVolumes: [] +## Additional volumes to the default backend pod. +# - name: my-owner-acl +# secret: fake-acl-conf + # Containers that run before the creation of EMQX containers. They can contain utilities or setup scripts. initContainers: {} # - name: sysctl diff --git a/deploy/charts/emqx/Chart.yaml b/deploy/charts/emqx/Chart.yaml index bccccb0c0..a0662c9cd 100644 --- a/deploy/charts/emqx/Chart.yaml +++ b/deploy/charts/emqx/Chart.yaml @@ -14,8 +14,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. -version: 5.0.20 +version: 5.0.21 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. -appVersion: 5.0.20 +appVersion: 5.0.21 diff --git a/deploy/charts/emqx/README.md b/deploy/charts/emqx/README.md index e28a44199..47ae89245 100644 --- a/deploy/charts/emqx/README.md +++ b/deploy/charts/emqx/README.md @@ -57,6 +57,8 @@ The following table lists the configurable parameters of the emqx chart and thei | `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 | {} | +| `extraVolumeMounts` | Additional volumeMounts to the default backend container. | [] | +| `extraVolumes` | Additional volumes to the default backend pod.| [] | | `nodeSelector` | Node labels for pod assignment | `{}` | | `tolerations` | Toleration labels for pod assignment | `[]` | | `affinity` | Map of node/pod affinities | `{}` | diff --git a/deploy/charts/emqx/templates/StatefulSet.yaml b/deploy/charts/emqx/templates/StatefulSet.yaml index 91b6b1cb2..00751aceb 100644 --- a/deploy/charts/emqx/templates/StatefulSet.yaml +++ b/deploy/charts/emqx/templates/StatefulSet.yaml @@ -74,12 +74,15 @@ spec: secret: secretName: {{ .Values.emqxLicenseSecretName }} {{- end }} + {{- if .Values.extraVolumes }} + {{- toYaml .Values.extraVolumes | nindent 8 }} + {{- end }} {{- if .Values.podSecurityContext.enabled }} securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} {{- end }} {{- if .Values.initContainers }} initContainers: -{{ toYaml .Values.initContainers | indent 8 }} + {{- toYaml .Values.initContainers | nindent 8 }} {{- end }} {{- if .Values.image.pullSecrets }} imagePullSecrets: @@ -138,6 +141,9 @@ spec: subPath: "emqx.lic" readOnly: true {{- end }} + {{- if .Values.extraVolumeMounts }} + {{- toYaml .Values.extraVolumeMounts | nindent 12 }} + {{- end }} readinessProbe: httpGet: path: /status diff --git a/deploy/charts/emqx/values.yaml b/deploy/charts/emqx/values.yaml index 5f14fb17b..f4649cc15 100644 --- a/deploy/charts/emqx/values.yaml +++ b/deploy/charts/emqx/values.yaml @@ -62,6 +62,17 @@ resources: {} # cpu: 500m # memory: 512Mi +extraVolumeMounts: [] +## Additional volumeMounts to the default backend container. +# - name: my-owner-acl +# mountPath: /opt/emqx/etc/acl.conf +# subPath: acl.conf + +extraVolumes: [] +## Additional volumes to the default backend pod. +# - name: my-owner-acl +# secret: fake-acl-conf + # Containers that run before the creation of EMQX containers. They can contain utilities or setup scripts. initContainers: {} # - name: sysctl diff --git a/scripts/rel/format-changelog.sh b/scripts/rel/format-changelog.sh index 8474f24bb..528b3bdc9 100755 --- a/scripts/rel/format-changelog.sh +++ b/scripts/rel/format-changelog.sh @@ -115,9 +115,9 @@ if [ "$PROFILE" == "emqx-enterprise" ]; then changes_dir+=("$top_dir/changes/ee") fi -while read -d "" -r file; do +while read -r file; do PRS+=("$file") -done < <(git diff --name-only -z -a "tags/${BASE_TAG}...HEAD" "${changes_dir[@]}") +done < <(git diff --diff-filter=A --name-only "tags/${BASE_TAG}...HEAD" "${changes_dir[@]}") TEMPLATE_FEAT_CHANGES="$(section 'feat')" TEMPLATE_PERF_CHANGES="$(section 'perf')"