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
@@ -577,10 +577,14 @@ passenger_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
577
577
  |NGX_HTTP_UPSTREAM_FT_OFF;
578
578
  }
579
579
 
580
- ngx_conf_merge_path_value(cf,
580
+ if (ngx_conf_merge_path_value(cf,
581
581
  &conf->upstream_config.temp_path,
582
582
  prev->upstream_config.temp_path,
583
- &ngx_http_proxy_temp_path);
583
+ &ngx_http_proxy_temp_path)
584
+ != NGX_OK)
585
+ {
586
+ return NGX_CONF_ERROR;
587
+ }
584
588
 
585
589
  #if (NGX_HTTP_CACHE)
586
590
 
@@ -1091,7 +1095,7 @@ static char *
1091
1095
  passenger_enterprise_only(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) {
1092
1096
  return ": this feature is only available in Phusion Passenger Enterprise. "
1093
1097
  "You are currently running the open source Phusion Passenger. "
1094
- "Please learn more about and/or buy Phusion Passenger Enterprise at https://www.phusionpassenger.com/enterprise ;";
1098
+ "Please learn more about and/or buy Phusion Passenger Enterprise at https://www.phusionpassenger.com/features#premium-features ;";
1095
1099
  }
1096
1100
  #endif
1097
1101
 
@@ -1824,8 +1824,6 @@ passenger_content_handler(ngx_http_request_t *r)
1824
1824
  return NGX_HTTP_INTERNAL_SERVER_ERROR;
1825
1825
  }
1826
1826
 
1827
- //u->pipe->temp_file->path = u->conf->temp_path;
1828
-
1829
1827
  u->pipe->input_filter = ngx_event_pipe_copy_input_filter;
1830
1828
  u->pipe->input_ctx = r;
1831
1829
 
