dory 1.0.1 → 1.1.1

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
  SHA256:
3
- metadata.gz: d7d729d754ce11e1287274206933888c1248ef3e07ae55d32c708aec95616875
4
- data.tar.gz: 0eef50c6630c834f7bfce5a735ee83ae34731ed5bb9643509932deceb8cf4a8c
3
+ metadata.gz: 659312d1fe7a5260a3d79f8a66858a14bc31fc60c6a7401e3b687237d51f4ba4
4
+ data.tar.gz: aff69e2a2a6cc4b489de2ad0ea34fe82af138588bd8abe78987e444d66a7048c
5
5
  SHA512:
6
- metadata.gz: 9ccd9f68e0e9c54294772c6f1d1dea53d5d9c6dd0369f066d9c4640aaa67f6dc881888b4d355db5b288ffd3dc56d9ff3ffed42d38e04b208fab310304b6d2b60
7
- data.tar.gz: 84a489441dcb208b1ea21f4ff78802ae6beeb19833ec90ad2e8605a7910254df8424ccba2e797d6a9926577fdda941db02c6f001ca285b0ff74772de1eec3bc6
6
+ metadata.gz: a1f644b260ee0b79beb65ec308ab3cbaad934ae5d214bf60ba88fd0037f10bcb9e50d259a573a6344f91eca8d91fbf6f27902149390bab4da836f360e055b53c
7
+ data.tar.gz: 49c3141b65dd1cc1e3a98bb4d23602eaa43f04d524c451a8cd1ad52709d1e88d841a69cb6dfde103f22724ea5fef5c9d8db2b8735bd9a46aa68a23d4bece626e
data/bin/dory CHANGED
@@ -60,7 +60,7 @@ class DoryBin < Thor
60
60
 
61
61
  desc 'version', 'Check current installed version of dory'
62
62
  def version
63
- puts "Dory - Version: #{Dory::VERSION}"
63
+ puts "Dory - Version: #{Dory.version}"
64
64
  end
65
65
 
66
66
  desc 'restart', 'Stop and restart all dory services'
@@ -250,7 +250,7 @@ class DoryBin < Thor
250
250
  new_version = Dory::Upgrade.new_version
251
251
  if new_version
252
252
  if Dory::Upgrade.outdated?(new_version)
253
- puts "New version #{new_version} is available. You currently have #{Dory::VERSION}.".yellow
253
+ puts "New version #{new_version} is available. You currently have #{Dory.version}.".yellow
254
254
  print "Would you like to install the update? (Y/N): ".yellow
255
255
  if STDIN.gets.chomp =~ /y/i
256
256
  puts "Upgrading dory...".green
@@ -523,7 +523,7 @@ aliases = {
523
523
  }
524
524
 
525
525
  if !ARGV.empty? && %w[-v --version].include?(ARGV.first)
526
- puts "Dory - Version: #{Dory::VERSION}"
526
+ puts "Dory - Version: #{Dory.version}"
527
527
  else
528
528
  DoryBin.start(ARGV.map { |a| aliases.keys.include?(a) ? aliases[a] : a })
529
529
  end
data/lib/dory/config.rb CHANGED
@@ -41,8 +41,6 @@ module Dory
41
41
  domains: # array of domains that will be resolved to the specified address
42
42
  - domain: docker # you can set '#' for a wilcard
43
43
  address: 127.0.0.1 # return for queries against the domain
44
- - domain: dev
45
- address: 127.0.0.1
46
44
  container_name: dory_dnsmasq
47
45
  port: 53 # port to listen for dns requests on. must be 53 on linux. can be anything that's open on macos
48
46
  # kill_others: kill processes bound to the port we need (see previous setting 'port')
@@ -57,6 +55,8 @@ module Dory
57
55
  container_name: dory_dinghy_http_proxy
58
56
  https_enabled: true
59
57
  ssl_certs_dir: '' # leave as empty string to use default certs
58
+ port: 80 # port 80 is default for http
59
+ tls_port: 443 # port 443 is default for https
60
60
  resolv:
61
61
  enabled: true
62
62
  nameserver: 127.0.0.1
@@ -122,6 +122,14 @@ module Dory
122
122
  newsettings[:dory][:dnsmasq][:service_start_delay] = 5
123
123
  end
124
124
 
125
+ # add settings for nginx proxy port
126
+ unless newsettings[:dory][:nginx_proxy][:port]
127
+ newsettings[:dory][:nginx_proxy][:port] = 80
128
+ end
129
+ unless newsettings[:dory][:nginx_proxy][:tls_port]
130
+ newsettings[:dory][:nginx_proxy][:tls_port] = 443
131
+ end
132
+
125
133
  newsettings
126
134
  end
127
135
  end
data/lib/dory/dnsmasq.rb CHANGED
@@ -11,7 +11,8 @@ module Dory
11
11
  @@handle_systemd_services = []
12
12
 
13
13
  def self.dnsmasq_image_name
