-
Notifications
You must be signed in to change notification settings - Fork 197
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
Make client updates download
get signed builds if possible
#5859
base: develop
Are you sure you want to change the base?
Conversation
I split the dist-git enhancement out into a separate commit in case someone thought that was going a bit too far, makes it easy to leave it out. But I think it's probably OK. Note we already depend on requests elsewhere in the module, it's not a new dep. |
This tries to get signed packages when possible, by calling gpg on the key file in /etc/pki/rpm-gpg to figure out the key ID, and passing it to Koji. If we can't work it out - because the key file isn't there on this system, or gpg isn't there, or whatever - we just fall through to getting unsigned packages. There's also a `--no-gpg` to disable this behaviour. Signed-off-by: Adam Williamson <[email protected]>
4f8e8fc
to
a41fc16
Compare
This extends the 'try and find the correct signing key ID and get signed packages' mechanism to try and find the key file from fedora-repos dist-git if we can't find it as a local file. This will make it work on non-Fedora systems (and Fedora systems where we can't find the key file for some reason), but makes it a bit more complicated, and will need updating when dist-git moves. Signed-off-by: Adam Williamson <[email protected]>
a41fc16
to
7736639
Compare
This is a great addition, however I'd like to avoid calling I've just played a bit and wrote this:
This will also import the key in the |
I considered that, but the gnupg module itself is just a wrapper for gpg anyway. Here's |
Well, using gnupg module, even as a wrapper, would save us the burden to deal with future cli output pattern changes and/or handling locale. We could just rely on the module output and rest assured any breaking change will be catched by the gnupg module upstream before we are hit. However, I don't want to force my opinion, so if things are ok for you I'll just merge the change. But I think we should add a |
keyid = '' | ||
if gpg: | ||
# try to figure out the key ID we need to get signed packages | ||
relnum = update['release']['version'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't going to work for EPEL 10 updates after they are no longer the leading minor version. For example, currently EPEL 10.1 has a version of 10, but EPEL 10.0 has a version of 10.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, thanks, I did check an EPEL update but wasn't aware of that wrinkle. I'll try and deal with it. Just take the integer portion of the version, I guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I've done in a few other places is split on the dot in the version, which python handles well enough when there is no dot. Something like update['release']['version'].split('.')[0]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, of course, i meant the concept, I can handle the execution :)
Is checking the filesystem and dist-git the best approach here? The Koji API has a queryRPMSigs method that will list all the available signatures for a given RPM. I think in most cases there will only be one and we can use that, and if there are multiple we could print those and require the user specify an exact one. |
oh, neat, wasn't aware of that. hmm. I wonder if we could even implement this in |
I'm working on doing this in koji download-build, it seems entirely doable. I'm adding it as a new mode to download-build. If that gets accepted, we can just have bodhi use that mode. |
Uf. So I implemented a
so...now I'm not sure what to do :/ I do kinda like this
|
hum, the branching case is kinda interesting anyway, even in the Bodhi case. Say you're downloading an update that was for Fedora 42, right now. You're probably downloading it to use on F42. But you might be downloading it to use on Rawhide...so if we automatically download the 42-signed version, that'd be 'wrong'. Still, it's no worse than what we currently do, really (getting an unsigned copy). mmmf. |
This enhances the client
bodhi updates download
command to find the appropriate GPG key for the release (from a local file if possible, from dist-git if not) and pass--key
tokoji download-build
, so we get signed builds if possible. It's intended to work for Fedora, ELN and EPEL package updates. It doesn't work for Flatpak updates, but that doesn't work without this patch either, so fine.