diff --git a/Deploy/templates/registry/config.yml b/Deploy/templates/registry/config.yml index a1b19a8ed..999488a95 100644 --- a/Deploy/templates/registry/config.yml +++ b/Deploy/templates/registry/config.yml @@ -30,6 +30,6 @@ notifications: - name: harbor disabled: false url: http://ui/service/notifications - timeout: 500 + timeout: 500ms threshold: 5 - backoff: 1000 + backoff: 1s diff --git a/Deploy/templates/ui/app.conf b/Deploy/templates/ui/app.conf index 70dddbc89..a5cf4dfdf 100644 --- a/Deploy/templates/ui/app.conf +++ b/Deploy/templates/ui/app.conf @@ -2,8 +2,8 @@ appname = registry runmode = dev [lang] -types = en-US|zh-CN -names = en-US|zh-CN +types = en-US|zh-CN|de-DE +names = en-US|zh-CN|de-DE [dev] httpport = 80 diff --git a/api/base.go b/api/base.go index 70388009e..f2529b61e 100644 --- a/api/base.go +++ b/api/base.go @@ -86,3 +86,11 @@ func (b *BaseAPI) ValidateUser() int { } return userID } + +// Redirect does redirection to resource URI with http header status code. +func (b *BaseAPI) Redirect(statusCode int, resouceID string) { + requestURI := b.Ctx.Request.RequestURI + resoucreURI := requestURI + "/" + resouceID + + b.Ctx.Redirect(statusCode, resoucreURI) +} diff --git a/api/project.go b/api/project.go index 9c1a4f678..993cc9ad7 100644 --- a/api/project.go +++ b/api/project.go @@ -87,11 +87,13 @@ func (p *ProjectAPI) Post() { return } project := models.Project{OwnerID: p.userID, Name: projectName, CreationTime: time.Now(), Public: public} - err = dao.AddProject(project) + projectID, err := dao.AddProject(project) if err != nil { log.Errorf("Failed to add project, error: %v", err) p.RenderError(http.StatusInternalServerError, "Failed to add project") } + + p.Redirect(http.StatusCreated, strconv.FormatInt(projectID, 10)) } // Head ... diff --git a/api/user.go b/api/user.go index 1f4882e1c..c9bb99800 100644 --- a/api/user.go +++ b/api/user.go @@ -158,13 +158,14 @@ func (ua *UserAPI) Post() { user := models.User{} ua.DecodeJSONReq(&user) - _, err := dao.Register(user) + userID, err := dao.Register(user) if err != nil { log.Errorf("Error occurred in Register: %v", err) ua.RenderError(http.StatusInternalServerError, "Internal error.") return } + ua.Redirect(http.StatusCreated, strconv.FormatInt(userID, 10)) } // Delete ... diff --git a/contrib/docker-compose.yml.daocloud b/contrib/docker-compose.yml.daocloud new file mode 100644 index 000000000..e93fb42f1 --- /dev/null +++ b/contrib/docker-compose.yml.daocloud @@ -0,0 +1,68 @@ +version: '2' +services: + log: + image: daocloud.io/harbor/deploy_log:latest + volumes: + - /var/log/harbor/:/var/log/docker/ + ports: + - 1514:514 + registry: + image: daocloud.io/library/registry:2.3.0 + volumes: + - /data/registry:/storage + - ./config/registry/:/etc/registry/ + ports: + - 5001:5001 + command: + /etc/registry/config.yml + depends_on: + - log + logging: + driver: "syslog" + options: + syslog-address: "tcp://127.0.0.1:1514" + syslog-tag: "registry" + mysql: + image: daocloud.io/harbor/deploy_mysql:latest + volumes: + - /data/database:/var/lib/mysql + env_file: + - ./config/db/env + depends_on: + - log + logging: + driver: "syslog" + options: + syslog-address: "tcp://127.0.0.1:1514" + syslog-tag: "mysql" + ui: + image: daocloud.io/harbor/deploy_ui:latest + env_file: + - ./config/ui/env + volumes: + - ./config/ui/app.conf:/etc/ui/app.conf + - ./config/ui/private_key.pem:/etc/ui/private_key.pem + depends_on: + - log + logging: + driver: "syslog" + options: + syslog-address: "tcp://127.0.0.1:1514" + syslog-tag: "ui" + proxy: + image: daocloud.io/library/nginx:1.9 + volumes: + - ./config/nginx:/etc/nginx + ports: + - 80:80 + - 443:443 + depends_on: + - mysql + - registry + - ui + - log + logging: + driver: "syslog" + options: + syslog-address: "tcp://127.0.0.1:1514" + syslog-tag: "proxy" diff --git a/controllers/login.go b/controllers/login.go index f87c3dfc3..42d324f08 100644 --- a/controllers/login.go +++ b/controllers/login.go @@ -69,7 +69,7 @@ func (c *CommonController) Login() { // SwitchLanguage handles UI request to switch between different languages and re-render template based on language. func (c *CommonController) SwitchLanguage() { lang := c.GetString("lang") - if lang == "en-US" || lang == "zh-CN" { + if lang == "en-US" || lang == "zh-CN" || lang == "de-DE" { c.SetSession("lang", lang) c.Data["Lang"] = lang } diff --git a/dao/dao_test.go b/dao/dao_test.go index 67ccef833..da0ad6993 100644 --- a/dao/dao_test.go +++ b/dao/dao_test.go @@ -372,7 +372,7 @@ func TestAddProject(t *testing.T) { OwnerName: currentUser.Username, } - err := AddProject(project) + _, err := AddProject(project) if err != nil { t.Errorf("Error occurred in AddProject: %v", err) } diff --git a/dao/project.go b/dao/project.go index a0e6e6b25..9eba4f78e 100644 --- a/dao/project.go +++ b/dao/project.go @@ -29,41 +29,41 @@ import ( //TODO:transaction, return err // AddProject adds a project to the database along with project roles information and access log records. -func AddProject(project models.Project) error { +func AddProject(project models.Project) (int64, error) { if isIllegalLength(project.Name, 4, 30) { - return errors.New("project name is illegal in length. (greater than 4 or less than 30)") + return 0, errors.New("project name is illegal in length. (greater than 4 or less than 30)") } if isContainIllegalChar(project.Name, []string{"~", "-", "$", "\\", "[", "]", "{", "}", "(", ")", "&", "^", "%", "*", "<", ">", "\"", "'", "/", "?", "@"}) { - return errors.New("project name contains illegal characters") + return 0, errors.New("project name contains illegal characters") } o := orm.NewOrm() p, err := o.Raw("insert into project (owner_id, name, creation_time, update_time, deleted, public) values (?, ?, ?, ?, ?, ?)").Prepare() if err != nil { - return err + return 0, err } now := time.Now() r, err := p.Exec(project.OwnerID, project.Name, now, now, project.Deleted, project.Public) if err != nil { - return err + return 0, err } projectID, err := r.LastInsertId() if err != nil { - return err + return 0, err } if err = AddProjectMember(projectID, project.OwnerID, models.PROJECTADMIN); err != nil { - return err + return projectID, err } accessLog := models.AccessLog{UserID: project.OwnerID, ProjectID: projectID, RepoName: project.Name + "/", RepoTag: "N/A", GUID: "N/A", Operation: "create", OpTime: time.Now()} err = AddAccessLog(accessLog) - return err + return projectID, err } // IsProjectPublic ... diff --git a/docs/configure_swagger.md b/docs/configure_swagger.md index 5350975c2..80acee716 100644 --- a/docs/configure_swagger.md +++ b/docs/configure_swagger.md @@ -22,6 +22,10 @@ From time to time, you may need to mannually test Harbor REST API. You can deplo ```sh vi prepare-swagger.sh ``` +* Change the SCHEME to the protocol scheme of your Harbor server. +```sh + SCHEME= +``` * Change the SERVER_IP to the IP address of your Harbor server. ```sh SERVER_ID= diff --git a/docs/customize_token_service.md b/docs/customize_token_service.md new file mode 100644 index 000000000..ca358b2ae --- /dev/null +++ b/docs/customize_token_service.md @@ -0,0 +1,60 @@ +#Customize Harbor token service with your key and certificate + +Harbor requires Docker client to access the Harbor registry with a token. The procedure to generate a token is like [Docker Registry v2 authentication](https://github.com/docker/distribution/blob/master/docs/spec/auth/token.md). Firstly, you should make a request to the token service for a token. The token is signed by the private key. After that, you make a new request with the token to the Harbor registry, Harbor registry will verify the token with the public key in the rootcert bundle. Then Harbor registry will authorize the Docker client to push/pull images. + +By default, Harbor uses default private key and certificate in authentication. Also, you can customize your configuration with your own key and certificate with the following steps: + +1.If you already have a certificate, go to step 3. + +2.If not, you can generate a root certificate using openSSL with following commands: + +**1)Generate a private key:** + +```sh + $ openssl genrsa -out private_key.pem 4096 +``` + +**2)Generate a certificate:** +```sh + $ openssl req -new -x509 -key private_key.pem -out root.crt -days 3650 +``` +You are about to be asked to enter information that will be incorporated into your certificate request. +What you are about to enter is what is called a Distinguished Name or a DN. +There are quite a few fields but you can leave some blank +For some fields there will be a default value, +If you enter '.', the field will be left blank. Following are what you're asked to enter. + +Country Name (2 letter code) [AU]: + +State or Province Name (full name) [Some-State]: + +Locality Name (eg, city) []: + +Organization Name (eg, company) [Internet Widgits Pty Ltd]: + +Organizational Unit Name (eg, section) []: + +Common Name (eg, server FQDN or YOUR name) []: + +Email Address []: + +After you execute these two commands, you will see private_key.pem and root.crt in the **current directory**, just type "ls", you'll see them. + +3.Refer to [Installation Guide](https://github.com/vmware/harbor/blob/master/docs/installation_guide.md) to install Harbor, After you execute ./prepare, Harbor generates several config files. We need to replace the original private key and certificate with your own key and certificate. + +4.Replace the default key and certificate. Assume that you key and certificate are in the directory /root/cert, following are what you should do: + +``` +$ cd config/ui +$ cp /root/cert/private_key.pem private_key.pem +$ cp /root/cert/root.crt ../registry/root.crt +``` + +5.After these, go back to the Deploy directory, you can start Harbor using following command: +``` + $ docker-compose up -d +``` + +6.Then you can push/pull images to see if your own certificate works. Please refer [User Guide](https://github.com/vmware/harbor/blob/master/docs/user_guide.md) for more info. + + diff --git a/docs/image_pulling_chinese_user.md b/docs/image_pulling_chinese_user.md new file mode 100644 index 000000000..f16c7a4b7 --- /dev/null +++ b/docs/image_pulling_chinese_user.md @@ -0,0 +1,11 @@ +### A faster way to pull images for Chinese Harbor users +By default, Harbor not only build images according to Dockerfile but also pull images from Docker Hub. For the reason we all know, it is difficult for Chinese Harbor users to pull images from the Docker Hub. We put images on daocloud.io platform, we'll put images on other platforms later. If you have difficulty to pull images from Docker Hub, or you think it wastes too much time to build images. We recommend you to use the following way to accelerate the pulling procedure(make sure you're in the harbor diectory): +``` +$ cd contrib +$ cp docker-compose.yml.daocloud ../Deploy +$ cd ../Deploy +$ mv docker-compose.yml docker-compose.yml.bak +$ mv docker-compose.yml.daocloud docker-compose.yml +$ docker-compose up -d +``` +Then you'll see docker pulling imges faster than before. diff --git a/docs/prepare-swagger.sh b/docs/prepare-swagger.sh index f0fe84bc2..dee9b2e9b 100755 --- a/docs/prepare-swagger.sh +++ b/docs/prepare-swagger.sh @@ -1,5 +1,6 @@ #!/bin/bash -SERVER_IP=10.117.170.65 +SCHEME=http +SERVER_IP=reg.mydomain.com set -e echo "Doing some clean up..." rm -f *.tar.gz @@ -8,9 +9,10 @@ wget https://github.com/swagger-api/swagger-ui/archive/v2.1.4.tar.gz -O swagger. echo "Untarring Swagger UI package to the static file path..." tar -C ../static/vendors -zxf swagger.tar.gz swagger-ui-2.1.4/dist echo "Executing some processes..." -sed -i 's/http:\/\/petstore\.swagger\.io\/v2\/swagger\.json/http:\/\/'$SERVER_IP'\/static\/resources\/yaml\/swagger\.yaml/g' \ +sed -i 's/http:\/\/petstore\.swagger\.io\/v2\/swagger\.json/'$SCHEME':\/\/'$SERVER_IP'\/static\/resources\/yaml\/swagger\.yaml/g' \ ../static/vendors/swagger-ui-2.1.4/dist/index.html mkdir -p ../static/resources/yaml cp swagger.yaml ../static/resources/yaml sed -i 's/host: localhost/host: '$SERVER_IP'/g' ../static/resources/yaml/swagger.yaml +sed -i 's/ \- http$/ \- '$SCHEME'/g' ../static/resources/yaml/swagger.yaml echo "Finish preparation for the Swagger UI." diff --git a/static/i18n/locale_de-DE.ini b/static/i18n/locale_de-DE.ini new file mode 100644 index 000000000..67a926c72 --- /dev/null +++ b/static/i18n/locale_de-DE.ini @@ -0,0 +1,86 @@ +page_title_index = Harbor +page_title_sign_in = Anmelden - Harbor +page_title_project = Projekt - Harbor +page_title_item_details = Details - Harbor +page_title_registration = Registrieren - Harbor +page_title_add_user = Benutzer anlegen - Harbor +page_title_forgot_password = Passwort vergessen - Harbor +title_forgot_password = Passwort vergessen +page_title_reset_password = Passwort zurücksetzen - Harbor +title_reset_password = Passwort zurücksetzen +page_title_change_password = Passwort ändern - Harbor +title_change_password = Passwort ändern +page_title_search = Suche - Harbor +sign_in = Anmelden +sign_up = Registrieren +add_user = Benutzer anlegen +log_out = Abmelden +search_placeholder = Projekte oder Repositories +change_password = Passwort ändern +username_email = Benutzername/E-Mail +password = Passwort +forgot_password = Passwort vergessen +welcome = Willkommen +my_projects = Meine Projekte +public_projects = Öffentliche Projekte +admin_options = Admin Optionen +project_name = Projektname +creation_time = Erstellungsdatum +publicity = Öffentlich +add_project = Projekt hinzufügen +check_for_publicity = öffentliches Projekt +button_save = Speichern +button_cancel = Abbrechen +button_submit = Absenden +username = Benutzername +email = E-Mail +system_admin = System Admininistrator +dlg_button_ok = OK +dlg_button_cancel = Abbrechen +registration = Registrieren +username_description = Dies wird Ihr Benutzername sein. +email_description = Die E-Mail Adresse wird für das Zurücksetzen des Passworts genutzt. +full_name = Sollständiger Name +full_name_description = Vor- und Nachname. +password_description = Mindestens sieben Zeichen bestehend aus einem Kleinbuchstaben, einem Großbuchstaben und einer Zahl +confirm_password = Passwort bestätigen +note_to_the_admin = Kommentar +old_password = Altes Passwort +new_password = Neues Passwort +forgot_password_description = Bitte gebe die E-Mail Adresse ein, die du zur Registrierung verwendet hast. Ein Link zur Wiederherstellung wird dir per E-Mail an diese Adresse geschickt. + +projects = Projekte +repositories = Repositories +search = Suche +home = Home +project = Projekt +owner = Besitzer +repo = Repositories +user = Benutzer +logs = Logs +repo_name = Repository +add_members = Benutzer hinzufügen +operation = Aktion +advance = erweiterte Suche +all = Alle +others = Andere +start_date = Start Datum +end_date = End Datum +timestamp = Zeitstempel +role = Rolle +reset_email_hint = Bitte klicke auf diesen Link um dein Passwort zurückzusetzen +reset_email_subject = Passwort zurücksetzen +language = Deutsch +language_en-US = English +language_zh-CN = 中文 +language_de-DE = Deutsch +copyright = Copyright +all_rights_reserved = Alle Rechte vorbehalten. +index_desc = Project Harbor ist ein zuverlässiger Enterprise-Class Registry Server. Unternehmen können ihren eigenen Registry Server aufsetzen um die Produktivität und Sicherheit zu erhöhen. Project Harbor kann für Entwicklungs- wie auch Produktiv-Umgebungen genutzt werden. +index_desc_0 = Vorteile: +index_desc_1 = 1. Sicherheit: Halten Sie ihr geistiges Eigentum innerhalb der Organisation. +index_desc_2 = 2. Effizienz: Ein privater Registry Server innerhalb des Netzwerks ihrer Organisation kann den Traffic zu öffentlichen Services im Internet signifikant reduzieren. +index_desc_3 = 3. Zugriffskontrolle: RBAC (Role Based Access Control) wird zur Verfügung gestellt. Benutzerverwaltung kann mit bestehenden Identitätsservices wie AD/LDAP integriert werden. +index_desc_4 = 4. Audit: Jeglicher Zugriff auf die Registry wird protokolliert und kann für ein Audit verwendet werden. +index_desc_5 = 5. GUI: Benutzerfreundliche Verwaltung über eine einzige Management-Konsole +index_title = Ein Enterprise-Class Registry Server diff --git a/static/i18n/locale_en-US.ini b/static/i18n/locale_en-US.ini index e7999607d..30f7009e0 100644 --- a/static/i18n/locale_en-US.ini +++ b/static/i18n/locale_en-US.ini @@ -74,6 +74,7 @@ reset_email_subject = Reset your password language = English language_en-US = English language_zh-CN = 中文 +language_de-DE = Deutsch copyright = Copyright all_rights_reserved = All rights reserved. index_desc = Project Harbor is to build an enterprise-class, reliable registry server. Enterprises can set up a private registry server in their own environment to improve productivity as well as security. Project Harbor can be used in both development and production environment. diff --git a/static/i18n/locale_messages.js b/static/i18n/locale_messages.js index 93fdcaabb..d2eb902a4 100644 --- a/static/i18n/locale_messages.js +++ b/static/i18n/locale_messages.js @@ -15,254 +15,317 @@ var global_messages = { "username_is_required" : { "en-US": "Username is required.", - "zh-CN": "用户名为必填项。" + "zh-CN": "用户名为必填项。", + "de-DE": "Benutzername erforderlich." }, "username_has_been_taken" : { - "en-US": "Username has been taken.", - "zh-CN": "用户名已被占用。" + "en-US": "Username has been taken.", + "zh-CN": "用户名已被占用。", + "de-DE": "Benutzername bereits vergeben." }, "username_is_too_long" : { "en-US": "Username is too long. (maximum 20 characters)", - "zh-CN": "用户名长度超出限制。(最长为20个字符)" + "zh-CN": "用户名长度超出限制。(最长为20个字符)", + "de-DE": "Benutzername ist zu lang. (maximal 20 Zeichen)" }, "username_contains_illegal_chars": { "en-US": "Username contains illegal character(s).", - "zh-CN": "用户名包含不合法的字符。" + "zh-CN": "用户名包含不合法的字符。", + "de-DE": "Benutzername enthält ungültige Zeichen." }, "email_is_required" : { "en-US": "Email is required.", - "zh-CN": "邮箱为必填项。" + "zh-CN": "邮箱为必填项。", + "de-DE": "E-Mail Adresse erforderlich." }, "email_contains_illegal_chars" : { "en-US": "Email contains illegal character(s).", - "zh-CN": "邮箱包含不合法的字符。" + "zh-CN": "邮箱包含不合法的字符。", + "de-DE": "E-Mail Adresse enthält ungültige Zeichen." }, "email_has_been_taken" : { "en-US": "Email has been taken.", - "zh-CN": "邮箱已被占用。" + "zh-CN": "邮箱已被占用。", + "de-DE": "E-Mail Adresse wird bereits verwendet." }, "email_content_illegal" : { "en-US": "Email format is illegal.", - "zh-CN": "邮箱格式不合法。" + "zh-CN": "邮箱格式不合法。", + "de-DE": "Format der E-Mail Adresse ist ungültig." }, "email_does_not_exist" : { "en-US": "Email does not exist.", - "zh-CN": "邮箱不存在。" + "zh-CN": "邮箱不存在。", + "de-DE": "E-Mail Adresse existiert nicht." }, "realname_is_required" : { "en-US": "Full name is required.", - "zh-CN": "全名为必填项。" + "zh-CN": "全名为必填项。", + "de-DE": "Vollständiger Name erforderlich." }, "realname_is_too_long" : { "en-US": "Full name is too long. (maximum 20 characters)", - "zh-CN": "全名长度超出限制。(最长为20个字符)" + "zh-CN": "全名长度超出限制。(最长为20个字符)", + "de-DE": "Vollständiger Name zu lang. (maximal 20 Zeichen)" }, "realname_contains_illegal_chars" : { "en-US": "Full name contains illegal character(s).", - "zh-CN": "全名包含不合法的字符。" + "zh-CN": "全名包含不合法的字符。", + "de-DE": "Vollständiger Name enthält ungültige Zeichen." }, "password_is_required" : { "en-US": "Password is required.", - "zh-CN": "密码为必填项。" + "zh-CN": "密码为必填项。", + "de-DE": "Passwort erforderlich." }, "password_is_invalid" : { "en-US": "Password is invalid. At least 7 characters with 1 lowercase letter, 1 capital letter and 1 numeric character.", - "zh-CN": "密码无效。至少输入 7个字符且包含 1个小写字母,1个大写字母和 1个数字。" + "zh-CN": "密码无效。至少输入 7个字符且包含 1个小写字母,1个大写字母和 1个数字。", + "de-DE": "Passwort ungültig. Mindestens sieben Zeichen bestehend aus einem Kleinbuchstaben, einem Großbuchstaben und einer Zahl" }, "password_is_too_long" : { "en-US": "Password is too long. (maximum 20 characters)", - "zh-CN": "密码长度超出限制。(最长为20个字符)" + "zh-CN": "密码长度超出限制。(最长为20个字符)", + "de-DE": "Passwort zu lang. (maximal 20 Zeichen)" }, "password_does_not_match" : { "en-US": "Passwords do not match.", - "zh-CN": "两次密码输入不一致。" + "zh-CN": "两次密码输入不一致。", + "de-DE": "Passwörter stimmen nicht überein." }, "comment_is_too_long" : { "en-US": "Comment is too long. (maximum 20 characters)", - "zh-CN": "备注长度超出限制。(最长为20个字符)" + "zh-CN": "备注长度超出限制。(最长为20个字符)", + "de-DE": "Kommentar zu lang. (maximal 20 Zeichen)" }, "comment_contains_illegal_chars" : { "en-US": "Comment contains illegal character(s).", - "zh-CN": "备注包含不合法的字符。" + "zh-CN": "备注包含不合法的字符。", + "de-DE": "Kommentar enthält ungültige Zeichen." }, "project_name_is_required" : { "en-US": "Project name is required.", - "zh-CN": "项目名称为必填项。" + "zh-CN": "项目名称为必填项。", + "de-DE": "Projektname erforderlich." }, "project_name_is_too_short" : { "en-US": "Project name is too short. (minimum 4 characters)", - "zh-CN": "项目名称至少要求 4个字符。" + "zh-CN": "项目名称至少要求 4个字符。", + "de-DE": "Projektname zu kurz. (mindestens 4 Zeichen)" }, "project_name_is_too_long" : { "en-US": "Project name is too long. (maximum 30 characters)", - "zh-CN": "项目名称长度超出限制。(最长为30个字符)" + "zh-CN": "项目名称长度超出限制。(最长为30个字符)", + "de-DE": "Projektname zu lang. (maximal 30 Zeichen)" }, "project_name_contains_illegal_chars" : { "en-US": "Project name contains illegal character(s).", - "zh-CN": "项目名称包含不合法的字符。" + "zh-CN": "项目名称包含不合法的字符。", + "de-DE": "Projektname enthält ungültige Zeichen." }, "project_exists" : { "en-US": "Project exists.", - "zh-CN": "项目已存在。" + "zh-CN": "项目已存在。", + "de-DE": "Projekt existiert bereits." }, "delete_user" : { "en-US": "Delete User", - "zh-CN": "删除用户" + "zh-CN": "删除用户", + "de-DE": "Benutzer löschen" }, "are_you_sure_to_delete_user" : { "en-US": "Are you sure to delete ", - "zh-CN": "确认要删除用户 " + "zh-CN": "确认要删除用户 ", + "de-DE": "Sind Sie sich sicher, dass Sie folgenden Benutzer löschen möchten: " }, "input_your_username_and_password" : { "en-US": "Please input your username and password.", - "zh-CN": "请输入用户名和密码。" + "zh-CN": "请输入用户名和密码。", + "de-DE": "Bitte geben Sie ihr Benutzername und Passwort ein." }, "check_your_username_or_password" : { "en-US": "Please check your username or password.", - "zh-CN": "请输入正确的用户名或密码。" + "zh-CN": "请输入正确的用户名或密码。", + "de-DE": "Bitte überprüfen Sie ihren Benutzernamen und Passwort." }, "title_login_failed" : { "en-US": "Login Failed", - "zh-CN": "登录失败" + "zh-CN": "登录失败", + "de-DE": "Anmeldung fehlgeschlagen" }, "title_change_password" : { "en-US": "Change Password", - "zh-CN": "修改密码" + "zh-CN": "修改密码", + "de-DE": "Passwort ändern" }, "change_password_successfully" : { "en-US": "Password changed successfully.", - "zh-CN": "密码已修改。" + "zh-CN": "密码已修改。", + "de-DE": "Passwort erfolgreich geändert." }, "title_forgot_password" : { - "en-US": "Forgot Password", - "zh-CN": "忘记密码" + "en-US": "Forgot Password", + "zh-CN": "忘记密码", + "de-DE": "Passwort vergessen" }, "email_has_been_sent" : { "en-US": "Email for resetting password has been sent.", - "zh-CN": "重置密码邮件已发送。" + "zh-CN": "重置密码邮件已发送。", + "de-DE": "Eine E-Mail mit einem Wiederherstellungslink wurde an Sie gesendet." }, "send_email_failed" : { "en-US": "Failed to send Email for resetting password.", - "zh-CN": "重置密码邮件发送失败。" + "zh-CN": "重置密码邮件发送失败。", + "de-DE": "Fehler beim Senden der Wiederherstellungs-E-Mail." }, "please_login_first" : { "en-US": "Please login first.", - "zh-CN": "请先登录。" + "zh-CN": "请先登录。", + "de-DE": "Bitte melden Sie sich zuerst an." }, "old_password_is_not_correct" : { "en-US": "Old password is not correct.", - "zh-CN": "原密码输入不正确。" + "zh-CN": "原密码输入不正确。", + "de-DE": "Altes Passwort ist nicht korrekt." }, "please_input_new_password" : { "en-US": "Please input new password.", - "zh-CN": "请输入新密码。" + "zh-CN": "请输入新密码。", + "de-DE": "Bitte geben Sie ihr neues Passwort ein." }, "invalid_reset_url": { "en-US": "Invalid URL for resetting password.", - "zh-CN": "无效密码重置链接。" + "zh-CN": "无效密码重置链接。", + "de-DE": "Ungültige URL zum Passwort wiederherstellen." }, "reset_password_successfully" : { "en-US": "Reset password successfully.", - "zh-CN": "密码重置成功。" + "zh-CN": "密码重置成功。", + "de-DE": "Passwort erfolgreich wiederhergestellt." }, "internal_error": { "en-US": "Internal error.", - "zh-CN": "内部错误,请联系系统管理员。" + "zh-CN": "内部错误,请联系系统管理员。", + "de-DE": "Interner Fehler." }, "title_reset_password" : { "en-US": "Reset Password", - "zh-CN": "重置密码" + "zh-CN": "重置密码", + "de-DE": "Passwort zurücksetzen" }, "title_sign_up" : { "en-US": "Sign Up", - "zh-CN": "注册" + "zh-CN": "注册", + "de-DE": "Registrieren" }, "title_add_user": { - "en-US": "Add User", - "zh-CN": "新增用户" + "en-US": "Add User", + "zh-CN": "新增用户", + "de-DE": "Benutzer hinzufügen" }, "registered_successfully": { "en-US": "Signed up successfully.", - "zh-CN": "注册成功。" + "zh-CN": "注册成功。", + "de-DE": "Erfolgreich registriert." }, "registered_failed" : { "en-US": "Failed to sign up.", - "zh-CN": "注册失败。" + "zh-CN": "注册失败。", + "de-DE": "Registrierung fehlgeschlagen." }, "added_user_successfully": { - "en-US": "Added user successfully.", - "zh-CN": "新增用户成功。" + "en-US": "Added user successfully.", + "zh-CN": "新增用户成功。", + "de-DE": "Benutzer erfolgreich erstellt." }, "added_user_failed": { - "en-US": "Added user failed.", - "zh-CN": "新增用户失败。" + "en-US": "Adding user failed.", + "zh-CN": "新增用户失败。", + "de-DE": "Benutzer erstellen fehlgeschlagen." }, - "projects" : { + "projects": { "en-US": "Projects", - "zh-CN": "项目" + "zh-CN": "项目", + "de-DE": "Projekte" }, "repositories" : { "en-US": "Repositories", - "zh-CN": "镜像仓库" + "zh-CN": "镜像仓库", + "de-DE": "Repositories" }, - "no_repo_exists" :{ - "en-US": "No repositories found, please use 'docker push' to upload images.", - "zh-CN": "未发现镜像,请用‘docker push’命令上传镜像。" + "no_repo_exists" : { + "en-US": "No repositories found, please use 'docker push' to upload images.", + "zh-CN": "未发现镜像,请用‘docker push’命令上传镜像。", + "de-DE": "Keine Repositories gefunden, bitte benutzen Sie 'docker push' um ein Image hochzuladen." }, "tag" : { - "en-US": "Tag", - "zh-CN": "标签" + "en-US": "Tag", + "zh-CN": "标签", + "de-DE": "Tag" }, "pull_command": { "en-US": "Pull Command", - "zh-CN": "Pull 命令" + "zh-CN": "Pull 命令", + "de-DE": "Pull Befehl" }, "image_details" : { "en-US": "Image Details", - "zh-CN": "镜像详细信息" + "zh-CN": "镜像详细信息", + "de-DE": "Image Details" }, "add_members" : { "en-US": "Add Member", - "zh-CN": "添加成员" + "zh-CN": "添加成员", + "de-DE": "Mitglied hinzufügen" }, "edit_members" : { - "en-US": "Edit Member", - "zh-CN": "编辑成员" + "en-US": "Edit Members", + "zh-CN": "编辑成员", + "de-DE": "Mitglieder bearbeiten" }, "add_member_failed" : { "en-US": "Adding Member Failed", - "zh-CN": "添加成员失败" + "zh-CN": "添加成员失败", + "de-DE": "Mitglied hinzufügen fehlgeschlagen" }, "please_input_username" : { "en-US": "Please input a username.", - "zh-CN": "请输入用户名。" + "zh-CN": "请输入用户名。", + "de-DE": "Bitte geben Sie einen Benutzernamen ein." }, "please_assign_a_role_to_user" : { "en-US": "Please assign a role to the user.", - "zh-CN": "请为用户分配角色。" + "zh-CN": "请为用户分配角色。", + "de-DE": "Bitte weisen Sie dem Benutzer eine Rolle zu." }, "user_id_exists" : { "en-US": "User is already a member.", - "zh-CN": "用户已经是成员。" + "zh-CN": "用户已经是成员。", + "de-DE": "Benutzer ist bereits Mitglied." }, "user_id_does_not_exist" : { "en-US": "User does not exist.", - "zh-CN": "不存在此用户。" + "zh-CN": "不存在此用户。", + "de-DE": "Benutzer existiert nicht." }, "insufficient_privileges" : { "en-US": "Insufficient privileges.", - "zh-CN": "权限不足。" + "zh-CN": "权限不足。", + "de-DE": "Unzureichende Berechtigungen." }, "operation_failed" : { "en-US": "Operation Failed", - "zh-CN": "操作失败" + "zh-CN": "操作失败", + "de-DE": "Befehl fehlgeschlagen" }, "button_on" : { - "en-US": "On", - "zh-CN": "打开" + "en-US": "On", + "zh-CN": "打开", + "de-DE": "An" }, "button_off" : { - "en-US": "Off", - "zh-CN": "关闭" + "en-US": "Off", + "zh-CN": "关闭", + "de-DE": "Aus" } -}; \ No newline at end of file +}; diff --git a/static/i18n/locale_zh-CN.ini b/static/i18n/locale_zh-CN.ini index 3f3ef904b..7f92b463f 100644 --- a/static/i18n/locale_zh-CN.ini +++ b/static/i18n/locale_zh-CN.ini @@ -74,6 +74,7 @@ reset_email_subject = 重置您的密码 language = 中文 language_en-US = English language_zh-CN = 中文 +language_de-DE = Deutsch copyright = 版权所有 all_rights_reserved = 保留所有权利。 index_desc = Harbor是可靠的企业级Registry服务器。企业用户可使用Harbor搭建私有容器Registry服务,提高生产效率和安全度,既可应用于生产环境,也可以在开发环境中使用。 diff --git a/static/resources/js/common.js b/static/resources/js/common.js index 850d1b9ab..3b63c7f0f 100644 --- a/static/resources/js/common.js +++ b/static/resources/js/common.js @@ -68,7 +68,8 @@ AjaxUtil.prototype.exec = function(){ var SUPPORT_LANGUAGES = { "en-US": "English", - "zh-CN": "Chinese" + "zh-CN": "Chinese", + "de-DE": "German" }; var DEFAULT_LANGUAGE = "en-US"; @@ -157,4 +158,4 @@ jQuery(function(){ } $(self).modal('show'); } -}); \ No newline at end of file +}); diff --git a/static/resources/js/project.js b/static/resources/js/project.js index 69ab51a5f..97da2d6f9 100644 --- a/static/resources/js/project.js +++ b/static/resources/js/project.js @@ -161,8 +161,8 @@ jQuery(function(){ $("#tblUser tbody tr").remove(); $.each(data || [], function(i, e){ var row = '' + - '' + e.Username + '' + - '' + e.Email + ''; + '' + e.username + '' + + '' + e.email + ''; if(e.HasAdminRole == 1){ row += ''; } else { diff --git a/static/resources/js/register.js b/static/resources/js/register.js index 8f970946f..3fa2882b4 100644 --- a/static/resources/js/register.js +++ b/static/resources/js/register.js @@ -57,7 +57,7 @@ jQuery(function(){ }, complete: function(xhr, status){ $("#btnPageSignUp").prop("disabled", false); - if(xhr && xhr.status == 200){ + if(xhr && xhr.status == 201){ $("#dlgModal") .dialogModal({ "title": isAdmin == "true" ? i18n.getMessage("title_add_user") : i18n.getMessage("title_sign_up"), diff --git a/views/project.tpl b/views/project.tpl index af8ca3b96..fae2878d1 100644 --- a/views/project.tpl +++ b/views/project.tpl @@ -42,7 +42,7 @@ {{i18n .Lang "project_name"}} {{i18n .Lang "creation_time"}} - {{i18n .Lang "publicity"}} + {{i18n .Lang "publicity"}} @@ -65,9 +65,9 @@ - - - + + + diff --git a/views/segment/header-content.tpl b/views/segment/header-content.tpl index 6c88e0d25..464cd09aa 100644 --- a/views/segment/header-content.tpl +++ b/views/segment/header-content.tpl @@ -36,6 +36,7 @@ @@ -80,4 +81,4 @@ {{ end }} - \ No newline at end of file +
{{i18n .Lang "username"}}{{i18n .Lang "email"}}{{i18n .Lang "system_admin"}}{{i18n .Lang "username"}}{{i18n .Lang "email"}}{{i18n .Lang "system_admin"}}