From ba735545fb8755a51bf0f8091dfb9eb0281a01d0 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Sat, 25 May 2024 00:22:00 +0800 Subject: [PATCH] [improve] tips need update initial default password (#2030) Signed-off-by: tomsun28 --- manager/src/main/resources/sureness.yml | 6 +++--- .../hertzbeat-mysql-iotdb/conf/sureness.yml | 6 +++--- .../conf/sureness.yml | 6 +++--- .../conf/sureness.yml | 6 +++--- .../conf/sureness.yml | 6 +++--- .../templates/manager/configmap.yaml | 6 +++--- script/sureness.yml | 6 +++--- .../src/app/core/startup/startup.service.ts | 2 +- .../passport/login/login.component.html | 20 +++++++++++++++++++ .../routes/passport/login/login.component.ts | 5 +++++ web-app/src/assets/i18n/en-US.json | 1 + web-app/src/assets/i18n/zh-CN.json | 1 + web-app/src/assets/i18n/zh-TW.json | 1 + 13 files changed, 50 insertions(+), 22 deletions(-) diff --git a/manager/src/main/resources/sureness.yml b/manager/src/main/resources/sureness.yml index 0cea278a35b..c7253ff88c8 100644 --- a/manager/src/main/resources/sureness.yml +++ b/manager/src/main/resources/sureness.yml @@ -113,8 +113,8 @@ account: role: [guest] - appId: lili # credential = MD5(password + salt) - # plain password: lili + # plain password: hertzbeat # attention: digest authentication does not support salted encrypted password accounts - credential: 1A676730B0C7F54654B0E09184448289 + credential: 94C6B34E7A199A9F9D4E1F208093B489 salt: 123 - role: [guest] + role: [user] diff --git a/script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml b/script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml index 0cea278a35b..c7253ff88c8 100644 --- a/script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml +++ b/script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml @@ -113,8 +113,8 @@ account: role: [guest] - appId: lili # credential = MD5(password + salt) - # plain password: lili + # plain password: hertzbeat # attention: digest authentication does not support salted encrypted password accounts - credential: 1A676730B0C7F54654B0E09184448289 + credential: 94C6B34E7A199A9F9D4E1F208093B489 salt: 123 - role: [guest] + role: [user] diff --git a/script/docker-compose/hertzbeat-mysql-tdengine/conf/sureness.yml b/script/docker-compose/hertzbeat-mysql-tdengine/conf/sureness.yml index 0cea278a35b..c7253ff88c8 100644 --- a/script/docker-compose/hertzbeat-mysql-tdengine/conf/sureness.yml +++ b/script/docker-compose/hertzbeat-mysql-tdengine/conf/sureness.yml @@ -113,8 +113,8 @@ account: role: [guest] - appId: lili # credential = MD5(password + salt) - # plain password: lili + # plain password: hertzbeat # attention: digest authentication does not support salted encrypted password accounts - credential: 1A676730B0C7F54654B0E09184448289 + credential: 94C6B34E7A199A9F9D4E1F208093B489 salt: 123 - role: [guest] + role: [user] diff --git a/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/sureness.yml b/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/sureness.yml index 0cea278a35b..c7253ff88c8 100644 --- a/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/sureness.yml +++ b/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/sureness.yml @@ -113,8 +113,8 @@ account: role: [guest] - appId: lili # credential = MD5(password + salt) - # plain password: lili + # plain password: hertzbeat # attention: digest authentication does not support salted encrypted password accounts - credential: 1A676730B0C7F54654B0E09184448289 + credential: 94C6B34E7A199A9F9D4E1F208093B489 salt: 123 - role: [guest] + role: [user] diff --git a/script/docker-compose/hertzbeat-postgresql-iotdb/conf/sureness.yml b/script/docker-compose/hertzbeat-postgresql-iotdb/conf/sureness.yml index 0cea278a35b..c7253ff88c8 100644 --- a/script/docker-compose/hertzbeat-postgresql-iotdb/conf/sureness.yml +++ b/script/docker-compose/hertzbeat-postgresql-iotdb/conf/sureness.yml @@ -113,8 +113,8 @@ account: role: [guest] - appId: lili # credential = MD5(password + salt) - # plain password: lili + # plain password: hertzbeat # attention: digest authentication does not support salted encrypted password accounts - credential: 1A676730B0C7F54654B0E09184448289 + credential: 94C6B34E7A199A9F9D4E1F208093B489 salt: 123 - role: [guest] + role: [user] diff --git a/script/helm/hertzbeat/templates/manager/configmap.yaml b/script/helm/hertzbeat/templates/manager/configmap.yaml index 0442bb3a5b7..3efb85f671f 100644 --- a/script/helm/hertzbeat/templates/manager/configmap.yaml +++ b/script/helm/hertzbeat/templates/manager/configmap.yaml @@ -262,8 +262,8 @@ data: role: [guest] - appId: lili # credential = MD5(password + salt) - # plain password: lili + # plain password: hertzbeat # attention: digest authentication does not support salted encrypted password accounts - credential: 1A676730B0C7F54654B0E09184448289 + credential: 94C6B34E7A199A9F9D4E1F208093B489 salt: 123 - role: [guest] + role: [user] diff --git a/script/sureness.yml b/script/sureness.yml index 0cea278a35b..c7253ff88c8 100644 --- a/script/sureness.yml +++ b/script/sureness.yml @@ -113,8 +113,8 @@ account: role: [guest] - appId: lili # credential = MD5(password + salt) - # plain password: lili + # plain password: hertzbeat # attention: digest authentication does not support salted encrypted password accounts - credential: 1A676730B0C7F54654B0E09184448289 + credential: 94C6B34E7A199A9F9D4E1F208093B489 salt: 123 - role: [guest] + role: [user] diff --git a/web-app/src/app/core/startup/startup.service.ts b/web-app/src/app/core/startup/startup.service.ts index ef5b03972cb..1dabb86aa59 100644 --- a/web-app/src/app/core/startup/startup.service.ts +++ b/web-app/src/app/core/startup/startup.service.ts @@ -39,7 +39,7 @@ export class StartupService { return zip( this.i18n.loadLangData(defaultLang), this.httpClient.get('./assets/app-data.json', { headers: headers }), - this.httpClient.get('/apps/hierarchy') + this.httpClient.get(`/apps/hierarchy?lang=${defaultLang}`) ).pipe( catchError((res: NzSafeAny) => { console.warn(`StartupService.load: Network request failed`, res); diff --git a/web-app/src/app/routes/passport/login/login.component.html b/web-app/src/app/routes/passport/login/login.component.html index caf0fa8c0ce..f5809bc6d9c 100644 --- a/web-app/src/app/routes/passport/login/login.component.html +++ b/web-app/src/app/routes/passport/login/login.component.html @@ -36,6 +36,26 @@ + + + + + {{ 'app.login.need-change-password' | i18n }} + + + + diff --git a/web-app/src/app/routes/passport/login/login.component.ts b/web-app/src/app/routes/passport/login/login.component.ts index 99f349a6314..df9d47aed3d 100644 --- a/web-app/src/app/routes/passport/login/login.component.ts +++ b/web-app/src/app/routes/passport/login/login.component.ts @@ -80,6 +80,7 @@ export class UserLoginComponent implements OnDestroy { error = ''; type = 0; loading = false; + needUpdatePassword = false; // #region get captcha @@ -104,6 +105,10 @@ export class UserLoginComponent implements OnDestroy { if (this.userName.invalid || this.password.invalid) { return; } + if (!this.needUpdatePassword && this.password.value === 'hertzbeat') { + this.needUpdatePassword = true; + return; + } } else { this.mobile.markAsDirty(); this.mobile.updateValueAndValidity(); diff --git a/web-app/src/assets/i18n/en-US.json b/web-app/src/assets/i18n/en-US.json index a7e96341b36..3de3ee76f4d 100644 --- a/web-app/src/assets/i18n/en-US.json +++ b/web-app/src/assets/i18n/en-US.json @@ -496,6 +496,7 @@ "app.passport.intro-2": "Real-Time Monitoring", "app.login.message-need-identifier": "Please enter your username", "app.login.message-need-credential": "Please enter password", "app.login.message-invalid-credentials": "Invalid username or password", + "app.login.need-change-password": "Please update the initial default password in time!", "app.login.tab-login-credentials": "Sign In HertzBeat", "app.login.remember-me": "Remember me", "app.login.login": "Login", diff --git a/web-app/src/assets/i18n/zh-CN.json b/web-app/src/assets/i18n/zh-CN.json index 3497d5d2814..92326cf3c28 100644 --- a/web-app/src/assets/i18n/zh-CN.json +++ b/web-app/src/assets/i18n/zh-CN.json @@ -495,6 +495,7 @@ "app.login.message-need-identifier": "请输入用户名", "app.login.message-need-credential": "请输入密码", "app.login.message-invalid-credentials": "账户或密码错误", + "app.login.need-change-password": "请及时更新初始默认密码!", "app.login.tab-login-credentials": "登入 HertzBeat", "app.login.remember-me": "自动登录", "app.login.login": "登录", diff --git a/web-app/src/assets/i18n/zh-TW.json b/web-app/src/assets/i18n/zh-TW.json index a0acbfec8aa..07df1657af9 100644 --- a/web-app/src/assets/i18n/zh-TW.json +++ b/web-app/src/assets/i18n/zh-TW.json @@ -494,6 +494,7 @@ "app.login.message-need-identifier": "請輸入用戶名", "app.login.message-need-credential": "請輸入密碼", "app.login.message-invalid-credentials": "賬戶或密碼錯誤", + "app.login.need-change-password": "請及時更新初始默認密碼!", "app.login.tab-login-credentials": "登錄 HertzBeat", "app.login.remember-me": "自動登錄", "app.login.login": "登錄",