passenger 5.3.4 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (283) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +69 -0
  3. data/CONTRIBUTORS +1 -0
  4. data/README.md +2 -1
  5. data/Rakefile +0 -5
  6. data/build/agent.rb +6 -3
  7. data/build/cxx_tests.rb +28 -19
  8. data/build/integration_tests.rb +6 -2
  9. data/build/misc.rb +2 -1
  10. data/build/packaging.rb +2 -0
  11. data/build/support/cplusplus.rb +2 -2
  12. data/build/support/cxx_dependency_map.rb +2651 -2189
  13. data/dev/colorize-logs +272 -0
  14. data/dev/show-latest-crashlog-dir +27 -0
  15. data/resources/templates/standalone/http.erb +2 -0
  16. data/resources/templates/standalone/server.erb +1 -0
  17. data/src/agent/AgentMain.cpp +4 -0
  18. data/src/agent/Core/AdminPanelConnector.h +6 -6
  19. data/src/agent/Core/ApiServer.h +4 -4
  20. data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +2 -2
  21. data/src/agent/Core/ApplicationPool/Context.h +5 -1
  22. data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +2 -2
  23. data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +5 -0
  24. data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +2 -1
  25. data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +3 -3
  26. data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
  27. data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +13 -20
  28. data/src/agent/Core/ApplicationPool/Group.h +4 -2
  29. data/src/agent/Core/ApplicationPool/Implementation.cpp +5 -5
  30. data/src/agent/Core/ApplicationPool/Options.h +42 -38
  31. data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +2 -1
  32. data/src/agent/Core/ApplicationPool/Pool.h +4 -4
  33. data/src/agent/Core/ApplicationPool/Process.h +13 -15
  34. data/src/agent/Core/ApplicationPool/Socket.h +5 -5
  35. data/src/agent/Core/ApplicationPool/TestSession.h +3 -3
  36. data/src/agent/Core/Config.h +50 -10
  37. data/src/agent/Core/ConfigChange.cpp +13 -1
  38. data/src/agent/Core/Controller/Config.h +41 -17
  39. data/src/agent/Core/Controller/ForwardResponse.cpp +4 -0
  40. data/src/agent/Core/Controller/InitRequest.cpp +14 -8
  41. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +5 -0
  42. data/src/agent/Core/Controller/SendRequest.cpp +9 -9
  43. data/src/agent/Core/Controller/TurboCaching.h +2 -2
  44. data/src/agent/Core/Controller.h +7 -5
  45. data/src/agent/Core/CoreMain.cpp +204 -60
  46. data/src/agent/Core/OptionParser.h +20 -3
  47. data/src/agent/Core/ResponseCache.h +3 -3
  48. data/src/agent/Core/SecurityUpdateChecker.h +4 -2
  49. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
  50. data/src/agent/Core/SpawningKit/Config.h +3 -2
  51. data/src/agent/Core/SpawningKit/Context.h +8 -2
  52. data/src/agent/Core/SpawningKit/DirectSpawner.h +4 -4
  53. data/src/agent/Core/SpawningKit/DummySpawner.h +3 -3
  54. data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
  55. data/src/agent/Core/SpawningKit/Exceptions.h +21 -14
  56. data/src/agent/Core/SpawningKit/Factory.h +1 -1
  57. data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
  58. data/src/agent/Core/SpawningKit/Handshake/Perform.h +14 -2
  59. data/src/agent/Core/SpawningKit/Handshake/Prepare.h +3 -3
  60. data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
  61. data/src/agent/Core/SpawningKit/Journey.h +4 -5
  62. data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
  63. data/src/agent/Core/SpawningKit/README.md +34 -17
  64. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
  65. data/src/agent/Core/SpawningKit/Result.h +20 -8
  66. data/src/agent/Core/SpawningKit/SmartSpawner.h +7 -7
  67. data/src/agent/Core/SpawningKit/Spawner.h +25 -8
  68. data/src/agent/Core/SpawningKit/UserSwitchingRules.h +17 -7
  69. data/src/agent/Core/TelemetryCollector.h +681 -0
  70. data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
  71. data/src/agent/FileReadHelper/FileReadHelperMain.cpp +198 -0
  72. data/src/agent/README.md +1 -1
  73. data/src/agent/Shared/ApiAccountUtils.h +1 -1
  74. data/src/agent/Shared/ApiServerUtils.h +3 -3
  75. data/src/agent/Shared/ApplicationPoolApiKey.h +2 -2
  76. data/src/agent/Shared/Fundamentals/AbortHandler.cpp +324 -98
  77. data/src/agent/Shared/Fundamentals/AbortHandler.h +31 -4
  78. data/src/agent/Shared/Fundamentals/Initialization.cpp +4 -5
  79. data/src/agent/Shared/Fundamentals/Initialization.h +9 -1
  80. data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
  81. data/src/agent/SystemMetrics/SystemMetricsMain.cpp +4 -3
  82. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +3 -3
  83. data/src/agent/Watchdog/ApiServer.h +3 -3
  84. data/src/agent/Watchdog/Config.h +24 -5
  85. data/src/agent/Watchdog/CoreWatcher.cpp +2 -2
  86. data/src/agent/Watchdog/WatchdogMain.cpp +97 -28
  87. data/src/apache2_module/Config.cpp +14 -14
  88. data/src/apache2_module/Config.h +8 -16
  89. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +510 -481
  90. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +39 -17
  91. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +5 -0
  92. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +69 -1
  93. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +31 -1
  94. data/src/apache2_module/ConfigGeneral/Common.h +45 -0
  95. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +17 -1
  96. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +16 -1
  97. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +19 -5
  98. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +26 -9
  99. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +19 -1
  100. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +10 -1
  101. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +14 -1
  102. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +11 -1
  103. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +36 -1
  104. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +34 -1
  105. data/src/apache2_module/DirectoryMapper.h +36 -37
  106. data/src/apache2_module/Hooks.cpp +27 -8
  107. data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +20 -0
  108. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +48 -1
  109. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +36 -1
  110. data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.cpp +2 -2
  111. data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.h +4 -4
  112. data/src/cxx_supportlib/AppLocalConfigFileUtils.h +148 -0
  113. data/src/cxx_supportlib/AppTypeDetector/CBindings.cpp +147 -0
  114. data/src/cxx_supportlib/AppTypeDetector/CBindings.h +75 -0
  115. data/src/cxx_supportlib/{AppTypes.h → AppTypeDetector/Detector.h} +92 -131
  116. data/src/cxx_supportlib/ConfigKit/README.md +90 -2
  117. data/src/cxx_supportlib/ConfigKit/Schema.h +60 -15
  118. data/src/cxx_supportlib/ConfigKit/Store.h +129 -5
  119. data/src/cxx_supportlib/Constants.h +1 -1
  120. data/src/cxx_supportlib/{Utils → DataStructures}/HashMap.h +4 -4
  121. data/src/cxx_supportlib/DataStructures/HashedStaticString.h +5 -5
  122. data/src/cxx_supportlib/DataStructures/LString.h +3 -3
  123. data/src/cxx_supportlib/{Utils → DataStructures}/StringMap.h +36 -36
  124. data/src/cxx_supportlib/FileTools/FileManip.cpp +1 -1
  125. data/src/cxx_supportlib/FileTools/PathManip.cpp +2 -2
  126. data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
  127. data/src/cxx_supportlib/Hooks.h +2 -2
  128. data/src/cxx_supportlib/{Utils → IOTools}/BufferedIO.h +5 -5
  129. data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.cpp +4 -3
  130. data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.h +3 -3
  131. data/src/cxx_supportlib/{Utils → IOTools}/MessageIO.h +7 -7
  132. data/src/cxx_supportlib/{MessageReadersWriters.h → IOTools/MessageSerialization.h} +5 -5
  133. data/src/cxx_supportlib/InstanceDirectory.h +4 -4
  134. data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +3 -3
  135. data/src/cxx_supportlib/{Utils → JsonTools}/JsonUtils.h +5 -5
  136. data/src/cxx_supportlib/LoggingKit/Context.h +2 -2
  137. data/src/cxx_supportlib/LoggingKit/Implementation.cpp +3 -3
  138. data/src/cxx_supportlib/MemoryKit/mbuf.cpp +2 -2
  139. data/src/cxx_supportlib/ProcessManagement/Ruby.cpp +3 -3
  140. data/src/cxx_supportlib/ProcessManagement/Ruby.h +7 -2
  141. data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +19 -12
  142. data/src/cxx_supportlib/ProcessManagement/Spawn.h +21 -2
  143. data/src/cxx_supportlib/ProcessManagement/Utils.h +10 -0
  144. data/src/cxx_supportlib/RandomGenerator.h +2 -2
  145. data/src/cxx_supportlib/ResourceLocator.h +1 -1
  146. data/src/cxx_supportlib/{Crypto.cpp → SecurityKit/Crypto.cpp} +4 -4
  147. data/src/cxx_supportlib/{Crypto.h → SecurityKit/Crypto.h} +4 -4
  148. data/src/cxx_supportlib/{Utils → SecurityKit}/MemZeroGuard.h +0 -0
  149. data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +2 -2
  150. data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
  151. data/src/cxx_supportlib/ServerKit/ClientRef.h +17 -7
  152. data/src/cxx_supportlib/ServerKit/Context.h +2 -2
  153. data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +1 -1
  154. data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +3 -3
  155. data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +2 -2
  156. data/src/cxx_supportlib/ServerKit/HttpRequestRef.h +17 -7
  157. data/src/cxx_supportlib/ServerKit/HttpServer.h +16 -10
  158. data/src/cxx_supportlib/ServerKit/Server.h +3 -4
  159. data/src/cxx_supportlib/{Utils → StrIntTools}/DateParsing.h +5 -5
  160. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.cpp +3 -3
  161. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.h +0 -0
  162. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtilsNoStrictAliasing.cpp +12 -12
  163. data/src/cxx_supportlib/{Utils → StrIntTools}/StringScanning.h +5 -5
  164. data/src/cxx_supportlib/{Utils → StrIntTools}/Template.h +30 -5
  165. data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +88 -0
  166. data/src/cxx_supportlib/{Utils → SystemTools}/ProcessMetricsCollector.h +15 -12
  167. data/src/cxx_supportlib/{Utils → SystemTools}/SystemMetricsCollector.h +3 -3
  168. data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.cpp +1 -1
  169. data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.h +0 -0
  170. data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
  171. data/src/cxx_supportlib/Utils/CachedFileStat.hpp +3 -3
  172. data/src/cxx_supportlib/Utils/Curl.h +2 -2
  173. data/src/cxx_supportlib/Utils/FileChangeChecker.h +2 -2
  174. data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
  175. data/src/cxx_supportlib/Utils/SpeedMeter.h +2 -2
  176. data/src/cxx_supportlib/Utils/Timer.h +2 -2
  177. data/src/cxx_supportlib/Utils/VariantMap.h +3 -3
  178. data/src/cxx_supportlib/Utils.cpp +2 -2
  179. data/src/cxx_supportlib/WatchdogLauncher.h +3 -3
  180. data/src/cxx_supportlib/WebSocketCommandReverseServer.h +1 -1
  181. data/src/cxx_supportlib/WrapperRegistry/CBindings.cpp +85 -0
  182. data/src/cxx_supportlib/{Utils/MemoryBarrier.h → WrapperRegistry/CBindings.h} +30 -27
  183. data/src/cxx_supportlib/WrapperRegistry/Entry.h +112 -0
  184. data/src/cxx_supportlib/WrapperRegistry/README.md +37 -0
  185. data/src/cxx_supportlib/WrapperRegistry/Registry.h +309 -0
  186. data/src/cxx_supportlib/vendor-modified/psg_sysqueue.h +3 -0
  187. data/src/helper-scripts/download_binaries/extconf.rb +6 -2
  188. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +32 -0
  189. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +12 -0
  190. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +36 -0
  191. data/src/nginx_module/Configuration.c +23 -3
  192. data/src/nginx_module/ContentHandler.c +331 -32
  193. data/src/nginx_module/ContentHandler.h +8 -3
  194. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +10 -0
  195. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +27 -0
  196. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +3 -0
  197. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +7 -0
  198. data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +11 -0
  199. data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +23 -0
  200. data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +8 -0
  201. data/src/nginx_module/config +2 -1
  202. data/src/nginx_module/ngx_http_passenger_module.c +9 -3
  203. data/src/nginx_module/ngx_http_passenger_module.h +10 -3
  204. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +19 -0
  205. data/src/ruby_supportlib/phusion_passenger/common_library.rb +19 -16
  206. data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +4 -4
  207. data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +6 -2
  208. data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +6 -2
  209. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +1 -1
  210. data/src/ruby_supportlib/phusion_passenger/message_channel.rb +2 -2
  211. data/src/ruby_supportlib/phusion_passenger/native_support.rb +7 -3
  212. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +29 -0
  213. data/src/ruby_supportlib/phusion_passenger/packaging.rb +20 -19
  214. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +22 -4
  215. data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +33 -13
  216. data/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +1 -0
  217. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +22 -2
  218. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +4 -1
  219. data/src/ruby_supportlib/phusion_passenger.rb +7 -5
  220. data/src/schema_printer/SchemaPrinterMain.cpp +2 -0
  221. metadata +40 -89
  222. data/.editorconfig +0 -134
  223. data/CODE_OF_CONDUCT.md +0 -52
  224. data/dev/boost-patches/0001-Patch-boost-thread-so-that-oxt-thread-can-use-it.patch +0 -48
  225. data/dev/boost-patches/0002-Make-boost-thread_interrupted-derive-from-oxt-tracab.patch +0 -33
  226. data/dev/boost-patches/0003-Disable-a-Clang-pragma-to-prevent-warnings-on-OS-X.patch +0 -25
  227. data/dev/ci/README.md +0 -134
  228. data/dev/ci/lib/functions.sh +0 -129
  229. data/dev/ci/lib/set-container-envvars.sh +0 -53
  230. data/dev/ci/lib/setup-container.sh +0 -46
  231. data/dev/ci/run-tests-natively +0 -24
  232. data/dev/ci/run-tests-with-docker +0 -42
  233. data/dev/ci/scripts/debug-console-wrapper.sh +0 -29
  234. data/dev/ci/scripts/docker-entrypoint-stage2.sh +0 -17
  235. data/dev/ci/scripts/docker-entrypoint.sh +0 -17
  236. data/dev/ci/scripts/inituidgid +0 -17
  237. data/dev/ci/scripts/run-tests-natively-stage2.sh +0 -17
  238. data/dev/ci/scripts/setup-host-natively.sh +0 -11
  239. data/dev/ci/setup-host +0 -56
  240. data/dev/ci/tests/apache2/run +0 -6
  241. data/dev/ci/tests/apache2/setup +0 -4
  242. data/dev/ci/tests/binaries/Jenkinsfile +0 -105
  243. data/dev/ci/tests/binaries/build-linux +0 -38
  244. data/dev/ci/tests/binaries/build-macos +0 -40
  245. data/dev/ci/tests/binaries/prepare-macos +0 -38
  246. data/dev/ci/tests/binaries/test-linux +0 -45
  247. data/dev/ci/tests/binaries/test-macos +0 -38
  248. data/dev/ci/tests/cxx/run +0 -9
  249. data/dev/ci/tests/cxx/setup +0 -4
  250. data/dev/ci/tests/debian/Jenkinsfile +0 -89
  251. data/dev/ci/tests/debian/run +0 -60
  252. data/dev/ci/tests/nginx/run +0 -5
  253. data/dev/ci/tests/nginx/setup +0 -4
  254. data/dev/ci/tests/nginx-dynamic/run +0 -20
  255. data/dev/ci/tests/nginx-dynamic/setup +0 -4
  256. data/dev/ci/tests/nodejs/run +0 -4
  257. data/dev/ci/tests/nodejs/setup +0 -4
  258. data/dev/ci/tests/rpm/Jenkinsfile +0 -68
  259. data/dev/ci/tests/rpm/run +0 -63
  260. data/dev/ci/tests/ruby/run +0 -4
  261. data/dev/ci/tests/ruby/setup +0 -4
  262. data/dev/ci/tests/source-packaging/run +0 -4
  263. data/dev/ci/tests/source-packaging/setup +0 -4
  264. data/dev/ci/tests/standalone/run +0 -4
  265. data/dev/ci/tests/standalone/setup +0 -4
  266. data/dev/configkit-schemas/index.json +0 -1748
  267. data/dev/configkit-schemas/update_schema_inline_comments.rb +0 -118
  268. data/dev/rack.test/config.ru +0 -5
  269. data/dev/rack.test/public/asset.txt +0 -1
  270. data/dev/vagrant/apache_default_site.conf +0 -35
  271. data/dev/vagrant/apache_passenger.conf +0 -5
  272. data/dev/vagrant/apache_passenger.load +0 -1
  273. data/dev/vagrant/apache_ports.conf +0 -24
  274. data/dev/vagrant/apache_rack_test.conf +0 -9
  275. data/dev/vagrant/bashrc +0 -23
  276. data/dev/vagrant/nginx.conf +0 -39
  277. data/dev/vagrant/nginx_rakefile +0 -33
  278. data/dev/vagrant/nginx_start +0 -32
  279. data/dev/vagrant/provision.sh +0 -117
  280. data/dev/vagrant/sudoers.conf +0 -5
  281. data/resources/templates/error_renderer/.editorconfig +0 -19
  282. data/src/cxx_supportlib/AppTypes.cpp +0 -109
  283. data/src/cxx_supportlib/vendor-modified/SmallVector.h +0 -653
