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

build: verify tag signatures #110

Merged
merged 6 commits into from
Nov 5, 2024
Merged

build: verify tag signatures #110

merged 6 commits into from
Nov 5, 2024

Conversation

theborakompanioni
Copy link
Collaborator

@theborakompanioni theborakompanioni commented Sep 3, 2023

Verify release signatures.

After this change, you will only be able to build from signed tags for both JM and Jam (e.g. v0.1.5 for Jam, v0.9.10 for JM) when signature verification is enabled (defaults to true).

For testing purposes, if you want to build from non-tagged objects, e.g. the latest commit in master branch, you must disable signature verification with --build-arg VERIFY_RELEASE=false.

Test

Try to build the ui-only image..

..should succeed with enabled verification of a tagged object (tag v0.3.0):

docker build --label "local" --build-arg JAM_REPO_REF=v0.3.0 --tag "joinmarket-webui/jam-ui-only" ./ui-only --no-cache

..should fail with enabled verification of a non-tagged object (branch master):

docker build --label "local" --build-arg JAM_REPO_REF=master --tag "joinmarket-webui/jam-ui-only" ./ui-only --no-cache

Exits with an error like:

error: master: cannot verify a non-tag object of type commit.

..should succeed with disabled verification of a non-tagged object (branch master):

docker build --label "local" --build-arg JAM_REPO_REF=master --build-arg SKIP_RELEASE_VERIFICATION=true --tag "joinmarket-webui/jam-ui-only" ./ui-only --no-cache

..should fail with enabled verification of a tagged object (tag v0.3.0) if no pubkey can be found:

Delete the pubkey ./ui-only/pubkeys/tbk.asc locally and run:

docker build --label "local" --build-arg JAM_REPO_REF=v0.3.0 --tag "joinmarket-webui/jam-ui-only" ./ui-only --no-cache

Exits with an error like:

gpg: Can't check signature: No public key

Copy link

@MarnixCroes MarnixCroes left a comment

Choose a reason for hiding this comment

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

cACK

I have limited docker knowledge, but the change looks good to me.
I've verified all the added pubkeys, except yours: Kristaps and Adam's match the ones listed in JM repo and dergigi's matches the one listed on his website (dergigi.com/pgp). I'm not sure where yours is listed tho?:)

doc change also LGTM

@theborakompanioni
Copy link
Collaborator Author

I've verified all the added pubkeys, except yours: Kristaps and Adam's match the ones listed in JM repo and dergigi's matches the one listed on his website (dergigi.com/pgp). I'm not sure where yours is listed tho?:)

Can be seen e.g. when you click the "verified" badge on the commits, should be E8070AF0053AAC0D.
Also: https://pgp.mit.edu/pks/lookup?op=vindex&search=0xE8070AF0053AAC0D

doc change also LGTM

👍 🙏

@theborakompanioni theborakompanioni force-pushed the verify-release branch 2 times, most recently from 7d15c16 to ac9eb7f Compare November 5, 2024 11:27
@theborakompanioni
Copy link
Collaborator Author

docker build --label "local" --build-arg JAM_REPO_REF=master --tag "joinmarket-webui/jam-ui-only" ./ui-only --no-cache

Exits with an error like:

error: master: cannot verify a non-tag object of type commit.

e.g. see a failed build GitHub actions run for this scenario, building a non-release version (from current "master") having SKIP_RELEASE_VERIFICATION := false.

@theborakompanioni
Copy link
Collaborator Author

..should succeed with enabled verification of a tagged object (tag v0.3.0):

docker build --label "local" --build-arg JAM_REPO_REF=v0.3.0 --tag "joinmarket-webui/jam-ui-only" ./ui-only --no-cache

e.g. see a success build GitHub actions run for this scenario, building a release version ("v0.3.0") having SKIP_RELEASE_VERIFICATION := false.

Good signature from "theborakompanioni (no comment) [email protected]" [unknown]

@theborakompanioni theborakompanioni merged commit 67ab436 into master Nov 5, 2024
4 of 6 checks passed
@theborakompanioni theborakompanioni deleted the verify-release branch November 5, 2024 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants