Commit Graph

218 Commits

Author SHA1 Message Date
11159bae89 registry: handle unresolvable domain names in isSecure
to allow HTTP proxies to work as expected.

Fixes #9708

Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: ff4bfcc0e9f171a95dac5cc2650faacf73943057
Component: engine
2014-12-18 19:16:55 -05:00
3b8d2a3264 registry: add tests for unresolvable domain names in isSecure
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: a70d7aaf282948c6873c03031cee0704cbe86476
Component: engine
2014-12-18 19:16:55 -05:00
d6330f220b Chnage LookupRemoteImage to return error
This commit is patch for following comment
// TODO: This method should return the errors instead of masking them and returning false

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 8123c1e9fef0eb0d6b4e89dce4089276b751906c
Component: engine
2014-12-16 16:23:19 -08:00
24d7379326 validate image ID properly & before load
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>

Conflicts:
	graph/load.go
Upstream-commit: bff1d9dbce76bed1e267a067eb4a1a74ef4da312
Component: engine
2014-12-11 16:29:27 -05:00
807e0b468d Refactor put image function's redirect loop
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 9a7a1e5be01b829e64b32a8b0f1d260f0a2a45c3
Component: engine
2014-12-10 18:11:27 -08:00
e42acc43c3 Prevent loop with var overshadowing
Incase of a 3xx redirect the var was being overshowed and ever changed
causing an infinite loop.

Fixes #9480

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 3b4de1070fac41c400c22f200438c90823e7769d
Component: engine
2014-12-10 17:43:21 -08:00
c33d4c9307 registry: fix ServerAddress setting
This ensures that ServerAddress is set, while previously it was getting
set after configFile.Configs.

Signed-off-by: Vaidas Jablonskis <jablonskis@gmail.com>
Upstream-commit: d96832cbd2c62103944518866e1fc1219ce048d5
Component: engine
2014-11-24 18:26:41 +00:00
ea3d6b1b0d Add the possibility of specifying a subnet for --insecure-registry
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 6aba75db4e7b0151aeb48f450bb43e659ce0ec82
Component: engine
2014-11-14 12:31:11 -08:00
2e493e1f52 registry: parse INDEXSERVERADDRESS into a URL for easier check in isSecure
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: fbe10c83d81843412fd3485a8d6bb75849de97d4
Component: engine
2014-11-13 07:02:24 -08:00
fdd71c9652 Put mock registry address in insecureRegistries for unit tests
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 78e859f3c35d1f31e7d6f3ded9a414dc0fbb8eaa
Component: engine
2014-11-12 20:34:03 -06:00
166cb2e350 registry: refactor registry.IsSecure calls into registry.NewEndpoint
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 4455f517605f1fd7279bbe9547915f15c037997d
Component: engine
2014-11-12 20:34:03 -06:00
f8e94225af registry: always treat 127.0.0.1 as insecure for all cases anytime anywhere
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 11380a109e53bc5f388b6212c12794609c0241eb
Component: engine
2014-11-12 12:14:43 -08:00
dc8c6e365a registry: default --insecure-registry to localhost and 127.0.0.1
Signed-off-by: Johan Euphrosine <proppy@google.com>
Upstream-commit: 28ee373e19bbfdf47c747f6fd9385a8a75f0a483
Component: engine
2014-11-12 09:12:42 -08:00
a4433b9e0f Merge pull request #9095 from proppy/is-secure-test
registry: add tests for IsSecure
Upstream-commit: e08d1f6af2de6f0a402bd0e5c26fb5093fda378e
Component: engine
2014-11-11 16:52:36 -05:00
cc91da7978 registry: add tests for IsSecure
Signed-off-by: Johan Euphrosine <proppy@google.com>
Upstream-commit: 75e3b35bf15dd01363f8b422d6b8a4a62b1054c6
Component: engine
2014-11-11 11:02:32 -08:00
8b766a1400 registry: don't iterate through certs
the golang tls.Conn does a fine job of that.
http://golang.org/src/pkg/crypto/tls/handshake_client.go?#L334

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: a368e064a972ab75561ee50067a3168b9d8d277e
Component: engine
2014-11-04 16:12:23 -05:00
1b58e19e34 Fix login command
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 05c18a2434ab7bd68a86c87fe866bc7107ac1941
Component: engine
2014-10-30 19:44:44 -04:00
6d16ddef35 Do not verify certificate when using --insecure-registry on an HTTPS registry
Signed-off-by: Tibor Vass <teabee89@gmail.com>

Conflicts:
	registry/registry.go
	registry/registry_test.go
	registry/service.go
	registry/session.go

Conflicts:
	registry/endpoint.go
	registry/registry.go
