passenger 6.0.3 → 6.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +93 -1
  3. data/CONTRIBUTING.md +1 -1
  4. data/CONTRIBUTORS +3 -0
  5. data/bin/passenger-install-nginx-module +1 -1
  6. data/bin/passenger-memory-stats +65 -12
  7. data/passenger.gemspec +9 -1
  8. data/resources/templates/error_renderer/with_details/dist/bundle.js +1 -1
  9. data/resources/templates/error_renderer/with_details/src/GetHelpView.jsx +1 -1
  10. data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.css +0 -0
  11. data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.js +0 -0
  12. data/resources/templates/error_renderer/with_details/src/bootstrap/config.json +0 -0
  13. data/resources/templates/standalone/rails_asset_pipeline.erb +1 -1
  14. data/resources/templates/standalone/server.erb +1 -0
  15. data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
  16. data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +2 -0
  17. data/src/agent/Core/ApplicationPool/Implementation.cpp +0 -1
  18. data/src/agent/Core/ApplicationPool/Options.h +19 -0
  19. data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +1 -1
  20. data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
  21. data/src/agent/Core/Config.h +3 -1
  22. data/src/agent/Core/Controller.h +1 -0
  23. data/src/agent/Core/Controller/Config.h +9 -1
  24. data/src/agent/Core/Controller/ForwardResponse.cpp +13 -0
  25. data/src/agent/Core/Controller/InitRequest.cpp +5 -0
  26. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -0
  27. data/src/agent/Core/OptionParser.h +3 -0
  28. data/src/agent/Core/SpawningKit/Config.h +11 -0
  29. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +13 -0
  30. data/src/agent/Core/SpawningKit/Spawner.h +1 -0
  31. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +2 -0
  32. data/src/agent/Watchdog/Config.h +3 -1
  33. data/src/apache2_module/Config.cpp +1 -1
  34. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +10 -0
  35. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +10 -0
  36. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +25 -0
  37. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +10 -0
  38. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +6 -0
  39. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +26 -0
  40. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +14 -0
  41. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +34 -0
  42. data/src/apache2_module/Hooks.cpp +4 -0
  43. data/src/cxx_supportlib/Constants.h +4 -2
  44. data/src/cxx_supportlib/Hooks.h +1 -0
  45. data/src/cxx_supportlib/oxt/system_calls.cpp +10 -10
  46. data/src/cxx_supportlib/vendor-modified/modp_b64_data.h +0 -4
  47. data/src/cxx_supportlib/vendor-modified/modp_b64_strict_aliasing.cpp +5 -1
  48. data/src/helper-scripts/node-loader.js +1 -1
  49. data/src/helper-scripts/prespawn +1 -0
  50. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +24 -0
  51. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +14 -0
  52. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +24 -0
  53. data/src/nginx_module/Configuration.c +7 -3
  54. data/src/nginx_module/ContentHandler.c +0 -2
  55. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +16 -0
  56. data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +30 -0
  57. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +29 -0
  58. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +6 -0
  59. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +11 -0
  60. data/src/nginx_module/ngx_http_passenger_module.c +2 -2
  61. data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/logger.js +0 -0
  62. data/src/ruby_supportlib/phusion_passenger.rb +8 -8
  63. data/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb +1 -1
  64. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +15 -0
  65. data/src/ruby_supportlib/phusion_passenger/constants.rb +3 -1
  66. data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +4 -2
  67. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +20 -0
  68. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +1 -1
  69. data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +1 -1
  70. data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +10 -0
  71. data/src/ruby_supportlib/phusion_passenger/request_handler.rb +7 -6
  72. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +13 -0
  73. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +3 -2
  74. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +1 -1
  75. data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +15 -11
  76. metadata +11 -4
@@ -890,7 +890,7 @@ module PhusionPassenger
890
890
  # On macOS >= 10.13 High Sierra /usr/include no longer
891
891
  # exists.
892
892
  xcode_prefix = `/usr/bin/xcode-select -p`.strip