14
- 'freedomben/dory-dnsmasq:1.1.0'
14
+ setting = Dory::Config.settings[:dory][:dnsmasq][:image]
15
+ setting ? setting : 'freedomben/dory-dnsmasq:1.1.0'
15
16
  end
16
17
 
17
18
  def self.first_attempt_failed?
data/lib/dory/proxy.rb CHANGED
@@ -8,7 +8,7 @@ module Dory
8
8
  setting = Dory::Config.settings[:dory][:nginx_proxy][:image]
9
9
  return setting if setting
10
10
  certs_dir && !certs_dir.empty? \
11
- ? 'codekitchen/dinghy-http-proxy:2.5.9' \
11
+ ? 'codekitchen/dinghy-http-proxy:2.5.10' \
12
12
  : 'freedomben/dory-http-proxy:2.5.9.1'
13
13
  end
14
14
 
@@ -32,14 +32,18 @@ module Dory
32
32
  if [:tls_enabled, :ssl_enabled, :https_enabled].any? { |s|
33
33
  Dory::Config.settings[:dory][:nginx_proxy][s]
34
34
  }
35
- "-p 443:443"
35
+ "-p #{Dory::Config.settings[:dory][:nginx_proxy][:tls_port]}:443"
36
36
  else
37
37
  ''
38
38
  end
39
39
  end
40
40
 
41
+ def self.http_port
42
+ Dory::Config.settings[:dory][:nginx_proxy][:port]
43
+ end
44
+
41
45
  def self.run_command
42
- "docker run -d -p 80:80 #{self.tls_arg} #{self.certs_arg} "\
46
+ "docker run -d -p #{http_port}:80 #{self.tls_arg} #{self.certs_arg} "\
43
47
  "-v /var/run/docker.sock:/tmp/docker.sock -e " \
44
48
  "'CONTAINER_NAME=#{Shellwords.escape(self.container_name)}' --name " \
45
49
  "'#{Shellwords.escape(self.container_name)}' " \
@@ -74,7 +74,7 @@ module Dory
74
74
  def self.write_to_file(contents)
75
75
  # have to use this hack cuz we don't run as root :-(
76
76
  puts "Requesting sudo to write to #{self.resolv_file}".green
77
- Bash.run_command("echo -e '#{contents}' | sudo tee #{Shellwords.escape(self.resolv_file)} >/dev/null")
77
+ Bash.run_command("echo -e '#{contents}' | sudo /usr/bin/tee #{Shellwords.escape(self.resolv_file)} >/dev/null")
78
78
  end
79
79
 
80
80
  def self.resolv_file_contents
@@ -63,7 +63,7 @@ module Dory
63
63
  end
64
64
  self.resolv_files.each do |filename|
65
65
  puts "Requesting sudo to write to #{filename}".green
66
- Bash.run_command("echo -e '#{self.resolv_contents}' | sudo tee #{Shellwords.escape(filename)} >/dev/null")
66
+ Bash.run_command("echo -e '#{self.resolv_contents}' | sudo /usr/bin/tee #{Shellwords.escape(filename)} >/dev/null")
67
67
  end
68
68
  rescue DinghyError => e
69
69
  puts e.message.red
data/lib/dory/upgrade.rb CHANGED
@@ -9,7 +9,7 @@ module Dory
9
9
  end
10
10
 
11
11
  def self.outdated?(new_version = self.new_version)
12
- return Dory::VERSION != new_version
12
+ return Dory.version != new_version
13
13
  end
14
14
 
15
15
  def self.install
data/lib/dory/version.rb CHANGED
@@ -1,4 +1,9 @@
1
1
  module Dory
2
- VERSION = '1.0.1'
3
- DATE = '2018-08-22'
2
+ def self.version
3
+ '1.1.1'
4
+ end
5
+
6
+ def self.date
7
+ '2021-04-06'
8
+ end
4
9
  end
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: 1.0.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Porter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-22 00:00:00.000000000 Z
11
+ date: 2021-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -56,16 +56,22 @@ dependencies:
56
56
  name: activesupport
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '5.2'
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '7.0'
62
65
  type: :runtime
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
- - - "~>"
69
+ - - ">="
67
70
  - !ruby/object:Gem::Version
68
71
  version: '5.2'
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '7.0'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: rspec
71
77
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +92,14 @@ dependencies:
86
92
  requirements:
87
93
  - - "~>"
88
94
  - !ruby/object:Gem::Version
89
- version: '12.3'
95
+ version: '13.0'
90
96
  type: :development
91
97
  prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
100
  - - "~>"
95
101
  - !ruby/object:Gem::Version
96
- version: '12.3'
102
+ version: '13.0'
97
103
  - !ruby/object:Gem::Dependency
98
104
  name: byebug
99
105
  requirement: !ruby/object:Gem::Requirement
@@ -183,8 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
189
  - !ruby/object:Gem::Version
184
190
  version: '0'
185
191
  requirements: []
186
- rubyforge_project:
187
- rubygems_version: 2.7.6
192
+ rubygems_version: 3.0.1
188
193
  signing_key:
189
194
  specification_version: 4
190
195
  summary: Your development proxy for Docker