Upstream-commit: 6a1ff022b0744213ed588d9c16dbb13ce055eda6
Component: engine
2014-10-30 19:44:09 -04:00
ff11c586b2 Don't hard code true for auth job
Signed-off-by: Michael Crosby <michael@docker.com>

Conflicts:
	registry/service.go
Upstream-commit: afade4236d3f15704653132c364d6e7ccc975f8b
Component: engine
2014-10-30 19:41:55 -04:00
2339e91d29 Refactor IsSecure change
Fix issue with restoring the tag store and setting static configuration
from the daemon. i.e. the field on the TagStore struct must be made
internal or the json.Unmarshal in restore will overwrite the insecure
registries to be an empty struct.

Signed-off-by: Michael Crosby <michael@docker.com>

Conflicts:
	graph/pull.go
	graph/push.go
	graph/tags.go
Upstream-commit: f29b2e48ebfb171f58375b6e355910fc2192aceb
Component: engine
2014-10-30 19:41:55 -04:00
6b54bde512 make http usage for registry explicit
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)

Conflicts:
	daemon/config.go
	daemon/daemon.go
	graph/pull.go
	graph/push.go
	graph/tags.go
	registry/registry.go
	registry/service.go
Upstream-commit: 380c8320a78dc16da65d9d13004422ac5a0cca53
Component: engine
2014-10-30 19:41:55 -04:00
6c8d4b4efb Merge pull request #8387 from vbatts/vbatts-registry_test_enpoint
registry/endpoint: make it testable
Upstream-commit: 265a89a605ad6cdbd6abb85804644f4fd3f30050
Component: engine
2014-10-29 13:36:17 -07:00
2bfa151ffc Merge pull request #8669 from monsterzz/8668-dualstack-registry
Use dual-stack Dialer when talking to registy
Upstream-commit: 565340c90c2e3402369224450807a047481d9efa
Component: engine
2014-10-29 12:03:12 -07:00
fbef49310d Fix error on successful login.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 35703d4f0c79e936bbff1804167ae9e8dde9b76c
Component: engine
2014-10-28 17:42:03 -07:00
5db49e8c8b excluding unused transformation to []byte
Signed-off-by: Igor Dolzhikov <bluesriverz@gmail.com>
Upstream-commit: b65eb8d215576516b1d4bbb537968f08bbc8ff0e
Component: engine
2014-10-28 01:04:36 +06:00
bad39206ea Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: ee7dd44c017458c8fe0be8e09569b1238366dca3
Component: engine
2014-10-24 15:11:48 -07:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07:00
5224a151c8 registry/endpoint: make it testable
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 3eba719400d5016aa0cbecbed1e222f810237b5b
Component: engine
2014-10-24 16:27:17 -04:00
d1d44d2d21 Merge pull request #8423 from unclejack/lint_changes
lint changes part 1
Upstream-commit: 9df3e45ba985a6ed7e9a07b308d56d694d1c13ad
Component: engine
2014-10-21 12:15:58 -04:00
db8dd3c6e0 Use dual-stack Dialer when talking to registy
Signed-off-by: Gleb M. Borisov <borisov.gleb@gmail.com>
Upstream-commit: fdd2abe7b34f15fbe5ec64309e9d700ba2e66e65
Component: engine
2014-10-21 03:59:11 +04:00
87dffd42be On Red Hat Registry Servers we return 404 on certification errors.
We do this to prevent leakage of information, we don't want people
to be able to probe for existing content.

According to RFC 2616, "This status code (404) is commonly used when the server does not
wish to reveal exactly why the request has been refused, or when no other response i
is applicable."

https://www.ietf.org/rfc/rfc2616.txt

10.4.4 403 Forbidden

   The server understood the request, but is refusing to fulfill it.
   Authorization will not help and the request SHOULD NOT be repeated.
   If the request method was not HEAD and the server wishes to make
   public why the request has not been fulfilled, it SHOULD describe the
   reason for the refusal in the entity.  If the server does not wish to
   make this information available to the client, the status code 404
   (Not Found) can be used instead.

10.4.5 404 Not Found

   The server has not found anything matching the Request-URI. No
   indication is given of whether the condition is temporary or
   permanent. The 410 (Gone) status code SHOULD be used if the server
   knows, through some internally configurable mechanism, that an old
   resource is permanently unavailable and has no forwarding address.
   This status code is commonly used when the server does not wish to
   reveal exactly why the request has been refused, or when no other
   response is applicable.

