From 940b238ad9da3dfa0e012c4bad98fdaf62ce958b Mon Sep 17 00:00:00 2001 From: Antoine Bertin Date: Sun, 22 Jan 2023 18:00:15 +0100 Subject: [PATCH 1/7] fix: add clusterDomain in values --- deploy/charts/emqx/templates/configmap.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/charts/emqx/templates/configmap.yaml b/deploy/charts/emqx/templates/configmap.yaml index 5086f85f6..6bd815ca0 100644 --- a/deploy/charts/emqx/templates/configmap.yaml +++ b/deploy/charts/emqx/templates/configmap.yaml @@ -16,9 +16,9 @@ data: EMQX_CLUSTER__K8S__SERVICE_NAME: {{ include "emqx.fullname" . }}-headless EMQX_CLUSTER__K8S__NAMESPACE: {{ .Release.Namespace }} EMQX_CLUSTER__K8S__ADDRESS_TYPE: "hostname" - EMQX_CLUSTER__K8S__SUFFIX: "svc.cluster.local" + EMQX_CLUSTER__K8S__SUFFIX: "svc.{{ .Values.clusterDomain }}" {{- else if eq (.Values.emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY) "dns" }} - EMQX_CLUSTER__DNS__NAME: "{{ include "emqx.fullname" . }}-headless.{{ .Release.Namespace }}.svc.cluster.local" + EMQX_CLUSTER__DNS__NAME: "{{ include "emqx.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}" EMQX_CLUSTER__DNS__RECORD_TYPE: "srv" {{- end -}} {{- range $index, $value := .Values.emqxConfig }} From 297d33dbad4a2a8dded59b1633f0bf79de6a38eb Mon Sep 17 00:00:00 2001 From: Antoine Bertin Date: Sun, 22 Jan 2023 18:05:12 +0100 Subject: [PATCH 2/7] feat: add clusterDomain value --- deploy/charts/emqx/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy/charts/emqx/values.yaml b/deploy/charts/emqx/values.yaml index 0423c8cdf..c737c8808 100644 --- a/deploy/charts/emqx/values.yaml +++ b/deploy/charts/emqx/values.yaml @@ -35,6 +35,8 @@ serviceAccount: ## Forces the recreation of pods during helm upgrades. This can be useful to update configuration values even if the container image did not change. recreatePods: false +clusterDomain: cluster.local + podAnnotations: {} # Pod deployment policy From 81e7f26ec6173bc1b42cdbf5213c32e5adabd8f0 Mon Sep 17 00:00:00 2001 From: Antoine Bertin Date: Fri, 27 Jan 2023 23:44:58 +0100 Subject: [PATCH 3/7] fix: add clusterDomain to enterprise chart --- deploy/charts/emqx-enterprise/templates/configmap.yaml | 4 ++-- deploy/charts/emqx-enterprise/values.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy/charts/emqx-enterprise/templates/configmap.yaml b/deploy/charts/emqx-enterprise/templates/configmap.yaml index 5086f85f6..6bd815ca0 100644 --- a/deploy/charts/emqx-enterprise/templates/configmap.yaml +++ b/deploy/charts/emqx-enterprise/templates/configmap.yaml @@ -16,9 +16,9 @@ data: EMQX_CLUSTER__K8S__SERVICE_NAME: {{ include "emqx.fullname" . }}-headless EMQX_CLUSTER__K8S__NAMESPACE: {{ .Release.Namespace }} EMQX_CLUSTER__K8S__ADDRESS_TYPE: "hostname" - EMQX_CLUSTER__K8S__SUFFIX: "svc.cluster.local" + EMQX_CLUSTER__K8S__SUFFIX: "svc.{{ .Values.clusterDomain }}" {{- else if eq (.Values.emqxConfig.EMQX_CLUSTER__DISCOVERY_STRATEGY) "dns" }} - EMQX_CLUSTER__DNS__NAME: "{{ include "emqx.fullname" . }}-headless.{{ .Release.Namespace }}.svc.cluster.local" + EMQX_CLUSTER__DNS__NAME: "{{ include "emqx.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}" EMQX_CLUSTER__DNS__RECORD_TYPE: "srv" {{- end -}} {{- range $index, $value := .Values.emqxConfig }} diff --git a/deploy/charts/emqx-enterprise/values.yaml b/deploy/charts/emqx-enterprise/values.yaml index b9507c5a0..3a607a71e 100644 --- a/deploy/charts/emqx-enterprise/values.yaml +++ b/deploy/charts/emqx-enterprise/values.yaml @@ -35,6 +35,8 @@ serviceAccount: ## Forces the recreation of pods during helm upgrades. This can be useful to update configuration values even if the container image did not change. recreatePods: false +clusterDomain: cluster.local + podAnnotations: {} # Pod deployment policy From 636247650854c41645d238f0964f70eccaa64328 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 3 Feb 2023 09:00:34 +0100 Subject: [PATCH 4/7] feat: disable telemetry for ee by default --- lib-ee/emqx_ee_conf/etc/emqx-enterprise.conf | 1 + scripts/merge-config.escript | 33 ++++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 lib-ee/emqx_ee_conf/etc/emqx-enterprise.conf diff --git a/lib-ee/emqx_ee_conf/etc/emqx-enterprise.conf b/lib-ee/emqx_ee_conf/etc/emqx-enterprise.conf new file mode 100644 index 000000000..8da63dad9 --- /dev/null +++ b/lib-ee/emqx_ee_conf/etc/emqx-enterprise.conf @@ -0,0 +1 @@ +telemetry.enable = false diff --git a/scripts/merge-config.escript b/scripts/merge-config.escript index 1b30dbd1d..d30a0ca68 100755 --- a/scripts/merge-config.escript +++ b/scripts/merge-config.escript @@ -30,7 +30,7 @@ main(_) -> case IsEnterprise of true -> EnterpriseCfgs = get_all_cfgs("lib-ee"), - EnterpriseConf = merge("", EnterpriseCfgs), + EnterpriseConf = merge(<<"">>, EnterpriseCfgs), ok = file:write_file("apps/emqx_conf/etc/emqx-enterprise.conf.all", EnterpriseConf); false -> ok @@ -41,22 +41,21 @@ is_enterprise() -> nomatch =/= string:find(Profile, "enterprise"). merge(BaseConf, Cfgs) -> - lists:foldl( - fun(CfgFile, Acc) -> - case filelib:is_regular(CfgFile) of - true -> - {ok, Bin1} = file:read_file(CfgFile), - case string:trim(Bin1, both) of - <<>> -> Acc; - Bin2 -> [Acc, io_lib:nl(), io_lib:nl(), Bin2] - end; - false -> - Acc - end - end, - BaseConf, - Cfgs - ). + Confs = [BaseConf | lists:map(fun read_conf/1, Cfgs)], + infix(lists:filter(fun(I) -> iolist_size(I) > 0 end, Confs), [io_lib:nl(), io_lib:nl()]). + +read_conf(CfgFile) -> + case filelib:is_regular(CfgFile) of + true -> + {ok, Bin1} = file:read_file(CfgFile), + string:trim(Bin1, both); + false -> + <<>> + end. + +infix([], _With) -> []; +infix([One], _With) -> [One]; +infix([H | T], With) -> [H, With, infix(T, With)]. get_all_cfgs(Root) -> Apps0 = filelib:wildcard("*", Root) -- ["emqx_machine", "emqx_conf"], From c95d201331ca59a4ff361a3b53dfb194da821616 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 3 Feb 2023 09:40:28 +0100 Subject: [PATCH 5/7] ci: no relup for now --- scripts/relup-build/download-base-packages.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/relup-build/download-base-packages.sh b/scripts/relup-build/download-base-packages.sh index 1a03f7ef8..8d89e8ab5 100755 --- a/scripts/relup-build/download-base-packages.sh +++ b/scripts/relup-build/download-base-packages.sh @@ -14,8 +14,10 @@ export PROFILE case $PROFILE in "emqx-enterprise") - DIR='emqx-ee' - EDITION='enterprise' + #DIR='emqx-ee' + #EDITION='enterprise' + echo "No relup for now" + exit 0 ;; "emqx") echo "No relup for opensource edition" From d45a0cb2ee929f48113823bfc0b832f10e094408 Mon Sep 17 00:00:00 2001 From: Zhongwen Deng Date: Fri, 3 Feb 2023 15:45:18 +0800 Subject: [PATCH 6/7] chore: remove <<>> when logging username --- apps/emqx_dashboard/src/emqx_dashboard_api.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/emqx_dashboard/src/emqx_dashboard_api.erl b/apps/emqx_dashboard/src/emqx_dashboard_api.erl index a4322c696..cc2a1337d 100644 --- a/apps/emqx_dashboard/src/emqx_dashboard_api.erl +++ b/apps/emqx_dashboard/src/emqx_dashboard_api.erl @@ -325,7 +325,7 @@ is_self_auth_token(Username, Token) -> end. change_pwd(post, #{bindings := #{username := Username}, body := Params}) -> - LogMeta = #{msg => "Dashboard change password", username => Username}, + LogMeta = #{msg => "Dashboard change password", username => binary_to_list(Username)}, OldPwd = maps:get(<<"old_pwd">>, Params), NewPwd = maps:get(<<"new_pwd">>, Params), case ?EMPTY(OldPwd) orelse ?EMPTY(NewPwd) of From 7233f42889d3786575742e8a404b54edded04632 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 3 Feb 2023 09:58:02 +0100 Subject: [PATCH 7/7] ci: skip relup tests for now --- .github/workflows/run_relup_tests.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run_relup_tests.yaml b/.github/workflows/run_relup_tests.yaml index a6854aa40..29b4fbc45 100644 --- a/.github/workflows/run_relup_tests.yaml +++ b/.github/workflows/run_relup_tests.yaml @@ -4,13 +4,13 @@ concurrency: group: relup-${{ github.event_name }}-${{ github.ref }} cancel-in-progress: true -on: - push: - branches: - - '**' - tags: - - e* - pull_request: +# on: +# push: +# branches: +# - '**' +# tags: +# - e* +# pull_request: jobs: relup_test_plan: