passenger 5.0.30 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +30 -1
  3. data/CONTRIBUTING.md +1 -1
  4. data/CONTRIBUTORS +2 -0
  5. data/bin/passenger-install-nginx-module +18 -13
  6. data/build/agent.rb +1 -0
  7. data/build/basics.rb +1 -0
  8. data/build/cxx_tests.rb +6 -1
  9. data/build/misc.rb +3 -0
  10. data/build/packaging.rb +5 -17
  11. data/build/support/cxx_dependency_map.rb +100 -0
  12. data/build/support/vendor/cxxcodebuilder/lib/cxxcodebuilder/builder.rb +4 -1
  13. data/build/test_basics.rb +12 -2
  14. data/dev/ci/run_travis.sh +6 -2
  15. data/doc/Users guide Apache.html +7 -2
  16. data/doc/Users guide Apache.txt +4 -0
  17. data/resources/templates/error_layout.css +70 -84
  18. data/resources/templates/error_layout.html.template +84 -93
  19. data/resources/templates/standalone/http.erb +17 -13
  20. data/resources/templates/standalone/server.erb +2 -1
  21. data/resources/templates/undisclosed_error.html.template +52 -51
  22. data/resources/update_check_client_cert.p12 +0 -0
  23. data/resources/update_check_client_cert.pem +89 -0
  24. data/resources/update_check_server_pubkey.pem +14 -0
  25. data/src/agent/Core/ApplicationPool/ErrorRenderer.h +15 -1
  26. data/src/agent/Core/Controller.h +3 -2
  27. data/src/agent/Core/Controller/CheckoutSession.cpp +5 -4
  28. data/src/agent/Core/Controller/ForwardResponse.cpp +1 -1
  29. data/src/agent/Core/Controller/InitRequest.cpp +2 -0
  30. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -0
  31. data/src/agent/Core/Controller/Request.h +1 -0
  32. data/src/agent/Core/CoreMain.cpp +99 -2
  33. data/src/agent/Core/OptionParser.h +18 -1
  34. data/src/agent/Core/SecurityUpdateChecker.h +559 -0
  35. data/src/agent/Shared/Base.cpp +6 -1
  36. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +52 -0
  37. data/src/agent/Watchdog/InstanceDirToucher.cpp +1 -2
  38. data/src/agent/Watchdog/WatchdogMain.cpp +31 -40
  39. data/src/apache2_module/Configuration.cpp +12 -0
  40. data/src/apache2_module/Configuration.hpp +5 -0
  41. data/src/apache2_module/ConfigurationCommands.cpp +19 -19
  42. data/src/apache2_module/ConfigurationCommands.cpp.cxxcodebuilder +2 -2
  43. data/src/apache2_module/ConfigurationFields.hpp +19 -19
  44. data/src/apache2_module/ConfigurationFields.hpp.cxxcodebuilder +2 -2
  45. data/src/apache2_module/ConfigurationSetters.cpp +19 -19
  46. data/src/apache2_module/ConfigurationSetters.cpp.cxxcodebuilder +2 -2
  47. data/src/apache2_module/CreateDirConfig.cpp +19 -19
  48. data/src/apache2_module/CreateDirConfig.cpp.cxxcodebuilder +2 -2
  49. data/src/apache2_module/Hooks.cpp +10 -1
  50. data/src/apache2_module/MergeDirConfig.cpp +19 -19
  51. data/src/apache2_module/MergeDirConfig.cpp.cxxcodebuilder +2 -2
  52. data/src/apache2_module/SetHeaders.cpp +19 -19
  53. data/src/apache2_module/SetHeaders.cpp.cxxcodebuilder +2 -2
  54. data/src/cxx_supportlib/Constants.h +22 -22
  55. data/src/cxx_supportlib/Constants.h.cxxcodebuilder +4 -1
  56. data/src/cxx_supportlib/Crypto.cpp +977 -0
  57. data/src/cxx_supportlib/Crypto.h +147 -0
  58. data/src/cxx_supportlib/InstanceDirectory.h +55 -2
  59. data/src/cxx_supportlib/Utils/Curl.h +24 -10
  60. data/src/cxx_supportlib/Utils/JsonUtils.h +1 -1
  61. data/src/cxx_supportlib/oxt/detail/spin_lock_darwin.hpp +2 -0
  62. data/src/cxx_supportlib/vendor-modified/boost/system/error_code.hpp +3 -3
  63. data/src/cxx_supportlib/vendor-modified/jsoncpp/json-forwards.h +167 -92
  64. data/src/cxx_supportlib/vendor-modified/jsoncpp/json.h +1827 -1542
  65. data/src/cxx_supportlib/vendor-modified/jsoncpp/jsoncpp.cpp +4705 -3652
  66. data/src/cxx_supportlib/vendor-modified/libev/Changes +46 -15
  67. data/src/cxx_supportlib/vendor-modified/libev/LICENSE +1 -1
  68. data/src/cxx_supportlib/vendor-modified/libev/Makefile.in +215 -128
  69. data/src/cxx_supportlib/vendor-modified/libev/aclocal.m4 +466 -275
  70. data/src/cxx_supportlib/vendor-modified/libev/config.guess +312 -418
  71. data/src/cxx_supportlib/vendor-modified/libev/config.sub +246 -105
  72. data/src/cxx_supportlib/vendor-modified/libev/configure +276 -72
  73. data/src/cxx_supportlib/vendor-modified/libev/configure.ac +2 -1
  74. data/src/cxx_supportlib/vendor-modified/libev/depcomp +346 -185
  75. data/src/cxx_supportlib/vendor-modified/libev/ev++.h +1 -1
  76. data/src/cxx_supportlib/vendor-modified/libev/ev.c +530 -190
  77. data/src/cxx_supportlib/vendor-modified/libev/ev.h +23 -14
  78. data/src/cxx_supportlib/vendor-modified/libev/ev_epoll.c +12 -6
  79. data/src/cxx_supportlib/vendor-modified/libev/ev_kqueue.c +9 -5
  80. data/src/cxx_supportlib/vendor-modified/libev/ev_poll.c +6 -3
  81. data/src/cxx_supportlib/vendor-modified/libev/ev_port.c +8 -4
  82. data/src/cxx_supportlib/vendor-modified/libev/ev_select.c +4 -2
  83. data/src/cxx_supportlib/vendor-modified/libev/ev_vars.h +3 -2
  84. data/src/cxx_supportlib/vendor-modified/libev/ev_win32.c +3 -4
  85. data/src/cxx_supportlib/vendor-modified/libev/install-sh +433 -219
  86. data/src/cxx_supportlib/vendor-modified/libev/libev.m4 +6 -6
  87. data/src/cxx_supportlib/vendor-modified/libev/ltmain.sh +2 -2
  88. data/src/cxx_supportlib/vendor-modified/libev/missing +167 -288
  89. data/src/cxx_supportlib/vendor-modified/libev/mkinstalldirs +72 -21
  90. data/src/cxx_supportlib/vendor-modified/modp_b64.cpp +4 -106
  91. data/src/cxx_supportlib/vendor-modified/modp_b64_data.h +37 -1
  92. data/src/cxx_supportlib/vendor-modified/modp_b64_strict_aliasing.cpp +119 -0
  93. data/src/helper-scripts/node-loader.js +72 -1
  94. data/src/nginx_module/CacheLocationConfig.c +52 -19
  95. data/src/nginx_module/CacheLocationConfig.c.cxxcodebuilder +2 -2
  96. data/src/nginx_module/Configuration.c +26 -1
  97. data/src/nginx_module/Configuration.h +2 -0
  98. data/src/nginx_module/ConfigurationCommands.c +35 -19
  99. data/src/nginx_module/ConfigurationCommands.c.cxxcodebuilder +2 -2
  100. data/src/nginx_module/ContentHandler.c +1 -1
  101. data/src/nginx_module/CreateLocationConfig.c +22 -19
  102. data/src/nginx_module/CreateLocationConfig.c.cxxcodebuilder +2 -2
  103. data/src/nginx_module/LocationConfig.h +21 -19
  104. data/src/nginx_module/LocationConfig.h.cxxcodebuilder +2 -2
  105. data/src/nginx_module/MergeLocationConfig.c +25 -19
  106. data/src/nginx_module/MergeLocationConfig.c.cxxcodebuilder +2 -2
  107. data/src/nginx_module/ngx_http_passenger_module.c +8 -4
  108. data/src/ruby_supportlib/phusion_passenger.rb +9 -4
  109. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance.rb +2 -2
  110. data/src/ruby_supportlib/phusion_passenger/admin_tools/instance_registry.rb +1 -1
  111. data/src/ruby_supportlib/phusion_passenger/common_library.rb +13 -0
  112. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +5 -2
  113. data/src/ruby_supportlib/phusion_passenger/constants.rb +1 -1
  114. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +15 -3
  115. data/src/ruby_supportlib/phusion_passenger/platform_info/crypto.rb +51 -0
  116. data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +7 -0
  117. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +17 -0
  118. data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +4 -2
  119. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +4 -0
  120. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +5 -0
  121. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/app.rb +19 -10
  122. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/base.rb +25 -0
  123. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/gdb_controller.rb +38 -103
  124. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/lldb_controller.rb +178 -0
  125. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/utils.rb +94 -0
  126. data/src/ruby_supportlib/phusion_passenger/vendor/crash_watch/version.rb +2 -2
  127. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core.rb +2 -2
  128. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core/version_data.rb +2 -2
  129. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis +5 -3
  130. data/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/ruby_versions.yml.travis-with-sudo +9 -7
  131. metadata +14 -4
