passenger 5.0.30 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +30 -1
  3. data/CONTRIBUTING.md +1 -1
  4. data/CONTRIBUTORS +2 -0
  5. data/bin/passenger-install-nginx-module +18 -13
  6. data/build/agent.rb +1 -0
  7. data/build/basics.rb +1 -0
  8. data/build/cxx_tests.rb +6 -1
  9. data/build/misc.rb +3 -0
  10. data/build/packaging.rb +5 -17
  11. data/build/support/cxx_dependency_map.rb +100 -0
  12. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +4 -1
  13. data/build/test_basics.rb +12 -2
  14. data/dev/ci/run_travis.sh +6 -2
  15. data/doc/Users guide Apache.html +7 -2
  16. data/doc/Users guide Apache.txt +4 -0
  17. data/resources/templates/error_layout.css +70 -84
  18. data/resources/templates/error_layout.html.template +84 -93
  19. data/resources/templates/standalone/http.erb +17 -13
  20. data/resources/templates/standalone/server.erb +2 -1
  21. data/resources/templates/undisclosed_error.html.template +52 -51
  22. data/resources/update_check_client_cert.p12 +0 -0
  23. data/resources/update_check_client_cert.pem +89 -0
  24. data/resources/update_check_server_pubkey.pem +14 -0
  25. data/src/agent/Core/ApplicationPool/ErrorRenderer.h +15 -1
  26. data/src/agent/Core/Controller.h +3 -2
  27. data/src/agent/Core/Controller/CheckoutSession.cpp +5 -4
  28. data/src/agent/Core/Controller/ForwardResponse.cpp +1 -1
  29. data/src/agent/Core/Controller/InitRequest.cpp +2 -0
  30. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -0
  31. data/src/agent/Core/Controller/Request.h +1 -0
  32. data/src/agent/Core/CoreMain.cpp +99 -2
  33. data/src/agent/Core/OptionParser.h +18 -1
  34. data/src/agent/Core/SecurityUpdateChecker.h +559 -0
  35. data/src/agent/Shared/Base.cpp +6 -1
  36. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +52 -0
  37. data/src/agent/Watchdog/InstanceDirToucher.cpp +1 -2
  38. data/src/agent/Watchdog/WatchdogMain.cpp +31 -40
  39. data/src/apache2_module/Configuration.cpp +12 -0
  40. data/src/apache2_module/Configuration.hpp +5 -0
  41. data/src/apache2_module/ConfigurationCommands.cpp +19 -19
  42. data/src/apache2_module/ConfigurationCommands.cpp.cxxcodebuilder +2 -2
  43. data/src/apache2_module/ConfigurationFields.hpp +19 -19
  44. data/src/apache2_module/ConfigurationFields.hpp.cxxcodebuilder +2 -2
  45. data/src/apache2_module/ConfigurationSetters.cpp +19 -19
  46. data/src/apache2_module/ConfigurationSetters.cpp.cxxcodebuilder +2 -2
  47. data/src/apache2_module/CreateDirConfig.cpp +19 -19
  48. data/src/apache2_module/CreateDirConfig.cpp.cxxcodebuilder +2 -2
  49. data/src/apache2_module/Hooks.cpp +10 -1
  50. data/src/apache2_module/MergeDirConfig.cpp +19 -19
  51. data/src/apache2_module/MergeDirConfig.cpp.cxxcodebuilder +2 -2
  52. data/src/apache2_module/SetHeaders.cpp +19 -19
  53. data/src/apache2_module/SetHeaders.cpp.cxxcodebuilder +2 -2
  54. data/src/cxx_supportlib/Constants.h +22 -22
  55. data/src/cxx_supportlib/Constants.h.cxxcodebuilder +4 -1
  56. data/src/cxx_supportlib/Crypto.cpp +977 -0
  57. data/src/cxx_supportlib/Crypto.h +147 -0
  58. data/src/cxx_supportlib/InstanceDirectory.h +55 -2
  59. data/src/cxx_supportlib/Utils/Curl.h +24 -10
  60. data/src/cxx_supportlib/Utils/JsonUtils.h +1 -1
  61. data/src/cxx_supportlib/oxt/detail/spin_lock_darwin.hpp +2 -0
  62. data/src/cxx_supportlib/vendor-modified/boost/system/error_code.hpp +3 -3
  63. data/src/cxx_supportlib/vendor-modified/jsoncpp/json-forwards.h +167 -92
  64. data/src/cxx_supportlib/vendor-modified/jsoncpp/json.h +1827 -1542
  65. data/src/cxx_supportlib/vendor-modified/jsoncpp/jsoncpp.cpp +4705 -3652
  66. data/src/cxx_supportlib/vendor-modified/libev/Changes +46 -15
  67. data/src/cxx_supportlib/vendor-modified/libev/LICENSE +1 -1
  68. data/src/cxx_supportlib/vendor-modified/libev/Makefile.in +215 -128
  69. data/src/cxx_supportlib/vendor-modified/libev/aclocal.m4 +466 -275
  70. data/src/cxx_supportlib/vendor-modified/libev/config.guess +312 -418
  71. data/src/cxx_supportlib/vendor-modified/libev/config.sub +246 -105
  72. data/src/cxx_supportlib/vendor-modified/libev/configure +276 -72
  73. data/src/cxx_supportlib/vendor-modified/libev/configure.ac +2 -1
  74. data/src/cxx_supportlib/vendor-modified/libev/depcomp +346 -185
  75. data/src/cxx_supportlib/vendor-modified/libev/ev++.h +1 -1
  76. data/src/cxx_supportlib/vendor-modified/libev/ev.c +530 -190
  77. data/src/cxx_supportlib/vendor-modified/libev/ev.h +23 -14
  78. data/src/cxx_supportlib/vendor-modified/libev/ev_epoll.c +12 -6
  79. data/src/cxx_supportlib/vendor-modified/libev/ev_kqueue.c +9 -5
  80. data/src/cxx_supportlib/vendor-modified/libev/ev_poll.c +6 -3
  81. data/src/cxx_supportlib/vendor-modified/libev/ev_port.c +8 -4
  82. data/src/cxx_supportlib/vendor-modified/libev/ev_select.c +4 -2
  83. data/src/cxx_supportlib/vendor-modified/libev/ev_vars.h +3 -2
  84. data/src/cxx_supportlib/vendor-modified/libev/ev_win32.c +3 -4
  85. data/src/cxx_supportlib/vendor-modified/libev/install-sh +433 -219
  86. data/src/cxx_supportlib/vendor-modified/libev/libev.m4 +6 -6
  87. data/src/cxx_supportlib/vendor-modified/libev/ltmain.sh +2 -2
  88. data/src/cxx_supportlib/vendor-modified/libev/missing +167 -288
  89. data/src/cxx_supportlib/vendor-modified/libev/mkinstalldirs +72 -21
  90. data/src/cxx_supportlib/vendor-modified/modp_b64.cpp +4 -106
  91. data/src/cxx_supportlib/vendor-modified/modp_b64_data.h +37 -1
  92. data/src/cxx_supportlib/vendor-modified/modp_b64_strict_aliasing.cpp +119 -0
  93. data/src/helper-scripts/node-loader.js +72 -1
  94. data/src/nginx_module/CacheLocationConfig.c +52 -19
  95. data/src/nginx_module/CacheLocationConfig.c.cxxcodebuilder +2 -2
  96. data/src/nginx_module/Configuration.c +26 -1
  97. data/src/nginx_module/Configuration.h +2 -0
  98. data/src/nginx_module/ConfigurationCommands.c +35 -19
  99. data/src/nginx_module/ConfigurationCommands.c.cxxcodebuilder +2 -2
  100. data/src/nginx_module/ContentHandler.c +1 -1
  101. data/src/nginx_module/CreateLocationConfig.c +22 -19
  102. data/src/nginx_module/CreateLocationConfig.c.cxxcodebuilder +2 -2
  103. data/src/nginx_module/LocationConfig.h +21 -19
  104. data/src/nginx_module/LocationConfig.h.cxxcodebuilder +2 -2
  105. data/src/nginx_module/MergeLocationConfig.c +25 -19
  106. data/src/nginx_module/MergeLocationConfig.c.cxxcodebuilder +2 -2
  107. data/src/nginx_module/ngx_http_passenger_module.c +8 -4
  108. data/src/ruby_supportlib/phusion_passenger.rb +9 -4
  109. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +2 -2
  110. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb +1 -1
  111. data/src/ruby_supportlib/phusion_passenger/common_library.rb +13 -0
  112. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +5 -2
  113. data/src/ruby_supportlib/phusion_passenger/constants.rb +1 -1
  114. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +15 -3
  115. data/src/ruby_supportlib/phusion_passenger/platform_info/crypto.rb +51 -0
  116. data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +7 -0
  117. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +17 -0
  118. data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +4 -2
  119. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +4 -0
  120. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +5 -0
  121. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/app.rb +19 -10
  122. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/base.rb +25 -0
  123. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/gdb_controller.rb +38 -103
  124. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/lldb_controller.rb +178 -0
  125. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/utils.rb +94 -0
  126. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/version.rb +2 -2
  127. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core.rb +2 -2
  128. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/version_data.rb +2 -2
  129. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis +5 -3
  130. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis-with-sudo +9 -7
  131. metadata +14 -4