When docker is running through its certificates, it should continue
trying with a new certificate even if it gets back a 404 error code.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 69fe3e1a3493e53acb2da7220764bd3807415ea2
Component: engine
2014-10-20 13:20:48 -04:00
8091e3851f Avoid fallback to SSL protocols < TLS1.0
Signed-off-by: Tibor Vass <teabee89@gmail.com>

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: 7a062b2b8f7751fbb926e6ddc9f7df8a1b281eb6
Component: engine
2014-10-15 22:39:51 -04:00
0ae83cbb52 Support tarsum dev version to fix issue with mtime
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 73a9089306ac1ed25c594e54c9b2a11a0ac8e610
Component: engine
2014-10-10 16:04:29 -07:00
5ab2b8482f Update manifest format to rename blobsums and use arrays of dictionaries
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 15d5c7f10f56faeaa04f6374341e1cfd3e03cab1
Component: engine
2014-10-10 16:04:29 -07:00
045011f555 Use direct registry url
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: a152f37674df3f2a31e60cbfb764fa348333e805
Component: engine
2014-10-10 16:04:28 -07:00
3baf5d2249 registry: lint
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: ae3b59c1715840ba322fbe19002994e717b10b48
Component: engine
2014-10-06 22:34:39 +03:00
1510f709b8 Add comment for permission and fix wrong format variable
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 22e59009e491dc8b32b512e0d2297662d278af45
Component: engine
2014-10-02 17:41:57 -07:00
4d78f5d6d8 Add provenance pull flow for official images
Add support for pulling signed images from a version 2 registry.
Only official images within the library namespace will be pull from the
new registry and check the build signature.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 7c88e8f13d9f0c68de6da0cd467a541231304dd5
Component: engine
2014-10-01 18:26:06 -07:00
082c35423e registry: getting Endpoint ironned out
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 61c6f206b073159c5463a083e0d04e5934351dfe
Component: engine
2014-10-01 13:19:40 -07:00
8a28fc553b Replace get.docker.io -> get.docker.com and test.docker.io -> test.docker.com
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 808257654a4147ad9b54cfeddc5d0ad236c26e3f
Component: engine
2014-09-24 18:53:27 -04:00
b4607092ee Refactor all pre-compiled regexp to package level vars
Addresses #8057

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 4119c9d7d955757092adc3410da8d75f972bd3c1
Component: engine
2014-09-16 12:57:44 -04:00
5f275ccb1b TarSum: versioning
This introduces Versions for TarSum checksums.
Fixes: https://github.com/docker/docker/issues/7526

It preserves current functionality and abstracts the interface for
future flexibility of hashing algorithms. As a POC, the VersionDev
Tarsum does not include the mtime in the checksum calculation, and would
solve https://github.com/docker/docker/issues/7387 though this is not a
settled Version is subject to change until a version number is assigned.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 747f89cd327db9d50251b17797c4d825162226d0
Component: engine
2014-09-10 15:41:52 -04:00
0ece639e47 Merge pull request #7862 from Gandi/bugfixes/segfault-registry-session
Fix SEGFAULT if dns resolv error
Upstream-commit: 7bb5ec3be6f3f52cd1aa65e4be20a6d6526a1d3a
Component: engine
2014-09-08 11:38:34 -07:00
6dc15f86be Merge pull request #7609 from ewindisch/max_imgname
Restrict length of repository names
Upstream-commit: 18edea2a6f5b01e38e3189dbec54566ad4a67f4f
Component: engine
2014-09-08 11:06:54 -07:00
64908e2dd5 Fix SEGFAULT if dns resolv error
Per registry.doRequest, res and client might be nil in case of error
For example, dns resolution errors, /etc/docker/certs.d perms, failed
loading of x509 cert ...
This will make res.StatusCode and res.Body SEGFAULT.

Signed-off-by: Arthur Gautier <baloo@gandi.net>
Upstream-commit: 3e6c69e5a1dbb428c4a62656f96cfe77c19986f9
Component: engine
2014-09-05 13:40:06 +02:00
e62472c6f3 registry/session: fix panic in GetRemoteImageLayer
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 9c413e3e6f1c6bd6abada707c442862049d29743
Component: engine
2014-09-03 17:26:56 +03:00
94a36f4c63 Restrict repository names from matching hexadecimal strings
To avoid conflicting with layer IDs, repository names must
not be tagged with names that collide with hexadecimal strings.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 0bd1c05e5c36799e0740a155092be0c9c417f175
Component: engine
2014-08-27 13:46:10 -04:00
0f8e8a7de5 Merge pull request #7740 from LK4D4/registry_style
Style fixes for registry/registry.go
Upstream-commit: 1385b2d2935c0d20e6406a80c62615a8c4cdbcc9
Component: engine
2014-08-26 18:02:11 -07:00
b5fb241c16 Style fixes for registry/registry.go
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 45a2923874a9b1f70674e627d0d112851d5982a8
Component: engine
2014-08-26 12:28:40 +04:00
579f334a23 fix return values in registry mock service
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: e81b68692408ef717c2228986cc74102cae55772
Component: engine
2014-08-25 10:29:38 -07:00