dev-lxc 2.2.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5561d60e7887cad1c29c9d1cb18363b0d09a9687
4
- data.tar.gz: fa29a6fc4291a7bf48483a6309602542b9116778
3
+ metadata.gz: 9aeb8759ea61759a5c8b6888306cd05e0806ed1d
4
+ data.tar.gz: d12cfeeaa05bb6e5ce82896768ea87f7e01aa97d
5
5
  SHA512:
6
- metadata.gz: 2f93035b7594c97cf9a4a637cbc66cbde1e714852bfc81bab1d0dd3d667a7e8d48f753306074c9bdd628e0bf5decbe5f87fdb88d370a8444109bb56fe36193a7
7
- data.tar.gz: ed0862acfae520555f40be824bfcd92f68ef987a4019d29e387b049daff5824896e5ed8054c087cc7bf0cabc56078ca6835b29a6e04949478036a9a6da8ef6e6
6
+ metadata.gz: 7339707e329e093333257d64ef62b980919c10c87fd04efd26c6557ce1dd39ea4cc88b9c5f47933902926cb876c4acc2dca754a7205925a7275e24a97d76b7c1
7
+ data.tar.gz: 0b9c409e8b1f8a51e32cbf7a9b98582b4e119a1db6eb9822af6583885fd1049c0267a8eb0199250add89e6dd0cf74154ad97dc0cb60e5cfb363db7034c2a3f29
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # dev-lxc Change Log
2
2
 
3
+ ## 2.2.4 (2016-08-24)
4
+
5
+ * Add sha256 check for downloaded packages
6
+
3
7
  ## 2.2.3 (2016-07-27)
4
8
 
5
9
  * Copy validation key when validation_key is set
@@ -1,9 +1,9 @@
1
1
 
2
2
  #### Download and Install Prerequisites
3
3
 
4
- Download and install [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
4
+ Download and install [VirtualBox 5.0.14+](https://www.virtualbox.org/wiki/Downloads).
5
5
 
6
- Download and install [Vagrant](https://www.vagrantup.com/downloads.html).
6
+ Download and install [Vagrant 1.8.5+](https://www.vagrantup.com/downloads.html).
7
7
 
8
8
  Install the vagrant-persistent-storage plugin.
9
9
 
@@ -452,7 +452,7 @@ module DevLXC
452
452
  server.container.save_config
453
453
  end
454
454
 
455
- def get_product_url(server, product_name, product_options)
455
+ def get_product_download_info(server, product_name, product_options)
456
456
  server_type = @server_configs[server.name][:server_type]
457
457
  base_container = DevLXC::Container.new(@server_configs[server.name][:base_container_name])
458
458
  mixlib_install_platform_detection_path = "#{base_container.config_item('lxc.rootfs')}/mixlib-install-platform-detection"
@@ -483,7 +483,7 @@ module DevLXC
483
483
  puts JSON.pretty_generate(options)
484
484
  exit 1
485
485
  end
486
- artifact.url
486
+ [artifact.url, artifact.sha256]
487
487
  end
488
488
 
489
489
  def calculate_required_products(servers, force=false)
@@ -501,11 +501,11 @@ module DevLXC
501
501
  products.each do |product_name, product_options|
502
502
  if product_options && product_options['package_source']
503
503
  package_source = product_options['package_source']
504
- all_required_products[package_source] = product_name
504
+ all_required_products[package_source] = [product_name, nil]
505
505
  @server_configs[server.name][:required_products][product_name] = package_source
506
506
  else
507
- package_source = get_product_url(server, product_name, product_options)
508
- all_required_products[package_source] = product_name
507
+ package_source, package_sha256 = get_product_download_info(server, product_name, product_options)
508
+ all_required_products[package_source] = [product_name, package_sha256]
509
509
  product_cache_path = "/var/dev-lxc/cache/chef-products/#{product_name}/#{File.basename(package_source)}"
510
510
  @server_configs[server.name][:required_products][product_name] = product_cache_path
511
511
  end
@@ -516,7 +516,8 @@ module DevLXC
516
516
 
517
517
  def prep_product_cache(servers, force=false)
518
518
  all_required_products = calculate_required_products(servers, force)
519
- all_required_products.each do |package_source, product_name|
519
+ all_required_products.each do |package_source, v|
520
+ product_name, package_sha256 = v
520
521
  if package_source.start_with?('http')
521
522
  product_cache_path = "/var/dev-lxc/cache/chef-products/#{product_name}/#{File.basename(package_source)}"
522
523
  if !File.exist?(product_cache_path)
@@ -524,6 +525,11 @@ module DevLXC
524
525
  puts "Downloading #{package_source} to #{product_cache_path}"
525
526
  open(package_source) { |url| File.open(product_cache_path, 'wb') { |f| f.write(url.read) } }
526
527
  end
528
+ actual_sha256 = Digest::SHA256.file(product_cache_path).hexdigest
529
+ if package_sha256 != actual_sha256
530
+ puts "ERROR: Invalid SHA256 #{actual_sha256} for #{File.basename(product_cache_path)}."
531
+ exit 1
532
+ end
527
533
  elsif !File.exist?(package_source)
528
534
  puts "ERROR: Package source #{package_source} does not exist."
529
535
  exit 1
@@ -1,3 +1,3 @@
1
1
  module DevLXC
2
- VERSION = "2.2.3"
2
+ VERSION = "2.2.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev-lxc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremiah Snapp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-27 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -134,4 +134,3 @@ signing_key:
134
134
  specification_version: 4
135
135
  summary: A tool for building Chef server clusters using LXC containers
136
136
  test_files: []
137
- has_rdoc: