From 0332b39575eb3eb9899f0479ea5404f7a69fb786 Mon Sep 17 00:00:00 2001 From: Tan Jiang Date: Sun, 10 Jul 2016 18:54:08 +0800 Subject: [PATCH 1/4] syslog-tag to tag to work on docker1.12 --- Deploy/docker-compose.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Deploy/docker-compose.yml b/Deploy/docker-compose.yml index e6308669f..4a648b486 100644 --- a/Deploy/docker-compose.yml +++ b/Deploy/docker-compose.yml @@ -23,7 +23,7 @@ services: driver: "syslog" options: syslog-address: "tcp://127.0.0.1:1514" - syslog-tag: "registry" + tag: "registry" mysql: build: ./db/ volumes: @@ -36,7 +36,7 @@ services: driver: "syslog" options: syslog-address: "tcp://127.0.0.1:1514" - syslog-tag: "mysql" + tag: "mysql" ui: build: context: ../ @@ -54,7 +54,7 @@ services: driver: "syslog" options: syslog-address: "tcp://127.0.0.1:1514" - syslog-tag: "ui" + tag: "ui" jobservice: build: context: ../ @@ -70,7 +70,7 @@ services: driver: "syslog" options: syslog-address: "tcp://127.0.0.1:1514" - syslog-tag: "jobservice" + tag: "jobservice" proxy: image: library/nginx:1.9 volumes: @@ -87,4 +87,4 @@ services: driver: "syslog" options: syslog-address: "tcp://127.0.0.1:1514" - syslog-tag: "proxy" + tag: "proxy" From 5416a2b773921802500723d5a6cafbe8785f1749 Mon Sep 17 00:00:00 2001 From: Tan Jiang Date: Mon, 11 Jul 2016 01:42:41 +0800 Subject: [PATCH 2/4] update rsyslog config --- Deploy/log/rsyslog_docker.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Deploy/log/rsyslog_docker.conf b/Deploy/log/rsyslog_docker.conf index 4c417b054..ce565c705 100644 --- a/Deploy/log/rsyslog_docker.conf +++ b/Deploy/log/rsyslog_docker.conf @@ -3,5 +3,6 @@ template(name="DynaFile" type="string" string="/var/log/docker/%$now%/%syslogtag:R,ERE,0,DFLT:[^[]*--end:secpath-replace%.log" ) +#if $programname == "docker" then ?DynaFile +if $programname != "rsyslogd" then -?DynaFile -if $programname == "docker" then ?DynaFile \ No newline at end of file From cf0674eae72ea1af7acafa1ad1b7a92a61dd42c9 Mon Sep 17 00:00:00 2001 From: Tan Jiang Date: Mon, 11 Jul 2016 03:13:47 +0800 Subject: [PATCH 3/4] update installation guide to add infor for more attributes --- docs/installation_guide.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/installation_guide.md b/docs/installation_guide.md index 3edd8bbd9..602eb5c94 100644 --- a/docs/installation_guide.md +++ b/docs/installation_guide.md @@ -51,6 +51,9 @@ The parameters are described below - note that at the very least, you will need * **ldap_basedn**: The basedn template for verifying the user's credentials against LDAP (e.g. `uid=%s,ou=people,dc=mydomain,dc=com`). _Only used when **auth_mode** is set to *ldap_auth* ._ * **db_password**: The root password for the mySQL database used for **db_auth**. _Change this password for any production use!_ * **self_registration**: (**on** or **off**. Default is **on**) Enable / Disable the ability for a user to register themselves. When disabled, new users can only be created by the Admin user, only an admin user can create new users in Harbor. _NOTE: When **auth_mode** is set to **ldap_auth**, self-registration feature is **always** disabled, and this flag is ignored._ +* **max_job_workers**: The number of workers in job service, for image replication jobs, each worker will sync all tags of a repository to remote destination. The default number of works is **3**, when the number of works increase the load of job service will grow, please allocate more resource to job service if you want to set the number of workers to larger than 10. +* **verify_remote_cert**: (**on** or **off**. Default is **on**) This attribute controls whether or not to verify SSL/TLS certificate when Harbor tries to communicate with remote registry instances, for example, when replicating images. Setting this attribute to **off** will bypass the SSL/TLS verification. +* **customize_crt**: (**on** or **off**. Default is **on**) When this attribute is set to **on**, the prepare script will generate private key and root cert for the generation/verification of regitry's token. The following attributes:**crt_country**, **crt_state**, **crt_location**, **crt_organization**, **crt_organizationalunit**, **crt_commonname**, **crt_email** will be used as parameters for generating the keys. #### Configuring storage backend (optional) @@ -85,6 +88,11 @@ Once **harbord.cfg** and storage backend (optional) are configured, build and st Generated configuration file: ./config/ui/app.conf Generated configuration file: ./config/registry/config.yml Generated configuration file: ./config/db/env + Generated configuration file: ./config/jobservice/env + Clearing the configuration file: ./config/ui/private_key.pem + Clearing the configuration file: ./config/registry/root.crt + Generated configuration file: ./config/ui/private_key.pem + Generated configuration file: ./config/registry/root.crt The configuration files are ready, please use docker-compose to start the service. $ sudo docker-compose up -d @@ -125,6 +133,11 @@ Generated configuration file: ./config/ui/env Generated configuration file: ./config/ui/app.conf Generated configuration file: ./config/registry/config.yml Generated configuration file: ./config/db/env +Generated configuration file: ./config/jobservice/env +Clearing the configuration file: ./config/ui/private_key.pem +Clearing the configuration file: ./config/registry/root.crt +Generated configuration file: ./config/ui/private_key.pem +Generated configuration file: ./config/registry/root.crt The configuration files are ready, please use docker-compose to start the service. $ sudo docker-compose up -d From 7ededc7fe2d17e3cf7a77c1d765b85152c21db77 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 11 Jul 2016 18:38:51 +0800 Subject: [PATCH 4/4] modify for grunt checking --- .../dismissable-alerts.directive.js | 6 ++-- .../element-height.inspector.js | 10 +++--- .../modal-dialog/modal-dialog.directive.js | 6 ++-- .../add-project-member.directive.js | 2 +- .../project-member/project-member.config.js | 5 ++- .../project/add-project.directive.js | 4 +-- .../replication/create-policy.directive.js | 4 +-- .../replication/list-replication.directive.js | 9 ++--- .../repository/list-tag.directive.js | 4 +-- .../replication.directive.js | 4 +-- .../components/user-log/user-log.directive.js | 4 +-- .../components/user/toggle-admin.directive.js | 4 +-- .../validator/project-name.validator.js | 4 +-- static/resources/js/harbor.config.js | 4 +-- .../admin-option/admin-option.controller.js | 4 +-- .../change-password.controller.js | 2 +- .../js/layout/details/details.controller.js | 4 +-- .../js/layout/index/index.controller.js | 4 +-- .../services.create-destination.js | 2 +- .../destination/services.list-destination.js | 2 +- .../services.create-replication-policy.js | 4 +-- .../js/services/user/services.is-admin.js | 35 ------------------- 22 files changed, 46 insertions(+), 81 deletions(-) delete mode 100644 static/resources/js/services/user/services.is-admin.js diff --git a/static/resources/js/components/dismissable-alerts/dismissable-alerts.directive.js b/static/resources/js/components/dismissable-alerts/dismissable-alerts.directive.js index 9b94a1641..5e7fa533c 100644 --- a/static/resources/js/components/dismissable-alerts/dismissable-alerts.directive.js +++ b/static/resources/js/components/dismissable-alerts/dismissable-alerts.directive.js @@ -31,18 +31,18 @@ scope.close = function() { scope.toggleAlert = false; - } + }; scope.$on('raiseAlert', function(e, val) { console.log('received raiseAlert:' + angular.toJson(val)); if(val.show) { scope.message = val.message; scope.toggleAlert = true; }else{ - scope.message = '' + scope.message = ''; scope.toggleAlert = false; } }); } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/element-height/element-height.inspector.js b/static/resources/js/components/element-height/element-height.inspector.js index 769f2f068..40d638adf 100644 --- a/static/resources/js/components/element-height/element-height.inspector.js +++ b/static/resources/js/components/element-height/element-height.inspector.js @@ -36,10 +36,10 @@ return {'h' : w.height()}; }; - if(!angular.isDefined(scope.subsHeight)) scope.subsHeight = 110; - if(!angular.isDefined(scope.subsSection)) scope.subsSection = 32; - if(!angular.isDefined(scope.subsSubPane)) scope.subsSubPane = 226; - if(!angular.isDefined(scope.subsTblBody)) scope.subsTblBody = 40; + if(!angular.isDefined(scope.subsHeight)) {scope.subsHeight = 110;} + if(!angular.isDefined(scope.subsSection)) {scope.subsSection = 32;} + if(!angular.isDefined(scope.subsSubPane)) {scope.subsSubPane = 226;} + if(!angular.isDefined(scope.subsTblBody)) {scope.subsTblBody = 40;} scope.$watch(scope.getDimension, function(current) { if(current) { @@ -59,4 +59,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/modal-dialog/modal-dialog.directive.js b/static/resources/js/components/modal-dialog/modal-dialog.directive.js index dc1722049..7557f5fe9 100644 --- a/static/resources/js/components/modal-dialog/modal-dialog.directive.js +++ b/static/resources/js/components/modal-dialog/modal-dialog.directive.js @@ -51,12 +51,12 @@ if(current) { ctrl.contentType = current; } - }) + }); scope.$watch('confirmOnly', function(current) { if(current) { ctrl.confirmOnly = current; } - }) + }); scope.$watch('vm.modalMessage', function(current) { if(current) { @@ -87,4 +87,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/project-member/add-project-member.directive.js b/static/resources/js/components/project-member/add-project-member.directive.js index 1f6251492..a872ba04b 100644 --- a/static/resources/js/components/project-member/add-project-member.directive.js +++ b/static/resources/js/components/project-member/add-project-member.directive.js @@ -71,7 +71,7 @@ vm.hasError = true; vm.errorMessage = 'failed_to_add_member'; } - if(status === 409 && pm.username != '') { + if(status === 409 && pm.username !== '') { vm.hasError = true; vm.errorMessage = 'username_already_exist'; } diff --git a/static/resources/js/components/project-member/project-member.config.js b/static/resources/js/components/project-member/project-member.config.js index a63acc2ad..9c0438e2e 100644 --- a/static/resources/js/components/project-member/project-member.config.js +++ b/static/resources/js/components/project-member/project-member.config.js @@ -38,11 +38,10 @@ for(var i = 0; i < r.length; i++) { var role = r[i]; - if(query.key === 'roleName' && role.roleName === query.value - || query.key === 'roleId' && role.id === String(query.value)) { + if(query.key === 'roleName' && role.roleName === query.value || query.key === 'roleId' && role.id === String(query.value)) { return role; } } } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/project/add-project.directive.js b/static/resources/js/components/project/add-project.directive.js index 226eff3ad..3ecf4ac60 100644 --- a/static/resources/js/components/project/add-project.directive.js +++ b/static/resources/js/components/project/add-project.directive.js @@ -55,13 +55,13 @@ function addProjectFailed(data, status) { vm.hasError = true; - if(status === 400 && vm0.projectName!= '' && vm0.projectName.length < 4) { + if(status === 400 && vm0.projectName !== '' && vm0.projectName.length < 4) { vm.errorMessage = 'project_name_is_too_short'; } if(status === 400 && vm0.projectName.length > 30) { vm.errorMessage = 'project_name_is_too_long'; } - if(status === 409 && vm0.projectName != '') { + if(status === 409 && vm0.projectName !== '') { vm.errorMessage = 'project_already_exist'; } console.log('Failed to add project:' + status); diff --git a/static/resources/js/components/replication/create-policy.directive.js b/static/resources/js/components/replication/create-policy.directive.js index e802b4f24..ae1e5c7bb 100644 --- a/static/resources/js/components/replication/create-policy.directive.js +++ b/static/resources/js/components/replication/create-policy.directive.js @@ -256,7 +256,7 @@ vm0.name = replicationPolicy.name; vm0.description = replicationPolicy.description; - vm0.enabled = (replicationPolicy.enabled == 1); + vm0.enabled = (replicationPolicy.enabled === 1); angular.forEach(vm.destinations, function(item) { if(item.id === vm.targetId) { @@ -431,4 +431,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/replication/list-replication.directive.js b/static/resources/js/components/replication/list-replication.directive.js index 28e8560ea..87151245e 100644 --- a/static/resources/js/components/replication/list-replication.directive.js +++ b/static/resources/js/components/replication/list-replication.directive.js @@ -34,7 +34,7 @@ {'key': 'finished', 'value':$filter('tr')('finished')}, {'key': 'canceled', 'value': $filter('tr')('canceled')} ]; - } + }; } ListReplicationController.$inject = ['$scope', 'getParameterByName', '$location', 'ListReplicationPolicyService', 'ToggleReplicationPolicyService', 'ListReplicationJobService', '$window', '$filter', 'trFilter', 'jobStatus']; @@ -134,6 +134,7 @@ case 'operation': case 'status': item[key] = $filter('tr')(value); + break; default: break; } @@ -143,7 +144,7 @@ $scope.$emit('raiseAlert', alertInfo); vm.searchJobTIP = false; vm.refreshJobTIP = false; - }searchReplicationJob + } function listReplicationJobFailed(data, status) { console.log('Failed to list replication job:' + data); @@ -186,7 +187,7 @@ 'contentType': 'text/html', 'confirmOnly': false, 'action': vm.togglePolicy - } + }; $scope.$emit('raiseInfo', emitInfo); } @@ -319,4 +320,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/repository/list-tag.directive.js b/static/resources/js/components/repository/list-tag.directive.js index c856512f5..fde155265 100644 --- a/static/resources/js/components/repository/list-tag.directive.js +++ b/static/resources/js/components/repository/list-tag.directive.js @@ -64,7 +64,7 @@ function getTagFailed(data) { $scope.$emit('modalTitle', $filter('tr')('error')); - $scope.$emit('modalMessage', $filter('tr')('failed_to_get_tag') + response); + $scope.$emit('modalMessage', $filter('tr')('failed_to_get_tag') + data); $scope.$emit('raiseError', true); console.log('Failed to get tag:' + data); } @@ -97,4 +97,4 @@ } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/system-management/replication.directive.js b/static/resources/js/components/system-management/replication.directive.js index a66da4e55..923bf85f1 100644 --- a/static/resources/js/components/system-management/replication.directive.js +++ b/static/resources/js/components/system-management/replication.directive.js @@ -77,7 +77,7 @@ 'contentType': 'text/html', 'confirmOnly': false, 'action': vm.togglePolicy - } + }; $scope.$emit('raiseInfo', emitInfo); } @@ -127,4 +127,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/user-log/user-log.directive.js b/static/resources/js/components/user-log/user-log.directive.js index b735b00ef..8869c7854 100644 --- a/static/resources/js/components/user-log/user-log.directive.js +++ b/static/resources/js/components/user-log/user-log.directive.js @@ -30,7 +30,7 @@ .error(listIntegratedLogFailed); function listIntegratedLogSuccess(data) { - vm.integratedLogs = data || [] + vm.integratedLogs = data || []; } function listIntegratedLogFailed(data, status) { @@ -54,4 +54,4 @@ return directive; } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/user/toggle-admin.directive.js b/static/resources/js/components/user/toggle-admin.directive.js index 09424b499..f4eb5e5b7 100644 --- a/static/resources/js/components/user/toggle-admin.directive.js +++ b/static/resources/js/components/user/toggle-admin.directive.js @@ -25,7 +25,7 @@ function ToggleAdminController($scope, ToggleAdminService, $filter, trFilter) { var vm = this; - vm.isAdmin = (vm.hasAdminRole == 1) ? true : false; + vm.isAdmin = (vm.hasAdminRole === 1) ? true : false; vm.enabled = vm.isAdmin ? 0 : 1; vm.toggle = toggle; @@ -77,4 +77,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/components/validator/project-name.validator.js b/static/resources/js/components/validator/project-name.validator.js index 3c36c5827..a2fcff132 100644 --- a/static/resources/js/components/validator/project-name.validator.js +++ b/static/resources/js/components/validator/project-name.validator.js @@ -20,7 +20,7 @@ .module('harbor.validator') .directive('projectName', projectName); - projectName.$inject = ['PROJECT_REGEXP'] + projectName.$inject = ['PROJECT_REGEXP']; function projectName(PROJECT_REGEXP) { var directive = { @@ -38,4 +38,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/harbor.config.js b/static/resources/js/harbor.config.js index 026a96fb2..95327b6cc 100644 --- a/static/resources/js/harbor.config.js +++ b/static/resources/js/harbor.config.js @@ -106,7 +106,7 @@ function filter(input, pattern) { var d = new Date(input || ''); - if(d.getTime() <= 0) return '-'; + if(d.getTime() <= 0) {return '-';} return moment(d).format(pattern); } } @@ -130,4 +130,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/layout/admin-option/admin-option.controller.js b/static/resources/js/layout/admin-option/admin-option.controller.js index f383407c3..2a362fa01 100644 --- a/static/resources/js/layout/admin-option/admin-option.controller.js +++ b/static/resources/js/layout/admin-option/admin-option.controller.js @@ -69,7 +69,7 @@ vm.action = function() { val.action(); $scope.$broadcast('showDialog', false); - } + }; vm.contentType = val.contentType; vm.confirmOnly = val.confirmOnly; @@ -91,4 +91,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/layout/change-password/change-password.controller.js b/static/resources/js/layout/change-password/change-password.controller.js index f3c4244af..457874f9e 100644 --- a/static/resources/js/layout/change-password/change-password.controller.js +++ b/static/resources/js/layout/change-password/change-password.controller.js @@ -95,7 +95,7 @@ var message; $scope.$emit('modalTitle', $filter('tr')('error')); console.log('Failed to change password:' + data); - if(data == 'old_password_is_not_correct') { + if(data === 'old_password_is_not_correct') { message = $filter('tr')('old_password_is_incorrect'); }else{ message = $filter('tr')('failed_to_change_password'); diff --git a/static/resources/js/layout/details/details.controller.js b/static/resources/js/layout/details/details.controller.js index c891c8e87..1cd8c355d 100644 --- a/static/resources/js/layout/details/details.controller.js +++ b/static/resources/js/layout/details/details.controller.js @@ -60,7 +60,7 @@ vm.action = function() { val.action(); $scope.$broadcast('showDialog', false); - } + }; vm.contentType = val.contentType; vm.confirmOnly = val.confirmOnly; @@ -73,4 +73,4 @@ } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/layout/index/index.controller.js b/static/resources/js/layout/index/index.controller.js index a0dc20eb5..ef483513e 100644 --- a/static/resources/js/layout/index/index.controller.js +++ b/static/resources/js/layout/index/index.controller.js @@ -92,7 +92,7 @@ vm.action = function() { val.action(); $scope.$broadcast('showDialog', false); - } + }; vm.contentType = val.contentType; vm.confirmOnly = val.confirmOnly; @@ -102,4 +102,4 @@ } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/services/destination/services.create-destination.js b/static/resources/js/services/destination/services.create-destination.js index 8a2c1f3ad..4104da3cc 100644 --- a/static/resources/js/services/destination/services.create-destination.js +++ b/static/resources/js/services/destination/services.create-destination.js @@ -35,4 +35,4 @@ } } -})() \ No newline at end of file +})(); diff --git a/static/resources/js/services/destination/services.list-destination.js b/static/resources/js/services/destination/services.list-destination.js index eb8a3f7c0..14ba9d9b8 100644 --- a/static/resources/js/services/destination/services.list-destination.js +++ b/static/resources/js/services/destination/services.list-destination.js @@ -34,4 +34,4 @@ } } -})() \ No newline at end of file +})(); diff --git a/static/resources/js/services/replication-policy/services.create-replication-policy.js b/static/resources/js/services/replication-policy/services.create-replication-policy.js index 96e7c1c77..40236c2cd 100644 --- a/static/resources/js/services/replication-policy/services.create-replication-policy.js +++ b/static/resources/js/services/replication-policy/services.create-replication-policy.js @@ -35,8 +35,8 @@ 'description': policy.description, 'cron_str': policy.cronStr, 'start_time': policy.startTime - }) + }); } } -})(); \ No newline at end of file +})(); diff --git a/static/resources/js/services/user/services.is-admin.js b/static/resources/js/services/user/services.is-admin.js deleted file mode 100644 index 8375f2f14..000000000 --- a/static/resources/js/services/user/services.is-admin.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (c) 2016 VMware, Inc. All Rights Reserved. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -(function() { - - 'use strict'; - - angular - .module('harbor.services.user') - .factory('IsAdminService', IsAdminService); - - IsAdminService.$inject = ['$http', '$log']; - - function IsAdminService($http, $log) { - - return IsAdmin; - - function IsAdmin() { - - } - - } - -}) \ No newline at end of file