@@ -69,6 +69,8 @@ passenger_create_autogenerated_loc_conf(passenger_autogenerated_loc_conf_t *con
69
69
  conf->env_vars = NULL;
70
70
  conf->spawn_method.data = NULL;
71
71
  conf->spawn_method.len = 0;
72
+ conf->direct_instance_request_address.data = NULL;
73
+ conf->direct_instance_request_address.len = 0;
72
74
  conf->load_shell_envvars = NGX_CONF_UNSET;
73
75
  conf->max_request_queue_size = NGX_CONF_UNSET_UINT;
74
76
  conf->app_type.data = NULL;
@@ -93,6 +95,8 @@ passenger_create_autogenerated_loc_conf(passenger_autogenerated_loc_conf_t *con
93
95
  conf->sticky_sessions = NGX_CONF_UNSET;
94
96
  conf->sticky_sessions_cookie_name.data = NULL;
95
97
  conf->sticky_sessions_cookie_name.len = 0;
98
+ conf->sticky_sessions_cookie_attributes.data = NULL;
99
+ conf->sticky_sessions_cookie_attributes.len = 0;
96
100
  conf->vary_turbocache_by_cookie.data = NULL;
97
101
  conf->vary_turbocache_by_cookie.len = 0;
98
102
  conf->app_log_file.data = NULL;
@@ -170,6 +174,10 @@ passenger_create_autogenerated_loc_conf(passenger_autogenerated_loc_conf_t *con
170
174
  conf->spawn_method_source_file.len = 0;
171
175
  conf->spawn_method_source_line = 0;
172
176
  conf->spawn_method_explicitly_set = 0;
177
+ conf->direct_instance_request_address_source_file.data = NULL;
178
+ conf->direct_instance_request_address_source_file.len = 0;
179
+ conf->direct_instance_request_address_source_line = 0;
180
+ conf->direct_instance_request_address_explicitly_set = 0;
173
181
  conf->load_shell_envvars_source_file.data = NULL;
174
182
  conf->load_shell_envvars_source_file.len = 0;
175
183
  conf->load_shell_envvars_source_line = 0;
@@ -218,6 +226,10 @@ passenger_create_autogenerated_loc_conf(passenger_autogenerated_loc_conf_t *con
218
226
  conf->document_root_source_file.len = 0;
219
227
  conf->document_root_source_line = 0;
220
228
  conf->document_root_explicitly_set = 0;
229
+ conf->upstream_config_temp_path_source_file.data = NULL;
230
+ conf->upstream_config_temp_path_source_file.len = 0;
231
+ conf->upstream_config_temp_path_source_line = 0;
232
+ conf->upstream_config_temp_path_explicitly_set = 0;
221
233
  conf->upstream_config_ignore_headers_source_file.data = NULL;
222
234
  conf->upstream_config_ignore_headers_source_file.len = 0;
223
235
  conf->upstream_config_ignore_headers_source_line = 0;
@@ -286,6 +298,10 @@ passenger_create_autogenerated_loc_conf(passenger_autogenerated_loc_conf_t *con
286
298
  conf->sticky_sessions_cookie_name_source_file.len = 0;
287
299
  conf->sticky_sessions_cookie_name_source_line = 0;
288
300
  conf->sticky_sessions_cookie_name_explicitly_set = 0;
301
+ conf->sticky_sessions_cookie_attributes_source_file.data = NULL;
302
+ conf->sticky_sessions_cookie_attributes_source_file.len = 0;
303
+ conf->sticky_sessions_cookie_attributes_source_line = 0;
304
+ conf->sticky_sessions_cookie_attributes_explicitly_set = 0;
289
305
  conf->vary_turbocache_by_cookie_source_file.data = NULL;
290
306
  conf->vary_turbocache_by_cookie_source_file.len = 0;
291
307
  conf->vary_turbocache_by_cookie_source_line = 0;
@@ -159,6 +159,12 @@ passenger_serialize_autogenerated_loc_conf_to_headers(ngx_conf_t *cf, passenger_
159
159
  len += sizeof("\r\n") - 1;
160
160
  }
161
161
 
162
+ if (conf->autogenerated.direct_instance_request_address.data != NULL) {
163
+ len += sizeof("!~PASSENGER_DIRECT_INSTANCE_REQUEST_ADDRESS: ") - 1;
164
+ len += conf->autogenerated.direct_instance_request_address.len;
165
+ len += sizeof("\r\n") - 1;
166
+ }
167
+
162
168
  if (conf->autogenerated.load_shell_envvars != NGX_CONF_UNSET) {
163
169
  len += sizeof("!~PASSENGER_LOAD_SHELL_ENVVARS: ") - 1;
164
170
  len += conf->autogenerated.load_shell_envvars
@@ -238,6 +244,12 @@ passenger_serialize_autogenerated_loc_conf_to_headers(ngx_conf_t *cf, passenger_
238
244
  len += sizeof("\r\n") - 1;
239
245
  }
240
246
 
247
+ if (conf->autogenerated.sticky_sessions_cookie_attributes.data != NULL) {
248
+ len += sizeof("!~PASSENGER_STICKY_SESSIONS_COOKIE_ATTRIBUTES: ") - 1;
249
+ len += conf->autogenerated.sticky_sessions_cookie_attributes.len;
250
+ len += sizeof("\r\n") - 1;
251
+ }
252
+
241
253
  if (conf->autogenerated.vary_turbocache_by_cookie.data != NULL) {
242
254
  len += sizeof("!~PASSENGER_VARY_TURBOCACHE_BY_COOKIE: ") - 1;
243
255
  len += conf->autogenerated.vary_turbocache_by_cookie.len;
@@ -411,6 +423,15 @@ passenger_serialize_autogenerated_loc_conf_to_headers(ngx_conf_t *cf, passenger_
411
423
  conf->autogenerated.spawn_method.len);
412
424
  pos = ngx_copy(pos, (const u_char *) "\r\n", sizeof("\r\n") - 1);
413
425
  }
426
+ if (conf->autogenerated.direct_instance_request_address.data != NULL) {
427
+ pos = ngx_copy(pos,
428
+ "!~PASSENGER_DIRECT_INSTANCE_REQUEST_ADDRESS: ",
429
+ sizeof("!~PASSENGER_DIRECT_INSTANCE_REQUEST_ADDRESS: ") - 1);
430
+ pos = ngx_copy(pos,
431
+ conf->autogenerated.direct_instance_request_address.data,
432
+ conf->autogenerated.direct_instance_request_address.len);
433
+ pos = ngx_copy(pos, (const u_char *) "\r\n", sizeof("\r\n") - 1);
434
+ }
414
435
  if (conf->autogenerated.load_shell_envvars != NGX_CONF_UNSET) {
415
436
  pos = ngx_copy(pos,
416
437
  "!~PASSENGER_LOAD_SHELL_ENVVARS: ",
@@ -515,6 +536,15 @@ passenger_serialize_autogenerated_loc_conf_to_headers(ngx_conf_t *cf, passenger_
515
536
  conf->autogenerated.sticky_sessions_cookie_name.len);
516
537
  pos = ngx_copy(pos, (const u_char *) "\r\n", sizeof("\r\n") - 1);
517
538
  }
539
+ if (conf->autogenerated.sticky_sessions_cookie_attributes.data != NULL) {
540
+ pos = ngx_copy(pos,
541
+ "!~PASSENGER_STICKY_SESSIONS_COOKIE_ATTRIBUTES: ",
542
+ sizeof("!~PASSENGER_STICKY_SESSIONS_COOKIE_ATTRIBUTES: ") - 1);
543
+ pos = ngx_copy(pos,
544
+ conf->autogenerated.sticky_sessions_cookie_attributes.data,
545
+ conf->autogenerated.sticky_sessions_cookie_attributes.len);
546
+ pos = ngx_copy(pos, (const u_char *) "\r\n", sizeof("\r\n") - 1);
547
+ }
518
548
  if (conf->autogenerated.vary_turbocache_by_cookie.data != NULL) {
519
549
  pos = ngx_copy(pos,
520
550
  "!~PASSENGER_VARY_TURBOCACHE_BY_COOKIE: ",
@@ -291,6 +291,20 @@ generate_config_manifest_for_autogenerated_loc_conf(manifest_gen_ctx_t *ctx, pas
291
291
  (const char *) plcf->autogenerated.spawn_method.data,
292
292
  plcf->autogenerated.spawn_method.len);
293
293
  }
294
+ if (plcf->autogenerated.direct_instance_request_address_explicitly_set) {
295
+ find_or_create_manifest_app_and_loc_options_containers(ctx,
296
+ plcf, cscf, clcf, &app_options_container, &loc_options_container);
297
+ option_container = find_or_create_manifest_option_container(ctx,
298
+ app_options_container,
299
+ "passenger_direct_instance_request_address",
300
+ sizeof("passenger_direct_instance_request_address") - 1);
301
+ hierarchy_member = add_manifest_option_container_hierarchy_member(option_container,
302
+ &plcf->autogenerated.direct_instance_request_address_source_file,
303
+ plcf->autogenerated.direct_instance_request_address_source_line);
304
+ psg_json_value_set_str(hierarchy_member, "value",
305
+ (const char *) plcf->autogenerated.direct_instance_request_address.data,
306
+ plcf->autogenerated.direct_instance_request_address.len);
307
+ }
294
308
  if (plcf->autogenerated.load_shell_envvars_explicitly_set) {
295
309
  find_or_create_manifest_app_and_loc_options_containers(ctx,
296
310
  plcf, cscf, clcf, &app_options_container, &loc_options_container);
@@ -622,6 +636,20 @@ generate_config_manifest_for_autogenerated_loc_conf(manifest_gen_ctx_t *ctx, pas
622
636
  (const char *) plcf->autogenerated.sticky_sessions_cookie_name.data,
623
637
  plcf->autogenerated.sticky_sessions_cookie_name.len);
624
638
  }
639
+ if (plcf->autogenerated.sticky_sessions_cookie_attributes_explicitly_set) {
640
+ find_or_create_manifest_app_and_loc_options_containers(ctx,
641
+ plcf, cscf, clcf, &app_options_container, &loc_options_container);
642
+ option_container = find_or_create_manifest_option_container(ctx,
643
+ loc_options_container,
644
+ "passenger_sticky_sessions_cookie_attributes",
645
+ sizeof("passenger_sticky_sessions_cookie_attributes") - 1);
646
+ hierarchy_member = add_manifest_option_container_hierarchy_member(option_container,
647
+ &plcf->autogenerated.sticky_sessions_cookie_attributes_source_file,
648
+ plcf->autogenerated.sticky_sessions_cookie_attributes_source_line);
649
+ psg_json_value_set_str(hierarchy_member, "value",
650
+ (const char *) plcf->autogenerated.sticky_sessions_cookie_attributes.data,
651
+ plcf->autogenerated.sticky_sessions_cookie_attributes.len);
652
+ }
625
653
  if (plcf->autogenerated.vary_turbocache_by_cookie_explicitly_set) {
626
654
  find_or_create_manifest_app_and_loc_options_containers(ctx,
627
655
  plcf, cscf, clcf, &app_options_container, &loc_options_container);
@@ -653,6 +681,7 @@ generate_config_manifest_for_autogenerated_loc_conf(manifest_gen_ctx_t *ctx, pas
653
681
 
654
682
  /*
655
683
  * No autogenerated code for:
684
+ * passenger_temp_path
656
685
  * passenger_ignore_headers
657
686
  * passenger_buffer_size
658
687
  * passenger_buffers
@@ -101,6 +101,9 @@ passenger_merge_autogenerated_loc_conf(passenger_autogenerated_loc_conf_t *conf,
101
101
  ngx_conf_merge_str_value(conf->spawn_method,
102
102
  prev->spawn_method,
103
103
  NULL);
104
+ ngx_conf_merge_str_value(conf->direct_instance_request_address,
105
+ prev->direct_instance_request_address,
106
+ "127.0.0.1");
104
107
  ngx_conf_merge_value(conf->load_shell_envvars,
105
108
  prev->load_shell_envvars,
106
109
  1);
@@ -157,6 +160,9 @@ passenger_merge_autogenerated_loc_conf(passenger_autogenerated_loc_conf_t *conf,
157
160
  ngx_conf_merge_str_value(conf->sticky_sessions_cookie_name,
158
161
  prev->sticky_sessions_cookie_name,
159
162
  "_passenger_route");
163
+ ngx_conf_merge_str_value(conf->sticky_sessions_cookie_attributes,
164
+ prev->sticky_sessions_cookie_attributes,
165
+ "SameSite=Lax; Secure;");
160
166
  ngx_conf_merge_str_value(conf->vary_turbocache_by_cookie,
161
167
  prev->vary_turbocache_by_cookie,
162
168
  NULL);
@@ -65,6 +65,7 @@ typedef struct {
65
65
  ngx_str_t app_root;
66
66
  ngx_str_t app_start_command;
67
67
  ngx_str_t app_type;
68
+ ngx_str_t direct_instance_request_address;
68
69
  ngx_str_t document_root;
69
70
  ngx_str_t environment;
70
71
  ngx_str_t group;
@@ -75,6 +76,7 @@ typedef struct {
75
76
  ngx_str_t ruby;
76
77
  ngx_str_t spawn_method;
77
78
  ngx_str_t startup_file;
79
+ ngx_str_t sticky_sessions_cookie_attributes;
78
80
  ngx_str_t sticky_sessions_cookie_name;
79
81
  ngx_str_t user;
80
82
  ngx_str_t vary_turbocache_by_cookie;
@@ -89,6 +91,7 @@ typedef struct {
89
91
  ngx_str_t base_uris_source_file;
90
92
  ngx_str_t buffer_upload_source_file;
91
93
  ngx_str_t debugger_source_file;
94
+ ngx_str_t direct_instance_request_address_source_file;
92
95
  ngx_str_t document_root_source_file;
93
96
  ngx_str_t enabled_source_file;
94
97
  ngx_str_t env_vars_source_file;
@@ -115,6 +118,7 @@ typedef struct {
115
118
  ngx_str_t start_timeout_source_file;
116
119
  ngx_str_t startup_file_source_file;
117
120
  ngx_str_t sticky_sessions_source_file;
121
+ ngx_str_t sticky_sessions_cookie_attributes_source_file;
118
122
  ngx_str_t sticky_sessions_cookie_name_source_file;
119
123
  ngx_str_t upstream_config_buffer_size_source_file;
120
124
  ngx_str_t upstream_config_buffering_source_file;
@@ -126,6 +130,7 @@ typedef struct {
126
130
  ngx_str_t upstream_config_pass_headers_source_file;
127
131
  ngx_str_t upstream_config_read_timeout_source_file;
128
132
  ngx_str_t upstream_config_request_buffering_source_file;
133
+ ngx_str_t upstream_config_temp_path_source_file;
129
134
  ngx_str_t user_source_file;
130
135
  ngx_str_t vary_turbocache_by_cookie_source_file;
131
136
 
@@ -139,6 +144,7 @@ typedef struct {
139
144
  ngx_uint_t base_uris_source_line;
140
145
  ngx_uint_t buffer_upload_source_line;
141
146
  ngx_uint_t debugger_source_line;
147
+ ngx_uint_t direct_instance_request_address_source_line;
142
148
  ngx_uint_t document_root_source_line;
143
149
  ngx_uint_t enabled_source_line;
144
150
  ngx_uint_t env_vars_source_line;
@@ -165,6 +171,7 @@ typedef struct {
165
171
  ngx_uint_t start_timeout_source_line;
166
172
  ngx_uint_t startup_file_source_line;
167
173
  ngx_uint_t sticky_sessions_source_line;
174
+ ngx_uint_t sticky_sessions_cookie_attributes_source_line;
168
175
  ngx_uint_t sticky_sessions_cookie_name_source_line;
169
176
  ngx_uint_t upstream_config_buffer_size_source_line;
170
177
  ngx_uint_t upstream_config_buffering_source_line;
@@ -176,6 +183,7 @@ typedef struct {
176
183
  ngx_uint_t upstream_config_pass_headers_source_line;
177
184
  ngx_uint_t upstream_config_read_timeout_source_line;
178
185
  ngx_uint_t upstream_config_request_buffering_source_line;
186
+ ngx_uint_t upstream_config_temp_path_source_line;
179
187
  ngx_uint_t user_source_line;
180
188
  ngx_uint_t vary_turbocache_by_cookie_source_line;
181
189
 
@@ -189,6 +197,7 @@ typedef struct {
189
197
  ngx_int_t base_uris_explicitly_set;
190
198
  ngx_int_t buffer_upload_explicitly_set;
191
199
  ngx_int_t debugger_explicitly_set;
200
+ ngx_int_t direct_instance_request_address_explicitly_set;
192
201
  ngx_int_t document_root_explicitly_set;
193
202
  ngx_int_t enabled_explicitly_set;
194
203
  ngx_int_t env_vars_explicitly_set;
@@ -215,6 +224,7 @@ typedef struct {
215
224
  ngx_int_t start_timeout_explicitly_set;
216
225
  ngx_int_t startup_file_explicitly_set;
217
226
  ngx_int_t sticky_sessions_explicitly_set;
227
+ ngx_int_t sticky_sessions_cookie_attributes_explicitly_set;
218
228
  ngx_int_t sticky_sessions_cookie_name_explicitly_set;
219
229
  ngx_int_t upstream_config_buffer_size_explicitly_set;
220
230
  ngx_int_t upstream_config_buffering_explicitly_set;
@@ -226,6 +236,7 @@ typedef struct {
226
236
  ngx_int_t upstream_config_pass_headers_explicitly_set;
227
237
  ngx_int_t upstream_config_read_timeout_explicitly_set;
228
238
  ngx_int_t upstream_config_request_buffering_explicitly_set;
239
+ ngx_int_t upstream_config_temp_path_explicitly_set;
229
240
  ngx_int_t user_explicitly_set;
230
241
  ngx_int_t vary_turbocache_by_cookie_explicitly_set;
231
242
  } passenger_autogenerated_loc_conf_t;
@@ -43,9 +43,9 @@
43
43
 
44
44
  #define MODP_B64_DONT_INCLUDE_BOOST_ENDIANNESS_HEADERS
45
45
  #if NGX_HAVE_LITTLE_ENDIAN
46
- #define BOOST_LITTLE_ENDIAN
46
+ #define BOOST_ENDIAN_LITTLE_BYTE
47
47
  #else
48
- #define BOOST_BIG_ENDIAN
48
+ #define BOOST_ENDIAN_BIG_BYTE
49
49
  #endif
50
50
 
51
51
  #include "ngx_http_passenger_module.h"
@@ -31,20 +31,20 @@ 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.3'
34
+ VERSION_STRING = '6.0.7'
35
35
 
36
36
  # Tip: find the SHA-256 with ./dev/nginx_version_sha2 <VERSION>
37
- PREFERRED_NGINX_VERSION = '1.17.3'
38
- NGINX_SHA256_CHECKSUM = '3b84fe1c2cf9ca22fde370e486a9ab16b6427df1b6ea62cdb61978c9f34d0f3c'
37
+ PREFERRED_NGINX_VERSION = '1.18.0'
38
+ NGINX_SHA256_CHECKSUM = '4c373e7ab5bf91d34a4f11a0c9496561061ba5eee6020db272a17a7228d35f99'
39
39
 
40
40
  # Packaging may be locked to an older version due to the specific module configuration being
41
41
  # incompatible with the version we prefer (latest stable).
42
- PACKAGING_PREFERRED_NGINX_VERSION = '1.17.3'
43
- PACKAGING_NGINX_SHA256_CHECKSUM = '3b84fe1c2cf9ca22fde370e486a9ab16b6427df1b6ea62cdb61978c9f34d0f3c'
42
+ PACKAGING_PREFERRED_NGINX_VERSION = '1.18.0'
43
+ PACKAGING_NGINX_SHA256_CHECKSUM = '4c373e7ab5bf91d34a4f11a0c9496561061ba5eee6020db272a17a7228d35f99'
44
44
 
45
45
  # sha256sum of the .tar.gz
46
- PREFERRED_PCRE_VERSION = '8.43'
47
- PCRE_SHA256_CHECKSUM = '0b8e7465dc5e98c757cc3650a20a7843ee4c3edf50aaf60bb33fd879690d2c73'
46
+ PREFERRED_PCRE_VERSION = '8.44'
47
+ PCRE_SHA256_CHECKSUM = 'aecafd4af3bd0f3935721af77b889d9024b2e01d96b58471bd91a3063fb47728'
48
48
 
49
49
  STANDALONE_INTERFACE_VERSION = 1
50
50
 
@@ -258,7 +258,7 @@ module PhusionPassenger
258
258
  end
259
259
 
260
260
 
261
- private
261
+ private
262
262
  def self.infer_install_spec
263
263
  filename = ENV['PASSENGER_LOCATION_CONFIGURATION_FILE']
264
264
  return filename if filename && !filename.empty?
@@ -294,7 +294,7 @@ module PhusionPassenger
294
294
  else
295
295
  return total
296
296
  end
297
- rescue Errno::EACCES, Errno::ENOENT
297
+ rescue Errno::EACCES, Errno::ENOENT, Errno::ESRCH
298
298
  return nil
299
299
  end
300
300
 
@@ -444,6 +444,12 @@ APACHE2_CONFIGURATION_OPTIONS = [
444
444
  :desc => 'The spawn method to use.',
445
445
  :function => 'cmd_passenger_spawn_method'
446
446
  },
447
+ {
448
+ :name => 'PassengerDirectInstanceRequestAddress',
449
+ :type => :string,
450
+ :default => DEFAULT_BIND_ADDRESS,
451
+ :desc => 'The address that Passenger binds to in order to allow sending HTTP requests to individual application processes.'
452
+ },
447
453
  {
448
454
  :name => 'PassengerFriendlyErrorPages',
449
455
  :type => :flag,
@@ -547,6 +553,15 @@ APACHE2_CONFIGURATION_OPTIONS = [
547
553
  :default_expr => 'DEFAULT_STICKY_SESSIONS_COOKIE_NAME',
548
554
  :desc => 'The cookie name to use for sticky sessions.'
549
555
  },
556
+ {
557
+ :name => 'PassengerStickySessionsCookieAttributes',
558
+ :type => :string,
559
+ :context => :location,
560
+ :htaccess_context => ['OR_ALL'],
561
+ :default => DEFAULT_STICKY_SESSIONS_COOKIE_ATTRIBUTES,
562
+ :default_expr => 'DEFAULT_STICKY_SESSIONS_COOKIE_ATTRIBUTES',
563
+ :desc => 'The attributes to use for the sticky session cookie.'
564
+ },
550
565
  {
551
566
  :name => 'PassengerBufferResponse',
552
567
  :type => :flag,
@@ -58,10 +58,12 @@ module PhusionPassenger
58
58
  DEFAULT_WEB_APP_USER = "nobody"
59
59
  DEFAULT_APP_ENV = "production"
60
60
  DEFAULT_SPAWN_METHOD = "smart"
61
+ DEFAULT_BIND_ADDRESS = "127.0.0.1"
61
62
  # Apache's unixd.h also defines DEFAULT_USER, so we avoid naming clash here.
62
63
  PASSENGER_DEFAULT_USER = "nobody"
63
64
  DEFAULT_CONCURRENCY_MODEL = "process"
64
65
  DEFAULT_STICKY_SESSIONS_COOKIE_NAME = "_passenger_route"
66
+ DEFAULT_STICKY_SESSIONS_COOKIE_ATTRIBUTES = "SameSite=Lax; Secure;"
65
67
  DEFAULT_APP_THREAD_COUNT = 1
66
68
  DEFAULT_RESPONSE_BUFFER_HIGH_WATERMARK = 1024 * 1024 * 128
67
69
  DEFAULT_MAX_REQUEST_QUEUE_SIZE = 100
@@ -115,7 +117,7 @@ module PhusionPassenger
115
117
  PROGRAM_WEBSITE = "https://www.phusionpassenger.com"
116
118
  PROGRAM_AUTHOR = "Phusion"
117
119
  SUPPORT_URL = "https://www.phusionpassenger.com/support"
118
- ENTERPRISE_URL = "https://www.phusionpassenger.com/enterprise"
120
+ ENTERPRISE_URL = "https://www.phusionpassenger.com/features#premium-features"
119
121
  GLOBAL_NAMESPACE_DIRNAME = PhusionPassenger::GLOBAL_NAMESPACE_DIRNAME_
120
122
  # Subdirectory under $HOME to use for storing stuff.
121
123
  USER_NAMESPACE_DIRNAME = PhusionPassenger::USER_NAMESPACE_DIRNAME_
@@ -316,9 +316,11 @@ module PhusionPassenger
316
316
  ActiveRecord::Base.clear_all_connections!
317
317
  elsif ActiveRecord::Base.respond_to?(:clear_active_connections!)
318
318
  ActiveRecord::Base.clear_active_connections!
319
- elsif ActiveRecord::Base.respond_to?(:connected?) &&
320
- ActiveRecord::Base.connected?
319
+ end
320
+ begin
321
321
  ActiveRecord::Base.establish_connection
322
+ rescue
323
+ DebugLogging.debug('ActiveRecord is not configured, start it yourself')
322
324
  end
323
325
  end
324
326
 
@@ -476,6 +476,12 @@ NGINX_CONFIGURATION_OPTIONS = [
476
476
  :dynamic_default => "'smart' for Ruby apps, 'direct' for all other apps",
477
477
  :type => :string
478
478
  },
479
+ {
480
+ :name => 'passenger_direct_instance_request_address',
481
+ :scope => :application,
482
+ :default => DEFAULT_BIND_ADDRESS,
483
+ :type => :string
484
+ },
479
485
  {
480
486
  :name => 'passenger_load_shell_envvars',
481
487
  :scope => :application,
@@ -556,6 +562,14 @@ NGINX_CONFIGURATION_OPTIONS = [
556
562
  :type => :string,
557
563
  :header => nil
558
564
  },
565
+ {
566
+ :name => 'passenger_temp_path',
567
+ :scope => :location,
568
+ :type => :string,
569
+ :function => 'ngx_conf_set_path_slot',
570
+ :field => 'upstream_config.temp_path',
571
+ :auto_generate_nginx_tracking_code => false
572
+ },
559
573
  {
560
574
  :name => 'passenger_ignore_headers',
561
575
  :scope => :location,
@@ -681,6 +695,12 @@ NGINX_CONFIGURATION_OPTIONS = [
681
695
  :type => :string,
682
696
  :default => DEFAULT_STICKY_SESSIONS_COOKIE_NAME
683
697
  },
698
+ {
699
+ :name => 'passenger_sticky_sessions_cookie_attributes',
700
+ :scope => :location,
701
+ :type => :string,
702
+ :default => DEFAULT_STICKY_SESSIONS_COOKIE_ATTRIBUTES
703
+ },
684
704
  {
685
705
  :name => 'passenger_vary_turbocache_by_cookie',
686
706
  :scope => :location,