From 68839a6725f1bbb828f15367b59c7fdb0d2278d2 Mon Sep 17 00:00:00 2001
From: fang <2535030577@qq.com>
Date: Sun, 10 Dec 2023 01:15:46 +0800
Subject: [PATCH 1/6] =?UTF-8?q?[DOC]=E6=96=B0=E5=A2=9EMySQL=E5=AF=86?=
=?UTF-8?q?=E7=A0=81=E4=BB=A5=E5=8A=A0=E5=AF=86=E6=96=B9=E5=BC=8F=E5=AD=98?=
=?UTF-8?q?=E5=82=A8=E5=B9=B6=E4=BD=BF=E7=94=A8=E7=9A=84=E6=96=87=E6=A1=A3?=
=?UTF-8?q?=20(#1135)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...40\345\257\206\346\211\213\345\206\214.md" | 115 ++++++++++++++++++
km-rest/pom.xml | 6 +
2 files changed, 121 insertions(+)
create mode 100644 "docs/dev_guide/MYSQL\345\257\206\347\240\201\345\212\240\345\257\206\346\211\213\345\206\214.md"
diff --git "a/docs/dev_guide/MYSQL\345\257\206\347\240\201\345\212\240\345\257\206\346\211\213\345\206\214.md" "b/docs/dev_guide/MYSQL\345\257\206\347\240\201\345\212\240\345\257\206\346\211\213\345\206\214.md"
new file mode 100644
index 000000000..f38b5b006
--- /dev/null
+++ "b/docs/dev_guide/MYSQL\345\257\206\347\240\201\345\212\240\345\257\206\346\211\213\345\206\214.md"
@@ -0,0 +1,115 @@
+## YML文件MYSQL密码加密存储手册
+
+### 1、本地部署加密
+
+**第一步:生成密文**
+
+在本地仓库中找到jasypt-1.9.3.jar,默认在org/jasypt/jasypt/1.9.3中,使用`java -cp`生成密文。
+
+```bash
+java -cp jasypt-1.9.3.jar org.jasypt.intf.cli.JasyptPBEStringEncryptionCLI input=mysql密码 password=加密的salt algorithm=PBEWithMD5AndDES
+```
+
+```bash
+## 得到密文
+DYbVDLg5D0WRcJSCUGWjiw==
+```
+
+**第二步:配置jasypt**
+
+在YML文件中配置jasypt,例如
+
+```yaml
+jasypt:
+ encryptor:
+ algorithm: PBEWithMD5AndDES
+ iv-generator-classname: org.jasypt.iv.NoIvGenerator
+```
+
+**第三步:配置密文**
+
+使用密文替换YML文件中的明文密码为ENC(密文),例如[application.yml](https://github.com/didi/KnowStreaming/blob/master/km-rest/src/main/resources/application.yml)中MYSQL密码。
+
+```yaml
+know-streaming:
+ username: root
+ password: ENC(DYbVDLg5D0WRcJSCUGWjiw==)
+```
+
+**第四步:配置加密的salt(选择其一)**
+
+- 配置在YML文件中(不推荐)
+
+```yaml
+jasypt:
+ encryptor:
+ password: salt
+```
+
+- 配置程序启动时的命令行参数
+
+```bash
+java -jar xxx.jar --jasypt.encryptor.password=salt
+```
+
+- 配置程序启动时的环境变量
+
+```bash
+export JASYPT_PASSWORD=salt
+java -jar xxx.jar --jasypt.encryptor.password=${JASYPT_PASSWORD}
+```
+
+## 2、容器部署加密
+
+利用docker swarm 提供的 secret 机制加密存储密码,使用docker swarm来管理密码。
+
+### 2.1、secret加密存储
+
+**第一步:初始化docker swarm**
+
+```bash
+docker swarm init
+```
+
+**第二步:创建密钥**
+
+```bash
+echo "admin2022_" | docker secret create mysql_password -
+
+# 输出密钥
+f964wi4gg946hu78quxsh2ge9
+```
+
+**第三步:使用密钥**
+
+```yaml
+# mysql用户密码
+SERVER_MYSQL_USER: root
+SERVER_MYSQL_PASSWORD: mysql_password
+
+knowstreaming-mysql:
+ # root 用户密码
+ MYSQL_ROOT_PASSWORD: mysql_password
+secrets:
+ mysql_password:
+ external: true
+```
+
+### 2.2、使用密钥文件加密
+
+**第一步:创建密钥**
+
+```bash
+echo "admin2022_" > password
+```
+
+**第二步:使用密钥**
+
+```yaml
+# mysql用户密码
+SERVER_MYSQL_USER: root
+SERVER_MYSQL_PASSWORD: mysql_password
+secrets:
+ mysql_password:
+ file: ./password
+```
diff --git a/km-rest/pom.xml b/km-rest/pom.xml
index 0c69eccc7..954629fc8 100644
--- a/km-rest/pom.xml
+++ b/km-rest/pom.xml
@@ -138,6 +138,12 @@
${springboot.version}
+
+ com.github.ulisesbocchio
+ jasypt-spring-boot-starter
+ 3.0.5
+
+
org.testcontainers
From fcf0a08e0a3c4ba78576c8b5b253affa02068d4b Mon Sep 17 00:00:00 2001
From: jiangminbing
Date: Sat, 6 Jan 2024 16:40:11 +0800
Subject: [PATCH 2/6] =?UTF-8?q?[Bugfix]=20=E4=BF=AE=E5=A4=8DBrokerConfigSe?=
=?UTF-8?q?rviceImpl.getBrokerConfigByZKClient=E6=96=B9=E6=B3=95=E4=B8=80?=
=?UTF-8?q?=E5=AE=9A=E8=BF=94=E5=9B=9E=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?=
=?UTF-8?q?=20(#1198)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修复获取ZK-Broker配置,出现空列表的问题
Co-authored-by: jiangmb
---
.../km/core/service/broker/impl/BrokerConfigServiceImpl.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/impl/BrokerConfigServiceImpl.java b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/impl/BrokerConfigServiceImpl.java
index aa2bb7eca..1007cb270 100644
--- a/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/impl/BrokerConfigServiceImpl.java
+++ b/km-core/src/main/java/com/xiaojukeji/know/streaming/km/core/service/broker/impl/BrokerConfigServiceImpl.java
@@ -37,6 +37,7 @@
import javax.annotation.PostConstruct;
import java.util.*;
+import java.util.stream.Collectors;
import static com.xiaojukeji.know.streaming.km.common.enums.version.VersionEnum.*;
@@ -154,9 +155,11 @@ private Result> getBrokerConfigByZKClient(VersionItemPar
if (propertiesResult.failed()) {
return Result.buildFromIgnoreData(propertiesResult);
}
+ List configKeyList = propertiesResult.getData().keySet().stream().map(Object::toString).collect(Collectors.toList());
+
return Result.buildSuc(KafkaConfigConverter.convert2KafkaBrokerConfigDetailList(
- new ArrayList<>(),
+ configKeyList,
propertiesResult.getData()
));
}
From 232f06e5c216ff223e95b33e4d91a4ac1b2ed406 Mon Sep 17 00:00:00 2001
From: Peng <71620349+PenceXie@users.noreply.github.com>
Date: Tue, 25 Jun 2024 17:19:25 +0800
Subject: [PATCH 3/6] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index ac9415bec..9899d8fb3 100644
--- a/README.md
+++ b/README.md
@@ -146,7 +146,7 @@ PS: 提问请尽量把问题一次性描述清楚,并告知环境信息情况
**`2、微信群`**
-微信加群:添加`PenceXie` 、`szzdzhp001`的微信号备注KnowStreaming加群。
+微信加群:添加`PenceXie` 的微信号备注KnowStreaming加群。
加群之前有劳点一下 star,一个小小的 star 是对KnowStreaming作者们努力建设社区的动力。
From bfc6999c93aa60b7a6793771e95a4fd72f60458e Mon Sep 17 00:00:00 2001
From: Peng <71620349+PenceXie@users.noreply.github.com>
Date: Fri, 23 Aug 2024 15:38:04 +0800
Subject: [PATCH 4/6] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 9899d8fb3..93a29f844 100644
--- a/README.md
+++ b/README.md
@@ -136,7 +136,7 @@
👍 我们正在组建国内最大,最权威的 **[Kafka中文社区](https://z.didi.cn/5gSF9)**
-在这里你可以结交各大互联网的 Kafka大佬 以及 4000+ Kafka爱好者,一起实现知识共享,实时掌控最新行业资讯,期待 👏 您的加入中~ https://z.didi.cn/5gSF9
+在这里你可以结交各大互联网的 Kafka大佬 以及 6200+ Kafka爱好者,一起实现知识共享,实时掌控最新行业资讯,期待 👏 您的加入中~ https://z.didi.cn/5gSF9
有问必答~! 互动有礼~!
From a4085adf10a285d89592f81a8b68573ab3ec119f Mon Sep 17 00:00:00 2001
From: ruanliang-hualun
Date: Mon, 7 Oct 2024 20:14:05 +0800
Subject: [PATCH 5/6] [Bugfix]fix Topic level metric query
---
.../src/pages/TopicList/ExpandPartition.tsx | 2 +-
.../resources/es/dsl/TopicMetricESDAO/getAggListMetrics | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/km-console/packages/layout-clusters-fe/src/pages/TopicList/ExpandPartition.tsx b/km-console/packages/layout-clusters-fe/src/pages/TopicList/ExpandPartition.tsx
index bf87fb59f..81ec21324 100644
--- a/km-console/packages/layout-clusters-fe/src/pages/TopicList/ExpandPartition.tsx
+++ b/km-console/packages/layout-clusters-fe/src/pages/TopicList/ExpandPartition.tsx
@@ -44,7 +44,7 @@ const ExpandPartition = (props: { record: any; onConfirm: () => void }) => {
setLoading(true);
const metricParams = {
- aggType: 'avg',
+ aggType: 'sum',
endTime: Math.round(endStamp),
metricsNames: ['BytesIn', 'BytesOut'],
startTime: Math.round(startStamp),
diff --git a/km-persistence/src/main/resources/es/dsl/TopicMetricESDAO/getAggListMetrics b/km-persistence/src/main/resources/es/dsl/TopicMetricESDAO/getAggListMetrics
index b76f2cb99..c93b4d5f1 100644
--- a/km-persistence/src/main/resources/es/dsl/TopicMetricESDAO/getAggListMetrics
+++ b/km-persistence/src/main/resources/es/dsl/TopicMetricESDAO/getAggListMetrics
@@ -17,6 +17,13 @@
}
}
},
+ {
+ "term": {
+ "brokerAgg" : {
+ "value": "1"
+ }
+ }
+ },
{
"range": {
"timestamp": {
From e5836dc29ff773b8fdd4e532c2ffc0a49bf2a511 Mon Sep 17 00:00:00 2001
From: liwei
Date: Sat, 12 Oct 2024 19:44:18 +0800
Subject: [PATCH 6/6] Fix node download url
---
km-console/pom.xml | 2 --
1 file changed, 2 deletions(-)
diff --git a/km-console/pom.xml b/km-console/pom.xml
index 76201e592..5844e9c14 100644
--- a/km-console/pom.xml
+++ b/km-console/pom.xml
@@ -32,8 +32,6 @@
v12.22.12
6.14.16
- https://npm.taobao.org/mirrors/node/
- https://registry.npm.taobao.org/npm/-/