passenger 5.3.5 → 5.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +13 -0
- data/README.md +2 -1
- data/Rakefile +0 -5
- data/build/agent.rb +2 -1
- data/build/cxx_tests.rb +18 -20
- data/build/integration_tests.rb +6 -2
- data/build/support/cxx_dependency_map.rb +2019 -1966
- data/dev/colorize-logs +272 -0
- data/src/agent/Core/AdminPanelConnector.h +3 -3
- data/src/agent/Core/ApiServer.h +4 -4
- data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +2 -2
- data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +2 -2
- data/src/agent/Core/ApplicationPool/Implementation.cpp +5 -5
- data/src/agent/Core/ApplicationPool/Pool.h +4 -4
- data/src/agent/Core/ApplicationPool/Process.h +10 -15
- data/src/agent/Core/ApplicationPool/Socket.h +2 -2
- data/src/agent/Core/ApplicationPool/TestSession.h +3 -3
- data/src/agent/Core/Config.h +4 -2
- data/src/agent/Core/Controller.h +4 -4
- data/src/agent/Core/Controller/Config.h +1 -1
- data/src/agent/Core/Controller/SendRequest.cpp +2 -2
- data/src/agent/Core/Controller/TurboCaching.h +2 -2
- data/src/agent/Core/CoreMain.cpp +2 -2
- data/src/agent/Core/OptionParser.h +2 -2
- data/src/agent/Core/ResponseCache.h +3 -3
- data/src/agent/Core/SecurityUpdateChecker.h +2 -2
- data/src/agent/Core/SpawningKit/Config.h +2 -1
- data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/Context.h +1 -1
- data/src/agent/Core/SpawningKit/DirectSpawner.h +3 -3
- data/src/agent/Core/SpawningKit/DummySpawner.h +3 -3
- data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
- data/src/agent/Core/SpawningKit/Exceptions.h +2 -2
- data/src/agent/Core/SpawningKit/Factory.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
- data/src/agent/Core/SpawningKit/Handshake/Perform.h +13 -2
- data/src/agent/Core/SpawningKit/Handshake/Prepare.h +3 -3
- data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
- data/src/agent/Core/SpawningKit/Journey.h +4 -5
- data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
- data/src/agent/Core/SpawningKit/Result.h +20 -8
- data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/SmartSpawner.h +6 -6
- data/src/agent/Core/SpawningKit/Spawner.h +2 -2
- data/src/agent/Core/TelemetryCollector.h +13 -7
- data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
- data/src/agent/README.md +1 -1
- data/src/agent/Shared/ApiAccountUtils.h +1 -1
- data/src/agent/Shared/ApiServerUtils.h +3 -3
- data/src/agent/Shared/ApplicationPoolApiKey.h +2 -2
- data/src/agent/Shared/Fundamentals/Initialization.cpp +4 -4
- data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
- data/src/agent/SystemMetrics/SystemMetricsMain.cpp +4 -3
- data/src/agent/Watchdog/ApiServer.h +3 -3
- data/src/agent/Watchdog/Config.h +3 -2
- data/src/agent/Watchdog/CoreWatcher.cpp +2 -2
- data/src/agent/Watchdog/WatchdogMain.cpp +93 -27
- data/src/apache2_module/Config.cpp +14 -14
- data/src/apache2_module/Config.h +8 -16
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +505 -491
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +39 -17
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +24 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +31 -1
- data/src/{cxx_supportlib/Utils/MemoryBarrier.h → apache2_module/ConfigGeneral/Common.h} +17 -25
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +12 -1
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +16 -1
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +19 -5
- data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +26 -9
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +6 -1
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +10 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +7 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +11 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +23 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +34 -1
- data/src/apache2_module/Hooks.cpp +3 -3
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +24 -1
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +36 -1
- data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.cpp +2 -2
- data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.h +4 -4
- data/src/cxx_supportlib/AppTypeDetector/Detector.h +1 -1
- data/src/cxx_supportlib/ConfigKit/Schema.h +2 -2
- data/src/cxx_supportlib/ConfigKit/Store.h +1 -1
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/cxx_supportlib/{Utils → DataStructures}/HashMap.h +4 -4
- data/src/cxx_supportlib/DataStructures/HashedStaticString.h +5 -5
- data/src/cxx_supportlib/DataStructures/LString.h +3 -3
- data/src/cxx_supportlib/{Utils → DataStructures}/StringMap.h +36 -36
- data/src/cxx_supportlib/FileTools/FileManip.cpp +1 -1
- data/src/cxx_supportlib/FileTools/PathManip.cpp +2 -2
- data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
- data/src/cxx_supportlib/Hooks.h +2 -2
- data/src/cxx_supportlib/{Utils → IOTools}/BufferedIO.h +5 -5
- data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.cpp +2 -2
- data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.h +3 -3
- data/src/cxx_supportlib/{Utils → IOTools}/MessageIO.h +7 -7
- data/src/cxx_supportlib/{MessageReadersWriters.h → IOTools/MessageSerialization.h} +5 -5
- data/src/cxx_supportlib/InstanceDirectory.h +4 -4
- data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +3 -3
- data/src/cxx_supportlib/{Utils → JsonTools}/JsonUtils.h +5 -5
- data/src/cxx_supportlib/LoggingKit/Context.h +2 -2
- data/src/cxx_supportlib/LoggingKit/Implementation.cpp +3 -3
- data/src/cxx_supportlib/MemoryKit/mbuf.cpp +2 -2
- data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +5 -5
- data/src/cxx_supportlib/ProcessManagement/Utils.h +10 -0
- data/src/cxx_supportlib/RandomGenerator.h +2 -2
- data/src/cxx_supportlib/{Crypto.cpp → SecurityKit/Crypto.cpp} +4 -4
- data/src/cxx_supportlib/{Crypto.h → SecurityKit/Crypto.h} +4 -4
- data/src/cxx_supportlib/{Utils → SecurityKit}/MemZeroGuard.h +0 -0
- data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +2 -2
- data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
- data/src/cxx_supportlib/ServerKit/Context.h +2 -2
- data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +1 -1
- data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +3 -3
- data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +2 -2
- data/src/cxx_supportlib/ServerKit/HttpServer.h +16 -10
- data/src/cxx_supportlib/ServerKit/Server.h +3 -3
- data/src/cxx_supportlib/{Utils → StrIntTools}/DateParsing.h +5 -5
- data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.cpp +3 -3
- data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.h +0 -0
- data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtilsNoStrictAliasing.cpp +2 -2
- data/src/cxx_supportlib/{Utils → StrIntTools}/StringScanning.h +5 -5
- data/src/cxx_supportlib/{Utils → StrIntTools}/Template.h +30 -5
- data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +34 -0
- data/src/cxx_supportlib/{Utils → SystemTools}/ProcessMetricsCollector.h +6 -6
- data/src/cxx_supportlib/{Utils → SystemTools}/SystemMetricsCollector.h +3 -3
- data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.cpp +1 -1
- data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.h +0 -0
- data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
- data/src/cxx_supportlib/Utils.cpp +2 -2
- data/src/cxx_supportlib/Utils/CachedFileStat.hpp +3 -3
- data/src/cxx_supportlib/Utils/Curl.h +2 -2
- data/src/cxx_supportlib/Utils/FileChangeChecker.h +2 -2
- data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
- data/src/cxx_supportlib/Utils/SpeedMeter.h +2 -2
- data/src/cxx_supportlib/Utils/Timer.h +2 -2
- data/src/cxx_supportlib/Utils/VariantMap.h +3 -3
- data/src/cxx_supportlib/WatchdogLauncher.h +3 -3
- data/src/cxx_supportlib/WebSocketCommandReverseServer.h +1 -1
- data/src/cxx_supportlib/WrapperRegistry/Registry.h +1 -1
- data/src/cxx_supportlib/vendor-modified/psg_sysqueue.h +3 -0
- data/src/ruby_supportlib/phusion_passenger.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +11 -11
- data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +4 -4
- data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/message_channel.rb +2 -2
- data/src/ruby_supportlib/phusion_passenger/packaging.rb +20 -19
- data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +22 -4
- data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +33 -13
- data/src/schema_printer/SchemaPrinterMain.cpp +2 -0
- metadata +28 -86
- data/.editorconfig +0 -134
- data/CODE_OF_CONDUCT.md +0 -52
- data/dev/boost-patches/0001-Patch-boost-thread-so-that-oxt-thread-can-use-it.patch +0 -48
- data/dev/boost-patches/0002-Make-boost-thread_interrupted-derive-from-oxt-tracab.patch +0 -33
- data/dev/boost-patches/0003-Disable-a-Clang-pragma-to-prevent-warnings-on-OS-X.patch +0 -25
- data/dev/ci/README.md +0 -134
- data/dev/ci/lib/functions.sh +0 -129
- data/dev/ci/lib/set-container-envvars.sh +0 -53
- data/dev/ci/lib/setup-container.sh +0 -46
- data/dev/ci/run-tests-natively +0 -24
- data/dev/ci/run-tests-with-docker +0 -42
- data/dev/ci/scripts/debug-console-wrapper.sh +0 -29
- data/dev/ci/scripts/docker-entrypoint-stage2.sh +0 -17
- data/dev/ci/scripts/docker-entrypoint.sh +0 -17
- data/dev/ci/scripts/inituidgid +0 -17
- data/dev/ci/scripts/run-tests-natively-stage2.sh +0 -17
- data/dev/ci/scripts/setup-host-natively.sh +0 -11
- data/dev/ci/setup-host +0 -56
- data/dev/ci/tests/apache2/run +0 -6
- data/dev/ci/tests/apache2/setup +0 -4
- data/dev/ci/tests/binaries/Jenkinsfile +0 -105
- data/dev/ci/tests/binaries/build-linux +0 -38
- data/dev/ci/tests/binaries/build-macos +0 -40
- data/dev/ci/tests/binaries/prepare-macos +0 -38
- data/dev/ci/tests/binaries/test-linux +0 -45
- data/dev/ci/tests/binaries/test-macos +0 -38
- data/dev/ci/tests/cxx/run +0 -9
- data/dev/ci/tests/cxx/setup +0 -4
- data/dev/ci/tests/debian/Jenkinsfile +0 -89
- data/dev/ci/tests/debian/run +0 -60
- data/dev/ci/tests/nginx-dynamic/run +0 -20
- data/dev/ci/tests/nginx-dynamic/setup +0 -4
- data/dev/ci/tests/nginx/run +0 -5
- data/dev/ci/tests/nginx/setup +0 -4
- data/dev/ci/tests/nodejs/run +0 -4
- data/dev/ci/tests/nodejs/setup +0 -4
- data/dev/ci/tests/rpm/Jenkinsfile +0 -68
- data/dev/ci/tests/rpm/run +0 -63
- data/dev/ci/tests/ruby/run +0 -4
- data/dev/ci/tests/ruby/setup +0 -4
- data/dev/ci/tests/source-packaging/run +0 -4
- data/dev/ci/tests/source-packaging/setup +0 -4
- data/dev/ci/tests/standalone/run +0 -4
- data/dev/ci/tests/standalone/setup +0 -4
- data/dev/configkit-schemas/index.json +0 -1850
- data/dev/configkit-schemas/update_schema_inline_comments.rb +0 -118
- data/dev/rack.test/config.ru +0 -5
- data/dev/rack.test/public/asset.txt +0 -1
- data/dev/vagrant/apache_default_site.conf +0 -35
- data/dev/vagrant/apache_passenger.conf +0 -5
- data/dev/vagrant/apache_passenger.load +0 -1
- data/dev/vagrant/apache_ports.conf +0 -24
- data/dev/vagrant/apache_rack_test.conf +0 -9
- data/dev/vagrant/bashrc +0 -23
- data/dev/vagrant/nginx.conf +0 -39
- data/dev/vagrant/nginx_rakefile +0 -33
- data/dev/vagrant/nginx_start +0 -32
- data/dev/vagrant/provision.sh +0 -117
- data/dev/vagrant/sudoers.conf +0 -5
- data/resources/templates/error_renderer/.editorconfig +0 -19
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2011-
|
|
3
|
+
* Copyright (c) 2011-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
#include <LoggingKit/LoggingKit.h>
|
|
38
38
|
#include <StaticString.h>
|
|
39
39
|
#include <MemoryKit/palloc.h>
|
|
40
|
-
#include <
|
|
40
|
+
#include <IOTools/IOUtils.h>
|
|
41
41
|
#include <Core/ApplicationPool/Common.h>
|
|
42
42
|
|
|
43
43
|
namespace Passenger {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2016-
|
|
3
|
+
* Copyright (c) 2016-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
#include <boost/thread.hpp>
|
|
30
30
|
#include <string>
|
|
31
31
|
#include <cassert>
|
|
32
|
-
#include <
|
|
33
|
-
#include <
|
|
32
|
+
#include <IOTools/IOUtils.h>
|
|
33
|
+
#include <IOTools/BufferedIO.h>
|
|
34
34
|
#include <Core/ApplicationPool/AbstractSession.h>
|
|
35
35
|
|
|
36
36
|
namespace Passenger {
|
data/src/agent/Core/Config.h
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
#include <Shared/ApiAccountUtils.h>
|
|
51
51
|
#include <Constants.h>
|
|
52
52
|
#include <Utils.h>
|
|
53
|
-
#include <
|
|
53
|
+
#include <IOTools/IOUtils.h>
|
|
54
54
|
|
|
55
55
|
namespace Passenger {
|
|
56
56
|
namespace Core {
|
|
@@ -145,6 +145,7 @@ using namespace std;
|
|
|
145
145
|
* max_instances_per_app unsigned integer - read_only
|
|
146
146
|
* max_pool_size unsigned integer - default(6)
|
|
147
147
|
* multi_app boolean - default(false),read_only
|
|
148
|
+
* oom_score string - read_only
|
|
148
149
|
* passenger_root string required read_only
|
|
149
150
|
* pid_file string - read_only
|
|
150
151
|
* pool_idle_time unsigned integer - default(300)
|
|
@@ -156,7 +157,7 @@ using namespace std;
|
|
|
156
157
|
* security_update_checker_interval unsigned integer - default(86400)
|
|
157
158
|
* security_update_checker_proxy_url string - -
|
|
158
159
|
* security_update_checker_url string - default("https://securitycheck.phusionpassenger.com/v1/check.json")
|
|
159
|
-
* server_software string - default("Phusion_Passenger/5.3.
|
|
160
|
+
* server_software string - default("Phusion_Passenger/5.3.6")
|
|
160
161
|
* show_version_in_header boolean - default(true)
|
|
161
162
|
* single_app_mode_app_root string - default,read_only
|
|
162
163
|
* single_app_mode_app_type string - read_only
|
|
@@ -470,6 +471,7 @@ public:
|
|
|
470
471
|
add("config_manifest", OBJECT_TYPE, OPTIONAL | READ_ONLY);
|
|
471
472
|
add("pid_file", STRING_TYPE, OPTIONAL | READ_ONLY);
|
|
472
473
|
add("web_server_version", STRING_TYPE, OPTIONAL | READ_ONLY);
|
|
474
|
+
add("oom_score", STRING_TYPE, OPTIONAL | READ_ONLY);
|
|
473
475
|
addWithDynamicDefault("controller_threads", UINT_TYPE, OPTIONAL | READ_ONLY, getDefaultThreads);
|
|
474
476
|
add("max_pool_size", UINT_TYPE, OPTIONAL, DEFAULT_MAX_POOL_SIZE);
|
|
475
477
|
add("pool_idle_time", UINT_TYPE, OPTIONAL, Json::UInt(DEFAULT_POOL_IDLE_TIME));
|
data/src/agent/Core/Controller.h
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
#include <cctype>
|
|
63
63
|
|
|
64
64
|
#include <LoggingKit/LoggingKit.h>
|
|
65
|
-
#include <
|
|
65
|
+
#include <IOTools/MessageSerialization.h>
|
|
66
66
|
#include <Constants.h>
|
|
67
67
|
#include <ConfigKit/ConfigKit.h>
|
|
68
68
|
#include <ServerKit/Errors.h>
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
#include <WrapperRegistry/Registry.h>
|
|
75
75
|
#include <StaticString.h>
|
|
76
76
|
#include <Utils.h>
|
|
77
|
-
#include <
|
|
78
|
-
#include <
|
|
79
|
-
#include <
|
|
77
|
+
#include <StrIntTools/StrIntUtils.h>
|
|
78
|
+
#include <IOTools/IOUtils.h>
|
|
79
|
+
#include <JsonTools/JsonUtils.h>
|
|
80
80
|
#include <Utils/HttpConstants.h>
|
|
81
81
|
#include <Utils/Timer.h>
|
|
82
82
|
#include <Core/Controller/Config.h>
|
|
@@ -113,7 +113,7 @@ parseControllerBenchmarkMode(const StaticString &mode) {
|
|
|
113
113
|
* multi_app boolean - default(true),read_only
|
|
114
114
|
* request_freelist_limit unsigned integer - default(1024)
|
|
115
115
|
* response_buffer_high_watermark unsigned integer - default(134217728)
|
|
116
|
-
* server_software string - default("Phusion_Passenger/5.3.
|
|
116
|
+
* server_software string - default("Phusion_Passenger/5.3.6")
|
|
117
117
|
* show_version_in_header boolean - default(true)
|
|
118
118
|
* start_reading_after_accept boolean - default(true)
|
|
119
119
|
* stat_throttle_rate unsigned integer - default(10)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2011-
|
|
3
|
+
* Copyright (c) 2011-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* THE SOFTWARE.
|
|
25
25
|
*/
|
|
26
26
|
#include <Core/Controller.h>
|
|
27
|
-
#include <
|
|
27
|
+
#include <SystemTools/SystemTime.h>
|
|
28
28
|
|
|
29
29
|
/*************************************************************************
|
|
30
30
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2014-
|
|
3
|
+
* Copyright (c) 2014-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
#include <ServerKit/Context.h>
|
|
36
36
|
#include <Constants.h>
|
|
37
37
|
#include <LoggingKit/LoggingKit.h>
|
|
38
|
-
#include <
|
|
38
|
+
#include <StrIntTools/StrIntUtils.h>
|
|
39
39
|
#include <Core/ResponseCache.h>
|
|
40
40
|
|
|
41
41
|
namespace Passenger {
|
data/src/agent/Core/CoreMain.cpp
CHANGED
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
#include <ServerKit/Server.h>
|
|
83
83
|
#include <ServerKit/AcceptLoadBalancer.h>
|
|
84
84
|
#include <AppTypeDetector/Detector.h>
|
|
85
|
-
#include <
|
|
85
|
+
#include <IOTools/MessageSerialization.h>
|
|
86
86
|
#include <FileDescriptor.h>
|
|
87
87
|
#include <ResourceLocator.h>
|
|
88
88
|
#include <BackgroundEventLoop.cpp>
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
#include <Exceptions.h>
|
|
92
92
|
#include <Utils.h>
|
|
93
93
|
#include <Utils/Timer.h>
|
|
94
|
-
#include <
|
|
94
|
+
#include <IOTools/MessageIO.h>
|
|
95
95
|
#include <Core/OptionParser.h>
|
|
96
96
|
#include <Core/Controller.h>
|
|
97
97
|
#include <Core/ApiServer.h>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2010-
|
|
3
|
+
* Copyright (c) 2010-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
#include <JsonTools/Autocast.h>
|
|
35
35
|
#include <Utils.h>
|
|
36
36
|
#include <Utils/OptionParsing.h>
|
|
37
|
-
#include <
|
|
37
|
+
#include <StrIntTools/StrIntUtils.h>
|
|
38
38
|
|
|
39
39
|
#include <jsoncpp/json.h>
|
|
40
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2014-
|
|
3
|
+
* Copyright (c) 2014-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
#include <ServerKit/http_parser.h>
|
|
35
35
|
#include <ServerKit/CookieUtils.h>
|
|
36
36
|
#include <StaticString.h>
|
|
37
|
-
#include <
|
|
38
|
-
#include <
|
|
37
|
+
#include <StrIntTools/DateParsing.h>
|
|
38
|
+
#include <StrIntTools/StrIntUtils.h>
|
|
39
39
|
|
|
40
40
|
namespace Passenger {
|
|
41
41
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2017 Phusion Holding B.V.
|
|
3
|
+
* Copyright (c) 2017-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
#include <oxt/thread.hpp>
|
|
34
34
|
#include <oxt/backtrace.hpp>
|
|
35
35
|
|
|
36
|
-
#include <Crypto.h>
|
|
36
|
+
#include <SecurityKit/Crypto.h>
|
|
37
37
|
#include <ResourceLocator.h>
|
|
38
38
|
#include <Exceptions.h>
|
|
39
39
|
#include <StaticString.h>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2011-
|
|
3
|
+
* Copyright (c) 2011-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -299,6 +299,7 @@ public:
|
|
|
299
299
|
* to the given log file.
|
|
300
300
|
*
|
|
301
301
|
* @hinted_parseable
|
|
302
|
+
* @non_confidential
|
|
302
303
|
* @pass_during_handshake
|
|
303
304
|
*/
|
|
304
305
|
StaticString logFile;
|
|
@@ -344,7 +344,7 @@ Passenger::SpawningKit::Config::getNonConfidentialFieldsToPassToApp() const {
|
|
|
344
344
|
doc["user"] = user.toString();
|
|
345
345
|
doc["group"] = group.toString();
|
|
346
346
|
doc["environment_variables"] = "<SECRET>";
|
|
347
|
-
doc["log_file"] =
|
|
347
|
+
doc["log_file"] = logFile.toString();
|
|
348
348
|
if (!config.apiKey.empty()) {
|
|
349
349
|
doc["api_key"] = "<SECRET>";
|
|
350
350
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2011-
|
|
3
|
+
* Copyright (c) 2011-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
#include <Constants.h>
|
|
37
37
|
#include <LoggingKit/LoggingKit.h>
|
|
38
38
|
#include <LveLoggingDecorator.h>
|
|
39
|
-
#include <
|
|
39
|
+
#include <IOTools/IOUtils.h>
|
|
40
40
|
#include <Utils/AsyncSignalSafeUtils.h>
|
|
41
41
|
|
|
42
42
|
#include <limits.h> // for PTHREAD_STACK_MIN
|
|
@@ -164,7 +164,7 @@ private:
|
|
|
164
164
|
dup2(stdinCopy, 0);
|
|
165
165
|
dup2(stdoutAndErrCopy, 1);
|
|
166
166
|
dup2(stdoutAndErrCopy, 2);
|
|
167
|
-
closeAllFileDescriptors(2
|
|
167
|
+
closeAllFileDescriptors(2);
|
|
168
168
|
|
|
169
169
|
execlp(agentFilename.c_str(),
|
|
170
170
|
agentFilename.c_str(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2011-
|
|
3
|
+
* Copyright (c) 2011-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
#include <vector>
|
|
32
32
|
|
|
33
33
|
#include <StaticString.h>
|
|
34
|
-
#include <
|
|
34
|
+
#include <StrIntTools/StrIntUtils.h>
|
|
35
35
|
#include <Core/SpawningKit/Spawner.h>
|
|
36
36
|
#include <Core/SpawningKit/Exceptions.h>
|
|
37
37
|
|
|
@@ -89,7 +89,7 @@ public:
|
|
|
89
89
|
|
|
90
90
|
result.initialize(*context, &config);
|
|
91
91
|
result.pid = number;
|
|
92
|
-
result.
|
|
92
|
+
result.type = Result::DUMMY;
|
|
93
93
|
result.gupid = "gupid-" + toString(number);
|
|
94
94
|
result.spawnEndTime = result.spawnStartTime;
|
|
95
95
|
result.spawnEndTimeMonotonic = result.spawnStartTimeMonotonic;
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
#include <LoggingKit/LoggingKit.h>
|
|
37
37
|
#include <DataStructures/StringKeyTable.h>
|
|
38
38
|
#include <ProcessManagement/Spawn.h>
|
|
39
|
-
#include <
|
|
40
|
-
#include <
|
|
39
|
+
#include <SystemTools/SystemMetricsCollector.h>
|
|
40
|
+
#include <StrIntTools/StrIntUtils.h>
|
|
41
41
|
#include <Core/SpawningKit/Config.h>
|
|
42
42
|
#include <Core/SpawningKit/Journey.h>
|
|
43
43
|
|
|
@@ -48,7 +48,7 @@ private:
|
|
|
48
48
|
SpawnerPtr tryCreateSmartSpawner(const AppPoolOptions &options) {
|
|
49
49
|
string dir = context->resourceLocator->getHelperScriptsDir();
|
|
50
50
|
vector<string> preloaderCommand;
|
|
51
|
-
if (options.appType == "rack") {
|
|
51
|
+
if (options.appType == "ruby" || options.appType == "rack") {
|
|
52
52
|
preloaderCommand.push_back(options.ruby);
|
|
53
53
|
preloaderCommand.push_back(dir + "/rack-preloader.rb");
|
|
54
54
|
} else {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
#include <FileTools/PathManip.h>
|
|
53
53
|
#include <Utils.h>
|
|
54
54
|
#include <Utils/ScopeGuard.h>
|
|
55
|
-
#include <
|
|
56
|
-
#include <
|
|
55
|
+
#include <SystemTools/SystemTime.h>
|
|
56
|
+
#include <StrIntTools/StrIntUtils.h>
|
|
57
57
|
#include <Core/SpawningKit/Config.h>
|
|
58
58
|
#include <Core/SpawningKit/Exceptions.h>
|
|
59
59
|
#include <Core/SpawningKit/Handshake/BackgroundIOCapturer.h>
|
|
@@ -297,6 +297,7 @@ private:
|
|
|
297
297
|
result.stdoutAndErrFd = stdoutAndErrFd;
|
|
298
298
|
result.spawnEndTime = SystemTime::getUsec();
|
|
299
299
|
result.spawnEndTimeMonotonic = SystemTime::getMonotonicUsec();
|
|
300
|
+
setResultType(result);
|
|
300
301
|
|
|
301
302
|
if (socketIsNowPingable) {
|
|
302
303
|
assert(config->genericApp || config->findFreePort);
|
|
@@ -1674,6 +1675,16 @@ private:
|
|
|
1674
1675
|
return result;
|
|
1675
1676
|
}
|
|
1676
1677
|
|
|
1678
|
+
void setResultType(Result &result) const {
|
|
1679
|
+
if (config->genericApp) {
|
|
1680
|
+
result.type = Result::GENERIC;
|
|
1681
|
+
} else if (config->startsUsingWrapper) {
|
|
1682
|
+
result.type = Result::AUTO_SUPPORTED;
|
|
1683
|
+
} else {
|
|
1684
|
+
result.type = Result::KURIA;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1677
1688
|
public:
|
|
1678
1689
|
struct DebugSupport {
|
|
1679
1690
|
virtual ~DebugSupport() { }
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
#include <FileTools/FileManip.h>
|
|
57
57
|
#include <FileTools/PathManip.h>
|
|
58
58
|
#include <SystemTools/UserDatabase.h>
|
|
59
|
-
#include <
|
|
59
|
+
#include <SystemTools/SystemTime.h>
|
|
60
60
|
#include <Utils/Timer.h>
|
|
61
|
-
#include <
|
|
62
|
-
#include <
|
|
61
|
+
#include <IOTools/IOUtils.h>
|
|
62
|
+
#include <StrIntTools/StrIntUtils.h>
|
|
63
63
|
#include <Core/SpawningKit/Context.h>
|
|
64
64
|
#include <Core/SpawningKit/Config.h>
|
|
65
65
|
#include <Core/SpawningKit/Journey.h>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2017 Phusion Holding B.V.
|
|
3
|
+
* Copyright (c) 2017-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -36,10 +36,9 @@
|
|
|
36
36
|
|
|
37
37
|
#include <LoggingKit/LoggingKit.h>
|
|
38
38
|
#include <StaticString.h>
|
|
39
|
-
#include <
|
|
40
|
-
#include <
|
|
41
|
-
#include <
|
|
42
|
-
#include <Utils/SystemTime.h>
|
|
39
|
+
#include <SystemTools/SystemTime.h>
|
|
40
|
+
#include <JsonTools/JsonUtils.h>
|
|
41
|
+
#include <StrIntTools/StrIntUtils.h>
|
|
43
42
|
|
|
44
43
|
namespace Passenger {
|
|
45
44
|
namespace SpawningKit {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
|
3
|
-
* Copyright (c) 2014-
|
|
3
|
+
* Copyright (c) 2014-2018 Phusion Holding B.V.
|
|
4
4
|
*
|
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
|
6
6
|
* trademarks of Phusion Holding B.V.
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
#include <FileDescriptor.h>
|
|
35
35
|
#include <Exceptions.h>
|
|
36
|
-
#include <
|
|
36
|
+
#include <SystemTools/SystemTime.h>
|
|
37
37
|
#include <ConfigKit/ConfigKit.h>
|
|
38
38
|
#include <Core/SpawningKit/Context.h>
|
|
39
39
|
#include <Core/SpawningKit/Config.h>
|
|
@@ -113,6 +113,19 @@ public:
|
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
+
enum Type {
|
|
117
|
+
UNKNOWN,
|
|
118
|
+
GENERIC,
|
|
119
|
+
KURIA,
|
|
120
|
+
AUTO_SUPPORTED,
|
|
121
|
+
/**
|
|
122
|
+
* Indicates that this Process does not refer to a real OS
|
|
123
|
+
* process. The sockets in the socket list are fake and need not be deleted.
|
|
124
|
+
* Set to true by DummySpawner, used during unit tests.
|
|
125
|
+
*/
|
|
126
|
+
DUMMY
|
|
127
|
+
};
|
|
128
|
+
|
|
116
129
|
private:
|
|
117
130
|
void validate_autoGeneratedCode(vector<StaticString> &internalFieldErrors,
|
|
118
131
|
vector<StaticString> &appSuppliedFieldErrors) const;
|
|
@@ -127,13 +140,9 @@ public:
|
|
|
127
140
|
pid_t pid;
|
|
128
141
|
|
|
129
142
|
/**
|
|
130
|
-
* If true, then indicates that this Process does not refer to a real OS
|
|
131
|
-
* process. The sockets in the socket list are fake and need not be deleted.
|
|
132
|
-
* Set to true by DummySpawner, used during unit tests.
|
|
133
|
-
*
|
|
134
143
|
* @hinted_parseable
|
|
135
144
|
*/
|
|
136
|
-
|
|
145
|
+
Type type;
|
|
137
146
|
|
|
138
147
|
/**
|
|
139
148
|
* @hinted_parseable
|
|
@@ -188,7 +197,7 @@ public:
|
|
|
188
197
|
|
|
189
198
|
Result()
|
|
190
199
|
: pid(-1),
|
|
191
|
-
|
|
200
|
+
type(UNKNOWN),
|
|
192
201
|
spawnStartTime(0),
|
|
193
202
|
spawnEndTime(0),
|
|
194
203
|
spawnStartTimeMonotonic(0),
|
|
@@ -207,6 +216,9 @@ public:
|
|
|
207
216
|
{
|
|
208
217
|
validate_autoGeneratedCode(internalFieldErrors, appSuppliedFieldErrors);
|
|
209
218
|
|
|
219
|
+
if (type == UNKNOWN) {
|
|
220
|
+
internalFieldErrors.push_back(P_STATIC_STRING("type may not be unknown"));
|
|
221
|
+
}
|
|
210
222
|
if (sockets.empty()) {
|
|
211
223
|
appSuppliedFieldErrors.push_back(P_STATIC_STRING("sockets are not supplied"));
|
|
212
224
|
}
|