dory 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dory/config.rb +10 -3
- data/lib/dory/proxy.rb +11 -1
- data/lib/dory/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9406dd6b3ce94814c3f20b73eaf93f019bf641b
|
4
|
+
data.tar.gz: 46f5d75ffe41ed8b36636c43536033f33b3e9e38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b9f8df7b16d6a5871f96632872f3dee085f7bbf80f2ed31761df7da7b701631f8ee925b6c787d0f08dbbd6e80e88dbd05204921f1e25a861a03ca612c3510bf
|
7
|
+
data.tar.gz: d00f0d92c7d1fcb7d785bc80051e51a769df70b0260fa4845270a9575f7321a908ba0b58a27f07735f818463642e71c0d67f06dad9af2d17263c4ef5c914389f
|
data/lib/dory/config.rb
CHANGED
@@ -25,6 +25,7 @@ module Dory
|
|
25
25
|
:nginx_proxy:
|
26
26
|
:enabled: true
|
27
27
|
:container_name: dory_dinghy_http_proxy
|
28
|
+
:ssl_certs_dir: '' # leave as empty string to disable
|
28
29
|
:resolv:
|
29
30
|
:enabled: true
|
30
31
|
:nameserver: 127.0.0.1
|
@@ -37,18 +38,24 @@ module Dory
|
|
37
38
|
|
38
39
|
def self.settings(filename = self.filename)
|
39
40
|
if File.exist?(filename)
|
40
|
-
self.default_settings.
|
41
|
+
default_settings = self.default_settings.dup
|
42
|
+
config_file_settings = YAML.load_file(filename)
|
43
|
+
[:dnsmasq, :nginx_proxy, :resolv].each do |service|
|
44
|
+
default_settings[:dory][service].merge!(config_file_settings[:dory][service] || {})
|
45
|
+
end
|
46
|
+
default_settings
|
41
47
|
else
|
42
48
|
self.default_settings
|
43
49
|
end
|
44
50
|
end
|
45
51
|
|
46
|
-
def self.write_settings(settings, filename = self.filename)
|
52
|
+
def self.write_settings(settings, filename = self.filename, is_yaml: false)
|
53
|
+
settings = settings.to_yaml unless is_yaml
|
47
54
|
File.write(filename, settings)
|
48
55
|
end
|
49
56
|
|
50
57
|
def self.write_default_settings_file(filename = self.filename)
|
51
|
-
self.write_settings(self.default_yaml, filename)
|
58
|
+
self.write_settings(self.default_yaml, filename, is_yaml: true)
|
52
59
|
end
|
53
60
|
end
|
54
61
|
end
|
data/lib/dory/proxy.rb
CHANGED
@@ -12,8 +12,18 @@ module Dory
|
|
12
12
|
Dory::Config.settings[:dory][:nginx_proxy][:container_name]
|
13
13
|
end
|
14
14
|
|
15
|
+
def self.certs_arg
|
16
|
+
certs_dir = Dory::Config.settings[:dory][:nginx_proxy][:ssl_certs_dir]
|
17
|
+
if certs_dir && !certs_dir.empty?
|
18
|
+
"-v #{certs_dir}:/etc/nginx/certs"
|
19
|
+
else
|
20
|
+
''
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
15
24
|
def self.run_cmd
|
16
|
-
"docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock
|
25
|
+
"docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock "\
|
26
|
+
"#{self.certs_arg} -e " \
|
17
27
|
"'CONTAINER_NAME=#{Shellwords.escape(self.container_name)}' --name " \
|
18
28
|
"'#{Shellwords.escape(self.container_name)}' " \
|
19
29
|
"#{Shellwords.escape(dinghy_http_proxy_image_name)}"
|
data/lib/dory/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Porter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -138,9 +138,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.4.8
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: slackbot_frd provides a dirt-simple framework for implementing one or more
|
145
145
|
slack bots
|
146
146
|
test_files: []
|
147
|
+
has_rdoc:
|