piedesaint 0.1.3 → 0.2.0
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 +4 -4
- data/README.md +6 -0
- data/lib/piedesaint/cli.rb +27 -0
- data/lib/piedesaint/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7848358b15cb4718fc2497e2650527ea970bb673
|
4
|
+
data.tar.gz: 28c56e3778d10da2450536c4d8d7f81185d34a5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/piedesaint/cli.rb
CHANGED
@@ -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
|
|
data/lib/piedesaint/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|