hobo-inviqa 0.0.11 → 0.0.13

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: be7b49aeaf1ca940a8e4195b1d173f77a60ddb4c
4
- data.tar.gz: dbf72ecfd2f6cbb66b4bdd1be1058377f9b6b3b6
3
+ metadata.gz: dddcb0ce1d74f6b6f52849c57c855561d1d7f84d
4
+ data.tar.gz: bcdc46f391df9f1e18400cfe1e6852a526928c3e
5
5
  SHA512:
6
- metadata.gz: a66d5fc46a6a655a53bcb3b7aa5bdb9e8a35a3b044cca992e13bed83fde56d956aeccc9bcfcf433a0f715b41039e097e042d023a4cdb294b6bd2f4626ffa39d6
7
- data.tar.gz: 138f62a568f9ba19f71f60ab18517b11b9c9e0005f1c9794f9a398a0ff8305c0ab347596b4fe5f9ca37ea81d4c9744530d998dbd6dcfa14192e5c3c4d74c0251
6
+ metadata.gz: 9602e6025612afc89faef1e549584c70c24ecf868d1588d630f33503a8c3fe1764fe5a1c977e5289368d3b09f3256e6ebf47c6f65f270a570201f0b8bceb415a
7
+ data.tar.gz: 5b05f1109db5aeb1205355365ad3e213468331e4dda7def377d5a5b1d61724bc8699d916f336be41ad0539fd81f5ad13fd57de6750639401c832222e11193380
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hobo-inviqa (0.0.11)
4
+ hobo-inviqa (0.0.13)
5
5
  aws-sdk (~> 1.34.0)
6
6
  bundler (>= 1.5.2)
7
7
  deepstruct (~> 0.0.5)
@@ -8,6 +8,7 @@ require 'deepstruct'
8
8
  require 'logger'
9
9
  require 'highline'
10
10
  require 'fileutils'
11
+ require 'openssl'
11
12
 
12
13
  # DSL enhancements
13
14
  require 'hobo/metadata'
@@ -55,6 +56,7 @@ require 'hobo/asset_applicators/files'
55
56
  require 'hobo/lib/seed/project'
56
57
  require 'hobo/lib/seed/replacer'
57
58
  require 'hobo/lib/seed/seed'
59
+ require 'hobo/lib/self_signed_cert_generator'
58
60
 
59
61
  # Host checks
60
62
  require 'hobo/lib/host_check/git'
@@ -89,6 +89,7 @@ module Hobo
89
89
  require 'hobo/tasks/seed'
90
90
  require 'hobo/tasks/vm'
91
91
  require 'hobo/tasks/tools'
92
+ require 'hobo/tasks/ops'
92
93
  end
93
94
 
94
95
  def load_user_config
@@ -6,7 +6,8 @@ module Hobo
6
6
  @opts = {
7
7
  :replacer => Replacer.new,
8
8
  :config_class => Hobo::Config::File,
9
- :project_config_file => Hobo.project_config_file
9
+ :project_config_file => Hobo.project_config_file,
10
+ :ssl_cert_generator => Hobo::Lib::SelfSignedCertGenerator
10
11
  }.merge! opts
11
12
  end
12
13
 
@@ -19,12 +20,19 @@ module Hobo
19
20
  config[:vm] = {
20
21
  :project_mount_path => "/vagrant"
21
22
  }
23
+ config[:ssl] = @opts[:ssl_cert_generator].generate config[:hostname]
24
+ config[:chef_ssl] = {}
25
+ config[:ssl].each do |k, v|
26
+ config[:chef_ssl][k] = v.gsub("\n", "\\n")
27
+ end
22
28
 
23
29
  @opts[:replacer].replace(config[:project_path], config)
24
30
  load_seed_init(config)
25
31
 
26
32
  project_path = config[:project_path]
27
33
  config.delete :project_path
34
+ config.delete :ssl
35
+ config.delete :chef_ssl
28
36
  @opts[:config_class].save @opts[:project_config_file], config
29
37
 
30
38
  initialize_git project_path, config[:git_url]
@@ -75,7 +75,12 @@ module Hobo
75
75
 
76
76
  class << self
77
77
  def name_to_url name
78
- name.match(/\./) ? name : "git@github.com:inviqa/hobo-seed-#{name}"
78
+ path = File.expand_path name
79
+ if name.match(/^(\.|\/|\/~)/) && path
80
+ path
81
+ else
82
+ "git@github.com:inviqa/hobo-seed-#{name}"
83
+ end
79
84
  end
80
85
  end
81
86
  end