@@ -62,6 +62,7 @@ typedef struct {
62
62
  ngx_str_t app_log_file;
63
63
  ngx_str_t app_rights;
64
64
  ngx_str_t app_root;
65
+ ngx_str_t app_start_command;
65
66
  ngx_str_t app_type;
66
67
  ngx_str_t document_root;
67
68
  ngx_str_t environment;
@@ -82,6 +83,7 @@ typedef struct {
82
83
  ngx_str_t app_log_file_source_file;
83
84
  ngx_str_t app_rights_source_file;
84
85
  ngx_str_t app_root_source_file;
86
+ ngx_str_t app_start_command_source_file;
85
87
  ngx_str_t app_type_source_file;
86
88
  ngx_str_t base_uris_source_file;
87
89
  ngx_str_t debugger_source_file;
@@ -121,6 +123,7 @@ typedef struct {
121
123
  ngx_str_t upstream_config_intercept_errors_source_file;
122
124
  ngx_str_t upstream_config_pass_headers_source_file;
123
125
  ngx_str_t upstream_config_read_timeout_source_file;
126
+ ngx_str_t upstream_config_request_buffering_source_file;
124
127
  ngx_str_t user_source_file;
125
128
  ngx_str_t vary_turbocache_by_cookie_source_file;
126
129
 
@@ -129,6 +132,7 @@ typedef struct {
129
132
  ngx_uint_t app_log_file_source_line;
130
133
  ngx_uint_t app_rights_source_line;
131
134
  ngx_uint_t app_root_source_line;
135
+ ngx_uint_t app_start_command_source_line;
132
136
  ngx_uint_t app_type_source_line;
133
137
  ngx_uint_t base_uris_source_line;
134
138
  ngx_uint_t debugger_source_line;
@@ -168,6 +172,7 @@ typedef struct {
168
172
  ngx_uint_t upstream_config_intercept_errors_source_line;
169
173
  ngx_uint_t upstream_config_pass_headers_source_line;
170
174
  ngx_uint_t upstream_config_read_timeout_source_line;
175
+ ngx_uint_t upstream_config_request_buffering_source_line;
171
176
  ngx_uint_t user_source_line;
172
177
  ngx_uint_t vary_turbocache_by_cookie_source_line;
173
178
 
@@ -176,6 +181,7 @@ typedef struct {
176
181
  ngx_int_t app_log_file_explicitly_set;
177
182
  ngx_int_t app_rights_explicitly_set;
178
183
  ngx_int_t app_root_explicitly_set;
184
+ ngx_int_t app_start_command_explicitly_set;
179
185
  ngx_int_t app_type_explicitly_set;
180
186
  ngx_int_t base_uris_explicitly_set;
181
187
  ngx_int_t debugger_explicitly_set;
@@ -215,6 +221,7 @@ typedef struct {
215
221
  ngx_int_t upstream_config_intercept_errors_explicitly_set;
216
222
  ngx_int_t upstream_config_pass_headers_explicitly_set;
217
223
  ngx_int_t upstream_config_read_timeout_explicitly_set;
224
+ ngx_int_t upstream_config_request_buffering_explicitly_set;
218
225
  ngx_int_t user_explicitly_set;
219
226
  ngx_int_t vary_turbocache_by_cookie_explicitly_set;
220
227
  } passenger_autogenerated_loc_conf_t;
@@ -58,6 +58,9 @@ passenger_create_autogenerated_main_conf(passenger_autogenerated_main_conf_t *co
58
58
  conf->disable_security_update_check = NGX_CONF_UNSET;
59
59
  conf->security_update_check_proxy.data = NULL;
60
60
  conf->security_update_check_proxy.len = 0;
61
+ conf->disable_anonymous_telemetry = NGX_CONF_UNSET;
62
+ conf->anonymous_telemetry_proxy.data = NULL;
63
+ conf->anonymous_telemetry_proxy.len = 0;
61
64
  conf->prestart_uris = NGX_CONF_UNSET_PTR;
62
65
  conf->instance_registry_dir.data = NULL;
63
66
  conf->instance_registry_dir.len = 0;
@@ -131,6 +134,14 @@ passenger_create_autogenerated_main_conf(passenger_autogenerated_main_conf_t *co
131
134
  conf->security_update_check_proxy_source_file.len = 0;
132
135
  conf->security_update_check_proxy_source_line = 0;
133
136
  conf->security_update_check_proxy_explicitly_set = 0;
137
+ conf->disable_anonymous_telemetry_source_file.data = NULL;
138
+ conf->disable_anonymous_telemetry_source_file.len = 0;
139
+ conf->disable_anonymous_telemetry_source_line = 0;
140
+ conf->disable_anonymous_telemetry_explicitly_set = 0;
141
+ conf->anonymous_telemetry_proxy_source_file.data = NULL;
142
+ conf->anonymous_telemetry_proxy_source_file.len = 0;
143
+ conf->anonymous_telemetry_proxy_source_line = 0;
144
+ conf->anonymous_telemetry_proxy_explicitly_set = 0;
134
145
  conf->prestart_uris_source_file.data = NULL;
135
146
  conf->prestart_uris_source_file.len = 0;
136
147
  conf->prestart_uris_source_line = 0;
@@ -182,6 +182,29 @@ generate_config_manifest_for_autogenerated_main_conf(manifest_gen_ctx_t *ctx, pa
182
182
  (const char *) conf->autogenerated.security_update_check_proxy.data,
183
183
  conf->autogenerated.security_update_check_proxy.len);
184
184
  }
185
+ if (conf->autogenerated.disable_anonymous_telemetry_explicitly_set) {
186
+ option_container = find_or_create_manifest_option_container(ctx,
187
+ ctx->global_config_container,
188
+ "passenger_disable_anonymous_telemetry",
189
+ sizeof("passenger_disable_anonymous_telemetry") - 1);
190
+ hierarchy_member = add_manifest_option_container_hierarchy_member(option_container,
191
+ &conf->autogenerated.disable_anonymous_telemetry_source_file,
192
+ conf->autogenerated.disable_anonymous_telemetry_source_line);
193
+ psg_json_value_set_bool(hierarchy_member, "value",
194
+ conf->autogenerated.disable_anonymous_telemetry);
195
+ }
196
+ if (conf->autogenerated.anonymous_telemetry_proxy_explicitly_set) {
197
+ option_container = find_or_create_manifest_option_container(ctx,
198
+ ctx->global_config_container,
199
+ "passenger_anonymous_telemetry_proxy",
200
+ sizeof("passenger_anonymous_telemetry_proxy") - 1);
201
+ hierarchy_member = add_manifest_option_container_hierarchy_member(option_container,
202
+ &conf->autogenerated.anonymous_telemetry_proxy_source_file,
203
+ conf->autogenerated.anonymous_telemetry_proxy_source_line);
204
+ psg_json_value_set_str(hierarchy_member, "value",
205
+ (const char *) conf->autogenerated.anonymous_telemetry_proxy.data,
206
+ conf->autogenerated.anonymous_telemetry_proxy.len);
207
+ }
185
208
  if (conf->autogenerated.prestart_uris_explicitly_set) {
186
209
  option_container = find_or_create_manifest_option_container(ctx,
187
210
  ctx->global_config_container,
@@ -43,6 +43,7 @@ typedef struct {
43
43
  ngx_uint_t app_file_descriptor_ulimit;
44
44
  ngx_uint_t core_file_descriptor_ulimit;
45
45
  ngx_array_t *ctl;
46
+ ngx_flag_t disable_anonymous_telemetry;
46
47
  ngx_flag_t disable_security_update_check;
47
48
  ngx_uint_t log_level;
48
49
  ngx_uint_t max_instances_per_app;
@@ -59,6 +60,7 @@ typedef struct {
59
60
  ngx_str_t admin_panel_password;
60
61
  ngx_str_t admin_panel_url;
61
62
  ngx_str_t admin_panel_username;
63
+ ngx_str_t anonymous_telemetry_proxy;
62
64
  ngx_str_t data_buffer_dir;
63
65
  ngx_str_t default_group;
64
66
  ngx_str_t default_user;
@@ -74,12 +76,14 @@ typedef struct {
74
76
  ngx_str_t admin_panel_password_source_file;
75
77
  ngx_str_t admin_panel_url_source_file;
76
78
  ngx_str_t admin_panel_username_source_file;
79
+ ngx_str_t anonymous_telemetry_proxy_source_file;
77
80
  ngx_str_t app_file_descriptor_ulimit_source_file;
78
81
  ngx_str_t core_file_descriptor_ulimit_source_file;
79
82
  ngx_str_t ctl_source_file;
80
83
  ngx_str_t data_buffer_dir_source_file;
81
84
  ngx_str_t default_group_source_file;
82
85
  ngx_str_t default_user_source_file;
86
+ ngx_str_t disable_anonymous_telemetry_source_file;
83
87
  ngx_str_t disable_security_update_check_source_file;
84
88
  ngx_str_t dump_config_manifest_source_file;
85
89
  ngx_str_t file_descriptor_log_file_source_file;
@@ -104,12 +108,14 @@ typedef struct {
104
108
  ngx_uint_t admin_panel_password_source_line;
105
109
  ngx_uint_t admin_panel_url_source_line;
106
110
  ngx_uint_t admin_panel_username_source_line;
111
+ ngx_uint_t anonymous_telemetry_proxy_source_line;
107
112
  ngx_uint_t app_file_descriptor_ulimit_source_line;
108
113
  ngx_uint_t core_file_descriptor_ulimit_source_line;
109
114
  ngx_uint_t ctl_source_line;
110
115
  ngx_uint_t data_buffer_dir_source_line;
111
116
  ngx_uint_t default_group_source_line;
112
117
  ngx_uint_t default_user_source_line;
118
+ ngx_uint_t disable_anonymous_telemetry_source_line;
113
119
  ngx_uint_t disable_security_update_check_source_line;
114
120
  ngx_uint_t dump_config_manifest_source_line;
115
121
  ngx_uint_t file_descriptor_log_file_source_line;
@@ -134,12 +140,14 @@ typedef struct {
134
140
  ngx_int_t admin_panel_password_explicitly_set;
135
141
  ngx_int_t admin_panel_url_explicitly_set;
136
142
  ngx_int_t admin_panel_username_explicitly_set;
143
+ ngx_int_t anonymous_telemetry_proxy_explicitly_set;
137
144
  ngx_int_t app_file_descriptor_ulimit_explicitly_set;
138
145
  ngx_int_t core_file_descriptor_ulimit_explicitly_set;
139
146
  ngx_int_t ctl_explicitly_set;
140
147
  ngx_int_t data_buffer_dir_explicitly_set;
141
148
  ngx_int_t default_group_explicitly_set;
142
149
  ngx_int_t default_user_explicitly_set;
150
+ ngx_int_t disable_anonymous_telemetry_explicitly_set;
143
151
  ngx_int_t disable_security_update_check_explicitly_set;
144
152
  ngx_int_t dump_config_manifest_explicitly_set;
145
153
  ngx_int_t file_descriptor_log_file_explicitly_set;
@@ -75,7 +75,8 @@ PASSENGER_MODULE_DEPS="${ngx_addon_dir}/Configuration.h \
75
75
  ${ngx_addon_dir}/ngx_http_passenger_module.h \
76
76
  ${PASSENGER_INCLUDEDIR}/cxx_supportlib/Constants.h \
77
77
  ${PASSENGER_INCLUDEDIR}/cxx_supportlib/WatchdogLauncher.h \
78
- ${PASSENGER_INCLUDEDIR}/cxx_supportlib/AppTypes.h"
78
+ ${PASSENGER_INCLUDEDIR}/cxx_supportlib/AppTypeDetector/CBindings.h \
79
+ ${PASSENGER_INCLUDEDIR}/cxx_supportlib/WrapperRegistry/CBindings.h"
79
80
  PASSENGER_MODULE_SRCS="${ngx_addon_dir}/ngx_http_passenger_module.c \
80
81
  ${ngx_addon_dir}/Configuration.c \
81
82
  ${ngx_addon_dir}/ContentHandler.c \
@@ -60,7 +60,8 @@ static int first_start = 1;
60
60
  ngx_str_t pp_schema_string;
61
61
  ngx_str_t pp_placeholder_upstream_address;
62
62
  PP_CachedFileStat *pp_stat_cache;
63
- PP_AppTypeDetector *pp_app_type_detector;
63
+ PsgWrapperRegistry *psg_wrapper_registry;
64
+ PsgAppTypeDetector *psg_app_type_detector;
64
65
  PsgWatchdogLauncher *psg_watchdog_launcher = NULL;
65
66
  ngx_cycle_t *pp_current_cycle;
66
67
 
@@ -348,7 +349,7 @@ start_watchdog(ngx_cycle_t *cycle) {
348
349
  }
349
350
 
350
351
  if (autogenerated_main_conf->stat_throttle_rate != NGX_CONF_UNSET_UINT) {
351
- pp_app_type_detector_set_throttle_rate(pp_app_type_detector,
352
+ psg_app_type_detector_set_throttle_rate(psg_app_type_detector,
352
353
  autogenerated_main_conf->stat_throttle_rate);
353
354
  }
354
355
 
@@ -367,6 +368,8 @@ start_watchdog(ngx_cycle_t *cycle) {
367
368
  psg_json_value_set_ngx_str_ne(w_config, "instance_registry_dir", &autogenerated_main_conf->instance_registry_dir);
368
369
  psg_json_value_set_ngx_flag (w_config, "security_update_checker_disabled", autogenerated_main_conf->disable_security_update_check);
369
370
  psg_json_value_set_ngx_str_ne(w_config, "security_update_checker_proxy_url", &autogenerated_main_conf->security_update_check_proxy);
371
+ psg_json_value_set_ngx_flag (w_config, "telemetry_collector_disabled", autogenerated_main_conf->disable_anonymous_telemetry);
372
+ psg_json_value_set_ngx_str_ne(w_config, "telemetry_collector_proxy_url", &autogenerated_main_conf->anonymous_telemetry_proxy);
370
373
  psg_json_value_set_ngx_flag (w_config, "user_switching", autogenerated_main_conf->user_switching);
371
374
  psg_json_value_set_ngx_flag (w_config, "show_version_in_header", autogenerated_main_conf->show_version_in_header);
372
375
  psg_json_value_set_ngx_flag (w_config, "turbocaching", autogenerated_main_conf->turbocaching);
@@ -511,7 +514,10 @@ pre_config_init(ngx_conf_t *cf)
511
514
  pp_placeholder_upstream_address.data = (u_char *) "unix:/passenger_core";
512
515
  pp_placeholder_upstream_address.len = sizeof("unix:/passenger_core") - 1;
513
516
  pp_stat_cache = pp_cached_file_stat_new(1024);
514
- pp_app_type_detector = pp_app_type_detector_new(DEFAULT_STAT_THROTTLE_RATE);
517
+ psg_wrapper_registry = psg_wrapper_registry_new();
518
+ psg_wrapper_registry_finalize(psg_wrapper_registry);
519
+ psg_app_type_detector = psg_app_type_detector_new(psg_wrapper_registry,
520
+ DEFAULT_STAT_THROTTLE_RATE);
515
521
  psg_watchdog_launcher = psg_watchdog_launcher_new(IM_NGINX, &error_message);
516
522
 
517
523
  if (psg_watchdog_launcher == NULL) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Copyright (C) Igor Sysoev
3
3
  * Copyright (C) 2007 Manlio Perillo (manlio.perillo@gmail.com)
4
- * Copyright (c) 2010-2017 Phusion Holding B.V.
4
+ * Copyright (c) 2010-2018 Phusion Holding B.V.
5
5
  *
6
6
  * Redistribution and use in source and binary forms, with or without
7
7
  * modification, are permitted provided that the following conditions
@@ -31,7 +31,7 @@
31
31
  #include <ngx_config.h>
32
32
  #include <ngx_core.h>
33
33
  #include "cxx_supportlib/WatchdogLauncher.h"
34
- #include "cxx_supportlib/AppTypes.h"
34
+ #include "cxx_supportlib/AppTypeDetector/CBindings.h"
35
35
  #include "cxx_supportlib/Utils/CachedFileStat.h"
36
36
 
37
37
  /**
@@ -43,6 +43,11 @@
43
43
  1000 * PASSENGER_NGINX_MINOR_VERSION + \
44
44
  PASSENGER_NGINX_MICRO_VERSION)
45
45
 
46
+ /* https://trac.nginx.org/nginx/ticket/1618 */
47
+ #if NGINX_VERSION_NUM >= 1015003
48
+ #define NGINX_NO_SEND_REQUEST_BODY_INFINITE_LOOP_BUG
49
+ #endif
50
+
46
51
  extern ngx_module_t ngx_http_passenger_module;
47
52
 
48
53
  /**
@@ -55,7 +60,9 @@ extern ngx_str_t pp_placeholder_upstream_address;
55
60
  /** A CachedFileStat object used for caching stat() calls. */
56
61
  extern PP_CachedFileStat *pp_stat_cache;
57
62
 
58
- extern PP_AppTypeDetector *pp_app_type_detector;
63
+ extern PsgWrapperRegistry *psg_wrapper_registry;
64
+
65
+ extern PsgAppTypeDetector *psg_app_type_detector;
59
66
 
60
67
  extern PsgWatchdogLauncher *psg_watchdog_launcher;
61
68
 
@@ -228,6 +228,19 @@ APACHE2_CONFIGURATION_OPTIONS = [
228
228
  :context => :global,
229
229
  :desc => "Use specified HTTP/SOCKS proxy for the #{PROGRAM_NAME} security update check."
230
230
  },
231
+ {
232
+ :name => 'PassengerDisableAnonymousTelemetry',
233
+ :type => :flag,
234
+ :context => :global,
235
+ :default => false,
236
+ :desc => "Whether to disable #{PROGRAM_NAME} anonymous telemetry."
237
+ },
238
+ {
239
+ :name => 'PassengerAnonymousTelemetryProxy',
240
+ :type => :string,
241
+ :context => :global,
242
+ :desc => "Use specified HTTP/SOCKS proxy for #{PROGRAM_NAME} anonymous telemetry collection."
243
+ },
231
244
  {
232
245
  :name => 'PassengerStatThrottleRate',
233
246
  :type => :integer,
@@ -341,6 +354,12 @@ APACHE2_CONFIGURATION_OPTIONS = [
341
354
  :desc => 'Force specific application type.',
342
355
  :header => nil
343
356
  },
357
+ {
358
+ :name => 'PassengerAppStartCommand',
359
+ :type => :string,
360
+ :desc => 'Command string for starting the application.',
361
+ :header => nil
362
+ },
344
363
  {
345
364
  :name => 'PassengerStartupFile',
346
365
  :type => :string,
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2012-2017 Phusion Holding B.V.
2
+ # Copyright (c) 2012-2018 Phusion Holding B.V.
3
3
  #
4
4
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
5
  # trademarks of Phusion Holding B.V.
@@ -293,24 +293,24 @@ COMMON_LIBRARY = CommonLibraryBuilder.new do
293
293
  :source => 'SystemTools/UserDatabase.cpp',
294
294
  :category => :base
295
295
  define_component 'Utils/SystemTime.o',
296
- :source => 'Utils/SystemTime.cpp',
296
+ :source => 'SystemTools/SystemTime.cpp',
297
297
  :category => :base
298
- define_component 'Utils/StrIntUtils.o',
299
- :source => 'Utils/StrIntUtils.cpp',
298
+ define_component 'StrIntTools/StrIntUtils.o',
299
+ :source => 'StrIntTools/StrIntUtils.cpp',
300
300
  :category => :base,
301
301
  :optimize => :very_heavy
302
- define_component 'Utils/StrIntUtilsNoStrictAliasing.o',
303
- :source => 'Utils/StrIntUtilsNoStrictAliasing.cpp',
302
+ define_component 'StrIntTools/StrIntUtilsNoStrictAliasing.o',
303
+ :source => 'StrIntTools/StrIntUtilsNoStrictAliasing.cpp',
304
304
  :category => :base,
305
305
  # Compiling with -O3 causes segfaults on RHEL 6
306
306
  :optimize => :heavy,
307
307
  :strict_aliasing => false
308
- define_component 'Utils/IOUtils.o',
309
- :source => 'Utils/IOUtils.cpp',
308
+ define_component 'IOTools/IOUtils.o',
309
+ :source => 'IOTools/IOUtils.cpp',
310
310
  :optimize => :light,
311
311
  :category => :base
312
- define_component 'Utils/Hasher.o',
313
- :source => 'Utils/Hasher.cpp',
312
+ define_component 'Algorithms/Hasher.o',
313
+ :source => 'Algorithms/Hasher.cpp',
314
314
  :category => :base,
315
315
  :optimize => :very_heavy
316
316
  define_component 'Utils.o',
@@ -321,8 +321,8 @@ COMMON_LIBRARY = CommonLibraryBuilder.new do
321
321
  :category => :base,
322
322
  :optimize => true
323
323
 
324
- define_component 'Crypto.o',
325
- :source => 'Crypto.cpp',
324
+ define_component 'SecurityKit/Crypto.o',
325
+ :source => 'SecurityKit/Crypto.cpp',
326
326
  :category => :other,
327
327
  :cflags => PhusionPassenger::PlatformInfo.crypto_extra_cflags
328
328
  define_component 'Utils/CachedFileStat.o',
@@ -350,8 +350,11 @@ COMMON_LIBRARY = CommonLibraryBuilder.new do
350
350
  define_component 'DataStructures/LString.o',
351
351
  :source => 'DataStructures/LString.cpp',
352
352
  :category => :other
353
- define_component 'AppTypes.o',
354
- :source => 'AppTypes.cpp',
353
+ define_component 'AppTypeDetector/CBindings.o',
354
+ :source => 'AppTypeDetector/CBindings.cpp',
355
+ :category => :other
356
+ define_component 'WrapperRegistry/CBindings.o',
357
+ :source => 'WrapperRegistry/CBindings.cpp',
355
358
  :category => :other
356
359
 
357
360
  define_component 'vendor-modified/modp_b64.o',
@@ -380,6 +383,6 @@ end
380
383
 
381
384
  # A subset of the objects are linked to the Nginx binary. This defines
382
385
  # what those objects are.
383
- NGINX_LIBS_SELECTOR = [:base, 'WatchdogLauncher.o', 'AppTypes.o',
384
- 'Utils/CachedFileStat.o', 'JsonTools/CBindings.o',
386
+ NGINX_LIBS_SELECTOR = [:base, 'WatchdogLauncher.o', 'AppTypeDetector/CBindings.o',
387
+ 'WrapperRegistry/CBindings.o', 'Utils/CachedFileStat.o', 'JsonTools/CBindings.o',
385
388
  'FileTools/PathManipCBindings.o']
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Phusion Passenger - https://www.phusionpassenger.com/
4
- # Copyright (c) 2010-2017 Phusion Holding B.V.
4
+ # Copyright (c) 2010-2018 Phusion Holding B.V.
5
5
  #
6
6
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
7
7
  # trademarks of Phusion Holding B.V.
@@ -133,9 +133,9 @@ module PhusionPassenger
133
133
  puts "<banner>Compiling #{PROGRAM_NAME} agent...</banner>"
134
134
  progress_bar = ProgressBar.new
135
135
  e_working_dir = Shellwords.escape(@working_dir)
136
- args = "#{e_working_dir}/support-binaries/#{AGENT_EXE}" +
137
- " CACHING=false" +
138
- " OUTPUT_DIR=#{e_working_dir} "
136
+ args = "#{e_working_dir}/support-binaries/#{AGENT_EXE}" \
137
+ " CACHING=false" \
138
+ " OUTPUT_DIR=#{e_working_dir} " \
139
139
  " OPTIMIZE=#{!!@optimize}"
140
140
  begin
141
141
  progress_bar.set(0)
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2014-2017 Phusion Holding B.V.
2
+ # Copyright (c) 2014-2018 Phusion Holding B.V.
3
3
  #
4
4
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
5
  # trademarks of Phusion Holding B.V.
@@ -256,7 +256,11 @@ module PhusionPassenger
256
256
  end
257
257
 
258
258
  def real_download_support_file(site, name, output)
259
- url = "#{site[:url]}/#{VERSION_STRING}/#{name}"
259
+ if site[:url].include?('{{VERSION}}')
260
+ url = site[:url].gsub('{{VERSION}}', VERSION_STRING) + "/#{name}"
261
+ else
262
+ url = "#{site[:url]}/#{VERSION_STRING}/#{name}"
263
+ end
260
264
  options = {
261
265
  :cacert => site[:cacert],
262
266
  :logger => @logger,
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2014-2017 Phusion Holding B.V.
2
+ # Copyright (c) 2014-2018 Phusion Holding B.V.
3
3
  #
4
4
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
5
  # trademarks of Phusion Holding B.V.
@@ -260,7 +260,11 @@ module PhusionPassenger
260
260
  end
261
261
 
262
262
  def real_download_support_file(site, name, output)
263
- url = "#{site[:url]}/#{VERSION_STRING}/#{name}"
263
+ if site[:url].include?('{{VERSION}}')
264
+ url = site[:url].gsub('{{VERSION}}', VERSION_STRING) + "/#{name}"
265
+ else
266
+ url = "#{site[:url]}/#{VERSION_STRING}/#{name}"
267
+ end
264
268
  options = {
265
269
  :cacert => site[:cacert],
266
270
  :logger => @logger,
@@ -251,7 +251,7 @@ module PhusionPassenger
251
251
  if @nginx_tarball
252
252
  new_screen
253
253
  puts "You specified --nginx-tarball, but the file could not be extracted. " +
254
- "Please check the path and format (tar.gz), and ensure Passenger can write to " +
254
+ "Please check the path and format (tar.gz), and ensure Passenger can write to " +
255
255
  PlatformInfo.tmpexedir + "."
256
256
  puts
257
257
  else
@@ -1,6 +1,6 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2017 Phusion Holding B.V.
3
+ # Copyright (c) 2010-2018 Phusion Holding B.V.
4
4
  #
5
5
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  # trademarks of Phusion Holding B.V.
@@ -26,7 +26,7 @@
26
26
  module PhusionPassenger
27
27
 
28
28
  # This class allows reading and writing structured messages over
29
- # I/O channels. This is the Ruby implementation of src/cxx_supportlib/Utils/MessageIO.h;
29
+ # I/O channels. This is the Ruby implementation of src/cxx_supportlib/IOTools/MessageIO.h;
30
30
  # see that file for more information.
31
31
  class MessageChannel
32
32
  HEADER_SIZE = 2 # :nodoc:
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2017 Phusion Holding B.V.
2
+ # Copyright (c) 2010-2018 Phusion Holding B.V.
3
3
  #
4
4
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
5
  # trademarks of Phusion Holding B.V.
@@ -225,7 +225,7 @@ module PhusionPassenger
225
225
  end
226
226
 
227
227
  # Name of the user under which we are executing, or the id as fallback
228
- # N.B. loader_shared_helpers.rb has the same method
228
+ # N.B. loader_shared_helpers.rb has the same method
229
229
  def current_user_name_or_id
230
230
  require 'etc' if !defined?(Etc)
231
231
  begin
@@ -271,7 +271,11 @@ module PhusionPassenger
271
271
  end
272
272
 
273
273
  def real_download(site, name, output_dir, logger, options)
274
- url = "#{site[:url]}/#{VERSION_STRING}/#{name}"
274
+ if site[:url].include?('{{VERSION}}')
275
+ url = site[:url].gsub('{{VERSION}}', VERSION_STRING) + "/#{name}"
276
+ else
277
+ url = "#{site[:url]}/#{VERSION_STRING}/#{name}"
278
+ end
275
279
  filename = "#{output_dir}/#{name}"
276
280
  real_options = options.merge(
277
281
  :cacert => site[:cacert],
@@ -200,6 +200,21 @@ NGINX_CONFIGURATION_OPTIONS = [
200
200
  :context => [:main],
201
201
  :struct => 'NGX_HTTP_MAIN_CONF_OFFSET'
202
202
  },
203
+ {
204
+ :name => 'passenger_disable_anonymous_telemetry',
205
+ :scope => :global,
206
+ :type => :flag,
207
+ :default => false,
208
+ :context => [:main],
209
+ :struct => 'NGX_HTTP_MAIN_CONF_OFFSET'
210
+ },
211
+ {
212
+ :name => 'passenger_anonymous_telemetry_proxy',
213
+ :scope => :global,
214
+ :type => :string,
215
+ :context => [:main],
216
+ :struct => 'NGX_HTTP_MAIN_CONF_OFFSET'
217
+ },
203
218
  {
204
219
  :name => 'passenger_pre_start',
205
220
  :scope => :global,
@@ -470,6 +485,12 @@ NGINX_CONFIGURATION_OPTIONS = [
470
485
  :type => :string,
471
486
  :dynamic_default => 'Autodetected'
472
487
  },
488
+ {
489
+ :name => 'passenger_app_start_command',
490
+ :scope => :application,
491
+ :type => :string,
492
+ :header => nil
493
+ },
473
494
  {
474
495
  :name => 'passenger_restart_dir',
475
496
  :scope => :application,
@@ -604,6 +625,14 @@ NGINX_CONFIGURATION_OPTIONS = [
604
625
  :field => 'upstream_config.busy_buffers_size_conf',
605
626
  :auto_generate_nginx_tracking_code => false
606
627
  },
628
+ {
629
+ :name => 'passenger_request_buffering',
630
+ :scope => :location,
631
+ :type => :flag,
632
+ :default => true,
633
+ :field => 'upstream_config.request_buffering',
634
+ :function => 'passenger_conf_set_request_buffering'
635
+ },
607
636
  {
608
637
  :name => 'passenger_intercept_errors',
609
638
  :scope => :location,
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2017 Phusion Holding B.V.
2
+ # Copyright (c) 2010-2018 Phusion Holding B.V.
3
3
  #
4
4
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
5
  # trademarks of Phusion Holding B.V.
@@ -56,11 +56,9 @@ module PhusionPassenger
56
56
  # A list of globs which match all files that should be packaged
57
57
  # in the Phusion Passenger gem or tarball.
58
58
  GLOB = [
59
- '.editorconfig',
60
59
  'configure',
61
60
  'Rakefile',
62
61
  'README.md',
63
- 'CODE_OF_CONDUCT.md',
64
62
  'CONTRIBUTORS',
65
63
  'CONTRIBUTING.md',
66
64
  'LICENSE',
@@ -74,46 +72,49 @@ module PhusionPassenger
74
72
  'doc/**/*',
75
73
  'images/*',
76
74
  'man/*',
77
- 'dev/**/*',
75
+ # Only inlcude the top-level scripts, required by e.g. the Homebrew packaging.
76
+ 'dev/*',
78
77
  'src/**/*',
79
78
  'resources/**/*',
80
79
  'resources/templates/error_renderer/.editorconfig'
81
80
  ]
82
81
 
83
82
  # Files that should be excluded from the gem or tarball. Overrides GLOB.
83
+ #
84
+ # This is not merely an exclusion list on top of GLOB! All files that you
85
+ # do not want to include in the package must be explicitly specified here!
86
+ # Otherwise source_packaging_test.rb will complain.
84
87
  EXCLUDE_GLOB = [
85
88
  '**/.DS_Store',
86
- '.gitignore',
89
+ '**/*.gch',
90
+ '**/.editorconfig',
91
+ '.externalToolBuilders/**/*',
92
+ '.github/**/*',
93
+ '.settings/**/*',
94
+ '.vscode/**/*',
95
+ '.cproject',
87
96
  '.gitattributes',
97
+ '.gitignore',
88
98
  '.gitmodules',
89
- '.github/*',
90
- '.settings/*',
91
- '.externalToolBuilders/*',
92
- '.vscode/*',
93
- '.cproject',
94
99
  '.project',
100
+ 'CODE_OF_CONDUCT.md',
95
101
  'Gemfile',
96
102
  'Gemfile.lock',
97
- 'yarn.lock',
98
- 'Vagrantfile',
99
103
  'Jenkinsfile',
100
104
  'Passenger.sublime-project',
101
- 'Passenger.xcodeproj/**/*',
105
+ 'Vagrantfile',
106
+ 'yarn.lock',
102
107
  'build/support/vendor/*/.*',
103
108
  'build/support/vendor/*/spec/**/*',
109
+ 'dev/*/**/*',
110
+ 'packaging/**/*',
104
111
  'src/ruby_supportlib/phusion_passenger/vendor/*/.*',
105
112
  'src/ruby_supportlib/phusion_passenger/vendor/*/hacking/**/*',
106
113
  'src/ruby_supportlib/phusion_passenger/vendor/*/spec/**/*',
107
114
  'src/cxx_supportlib/vendor-copy/*/.*',
108
- 'packaging/**/*',
109
115
  'test/**/*'
110
116
  ]
111
117
 
112
- # Files and directories that should be excluded from the Homebrew installation.
113
- HOMEBREW_EXCLUDE = [
114
- "package.json", "npm-shrinkwrap.json"
115
- ]
116
-
117
118
  def self.files
118
119
  result = Dir[*GLOB] - Dir[*EXCLUDE_GLOB]
119
120
  result.reject! { |path| path =~ %r{/\.\.?$} }