passenger 5.2.3 → 5.3.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 (241) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +13 -0
  3. data/CONTRIBUTORS +5 -1
  4. data/build/agent.rb +22 -2
  5. data/build/cxx_tests.rb +41 -5
  6. data/build/misc.rb +4 -1
  7. data/build/support/cxx_dependency_map.rb +1746 -908
  8. data/build/support/vendor/cxx_hinted_parser/CxxHintedParser.sublime-project +8 -0
  9. data/build/support/vendor/cxx_hinted_parser/Gemfile +5 -0
  10. data/build/support/vendor/cxx_hinted_parser/Gemfile.lock +30 -0
  11. data/{src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core → build/support/vendor/cxx_hinted_parser}/LICENSE.md +1 -1
  12. data/build/support/vendor/cxx_hinted_parser/README.md +95 -0
  13. data/build/support/vendor/cxx_hinted_parser/Rakefile +4 -0
  14. data/{src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/initialize.rb → build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser.rb} +2 -9
  15. data/build/support/vendor/cxx_hinted_parser/lib/cxx_hinted_parser/parser.rb +239 -0
  16. data/dev/ci/README.md +15 -2
  17. data/dev/ci/lib/set-container-envvars.sh +6 -0
  18. data/dev/ci/lib/setup-container.sh +4 -1
  19. data/dev/ci/scripts/debug-console-wrapper.sh +3 -1
  20. data/dev/ci/setup-host +5 -0
  21. data/dev/ci/tests/binaries/Jenkinsfile +105 -0
  22. data/dev/ci/tests/binaries/build-linux +38 -0
  23. data/dev/ci/tests/binaries/build-macos +40 -0
  24. data/dev/ci/tests/binaries/prepare-macos +38 -0
  25. data/dev/ci/tests/binaries/test-linux +45 -0
  26. data/dev/ci/tests/binaries/test-macos +38 -0
  27. data/dev/ci/tests/debian/Jenkinsfile +2 -2
  28. data/dev/ci/tests/rpm/Jenkinsfile +1 -1
  29. data/dev/configkit-schemas/index.json +3 -24
  30. data/dev/vagrant/nginx_rakefile +0 -1
  31. data/package.json +15 -5
  32. data/resources/templates/error_renderer/.editorconfig +19 -0
  33. data/resources/templates/error_renderer/with_details/README.md +9 -0
  34. data/resources/templates/error_renderer/with_details/dist/bundle.js +33 -0
  35. data/resources/templates/error_renderer/with_details/dist/styles.css +17 -0
  36. data/resources/templates/error_renderer/with_details/src/DetailsView.jsx +52 -0
  37. data/resources/templates/error_renderer/with_details/src/GetHelpView.jsx +61 -0
  38. data/resources/templates/error_renderer/with_details/src/JourneyView.css +50 -0
  39. data/resources/templates/error_renderer/with_details/src/JourneyView.jsx +621 -0
  40. data/resources/templates/error_renderer/with_details/src/PageMain.css +114 -0
  41. data/resources/templates/error_renderer/with_details/src/PageMain.jsx +136 -0
  42. data/resources/templates/error_renderer/with_details/src/ProblemDescriptionView.jsx +14 -0
  43. data/resources/templates/error_renderer/with_details/src/ProcessDetailsView.jsx +56 -0
  44. data/resources/templates/error_renderer/with_details/src/SolutionDescriptionView.css +5 -0
  45. data/resources/templates/error_renderer/with_details/src/SolutionDescriptionView.jsx +15 -0
  46. data/resources/templates/error_renderer/with_details/src/SummaryView.jsx +35 -0
  47. data/resources/templates/error_renderer/with_details/src/SystemComponentView.css +34 -0
  48. data/resources/templates/error_renderer/with_details/src/SystemComponentView.jsx +168 -0
  49. data/resources/templates/error_renderer/with_details/src/SystemComponentsView.css +13 -0
  50. data/resources/templates/error_renderer/with_details/src/SystemComponentsView.jsx +116 -0
  51. data/resources/templates/error_renderer/with_details/src/Tab.jsx +12 -0
  52. data/resources/templates/error_renderer/with_details/src/Tabs.jsx +104 -0
  53. data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.css +3446 -0
  54. data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.js +293 -0
  55. data/resources/templates/error_renderer/with_details/src/bootstrap/config.json +401 -0
  56. data/resources/templates/error_renderer/with_details/src/index.html.template +22 -0
  57. data/resources/templates/error_renderer/with_details/src/index.jsx +23 -0
  58. data/resources/templates/error_renderer/with_details/webpack.config.js +47 -0
  59. data/resources/templates/error_renderer/without_details/dist/bundle.js +1 -0
  60. data/resources/templates/error_renderer/without_details/dist/styles.css +1 -0
  61. data/resources/templates/{undisclosed_error.html.template → error_renderer/without_details/src/index.html.template} +7 -11
  62. data/resources/templates/error_renderer/without_details/src/index.js +1 -0
  63. data/resources/templates/{error_layout.css → error_renderer/without_details/src/main.css} +5 -2
  64. data/resources/templates/error_renderer/without_details/webpack.config.js +42 -0
  65. data/src/agent/AgentMain.cpp +3 -3
  66. data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +13 -0
  67. data/src/agent/Core/ApplicationPool/Common.h +3 -4
  68. data/src/agent/Core/ApplicationPool/Context.h +27 -17
  69. data/src/agent/Core/ApplicationPool/Group.h +3 -1
  70. data/src/agent/Core/ApplicationPool/Group/InitializationAndShutdown.cpp +2 -12
  71. data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +55 -10
  72. data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +1 -1
  73. data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +1 -1
  74. data/src/agent/Core/ApplicationPool/Group/SpawningAndRestarting.cpp +13 -6
  75. data/src/agent/Core/ApplicationPool/Implementation.cpp +16 -100
  76. data/src/agent/Core/ApplicationPool/Options.h +8 -65
  77. data/src/agent/Core/ApplicationPool/Pool.h +4 -21
  78. data/src/agent/Core/ApplicationPool/Pool/AnalyticsCollection.cpp +1 -60
  79. data/src/agent/Core/ApplicationPool/Pool/GeneralUtils.cpp +10 -13
  80. data/src/agent/Core/ApplicationPool/Pool/InitializationAndShutdown.cpp +3 -8
  81. data/src/agent/Core/ApplicationPool/Pool/Miscellaneous.cpp +2 -34
  82. data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
  83. data/src/agent/Core/ApplicationPool/Process.cpp +17 -12
  84. data/src/agent/Core/ApplicationPool/Process.h +146 -93
  85. data/src/agent/Core/ApplicationPool/Session.h +2 -2
  86. data/src/agent/Core/ApplicationPool/Socket.h +28 -27
  87. data/src/agent/Core/Config.h +1 -3
  88. data/src/agent/Core/ConfigChange.cpp +2 -4
  89. data/src/agent/Core/Controller.h +2 -8
  90. data/src/agent/Core/Controller/BufferBody.cpp +0 -2
  91. data/src/agent/Core/Controller/CheckoutSession.cpp +12 -24
  92. data/src/agent/Core/Controller/Config.h +1 -9
  93. data/src/agent/Core/Controller/ForwardResponse.cpp +0 -34
  94. data/src/agent/Core/Controller/Hooks.cpp +0 -7
  95. data/src/agent/Core/Controller/InitRequest.cpp +0 -43
  96. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +0 -4
  97. data/src/agent/Core/Controller/Request.h +1 -35
  98. data/src/agent/Core/Controller/SendRequest.cpp +0 -32
  99. data/src/agent/Core/CoreMain.cpp +19 -32
  100. data/src/agent/Core/SpawningKit/Config.h +329 -55
  101. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +369 -0
  102. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h.cxxcodebuilder +307 -0
  103. data/src/agent/Core/SpawningKit/Context.h +211 -0
  104. data/src/agent/Core/SpawningKit/DirectSpawner.h +112 -122
  105. data/src/agent/Core/SpawningKit/DummySpawner.h +59 -20
  106. data/src/agent/Core/SpawningKit/ErrorRenderer.h +117 -0
  107. data/src/agent/Core/SpawningKit/Exceptions.h +1157 -0
  108. data/src/agent/Core/SpawningKit/Factory.h +24 -17
  109. data/src/agent/Core/SpawningKit/{BackgroundIOCapturer.h → Handshake/BackgroundIOCapturer.h} +48 -18
  110. data/src/agent/Core/SpawningKit/Handshake/Perform.h +1650 -0
  111. data/src/agent/Core/SpawningKit/Handshake/Prepare.h +582 -0
  112. data/src/agent/Core/SpawningKit/Handshake/Session.h +91 -0
  113. data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +100 -0
  114. data/src/agent/Core/SpawningKit/Journey.h +561 -0
  115. data/src/agent/Core/SpawningKit/PipeWatcher.h +41 -18
  116. data/src/agent/Core/SpawningKit/README.md +534 -0
  117. data/src/agent/Core/SpawningKit/Result.h +182 -7
  118. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +69 -0
  119. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h.cxxcodebuilder +110 -0
  120. data/src/agent/Core/SpawningKit/SmartSpawner.h +1027 -562
  121. data/src/agent/Core/SpawningKit/Spawner.h +70 -1134
  122. data/src/agent/Core/SpawningKit/UserSwitchingRules.h +3 -33
  123. data/src/agent/README.md +2 -3
  124. data/src/agent/Shared/ApiServerUtils.h +2 -3
  125. data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +932 -0
  126. data/src/agent/Watchdog/Config.h +1 -3
  127. data/src/agent/Watchdog/WatchdogMain.cpp +2 -1
  128. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +5 -0
  129. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +5 -0
  130. data/src/apache2_module/ConfigGeneral/ManifestGeneration.h +22 -13
  131. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +5 -0
  132. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +3 -0
  133. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +13 -0
  134. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +7 -0
  135. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +13 -0
  136. data/src/cxx_supportlib/Constants.h +3 -1
  137. data/src/cxx_supportlib/Exceptions.h +0 -121
  138. data/src/cxx_supportlib/LoggingKit/Implementation.cpp +7 -6
  139. data/src/cxx_supportlib/LoggingKit/Logging.h +3 -1
  140. data/src/cxx_supportlib/Utils.cpp +42 -0
  141. data/src/cxx_supportlib/Utils.h +7 -0
  142. data/src/cxx_supportlib/Utils/IOUtils.cpp +58 -0
  143. data/src/cxx_supportlib/Utils/IOUtils.h +13 -0
  144. data/src/cxx_supportlib/Utils/JsonUtils.h +130 -23
  145. data/src/cxx_supportlib/Utils/ScopeGuard.h +9 -4
  146. data/src/cxx_supportlib/Utils/StrIntUtils.cpp +7 -0
  147. data/src/cxx_supportlib/Utils/StrIntUtils.h +1 -0
  148. data/src/cxx_supportlib/Utils/SystemTime.h +1 -1
  149. data/src/cxx_supportlib/Utils/Timer.h +1 -1
  150. data/src/cxx_supportlib/WebSocketCommandReverseServer.h +6 -4
  151. data/src/cxx_supportlib/vendor-copy/adhoc_lve.h +1 -0
  152. data/src/helper-scripts/node-loader.js +54 -59
  153. data/src/helper-scripts/rack-loader.rb +63 -60
  154. data/src/helper-scripts/rack-preloader.rb +125 -72
  155. data/src/helper-scripts/wsgi-loader.py +100 -43
  156. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +120 -112
  157. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +15 -8
  158. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +142 -142
  159. data/src/nginx_module/ConfigGeneral/ManifestGeneration.c +26 -15
  160. data/src/nginx_module/ConfigGeneral/ManifestGeneration.h +3 -0
  161. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +76 -70
  162. data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +114 -99
  163. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +170 -156
  164. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +38 -35
  165. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +5 -1
  166. data/src/ruby_supportlib/phusion_passenger.rb +5 -5
  167. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +14 -1
  168. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +8 -0
  169. data/src/ruby_supportlib/phusion_passenger/common_library.rb +0 -3
  170. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +0 -1
  171. data/src/ruby_supportlib/phusion_passenger/constants.rb +2 -0
  172. data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +646 -238
  173. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +117 -95
  174. data/src/ruby_supportlib/phusion_passenger/packaging.rb +0 -1
  175. data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +5 -1
  176. data/src/ruby_supportlib/phusion_passenger/preloader_shared_helpers.rb +92 -69
  177. data/src/ruby_supportlib/phusion_passenger/public_api.rb +0 -17
  178. data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +0 -3
  179. data/src/ruby_supportlib/phusion_passenger/request_handler.rb +4 -5
  180. data/src/ruby_supportlib/phusion_passenger/request_handler/thread_handler.rb +0 -22
  181. metadata +64 -67
  182. data/resources/templates/error_layout.html.template +0 -86
  183. data/resources/templates/general_error.html.template +0 -1
  184. data/resources/templates/general_error_with_html.html.template +0 -1
  185. data/src/agent/Core/ApplicationPool/ErrorRenderer.h +0 -131
  186. data/src/agent/Core/SpawningKit/Options.h +0 -41
  187. data/src/agent/Core/UnionStation/Connection.h +0 -173
  188. data/src/agent/Core/UnionStation/Context.h +0 -536
  189. data/src/agent/Core/UnionStation/StopwatchLog.h +0 -147
  190. data/src/agent/Core/UnionStation/Transaction.h +0 -249
  191. data/src/agent/SpawnPreparer/SpawnPreparerMain.cpp +0 -208
  192. data/src/cxx_supportlib/UnionStationFilterSupport.cpp +0 -67
  193. data/src/cxx_supportlib/UnionStationFilterSupport.h +0 -1622
  194. data/src/nodejs_supportlib/phusion_passenger/log_express.js +0 -106
  195. data/src/nodejs_supportlib/phusion_passenger/log_mongodb.js +0 -202
  196. data/src/nodejs_supportlib/phusion_passenger/ustreporter.js +0 -227
  197. data/src/nodejs_supportlib/phusion_passenger/ustrouter_connector.js +0 -448
  198. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/CONFIG.md +0 -37
  199. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/Gemfile +0 -17
  200. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/Gemfile.lock +0 -59
  201. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/README-API.md +0 -5
  202. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/README.md +0 -117
  203. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/Rakefile +0 -115
  204. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core.rb +0 -423
  205. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/api.rb +0 -238
  206. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/connection.rb +0 -67
  207. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/context.rb +0 -281
  208. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/lock.rb +0 -62
  209. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/log.rb +0 -66
  210. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/message_channel.rb +0 -157
  211. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter.rb +0 -150
  212. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/basics.rb +0 -199
  213. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/controllers.rb +0 -187
  214. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/misc.rb +0 -303
  215. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/request_reporter/view_rendering.rb +0 -91
  216. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/simple_json.rb +0 -396
  217. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/spec_helper.rb +0 -279
  218. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/time_point.rb +0 -39
  219. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/transaction.rb +0 -173
  220. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/utils.rb +0 -177
  221. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/version.rb +0 -32
  222. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/version_data.rb +0 -44
  223. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.example +0 -16
  224. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis +0 -20
  225. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis-with-sudo +0 -18
  226. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/union_station_hooks_core.gemspec +0 -23
  227. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Gemfile +0 -14
  228. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Gemfile.lock +0 -45
  229. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/LICENSE.md +0 -19
  230. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/README.md +0 -104
  231. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/Rakefile +0 -160
  232. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails.rb +0 -200
  233. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/action_controller_extension.rb +0 -45
  234. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/action_view_subscriber.rb +0 -55
  235. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/active_record_subscriber.rb +0 -41
  236. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/active_support_benchmarkable_extension.rb +0 -47
  237. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/active_support_cache_subscriber.rb +0 -79
  238. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/exception_logger.rb +0 -57
  239. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/version.rb +0 -32
  240. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/lib/union_station_hooks_rails/version_data.rb +0 -44
  241. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_rails/union_station_hooks_rails.gemspec +0 -34
