piedesaint 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd5187dd62378f733ea9756d5c7e6acbfca1683b
4
- data.tar.gz: a2e52298d82e0e6bcaf2b9e7bd8ba14d298588b8
3
+ metadata.gz: 7848358b15cb4718fc2497e2650527ea970bb673
4
+ data.tar.gz: 28c56e3778d10da2450536c4d8d7f81185d34a5c
5
5
  SHA512:
6
- metadata.gz: 4292e4a783972de57f212e20d46f5c31e29cbc21fc53e91da8ac81d0a4dbad0cd4ccfed05ff2ea74c141728a00cdb0ed187f83becbd60f2bfb938ae53907231c
7
- data.tar.gz: ce9f94adb7f0af65c5c8767eefdf928d1ef87be604168915771679f1058bc61997b1a7d8df60a7ccaa9f25f8cf0006141897e4415b00b2ee6fba3b1436629b06
6
+ metadata.gz: 337ece3d727291c4380ef354ea3bb3f874951c30145d8567e9701ade8862bb685bb9f14fd969b399b66fcfce38730add0653c661d17bab8df715d3f5d606268c
7
+ data.tar.gz: ea90683c668a8001f57844307b2d84f6d19bb32dcc4577fad23bc09755057c539039b83ea1ab0c12c82f995696bc58606060b73c0896b24c5064febaa1992d50
data/README.md CHANGED
@@ -42,6 +42,12 @@ This creates the `.piedesaint` folder that you can inspect and configure (it con
42
42
 
43
43
  By default the configuration will serve the current directory, unless a list of folders is specified. If you want to serve a different folder or set of folders, just edit the configuration.
44
44
 
45
+ Host can be set via:
46
+
47
+ $ sug set_host [host IP]
48
+
49
+ This is useful/required so that the certificate is created with the correct IP and systems can validate it correctly.
50
+
45
51
  After this, whenever you want to serve the files/directories, just execute:
46
52
 
47
53
  $ sug
@@ -2,6 +2,7 @@ require 'piedesaint'
2
2
 
3
3
  require 'openssl'
4
4
  require 'yaml'
5
+ require 'json'
5
6
 
6
7
  module Piedesaint
7
8
 
@@ -15,6 +16,7 @@ module Piedesaint
15
16
  def execute
16
17
  load_config
17
18
  cert(@config[:host]) if @config[:refresh_cert]
19
+ refresh_asset_provider if @config[:refresh_asset_provider]
18
20
  piedesanto = Piedesaint.new @config
19
21
  piedesanto.start
20
22
  end
@@ -33,6 +35,9 @@ module Piedesaint
33
35
  cert: File.join(".", ".piedesaint", "ssl", "server.crt" ),
34
36
  username: "user",
35
37
  password: "password",
38
+ asset_provider_config: "",
39
+ asset_provider_helper_vagrantfile: "",
40
+ refresh_asset_provider: true,
36
41
  freshness: 3600,
37
42
  metastore: 'file:/tmp/rack/meta',
38
43
  entitystore: 'file:/tmp/rack/body',
@@ -50,6 +55,15 @@ module Piedesaint
50
55
  cert host[0]
51
56
  end
52
57
 
58
+ def asset_provider ( parameters = [] )
59
+ load_config
60
+ asset_provider_helper_vagrantfile = parameters[0] || "chef_vagrant"
61
+ asset_provider_config = parameters[1] || File.join("kitchen", "nodes", "vagrant.json")
62
+ @config[:asset_provider_helper_vagrantfile] = asset_provider_helper_vagrantfile
63
+ @config[:asset_provider_config] = asset_provider_config
64
+ save_config @config
65
+ end
66
+
53
67
  private
54
68
  def load_config
55
69
  config_path = find_default_config_path
@@ -80,6 +94,19 @@ module Piedesaint
80
94
  end
81
95
  end
82
96
 
97
+ def refresh_asset_provider
98
+ return if @config[:asset_provider_helper_vagrantfile].nil?
99
+ return if @config[:asset_provider_helper_vagrantfile].empty?
100
+ File.write(@config[:asset_provider_helper_vagrantfile], "trusted_certs_dir \"/vagrant/#{File.dirname(@config[:key])}\"")
101
+
102
+ return if @config[:asset_provider_config].nil?
103
+ return if @config[:asset_provider_config].empty?
104
+
105
+ asset_provider_config = JSON.parse(File.read(@config[:asset_provider_config]))
106
+ asset_provider_config["asset_provider"]["host"] = @config[:host]
107
+ File.write(@config[:asset_provider_config], JSON.pretty_generate(asset_provider_config))
108
+ end
109
+
83
110
  def create_ssl_artifacts ( cn = 'localhost' )
84
111
  key = OpenSSL::PKey::RSA.new 2048
85
112
 
@@ -1,3 +1,3 @@
1
1
  module Piedesaint
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piedesaint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tnarik Innael
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-24 00:00:00.000000000 Z
11
+ date: 2015-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  requirements: []
126
126
  rubyforge_project:
127
- rubygems_version: 2.4.5
127
+ rubygems_version: 2.2.2
128
128
  signing_key:
129
129
  specification_version: 4
130
130
  summary: Drop-in web server to serve files and tar'ed directories