From b57bfe3eee4c1dce4aa62aac05560311ad32fa8b Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 22 Jun 2017 05:11:40 +0200 Subject: [PATCH 1/8] Create CODE_OF_CONDUCT.md (#946) --- CODE_OF_CONDUCT.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..84ad8935f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at anthony.lapenna@portainer.io. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ From 1168e945343d413a36492621f090bb9b61e7aef6 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 29 Jun 2017 07:41:37 +0200 Subject: [PATCH 2/8] fix(service-creation): fix an issue when selecting a volume from available volumes (#963) --- app/components/createService/createservice.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/createService/createservice.html b/app/components/createService/createservice.html index 358f8a7c2..3f2f03016 100644 --- a/app/components/createService/createservice.html +++ b/app/components/createService/createservice.html @@ -242,7 +242,7 @@ volume From 4adedf943606e70167afac09d7f3e996733d2d23 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 29 Jun 2017 08:37:05 +0200 Subject: [PATCH 3/8] fix(service-details): fix an issue where secret target would be overwritten (#964) --- app/components/createService/createServiceController.js | 4 +++- app/helpers/secretHelper.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/components/createService/createServiceController.js b/app/components/createService/createServiceController.js index ca5b9f7dd..9a29f315d 100644 --- a/app/components/createService/createServiceController.js +++ b/app/components/createService/createServiceController.js @@ -222,7 +222,9 @@ function ($q, $scope, $state, Service, ServiceHelper, SecretHelper, SecretServic var secrets = []; angular.forEach(input.Secrets, function(secret) { if (secret.model) { - secrets.push(SecretHelper.secretConfig(secret.model)); + var s = SecretHelper.secretConfig(secret.model); + s.File.Name = s.SecretName; + secrets.push(s); } }); config.TaskTemplate.ContainerSpec.Secrets = secrets; diff --git a/app/helpers/secretHelper.js b/app/helpers/secretHelper.js index ff84aaef5..9c0f3d65b 100644 --- a/app/helpers/secretHelper.js +++ b/app/helpers/secretHelper.js @@ -21,7 +21,7 @@ angular.module('portainer.helpers') SecretID: secret.Id, SecretName: secret.Name, File: { - Name: secret.Name, + Name: secret.FileName, UID: '0', GID: '0', Mode: 444 From a161d25d481c29cb83adae01efa43f984c20bbec Mon Sep 17 00:00:00 2001 From: Adam Snodgrass Date: Thu, 29 Jun 2017 08:49:35 -0500 Subject: [PATCH 4/8] feat(container-details): add section to join networks (#927) --- app/components/container/container.html | 16 ++++++++ .../container/containerController.js | 39 +++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/app/components/container/container.html b/app/components/container/container.html index 63f9529b4..e696fde8d 100644 --- a/app/components/container/container.html +++ b/app/components/container/container.html @@ -290,6 +290,22 @@
+
+
+ +
+ +
+ +
+
+ +
+
+
diff --git a/app/components/container/containerController.js b/app/components/container/containerController.js index 2bed294ff..183bb9fa8 100644 --- a/app/components/container/containerController.js +++ b/app/components/container/containerController.js @@ -197,5 +197,44 @@ function ($scope, $state, $stateParams, $filter, Container, ContainerCommit, Con }); }; + $scope.containerJoinNetwork = function containerJoinNetwork(container, networkId) { + $('#joinNetworkSpinner').show(); + Network.connect({id: networkId}, { Container: $stateParams.id }, function (d) { + if (container.message) { + $('#joinNetworkSpinner').hide(); + Notifications.error('Error', d, 'Unable to connect container to network'); + } else { + $('#joinNetworkSpinner').hide(); + Notifications.success('Container joined network', $stateParams.id); + $state.go('container', {id: $stateParams.id}, {reload: true}); + } + }, function (e) { + $('#joinNetworkSpinner').hide(); + Notifications.error('Failure', e, 'Unable to connect container to network'); + }); + }; + + Network.query({}, function (d) { + var networks = d; + if ($scope.applicationState.endpoint.mode.provider === 'DOCKER_SWARM' || $scope.applicationState.endpoint.mode.provider === 'DOCKER_SWARM_MODE') { + networks = d.filter(function (network) { + if (network.Scope === 'global') { + return network; + } + }); + $scope.globalNetworkCount = networks.length; + networks.push({Name: 'bridge'}); + networks.push({Name: 'host'}); + networks.push({Name: 'none'}); + } + networks.push({Name: 'container'}); + $scope.availableNetworks = networks; + if (!_.find(networks, {'Name': 'bridge'})) { + $scope.config.HostConfig.NetworkMode = 'nat'; + } + }, function (e) { + Notifications.error('Failure', e, 'Unable to retrieve networks'); + }); + update(); }]); From 6609c2e92844232f34c1a6fbfa6c45b2c02578f5 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 29 Jun 2017 16:04:49 +0200 Subject: [PATCH 5/8] style(container-details): review responsiveness for the join network section --- app/components/container/container.html | 6 +++--- app/components/container/containerController.js | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/components/container/container.html b/app/components/container/container.html index e696fde8d..574e67aec 100644 --- a/app/components/container/container.html +++ b/app/components/container/container.html @@ -294,14 +294,14 @@
- -
+ +
-
+
diff --git a/app/components/container/containerController.js b/app/components/container/containerController.js index 183bb9fa8..e9c6b3303 100644 --- a/app/components/container/containerController.js +++ b/app/components/container/containerController.js @@ -222,15 +222,13 @@ function ($scope, $state, $stateParams, $filter, Container, ContainerCommit, Con return network; } }); - $scope.globalNetworkCount = networks.length; networks.push({Name: 'bridge'}); networks.push({Name: 'host'}); networks.push({Name: 'none'}); } - networks.push({Name: 'container'}); $scope.availableNetworks = networks; if (!_.find(networks, {'Name': 'bridge'})) { - $scope.config.HostConfig.NetworkMode = 'nat'; + networks.push({Name: 'nat'}); } }, function (e) { Notifications.error('Failure', e, 'Unable to retrieve networks'); From 6d401dcd5904cab671f87bd0b62d621f00835f41 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 29 Jun 2017 16:05:39 +0200 Subject: [PATCH 6/8] fix(templates): fix the ability to pull an image within an offline environment (#961) --- .../createContainerController.js | 2 +- app/components/image/imageController.js | 2 +- app/components/images/imagesController.js | 2 +- .../templates/templatesController.js | 2 +- app/services/docker/imageService.js | 29 +++++++++++++++---- 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/app/components/createContainer/createContainerController.js b/app/components/createContainer/createContainerController.js index 77cefd4ac..b578a8bc0 100644 --- a/app/components/createContainer/createContainerController.js +++ b/app/components/createContainer/createContainerController.js @@ -299,7 +299,7 @@ function ($q, $scope, $state, $stateParams, $filter, Container, ContainerHelper, }; function createContainer(config, accessControlData) { - $q.when(!$scope.formValues.alwaysPull || ImageService.pullImage($scope.config.Image, $scope.formValues.Registry)) + $q.when(!$scope.formValues.alwaysPull || ImageService.pullImage($scope.config.Image, $scope.formValues.Registry, true)) .finally(function final() { ContainerService.createAndStartContainer(config) .then(function success(data) { diff --git a/app/components/image/imageController.js b/app/components/image/imageController.js index 5b8825bf4..fa2925b07 100644 --- a/app/components/image/imageController.js +++ b/app/components/image/imageController.js @@ -47,7 +47,7 @@ function ($scope, $stateParams, $state, $timeout, ImageService, RegistryService, RegistryService.retrieveRegistryFromRepository(repository) .then(function success(data) { var registry = data; - return ImageService.pullImage(repository, registry); + return ImageService.pullImage(repository, registry, false); }) .then(function success(data) { Notifications.success('Image successfully pulled', repository); diff --git a/app/components/images/imagesController.js b/app/components/images/imagesController.js index 6a1c56335..feb0f89ee 100644 --- a/app/components/images/imagesController.js +++ b/app/components/images/imagesController.js @@ -42,7 +42,7 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService) $('#pullImageSpinner').show(); var image = $scope.formValues.Image; var registry = $scope.formValues.Registry; - ImageService.pullImage(image, registry) + ImageService.pullImage(image, registry, false) .then(function success(data) { Notifications.success('Image successfully pulled', image); $state.reload(); diff --git a/app/components/templates/templatesController.js b/app/components/templates/templatesController.js index b64eba6a4..e4ab1f384 100644 --- a/app/components/templates/templatesController.js +++ b/app/components/templates/templatesController.js @@ -69,7 +69,7 @@ function ($scope, $q, $state, $stateParams, $anchorScroll, $filter, ContainerSer generatedVolumeIds.push(volumeId); }); TemplateService.updateContainerConfigurationWithVolumes(templateConfiguration, template, data); - return ImageService.pullImage(template.Image, template.Registry); + return ImageService.pullImage(template.Image, { URL: template.Registry }, true); }) .then(function success(data) { return ContainerService.createAndStartContainer(templateConfiguration); diff --git a/app/services/docker/imageService.js b/app/services/docker/imageService.js index 415125f07..c3dbebb1e 100644 --- a/app/services/docker/imageService.js +++ b/app/services/docker/imageService.js @@ -54,14 +54,19 @@ angular.module('portainer.services') return deferred.promise; }; - - service.pullImage = function(image, registry) { + function pullImageAndIgnoreErrors(imageConfiguration) { var deferred = $q.defer(); - var imageDetails = ImageHelper.extractImageAndRegistryFromRepository(image); - var imageConfiguration = ImageHelper.createImageConfigForContainer(imageDetails.image, registry.URL); - var authenticationDetails = registry.Authentication ? RegistryService.encodedCredentials(registry) : ''; - HttpRequestHelper.setRegistryAuthenticationHeader(authenticationDetails); + Image.create({}, imageConfiguration).$promise + .finally(function final() { + deferred.resolve(); + }); + + return deferred.promise; + } + + function pullImageAndAcknowledgeErrors(imageConfiguration) { + var deferred = $q.defer(); Image.create({}, imageConfiguration).$promise .then(function success(data) { @@ -78,6 +83,18 @@ angular.module('portainer.services') }); return deferred.promise; + } + + service.pullImage = function(image, registry, ignoreErrors) { + var imageDetails = ImageHelper.extractImageAndRegistryFromRepository(image); + var imageConfiguration = ImageHelper.createImageConfigForContainer(imageDetails.image, registry.URL); + var authenticationDetails = registry.Authentication ? RegistryService.encodedCredentials(registry) : ''; + HttpRequestHelper.setRegistryAuthenticationHeader(authenticationDetails); + + if (ignoreErrors) { + return pullImageAndIgnoreErrors(imageConfiguration); + } + return pullImageAndAcknowledgeErrors(imageConfiguration); }; service.tagImage = function(id, image, registry) { From e47db0b8c96e1aa3066cbd556266a9b3367d406b Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 29 Jun 2017 16:14:17 +0200 Subject: [PATCH 7/8] feat(volumes): display mount point for each volume (#967) --- app/components/volumes/volumes.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/components/volumes/volumes.html b/app/components/volumes/volumes.html index 92b318b16..c94862633 100644 --- a/app/components/volumes/volumes.html +++ b/app/components/volumes/volumes.html @@ -53,6 +53,13 @@ + + + Mount point + + + + Ownership @@ -65,8 +72,9 @@ - {{ volume.Id|truncate:50 }} + {{ volume.Id|truncate:25 }} {{ volume.Driver }} + {{ volume.Mountpoint | truncate:52 }} @@ -75,10 +83,10 @@ - Loading... + Loading... - No volumes available. + No volumes available. From 0e0764eff83747ea6a9bf093978a63683af90be7 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 29 Jun 2017 16:37:22 +0200 Subject: [PATCH 8/8] chore(version): bump version number --- api/portainer.go | 2 +- bower.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/portainer.go b/api/portainer.go index 3bb862c98..fad8e5168 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -305,7 +305,7 @@ type ( const ( // APIVersion is the version number of the Portainer API. - APIVersion = "1.13.3" + APIVersion = "1.13.4" // DBVersion is the version number of the Portainer database. DBVersion = 2 // DefaultTemplatesURL represents the default URL for the templates definitions. diff --git a/bower.json b/bower.json index c4563ea27..3c5b32df4 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "portainer", - "version": "1.13.3", + "version": "1.13.4", "homepage": "https://github.com/portainer/portainer", "authors": [ "Anthony Lapenna " diff --git a/package.json b/package.json index 206efa37e..a1bfab28d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Portainer.io", "name": "portainer", "homepage": "http://portainer.io", - "version": "1.13.3", + "version": "1.13.4", "repository": { "type": "git", "url": "git@github.com:portainer/portainer.git"