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

Publish checksums for every artifact #199

Merged
merged 2 commits into from
Nov 1, 2018
Merged

Conversation

lidel
Copy link
Member

@lidel lidel commented Aug 25, 2018

This PR aims to close #152 by exposing CID and additionally generating a plain SHA512 hash for every artifact of new releases.

Rationale

I had a short chat with someone (sorry, forgot the name :() about things that we could improve as an open source project to make it easier to package our software.

Number one issue was that we do not publish checksums and package managers can't verify downloads without additional orchestration. This makes package maintainer's work harder than it should be.

I mentioned all our artifacts are content-addressed and it is possible to get CID for every file but there is a good argument about learning curve of IPFS concepts and multihash/cids not being supported by default userland tools in unix-like systems (yet), while things like shasum being usually around.

Details

This PR exposes two new values in two places:

  • in file hierarchy, as additional files with self-describing extension:
    • releases/<dist>/<version>/<dist>_<version>_<platform>.tar.gz.cid
    • releases/<dist>/<version>/<dist>_<version>_<platform>.tar.gz.sha512
  • in releases/<dist>/<version>/dist.js as additional fields named cid and sha512:
    "amd64": {
              "link": "/go-ipfs_v0.4.17_linux-amd64.tar.gz",
    +          "cid": "QmSmogJPQKUbDtvtxBsbstE4RtX7u1RRoApCyQgzj9UvD7",
    +          "sha512": "27aa376e0a542aefadc643503bf3f95c4255fbdeff0f6522bba0fa3f2b9145a30c246d7e9c2e2d260381b8d7b9b96dbc0f29649e2732af8ddce204c205a2f770"
             },

Flat files enable bulk verification via simple shell scripts or just plain shasum -c *.sha512.
Fields in dist.js enable more sophisticated setups to do the same.

How to test locally

  # fetch historical releases of go-ipfs
$ make go-ipfs
$ cd dists/go-ipfs
  # remove last release 
$ rm -rf ../../releases/go-ipfs/v0.4.17
  # rebuild v0.4.17
$ bash ../../build-go.sh go-ipfs github.com/ipfs/go-ipfs/cmd/ipfs versions
  # inspect generated artifacts
$ ls ../../releases/go-ipfs/v0.4.17/
$ view ../../releases/go-ipfs/v0.4.17/dist.json

What about historical releases?

Due to the way we fetch historical data from IPNS those changes will be applied only to new releases. Adding this additional metadata to historical archives requires additional work and QA and if it is really needed it can be tackled in a separate PR, so this one can be merged before go-ipfs v0.4.18 is released.

Demo

(2018-11-02) go-ipfs 0.4.18 just got published on the website and has .cid and .sha512 files:

@dignifiedquire
Copy link
Member

@lidel have you tested this on both macos and linux? just making sure because sometimes builtin shell commands don't work exactly the same

@lidel
Copy link
Member Author

lidel commented Oct 31, 2018

@dignifiedquire tested on linux, don't have mac around unfortunately, however shasum -a 512 should work the same according to this.

@dignifiedquire
Copy link
Member

I tested shasum -a 512 locally and it worked.

Copy link
Member

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

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

LGTM, nice improvement

@lidel
Copy link
Member Author

lidel commented Nov 1, 2018

@dignifiedquire I don't have power to merge this, are you able to do it? (or grant me the rights)

@dignifiedquire dignifiedquire merged commit 53ef3f9 into ipfs:master Nov 1, 2018
@lidel lidel deleted the checksums branch November 1, 2018 19:56
lidel added a commit to lidel/distributions that referenced this pull request Jan 9, 2019
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.

Wishlist: Provide checksum files for IPFS distributions.
2 participants