vagrant-ca-certificates 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/vagrant-ca-certificates/action/install_certificates.rb +4 -4
- data/lib/vagrant-ca-certificates/cap/debian/update_certificate_bundle.rb +1 -0
- data/lib/vagrant-ca-certificates/cap/redhat/helpers.rb +1 -1
- data/lib/vagrant-ca-certificates/cap/redhat/update_certificate_bundle.rb +4 -2
- data/lib/vagrant-ca-certificates/plugin.rb +0 -5
- data/lib/vagrant-ca-certificates/version.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8784848a5643a4e349cab6d9b221cbdef4e04876
|
4
|
+
data.tar.gz: fc760febe565f144ee67a9b5aed2549779bab109
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eee07d1e8ba330c545090cc2d0b50297a4b93386fcf0e6ce99ffbd57ec52c2c46f48a8a04105279ae6b50259e71b8bae088a9fc6a7397ad92013a1d57ee3a917
|
7
|
+
data.tar.gz: acbb68a3f36f9384c4d09302f592c7ae163ac0f3f5145cd67495dadd64158af004ba5e128b61fc09aca3241708c8e48c3c33f04d12d60cf32587a4908e3cd807
|
checksums.yaml.gz.sig
CHANGED
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
|
-
|
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 #{
|
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
|
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.
|
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-
|
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
|