@@ -23,13 +23,13 @@
23
23
  # THE SOFTWARE.
24
24
 
25
25
  # This file uses the cxxcodebuilder API. Learn more at:
26
- # https://github.com/phusion/passenger/cxxcodebuilder
26
+ # https://github.com/phusion/cxxcodebuilder
27
27
 
28
28
  require 'phusion_passenger/nginx/config_options'
29
29
 
30
30
  def main
31
31
  set_indent_string ' '
32
- comment copyright_header_for(__FILE__)
32
+ comment copyright_header_for(__FILE__), 1
33
33
 
34
34
  separator
35
35
 
@@ -1,27 +1,27 @@
1
1
  /*
2
- * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2010-2016 Phusion Holding B.V.
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2016 Phusion Holding B.V.
4
4
  *
5
- * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
- * trademarks of Phusion Holding B.V.
5
+ * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ * trademarks of Phusion Holding B.V.
7
7
  *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is
13
- * furnished to do so, subject to the following conditions:
8
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ * of this software and associated documentation files (the "Software"), to deal
10
+ * in the Software without restriction, including without limitation the rights
11
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ * copies of the Software, and to permit persons to whom the Software is
13
+ * furnished to do so, subject to the following conditions:
14
14
  *
15
- * The above copyright notice and this permission notice shall be included in
16
- * all copies or substantial portions of the Software.
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
17
  *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
+ * THE SOFTWARE.
25
25
  */