@@ -48,7 +48,7 @@
48
48
  #include <signal.h>
49
49
  #include <libgen.h>
50
50
 
51
- #if defined(__APPLE__) || defined(__linux__)
51
+ #if defined(__APPLE__) || defined(__GNU_LIBRARY__)
52
52
  #define LIBC_HAS_BACKTRACE_FUNC
53
53
  #endif
54
54
  #ifdef LIBC_HAS_BACKTRACE_FUNC
@@ -1647,6 +1647,11 @@ shutdownAgent(VariantMap *agentOptions) {
1647
1647
  oxt::shutdown();
1648
1648
  }
1649
1649
 
1650
+ /**
1651
+ * Linux-only way to change OOM killer configuration for
1652
+ * current process. Requires root privileges, which we
1653
+ * should have.
1654
+ */
1650
1655
  void
1651
1656
  restoreOomScore(VariantMap *agentOptions) {
1652
1657
  TRACE_POINT();
@@ -31,6 +31,7 @@
31
31
  #include <sys/stat.h>
32
32
  #include <sys/types.h>
33
33
  #include <sys/wait.h>
34
+ #include <pwd.h>
34
35
  #include <stdio.h>
35
36
  #include <stdlib.h>
36
37
  #include <unistd.h>
@@ -57,6 +58,7 @@ static int shouldDaemonize = 0;
57
58
  static bool verbose = false;
58
59
  static const char *pidFile = NULL;
59
60
  static const char *logFile = NULL;
61
+ static uid_t uid = 0;
60
62
  static int sleepInterval = 1800;
61
63
  static int terminationPipe[2];
62
64
  static sig_atomic_t shouldIgnoreNextTermSignal = 0;
@@ -114,6 +116,18 @@ parseArguments(int argc, char *argv[], int offset) {
114
116
  i++;
115
117
  } else if (strcmp(argv[i], "--verbose") == 0) {
116
118
  verbose = true;
119
+ } else if (strcmp(argv[i], "--user") == 0) {
120
+ const char *user = argv[i + 1];
121
+ struct passwd *pwUser = getpwnam(user);
122
+ if (pwUser == NULL) {
123
+ int e = errno;
124
+ fprintf(stderr, ERROR_PREFIX
125
+ "Cannot lookup user information for user %s, %s (errno %d)\n",
126
+ user, strerror(e), e);
127
+ }else{
128
+ uid = pwUser->pw_uid;
129
+ }
130
+ i++;
117
131
  } else {
118
132
  fprintf(stderr, ERROR_PREFIX ": unrecognized argument %s\n",
119
133
  argv[i]);
@@ -150,12 +164,38 @@ setNonBlocking(int fd) {
150
164
  }
151
165
  }
152
166
 
167
+ static void down_privilege() {
168
+ if (getuid() == 0 && uid != 0) {
169
+ if (setreuid(uid,0) != 0) {
170
+ int e = errno;
171
+ fprintf(stderr, ERROR_PREFIX
172
+ ": cannot set effective user to %d for sleeping: %s (errno %d)\n",
173
+ uid, strerror(e), e);
174
+ exit(1);
175
+ }
176
+ }
177
+ }
178
+
179
+ static void up_privilege() {
180
+ if (getuid() != 0 && uid != 0) {
181
+ if (setuid(0) != 0) {
182
+ int e = errno;
183
+ fprintf(stderr, ERROR_PREFIX
184
+ ": cannot set effective user to %d for touching files: %s (errno %d)\n",
185
+ uid, strerror(e), e);
186
+ exit(1);
187
+ }
188
+ }
189
+ }
190
+
153
191
  static void
154
192
  initialize(int argc, char *argv[], int offset) {
155
193
  int e, fd;
156
194
 
157
195
  parseArguments(argc, argv, offset);
158
196
 
197
+ down_privilege();// drop priv. until needed.
198
+
159
199
  if (logFile != NULL) {
160
200
  fd = open(logFile, O_WRONLY | O_APPEND | O_CREAT, 0644);
161
201
  if (fd == -1) {
@@ -266,22 +306,31 @@ maybeWritePidfile() {
266
306
  FILE *f;
267
307
 
268
308
  if (pidFile != NULL) {
309
+ up_privilege(); // need permission to write to pid file, and set permissions
269
310
  f = fopen(pidFile, "w");
270
311
  if (f != NULL) {
271
312
  fprintf(f, "%d\n", (int) getpid());
313
+ if (fchmod(fileno(f), S_IRWXU|S_IRWXG|S_IROTH) == -1){
314
+ int e = errno;
315
+ fprintf(stderr, ERROR_PREFIX
316
+ ": cannot change permissions on pid file %s, process may remain after passenger shutdown: %s (errno %d)\n", pidFile, strerror(e), e);
317
+ }
272
318
  fclose(f);
273
319
  } else {
274
320
  fprintf(stderr, ERROR_PREFIX ": cannot open PID file %s for writing\n",
275
321
  pidFile);
276
322
  exit(1);
277
323
  }
324
+ down_privilege(); // drop priv now that unneeded
278
325
  }
279
326
  }
280
327
 
281
328
  static int
282
329
  dirExists(const char *dir) {
330
+ up_privilege(); // raise priv. to stat file
283
331
  struct stat buf;
284
332
  return stat(dir, &buf) == 0 && S_ISDIR(buf.st_mode);
333
+ down_privilege(); // drop priv now that unneeded
285
334
  }
286
335
 
287
336
  static void
@@ -289,6 +338,7 @@ touchDir(const char *dir) {
289
338
  pid_t pid;
290
339
  int e, status;
291
340
 
341
+ up_privilege(); // raise priv. to touch files
292
342
  pid = fork();
293
343
  if (pid == 0) {
294
344
  close(terminationPipe[0]);
@@ -327,6 +377,7 @@ touchDir(const char *dir) {
327
377
  exit(1);
328
378
  }
329
379
  }
380
+ down_privilege(); // drop priv now that unneeded
330
381
  }
331
382
 
332
383
  static int
@@ -365,6 +416,7 @@ performCleanup(const char *dir) {
365
416
  pid_t pid;
366
417
  int e, status;
367
418
 
419
+ up_privilege(); // raise priv. so we can delete files
368
420
  pid = fork();
369
421
  if (pid == 0) {
370
422
  close(terminationPipe[0]);
@@ -78,8 +78,7 @@ private:
78
78
  fflush(stderr);
79
79
  _exit(1);
80
80
  }
81
-
82
- setOomScore(oldOomScore);
81
+ restoreOomScore(agentsOptions);
83
82
 
84
83
  execlp("/bin/sh", "/bin/sh", "-c", "find . | xargs touch", (char *) 0);
85
84
  e = errno;
@@ -42,6 +42,9 @@
42
42
  #define HAVE_FLOCK
43
43
  #endif
44
44
 
45
+ #ifdef __linux__
46
+ #include <sys/prctl.h>
47
+ #endif
45
48
  #include <sys/select.h>
46
49
  #include <sys/types.h>
47
50
  #include <sys/time.h>
@@ -148,9 +151,7 @@ using namespace Passenger::WatchdogAgent;
148
151
 
149
152
  static VariantMap *agentsOptions;
150
153
  static WorkingObjects *workingObjects;
151
- static string oldOomScore;
152
154
 
153
- static void setOomScore(const StaticString &score);
154
155
  static void cleanup(const WorkingObjectsPtr &wo);
155
156
 
156
157
  #include "AgentWatcher.cpp"
@@ -188,40 +189,6 @@ openOomAdjFileForcedType(const char *mode, OomFileType &type) {
188
189
  }
189
190
  }
190
191
 
191
- /**
192
- * Linux-only way to change OOM killer configuration for
193
- * current process. Requires root privileges, which we
194
- * should have.
195
- */
196
- static void
197
- setOomScore(const StaticString &score) {
198
- if (score.empty()) {
199
- return;
200
- }
201
-
202
- FILE *f;
203
- OomFileType type;
204
- string filteredScore;
205
-
206
- if (score.at(0) == 'l') {
207
- filteredScore = score.substr(1);
208
- type = OOM_ADJ;
209
- } else {
210
- filteredScore = score;
211
- type = OOM_SCORE_ADJ;
212
- }
213
- f = openOomAdjFileForcedType("w", type);
214
- if (f != NULL) {
215
- size_t ret = fwrite(filteredScore.data(), 1, filteredScore.size(), f);
216
- // We can't do anything about failures, so ignore compiler
217
- // warnings about not doing anything with the result.
218
- (void) ret;
219
- fclose(f);
220
- } else {
221
- P_WARN("setOomScore(" << filteredScore << ", " << type << ") failed due to error: " << strerror(errno));
222
- }
223
- }
224
-
225
192
  /**
226
193
  * Set the current process's OOM score to "never kill".
227
194
  */
@@ -358,12 +325,18 @@ waitForStarterProcessOrWatchers(const WorkingObjectsPtr &wo, vector<AgentWatcher
358
325
  }
359
326
  }
360
327
 
328
+ string
329
+ relative(string filename){
330
+ string dir = filename.substr(filename.find_last_of('/')+1);
331
+ return dir;
332
+ }
333
+
361
334
  static vector<pid_t>
362
335
  readCleanupPids(const WorkingObjectsPtr &wo) {
363
336
  vector<pid_t> result;
364
337
 
365
338
  foreach (string filename, wo->cleanupPidfiles) {
366
- FILE *f = fopen(filename.c_str(), "r");
339
+ FILE *f = fopen(relative(filename).c_str(), "r");
367
340
  if (f != NULL) {
368
341
  char buf[33];
369
342
  size_t ret;
@@ -388,7 +361,10 @@ static void
388
361
  killCleanupPids(const vector<pid_t> &cleanupPids) {
389
362
  foreach (pid_t pid, cleanupPids) {
390
363
  P_DEBUG("Sending SIGTERM to cleanup PID " << pid);
391
- kill(pid, SIGTERM);
364
+ if(kill(pid, SIGTERM) == -1){
365
+ int e = errno;
366
+ P_WARN("Failed to send SIGTERM to " << pid << ", error: " << e << " " << strerror(e));
367
+ }
392
368
  }
393
369
  }
394
370
 
@@ -800,7 +776,7 @@ initializeBareEssentials(int argc, char *argv[], WorkingObjectsPtr &wo) {
800
776
  * for this watchdog. Note that the OOM score is inherited by child processes
801
777
  * so we need to restore it after each fork().
802
778
  */
803
- oldOomScore = setOomScoreNeverKill();
779
+ string oldOomScore = setOomScoreNeverKill();
804
780
 
805
781
  agentsOptions = new VariantMap();
806
782
  *agentsOptions = initializeAgent(argc, &argv, SHORT_PROGRAM_NAME " watchdog",
@@ -925,6 +901,18 @@ openReportFile(const WorkingObjectsPtr &wo) {
925
901
  }
926
902
  }
927
903
 
904
+ static void
905
+ chdirToTmpDir() {
906
+ vector<string> pidfiles = agentsOptions->getStrSet("cleanup_pidfiles", false);
907
+ if (pidfiles.size() > 0) {
908
+ string str = pidfiles.front();
909
+ string dir = str.substr(0,str.find_last_of('/'));
910
+ if (dir != "" && chdir(dir.c_str()) == -1) {
911
+ throw RuntimeException("Cannot change working directory to " + dir);
912
+ }
913
+ }
914
+ }
915
+
928
916
  static void
929
917
  lowerPrivilege() {
930
918
  TRACE_POINT();
@@ -960,7 +948,9 @@ lowerPrivilege() {
960
948
  "to that of user '" + userName + "' and group '" + groupName +
961
949
  "': cannot set user ID to " + toString(pwUser->pw_uid), e);
962
950
  }
963
-
951
+ #ifdef __linux__
952
+ prctl(PR_SET_DUMPABLE, 1);
953
+ #endif
964
954
  setenv("USER", pwUser->pw_name, 1);
965
955
  setenv("HOME", pwUser->pw_dir, 1);
966
956
  setenv("UID", toString(gid).c_str(), 1);
@@ -1300,6 +1290,7 @@ watchdogMain(int argc, char *argv[]) {
1300
1290
  maybeDaemonize();
1301
1291
  createPidFile();
1302
1292
  openReportFile(wo);
1293
+ chdirToTmpDir();
1303
1294
  lowerPrivilege();
1304
1295
  initializeWorkingObjects(wo, instanceDirToucher, uidBeforeLoweringPrivilege);
1305
1296
  initializeAgentWatchers(wo, watchers);
@@ -303,6 +303,8 @@ DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_default_user, defaultUser)
303
303
  DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_default_group, defaultGroup)
304
304
  DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_data_buffer_dir, dataBufferDir)
305
305
  DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_instance_registry_dir, instanceRegistryDir)
306
+ DEFINE_SERVER_BOOLEAN_CONFIG_SETTER(cmd_passenger_disable_security_update_check, disableSecurityUpdateCheck)
307
+ DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_security_update_check_proxy, securityUpdateCheckProxy)
306
308
  DEFINE_SERVER_STR_CONFIG_SETTER(cmd_union_station_gateway_address, unionStationGatewayAddress)
307
309
  DEFINE_SERVER_INT_CONFIG_SETTER(cmd_union_station_gateway_port, unionStationGatewayPort, int, 1)
308
310
  DEFINE_SERVER_STR_CONFIG_SETTER(cmd_union_station_gateway_cert, unionStationGatewayCert)
@@ -509,6 +511,16 @@ const command_rec passenger_commands[] = {
509
511
  NULL,
510
512
  RSRC_CONF,
511
513
  "The directory to register the instance to."),
514
+ AP_INIT_FLAG("PassengerDisableSecurityUpdateCheck",
515
+ (FlagFunc) cmd_passenger_disable_security_update_check,
516
+ NULL,
517
+ RSRC_CONF,
518
+ "Whether to enable the security update check & notify."),
519
+ AP_INIT_TAKE1("PassengerSecurityUpdateCheckProxy",
520
+ (Take1Func) cmd_passenger_security_update_check_proxy,
521
+ NULL,
522
+ RSRC_CONF,
523
+ "Use specified http/SOCKS proxy for the security update check."),
512
524
  AP_INIT_TAKE1("PassengerMaxPreloaderIdleTime",
513
525
  (Take1Func) cmd_passenger_max_preloader_idle_time,
514
526
  NULL,
@@ -194,6 +194,9 @@ struct ServerConfig {
194
194
  string dataBufferDir;
195
195
  string instanceRegistryDir;
196
196
 
197
+ bool disableSecurityUpdateCheck;
198
+ string securityUpdateCheckProxy;
199
+
197
200
  bool unionStationSupport;
198
201
  string unionStationGatewayAddress;
199
202
  int unionStationGatewayPort;
@@ -220,6 +223,8 @@ struct ServerConfig {
220
223
  responseBufferHighWatermark = DEFAULT_RESPONSE_BUFFER_HIGH_WATERMARK;
221
224
  statThrottleRate = DEFAULT_STAT_THROTTLE_RATE;
222
225
  userSwitching = true;
226
+ disableSecurityUpdateCheck = false;
227
+ securityUpdateCheckProxy = string();
223
228
  defaultUser = DEFAULT_WEB_APP_USER;
224
229
  unionStationSupport = false;
225
230
  unionStationGatewayAddress = DEFAULT_UNION_STATION_GATEWAY_ADDRESS;
@@ -1,27 +1,27 @@
1
1
  /*
2
- * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2010-2016 Phusion Holding B.V.
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2016 Phusion Holding B.V.
4
4
  *
5
- * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
- * trademarks of Phusion Holding B.V.
5
+ * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ * trademarks of Phusion Holding B.V.
7
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:
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
14
  *
15
- * The above copyright notice and this permission notice shall be included in
16
- * all copies or substantial portions of the Software.
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
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.
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
25
  */
26
26
 
27
27
  /*
@@ -23,12 +23,12 @@
23
23
  # THE SOFTWARE.
24
24
 
25
25
  # This file uses the cxxcodebuilder API. Learn more at:
26
- # https://github.com/phusion/passenger/cxxcodebuilder
26
+ # https://github.com/phusion/cxxcodebuilder
27
27
 
28
28
  require 'phusion_passenger/apache2/config_options'
29
29
 
30
30
  def main
31
- comment copyright_header_for(__FILE__)
31
+ comment copyright_header_for(__FILE__), 1
32
32
 
33
33
  separator
34
34
 
@@ -1,27 +1,27 @@
1
1
  /*
2
- * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2010-2016 Phusion Holding B.V.
2
+ * Phusion Passenger - https://www.phusionpassenger.com/
3
+ * Copyright (c) 2010-2016 Phusion Holding B.V.
4
4
  *
5
- * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
- * trademarks of Phusion Holding B.V.
5
+ * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
+ * trademarks of Phusion Holding B.V.
7
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:
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
14
  *
15
- * The above copyright notice and this permission notice shall be included in
16
- * all copies or substantial portions of the Software.
15
+ * The above copyright notice and this permission notice shall be included in
16
+ * all copies or substantial portions of the Software.
17
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.
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
25
  */
26
26
 
27
27
  /*