passenger 6.0.13 → 6.0.14
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/CHANGELOG +24 -1
- data/bin/passenger-status +29 -4
- data/build/test_basics.rb +2 -2
- data/doc/templates/markdown.html.erb +2 -6
- data/package.json +19 -17
- data/resources/templates/error_renderer/with_details/dist/bundle.js +2 -33
- data/resources/templates/error_renderer/with_details/dist/styles.css +2 -2
- data/resources/templates/error_renderer/with_details/src/index.html.template +0 -2
- data/resources/templates/error_renderer/with_details/webpack.config.js +13 -16
- data/resources/templates/error_renderer/without_details/dist/bundle.js +0 -1
- data/resources/templates/error_renderer/without_details/dist/styles.css +1 -1
- data/resources/templates/error_renderer/without_details/webpack.config.js +13 -16
- data/src/agent/Core/ApiServer.h +35 -0
- data/src/agent/Core/ApplicationPool/Pool.h +9 -1
- data/src/agent/Core/Config.h +2 -1
- data/src/agent/Core/Controller/Config.h +2 -1
- data/src/agent/Core/Controller/InternalUtils.cpp +1 -1
- data/src/agent/Core/Controller.h +1 -1
- data/src/agent/Watchdog/Config.h +2 -1
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/ruby_supportlib/phusion_passenger/config/restart_app_command.rb +16 -12
- data/src/ruby_supportlib/phusion_passenger/console_text_template.rb +7 -2
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +28 -17
- data/src/ruby_supportlib/phusion_passenger.rb +1 -1
- metadata +2 -2
@@ -25,7 +25,7 @@
|
|
25
25
|
require 'optparse'
|
26
26
|
require 'net/http'
|
27
27
|
require 'socket'
|
28
|
-
require '
|
28
|
+
require 'json'
|
29
29
|
PhusionPassenger.require_passenger_lib 'constants'
|
30
30
|
PhusionPassenger.require_passenger_lib 'admin_tools/instance_registry'
|
31
31
|
PhusionPassenger.require_passenger_lib 'config/command'
|
@@ -148,8 +148,8 @@ module PhusionPassenger
|
|
148
148
|
end
|
149
149
|
|
150
150
|
def select_app_group_name_exact(name)
|
151
|
-
|
152
|
-
if group
|
151
|
+
query_pool_json.each do |group|
|
152
|
+
if group[:name] == name
|
153
153
|
@groups << group
|
154
154
|
end
|
155
155
|
end
|
@@ -161,8 +161,8 @@ module PhusionPassenger
|
|
161
161
|
|
162
162
|
def query_group_names
|
163
163
|
result = []
|
164
|
-
|
165
|
-
result << group
|
164
|
+
query_pool_json.each do |group|
|
165
|
+
result << group[:name]
|
166
166
|
end
|
167
167
|
result << "Cancel"
|
168
168
|
result
|
@@ -204,8 +204,8 @@ module PhusionPassenger
|
|
204
204
|
app_root = Dir.pwd
|
205
205
|
end
|
206
206
|
regex = /^#{Regexp.escape(app_root)}/
|
207
|
-
|
208
|
-
if group
|
207
|
+
query_pool_json.each do |group|
|
208
|
+
if group[:app_root] =~ regex
|
209
209
|
@groups << group
|
210
210
|
end
|
211
211
|
end
|
@@ -218,7 +218,7 @@ module PhusionPassenger
|
|
218
218
|
def perform_restart
|
219
219
|
restart_method = @options[:rolling_restart] ? "rolling" : "blocking"
|
220
220
|
@groups.each do |group|
|
221
|
-
group_name = group
|
221
|
+
group_name = group[:name]
|
222
222
|
puts "Restarting #{group_name}"
|
223
223
|
request = Net::HTTP::Post.new("/pool/restart_app_group.json")
|
224
224
|
try_performing_full_admin_basic_auth(request, @instance)
|
@@ -249,15 +249,19 @@ module PhusionPassenger
|
|
249
249
|
end
|
250
250
|
end
|
251
251
|
|
252
|
-
def
|
253
|
-
request = Net::HTTP::Get.new("/pool.
|
252
|
+
def query_pool_json
|
253
|
+
request = Net::HTTP::Get.new("/pool.json")
|
254
254
|
try_performing_ro_admin_basic_auth(request, @instance)
|
255
255
|
response = @instance.http_request("agents.s/core_api", request)
|
256
256
|
if response.code.to_i / 100 == 2
|
257
|
-
|
257
|
+
if RUBY_VERSION >= '2.3'
|
258
|
+
JSON.parse(response.body, symbolize_names: true).to_a.map{|(key,value)| {name: key.to_s, app_root: value.dig(:app_root,0,:value)}}
|
259
|
+
else
|
260
|
+
JSON.parse(response.body, symbolize_names: true).to_a.map{|(key,value)| {name: key.to_s, app_root: value[:app_root][0][:value]}}
|
261
|
+
end
|
258
262
|
elsif response.code.to_i == 401
|
259
263
|
if response["pool-empty"] == "true"
|
260
|
-
|
264
|
+
[]
|
261
265
|
elsif @options[:ignore_app_not_running]
|
262
266
|
print_instance_querying_permission_error
|
263
267
|
exit
|
@@ -40,8 +40,13 @@ module PhusionPassenger
|
|
40
40
|
data = input[:text]
|
41
41
|
end
|
42
42
|
@colors = options[:colors] || AnsiColors.new
|
43
|
-
|
44
|
-
|
43
|
+
|
44
|
+
if RUBY_VERSION >= '2.6'
|
45
|
+
@template = ERB.new(@colors.ansi_colorize(data), trim_mode: '-', eoutvar: '@buffer')
|
46
|
+
else
|
47
|
+
@template = ERB.new(@colors.ansi_colorize(data), nil, '-', '@buffer')
|
48
|
+
end
|
49
|
+
|
45
50
|
@template.filename = filename if filename
|
46
51
|
options.each_pair do |name, value|
|
47
52
|
self[name] = value
|
@@ -75,7 +75,7 @@ module PhusionPassenger
|
|
75
75
|
#
|
76
76
|
# Connect to the engine's server and wait until it disconnects the socket
|
77
77
|
# because of timeout. Keep doing this until we can no longer connect.
|
78
|
-
|
78
|
+
loop do
|
79
79
|
if @options[:socket_file]
|
80
80
|
socket = UNIXSocket.new(@options[:socket_file])
|
81
81
|
else
|
@@ -110,14 +110,14 @@ module PhusionPassenger
|
|
110
110
|
command = "#{Shellwords.escape @nginx_binary}" \
|
111
111
|
" -c #{Shellwords.escape path}" \
|
112
112
|
" -p #{Shellwords.escape @working_dir}" \
|
113
|
-
|
113
|
+
' -t'
|
114
114
|
output = `#{command} 2>&1`
|
115
115
|
if $? && $?.exitstatus != 0
|
116
116
|
output.gsub!(path, file)
|
117
117
|
output = PlatformInfo.send(:reindent, output, 4)
|
118
118
|
|
119
119
|
message = "*** ERROR: the Nginx configuration that #{PROGRAM_NAME}" \
|
120
|
-
|
120
|
+
' Standalone generated internally contains problems. The error ' \
|
121
121
|
"message returned by the Nginx engine is:\n\n" \
|
122
122
|
"#{output}\n\n"
|
123
123
|
debug_log_file = Utils::TmpIO.new('passenger-standalone',
|
@@ -130,16 +130,16 @@ module PhusionPassenger
|
|
130
130
|
debug_log_file.close
|
131
131
|
end
|
132
132
|
if @options[:nginx_config_template] && file == 'nginx.conf'
|
133
|
-
message <<
|
133
|
+
message << 'This probably means that you have a problem in your ' \
|
134
134
|
"Nginx configuration template. Please fix your template.\n\n" \
|
135
135
|
"Tip: to debug your template, re-run #{SHORT_PROGRAM_NAME} " \
|
136
|
-
|
137
|
-
|
136
|
+
'Standalone with the `--debug-nginx-config` option. This ' \
|
137
|
+
'allows you to see how the final Nginx config file looks like.'
|
138
138
|
else
|
139
|
-
message <<
|
139
|
+
message << 'This probably means that you have found a bug in ' \
|
140
140
|
"#{PROGRAM_NAME} Standalone. Please report this bug to our " \
|
141
141
|
"Github issue tracker: https://github.com/phusion/passenger/issues\n\n" \
|
142
|
-
|
142
|
+
'In the bug report, please include this error message, as ' \
|
143
143
|
"well as the contents of the file #{debug_log_file.path}"
|
144
144
|
end
|
145
145
|
|
@@ -155,13 +155,13 @@ module PhusionPassenger
|
|
155
155
|
end
|
156
156
|
return {
|
157
157
|
:identifier => 'Nginx',
|
158
|
-
:start_command => "#{Shellwords.escape @nginx_binary} "
|
159
|
-
"-c #{Shellwords.escape nginx_config_path} "
|
158
|
+
:start_command => "#{Shellwords.escape @nginx_binary} " \
|
159
|
+
"-c #{Shellwords.escape nginx_config_path} " \
|
160
160
|
"-p #{Shellwords.escape @working_dir}",
|
161
|
-
:stop_command => "#{Shellwords.escape @nginx_binary} "
|
162
|
-
"-c #{Shellwords.escape nginx_config_path} "
|
163
|
-
"-p #{Shellwords.escape @working_dir} "
|
164
|
-
|
161
|
+
:stop_command => "#{Shellwords.escape @nginx_binary} " \
|
162
|
+
"-c #{Shellwords.escape nginx_config_path} " \
|
163
|
+
"-p #{Shellwords.escape @working_dir} " \
|
164
|
+
'-s quit',
|
165
165
|
:ping_command => ping_spec,
|
166
166
|
:pid_file => @options[:pid_file],
|
167
167
|
:log_file => @options[:log_file],
|
@@ -179,8 +179,13 @@ module PhusionPassenger
|
|
179
179
|
def write_nginx_config_file(path)
|
180
180
|
File.open(path, 'w') do |f|
|
181
181
|
f.chmod(0644)
|
182
|
-
|
183
|
-
|
182
|
+
|
183
|
+
if RUBY_VERSION >= '2.6'
|
184
|
+
erb = ERB.new(File.read(nginx_config_template_filename), trim_mode: "-", eoutvar: next_eoutvar)
|
185
|
+
else
|
186
|
+
erb = ERB.new(File.read(nginx_config_template_filename), nil, '-', next_eoutvar)
|
187
|
+
end
|
188
|
+
|
184
189
|
erb.filename = nginx_config_template_filename
|
185
190
|
|
186
191
|
# The template requires some helper methods which are defined in start_command.rb.
|
@@ -279,7 +284,13 @@ module PhusionPassenger
|
|
279
284
|
|
280
285
|
def include_passenger_internal_template(name, indent = 0, fix_existing_indenting = true, the_binding = get_binding)
|
281
286
|
path = "#{PhusionPassenger.resources_dir}/templates/standalone/#{name}"
|
282
|
-
|
287
|
+
|
288
|
+
if RUBY_VERSION >= '2.6'
|
289
|
+
erb = ERB.new(File.read(path), trim_mode: "-", eoutvar: next_eoutvar)
|
290
|
+
else
|
291
|
+
erb = ERB.new(File.read(path), nil, "-", next_eoutvar)
|
292
|
+
end
|
293
|
+
|
283
294
|
erb.filename = path
|
284
295
|
result = erb.result(the_binding)
|
285
296
|
|
@@ -31,7 +31,7 @@ module PhusionPassenger
|
|
31
31
|
|
32
32
|
PACKAGE_NAME = 'passenger'
|
33
33
|
# Run 'rake src/cxx_supportlib/Constants.h configkit_schemas_inline_comments' after changing this number.
|
34
|
-
VERSION_STRING = '6.0.
|
34
|
+
VERSION_STRING = '6.0.14'
|
35
35
|
|
36
36
|
# Tip: find the SHA-256 with ./dev/nginx_version_sha2 <VERSION>
|
37
37
|
PREFERRED_NGINX_VERSION = '1.20.2'
|
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.
|
4
|
+
version: 6.0.14
|
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: 2022-
|
11
|
+
date: 2022-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|