@@ -0,0 +1,37 @@
1
+ module Hobo
2
+ module Lib
3
+ class SelfSignedCertGenerator
4
+ def self.generate domain
5
+ key = OpenSSL::PKey::RSA.new(2048)
6
+ public_key = key.public_key
7
+
8
+ subject = "/C=UK/ST=/O=Inviqa/localityName=London/commonName=*.#{domain}/organizationalUnitName=/emailAddress=support@inviqa.com"
9
+
10
+ cert = OpenSSL::X509::Certificate.new
11
+ cert.subject = cert.issuer = OpenSSL::X509::Name.parse(subject)
12
+ cert.not_before = Time.now
13
+ cert.not_after = Time.now + 365 * 24 * 60 * 60
14
+ cert.public_key = public_key
15
+ cert.serial = 0x0
16
+ cert.version = 2
17
+
18
+ ef = OpenSSL::X509::ExtensionFactory.new
19
+ ef.subject_certificate = cert
20
+ ef.issuer_certificate = cert
21
+ cert.extensions = [
22
+ ef.create_extension("basicConstraints","CA:TRUE", true),
23
+ ef.create_extension("subjectKeyIdentifier", "hash")
24
+ ]
25
+
26
+ cert.add_extension ef.create_extension("authorityKeyIdentifier", "keyid:always,issuer:always")
27
+
28
+ cert.sign key, OpenSSL::Digest::SHA1.new
29
+
30
+ {
31
+ :key => key.to_pem.to_s.strip,
32
+ :cert => cert.to_pem.to_s.strip
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
@@ -52,12 +52,20 @@ namespace :deps do
52
52
  task :vagrant_plugins => [ "deps:gems" ] do
53
53
  plugins = shell "vagrant plugin list", :capture => true
54
54
  locate "*Vagrantfile" do
55
+ to_install = []
55
56
  File.read("Vagrantfile").split("\n").each do |line|
56
- next if line.match /^\s*#/
57
- next unless line.match /Vagrant\.require_plugin (.*)/
58
- plugin = $1.gsub(/['"]*/, '')
59
- next if plugins.include? "#{plugin} "
57
+ if line.match /#\s*Hobo.vagrant_plugin (.*)/
58
+ to_install << $1
59
+ else
60
+ next if line.match /^\s*#/
61
+ next unless line.match /Vagrant\.require_plugin (.*)/
62
+ to_install << $1
63
+ end
64
+ end
60
65
 
66
+ to_install.each do |plugin|
67
+ plugin.gsub!(/['"]*/, '')
68
+ next if plugins.include? "#{plugin} "
61
69
  Hobo.ui.title "Installing vagrant plugin: #{plugin}"
62
70
  shell "vagrant", "plugin", "install", plugin, :realtime => true, :indent => 2
63
71
  Hobo.ui.separator
@@ -0,0 +1,6 @@
1
+ namespace :ops do
2
+ task 'generate-self-signed-cert', [ 'domain' ] do |task, args|
3
+ cert = Hobo::Lib::SelfSignedCertGenerator.generate args[:domain]
4
+ puts "Key:\n#{cert[:key]}\nCert:\n#{cert[:cert]}\n"
5
+ end
6
+ end
@@ -43,7 +43,7 @@ namespace :vm do
43
43
  task :stop do
44
44
  vagrantfile do
45
45
  Hobo.ui.title "Stopping VM"
46
- vagrant_exec 'suspend'
46
+ vagrant_exec 'halt'
47
47
  Hobo.ui.separator
48
48
  end
49
49
  end
@@ -1,3 +1,3 @@
1
1
  module Hobo
2
- VERSION = '0.0.11'
2
+ VERSION = '0.0.13'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo-inviqa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Simons
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-16 00:00:00.000000000 Z
11
+ date: 2014-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop
@@ -235,6 +235,7 @@ files:
235
235
  - lib/hobo/lib/seed/project.rb
236
236
  - lib/hobo/lib/seed/replacer.rb
237
237
  - lib/hobo/lib/seed/seed.rb
238
+ - lib/hobo/lib/self_signed_cert_generator.rb
238
239
  - lib/hobo/lib/vm/command.rb
239
240
  - lib/hobo/lib/vm/inspector.rb
240
241
  - lib/hobo/logging.rb
@@ -249,6 +250,7 @@ files:
249
250
  - lib/hobo/tasks/config.rb
250
251
  - lib/hobo/tasks/deps.rb
251
252
  - lib/hobo/tasks/magento.rb
253
+ - lib/hobo/tasks/ops.rb
252
254
  - lib/hobo/tasks/seed.rb
253
255
  - lib/hobo/tasks/self.rb
254
256
  - lib/hobo/tasks/system.rb