26
26
 
27
27
  /*
@@ -48,6 +48,12 @@ generated_merge_part(passenger_loc_conf_t *conf, passenger_loc_conf_t *prev, ngx
48
48
  ngx_conf_merge_uint_value(conf->core_file_descriptor_ulimit,
49
49
  prev->core_file_descriptor_ulimit,
50
50
  NGX_CONF_UNSET_UINT);
51
+ ngx_conf_merge_value(conf->disable_security_update_check,
52
+ prev->disable_security_update_check,
53
+ NGX_CONF_UNSET);
54
+ ngx_conf_merge_str_value(conf->security_update_check_proxy,
55
+ prev->security_update_check_proxy,
56
+ NULL);
51
57
  ngx_conf_merge_uint_value(conf->app_file_descriptor_ulimit,
52
58
  prev->app_file_descriptor_ulimit,
53
59
  NGX_CONF_UNSET_UINT);
@@ -23,13 +23,13 @@
23
23
  # THE SOFTWARE.
24
24
 
25
25
  # This file uses the cxxcodebuilder API. Learn more at:
26
- # https://github.com/phusion/passenger/cxxcodebuilder
26
+ # https://github.com/phusion/cxxcodebuilder
27
27
 
28
28
  require 'phusion_passenger/nginx/config_options'
29
29
 
30
30
  def main
31
31
  set_indent_string ' '
32
- comment copyright_header_for(__FILE__)
32
+ comment copyright_header_for(__FILE__), 1
33
33
 
34
34
  separator
35
35
 
@@ -52,6 +52,7 @@
52
52
  #include "ContentHandler.h"
53
53
  #include "cxx_supportlib/Constants.h"
54
54
  #include "cxx_supportlib/vendor-modified/modp_b64.cpp" /* File is C compatible. */
55
+ #include "cxx_supportlib/vendor-modified/modp_b64_strict_aliasing.cpp" /* File is C compatible. */
55
56
 
56
57
 
57
58
  static int first_start = 1;
