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
@@ -49,7 +49,6 @@ using namespace boost;
49
49
  struct Controller::RequestAnalysis {
50
50
  const LString *flags;
51
51
  ServerKit::HeaderTable::Cell *appGroupNameCell;
52
- bool unionStationSupport;
53
52
  };
54
53
 
55
54
 
@@ -189,9 +188,6 @@ Controller::fillPoolOptionsFromConfigCaches(Options &options,
189
188
 
190
189
  options.logLevel = int(LoggingKit::getLevel());
191
190
  options.integrationMode = psg_pstrdup(pool, mainConfig.integrationMode);
192
- options.ustRouterAddress = requestConfig->ustRouterAddress;
193
- options.ustRouterUsername = P_STATIC_STRING("logging");
194
- options.ustRouterPassword = requestConfig->ustRouterPassword;
195
191
  options.userSwitching = mainConfig.userSwitching;
196
192
  options.defaultUser = requestConfig->defaultUser;
197
193
  options.defaultGroup = requestConfig->defaultGroup;
@@ -381,45 +377,9 @@ Controller::createNewPoolOptions(Client *client, Request *req,
381
377
  boost::shared_ptr<Options> optionsCopy = boost::make_shared<Options>(options);
382
378
  optionsCopy->persist(options);
383
379
  optionsCopy->clearPerRequestFields();
384
- optionsCopy->detachFromUnionStationTransaction();
385
380
  poolOptionsCache.insert(options.getAppGroupName(), optionsCopy);
386
381
  }
387
382
 
388
- void
389
- Controller::initializeUnionStation(Client *client, Request *req, RequestAnalysis &analysis) {
390
- if (analysis.unionStationSupport) {
391
- Options &options = req->options;
392
- ServerKit::HeaderTable &headers = req->secureHeaders;
393
-
394
- const LString *key = headers.lookup("!~UNION_STATION_KEY");
395
- if (key == NULL || key->size == 0) {
396
- disconnectWithError(&client, "header !~UNION_STATION_KEY must be set.");
397
- return;
398
- }
399
- key = psg_lstr_make_contiguous(key, req->pool);
400
-
401
- const LString *filters = headers.lookup("!~UNION_STATION_FILTERS");
402
- if (filters != NULL) {
403
- filters = psg_lstr_make_contiguous(filters, req->pool);
404
- }
405
-
406
- options.transaction = unionStationContext->newTransaction(
407
- options.getAppGroupName(), "requests",
408
- string(key->start->data, key->size),
409
- (filters != NULL)
410
- ? string(filters->start->data, filters->size)
411
- : string());
412
- if (!options.transaction->isNull()) {
413
- options.analytics = true;
414
- options.unionStationKey = StaticString(key->start->data, key->size);
415
- }
416
-
417
- req->beginStopwatchLog(&req->stopwatchLogs.requestProcessing, "request processing");
418
- req->logMessage(string("Request method: ") + http_method_str(req->method));
419
- req->logMessage("URI: " + StaticString(req->path.start->data, req->path.size));
420
- }
421
- }
422
-
423
383
  void
424
384
  Controller::setStickySessionId(Client *client, Request *req) {
425
385
  if (req->stickySession) {
@@ -477,8 +437,6 @@ Controller::onRequestBegin(Client *client, Request *req) {
477
437
  analysis.appGroupNameCell = mainConfig.singleAppMode
478
438
  ? NULL
479
439
  : req->secureHeaders.lookupCell(PASSENGER_APP_GROUP_NAME);
480
- analysis.unionStationSupport = unionStationContext != NULL
481
- && getBoolOption(req, UNION_STATION_SUPPORT, false);
482
440
  req->stickySession = getBoolOption(req, PASSENGER_STICKY_SESSIONS,
483
441
  mainConfig.defaultStickySessions);
484
442
  req->host = req->headers.lookup(HTTP_HOST);
@@ -498,7 +456,6 @@ Controller::onRequestBegin(Client *client, Request *req) {
498
456
  if (req->ended()) {
499
457
  return;
500
458
  }
501
- initializeUnionStation(client, req, analysis);
502
459
  if (req->ended()) {
503
460
  return;
504
461
  }
@@ -71,7 +71,6 @@ Controller::preinitialize() {
71
71
  PASSENGER_STICKY_SESSIONS = "!~PASSENGER_STICKY_SESSIONS";
72
72
  PASSENGER_STICKY_SESSIONS_COOKIE_NAME = "!~PASSENGER_STICKY_SESSIONS_COOKIE_NAME";
73
73
  PASSENGER_REQUEST_OOB_WORK = "!~Request-OOB-Work";
74
- UNION_STATION_SUPPORT = "!~UNION_STATION_SUPPORT";
75
74
  REMOTE_ADDR = "!~REMOTE_ADDR";
76
75
  REMOTE_PORT = "!~REMOTE_PORT";
77
76
  REMOTE_USER = "!~REMOTE_USER";
@@ -98,9 +97,6 @@ Controller::initialize() {
98
97
  if (appPool == NULL) {
99
98
  throw RuntimeException("AppPool not initialized");
100
99
  }
101
- if (unionStationContext == NULL) {
102
- unionStationContext = appPool->getUnionStationContext();
103
- }
104
100
 
105
101
  ParentClass::initialize();
106
102
  turboCaching.initialize(config["turbocaching"].asBool());
@@ -35,9 +35,6 @@
35
35
  #include <ServerKit/FdSourceChannel.h>
36
36
  #include <LoggingKit/LoggingKit.h>
37
37
  #include <Core/ApplicationPool/Pool.h>
38
- #include <Core/UnionStation/Context.h>
39
- #include <Core/UnionStation/Transaction.h>
40
- #include <Core/UnionStation/StopwatchLog.h>
41
38
  #include <Core/Controller/Config.h>
42
39
  #include <Core/Controller/AppResponse.h>
43
40
 
@@ -94,13 +91,6 @@ public:
94
91
  ServerKit::FileBufferedChannel bodyBuffer;
95
92
  boost::uint64_t bodyBytesBuffered; // After dechunking
96
93
 
97
- struct {
98
- UnionStation::StopwatchLog *requestProcessing;
99
- UnionStation::StopwatchLog *bufferingRequestBody;
100
- UnionStation::StopwatchLog *getFromPool;
101
- UnionStation::StopwatchLog *requestProxying;
102
- } stopwatchLogs;
103
-
104
94
  HashedStaticString cacheKey;
105
95
  LString *cacheControl;
106
96
  LString *varyCookie;
@@ -122,9 +112,7 @@ public:
122
112
 
123
113
  Request()
124
114
  : BaseHttpRequest()
125
- {
126
- memset(&stopwatchLogs, 0, sizeof(stopwatchLogs));
127
- }
115
+ { }
128
116
 
129
117
  const char *getStateString() const {
130
118
  switch (state) {
@@ -145,28 +133,6 @@ public:
145
133
  }
146
134
  }
147
135
 
148
- bool useUnionStation() const {
149
- return options.transaction != NULL;
150
- }
151
-
152
- void beginStopwatchLog(UnionStation::StopwatchLog **stopwatchLog, const char *id, const char *nameAndData = NULL) {
153
- if (options.transaction != NULL) {
154
- *stopwatchLog = new UnionStation::StopwatchLog(options.transaction, id, nameAndData);
155
- }
156
- }
157
-
158
- void endStopwatchLog(UnionStation::StopwatchLog **stopwatchLog, bool success = true) {
159
- if (success && *stopwatchLog != NULL) {
160
- (*stopwatchLog)->success();
161
- }
162
- delete *stopwatchLog;
163
- *stopwatchLog = NULL;
164
- }
165
-
166
- void logMessage(const StaticString &message) {
167
- options.transaction->message(message);
168
- }
169
-
170
136
  DEFINE_SERVER_KIT_BASE_HTTP_REQUEST_FOOTER(Passenger::Core::Request);
171
137
  };
172
138
 
@@ -446,14 +446,6 @@ Controller::determineHeaderSizeForSessionProtocol(Request *req,
446
446
  dataSize += sizeof("on");
447
447
  }
448
448
 
449
- if (req->options.analytics) {
450
- dataSize += sizeof("PASSENGER_TXN_ID");
451
- dataSize += req->options.transaction->getTxnId().size() + 1;
452
-
453
- dataSize += sizeof("PASSENGER_DELTA_MONOTONIC");
454
- dataSize += delta_monotonic.size() + 1;
455
- }
456
-
457
449
  if (req->upgraded()) {
458
450
  dataSize += sizeof("HTTP_CONNECTION");
459
451
  dataSize += sizeof("upgrade");
@@ -564,16 +556,6 @@ Controller::constructHeaderForSessionProtocol(Request *req, char * restrict buff
564
556
  pos = appendData(pos, end, P_STATIC_STRING_WITH_NULL("on"));
565
557
  }
566
558
 
567
- if (req->options.analytics) {
568
- pos = appendData(pos, end, P_STATIC_STRING_WITH_NULL("PASSENGER_TXN_ID"));
569
- pos = appendData(pos, end, req->options.transaction->getTxnId());
570
- pos = appendData(pos, end, "", 1);
571
-
572
- pos = appendData(pos, end, P_STATIC_STRING_WITH_NULL("PASSENGER_DELTA_MONOTONIC"));
573
- pos = appendData(pos, end, delta_monotonic);
574
- pos = appendData(pos, end, "", 1);
575
- }
576
-
577
559
  if (req->upgraded()) {
578
560
  pos = appendData(pos, end, P_STATIC_STRING_WITH_NULL("HTTP_CONNECTION"));
579
561
  pos = appendData(pos, end, P_STATIC_STRING_WITH_NULL("upgrade"));
@@ -863,20 +845,6 @@ Controller::constructHeaderBuffersForHttpProtocol(Request *req, struct iovec *bu
863
845
  PUSH_STATIC_BUFFER("\r\n");
864
846
  }
865
847
 
866
- if (req->options.analytics) {
867
- PUSH_STATIC_BUFFER("!~Passenger-Txn-Id: ");
868
-
869
- if (buffers != NULL) {
870
- BEGIN_PUSH_NEXT_BUFFER();
871
- buffers[i].iov_base = (void *) req->options.transaction->getTxnId().data();
872
- buffers[i].iov_len = req->options.transaction->getTxnId().size();
873
- }
874
- INC_BUFFER_ITER(i);
875
- dataSize += req->options.transaction->getTxnId().size();
876
-
877
- PUSH_STATIC_BUFFER("\r\n");
878
- }
879
-
880
848
  PUSH_STATIC_BUFFER("\r\n");
881
849
 
882
850
  nbuffers = i;
@@ -98,7 +98,6 @@
98
98
  #include <Core/Config.h>
99
99
  #include <Core/ConfigChange.h>
100
100
  #include <Core/ApplicationPool/Pool.h>
101
- #include <Core/UnionStation/Context.h>
102
101
  #include <Core/SecurityUpdateChecker.h>
103
102
  #include <Core/AdminPanelConnector.h>
104
103
 
@@ -146,9 +145,9 @@ namespace Core {
146
145
 
147
146
  ResourceLocator resourceLocator;
148
147
  RandomGeneratorPtr randomGenerator;
149
- UnionStation::ContextPtr unionStationContext;
150
- SpawningKit::ConfigPtr spawningKitConfig;
151
- SpawningKit::FactoryPtr spawningKitFactory;
148
+ SpawningKit::Context::Schema spawningKitContextSchema;
149
+ SpawningKit::ContextPtr spawningKitContext;
150
+ ApplicationPool2::ContextPtr appPoolContext;
152
151
  PoolPtr appPool;
153
152
  Json::Value singleAppModeConfig;
154
153
 
@@ -621,12 +620,6 @@ onTerminationSignal(EV_P_ struct ev_signal *watcher, int revents) {
621
620
  }
622
621
  }
623
622
 
624
- static void
625
- spawningKitErrorHandler(const SpawningKit::ConfigPtr &config, SpawnException &e, const Options &options) {
626
- ApplicationPool2::processAndLogNewSpawnException(e, options, config);
627
- }
628
-
629
-
630
623
  static void
631
624
  initializeCurl() {
632
625
  TRACE_POINT();
@@ -658,30 +651,25 @@ initializeNonPrivilegedWorkingObjects() {
658
651
  }
659
652
 
660
653
  UPDATE_TRACE_POINT();
661
- if (!coreConfig->get("ust_router_address").isNull()) {
662
- wo->unionStationContext = boost::make_shared<UnionStation::Context>(
663
- coreConfig->get("ust_router_address").asString(),
664
- "logging",
665
- coreConfig->get("ust_router_password").asString());
666
- }
667
-
668
- UPDATE_TRACE_POINT();
669
- wo->spawningKitConfig = boost::make_shared<SpawningKit::Config>();
670
- wo->spawningKitConfig->resourceLocator = &wo->resourceLocator;
671
- wo->spawningKitConfig->agentConfig = coreConfig->inspectEffectiveValues();
672
- wo->spawningKitConfig->errorHandler = spawningKitErrorHandler;
673
- wo->spawningKitConfig->unionStationContext = wo->unionStationContext;
674
- wo->spawningKitConfig->randomGenerator = wo->randomGenerator;
675
- wo->spawningKitConfig->instanceDir = coreConfig->get("instance_dir").asString();
676
- if (!wo->spawningKitConfig->instanceDir.empty()) {
677
- wo->spawningKitConfig->instanceDir = absolutizePath(
678
- wo->spawningKitConfig->instanceDir);
654
+ wo->spawningKitContext = boost::make_shared<SpawningKit::Context>(
655
+ wo->spawningKitContextSchema);
656
+ wo->spawningKitContext->resourceLocator = &wo->resourceLocator;
657
+ wo->spawningKitContext->randomGenerator = wo->randomGenerator;
658
+ wo->spawningKitContext->integrationMode = coreConfig->get("integration_mode").asString();
659
+ wo->spawningKitContext->instanceDir = coreConfig->get("instance_dir").asString();
660
+ if (!wo->spawningKitContext->instanceDir.empty()) {
661
+ wo->spawningKitContext->instanceDir = absolutizePath(
662
+ wo->spawningKitContext->instanceDir);
679
663
  }
680
- wo->spawningKitConfig->finalize();
664
+ wo->spawningKitContext->finalize();
681
665
 
682
666
  UPDATE_TRACE_POINT();
683
- wo->spawningKitFactory = boost::make_shared<SpawningKit::Factory>(wo->spawningKitConfig);
684
- wo->appPool = boost::make_shared<Pool>(wo->spawningKitFactory, coreConfig->inspectEffectiveValues());
667
+ wo->appPoolContext = boost::make_shared<ApplicationPool2::Context>();
668
+ wo->appPoolContext->spawningKitFactory = boost::make_shared<SpawningKit::Factory>(
669
+ wo->spawningKitContext.get());
670
+ wo->appPoolContext->agentConfig = coreConfig->inspectEffectiveValues();
671
+ wo->appPoolContext->finalize();
672
+ wo->appPool = boost::make_shared<Pool>(wo->appPoolContext.get());
685
673
  wo->appPool->initialize();
686
674
  wo->appPool->setMax(coreConfig->get("max_pool_size").asInt());
687
675
  wo->appPool->setMaxIdleTime(coreConfig->get("pool_idle_time").asInt() * 1000000ULL);
@@ -727,7 +715,6 @@ initializeNonPrivilegedWorkingObjects() {
727
715
  coreSchema->controllerSingleAppMode.translator);
728
716
  two.controller->resourceLocator = &wo->resourceLocator;
729
717
  two.controller->appPool = wo->appPool;
730
- two.controller->unionStationContext = wo->unionStationContext;
731
718
  two.controller->shutdownFinishCallback = controllerShutdownFinished;
732
719
  two.controller->initialize();
733
720
  wo->shutdownCounter.fetch_add(1, boost::memory_order_relaxed);
@@ -26,25 +26,16 @@
26
26
  #ifndef _PASSENGER_SPAWNING_KIT_CONFIG_H_
27
27
  #define _PASSENGER_SPAWNING_KIT_CONFIG_H_
28
28
 
29
- #include <boost/function.hpp>
30
- #include <boost/make_shared.hpp>
31
- #include <boost/thread.hpp>
32
- #include <string>
29
+ #include <oxt/macros.hpp>
30
+ #include <boost/shared_array.hpp>
31
+ #include <vector>
33
32
  #include <cstddef>
34
33
 
35
34
  #include <jsoncpp/json.h>
36
35
 
37
- #include <ResourceLocator.h>
38
- #include <RandomGenerator.h>
39
- #include <Exceptions.h>
40
- #include <Utils/VariantMap.h>
41
- #include <Core/UnionStation/Context.h>
42
-
43
- namespace Passenger {
44
- namespace ApplicationPool2 {
45
- class Options;
46
- } // namespace ApplicationPool2
47
- } // namespace Passenger
36
+ #include <Constants.h>
37
+ #include <StaticString.h>
38
+ #include <DataStructures/StringKeyTable.h>
48
39
 
49
40
  namespace Passenger {
50
41
  namespace SpawningKit {
@@ -52,61 +43,344 @@ namespace SpawningKit {
52
43
  using namespace std;
53
44
 
54
45
 
55
- struct Config;
56
- typedef ApplicationPool2::Options Options;
57
- typedef boost::shared_ptr<Config> ConfigPtr;
46
+ // The following hints are available:
47
+ //
48
+ // @require_non_empty
49
+ // @pass_during_handshake
50
+ // @non_confidential
51
+ // @only_meaningful_if
52
+ // @only_pass_during_handshake_if
53
+ //
54
+ // - begin hinted parseable class -
55
+ class Config {
56
+ private:
57
+ boost::shared_array<char> storage;
58
+
59
+ Json::Value tableToJson(const StringKeyTable<StaticString> &table) const {
60
+ Json::Value doc(Json::objectValue);
61
+ StringKeyTable<StaticString>::ConstIterator it(table);
62
+
63
+ while (*it != NULL) {
64
+ doc[it.getKey().toString()] = it.getValue().toString();
65
+ it.next();
66
+ }
67
+
68
+ return doc;
69
+ }
70
+
71
+ public:
72
+ /**
73
+ * The app group name that the spawned process shall belong to. SpawningKit does
74
+ * not use this information directly: it is passed to LoggingKit when logging
75
+ * app output.
76
+ *
77
+ * @hinted_parseable
78
+ * @require_non_empty
79
+ * @pass_during_handshake
80
+ * @non_confidential
81
+ */
82
+ StaticString appGroupName;
83
+
84
+ /**
85
+ * The root directory of the application to spawn. For example, for Ruby apps, this
86
+ * is the directory containing config.ru. The startCommand will be invoked from
87
+ * this directory.
88
+ *
89
+ * @hinted_parseable
90
+ * @require_non_empty
91
+ * @pass_during_handshake
92
+ * @non_confidential
93
+ */
94
+ StaticString appRoot;
95
+
96
+ /**
97
+ * The log level to use.
98
+ *
99
+ * @hinted_parseable
100
+ * @pass_during_handshake
101
+ * @non_confidential
102
+ */
103
+ int logLevel;
104
+
105
+ /**
106
+ * Whether the app to be spawned is generic or not. Generic
107
+ * apps do not have special support for Passenger built in,
108
+ * nor do we have a wrapper for loading the app.
109
+ *
110
+ * For example, Rack and Node.js apps are not considered
111
+ * generic because we have wrappers for them. Go apps without
112
+ * special Passenger support built in are considered generic.
113
+ *
114
+ * @hinted_parseable
115
+ * @pass_during_handshake
116
+ * @non_confidential
117
+ */
118
+ bool genericApp: 1;
119
+
120
+ /**
121
+ * If the app is not generic (`!genericApp`), then this specifies
122
+ * whether the app is loaded through a wrapper (true), or whether
123
+ * the app has special support for Passenger built in and is
124
+ * started directly (false). The only use for this in SpawningKit
125
+ * is to better format error messages.
126
+ *
127
+ * @hinted_parseable
128
+ * @only_meaningful_if !config.genericApp
129
+ * @pass_during_handshake
130
+ * @non_confidential
131
+ */
132
+ bool startsUsingWrapper: 1;
133
+
134
+ /**
135
+ * When a wrapper is used to load the application, this field
136
+ * specifies whether the wrapper is supplied by Phusion or by
137
+ * a third party. The only use for this in SpawningKit is to better
138
+ * format error messages.
139
+ *
140
+ * @hinted_parseable
141
+ * @only_meaningful_if !config.genericApp && config.startsUsingWrapper
142
+ * @pass_during_handshake
143
+ * @non_confidential
144
+ */
145
+ bool wrapperSuppliedByThirdParty: 1;
146
+
147
+ /**
148
+ * If the app is not generic (`!genericApp`), then this specifies
149
+ * whether SpawningKit should find a free port to pass to the app
150
+ * so that it can listen on that port.
151
+ * This is always done if the app is generic, but *can* be done
152
+ * for non-generic apps as well.
153
+ *
154
+ * @hinted_parseable
155
+ * @only_meaningful_if !config.genericApp
156
+ */
157
+ bool findFreePort: 1;
158
+
159
+ /**
160
+ * Whether to load environment variables set in shell startup
161
+ * files (e.g. ~/.bashrc) during spawning.
162
+ *
163
+ * @hinted_parseable
164
+ * @pass_during_handshake
165
+ * @non_confidential
166
+ */
167
+ bool loadShellEnvvars: 1;
58
168
 
59
- typedef void (*ErrorHandler)(const ConfigPtr &config, SpawnException &e, const Options &options);
60
- typedef boost::function<void (const char *data, unsigned int size)> OutputHandler;
169
+ /**
170
+ * Set to true if you do not want SpawningKit to remove the
171
+ * work directory after a spawning operation, which is useful
172
+ * for debugging. Defaults to false.
173
+ *
174
+ * @hinted_parseable
175
+ */
176
+ bool debugWorkDir: 1;
61
177
 
62
- struct Config {
63
- // Used by error pages and hooks.
64
- ResourceLocator *resourceLocator;
65
- ErrorHandler errorHandler;
178
+ /**
179
+ * The command to run in order to start the app.
180
+ *
181
+ * If `genericApp` is true, then the command string must contain '$PORT'.
182
+ * The command string is expected to start the app on the given port.
183
+ * SpawningKit will take care of passing an appropriate $PORT value to
184
+ * the app.
185
+ *
186
+ * If `genericApp` is false, then the command string is expected do
187
+ * either one of these things:
188
+ * - If there is a wrapper available for the app, then the command string
189
+ * is to invoke the wrapper (and `startsUsingWrapper` should be true).
190
+ * - Otherwise, the command string is to start the app directly, in
191
+ * Passenger mode (and `startsUsingWrapper` should be false).
192
+ *
193
+ * @hinted_parseable
194
+ * @require_non_empty
195
+ * @pass_during_handshake
196
+ * @non_confidential
197
+ */
198
+ StaticString startCommand;
66
199
 
67
- boost::mutex agentConfigSyncher;
68
- Json::Value agentConfig;
200
+ /**
201
+ * The application's entry point file. If a relative path is given, then it
202
+ * is relative to the app root. Only meaningful if app is to be loaded through
203
+ * a wrapper.
204
+ *
205
+ * @hinted_parseable
206
+ * @only_meaningful_if !config.genericApp && config.startsUsingWrapper
207
+ * @require_non_empty
208
+ * @pass_during_handshake
209
+ * @non_confidential
210
+ */
211
+ StaticString startupFile;
69
212
 
70
- // Used for Union Station logging.
71
- UnionStation::ContextPtr unionStationContext;
213
+ /**
214
+ * A process title to set when spawning the application.
215
+ *
216
+ * @hinted_parseable
217
+ * @pass_during_handshake
218
+ * @non_confidential
219
+ * @only_pass_during_handshake_if !config.processTitle.empty()
220
+ */
221
+ StaticString processTitle;
72
222
 
73
- // Used by SmartSpawner and DirectSpawner.
74
- RandomGeneratorPtr randomGenerator;
75
- string instanceDir;
223
+ /**
224
+ * An application type name, e.g. "rack" or "node". The only use for this
225
+ * in SpawningKit is to better format error messages.
226
+ *
227
+ * @hinted_parseable
228
+ * @require_non_empty
229
+ * @pass_during_handshake
230
+ * @non_confidential
231
+ */
232
+ StaticString appType;
76
233
 
77
- // Used by DummySpawner and SpawnerFactory.
78
- unsigned int concurrency;
79
- unsigned int spawnerCreationSleepTime;
80
- unsigned int spawnTime;
234
+ /**
235
+ * The value to set PASSENGER_APP_ENV/RAILS_ENV/etc to.
236
+ *
237
+ * @hinted_parseable
238
+ * @require_non_empty
239
+ * @pass_during_handshake
240
+ * @non_confidential
241
+ */
242
+ StaticString appEnv;
81
243
 
82
- // Used by PipeWatcher.
83
- OutputHandler outputHandler;
244
+ /**
245
+ * The spawn method used for spawning the app, i.e. "smart" or "direct".
246
+ *
247
+ * @hinted_parseable
248
+ * @require_non_empty
249
+ * @pass_during_handshake
250
+ * @non_confidential
251
+ */
252
+ StaticString spawnMethod;
84
253
 
85
- // Other.
86
- void *data;
254
+ /**
255
+ * The base URI on which the app runs. If the app is running on the
256
+ * root URI, then this value must be "/".
257
+ *
258
+ * @hinted_parseable
259
+ * @require_non_empty
260
+ * @pass_during_handshake base_uri
261
+ * @non_confidential
262
+ */
263
+ StaticString baseURI;
264
+
265
+ /**
266
+ * The user to start run the app as. Only has effect if the current process
267
+ * is running with root privileges.
268
+ *
269
+ * @hinted_parseable
270
+ * @require_non_empty
271
+ * @pass_during_handshake
272
+ * @non_confidential
273
+ */
274
+ StaticString user;
275
+
276
+ /**
277
+ * The group to start run the app as. Only has effect if the current process
278
+ * is running with root privileges.
279
+ *
280
+ * @hinted_parseable
281
+ * @require_non_empty
282
+ * @pass_during_handshake
283
+ * @non_confidential
284
+ */
285
+ StaticString group;
286
+
287
+ /**
288
+ * Any environment variables to pass to the application. These will be set
289
+ * after the OS shell has already done its work, but before the application
290
+ * is started.
291
+ *
292
+ * @hinted_parseable
293
+ * @pass_during_handshake
294
+ */
295
+ StringKeyTable<StaticString> environmentVariables;
296
+
297
+ /**
298
+ * Specifies that the app's stdout/stderr output should be written
299
+ * to the given log file.
300
+ *
301
+ * @hinted_parseable
302
+ * @pass_during_handshake
303
+ */
304
+ StaticString logFile;
305
+
306
+ /**
307
+ * The API key of the pool group that the spawned process is to belong to.
308
+ *
309
+ * @hinted_parseable
310
+ * @pass_during_handshake
311
+ * @only_pass_during_handshake_if !config.apiKey.empty()
312
+ */
313
+ StaticString apiKey;
314
+
315
+ /**
316
+ * A UUID that's generated on Group initialization, and changes every time
317
+ * the Group receives a restart command. Allows Union Station to track app
318
+ * restarts.
319
+ *
320
+ * @hinted_parseable
321
+ * @pass_during_handshake
322
+ * @only_pass_during_handshake_if !config.groupUuid.empty()
323
+ */
324
+ StaticString groupUuid;
325
+
326
+ /**
327
+ * Minimum user ID starting from which entering LVE and CageFS is allowed.
328
+ *
329
+ * @hinted_parseable
330
+ */
331
+ unsigned int lveMinUid;
332
+
333
+ /**
334
+ * The file descriptor ulimit that the app should have.
335
+ * A value of 0 means that the ulimit should not be changed.
336
+ *
337
+ * @hinted_parseable
338
+ * @pass_during_handshake
339
+ * @non_confidential
340
+ * @only_pass_during_handshake_if config.fileDescriptorUlimit > 0
341
+ */
342
+ unsigned int fileDescriptorUlimit;
343
+
344
+ /**
345
+ * The maximum amount of time, in milliseconds, that may be spent
346
+ * on spawning the process or the preloader.
347
+ *
348
+ * @hinted_parseable
349
+ * @require config.startTimeoutMsec > 0
350
+ */
351
+ unsigned int startTimeoutMsec;
352
+
353
+ /*********************/
354
+ /*********************/
87
355
 
88
356
  Config()
89
- : resourceLocator(NULL),
90
- errorHandler(NULL),
91
- concurrency(1),
92
- spawnerCreationSleepTime(0),
93
- spawnTime(0),
94
- data(NULL)
357
+ : logLevel(DEFAULT_LOG_LEVEL),
358
+ genericApp(false),
359
+ startsUsingWrapper(false),
360
+ wrapperSuppliedByThirdParty(false),
361
+ findFreePort(false),
362
+ loadShellEnvvars(false),
363
+ debugWorkDir(false),
364
+ appEnv(P_STATIC_STRING(DEFAULT_APP_ENV)),
365
+ baseURI(P_STATIC_STRING("/")),
366
+ lveMinUid(DEFAULT_LVE_MIN_UID),
367
+ fileDescriptorUlimit(0),
368
+ startTimeoutMsec(DEFAULT_START_TIMEOUT)
369
+ /*********************/
95
370
  { }
96
371
 
97
- void finalize() {
98
- TRACE_POINT();
99
- if (resourceLocator == NULL) {
100
- throw RuntimeException("ResourceLocator not initialized");
101
- }
102
- if (randomGenerator == NULL) {
103
- randomGenerator = boost::make_shared<RandomGenerator>();
104
- }
105
- }
372
+ void internStrings();
373
+ bool validate(vector<StaticString> &errors) const;
374
+ Json::Value getConfidentialFieldsToPassToApp() const;
375
+ Json::Value getNonConfidentialFieldsToPassToApp() const;
106
376
  };
377
+ // - end hinted parseable class -
378
+
379
+
380
+ #include <Core/SpawningKit/Config/AutoGeneratedCode.h>
107
381
 
108
382
 
109
- } // namespace ApplicationPool2
383
+ } // namespace SpawningKit
110
384
  } // namespace Passenger
111
385
 
112
386
  #endif /* _PASSENGER_SPAWNING_KIT_CONFIG_H_ */