diff --git a/make/common/templates/ui/app.conf b/make/common/templates/ui/app.conf index b4090f33c..8e8f199b7 100644 --- a/make/common/templates/ui/app.conf +++ b/make/common/templates/ui/app.conf @@ -1,9 +1,6 @@ -appname = registry +appname = Harbor runmode = dev - -[lang] -types = en-US|zh-CN -names = en-US|zh-CN +enablegzip = true [dev] -httpport = 80 \ No newline at end of file +httpport = 80 diff --git a/make/dev/docker-compose.yml b/make/dev/docker-compose.yml index c25a4d7c8..f99224b92 100644 --- a/make/dev/docker-compose.yml +++ b/make/dev/docker-compose.yml @@ -48,7 +48,7 @@ services: - ../common/config/adminserver/env restart: always volumes: - - /data/config/:/etc/adminserver/ + - /data/config/:/etc/adminserver/config/ - /data/secretkey:/etc/adminserver/key - /data/:/data/ depends_on: diff --git a/make/docker-compose.tpl b/make/docker-compose.tpl index 72338c915..10cbada2b 100644 --- a/make/docker-compose.tpl +++ b/make/docker-compose.tpl @@ -54,9 +54,9 @@ services: - ./common/config/adminserver/env restart: always volumes: - - /data/config/:/etc/adminserver/ - - /data/secretkey:/etc/adminserver/key - - /data/:/data/ + - /data/config/:/etc/adminserver/config/:z + - /data/secretkey:/etc/adminserver/key:z + - /data/:/data/:z networks: - harbor depends_on: diff --git a/src/adminserver/systemcfg/systemcfg.go b/src/adminserver/systemcfg/systemcfg.go index 1cef91005..487f71e5f 100644 --- a/src/adminserver/systemcfg/systemcfg.go +++ b/src/adminserver/systemcfg/systemcfg.go @@ -31,7 +31,7 @@ import ( ) const ( - defaultJSONCfgStorePath string = "/etc/adminserver/config.json" + defaultJSONCfgStorePath string = "/etc/adminserver/config/config.json" defaultKeyPath string = "/etc/adminserver/key" ) diff --git a/src/common/dao/projectmember.go b/src/common/dao/projectmember.go index 31788dfc2..09410e1ce 100644 --- a/src/common/dao/projectmember.go +++ b/src/common/dao/projectmember.go @@ -58,7 +58,8 @@ func DeleteProjectMember(projectID int64, userID int) error { func GetUserByProject(projectID int64, queryUser models.User) ([]models.User, error) { o := GetOrmer() u := []models.User{} - sql := `select u.user_id, u.username, r.name rolename, r.role_id as role + sql := `select u.user_id, u.username, u.creation_time, u.update_time, r.name as rolename, + r.role_id as role from user u join project_member pm on pm.project_id = ? and u.user_id = pm.user_id @@ -73,7 +74,7 @@ func GetUserByProject(projectID int64, queryUser models.User) ([]models.User, er sql += " and u.username like ? " queryParam = append(queryParam, "%"+escape(queryUser.Username)+"%") } - sql += ` order by u.user_id ` + sql += ` order by u.username ` _, err := o.Raw(sql, queryParam).QueryRows(&u) return u, err } diff --git a/src/ui/api/target.go b/src/ui/api/target.go index 425c9a4dc..bb671cb07 100644 --- a/src/ui/api/target.go +++ b/src/ui/api/target.go @@ -147,17 +147,7 @@ func (t *TargetAPI) Get() { t.CustomAbort(http.StatusNotFound, http.StatusText(http.StatusNotFound)) } - // The reason why the password is returned is that when user just wants to - // modify other fields of target he does not need to input the password again. - // The security issue can be fixed by enable https. - if len(target.Password) != 0 { - pwd, err := utils.ReversibleDecrypt(target.Password, t.secretKey) - if err != nil { - log.Errorf("failed to decrypt password: %v", err) - t.CustomAbort(http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError)) - } - target.Password = pwd - } + target.Password = "" t.Data["json"] = target t.ServeJSON() @@ -173,16 +163,7 @@ func (t *TargetAPI) List() { } for _, target := range targets { - if len(target.Password) == 0 { - continue - } - - str, err := utils.ReversibleDecrypt(target.Password, t.secretKey) - if err != nil { - log.Errorf("failed to decrypt password: %v", err) - t.CustomAbort(http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError)) - } - target.Password = str + target.Password = "" } t.Data["json"] = targets diff --git a/src/ui/controllers/base.go b/src/ui/controllers/base.go index cfde32b41..378ae581a 100644 --- a/src/ui/controllers/base.go +++ b/src/ui/controllers/base.go @@ -158,7 +158,7 @@ func (cc *CommonController) SendEmail() { 60, settings.SSL, false, settings.From, []string{email}, - cc.Tr("reset_email_subject"), + "Reset Harbor user password", message.String()) if err != nil { log.Errorf("Send email failed: %v", err) diff --git a/src/ui_ng/src/app/account/password/forgot-password.component.html b/src/ui_ng/src/app/account/password/forgot-password.component.html index d95eeb94f..5f50299e2 100644 --- a/src/ui_ng/src/app/account/password/forgot-password.component.html +++ b/src/ui_ng/src/app/account/password/forgot-password.component.html @@ -12,7 +12,7 @@ required email id="reset_pwd_email" - size="40" + size="30" (input)="handleValidation(true)" (blur)="handleValidation(false)"> diff --git a/src/ui_ng/src/app/account/password/password-setting.component.html b/src/ui_ng/src/app/account/password/password-setting.component.html index 2292585ec..55e396ba5 100644 --- a/src/ui_ng/src/app/account/password/password-setting.component.html +++ b/src/ui_ng/src/app/account/password/password-setting.component.html @@ -11,7 +11,7 @@ required name="oldPassword" [(ngModel)]="oldPwd" - #oldPassInput="ngModel" size="42"> + #oldPassInput="ngModel" size="30"> {{'TOOLTIP.CURRENT_PWD' | translate}} @@ -25,7 +25,7 @@ pattern="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).{8,20}$" name="newPassword" [(ngModel)]="newPwd" - #newPassInput="ngModel" size="42" + #newPassInput="ngModel" size="30" (input)='handleValidation("newPassword", false)' (blur)='handleValidation("newPassword", true)'> @@ -42,7 +42,7 @@ pattern="^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).{8,20}$" name="reNewPassword" [(ngModel)]="reNewPwd" - #reNewPassInput="ngModel" size="42" + #reNewPassInput="ngModel" size="30" (input)='handleValidation("reNewPassword", false)' (blur)='handleValidation("reNewPassword", true)'> diff --git a/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.html b/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.html index d2ec17401..e8a5bbe72 100644 --- a/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.html +++ b/src/ui_ng/src/app/replication/create-edit-destination/create-edit-destination.component.html @@ -14,7 +14,7 @@