@@ -93,7 +94,7 @@ psg_variant_map_set_ngx_str(PsgVariantMap *m,
93
94
 
94
95
  /**
95
96
  * Save the Nginx master process's PID into a file in the instance directory.
96
- * This PID file isn't currently used, but it might be useful for future tooling.
97
+ * This PID file is used in the `passenger-config reopen-logs` command.
97
98
  *
98
99
  * The master process's PID is already passed to the Watchdog through the
99
100
  * "web_server_control_process_pid" property, but that isn't enough. The Watchdog
@@ -107,7 +108,7 @@ save_master_process_pid(ngx_cycle_t *cycle) {
107
108
  u_char *last;
108
109
  FILE *f;
109
110
 
110
- last = ngx_snprintf(filename, sizeof(filename) - 1, "%s/web_server_control_process.pid",
111
+ last = ngx_snprintf(filename, sizeof(filename) - 1, "%s/web_server_info/control_process.pid",
111
112
  psg_watchdog_launcher_get_instance_dir(psg_watchdog_launcher, NULL));
112
113
  *last = (u_char) '\0';
113
114
 
@@ -255,6 +256,7 @@ start_watchdog(ngx_cycle_t *cycle) {
255
256
 
256
257
  psg_variant_map_set_int (params, "web_server_control_process_pid", getpid());
257
258
  psg_variant_map_set (params, "server_software", NGINX_VER, strlen(NGINX_VER));
259
+ psg_variant_map_set (params, "server_version", NGINX_VERSION, strlen(NGINX_VERSION));
258
260
  psg_variant_map_set_bool (params, "multi_app", 1);
259
261
  psg_variant_map_set_bool (params, "load_shell_envvars", 1);
260
262
  psg_variant_map_set_int (params, "log_level", passenger_main_conf.log_level);
@@ -262,6 +264,8 @@ start_watchdog(ngx_cycle_t *cycle) {
262
264
  psg_variant_map_set_int (params, "socket_backlog", passenger_main_conf.socket_backlog);
263
265
  psg_variant_map_set_ngx_str(params, "data_buffer_dir", &passenger_main_conf.data_buffer_dir);
264
266
  psg_variant_map_set_ngx_str(params, "instance_registry_dir", &passenger_main_conf.instance_registry_dir);
267
+ psg_variant_map_set_bool (params, "disable_security_update_check", passenger_main_conf.disable_security_update_check);
268
+ psg_variant_map_set_ngx_str(params, "security_update_check_proxy", &passenger_main_conf.security_update_check_proxy);
265
269
  psg_variant_map_set_bool (params, "user_switching", passenger_main_conf.user_switching);
266
270
  psg_variant_map_set_bool (params, "show_version_in_header", passenger_main_conf.show_version_in_header);
267
271
  psg_variant_map_set_bool (params, "turbocaching", passenger_main_conf.turbocaching);
@@ -319,12 +323,12 @@ start_watchdog(ngx_cycle_t *cycle) {
319
323
  goto cleanup;
320
324
  }
321
325
 
322
- /* Create the file instance_dir + "/web_server_control_process.pid"
326
+ /* Create the file instance_dir + "/web_server_info/control_process.pid"
323
327
  * and make it writable by the worker processes. This is because
324
328
  * save_master_process_pid is run after Nginx has lowered privileges.
325
329
  */
326
330
  last = ngx_snprintf(filename, sizeof(filename) - 1,
327
- "%s/web_server_control_process.pid",
331
+ "%s/web_server_info/control_process.pid",
328
332
  psg_watchdog_launcher_get_instance_dir(psg_watchdog_launcher, NULL));
329
333
  *last = (u_char) '\0';
330
334
  if (create_file(cycle, filename, (const u_char *) "", 0) != NGX_OK) {
@@ -31,10 +31,10 @@ module PhusionPassenger
31
31
 
32
32
  PACKAGE_NAME = 'passenger'
33
33
  # Run 'rake src/cxx_supportlib/Constants.h' after changing this number.
34
- VERSION_STRING = '5.0.30'
34
+ VERSION_STRING = '5.1.0'
35
35
 
36
- PREFERRED_NGINX_VERSION = '1.10.1'
37
- NGINX_SHA256_CHECKSUM = '1fd35846566485e03c0e318989561c135c598323ff349c503a6c14826487a801'
36
+ PREFERRED_NGINX_VERSION = '1.10.2'
37
+ NGINX_SHA256_CHECKSUM = '1045ac4987a396e2fa5d0011daf8987b612dd2f05181b67507da68cbe7d765c2'
38
38
 
39
39
  PREFERRED_PCRE_VERSION = '8.39'
40
40
  PCRE_SHA256_CHECKSUM = 'ccdf7e788769838f8285b3ee672ed573358202305ee361cfec7a4a4fb005bbc7'
@@ -320,7 +320,12 @@ private
320
320
  end
321
321
  if home.nil? || home.empty?
322
322
  require 'etc' if !defined?(Etc)
323
- home = Etc.getpwuid(Process.uid).dir
323
+ begin
324
+ home = Etc.getpwuid(Process.uid).dir
325
+ rescue ArgumentError
326
+ # Unknown user.
327
+ home = ENV['HOME']
328
+ end
324
329
  end
325
330
  return home
326
331
  end
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2014-2015 Phusion Holding B.V.
3
+ # Copyright (c) 2014-2016 Phusion Holding B.V.
4
4
  #
5
5
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  # trademarks of Phusion Holding B.V.
@@ -120,7 +120,7 @@ module PhusionPassenger
120
120
  end
121
121
 
122
122
  def web_server_control_process_pid
123
- File.read("#{@path}/web_server_control_process.pid").to_i
123
+ File.read("#{@path}/web_server_info/control_process.pid").to_i
124
124
  end
125
125
 
126
126
  def full_admin_password
@@ -31,7 +31,7 @@ module PhusionPassenger
31
31
 
32
32
  class InstanceRegistry
33
33
  def initialize(paths = nil)
34
- @paths = [paths || default_paths].flatten
34
+ @paths = [paths || default_paths].flatten.uniq
35
35
  end
36
36
 
37
37
  def list(options = {})
@@ -27,6 +27,8 @@
27
27
  # executables. It's used by the build system (build/*.rb) and by
28
28
  # src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb
29
29
 
30
+ PhusionPassenger.require_passenger_lib 'platform_info/crypto'
31
+
30
32
  class CommonLibraryBuilder
31
33
  include Rake::DSL if defined?(Rake::DSL)
32
34
 
@@ -147,6 +149,8 @@ private
147
149
  optimize.sub!(/-flto/, "")
148
150
  end
149
151
 
152
+ extra_compiler_flags = "#{extra_compiler_flags} #{options[:cflags]}".strip
153
+
150
154
  define_c_or_cxx_object_compilation_task(
151
155
  object_file,
152
156
  source_file,
@@ -290,6 +294,10 @@ COMMON_LIBRARY = CommonLibraryBuilder.new do
290
294
  define_component 'Utils.o',
291
295
  :source => 'Utils.cpp',
292
296
  :category => :base
297
+ define_component 'Crypto.o',
298
+ :source => 'Crypto.cpp',
299
+ :category => :other,
300
+ :cflags => PhusionPassenger::PlatformInfo.crypto_extra_cflags
293
301
  define_component 'Utils/CachedFileStat.o',
294
302
  :source => 'Utils/CachedFileStat.cpp',
295
303
  :category => :other
@@ -334,6 +342,11 @@ COMMON_LIBRARY = CommonLibraryBuilder.new do
334
342
  define_component 'vendor-modified/modp_b64.o',
335
343
  :source => 'vendor-modified/modp_b64.cpp',
336
344
  :category => :bas64,
345
+ :optimize => true,
346
+ :strict_aliasing => false
347
+ define_component 'vendor-modified/modp_b64_strict_aliasing.o',
348
+ :source => 'vendor-modified/modp_b64_strict_aliasing.cpp',
349
+ :category => :bas64,
337
350
  :optimize => true
338
351
  define_component 'UnionStationFilterSupport.o',
339
352
  :source => 'UnionStationFilterSupport.cpp',
@@ -55,10 +55,13 @@ module PhusionPassenger
55
55
  result << "--without-http_fastcgi_module " \
56
56
  "--without-http_scgi_module " \
57
57
  "--without-http_uwsgi_module " \
58
+ "--with-ipv6 " \
59
+ "--with-http_ssl_module " \
60
+ "--with-http_v2_module " \
61
+ "--with-http_realip_module " \
58
62
  "--with-http_gzip_static_module " \
59
63
  "--with-http_stub_status_module " \
60
- "--with-http_ssl_module " \
61
- "--with-http_realip_module"
64
+ "--with-http_addition_module"
62
65
 
63
66
  result
64
67
  end
@@ -96,7 +96,7 @@ module PhusionPassenger
96
96
  PASSENGER_API_VERSION_MAJOR = 0
97
97
  PASSENGER_API_VERSION_MINOR = 3
98
98
  PASSENGER_API_VERSION = "#{PASSENGER_API_VERSION_MAJOR}.#{PASSENGER_API_VERSION_MINOR}"
99
- SERVER_INSTANCE_DIR_STRUCTURE_MAJOR_VERSION = 3
99
+ SERVER_INSTANCE_DIR_STRUCTURE_MAJOR_VERSION = 4
100
100
  SERVER_INSTANCE_DIR_STRUCTURE_MINOR_VERSION = 0
101
101
  SERVER_INSTANCE_DIR_STRUCTURE_MIN_SUPPORTED_MINOR_VERSION = 0
102
102
 
@@ -87,9 +87,9 @@
87
87
 
88
88
  LOCATION_CONFIGURATION_OPTIONS = [
89
89
  {
90
- :name => 'passenger_socket_backlog',
91
- :type => :integer,
92
- :context => [:main],
90
+ :name => 'passenger_socket_backlog',
91
+ :type => :integer,
92
+ :context => [:main],
93
93
  :struct => "NGX_HTTP_MAIN_CONF_OFFSET"
94
94
  },
95
95
  {
@@ -98,6 +98,18 @@ LOCATION_CONFIGURATION_OPTIONS = [
98
98
  :context => [:main],
99
99
  :struct => 'NGX_HTTP_MAIN_CONF_OFFSET'
100
100
  },
101
+ {
102
+ :name => 'disable_security_update_check',
103
+ :type => :flag,
104
+ :context => [:main],
105
+ :struct => "NGX_HTTP_MAIN_CONF_OFFSET"
106
+ },
107
+ {
108
+ :name => 'security_update_check_proxy',
109
+ :type => :string,
110
+ :context => [:main],
111
+ :struct => "NGX_HTTP_MAIN_CONF_OFFSET"
112
+ },
101
113
  {
102
114
  :name => 'passenger_app_file_descriptor_ulimit',
103
115
  :type => :uinteger
@@ -0,0 +1,51 @@
1
+ # Phusion Passenger - https://www.phusionpassenger.com/
2
+ # Copyright (c) 2010-2016 Phusion Holding B.V.
3
+ #
4
+ # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
+ # trademarks of Phusion Holding B.V.
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in
15
+ # all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ # THE SOFTWARE.
24
+
25
+ PhusionPassenger.require_passenger_lib 'platform_info'
26
+ PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
27
+
28
+ module PhusionPassenger
29
+
30
+ module PlatformInfo
31
+ def self.crypto_libs
32
+ if os_name_simple == "macosx"
33
+ return ' -framework CoreFoundation -framework Security'
34
+ else
35
+ return ' -lcrypto'
36
+ end
37
+ end
38
+ memoize :crypto_libs
39
+
40
+ def self.crypto_extra_cflags
41
+ if os_name_simple == "macosx"
42
+ return ' -Wno-deprecated-declarations'
43
+ else
44
+ return ''
45
+ end
46
+ end
47
+ memoize :crypto_extra_cflags
48
+
49
+ end
50
+
51
+ end # module PhusionPassenger
@@ -43,6 +43,13 @@ define 'apache2-dev' do
43
43
  end
44
44
  end
45
45
 
46
+ on :ubuntu do
47
+ if `#{PlatformInfo::uname_command} -a`.include? 'precise'
48
+ apt_get_install "apache2-threaded-dev"
49
+ else
50
+ apt_get_install "apache2-dev"
51
+ end
52
+ end
46
53
  on :debian do
47
54
  apt_get_install "apache2-threaded-dev"
48
55
  end
@@ -386,6 +386,13 @@ module PhusionPassenger
386
386
 
387
387
  # Request handling configuration options
388
388
  REQUEST_HANDLING_CONFIG_SPECS = [
389
+ {
390
+ :name => :max_requests,
391
+ :type => :integer,
392
+ :min => 0,
393
+ :desc => "Restart application processes that have handled\n" \
394
+ "the specified maximum number of requests"
395
+ },
389
396
  {
390
397
  :name => :max_request_time,
391
398
  :type => :integer,
@@ -552,6 +559,16 @@ module PhusionPassenger
552
559
 
553
560
  # Advanced configuration options
554
561
  ADVANCED_CONFIG_SPECS = [
562
+ {
563
+ :name => :disable_security_update_check,
564
+ :type => :boolean,
565
+ :desc => "Disable check for security updates"
566
+ },
567
+ {
568
+ :name => :security_update_check_proxy,
569
+ :type_desc => 'NAME',
570
+ :desc => "Use http/SOCKS proxy for the security update check"
571
+ },
555
572
  {
556
573
  :name => :engine,
557
574
  :type_desc => 'NAME',
@@ -401,13 +401,15 @@ module PhusionPassenger
401
401
  end
402
402
 
403
403
  def touch_temp_dir_in_background
404
- result = system(@agent_exe,
404
+ command = [@agent_exe,
405
405
  "temp-dir-toucher",
406
406
  @working_dir,
407
407
  "--cleanup",
408
408
  "--daemonize",
409
409
  "--pid-file", "#{@working_dir}/temp_dir_toucher.pid",
410
- "--log-file", @options[:log_file])
410
+ "--log-file", @options[:log_file]]
411
+ command << "--user" << @options[:user] unless @options[:user].nil?
412
+ result = system(*command)
411
413
  if !result
412
414
  abort "Cannot start #{@agent_exe} temp-dir-toucher"
413
415
  end
@@ -125,6 +125,7 @@ module PhusionPassenger
125
125
  command << " --default-user #{Shellwords.escape user}"
126
126
  end
127
127
 
128
+ # Arguments for supervised agent are between --BC/--EC and --BU/--EU
128
129
  command << " --BC"
129
130
  # The builtin engine cannot be used in combination with Mass Deployment,
130
131
  # so we know @apps always has 1 app.
@@ -158,6 +159,7 @@ module PhusionPassenger
158
159
  add_param(command, :max_request_queue_size, "--max-request-queue-size")
159
160
  add_enterprise_param(command, :concurrency_model, "--concurrency-model")
160
161
  add_enterprise_param(command, :thread_count, "--app-thread-count")
162
+ add_param(command, :max_requests, "--max-requests")
161
163
  add_enterprise_param(command, :max_request_time, "--max-request-time")
162
164
  add_enterprise_param(command, :memory_limit, "--memory-limit")
163
165
  add_enterprise_flag_param(command, :rolling_restarts, "--rolling-restarts")
@@ -175,6 +177,8 @@ module PhusionPassenger
175
177
  add_param(command, :meteor_app_settings, "--meteor-app-settings")
176
178
  add_param(command, :core_file_descriptor_ulimit, "--core-file-descriptor-ulimit")
177
179
  add_param(command, :app_file_descriptor_ulimit, "--app-file-descriptor-ulimit")
180
+ add_param(command, :disable_security_update_check, "--disable-security-update-check")
181
+ add_param(command, :security_update_check_proxy, "--security-update-check-proxy")
178
182
 
179
183
  command << " #{Shellwords.escape(@apps[0][:root])}"
180
184
 
@@ -30,6 +30,7 @@ PhusionPassenger.require_passenger_lib 'platform_info/ruby'
30
30
  PhusionPassenger.require_passenger_lib 'standalone/control_utils'
31
31
  PhusionPassenger.require_passenger_lib 'utils/tmpio'
32
32
  PhusionPassenger.require_passenger_lib 'utils/shellwords'
33
+ PhusionPassenger.require_passenger_lib 'utils/json'
33
34
 
34
35
  module PhusionPassenger
35
36
  module Standalone
@@ -263,6 +264,10 @@ module PhusionPassenger
263
264
  val ? "on" : "off"
264
265
  end
265
266
 
267
+ def json_config_value(value)
268
+ value.is_a?(Hash) || value.is_a?(Array) ? Utils::JSON.generate(value) : value
269
+ end
270
+
266
271
  def include_passenger_internal_template(name, indent = 0, fix_existing_indenting = true, the_binding = get_binding)
267
272
  path = "#{PhusionPassenger.resources_dir}/templates/standalone/#{name}"
268
273
  erb = ERB.new(File.read(path), nil, "-", next_eoutvar)