@@ -0,0 +1,22 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>{{TITLE}}</title>
7
+ <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700" rel="stylesheet">
8
+ <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet">
9
+ <style type="text/css">{{CSS|raw}}</style>
10
+ </head>
11
+ <body>
12
+ <script>
13
+ window.spec = {{SPEC|raw}};
14
+ </script>
15
+ <div id="root"></div>
16
+ <script>{{JS|raw}}</script>
17
+ <script>{{EXTENSION_JS|raw}}</script>
18
+ <script>
19
+ window.renderErrorPage();
20
+ </script>
21
+ </body>
22
+ </html>
@@ -0,0 +1,23 @@
1
+ /** @jsx h */
2
+ import { render, h } from 'preact';
3
+ import 'jquery';
4
+ import './bootstrap/bootstrap.css';
5
+ import './bootstrap/bootstrap.js';
6
+ import PageMain from './PageMain.jsx';
7
+ import './PageMain.css';
8
+
9
+ window.errorPageExtensions = [];
10
+
11
+ function initialize(pageMain) {
12
+ window.ErrorPage = pageMain;
13
+ for (var i = 0; i < window.errorPageExtensions.length; i++) {
14
+ window.errorPageExtensions[i]();
15
+ }
16
+ }
17
+
18
+ window.renderErrorPage = function() {
19
+ render(
20
+ <PageMain spec={window.spec} ref={ initialize } />,
21
+ document.getElementById('root')
22
+ );
23
+ }
@@ -0,0 +1,47 @@
1
+ const webpack = require('webpack');
2
+ const path = require('path');
3
+ const ExtractTextPlugin = require('extract-text-webpack-plugin');
4
+ const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
5
+
6
+ const extractCSS = new ExtractTextPlugin('styles.css');
7
+
8
+ module.exports = {
9
+ entry: ['./src/index.jsx'],
10
+ output: {
11
+ path: path.resolve(__dirname, 'dist'),
12
+ filename: 'bundle.js'
13
+ },
14
+ module: {
15
+ rules: [
16
+ {
17
+ test: /\.(js|jsx)$/,
18
+ use: {
19
+ loader: 'babel-loader',
20
+ options: {
21
+ presets: ['env', 'react']
22
+ }
23
+ }
24
+ },
25
+ {
26
+ test: /\.css$/,
27
+ use: extractCSS.extract({
28
+ use: {
29
+ loader: 'css-loader',
30
+ options: {
31
+ minimize: true
32
+ }
33
+ },
34
+ fallback: 'style-loader'
35
+ })
36
+ },
37
+ ]
38
+ },
39
+ plugins: [
40
+ extractCSS,
41
+ new UglifyJSPlugin(),
42
+ new webpack.ProvidePlugin({
43
+ $: 'jquery',
44
+ jQuery: 'jquery'
45
+ })
46
+ ]
47
+ };
@@ -0,0 +1 @@
1
+ !function(n){function t(e){if(r[e])return r[e].exports;var o=r[e]={i:e,l:!1,exports:{}};return n[e].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=n,t.c=r,t.i=function(n){return n},t.d=function(n,r,e){t.o(n,r)||Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:e})},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=2)}([function(n,t,r){"use strict";r(1)},function(n,t){},function(n,t,r){n.exports=r(0)}]);
@@ -0,0 +1 @@
1
+ body{font-family:Arial,Sans-Serif;font-size:13px;color:#222;margin:0}.column{max-width:1000px;margin-left:auto;margin-right:auto;text-align:center}header{border-bottom:1px solid #e3e3e3;margin-bottom:45px}footer,header{margin-top:50px}footer{font-size:14px;color:#7f7f7f;border-top:1px solid #e3e3e3;padding:40px 0}h1{font-size:30px;margin-top:30px;margin-bottom:10px}.subtitle{margin-top:0;margin-bottom:110px;font-size:20px}#operator_info{display:none}#show_operator_info{font-size:17px;font-weight:400}.left{text-align:left;padding:8px}h3{margin-top:30px;margin-bottom:10px;font-size:23px}ul{padding-left:16px}a,li{color:#1781bf;text-decoration:none}.error,a,li{font-weight:700}.error{background:#e6f3fc;border-radius:5px;padding:7px 12px}.error.block{display:block}.bold{font-weight:700!important}pre{margin:0;overflow-x:auto;white-space:pre-wrap;word-break:break-all}dt{margin-top:16px;font-weight:700}dd{margin-left:0}.plain{color:inherit;font-weight:inherit}#content{overflow-y:scroll;height:800px}
@@ -1,12 +1,10 @@
1
- <!DOCTYPE html>
2
- <html>
1
+ <!doctype html>
2
+ <html lang="en">
3
3
  <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
4
6
  <title>We're sorry, but something went wrong: {{TITLE}}</title>
5
- <style type="text/css">
6
- {{CSS|raw}}
7
- </style>
8
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
9
- <meta name="generator" content="Phusion Passenger">
7
+ <style type="text/css">{{CSS|raw}}</style>
10
8
  </head>
11
9
  <body>
12
10
  <header>
@@ -20,13 +18,11 @@
20
18
  <a id="show_operator_info" href="#" onclick="showOperatorInfo()">Technical details for the administrator of this website</a>
21
19
  <div id="operator_info">
22
20
  <div class="left">
23
- <h3>Error:</h3>
24
- <span class="error">{{TITLE}}</span>
25
21
  <h3>Error ID:</h3>
26
22
  <span class="error">{{ERROR_ID}}</span>
27
23
  <h3>Details:</h3>
28
24
  <p>Web application could not be started by the {{PROGRAM_NAME}} application server.</p>
29
- <p class="bold">Please read <a href="https://www.phusionpassenger.com/library/admin/log_file/" class="plain">the Passenger log file</a> (search for the Error ID) to find the details of the error.</p>
25
+ <p class="bold">Please read <a href="https://www.phusionpassenger.com/library/admin/log_file/" class="plain">the {{SHORT_PROGRAM_NAME}} log file</a> (search for the Error ID) to find the details of the error.</p>
30
26
  <p>You can also get a detailed report to appear directly on this page, but for security reasons it is only provided if {{PROGRAM_NAME}} is run with <i>environment</i> set to <i>development</i> and/or with the <i>friendly error pages</i> option set to <i>on</i>.</p>
31
27
  <p>For more information about configuring environment and friendly error pages, see:</p>
32
28
  <ul>
@@ -44,7 +40,7 @@
44
40
  text. Thank you.
45
41
  -->
46
42
  <div class="column">
47
- This website is powered by <b>Passenger</b>&reg;, a rock-solid, feature-rich web application server that integrates with Apache and Nginx built by <b>Phusion</b>&reg;.
43
+ This website is powered by <a href="{{PROGRAM_WEBSITE}}"><b>{{PROGRAM_NAME}}</b></a>&reg;, the smart application server built by <b>{{PROGRAM_AUTHOR}}</b>&reg;.
48
44
  </div>
49
45
  </footer>
50
46
  <script>
@@ -5,7 +5,7 @@ body {
5
5
  margin: 0;
6
6
  }
7
7
  .column {
8
- width: 1000px;
8
+ max-width: 1000px;
9
9
  margin-left: auto;
10
10
  margin-right: auto;
11
11
  text-align: center;
@@ -62,6 +62,9 @@ a, li {
62
62
  border-radius: 5px;
63
63
  padding: 7px 12px;
64
64
  }
65
+ .error.block {
66
+ display: block;
67
+ }
65
68
  .bold {
66
69
  font-weight: bold !important;
67
70
  }
@@ -82,7 +85,7 @@ dd {
82
85
  color: inherit;
83
86
  font-weight: inherit;
84
87
  }
85
-
88
+
86
89
  #content {
87
90
  overflow-y: scroll;
88
91
  height: 800px;
@@ -0,0 +1,42 @@
1
+ const path = require('path');
2
+ const ExtractTextPlugin = require('extract-text-webpack-plugin');
3
+ const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
4
+
5
+ const extractCSS = new ExtractTextPlugin('styles.css');
6
+
7
+ module.exports = {
8
+ entry: ['./src/index.js'],
9
+ output: {
10
+ path: path.resolve(__dirname, 'dist'),
11
+ filename: 'bundle.js'
12
+ },
13
+ module: {
14
+ rules: [
15
+ {
16
+ test: /\.(js|jsx)$/,
17
+ use: {
18
+ loader: 'babel-loader',
19
+ options: {
20
+ presets: ['env', 'react']
21
+ }
22
+ }
23
+ },
24
+ {
25
+ test: /\.css$/,
26
+ use: extractCSS.extract({
27
+ use: {
28
+ loader: 'css-loader',
29
+ options: {
30
+ minimize: true
31
+ }
32
+ },
33
+ fallback: 'style-loader'
34
+ })
35
+ },
36
+ ]
37
+ },
38
+ plugins: [
39
+ extractCSS,
40
+ new UglifyJSPlugin()
41
+ ]
42
+ };
@@ -34,7 +34,7 @@ int watchdogMain(int argc, char *argv[]);
34
34
  int coreMain(int argc, char *argv[]);
35
35
  int systemMetricsMain(int argc, char *argv[]);
36
36
  int tempDirToucherMain(int argc, char *argv[]);
37
- int spawnPreparerMain(int argc, char *argv[]);
37
+ int spawnEnvSetupperMain(int argc, char *argv[]);
38
38
  int execHelperMain(int argc, char *argv[]);
39
39
 
40
40
  static bool
@@ -86,8 +86,8 @@ dispatchSubcommand(int argc, char *argv[]) {
86
86
  exit(systemMetricsMain(argc, argv));
87
87
  } else if (strcmp(argv[1], "temp-dir-toucher") == 0) {
88
88
  exit(tempDirToucherMain(argc, argv));
89
- } else if (strcmp(argv[1], "spawn-preparer") == 0) {
90
- exit(spawnPreparerMain(argc, argv));
89
+ } else if (strcmp(argv[1], "spawn-env-setupper") == 0) {
90
+ exit(spawnEnvSetupperMain(argc, argv));
91
91
  } else if (strcmp(argv[1], "exec-helper") == 0) {
92
92
  exit(execHelperMain(argc, argv));
93
93
  } else if (strcmp(argv[1], "test-binary") == 0) {
@@ -35,6 +35,7 @@
35
35
  #include <Exceptions.h>
36
36
  #include <Utils/JsonUtils.h>
37
37
  #include <Core/ApplicationPool/BasicGroupInfo.h>
38
+ #include <Core/SpawningKit/Result.h>
38
39
 
39
40
  namespace Passenger {
40
41
  namespace ApplicationPool2 {
@@ -105,6 +106,18 @@ public:
105
106
  memcpy(this->gupid, gupid.data(), gupid.size());
106
107
  gupidSize = gupid.size();
107
108
  }
109
+
110
+ BasicProcessInfo(Process *_process, const BasicGroupInfo *_groupInfo,
111
+ const SpawningKit::Result &skResult)
112
+ : process(_process),
113
+ groupInfo(_groupInfo),
114
+ pid(skResult.pid)
115
+ // See above comment about the 'stickySessionId' field
116
+ {
117
+ assert(skResult.gupid.size() <= GUPID_MAX_SIZE);
118
+ memcpy(gupid, skResult.gupid.data(), skResult.gupid.size());
119
+ gupidSize = skResult.gupid.size();
120
+ }
108
121
  };
109
122
 
110
123
 
@@ -38,9 +38,8 @@
38
38
  #include <DataStructures/StringKeyTable.h>
39
39
  #include <Utils/VariantMap.h>
40
40
  #include <Core/ApplicationPool/Options.h>
41
+ #include <Core/ApplicationPool/Context.h>
41
42
  #include <Core/SpawningKit/Config.h>
42
- #include <Core/UnionStation/Context.h>
43
- #include <Core/UnionStation/Transaction.h>
44
43
 
45
44
  namespace tut {
46
45
  struct ApplicationPool2_PoolTest;
@@ -206,8 +205,8 @@ struct Ticket {
206
205
 
207
206
  ExceptionPtr copyException(const tracable_exception &e);
208
207
  void rethrowException(const ExceptionPtr &e);
209
- void processAndLogNewSpawnException(SpawnException &e, const Options &options,
210
- const SpawningKit::ConfigPtr &config);
208
+ void processAndLogNewSpawnException(SpawningKit::SpawnException &e, const Options &options,
209
+ const Context *context);
211
210
  void recreateString(psg_pool_t *pool, StaticString &str);
212
211
 
213
212
  } // namespace ApplicationPool2
@@ -26,10 +26,11 @@
26
26
  #ifndef _PASSENGER_APPLICATION_POOL2_CONTEXT_H_
27
27
  #define _PASSENGER_APPLICATION_POOL2_CONTEXT_H_
28
28
 
29
+ #include <boost/shared_ptr.hpp>
29
30
  #include <boost/thread.hpp>
30
31
  #include <boost/pool/object_pool.hpp>
31
32
  #include <Exceptions.h>
32
- #include <Utils/ClassUtils.h>
33
+ #include <Utils/VariantMap.h>
33
34
  #include <Core/SpawningKit/Factory.h>
34
35
 
35
36
  namespace Passenger {
@@ -52,30 +53,29 @@ class Process;
52
53
  * If it does, then all operations on any of the fields in that group requires
53
54
  * grabbing the mutex unless documented otherwise.
54
55
  */
55
- class Context {
56
- private:
57
- /****** Memory management objects *****/
56
+ struct Context {
57
+ public:
58
+ /****** Working objects ******/
58
59
 
59
- P_RO_PROPERTY_REF(private, boost::mutex, MmSyncher);
60
- P_RO_PROPERTY_REF(private, object_pool<Session>, SessionObjectPool);
61
- P_RO_PROPERTY_REF(private, object_pool<Process>, ProcessObjectPool);
60
+ boost::mutex memoryManagementSyncher;
61
+ boost::object_pool<Session> sessionObjectPool;
62
+ boost::object_pool<Process> processObjectPool;
63
+ mutable boost::mutex agentConfigSyncher;
62
64
 
63
65
 
64
- /****** Configuration objects ******/
66
+ /****** Dependencies ******/
65
67
 
66
- P_PROPERTY_CONST_REF(private, SpawningKit::FactoryPtr, SpawningKitFactory);
68
+ SpawningKit::FactoryPtr spawningKitFactory;
69
+ Json::Value agentConfig;
67
70
 
68
71
 
69
- public:
70
- /****** Initialization ******/
71
-
72
72
  Context()
73
- : mSessionObjectPool(64, 1024),
74
- mProcessObjectPool(4, 64)
73
+ : sessionObjectPool(64, 1024),
74
+ processObjectPool(4, 64)
75
75
  { }
76
76
 
77
77
  void finalize() {
78
- if (mSpawningKitFactory == NULL) {
78
+ if (spawningKitFactory == NULL) {
79
79
  throw RuntimeException("spawningKitFactory must be set");
80
80
  }
81
81
  }
@@ -83,11 +83,21 @@ public:
83
83
 
84
84
  /****** Configuration objects ******/
85
85
 
86
- const SpawningKit::ConfigPtr &getSpawningKitConfig() const {
87
- return mSpawningKitFactory->getConfig();
86
+ SpawningKit::Context *getSpawningKitContext() const {
87
+ return spawningKitFactory->getContext();
88
+ }
89
+
90
+ ResourceLocator *getResourceLocator() const {
91
+ return getSpawningKitContext()->resourceLocator;
92
+ }
93
+
94
+ const RandomGeneratorPtr &getRandomGenerator() const {
95
+ return getSpawningKitContext()->randomGenerator;
88
96
  }
89
97
  };
90
98
 
99
+ typedef boost::shared_ptr<Context> ContextPtr;
100
+
91
101
 
92
102
  } // namespace ApplicationPool2
93
103
  } // namespace Passenger
@@ -54,6 +54,7 @@
54
54
  #include <Core/ApplicationPool/Process.h>
55
55
  #include <Core/ApplicationPool/Options.h>
56
56
  #include <Core/SpawningKit/Factory.h>
57
+ #include <Core/SpawningKit/Result.h>
57
58
  #include <Core/SpawningKit/UserSwitchingRules.h>
58
59
  #include <Shared/ApplicationPoolApiKey.h>
59
60
 
@@ -261,7 +262,8 @@ public:
261
262
  void setupAttachOrDetachHook(const ProcessPtr process, HookScriptOptions &options) const;
262
263
 
263
264
  unsigned int generateStickySessionId();
264
- ProcessPtr createProcessObject(const Json::Value &json);
265
+ ProcessPtr createNullProcessObject();
266
+ ProcessPtr createProcessObject(const SpawningKit::Spawner &spawner, const SpawningKit::Result &spawnResult);
265
267
  bool poolAtFullCapacity() const;
266
268
  ProcessPtr poolForceFreeCapacity(const Group *exclude, boost::container::vector<Callback> &postLockActions);
267
269
  void wakeUpGarbageCollector();
@@ -109,7 +109,7 @@ Group::Group(Pool *_pool, const Options &_options)
109
109
  disablingCount = 0;
110
110
  disabledCount = 0;
111
111
  nEnabledProcessesTotallyBusy = 0;
112
- spawner = getContext()->getSpawningKitFactory()->create(options);
112
+ spawner = getContext()->spawningKitFactory->create(options);
113
113
  restartsInitiated = 0;
114
114
  processesBeingSpawned = 0;
115
115
  m_spawning = false;
@@ -144,17 +144,7 @@ Group::~Group() {
144
144
 
145
145
  bool
146
146
  Group::initialize() {
147
- Json::Value json;
148
-
149
- json["type"] = "dummy";
150
- json["pid"] = 0;
151
- json["gupid"] = "0";
152
- json["spawner_creation_time"] = 0;
153
- json["spawn_start_time"] = 0;
154
- json["sockets"] = Json::Value(Json::arrayValue);
155
-
156
- nullProcess = createProcessObject(json);
157
- nullProcess->shutdownNotRequired();
147
+ nullProcess = createNullProcessObject();
158
148
  return true;
159
149
  }
160
150
 
@@ -97,15 +97,15 @@ Group::mergeOptions(const Options &other) {
97
97
  */
98
98
  bool
99
99
  Group::prepareHookScriptOptions(HookScriptOptions &hsOptions, const char *name) {
100
- SpawningKit::ConfigPtr config = getPool()->getSpawningKitConfig();
101
- LockGuard l(config->agentConfigSyncher);
102
- if (config->agentConfig.isNull()) {
100
+ Context *context = getPool()->getContext();
101
+ LockGuard l(context->agentConfigSyncher);
102
+ if (context->agentConfig.isNull()) {
103
103
  return false;
104
104
  }
105
105
 
106
106
  hsOptions.name = name;
107
107
  string hookName = string("hook_") + name;
108
- hsOptions.spec = config->agentConfig.get(hookName, Json::Value()).asString();
108
+ hsOptions.spec = context->agentConfig.get(hookName, Json::Value()).asString();
109
109
 
110
110
  return true;
111
111
  }
@@ -145,7 +145,7 @@ Group::generateStickySessionId() {
145
145
  }
146
146
 
147
147
  ProcessPtr
148
- Group::createProcessObject(const Json::Value &json) {
148
+ Group::createNullProcessObject() {
149
149
  struct Guard {
150
150
  Context *context;
151
151
  Process *process;
@@ -157,7 +157,7 @@ Group::createProcessObject(const Json::Value &json) {
157
157
 
158
158
  ~Guard() {
159
159
  if (process != NULL) {
160
- context->getProcessObjectPool().free(process);
160
+ context->processObjectPool.free(process);
161
161
  }
162
162
  }
163
163
 
@@ -166,11 +166,56 @@ Group::createProcessObject(const Json::Value &json) {
166
166
  }
167
167
  };
168
168
 
169
+ Json::Value args;
170
+ args["pid"] = 0;
171
+ args["gupid"] = "0";
172
+ args["spawner_creation_time"] = 0;
173
+ args["spawn_start_time"] = 0;
174
+ args["dummy"] = true;
175
+ args["sockets"] = Json::Value(Json::arrayValue);
176
+
177
+ Context *context = getContext();
178
+ LockGuard l(context->memoryManagementSyncher);
179
+ Process *process = context->processObjectPool.malloc();
180
+ Guard guard(context, process);
181
+ process = new (process) Process(&info, args);
182
+ process->shutdownNotRequired();
183
+ guard.clear();
184
+ return ProcessPtr(process, false);
185
+ }
186
+
187
+ ProcessPtr
188
+ Group::createProcessObject(const SpawningKit::Spawner &spawner,
189
+ const SpawningKit::Result &spawnResult)
190
+ {
191
+ struct Guard {
192
+ Context *context;
193
+ Process *process;
194
+
195
+ Guard(Context *c, Process *s)
196
+ : context(c),
197
+ process(s)
198
+ { }
199
+
200
+ ~Guard() {
201
+ if (process != NULL) {
202
+ context->processObjectPool.free(process);
203
+ }
204
+ }
205
+
206
+ void clear() {
207
+ process = NULL;
208
+ }
209
+ };
210
+
211
+ Json::Value args;
212
+ args["spawner_creation_time"] = (Json::UInt64) spawner.creationTime;
213
+
169
214
  Context *context = getContext();
170
- LockGuard l(context->getMmSyncher());
171
- Process *process = context->getProcessObjectPool().malloc();
215
+ LockGuard l(context->memoryManagementSyncher);
216
+ Process *process = context->processObjectPool.malloc();
172
217
  Guard guard(context, process);
173
- process = new (process) Process(&info, json);
218
+ process = new (process) Process(&info, spawnResult, args);
174
219
  guard.clear();
175
220
  return ProcessPtr(process, false);
176
221
  }
@@ -224,7 +269,7 @@ Group::pushGetWaiter(const Options &newOptions, const GetCallback &callback,
224
269
  || getWaitlist.size() < newOptions.maxRequestQueueSize)))
225
270
  {
226
271
  getWaitlist.push_back(GetWaiter(
227
- newOptions.copyAndPersist().detachFromUnionStationTransaction(),
272
+ newOptions.copyAndPersist(),
228
273
  callback));
229
274
  return true;
230
275
  } else {