vagrant-ca-certificates 1.0.1 → 1.0.2

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: e6bb5a84f031146833700dd4a0134e5f59190238
4
- data.tar.gz: 6c60e7e1ce00d468b6b37d5d5cc4c7ce7d4e132d
3
+ metadata.gz: 8784848a5643a4e349cab6d9b221cbdef4e04876
4
+ data.tar.gz: fc760febe565f144ee67a9b5aed2549779bab109
5
5
  SHA512:
6
- metadata.gz: 926f8fa00f08d77e5d52d6bed80fd39ebf85488ff50b3d52f2c286a7ef36ed32223fa8f19f5054a1f8a2fde70ce58a5bb19ceeb59f4551b2d176c723d772dc6a
7
- data.tar.gz: 5e34b56b1ccfbedb53afbb7f0e6242f889b69e9f6327cd8879dd74ffd7a9dc639ea7134c6956d8b043115d280bc410efd10aaf58808d7c04caca7f90376b7fc9
6
+ metadata.gz: eee07d1e8ba330c545090cc2d0b50297a4b93386fcf0e6ce99ffbd57ec52c2c46f48a8a04105279ae6b50259e71b8bae088a9fc6a7397ad92013a1d57ee3a917
7
+ data.tar.gz: acbb68a3f36f9384c4d09302f592c7ae163ac0f3f5145cd67495dadd64158af004ba5e128b61fc09aca3241708c8e48c3c33f04d12d60cf32587a4908e3cd807
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -55,18 +55,18 @@ module VagrantPlugins
55
55
 
56
56
  def upload_certificate(from, to)
57
57
  @logger.debug("Uploading certificates #{from} -> #{to}")
58
- remote = Tempfile.new('vagrant-ca-certificates')
59
58
  if from =~ /^http[s]?/
59
+ remote = Tempfile.new('vagrant-ca-certificates')
60
60
  Vagrant::Util::Downloader.new(from, remote.path).download!
61
61
  from = remote.path
62
62
  end
63
63
 
64
64
  @machine.communicate.tap do |sh|
65
65
  unless certificate_matches?(from, to)
66
- remote = Tempfile.new('vagrant')
66
+ tmp_to = Pathname.new(Tempfile.new('vagrant').path).basename
67
67
  @machine.ui.info(I18n.t('vagrant_ca_certificates.certificate.upload.file', from: from, to: to))
68
- sh.upload(from, remote.path)
69
- sh.sudo("mv #{remote.path} #{to} && chown root: #{to} && chmod 0644 #{to}")
68
+ sh.upload(from, tmp_to) # remote.path will build a "C:\" URI on windows, cp to ~ and move
69
+ sh.sudo("mv #{tmp_to} #{to} && chown root: #{to} && chmod 0644 #{to}")
70
70
  end
71
71
  end
72
72
  end
@@ -5,6 +5,7 @@ module VagrantPlugins
5
5
  # Capability for configuring the certificate bundle on Debian.
6
6
  module UpdateCertificateBundle
7
7
  def self.update_certificate_bundle(m)
8
+ m.communicate.sudo("ls /usr/share/ca-certificates/private | awk '{print \"private/\"$1;}' >> /etc/ca-certificates.conf") # enable our custom certs
8
9
  m.communicate.sudo('update-ca-certificates') do |type, data|
9
10
  if [:stderr, :stdout].include?(type)
10
11
  next if data =~ /stdin: is not a tty/
@@ -7,7 +7,7 @@ module VagrantPlugins
7
7
  # bundles must be managed manually.
8
8
  def self.legacy_certificate_bundle?(sh)
9
9
  command = %q(R=$(sed -E "s/.* ([0-9])\.([0-9]+) .*/\\1.\\2/" /etc/redhat-release))
10
- sh.test(%Q(#{command} && [[ $R =~ ^5 || $R =~ ^6\.[0-4]+ ]]), shell: '/bin/bash')
10
+ sh.test(%Q(#{command} && [[ $R =~ ^5 || $R =~ ^6\.[0-4]+ ]]), shell: '/bin/bash') || !sh.test("rpm -q --verify --nomtime ca-certificates", shell:'/bin/bash')
11
11
  end
12
12
  end
13
13
  end
@@ -11,11 +11,13 @@ module VagrantPlugins
11
11
  if Redhat.legacy_certificate_bundle?(sh)
12
12
  sh.sudo('find /etc/pki/tls/private -type f -exec cat {} \; | cat /etc/pki/tls/certs/ca-bundle.crt - > /etc/pki/tls/ca.private.crt')
13
13
  sh.sudo('/bin/ln -fsn /etc/pki/tls/ca.private.crt /etc/pki/tls/cert.pem')
14
+ sh.sudo('/bin/ln -fsn /etc/pki/tls/ca.private.crt /etc/pki/tls/certs/ca-bundle.crt')
14
15
  sh.execute(<<-SCRIPT, shell: '/bin/bash', sudo: true)
15
- [ ! -z "$JAVA_HOME" ] && \
16
+ if [ ! -z "$JAVA_HOME" ]; then \
16
17
  find /etc/pki/tls/private -type f -exec $JAVA_HOME/bin/keytool -importcert \
17
18
  -trustcacerts -noprompt -storepass changeit \
18
- -keystore $JAVA_HOME/jre/lib/security/cacerts -file {} \\;
19
+ -keystore $JAVA_HOME/jre/lib/security/cacerts -file {} \\; \
20
+ else true; fi
19
21
  SCRIPT
20
22
  else
21
23
  sh.sudo('update-ca-trust enable')
@@ -22,11 +22,6 @@ module VagrantPlugins
22
22
  hook.after(Vagrant::Action::Builtin::Provision, Action::InstallCertificates)
23
23
  end
24
24
 
25
- action_hook(:install_ca_certificates) do |hook|
26
- require_relative 'action/install_certificates'
27
- hook.after(:run_provisioner, Action::InstallCertificates)
28
- end
29
-
30
25
  # All supported guest systems must have these capabilities
31
26
  # implemented. If any of them aren't config validate will fail.
32
27
  guest_capability('debian', 'update_certificate_bundle') do
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module CaCertificates
3
- VERSION = '1.0.1'
3
+ VERSION = '1.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-ca-certificates
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Bailey
@@ -31,7 +31,7 @@ cert_chain:
31
31
  cKcRBHKYVo5pQ0zs2WJv6Qwa8KhCS5HlABy/3x2Mqt6reHGppi7nVC4nUt/B1y/9
32
32
  e2Nj035zG32VLvxrvP4OKOJJlV2dnn0CyZeQYgpZ5+d1C/lz
33
33
  -----END CERTIFICATE-----
34
- date: 2015-05-12 00:00:00.000000000 Z
34
+ date: 2015-05-14 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
metadata.gz.sig CHANGED
Binary file