893
- ["-I#{xcode_prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/apr-1" \
893
+ ["-I#{xcode_prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/apr-1 " \
894
894
  "-I#{xcode_prefix}/SDKs/MacOSX.sdk/usr/include/apr-1",
895
895
  '-laprutil-1']
896
896
  else
@@ -279,7 +279,7 @@ module PhusionPassenger
279
279
  "-c '#{filename}' -o '#{filename}.o'",
280
280
  flags)
281
281
  result = run_compiler(description, command, filename, source, true)
282
- result = result && result[:result] && result[:output] !~ /unknown warning option/i
282
+ result = result && result[:result] && result[:output] !~ /unknown warning option|unrecognized command line option/i
283
283
  end
284
284
  return false if !result
285
285
 
@@ -25,6 +25,16 @@
25
25
 
26
26
  PhusionPassenger.require_passenger_lib 'utils/tee_input'
27
27
 
28
+ if defined?(::Rack::BodyProxy) && !::Rack::BodyProxy.new("").respond_to?(:each)
29
+ module ::Rack
30
+ class BodyProxy
31
+ def each
32
+ @body.each { |body| yield body }
33
+ end
34
+ end
35
+ end
36
+ end
37
+
28
38
  module PhusionPassenger
29
39
  module Rack
30
40
 
@@ -99,7 +99,7 @@ module PhusionPassenger
99
99
  if should_use_unix_sockets?
100
100
  @main_socket_address, @main_socket = create_unix_socket_on_filesystem(options)
101
101
  else
102
- @main_socket_address, @main_socket = create_tcp_socket
102
+ @main_socket_address, @main_socket = create_tcp_socket(options)
103
103
  end
104
104
  @server_sockets[:main] = {
105
105
  :address => @main_socket_address,
@@ -109,7 +109,7 @@ module PhusionPassenger
109
109
  :accept_http_requests => true
110
110
  }
111
111
 
112
- @http_socket_address, @http_socket = create_tcp_socket
112
+ @http_socket_address, @http_socket = create_tcp_socket(options)
113
113
  @server_sockets[:http] = {
114
114
  :address => @http_socket_address,
115
115
  :socket => @http_socket,
@@ -309,16 +309,17 @@ module PhusionPassenger
309
309
  end
310
310
  end
311
311
 
312
- def create_tcp_socket
313
- # We use "0.0.0.0" as address in order to force
312
+ def create_tcp_socket(options)
313
+ # We default to "127.0.0.1" as address in order to force
314
314
  # TCPv4 instead of TCPv6.
315
- socket = TCPServer.new('0.0.0.0', 0)
315
+ bind_address = options.fetch('bind_address', '127.0.0.1')
316
+ socket = TCPServer.new(bind_address, 0)
316
317
  socket.listen(BACKLOG_SIZE)
317
318
  socket.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
318
319
  socket.binmode
319
320
  socket.sync = true
320
321
  socket.close_on_exec!
321
- socket_address = "tcp://127.0.0.1:#{socket.addr[1]}"
322
+ socket_address = "tcp://#{bind_address}:#{socket.addr[1]}"
322
323
  return [socket_address, socket]
323
324
  end
324
325
 
@@ -258,6 +258,13 @@ module PhusionPassenger
258
258
  :default => PlatformInfo.ruby_supports_fork? ? DEFAULT_SPAWN_METHOD : 'direct',
259
259
  :desc => 'The spawn method to use. Default: see docs'
260
260
  },
261
+ {
262
+ :name => :direct_instance_request_address,
263
+ :type => :hostname,
264
+ :type_desc => 'HOST',
265
+ :default => '127.0.0.1',
266
+ :desc => "The address that Passenger binds to in order to allow sending HTTP requests to individual application processes.\nDefault: %DEFAULT%"
267
+ },
261
268
  {
262
269
  :name => :static_files_dir,
263
270
  :type => :path,
@@ -436,6 +443,12 @@ module PhusionPassenger
436
443
  :desc => "Cookie name to use for sticky sessions.\n" \
437
444
  "Default: #{DEFAULT_STICKY_SESSIONS_COOKIE_NAME}"
438
445
  },
446
+ {
447
+ :name => :sticky_sessions_cookie_attributes,
448
+ :type_desc => "'NAME1=VALUE1; NAME2'",
449
+ :desc => "The attributes to use for the sticky session cookie.\n" \
450
+ "Default: #{DEFAULT_STICKY_SESSIONS_COOKIE_ATTRIBUTES}"
451
+ },
439
452
  {
440
453
  :name => :vary_turbocache_by_cookie,
441
454
  :type_desc => 'NAME',
@@ -175,6 +175,7 @@ module PhusionPassenger
175
175
  add_flag_param(command, :sticky_sessions, "--sticky-sessions")
176
176
  add_param(command, :vary_turbocache_by_cookie, "--vary-turbocache-by-cookie")
177
177
  add_param(command, :sticky_sessions_cookie_name, "--sticky-sessions-cookie-name")
178
+ add_param(command, :sticky_sessions_cookie_attributes, "--sticky-sessions-cookie-attributes")
178
179
  add_param(command, :ruby, "--ruby")
179
180
  add_param(command, :python, "--python")
180
181
  add_param(command, :nodejs, "--nodejs")
@@ -230,7 +231,7 @@ module PhusionPassenger
230
231
  abort "The '#{option_name}' feature is only available in #{PROGRAM_NAME} " +
231
232
  "Enterprise. You are currently running the open source #{PROGRAM_NAME}. " +
232
233
  "Please learn more about and/or buy #{PROGRAM_NAME} Enterprise at " +
233
- "https://www.phusionpassenger.com/enterprise"
234
+ "https://www.phusionpassenger.com/features#premium-features"
234
235
  end
235
236
  end
236
237
 
@@ -239,7 +240,7 @@ module PhusionPassenger
239
240
  abort "The '#{option_name}' feature is only available in #{PROGRAM_NAME} " +
240
241
  "Enterprise. You are currently running the open source #{PROGRAM_NAME}. " +
241
242
  "Please learn more about and/or buy #{PROGRAM_NAME} Enterprise at " +
242
- "https://www.phusionpassenger.com/enterprise"
243
+ "https://www.phusionpassenger.com/features#premium-features"
243
244
  end
244
245
  end
245
246
 
@@ -286,7 +286,7 @@ module PhusionPassenger
286
286
  if fix_existing_indenting
287
287
  # Remove extraneous indenting by 'if' blocks
288
288
  # and collapse multiple empty newlines
289
- result.gsub!(/;[\n ]+/, ";\n")
289
+ result.gsub!(/;[\n ]+$/, ";\n")
290
290
  end
291
291
 
292
292
  # Set indenting
@@ -24,6 +24,10 @@
24
24
 
25
25
  PhusionPassenger.require_passenger_lib 'utils' # So that we can know whether #writev is supported.
26
26
 
27
+ # https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
28
+ def ruby2_keywords(*)
29
+ end if RUBY_VERSION < "2.7"
30
+
27
31
  module PhusionPassenger
28
32
  module Utils
29
33
 
@@ -117,7 +121,7 @@ module PhusionPassenger
117
121
  raise annotate(e)
118
122
  end
119
123
 
120
- def write_nonblock(string, *args)
124
+ ruby2_keywords def write_nonblock(string, *args)
121
125
  @socket.write_nonblock(string, *args)
122
126
  rescue => e
123
127
  raise annotate(e)
@@ -141,25 +145,25 @@ module PhusionPassenger
141
145
  raise annotate(e)
142
146
  end if IO.method_defined?(:writev3)
143
147
 
144
- def send(*args)
148
+ ruby2_keywords def send(*args)
145
149
  @socket.send(*args)
146
150
  rescue => e
147
151
  raise annotate(e)
148
152
  end
149
153
 
150
- def sendmsg(*args)
154
+ ruby2_keywords def sendmsg(*args)
151
155
  @socket.sendmsg(*args)
152
156
  rescue => e
153
157
  raise annotate(e)
154
158
  end
155
159
 
156
- def sendmsg_nonblock(*args)
160
+ ruby2_keywords def sendmsg_nonblock(*args)
157
161
  @socket.sendmsg_nonblock(*args)
158
162
  rescue => e
159
163
  raise annotate(e)
160
164
  end
161
165
 
162
- def puts(*args)
166
+ ruby2_keywords def puts(*args)
163
167
  @socket.puts(*args)
164
168
  rescue => e
165
169
  raise annotate(e)
@@ -172,7 +176,7 @@ module PhusionPassenger
172
176
  raise annotate(e)
173
177
  end
174
178
 
175
- def read(*args)
179
+ ruby2_keywords def read(*args)
176
180
  if @simulate_eof
177
181
  length, buffer = args
178
182
  if buffer
@@ -191,14 +195,14 @@ module PhusionPassenger
191
195
  raise annotate(e)
192
196
  end
193
197
 
194
- def read_nonblock(*args)
198
+ ruby2_keywords def read_nonblock(*args)
195
199
  raise EOFError, "end of file reached" if @simulate_eof
196
200
  @socket.read_nonblock(*args)
197
201
  rescue => e
198
202
  raise annotate(e)
199
203
  end
200
204
 
201
- def readpartial(*args)
205
+ ruby2_keywords def readpartial(*args)
202
206
  raise EOFError, "end of file reached" if @simulate_eof
203
207
  @socket.readpartial(*args)
204
208
  rescue => e
@@ -212,21 +216,21 @@ module PhusionPassenger
212
216
  raise annotate(e)
213
217
  end
214
218
 
215
- def recv(*args)
219
+ ruby2_keywords def recv(*args)
216
220
  raise EOFError, "end of file reached" if @simulate_eof
217
221
  @socket.recv(*args)
218
222
  rescue => e
219
223
  raise annotate(e)
220
224
  end
221
225
 
222
- def recvfrom(*args)
226
+ ruby2_keywords def recvfrom(*args)
223
227
  raise EOFError, "end of file reached" if @simulate_eof
224
228
  @socket.recvfrom(*args)
225
229
  rescue => e
226
230
  raise annotate(e)
227
231
  end
228
232
 
229
- def recvfrom_nonblock(*args)
233
+ ruby2_keywords def recvfrom_nonblock(*args)
230
234
  raise EOFError, "end of file reached" if @simulate_eof
231
235
  @socket.recvfrom_nonblock(*args)
232
236
  rescue => e
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: passenger
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.3
4
+ version: 6.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phusion - http://www.phusion.nl/
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-12 00:00:00.000000000 Z
11
+ date: 2020-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -4443,7 +4443,14 @@ files:
4443
4443
  - src/schema_printer/SchemaPrinterMain.cpp.cxxcodebuilder
4444
4444
  homepage: https://www.phusionpassenger.com/
4445
4445
  licenses: []
4446
- metadata: {}
4446
+ metadata:
4447
+ bug_tracker_uri: https://github.com/phusion/passenger/issues
4448
+ changelog_uri: https://github.com/phusion/passenger/blob/stable-6.0/CHANGELOG
4449
+ documentation_uri: https://www.phusionpassenger.com/docs/
4450
+ homepage_uri: https://www.phusionpassenger.com/
4451
+ source_code_uri: https://github.com/phusion/passenger
4452
+ mailing_list_uri: https://www.phusionpassenger.com/contact
4453
+ wiki_uri: https://github.com/phusion/passenger/wiki
4447
4454
  post_install_message:
4448
4455
  rdoc_options: []
4449
4456
  require_paths:
@@ -4459,7 +4466,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
4459
4466
  - !ruby/object:Gem::Version
4460
4467
  version: '0'
4461
4468
  requirements: []
4462
- rubyforge_project: passenger
4469
+ rubyforge_project:
4463
4470
  rubygems_version: 2.6.11
4464
4471
  signing_key:
4465
4472
  specification_version: 4