Merge remote-tracking branch 'upstream/master'

This commit is contained in:
kunw 2016-07-11 22:32:50 +08:00
commit ed0535d15e
25 changed files with 66 additions and 87 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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;
}
});
}
}
})();
})();

View File

@ -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 @@
}
}
})();
})();

View File

@ -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 @@
}
}
})();
})();

View File

@ -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';
}

View File

@ -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;
}
}
}
}
})();
})();

View File

@ -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);

View File

@ -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 @@
}
}
})();
})();

View File

@ -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 @@
}
}
})();
})();

View File

@ -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 @@
}
})();
})();

View File

@ -77,7 +77,7 @@
'contentType': 'text/html',
'confirmOnly': false,
'action': vm.togglePolicy
}
};
$scope.$emit('raiseInfo', emitInfo);
}
@ -127,4 +127,4 @@
}
}
})();
})();

View File

@ -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;
}
})();
})();

View File

@ -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 @@
}
}
})();
})();

View File

@ -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 @@
}
}
})();
})();

View File

@ -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 @@
}
}
})();
})();

View File

@ -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 @@
}
}
})();
})();

View File

@ -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');

View File

@ -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 @@
}
}
})();
})();

View File

@ -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 @@
}
})();
})();

View File

@ -34,4 +34,4 @@
}
}
})()
})();

View File

@ -35,8 +35,8 @@
'description': policy.description,
'cron_str': policy.cronStr,
'start_time': policy.startTime
})
});
}
}
})();
})();

View File

@ -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() {
}
}
})