Skip to content

Commit

Permalink
[improve] tips need update initial default password (#2030)
Browse files Browse the repository at this point in the history
Signed-off-by: tomsun28 <[email protected]>
  • Loading branch information
tomsun28 authored May 24, 2024
1 parent ddf6daa commit ba73554
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 22 deletions.
6 changes: 3 additions & 3 deletions manager/src/main/resources/sureness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
6 changes: 3 additions & 3 deletions script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Original file line number Diff line number Diff line change
Expand Up @@ -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]
6 changes: 3 additions & 3 deletions script/helm/hertzbeat/templates/manager/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
6 changes: 3 additions & 3 deletions script/sureness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
2 changes: 1 addition & 1 deletion web-app/src/app/core/startup/startup.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 20 additions & 0 deletions web-app/src/app/routes/passport/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
</nz-input-group>
</nz-form-control>
</nz-form-item>
<nz-alert
*ngIf="needUpdatePassword"
[nzType]="'warning'"
[nzMessage]="showPasswdChange"
[nzShowIcon]="true"
class="mb-lg"
></nz-alert>
<ng-template #showPasswdChange>
<a href="https://hertzbeat.apache.org/docs/start/account-modify" target="_blank">
<span>
{{ 'app.login.need-change-password' | i18n }}
<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" style="margin-left: 4px">
<path
fill="currentColor"
d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"
></path>
</svg>
</span>
</a>
</ng-template>
<nz-form-item>
<nz-col [nzSpan]="12">
<label nz-checkbox formControlName="remember">{{ 'app.login.remember-me' | i18n }}</label>
Expand Down
5 changes: 5 additions & 0 deletions web-app/src/app/routes/passport/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export class UserLoginComponent implements OnDestroy {
error = '';
type = 0;
loading = false;
needUpdatePassword = false;

// #region get captcha

Expand All @@ -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();
Expand Down
1 change: 1 addition & 0 deletions web-app/src/assets/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions web-app/src/assets/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "登录",
Expand Down
1 change: 1 addition & 0 deletions web-app/src/assets/i18n/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "登錄",
Expand Down

0 comments on commit ba73554

Please sign in to comment.