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/ 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/app/components/container/container.html b/app/components/container/container.html index 63f9529b4..574e67aec 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..e9c6b3303 100644 --- a/app/components/container/containerController.js +++ b/app/components/container/containerController.js @@ -197,5 +197,42 @@ 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; + } + }); + networks.push({Name: 'bridge'}); + networks.push({Name: 'host'}); + networks.push({Name: 'none'}); + } + $scope.availableNetworks = networks; + if (!_.find(networks, {'Name': 'bridge'})) { + networks.push({Name: 'nat'}); + } + }, function (e) { + Notifications.error('Failure', e, 'Unable to retrieve networks'); + }); + update(); }]); 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/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/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 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/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. 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 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) { 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"