这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@edigaryev
Copy link
Collaborator

Might be helpful for debugging against a local Docker Registry and also for #131.

@edigaryev edigaryev requested a review from fkorotkov August 8, 2022 15:07
baseURLComponents.host = host
baseURLComponents.path = "/v2/"
let proto = insecure ? "http" : "https"
let baseURLComponents = URLComponents(string: proto + "://" + host + "/v2/")!
Copy link
Contributor

@fkorotkov fkorotkov Aug 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just assume that post might contain either https or http and do something like:

var baseURL = host + "/v2/"
if !baseURL.contains("://") {
  baseURL = "https://" + baseURL
}
let baseURLComponents = URLComponents(string: baseURL)!

Will it be properly parsed from the upstream invocations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd have to modify the OCI reference parser (RemoteName.swift) for this. And an OCI reference parser that accepts URLs and knows anything about protocol seems like a standard non-compliant thing that might bite us in the future.

It also seems weird once we allow https://ghcr.io/a/b syntax instead of ghcr.io/a/b, it might make someone think they can control the base URL, which this is not the case: the base URL will ignore /a/b, but will always include /v2/`.

@edigaryev edigaryev requested a review from fkorotkov August 12, 2022 05:23
@edigaryev edigaryev merged commit cc8201d into main Aug 12, 2022
@edigaryev edigaryev deleted the insecure-registries branch August 12, 2022 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants