agoo 2.15.7 → 2.15.8

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: 6860d541228cbc1c4eb2cde9ff1ca990165c8bc6a94e7c3100b9815c5e7f355a
4
- data.tar.gz: 67a498d6cb3a1b979d17222f0c6b0b15fe6860af2bc2f16eefe665801e8257f9
3
+ metadata.gz: 02abdb9101a03fc778a6cac9b0ee843e1ba5d174faf33737dec99953f9950651
4
+ data.tar.gz: 2a59de84f142434913db679a6ea0cbe696f7681b5ff748da8f20cbced2f7358b
5
5
  SHA512:
6
- metadata.gz: 35bebcb546facab91fffd989fcf8d6abe4e09130840abe5066063a9858d2e7432b8979e497a1e3f3cd7e7c6a1673920c51c2ed92475cf81ed478c809973f34e5
7
- data.tar.gz: '0302865a039bcee648d1212296ec72039beff8edc02ce32dae21f1a5badcb4b8de9586ca97e6e9afcdd3cfbf72a4398af7c135354dcfdf4afeb7ab1556d41445'
6
+ metadata.gz: f4126df37e2339f76d007c0d96d5929b4ba50dc0ea65e4a50d7a3577403fe641eaf8054cc48e975b18786b321eddfe022a0994556784c5b33dd93504d9981d00
7
+ data.tar.gz: 9072e8a005ce5fbc1b033c14cd05990096371d4d885a65a7e1af2684ab5cd13cf745de71ce1b846f1655b7176b179d254aa9369c79200adfe15cfdcc9975e2fc
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All changes to the Agoo gem are documented here. Releases follow semantic versioning.
4
4
 
5
+ ## [2.15.8] - 2023-10-07
6
+
7
+ ### Fixed
8
+
9
+ - Fixed race condition on starting a thread count set to 1.
10
+
11
+ - Fixed crash with invalid bindings.
12
+
13
+ ### Added
14
+
15
+ - Added command line options for TLS.
16
+
5
17
  ## [2.15.7] - 2023-07-10
6
18
 
7
19
  ### Fixed
data/bin/agoo CHANGED
@@ -52,6 +52,9 @@ Example:
52
52
  @workers = 0
53
53
  @first = false
54
54
  @graphql = nil
55
+ @ssl_cert = nil
56
+ @ssl_key = nil
57
+
55
58
 
56
59
  @opts = OptionParser.new(usage)
57
60
  @opts.on('-h', '--help', 'Show this display.') { puts @opts.help; Process.exit!(0) }
@@ -65,6 +68,8 @@ Example:
65
68
  @opts.on('-r', '--require FILE', String, 'Ruby require.') { |r| require r }
66
69
  @opts.on('-t', '--threads COUNT', Integer, 'Number of threads to use.') { |t| @threads = t }
67
70
  @opts.on('-w', '--workers COUNT', Integer, 'Number of workers to use.') { |w| @workers = w }
71
+ @opts.on('--ssl_cert', String, 'SSL certificate.') { |c| @ssl_cert = c }
72
+ @opts.on('--ssl_key', String, 'SSL key.') { |k| @ssl_key = k }
68
73
  @opts.on('--log-dir DIR', String, 'Log file directory.') { |d| @log_dir = d }
69
74
  @opts.on('--[no-]log-classic', 'Classic log entries instead of JSON.') { |b| @classic = b }
70
75
  @opts.on('--[no-]log-console', 'Display log entries on the console.') { |b| @console = b }
@@ -74,7 +79,6 @@ handler_paths = @opts.parse(ARGV)
74
79
 
75
80
  @threads = 0 if @threads < 0
76
81
  @workers = 1 if @workers < 1
77
- @ran = false
78
82
  @run_file = nil
79
83
 
80
84
  if handler_paths.empty?
@@ -93,28 +97,30 @@ else
93
97
  end
94
98
 
95
99
  if @run_file.nil?
96
- @port = 6464 if 0 == @port
100
+ @port = 6464 if 0 == @port && @binds.empty?
97
101
  Agoo::Log.configure(dir: @log_dir,
98
- console: @console,
99
- classic: @classic,
100
- colorize: @colorize,
101
- states: {
102
- INFO: 1 <= @verbose,
103
- DEBUG: 3 <= @verbose,
104
- connect: 2 <= @verbose,
105
- request: 2 <= @verbose,
106
- response: 2 <= @verbose,
107
- eval: 2 <= @verbose,
108
- push: 2 <= @verbose,
109
- })
102
+ console: @console,
103
+ classic: @classic,
104
+ colorize: @colorize,
105
+ states: {
106
+ INFO: 1 <= @verbose,
107
+ DEBUG: 3 <= @verbose,
108
+ connect: 2 <= @verbose,
109
+ request: 2 <= @verbose,
110
+ response: 2 <= @verbose,
111
+ eval: 2 <= @verbose,
112
+ push: 2 <= @verbose,
113
+ })
110
114
 
111
115
  Agoo::Server.init(@port,
112
- @root,
113
- bind: @binds,
114
- thread_count: @threads,
115
- worker_count: @workers,
116
- root_first: @first,
117
- graphql: @graphql)
116
+ @root,
117
+ bind: @binds,
118
+ thread_count: @threads,
119
+ worker_count: @workers,
120
+ root_first: @first,
121
+ ssl_cert: @ssl_cert,
122
+ ssl_key: @ssl_key,
123
+ graphql: @graphql)
118
124
 
119
125
  puts "Agoo #{Agoo::VERSION} is listening on port #{@port}. Path mappings are:" if 1 <= @verbose
120
126
 
@@ -133,7 +139,7 @@ if @run_file.nil?
133
139
  }
134
140
 
135
141
  puts "Agoo is only serving static files in '#{@root}'." if handler_paths.empty?
136
- Agoo::Server.start() unless @ran
142
+ Agoo::Server.start()
137
143
 
138
144
  else
139
145
  @port = 9292 if 0 == @port
@@ -143,49 +149,51 @@ else
143
149
  options[:workers] = @workers unless options.has_key?(:workers) || options.has_key?(:wc)
144
150
  options[:root_first] = @first unless options.has_key?(:root_first) || options.has_key?(:f) || options.has_key?(:rmux)
145
151
  options[:graphql] = @graphql unless options.has_key?(:graphql) || options.has_key?(:g)
152
+ options[:ssl_cert] = @ssl_cert unless options.has_key?(:ssl_cert) || options.has_key?(:ssl_cert)
153
+ options[:ssl_key] = @ssl_key unless options.has_key?(:ssl_key) || options.has_key?(:ssl_key)
146
154
  unless @binds.empty?
147
155
  if options.has_key?(:b)
148
- b2 = options[:b]
149
- b2 = b2.split(',') if b2.is_a?(String)
150
- @binds = @binds + b2
151
- options.delete(:b)
156
+ b2 = options[:b]
157
+ b2 = b2.split(',') if b2.is_a?(String)
158
+ @binds = @binds + b2
159
+ options.delete(:b)
152
160
  elsif options.has_key?(:bind)
153
- b2 = options[:bind]
154
- b2 = b2.split(',') if b2.is_a?(String)
155
- @binds = @binds + b2
156
- options.delete(:bind)
161
+ b2 = options[:bind]
162
+ b2 = b2.split(',') if b2.is_a?(String)
163
+ @binds = @binds + b2
164
+ options.delete(:bind)
157
165
  end
158
166
  options[:bind] = @binds
159
167
  end
160
168
  unless options.has_key?(:silent) || options.has_key?(:verbose) || options.has_key?(:debug)
161
169
  if 0 == @verbose
162
- options[:silent] = true
170
+ options[:silent] = true
163
171
  elsif 2 == @verbose
164
- options[:verbose] = true
172
+ options[:verbose] = true
165
173
  elsif 3 <= @verbose
166
- options[:debug] = true
174
+ options[:debug] = true
167
175
  end
168
176
  end
169
177
  options[:log_dir] = @log_dir unless options.has_key?(:log_dir)
170
178
  unless options.has_key?(:log_classic) || options.has_key?(:no_log_classic)
171
179
  if @classic
172
- options[:log_classic] = true
180
+ options[:log_classic] = true
173
181
  else
174
- options[:no_log_classic] = true
182
+ options[:no_log_classic] = true
175
183
  end
176
184
  end
177
185
  unless options.has_key?(:log_console) || options.has_key?(:no_log_console)
178
186
  if @console
179
- options[:log_console] = true
187
+ options[:log_console] = true
180
188
  else
181
- options[:no_log_console] = true
189
+ options[:no_log_console] = true
182
190
  end
183
191
  end
184
192
  unless options.has_key?(:log_colorize) || options.has_key?(:no_log_colorize)
185
193
  if @colorize
186
- options[:log_colorize] = true
194
+ options[:log_colorize] = true
187
195
  else
188
- options[:no_log_colorize] = true
196
+ options[:no_log_colorize] = true
189
197
  end
190
198
  end
191
199
  ::Rack::Handler::Agoo.run(handler, options)
@@ -197,7 +205,7 @@ else
197
205
  require 'rack'
198
206
  puts " Racking #{@run_file}" if 1 <= @verbose
199
207
  app = Rack::Builder.new {
200
- eval(File.open(path).read)
208
+ eval(File.open(path).read)
201
209
  }
202
210
  run app
203
211
  rescue LoadError