Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

version bump and checksums #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sveiss
Copy link

@sveiss sveiss commented May 4, 2014

This bumps the TS3 version to the current version, and adds checksum validation for the tarball.

sveiss added 2 commits May 4, 2014 21:07
Use these checksums to both prevent re-downloading an existing file, and
to validate downloads.
if checksum != node['ts3']['sha256sum'][arch]
raise "Downloaded TS3 checksum does not match expected value."
end
end
Copy link
Owner

Choose a reason for hiding this comment

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

This ruby_block is not necessary. Using the checksum on remote_file will check the target file's SHA256 vs the source.

Copy link
Author

Choose a reason for hiding this comment

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

In my testing, it didn't. It would use the checksum to avoid re-downloading if the file already existed and the checksum matched, but wouldn't validate the checksum on download and fail if it didn't match. (Instead, it would re-download on every run.) Since the download is over http and coming from a mirror, I'd like to validate it.

The ruby_block is based on this, where someone else had a similar problem: http://tech.yipit.com/2013/05/09/pragmatic-chef-verifying-remote-files/

Copy link
Owner

Choose a reason for hiding this comment

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

I trust this particular mirror:

  1. It's the default one on teamspeak's downloads page
  2. Teamspeak itself does not run as the root user.

IMO, Verifying the content of a downloaded file is something that should be added to Chef's content management resources. That is, it's a bug that it doesn't currently.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants