Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Set a unique user-agent for skopeo #1109

Closed
jonjohnsonjr opened this issue Nov 16, 2020 · 5 comments · Fixed by #1159
Closed

[feature request] Set a unique user-agent for skopeo #1109

jonjohnsonjr opened this issue Nov 16, 2020 · 5 comments · Fixed by #1159

Comments

@jonjohnsonjr
Copy link
Contributor

I did some quick grepping around and don't see any skopeo-specific user-agent being set, which makes debugging things from the registry side a bit challenging.

@vrothberg
Copy link
Member

Thanks for the request, @jonjohnsonjr.

@rhatdan @mtrmac WDYT?

@mtrmac
Copy link
Contributor

mtrmac commented Nov 17, 2020

Alternatively, should c/image have a default User-Agent value? Podman and Buildah set a value, but it’s unclear that the registry cares about the difference.

(OTOH I vaguely remember that at one time we have traced back a behavior difference between Podman and Skopeo down to User-Agent, and I can’t remember which one worked; so it might not be safe enough to default to an User-Agent value — or maybe that case was sufficiently obscure that we shouldn’t need to care; I can’t remember the details and I can’t search for them today.)

@jonjohnsonjr
Copy link
Contributor Author

Alternatively, should c/image have a default User-Agent value?

I'd be fine with that as well, especially if some version information is included. Mostly I'm looking for a way to reproduce issues and determine how many users are affected by said issues.

Some kind of containers/image UA by default like containers-image/5.8.0 (or whatever string) would work just as well.

skopeo could supply its own to produce skopeo/1.2.0 containers-image/5.8.0 (not sure if this conforms to the grammar), which would save a little bit of time correlating versions across projects, but honestly I'd be fine with just skopeo/1.2.0 as well!

I can’t remember the details and I can’t search for them today.

containers/podman#1792 might be what you're thinking of? Looks like it's fixed. That kind of user-agent sniffing is super brittle and I'd argue any registries doing this are broken :)

@mtrmac
Copy link
Contributor

mtrmac commented Nov 24, 2020

I was actually thinking of containers/podman#4254 (comment) , which is at least per the issue ~unresolved , though the other one is also relevant (as is, to an extent, containers/podman#3788 “Our setup uses a nginx reverse proxy that only forwards requests to https://repo:443/... if the User-Agent string matches the pattern docker,” — but we really can’t support arbitrary user-agent-restrictive configurations, so that one is moot).


Anyway, yes, I think this should happen, and the syntax you suggest does seem to be valid per RFC 7231 section 5.5.3 . c/image will probably need a new DockerRegistryPartialUserAgent or something like that, rather than changing the semantics of the existing field.

@jonjohnsonjr
Copy link
Contributor Author

if the User-Agent string matches the pattern docker,” — but we really can’t support arbitrary user-agent-restrictive configurations, so that one is moot

Yeah... that's hard to accommodate. Luckily for them, if the useragent is set to skopeo/<something>, they could just run s/skopeo/docker/ over the binary to fix it? (only kind of joking)

c/image will probably need a new DockerRegistryPartialUserAgent or something like that, rather than changing the semantics of the existing field.

👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants