passenger 5.3.4 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +69 -0
- data/CONTRIBUTORS +1 -0
- data/README.md +2 -1
- data/Rakefile +0 -5
- data/build/agent.rb +6 -3
- data/build/cxx_tests.rb +28 -19
- data/build/integration_tests.rb +6 -2
- data/build/misc.rb +2 -1
- data/build/packaging.rb +2 -0
- data/build/support/cplusplus.rb +2 -2
- data/build/support/cxx_dependency_map.rb +2651 -2189
- data/dev/colorize-logs +272 -0
- data/dev/show-latest-crashlog-dir +27 -0
- data/resources/templates/standalone/http.erb +2 -0
- data/resources/templates/standalone/server.erb +1 -0
- data/src/agent/AgentMain.cpp +4 -0
- data/src/agent/Core/AdminPanelConnector.h +6 -6
- data/src/agent/Core/ApiServer.h +4 -4
- data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +2 -2
- data/src/agent/Core/ApplicationPool/Context.h +5 -1
- data/src/agent/Core/ApplicationPool/Group/InternalUtils.cpp +2 -2
- data/src/agent/Core/ApplicationPool/Group/LifetimeAndBasics.cpp +5 -0
- data/src/agent/Core/ApplicationPool/Group/Miscellaneous.cpp +2 -1
- data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +3 -3
- data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
- data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +13 -20
- data/src/agent/Core/ApplicationPool/Group.h +4 -2
- data/src/agent/Core/ApplicationPool/Implementation.cpp +5 -5
- data/src/agent/Core/ApplicationPool/Options.h +42 -38
- data/src/agent/Core/ApplicationPool/Pool/GroupUtils.cpp +2 -1
- data/src/agent/Core/ApplicationPool/Pool.h +4 -4
- data/src/agent/Core/ApplicationPool/Process.h +13 -15
- data/src/agent/Core/ApplicationPool/Socket.h +5 -5
- data/src/agent/Core/ApplicationPool/TestSession.h +3 -3
- data/src/agent/Core/Config.h +50 -10
- data/src/agent/Core/ConfigChange.cpp +13 -1
- data/src/agent/Core/Controller/Config.h +41 -17
- data/src/agent/Core/Controller/ForwardResponse.cpp +4 -0
- data/src/agent/Core/Controller/InitRequest.cpp +14 -8
- data/src/agent/Core/Controller/InitializationAndShutdown.cpp +5 -0
- data/src/agent/Core/Controller/SendRequest.cpp +9 -9
- data/src/agent/Core/Controller/TurboCaching.h +2 -2
- data/src/agent/Core/Controller.h +7 -5
- data/src/agent/Core/CoreMain.cpp +204 -60
- data/src/agent/Core/OptionParser.h +20 -3
- data/src/agent/Core/ResponseCache.h +3 -3
- data/src/agent/Core/SecurityUpdateChecker.h +4 -2
- data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/Config.h +3 -2
- data/src/agent/Core/SpawningKit/Context.h +8 -2
- data/src/agent/Core/SpawningKit/DirectSpawner.h +4 -4
- 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 +21 -14
- 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 +14 -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/README.md +34 -17
- data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
- data/src/agent/Core/SpawningKit/Result.h +20 -8
- data/src/agent/Core/SpawningKit/SmartSpawner.h +7 -7
- data/src/agent/Core/SpawningKit/Spawner.h +25 -8
- data/src/agent/Core/SpawningKit/UserSwitchingRules.h +17 -7
- data/src/agent/Core/TelemetryCollector.h +681 -0
- data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
- data/src/agent/FileReadHelper/FileReadHelperMain.cpp +198 -0
- 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/AbortHandler.cpp +324 -98
- data/src/agent/Shared/Fundamentals/AbortHandler.h +31 -4
- data/src/agent/Shared/Fundamentals/Initialization.cpp +4 -5
- data/src/agent/Shared/Fundamentals/Initialization.h +9 -1
- data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
- data/src/agent/SystemMetrics/SystemMetricsMain.cpp +4 -3
- data/src/agent/TempDirToucher/TempDirToucherMain.cpp +3 -3
- data/src/agent/Watchdog/ApiServer.h +3 -3
- data/src/agent/Watchdog/Config.h +24 -5
- data/src/agent/Watchdog/CoreWatcher.cpp +2 -2
- data/src/agent/Watchdog/WatchdogMain.cpp +97 -28
- data/src/apache2_module/Config.cpp +14 -14
- data/src/apache2_module/Config.h +8 -16
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +510 -481
- data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +39 -17
- data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +5 -0
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +69 -1
- data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +31 -1
- data/src/apache2_module/ConfigGeneral/Common.h +45 -0
- data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +17 -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 +19 -1
- data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +10 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +14 -1
- data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +11 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +36 -1
- data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +34 -1
- data/src/apache2_module/DirectoryMapper.h +36 -37
- data/src/apache2_module/Hooks.cpp +27 -8
- data/src/apache2_module/ServerConfig/AutoGeneratedManifestGeneration.cpp +20 -0
- data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +48 -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/AppLocalConfigFileUtils.h +148 -0
- data/src/cxx_supportlib/AppTypeDetector/CBindings.cpp +147 -0
- data/src/cxx_supportlib/AppTypeDetector/CBindings.h +75 -0
- data/src/cxx_supportlib/{AppTypes.h → AppTypeDetector/Detector.h} +92 -131
- data/src/cxx_supportlib/ConfigKit/README.md +90 -2
- data/src/cxx_supportlib/ConfigKit/Schema.h +60 -15
- data/src/cxx_supportlib/ConfigKit/Store.h +129 -5
- 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 +4 -3
- 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/Ruby.cpp +3 -3
- data/src/cxx_supportlib/ProcessManagement/Ruby.h +7 -2
- data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +19 -12
- data/src/cxx_supportlib/ProcessManagement/Spawn.h +21 -2
- data/src/cxx_supportlib/ProcessManagement/Utils.h +10 -0
- data/src/cxx_supportlib/RandomGenerator.h +2 -2
- data/src/cxx_supportlib/ResourceLocator.h +1 -1
- 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/ClientRef.h +17 -7
- 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/HttpRequestRef.h +17 -7
- data/src/cxx_supportlib/ServerKit/HttpServer.h +16 -10
- data/src/cxx_supportlib/ServerKit/Server.h +3 -4
- 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 +12 -12
- 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 +88 -0
- data/src/cxx_supportlib/{Utils → SystemTools}/ProcessMetricsCollector.h +15 -12
- 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/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/Utils.cpp +2 -2
- data/src/cxx_supportlib/WatchdogLauncher.h +3 -3
- data/src/cxx_supportlib/WebSocketCommandReverseServer.h +1 -1
- data/src/cxx_supportlib/WrapperRegistry/CBindings.cpp +85 -0
- data/src/cxx_supportlib/{Utils/MemoryBarrier.h → WrapperRegistry/CBindings.h} +30 -27
- data/src/cxx_supportlib/WrapperRegistry/Entry.h +112 -0
- data/src/cxx_supportlib/WrapperRegistry/README.md +37 -0
- data/src/cxx_supportlib/WrapperRegistry/Registry.h +309 -0
- data/src/cxx_supportlib/vendor-modified/psg_sysqueue.h +3 -0
- data/src/helper-scripts/download_binaries/extconf.rb +6 -2
- data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +32 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +12 -0
- data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +36 -0
- data/src/nginx_module/Configuration.c +23 -3
- data/src/nginx_module/ContentHandler.c +331 -32
- data/src/nginx_module/ContentHandler.h +8 -3
- data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +10 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +27 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +3 -0
- data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +7 -0
- data/src/nginx_module/MainConfig/AutoGeneratedCreateFunction.c +11 -0
- data/src/nginx_module/MainConfig/AutoGeneratedManifestGeneration.c +23 -0
- data/src/nginx_module/MainConfig/AutoGeneratedStruct.h +8 -0
- data/src/nginx_module/config +2 -1
- data/src/nginx_module/ngx_http_passenger_module.c +9 -3
- data/src/nginx_module/ngx_http_passenger_module.h +10 -3
- data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +19 -0
- data/src/ruby_supportlib/phusion_passenger/common_library.rb +19 -16
- data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +4 -4
- data/src/ruby_supportlib/phusion_passenger/config/download_agent_command.rb +6 -2
- data/src/ruby_supportlib/phusion_passenger/config/download_nginx_engine_command.rb +6 -2
- 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/native_support.rb +7 -3
- data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +29 -0
- 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/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +1 -0
- data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +22 -2
- data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +4 -1
- data/src/ruby_supportlib/phusion_passenger.rb +7 -5
- data/src/schema_printer/SchemaPrinterMain.cpp +2 -0
- metadata +40 -89
- 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/run +0 -5
- data/dev/ci/tests/nginx/setup +0 -4
- data/dev/ci/tests/nginx-dynamic/run +0 -20
- data/dev/ci/tests/nginx-dynamic/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 -1748
- 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
- data/src/cxx_supportlib/AppTypes.cpp +0 -109
- data/src/cxx_supportlib/vendor-modified/SmallVector.h +0 -653
@@ -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.
|
@@ -26,6 +26,8 @@
|
|
26
26
|
#ifndef _PASSENGER_AGENT_FUNDAMENTALS_ABORT_HANDLER_H_
|
27
27
|
#define _PASSENGER_AGENT_FUNDAMENTALS_ABORT_HANDLER_H_
|
28
28
|
|
29
|
+
#include <cstddef>
|
30
|
+
|
29
31
|
namespace Passenger {
|
30
32
|
class ResourceLocator;
|
31
33
|
}
|
@@ -36,7 +38,23 @@ namespace Fundamentals {
|
|
36
38
|
|
37
39
|
|
38
40
|
struct AbortHandlerConfig {
|
39
|
-
|
41
|
+
static const unsigned int MAX_DIAGNOSTICS_DUMPERS = 5;
|
42
|
+
typedef void (*DiagnosticsDumperFunc)(void *userData);
|
43
|
+
|
44
|
+
struct DiagnosticsDumper {
|
45
|
+
const char *name;
|
46
|
+
const char *logFileName;
|
47
|
+
DiagnosticsDumperFunc func;
|
48
|
+
void *userData;
|
49
|
+
|
50
|
+
DiagnosticsDumper()
|
51
|
+
: name(0),
|
52
|
+
logFileName(0),
|
53
|
+
func(0),
|
54
|
+
userData(0)
|
55
|
+
{ }
|
56
|
+
};
|
57
|
+
|
40
58
|
|
41
59
|
char *ruby;
|
42
60
|
char **origArgv;
|
@@ -45,8 +63,17 @@ struct AbortHandlerConfig {
|
|
45
63
|
bool beep;
|
46
64
|
bool stopProcess;
|
47
65
|
ResourceLocator *resourceLocator;
|
48
|
-
DiagnosticsDumper
|
49
|
-
|
66
|
+
DiagnosticsDumper diagnosticsDumpers[MAX_DIAGNOSTICS_DUMPERS];
|
67
|
+
|
68
|
+
AbortHandlerConfig()
|
69
|
+
: ruby(NULL),
|
70
|
+
origArgv(NULL),
|
71
|
+
randomSeed(0),
|
72
|
+
dumpWithCrashWatch(false),
|
73
|
+
beep(false),
|
74
|
+
stopProcess(false),
|
75
|
+
resourceLocator(NULL)
|
76
|
+
{ }
|
50
77
|
};
|
51
78
|
|
52
79
|
void installAbortHandler(const AbortHandlerConfig *config);
|
@@ -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.
|
@@ -50,9 +50,9 @@
|
|
50
50
|
#include <ResourceLocator.h>
|
51
51
|
#include <LoggingKit/LoggingKit.h>
|
52
52
|
#include <LoggingKit/Context.h>
|
53
|
-
#include <
|
54
|
-
#include <
|
55
|
-
#include <
|
53
|
+
#include <StrIntTools/StrIntUtils.h>
|
54
|
+
#include <IOTools/MessageIO.h>
|
55
|
+
#include <SystemTools/SystemTime.h>
|
56
56
|
|
57
57
|
|
58
58
|
namespace Passenger {
|
@@ -559,7 +559,6 @@ initializeAgent(int argc, char **argv[], const char *processName,
|
|
559
559
|
const char *seedStr;
|
560
560
|
|
561
561
|
context = new Context();
|
562
|
-
memset(context, 0, sizeof(Context));
|
563
562
|
|
564
563
|
seedStr = getEnvString("PASSENGER_RANDOM_SEED");
|
565
564
|
if (seedStr == NULL) {
|
@@ -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.
|
@@ -47,6 +47,14 @@ struct Context {
|
|
47
47
|
char **origArgv;
|
48
48
|
bool feedbackFdAvailable;
|
49
49
|
AbortHandlerConfig abortHandlerConfig;
|
50
|
+
|
51
|
+
Context()
|
52
|
+
: resourceLocator(NULL),
|
53
|
+
randomSeed(0),
|
54
|
+
origArgc(0),
|
55
|
+
origArgv(NULL),
|
56
|
+
feedbackFdAvailable(false)
|
57
|
+
{ }
|
50
58
|
};
|
51
59
|
|
52
60
|
typedef void (*OptionParserFunc)(int argc, const char **argv, ConfigKit::Store &config);
|
@@ -64,7 +64,7 @@
|
|
64
64
|
#include <FileTools/PathManip.h>
|
65
65
|
#include <SystemTools/UserDatabase.h>
|
66
66
|
#include <Utils.h>
|
67
|
-
#include <
|
67
|
+
#include <StrIntTools/StrIntUtils.h>
|
68
68
|
#include <Core/SpawningKit/Handshake/WorkDir.h>
|
69
69
|
#include <Core/SpawningKit/Exceptions.h>
|
70
70
|
|
@@ -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.
|
@@ -28,9 +28,10 @@
|
|
28
28
|
#include <unistd.h>
|
29
29
|
#include <cstdio>
|
30
30
|
#include <cstring>
|
31
|
+
|
32
|
+
#include <SystemTools/SystemMetricsCollector.h>
|
31
33
|
#include <Utils.h>
|
32
|
-
#include <
|
33
|
-
#include <Utils/SystemMetricsCollector.h>
|
34
|
+
#include <StrIntTools/StrIntUtils.h>
|
34
35
|
|
35
36
|
using namespace std;
|
36
37
|
using namespace Passenger;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2013-
|
3
|
+
* Copyright (c) 2013-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.
|
@@ -361,7 +361,7 @@ touchDir(const char *dir) {
|
|
361
361
|
}
|
362
362
|
execlp("/bin/sh", "/bin/sh", "-c",
|
363
363
|
"find \"$1\" | xargs touch", "/bin/sh", ".",
|
364
|
-
(
|
364
|
+
(char *) 0);
|
365
365
|
e = errno;
|
366
366
|
fprintf(stderr, ERROR_PREFIX ": cannot execute /bin/sh: %s (errno %d)\n",
|
367
367
|
strerror(e), e);
|
@@ -432,7 +432,7 @@ performCleanup(const char *dir) {
|
|
432
432
|
close(terminationPipe[1]);
|
433
433
|
execlp("/bin/sh", "/bin/sh", "-c",
|
434
434
|
"rm -rf \"$1\"", "/bin/sh", dir,
|
435
|
-
(
|
435
|
+
(char *) 0);
|
436
436
|
e = errno;
|
437
437
|
fprintf(stderr, ERROR_PREFIX ": cannot execute /bin/sh: %s (errno %d)\n",
|
438
438
|
strerror(e), e);
|
@@ -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.
|
@@ -40,8 +40,8 @@
|
|
40
40
|
#include <StaticString.h>
|
41
41
|
#include <LoggingKit/LoggingKit.h>
|
42
42
|
#include <Constants.h>
|
43
|
-
#include <
|
44
|
-
#include <
|
43
|
+
#include <StrIntTools/StrIntUtils.h>
|
44
|
+
#include <IOTools/MessageIO.h>
|
45
45
|
|
46
46
|
namespace Passenger {
|
47
47
|
namespace Watchdog {
|
data/src/agent/Watchdog/Config.h
CHANGED
@@ -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.
|
@@ -33,7 +33,7 @@
|
|
33
33
|
#include <Watchdog/ApiServer.h>
|
34
34
|
#include <Shared/ApiAccountUtils.h>
|
35
35
|
#include <Utils.h>
|
36
|
-
#include <
|
36
|
+
#include <StrIntTools/StrIntUtils.h>
|
37
37
|
|
38
38
|
namespace Passenger {
|
39
39
|
namespace Watchdog {
|
@@ -146,15 +146,27 @@ using namespace std;
|
|
146
146
|
* security_update_checker_interval unsigned integer - default(86400)
|
147
147
|
* security_update_checker_proxy_url string - -
|
148
148
|
* security_update_checker_url string - default("https://securitycheck.phusionpassenger.com/v1/check.json")
|
149
|
-
* server_software string - default("Phusion_Passenger/
|
149
|
+
* server_software string - default("Phusion_Passenger/6.0.1")
|
150
150
|
* setsid boolean - default(false)
|
151
151
|
* show_version_in_header boolean - default(true)
|
152
152
|
* single_app_mode_app_root string - default,read_only
|
153
|
+
* single_app_mode_app_start_command string - read_only
|
153
154
|
* single_app_mode_app_type string - read_only
|
154
155
|
* single_app_mode_startup_file string - read_only
|
155
156
|
* standalone_engine string - default
|
156
157
|
* startup_report_file string - -
|
157
158
|
* stat_throttle_rate unsigned integer - default(10)
|
159
|
+
* telemetry_collector_ca_certificate_path string - -
|
160
|
+
* telemetry_collector_debug_curl boolean - default(false)
|
161
|
+
* telemetry_collector_disabled boolean - default(false)
|
162
|
+
* telemetry_collector_final_run_timeout unsigned integer - default(5)
|
163
|
+
* telemetry_collector_first_interval unsigned integer - default(7200)
|
164
|
+
* telemetry_collector_interval unsigned integer - default(21600)
|
165
|
+
* telemetry_collector_interval_jitter unsigned integer - default(7200)
|
166
|
+
* telemetry_collector_proxy_url string - -
|
167
|
+
* telemetry_collector_timeout unsigned integer - default(180)
|
168
|
+
* telemetry_collector_url string - default("https://anontelemetry.phusionpassenger.com/v1/collect.json")
|
169
|
+
* telemetry_collector_verify_server boolean - default(true)
|
158
170
|
* turbocaching boolean - default(true),read_only
|
159
171
|
* user string - default,read_only
|
160
172
|
* user_switching boolean - default(true)
|
@@ -253,9 +265,13 @@ private:
|
|
253
265
|
}
|
254
266
|
|
255
267
|
public:
|
256
|
-
struct {
|
268
|
+
struct CoreSubschemaContainer {
|
257
269
|
Core::Schema schema;
|
258
270
|
ConfigKit::TableTranslator translator;
|
271
|
+
|
272
|
+
CoreSubschemaContainer(const WrapperRegistry::Registry *wrapperRegistry)
|
273
|
+
: schema(wrapperRegistry)
|
274
|
+
{ }
|
259
275
|
} core;
|
260
276
|
struct {
|
261
277
|
ApiServer::Schema schema;
|
@@ -266,7 +282,9 @@ public:
|
|
266
282
|
ConfigKit::PrefixTranslator translator;
|
267
283
|
} apiServerKit;
|
268
284
|
|
269
|
-
Schema()
|
285
|
+
Schema(const WrapperRegistry::Registry *wrapperRegistry = NULL)
|
286
|
+
: core(wrapperRegistry)
|
287
|
+
{
|
270
288
|
using namespace ConfigKit;
|
271
289
|
|
272
290
|
// Add subschema: core
|
@@ -279,6 +297,7 @@ public:
|
|
279
297
|
core.translator.finalize();
|
280
298
|
addSubSchema(core.schema, core.translator);
|
281
299
|
erase("instance_dir");
|
300
|
+
erase("oom_score");
|
282
301
|
erase("watchdog_fd_passing_password");
|
283
302
|
/***********/
|
284
303
|
/***********/
|
@@ -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.
|
@@ -25,7 +25,7 @@
|
|
25
25
|
*/
|
26
26
|
|
27
27
|
#include <Shared/Fundamentals/Utils.h>
|
28
|
-
#include <
|
28
|
+
#include <IOTools/MessageIO.h>
|
29
29
|
|
30
30
|
class CoreWatcher: public AgentWatcher {
|
31
31
|
protected:
|
@@ -73,18 +73,19 @@
|
|
73
73
|
#include <FileDescriptor.h>
|
74
74
|
#include <FileTools/PathSecurityCheck.h>
|
75
75
|
#include <SystemTools/UserDatabase.h>
|
76
|
+
#include <SystemTools/ContainerHelpers.h>
|
76
77
|
#include <RandomGenerator.h>
|
77
78
|
#include <BackgroundEventLoop.h>
|
78
79
|
#include <LoggingKit/LoggingKit.h>
|
79
80
|
#include <Exceptions.h>
|
80
81
|
#include <StaticString.h>
|
81
82
|
#include <Hooks.h>
|
83
|
+
#include <IOTools/IOUtils.h>
|
84
|
+
#include <IOTools/MessageIO.h>
|
82
85
|
#include <Utils.h>
|
83
86
|
#include <Utils/Timer.h>
|
84
87
|
#include <Utils/ScopeGuard.h>
|
85
|
-
#include <
|
86
|
-
#include <Utils/IOUtils.h>
|
87
|
-
#include <Utils/MessageIO.h>
|
88
|
+
#include <StrIntTools/StrIntUtils.h>
|
88
89
|
#include <Utils/OptionParsing.h>
|
89
90
|
#include <Utils/VariantMap.h>
|
90
91
|
|
@@ -165,6 +166,7 @@ namespace Watchdog {
|
|
165
166
|
|
166
167
|
using namespace Passenger::Watchdog;
|
167
168
|
|
169
|
+
static WrapperRegistry::Registry *watchdogWrapperRegistry;
|
168
170
|
static Schema *watchdogSchema;
|
169
171
|
static ConfigKit::Store *watchdogConfig;
|
170
172
|
static WorkingObjects *workingObjects;
|
@@ -179,8 +181,22 @@ static void cleanup(const WorkingObjectsPtr &wo);
|
|
179
181
|
/***** Functions *****/
|
180
182
|
|
181
183
|
#if !BOOST_OS_MACOS
|
184
|
+
|
185
|
+
struct WatchdogOomAdjustResult {
|
186
|
+
struct Message {
|
187
|
+
LoggingKit::Level level;
|
188
|
+
string text;
|
189
|
+
};
|
190
|
+
|
191
|
+
string oldScore;
|
192
|
+
// LoggingKit has not been initialized yet when setOomScoreNeverKill()
|
193
|
+
// is called, so we store the messages here and print them after
|
194
|
+
// LoggingKit initialization.
|
195
|
+
vector<Message> messages;
|
196
|
+
};
|
197
|
+
|
182
198
|
static FILE *
|
183
|
-
openOomAdjFileGetType(const char *mode, OomFileType &type) {
|
199
|
+
openOomAdjFileGetType(const char *mode, OomFileType &type, string &path) {
|
184
200
|
FILE *f = fopen("/proc/self/oom_score_adj", mode);
|
185
201
|
if (f == NULL) {
|
186
202
|
f = fopen("/proc/self/oom_adj", mode);
|
@@ -188,40 +204,46 @@ openOomAdjFileGetType(const char *mode, OomFileType &type) {
|
|
188
204
|
return NULL;
|
189
205
|
} else {
|
190
206
|
type = OOM_ADJ;
|
207
|
+
path = "/proc/self/oom_adj";
|
191
208
|
return f;
|
192
209
|
}
|
193
210
|
} else {
|
194
211
|
type = OOM_SCORE_ADJ;
|
212
|
+
path = "/proc/self/oom_score_adj";
|
195
213
|
return f;
|
196
214
|
}
|
197
215
|
}
|
198
216
|
|
199
|
-
static FILE *
|
200
|
-
openOomAdjFileForcedType(const char *mode, OomFileType &type) {
|
201
|
-
if (type == OOM_SCORE_ADJ) {
|
202
|
-
return fopen("/proc/self/oom_score_adj", mode);
|
203
|
-
} else {
|
204
|
-
assert(type == OOM_ADJ);
|
205
|
-
return fopen("/proc/self/oom_adj", mode);
|
206
|
-
}
|
207
|
-
}
|
208
|
-
|
209
217
|
/**
|
210
218
|
* Set the current process's OOM score to "never kill".
|
211
219
|
*/
|
212
|
-
static
|
220
|
+
static WatchdogOomAdjustResult
|
213
221
|
setOomScoreNeverKill() {
|
214
|
-
|
222
|
+
WatchdogOomAdjustResult result;
|
215
223
|
FILE *f;
|
224
|
+
string path;
|
216
225
|
OomFileType type;
|
226
|
+
int e;
|
227
|
+
|
228
|
+
if (geteuid() != 0) {
|
229
|
+
WatchdogOomAdjustResult::Message msg;
|
230
|
+
msg.level = LoggingKit::DEBUG;
|
231
|
+
msg.text = "Not adjusting Watchdog's OOM score because not running with root privileges";
|
232
|
+
result.messages.push_back(msg);
|
233
|
+
return result;
|
234
|
+
}
|
217
235
|
|
218
|
-
f = openOomAdjFileGetType("r", type);
|
236
|
+
f = openOomAdjFileGetType("r", type, path);
|
219
237
|
if (f == NULL) {
|
220
|
-
|
238
|
+
e = errno;
|
239
|
+
P_ERROR("Error adjusting Watchdog's OOM score: error opening both"
|
240
|
+
" /proc/self/oom_score_adj and /proc/self/oom_adj for reading: " <<
|
241
|
+
strerror(e) << " (errno=" << e << ")");
|
242
|
+
return result;
|
221
243
|
}
|
222
244
|
// mark if this is a legacy score so we won't try to write it as OOM_SCORE_ADJ
|
223
245
|
if (type == OOM_ADJ) {
|
224
|
-
oldScore.append("l");
|
246
|
+
result.oldScore.append("l");
|
225
247
|
}
|
226
248
|
char buf[1024];
|
227
249
|
size_t bytesRead;
|
@@ -230,17 +252,27 @@ setOomScoreNeverKill() {
|
|
230
252
|
if (bytesRead == 0 && feof(f)) {
|
231
253
|
break;
|
232
254
|
} else if (bytesRead == 0 && ferror(f)) {
|
255
|
+
P_ERROR("Error adjusting Watchdog's OOM score: error reading " << path);
|
233
256
|
fclose(f);
|
234
|
-
|
257
|
+
result.oldScore.clear();
|
258
|
+
return result;
|
235
259
|
} else {
|
236
|
-
oldScore.append(buf, bytesRead);
|
260
|
+
result.oldScore.append(buf, bytesRead);
|
237
261
|
}
|
238
262
|
}
|
239
263
|
fclose(f);
|
240
264
|
|
241
|
-
f =
|
265
|
+
f = fopen(path.c_str(), "w");
|
242
266
|
if (f == NULL) {
|
243
|
-
|
267
|
+
e = errno;
|
268
|
+
WatchdogOomAdjustResult::Message msg;
|
269
|
+
msg.level = LoggingKit::ERROR;
|
270
|
+
msg.text = "Error adjusting Watchdog's OOM score: error opening "
|
271
|
+
+ path + " for writing: " + strerror(e) + " (errno="
|
272
|
+
+ toString(e) + ")";
|
273
|
+
result.messages.push_back(msg);
|
274
|
+
result.oldScore.clear();
|
275
|
+
return result;
|
244
276
|
}
|
245
277
|
if (type == OOM_SCORE_ADJ) {
|
246
278
|
fprintf(f, "-1000\n");
|
@@ -248,10 +280,44 @@ setOomScoreNeverKill() {
|
|
248
280
|
assert(type == OOM_ADJ);
|
249
281
|
fprintf(f, "-17\n");
|
250
282
|
}
|
251
|
-
fclose(f);
|
252
283
|
|
253
|
-
|
284
|
+
e = fflush(f);
|
285
|
+
if (e != 0) {
|
286
|
+
e = errno;
|
287
|
+
WatchdogOomAdjustResult::Message msg;
|
288
|
+
if (autoDetectInContainer()) {
|
289
|
+
msg.level = LoggingKit::INFO;
|
290
|
+
msg.text = "Running in container, so couldn't adjust Watchdog's"
|
291
|
+
" OOM score through " + path;
|
292
|
+
} else {
|
293
|
+
msg.level = LoggingKit::ERROR;
|
294
|
+
msg.text = "Error adjusting Watchdog's OOM score: error writing to "
|
295
|
+
+ path + ": " + strerror(e) + " (errno=" + toString(e) + ")";
|
296
|
+
}
|
297
|
+
result.messages.push_back(msg);
|
298
|
+
}
|
299
|
+
e = fclose(f);
|
300
|
+
if (e == EOF) {
|
301
|
+
e = errno;
|
302
|
+
WatchdogOomAdjustResult::Message msg;
|
303
|
+
msg.level = LoggingKit::ERROR;
|
304
|
+
msg.text = "Error adjusting Watchdog's OOM score: error closing "
|
305
|
+
+ path + ": " + strerror(e) + " (errno=" + toString(e) + ")";
|
306
|
+
result.messages.push_back(msg);
|
307
|
+
}
|
308
|
+
|
309
|
+
return result;
|
310
|
+
}
|
311
|
+
|
312
|
+
static void
|
313
|
+
printOomAdjustResultMessages(const WatchdogOomAdjustResult &result) {
|
314
|
+
vector<WatchdogOomAdjustResult::Message>::const_iterator it;
|
315
|
+
|
316
|
+
for (it = result.messages.begin(); it != result.messages.end(); it++) {
|
317
|
+
P_LOG(LoggingKit::context, it->level, __FILE__, __LINE__, it->text);
|
318
|
+
}
|
254
319
|
}
|
320
|
+
|
255
321
|
#endif
|
256
322
|
|
257
323
|
static void
|
@@ -797,10 +863,12 @@ initializeBareEssentials(int argc, char *argv[], WorkingObjectsPtr &wo) {
|
|
797
863
|
* so we need to restore it after each fork().
|
798
864
|
*/
|
799
865
|
#if !BOOST_OS_MACOS
|
800
|
-
|
866
|
+
WatchdogOomAdjustResult oomAdjustResult = setOomScoreNeverKill();
|
801
867
|
#endif
|
802
868
|
|
803
|
-
|
869
|
+
watchdogWrapperRegistry = new WrapperRegistry::Registry();
|
870
|
+
watchdogWrapperRegistry->finalize();
|
871
|
+
watchdogSchema = new Schema(watchdogWrapperRegistry);
|
804
872
|
watchdogConfig = new ConfigKit::Store(*watchdogSchema);
|
805
873
|
initializeAgent(argc, &argv, SHORT_PROGRAM_NAME " watchdog",
|
806
874
|
*watchdogConfig, watchdogSchema->core.schema.loggingKit.translator,
|
@@ -812,7 +880,8 @@ initializeBareEssentials(int argc, char *argv[], WorkingObjectsPtr &wo) {
|
|
812
880
|
wo = boost::make_shared<WorkingObjects>();
|
813
881
|
workingObjects = wo.get();
|
814
882
|
#if !BOOST_OS_MACOS
|
815
|
-
|
883
|
+
printOomAdjustResultMessages(oomAdjustResult);
|
884
|
+
wo->extraConfigToPassToSubAgents["oom_score"] = oomAdjustResult.oldScore;
|
816
885
|
#endif
|
817
886
|
}
|
818
887
|
|
@@ -40,12 +40,6 @@
|
|
40
40
|
#include <ap_config.h>
|
41
41
|
#undef AP_HAVE_DESIGNATED_INITIALIZER
|
42
42
|
|
43
|
-
#include "Config.h"
|
44
|
-
#include "ConfigGeneral/SetterFuncs.h"
|
45
|
-
#include "ConfigGeneral/ManifestGeneration.h"
|
46
|
-
#include "DirConfig/AutoGeneratedCreateFunction.cpp"
|
47
|
-
#include "DirConfig/AutoGeneratedMergeFunction.cpp"
|
48
|
-
#include "Utils.h"
|
49
43
|
#include <JsonTools/Autocast.h>
|
50
44
|
#include <SystemTools/UserDatabase.h>
|
51
45
|
#include <Utils.h>
|
@@ -56,9 +50,17 @@
|
|
56
50
|
#include <apr_strings.h>
|
57
51
|
// In Apache < 2.4, this macro was necessary for core_dir_config and other structs
|
58
52
|
#define CORE_PRIVATE
|
59
|
-
#include <
|
53
|
+
#include <httpd.h>
|
60
54
|
#include <http_config.h>
|
61
55
|
#include <http_log.h>
|
56
|
+
#include <http_core.h>
|
57
|
+
|
58
|
+
#include "Config.h"
|
59
|
+
#include "ConfigGeneral/SetterFuncs.h"
|
60
|
+
#include "ConfigGeneral/ManifestGeneration.h"
|
61
|
+
#include "DirConfig/AutoGeneratedCreateFunction.cpp"
|
62
|
+
#include "DirConfig/AutoGeneratedMergeFunction.cpp"
|
63
|
+
#include "Utils.h"
|
62
64
|
|
63
65
|
|
64
66
|
extern "C" module AP_MODULE_DECLARE_DATA passenger_module;
|
@@ -72,6 +74,9 @@ extern "C" module AP_MODULE_DECLARE_DATA passenger_module;
|
|
72
74
|
#endif
|
73
75
|
|
74
76
|
|
77
|
+
#include "ConfigGeneral/AutoGeneratedSetterFuncs.cpp"
|
78
|
+
|
79
|
+
|
75
80
|
namespace Passenger {
|
76
81
|
namespace Apache2Module {
|
77
82
|
|
@@ -174,8 +179,6 @@ postprocessConfig(server_rec *s, apr_pool_t *pool, apr_pool_t *temp_pool) {
|
|
174
179
|
* Passenger settings
|
175
180
|
*************************************************/
|
176
181
|
|
177
|
-
#include "ConfigGeneral/AutoGeneratedSetterFuncs.cpp"
|
178
|
-
|
179
182
|
static const char *
|
180
183
|
cmd_passenger_enterprise_only(cmd_parms *cmd, void *pcfg, const char *arg) {
|
181
184
|
return "this feature is only available in Phusion Passenger Enterprise. "
|
@@ -246,11 +249,8 @@ cmd_passenger_base_uri(cmd_parms *cmd, void *pcfg, const char *arg) {
|
|
246
249
|
}
|
247
250
|
}
|
248
251
|
|
249
|
-
extern "C" const command_rec passenger_commands[] = {
|
250
|
-
#include "ConfigGeneral/AutoGeneratedDefinitions.cpp"
|
251
|
-
{ NULL }
|
252
|
-
};
|
253
|
-
|
254
252
|
|
255
253
|
} // namespace Apache2Module
|
256
254
|
} // namespace Passenger
|
255
|
+
|
256
|
+
#include "ConfigGeneral/AutoGeneratedDefinitions.cpp"
|
data/src/apache2_module/Config.h
CHANGED
@@ -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.
|
@@ -40,28 +40,22 @@
|
|
40
40
|
#include <apr_pools.h>
|
41
41
|
#include <apr_strings.h>
|
42
42
|
|
43
|
+
#include "ConfigGeneral/Common.h"
|
44
|
+
#include "DirConfig/AutoGeneratedStruct.h"
|
45
|
+
#include "ServerConfig/AutoGeneratedStruct.h"
|
46
|
+
|
43
47
|
namespace Passenger {
|
44
48
|
namespace Apache2Module {
|
45
49
|
|
46
50
|
using namespace std;
|
47
51
|
|
48
52
|
|
49
|
-
enum Threeway {
|
50
|
-
UNSET = -1,
|
51
|
-
DISABLED = 0,
|
52
|
-
ENABLED = 1
|
53
|
-
};
|
54
|
-
|
55
|
-
#define UNSET_INT_VALUE INT_MIN
|
56
|
-
|
57
53
|
/**
|
58
|
-
* Per-directory configuration information.
|
54
|
+
* Per-directory configuration information (manually-written part).
|
59
55
|
*
|
60
56
|
* Use the getter methods to query information, because those will return
|
61
57
|
* the default value if the value is not specified.
|
62
58
|
*/
|
63
|
-
#include "DirConfig/AutoGeneratedStruct.h"
|
64
|
-
|
65
59
|
struct DirConfig: public AutoGeneratedDirConfig {
|
66
60
|
|
67
61
|
/*************************************/
|
@@ -72,14 +66,12 @@ struct DirConfig: public AutoGeneratedDirConfig {
|
|
72
66
|
|
73
67
|
|
74
68
|
/**
|
75
|
-
* Server-wide (global, not per-virtual host) configuration information
|
69
|
+
* Server-wide (global, not per-virtual host) configuration information
|
70
|
+
* (manually written part).
|
76
71
|
*
|
77
72
|
* Use the getter methods to query information, because those will return
|
78
73
|
* the default value if the value is not specified.
|
79
74
|
*/
|
80
|
-
|
81
|
-
#include "ServerConfig/AutoGeneratedStruct.h"
|
82
|
-
|
83
75
|
struct ServerConfig: public AutoGeneratedServerConfig {
|
84
76
|
Json::Value manifest;
|
85
77
|
|