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
@@ -1,118 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative '../../src/ruby_supportlib/phusion_passenger/utils/json'
3
-
4
- SimpleJSON = PhusionPassenger::Utils::JSON
5
-
6
- FILES = Dir['src/**/*.{h,cpp}']
7
- SCHEMAS = SimpleJSON.parse(File.read('dev/configkit-schemas/index.json'))
8
-
9
- def main
10
- FILES.each do |path|
11
- update_file(path)
12
- end
13
- end
14
-
15
- def update_file(path)
16
- content = File.open(path, 'r:utf-8') do |f|
17
- f.read
18
- end
19
- orig_content = content.dup
20
-
21
- pos = 0
22
-
23
- while match_begin = /^(.*?)BEGIN ConfigKit schema: (.+)/.match(content, pos)
24
- if match_end = /END/.match(content, match_begin.end(0))
25
- prefix = match_begin.captures[0]
26
- class_name = match_begin.captures[1]
27
- replacement = format_inline_comment_for_schema(prefix, class_name)
28
-
29
- content[match_begin.begin(0) .. match_end.end(0) - 1] = replacement
30
- pos = match_begin.begin(0) + replacement.size
31
- else
32
- break
33
- end
34
- end
35
-
36
- if content != orig_content
37
- puts "Updating #{path}"
38
- File.open(path, 'w:utf-8') do |f|
39
- f.write(content)
40
- end
41
- end
42
- end
43
-
44
- def format_inline_comment_for_schema(prefix, class_name)
45
- lines = [
46
- "BEGIN ConfigKit schema: #{class_name}",
47
- "(do not edit: following text is automatically generated",
48
- "by 'rake configkit_schemas_inline_comments')",
49
- ""
50
- ]
51
-
52
- if schema = SCHEMAS[class_name]
53
- table = []
54
- schema.each_pair do |key, info|
55
- table << [
56
- key,
57
- info['type'],
58
- info['required'] ? 'required' : '-',
59
- format_option_names(info)
60
- ]
61
- end
62
-
63
- column_lengths = find_max_column_lengths(table)
64
- table.each do |row|
65
- fmt = " %-#{column_lengths[0]}s %-#{column_lengths[1]}s %-#{column_lengths[2]}s %-#{column_lengths[3]}s"
66
- lines << sprintf(fmt, *row)
67
- end
68
- else
69
- lines << "(unknown: #{class_name} not in dev/configkit-schemas/index.json"
70
- lines << " Please run:"
71
- lines << " touch src/schema_printer/SchemaPrinterMain.cpp.cxxcodebuilder"
72
- lines << " rake configkit_schemas_inline_comments"
73
- lines << ")"
74
- end
75
-
76
- lines << ""
77
- lines << "END"
78
- lines.map{ |x| "#{prefix}#{x}".rstrip }.join("\n")
79
- end
80
-
81
- def format_option_names(schema_entry)
82
- options = []
83
- if schema_entry['has_default_value']
84
- if schema_entry['has_default_value'] == 'static'
85
- desc = format_default_value_desc(schema_entry['default_value'])
86
- options << "default(#{desc})"
87
- else
88
- options << 'default'
89
- end
90
- end
91
- options << 'secret' if schema_entry['secret']
92
- options << 'read_only' if schema_entry['read_only']
93
- result = options.join(',')
94
- result = '-' if result.empty?
95
- result
96
- end
97
-
98
- def format_default_value_desc(value)
99
- if value.is_a?(Array) || value.is_a?(Hash)
100
- SimpleJSON.generate(value)
101
- else
102
- SimpleJSON.generate([value]).sub(/\A\[/, '').sub(/\]\Z/, '')
103
- end
104
- end
105
-
106
- def find_max_column_lengths(table)
107
- lengths = []
108
- table.each do |row|
109
- row.each_with_index do |col, i|
110
- if lengths[i].nil? || lengths[i] < col.size
111
- lengths[i] = col.size
112
- end
113
- end
114
- end
115
- lengths
116
- end
117
-
118
- main
@@ -1,5 +0,0 @@
1
- app = lambda do |env|
2
- [200, { "Content-Type" => "text/plain" }, ["ok\n"]]
3
- end
4
-
5
- run app
@@ -1 +0,0 @@
1
- This is a static asset.
@@ -1,35 +0,0 @@
1
- # This file is overwritten by 'vagrant provision'. For the source,
2
- # see dev/vagrant/apache_default_site.conf in the Phusion Passenger source
3
- # tree.
4
-
5
- <VirtualHost *:8000>
6
- # The ServerName directive sets the request scheme, hostname and port that
7
- # the server uses to identify itself. This is used when creating
8
- # redirection URLs. In the context of virtual hosts, the ServerName
9
- # specifies what hostname must appear in the request's Host: header to
10
- # match this virtual host. For the default virtual host (this file) this
11
- # value is not decisive as it is used as a last resort host regardless.
12
- # However, you must set it for any further virtual host explicitly.
13
- #ServerName www.example.com
14
-
15
- ServerAdmin webmaster@localhost
16
- DocumentRoot /var/www/html
17
-
18
- # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
19
- # error, crit, alert, emerg.
20
- # It is also possible to configure the loglevel for particular
21
- # modules, e.g.
22
- #LogLevel info ssl:warn
23
-
24
- ErrorLog ${APACHE_LOG_DIR}/error.log
25
- CustomLog ${APACHE_LOG_DIR}/access.log combined
26
-
27
- # For most configuration files from conf-available/, which are
28
- # enabled or disabled at a global level, it is possible to
29
- # include a line for only one particular virtual host. For example the
30
- # following line enables the CGI configuration for this host only
31
- # after it has been globally disabled with "a2disconf".
32
- #Include conf-available/serve-cgi-bin.conf
33
- </VirtualHost>
34
-
35
- # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
@@ -1,5 +0,0 @@
1
- <IfModule mod_passenger.c>
2
- PassengerRoot /vagrant
3
- PassengerDefaultRuby /usr/bin/ruby
4
- PassengerLogLevel 1
5
- </IfModule>
@@ -1 +0,0 @@
1
- LoadModule passenger_module /vagrant/buildout/apache2/mod_passenger.so
@@ -1,24 +0,0 @@
1
- # This file is overwritten by 'vagrant provision'. For the source,
2
- # see dev/vagrant/apache_ports.conf in the Phusion Passenger source
3
- # tree.
4
-
5
- # If you just change the port or add more ports here, you will likely also
6
- # have to change the VirtualHost statement in
7
- # /etc/apache2/sites-enabled/000-default.conf
8
-
9
- Listen 8000
10
- Listen 8001
11
- Listen 8002
12
- Listen 8003
13
- Listen 8004
14
- Listen 8005
15
-
16
- <IfModule ssl_module>
17
- Listen 8010
18
- </IfModule>
19
-
20
- <IfModule mod_gnutls.c>
21
- Listen 8010
22
- </IfModule>
23
-
24
- # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
@@ -1,9 +0,0 @@
1
- <VirtualHost *:8001>
2
- ServerName rack.test
3
- DocumentRoot /vagrant/dev/rack.test/public
4
- <Directory /vagrant/dev/rack.test/public>
5
- Allow from all
6
- Options -MultiViews
7
- Require all granted
8
- </Directory>
9
- </VirtualHost>
data/dev/vagrant/bashrc DELETED
@@ -1,23 +0,0 @@
1
- # This file is overwritten by 'vagrant provision'. For the source,
2
- # see dev/vagrant/bashrc in the Phusion Passenger source
3
- # tree.
4
-
5
- # Display git branch in bash prompt.
6
- export PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1 " (%s)")]\$ '
7
-
8
- # Add Phusion Passenger command line tools to PATH.
9
- export PATH=/vagrant/bin:$PATH
10
-
11
- # Tell Phusion Passenger's build system to use ccache.
12
- export USE_CCACHE=1
13
- export CCACHE_COMPRESS=1
14
-
15
- # Tell Phusion Passenger Standalone to run in debug mode.
16
- export PASSENGER_DEBUG=1
17
-
18
- export PASSENGER_VAGRANT_ENVIRONMENT=1
19
-
20
- alias ls='ls -Fh --color'
21
- alias dir='ls -l'
22
- alias free='free -m'
23
- alias df='df -h'
@@ -1,39 +0,0 @@
1
- daemon off;
2
- worker_processes 1;
3
- #user nobody;
4
- #error_log logs/error.log debug;
5
- #pid logs/nginx.pid;
6
-
7
-
8
- events {
9
- worker_connections 1024;
10
- }
11
-
12
-
13
- http {
14
- include mime.types;
15
- default_type application/octet-stream;
16
- sendfile on;
17
- keepalive_timeout 65;
18
- #gzip on;
19
-
20
- passenger_root /vagrant;
21
- passenger_ruby /usr/bin/ruby;
22
- passenger_log_level 1;
23
-
24
- server {
25
- listen 8100;
26
- server_name localhost;
27
- location / {
28
- root html;
29
- index index.html index.htm;
30
- }
31
- }
32
-
33
- server {
34
- listen 8101;
35
- server_name rack.test;
36
- root /vagrant/dev/rack.test/public;
37
- passenger_enabled on;
38
- }
39
- }
@@ -1,33 +0,0 @@
1
- ENV['CC'] ||= 'ccache cc'
2
- ENV['CXX'] ||= 'ccache c++'
3
-
4
- desc "Bootstrap Nginx for the first time"
5
- task :bootstrap => :configure do
6
- sh "make -j2"
7
- sh "make install"
8
- sh "rm -f inst/sbin/nginx"
9
- puts
10
- puts "--------------------------"
11
- puts "You're all set! You can start Nginx by running:"
12
- puts
13
- puts " ./start"
14
- puts
15
- puts "Nginx can be reached from the host machine on http://127.0.0.1:8100/"
16
- puts
17
- puts "You never have to run `rake bootstrap` again. You also never have to " +
18
- "run `make install`. If you've made changes to the Passenger Nginx module, " +
19
- "simply run `make && ./start` in /home/vagrant/nginx. The `start` script " +
20
- "will start the newly compiled Nginx binary directly."
21
- end
22
-
23
- desc "Configure Nginx source tree"
24
- task :configure do
25
- sh "./configure --prefix=/home/vagrant/nginx/inst" +
26
- " --add-module=/vagrant/src/nginx_module" +
27
- " --with-http_ssl_module" +
28
- " --with-http_gzip_static_module" +
29
- " --with-http_stub_status_module" +
30
- " --with-http_v2_module" +
31
- " --with-debug"
32
- sh "sed", "-E", "-i", 's/ -O[0-9]? / -ggdb /g', "objs/Makefile"
33
- end
@@ -1,32 +0,0 @@
1
- #!/usr/bin/ruby
2
- # This file is overwritten by 'vagrant provision'. For the source,
3
- # see dev/vagrant/nginx_start in the Phusion Passenger source
4
- # tree.
5
-
6
- ENV['PASSENGER_BEEP_ON_ABORT'] = '1'
7
-
8
- def run_in_bg(*command)
9
- return fork do
10
- Process.setsid
11
- exec(*command)
12
- end
13
- end
14
-
15
- File.open('inst/logs/error.log', 'a') do |f|
16
- f.write("\n\n\n\n-------------- NGINX START #{Time.now} --------------\n\n\n\n")
17
- end
18
-
19
- tail_pid = run_in_bg("tail -n 0 -f inst/logs/error.log")
20
- nginx_pid = run_in_bg("./objs/nginx", *ARGV)
21
- begin
22
- Process.waitpid(nginx_pid)
23
- nginx_pid = nil
24
- rescue Interrupt
25
- ensure
26
- Process.kill('INT', tail_pid)
27
- Process.waitpid(tail_pid)
28
- if nginx_pid
29
- Process.kill('INT', nginx_pid)
30
- Process.waitpid(nginx_pid)
31
- end
32
- end
@@ -1,117 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -ex
3
- set -o pipefail
4
-
5
-
6
- ### Update /etc/hosts
7
-
8
- if ! grep -q passenger.test /etc/hosts; then
9
- cat >>/etc/hosts <<-EOF
10
-
11
- 127.0.0.1 passenger.test
12
- 127.0.0.1 mycook.passenger.test
13
- 127.0.0.1 zsfa.passenger.test
14
- 127.0.0.1 norails.passenger.test
15
- 127.0.0.1 1.passenger.test 2.passenger.test 3.passenger.test
16
- 127.0.0.1 4.passenger.test 5.passenger.test 6.passenger.test
17
- 127.0.0.1 7.passenger.test 8.passenger.test 9.passenger.test
18
- 127.0.0.1 rack.test foobar.test
19
- EOF
20
- fi
21
-
22
-
23
- ### Update bashrc and bash profile
24
-
25
- if ! grep -q bashrc.mine /etc/bash.bashrc; then
26
- echo ". /etc/bash.bashrc.mine" >> /etc/bash.bashrc
27
- fi
28
- if ! grep -q bashrc.mine /home/vagrant/.bashrc; then
29
- echo ". /etc/bash.bashrc.mine" >> /home/vagrant/.bashrc
30
- fi
31
- if ! grep -q /vagrant /home/vagrant/.profile; then
32
- echo "if tty -s; then cd /vagrant; fi" >> /home/vagrant/.profile
33
- fi
34
- cp /vagrant/dev/vagrant/bashrc /etc/bash.bashrc.mine
35
- cp /vagrant/dev/vagrant/sudoers.conf /etc/sudoers.d/passenger
36
- chmod 440 /etc/sudoers.d/passenger
37
-
38
-
39
- ### Install native dependencies
40
-
41
- apt-get update
42
- apt-get install -y build-essential git bash-completion ccache wget \
43
- libxml2-dev libxslt1-dev libsqlite3-dev libcurl4-openssl-dev libpcre3-dev \
44
- ruby ruby-dev nodejs npm \
45
- apache2-mpm-worker apache2-threaded-dev
46
-
47
-
48
- ### Install basic gems
49
-
50
- if [[ ! -e /usr/local/bin/rake ]]; then
51
- gem install rake --no-rdoc --no-ri
52
- fi
53
- if [[ ! -e /usr/local/bin/drake ]]; then
54
- gem install drake --no-rdoc --no-ri
55
- fi
56
- if [[ ! -e /usr/local/bin/bundler ]]; then
57
- gem install bundler --no-rdoc --no-ri
58
- fi
59
-
60
-
61
- ### Install Phusion Passenger development dependencies
62
-
63
- pushd /vagrant
64
- if [[ ! -e ~/.test_deps_installed ]]; then
65
- rake test:install_deps SUDO=1 DEPS_TARGET=~/bundle
66
- touch ~/.test_deps_installed
67
- else
68
- bundle install --path ~/bundle
69
- fi
70
- popd
71
-
72
-
73
- ### Install Nginx source code
74
-
75
- pushd /home/vagrant
76
- if [[ ! -e nginx ]]; then
77
- sudo -u vagrant -H git clone -b branches/stable-1.6 https://github.com/nginx/nginx.git
78
- fi
79
- sudo -u vagrant -H mkdir -p nginx/inst/conf
80
- sudo -u vagrant -H cp /vagrant/dev/vagrant/nginx_start nginx/start
81
- if [[ ! -e nginx/Rakefile ]]; then
82
- sudo -u vagrant -H cp /vagrant/dev/vagrant/nginx_rakefile nginx/Rakefile
83
- fi
84
- if [[ ! -e nginx/inst/conf/nginx.conf ]]; then
85
- sudo -u vagrant -H cp /vagrant/dev/vagrant/nginx.conf nginx/inst/conf/
86
- fi
87
- if [[ ! -e nginx/nginx.conf && ! -h nginx/nginx.conf ]]; then
88
- sudo -u vagrant -H ln -s inst/conf/nginx.conf nginx/nginx.conf
89
- fi
90
- if [[ ! -e nginx/access.log && ! -h nginx/access.log ]]; then
91
- sudo -u vagrant -H ln -s inst/logs/access.log nginx/access.log
92
- fi
93
- if [[ ! -e nginx/error.log && ! -h nginx/error.log ]]; then
94
- sudo -u vagrant -H ln -s inst/logs/error.log nginx/error.log
95
- fi
96
- popd
97
-
98
-
99
- ### Set up Apache
100
-
101
- should_restart_apache=false
102
- cp /vagrant/dev/vagrant/apache_ports.conf /etc/apache2/ports.conf
103
- cp /vagrant/dev/vagrant/apache_default_site.conf /etc/apache2/sites-available/000-default.conf
104
- if [[ ! -e /etc/apache2/mods-available/passenger.conf ]]; then
105
- cp /vagrant/dev/vagrant/apache_passenger.conf /etc/apache2/mods-available/passenger.conf
106
- fi
107
- if [[ ! -e /etc/apache2/mods-available/passenger.load ]]; then
108
- cp /vagrant/dev/vagrant/apache_passenger.load /etc/apache2/mods-available/passenger.load
109
- fi
110
- if [[ ! -e /etc/apache2/sites-available/010-rack.test.conf ]]; then
111
- cp /vagrant/dev/vagrant/apache_rack_test.conf /etc/apache2/sites-available/010-rack.test.conf
112
- a2ensite 010-rack.test
113
- should_restart_apache=true
114
- fi
115
- if $should_restart_apache; then
116
- service apache2 restart
117
- fi
@@ -1,5 +0,0 @@
1
- # This file is overwritten by 'vagrant provision'. For the source,
2
- # see dev/vagrant/sudoers.conf in the Phusion Passenger source
3
- # tree.
4
-
5
- Defaults secure_path="/vagrant/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
@@ -1,19 +0,0 @@
1
- [*.jsx]
2
- indent_style=space
3
- indent_size=2
4
- trim_trailing_whitespace = true
5
-
6
- [*.js]
7
- indent_style=space
8
- indent_size=2
9
- trim_trailing_whitespace = true
10
-
11
- [*.css]
12
- indent_style=space
13
- indent_size=2
14
- trim_trailing_whitespace = true
15
-
16
- [*.html.template]
17
- indent_style=space
18
- indent_size=2
19
- trim_trailing_whitespace = true
@@ -1,109 +0,0 @@
1
- /*
2
- * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2013-2017 Phusion Holding B.V.
4
- *
5
- * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
- * trademarks of Phusion Holding B.V.
7
- *
8
- * Permission is hereby granted, free of charge, to any person obtaining a copy
9
- * of this software and associated documentation files (the "Software"), to deal
10
- * in the Software without restriction, including without limitation the rights
11
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- * copies of the Software, and to permit persons to whom the Software is
13
- * furnished to do so, subject to the following conditions:
14
- *
15
- * The above copyright notice and this permission notice shall be included in
16
- * all copies or substantial portions of the Software.
17
- *
18
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- * THE SOFTWARE.
25
- */
26
-
27
- #include <AppTypes.h>
28
- #include <exception>
29
- #include <string.h>
30
-
31
- namespace Passenger {
32
-
33
- /* If you update this structure, also update the following:
34
- * - ApplicationPool2::Options::getStartCommand()
35
- * - src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb
36
- * - The documentation for `PassengerAppEnv` (Apache) and `passenger_app_env` (Nginx)
37
- * - The Developer Guide, section "Executing the loader or preloader"
38
- */
39
- const AppTypeDefinition appTypeDefinitions[] = {
40
- { PAT_RACK, "rack", "config.ru", "Passenger RubyApp" },
41
- { PAT_WSGI, "wsgi", "passenger_wsgi.py", "Passenger WsgiApp" },
42
- { PAT_NODE, "node", "app.js", "Passenger NodeApp" },
43
- { PAT_METEOR, "meteor", ".meteor", "Passenger MeteorApp" },
44
- { PAT_NONE, NULL, NULL, NULL }
45
- };
46
-
47
- } // namespace Passenger
48
-
49
-
50
- using namespace Passenger;
51
-
52
- PP_AppTypeDetector *
53
- pp_app_type_detector_new(unsigned int throttleRate) {
54
- try {
55
- return new AppTypeDetector(NULL, NULL, throttleRate);
56
- } catch (const std::bad_alloc &) {
57
- return 0;
58
- }
59
- }
60
-
61
- void
62
- pp_app_type_detector_free(PP_AppTypeDetector *detector) {
63
- delete (AppTypeDetector *) detector;
64
- }
65
-
66
- void
67
- pp_app_type_detector_set_throttle_rate(PP_AppTypeDetector *_detector,
68
- unsigned int throttleRate)
69
- {
70
- AppTypeDetector *detector = (AppTypeDetector *) _detector;
71
- detector->setThrottleRate(throttleRate);
72
- }
73
-
74
- PassengerAppType
75
- pp_app_type_detector_check_document_root(PP_AppTypeDetector *_detector,
76
- const char *documentRoot, unsigned int len, int resolveFirstSymlink,
77
- PP_Error *error)
78
- {
79
- AppTypeDetector *detector = (AppTypeDetector *) _detector;
80
- try {
81
- return detector->checkDocumentRoot(StaticString(documentRoot, len), resolveFirstSymlink);
82
- } catch (const std::exception &e) {
83
- pp_error_set(e, error);
84
- return PAT_ERROR;
85
- }
86
- }
87
-
88
- PassengerAppType
89
- pp_app_type_detector_check_app_root(PP_AppTypeDetector *_detector,
90
- const char *appRoot, unsigned int len, PP_Error *error)
91
- {
92
- AppTypeDetector *detector = (AppTypeDetector *) _detector;
93
- try {
94
- return detector->checkAppRoot(StaticString(appRoot, len));
95
- } catch (const std::exception &e) {
96
- pp_error_set(e, error);
97
- return PAT_ERROR;
98
- }
99
- }
100
-
101
- const char *
102
- pp_get_app_type_name(PassengerAppType type) {
103
- return getAppTypeName(type);
104
- }
105
-
106
- PassengerAppType
107
- pp_get_app_type2(const char *name, unsigned int len) {
108
- return getAppType(StaticString(name, len));
109
- }