passenger 6.0.3 → 6.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +93 -1
  3. data/CONTRIBUTING.md +1 -1
  4. data/CONTRIBUTORS +3 -0
  5. data/bin/passenger-install-nginx-module +1 -1
  6. data/bin/passenger-memory-stats +65 -12
  7. data/passenger.gemspec +9 -1
  8. data/resources/templates/error_renderer/with_details/dist/bundle.js +1 -1
  9. data/resources/templates/error_renderer/with_details/src/GetHelpView.jsx +1 -1
  10. data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.css +0 -0
  11. data/resources/templates/error_renderer/with_details/src/bootstrap/bootstrap.js +0 -0
  12. data/resources/templates/error_renderer/with_details/src/bootstrap/config.json +0 -0
  13. data/resources/templates/standalone/rails_asset_pipeline.erb +1 -1
  14. data/resources/templates/standalone/server.erb +1 -0
  15. data/src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp +1 -1
  16. data/src/agent/Core/ApplicationPool/Group/StateInspection.cpp +2 -0
  17. data/src/agent/Core/ApplicationPool/Implementation.cpp +0 -1
  18. data/src/agent/Core/ApplicationPool/Options.h +19 -0
  19. data/src/agent/Core/ApplicationPool/Pool/GarbageCollection.cpp +1 -1
  20. data/src/agent/Core/ApplicationPool/Pool/StateInspection.cpp +1 -1
  21. data/src/agent/Core/Config.h +3 -1
  22. data/src/agent/Core/Controller.h +1 -0
  23. data/src/agent/Core/Controller/Config.h +9 -1
  24. data/src/agent/Core/Controller/ForwardResponse.cpp +13 -0
  25. data/src/agent/Core/Controller/InitRequest.cpp +5 -0
  26. data/src/agent/Core/Controller/InitializationAndShutdown.cpp +1 -0
  27. data/src/agent/Core/OptionParser.h +3 -0
  28. data/src/agent/Core/SpawningKit/Config.h +11 -0
  29. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +13 -0
  30. data/src/agent/Core/SpawningKit/Spawner.h +1 -0
  31. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +2 -0
  32. data/src/agent/Watchdog/Config.h +3 -1
  33. data/src/apache2_module/Config.cpp +1 -1
  34. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +10 -0
  35. data/src/apache2_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.cpp +10 -0
  36. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +25 -0
  37. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +10 -0
  38. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +6 -0
  39. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +26 -0
  40. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +14 -0
  41. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +34 -0
  42. data/src/apache2_module/Hooks.cpp +4 -0
  43. data/src/cxx_supportlib/Constants.h +4 -2
  44. data/src/cxx_supportlib/Hooks.h +1 -0
  45. data/src/cxx_supportlib/oxt/system_calls.cpp +10 -10
  46. data/src/cxx_supportlib/vendor-modified/modp_b64_data.h +0 -4
  47. data/src/cxx_supportlib/vendor-modified/modp_b64_strict_aliasing.cpp +5 -1
  48. data/src/helper-scripts/node-loader.js +1 -1
  49. data/src/helper-scripts/prespawn +1 -0
  50. data/src/nginx_module/ConfigGeneral/AutoGeneratedDefinitions.c +24 -0
  51. data/src/nginx_module/ConfigGeneral/AutoGeneratedManifestDefaultsInitialization.c +14 -0
  52. data/src/nginx_module/ConfigGeneral/AutoGeneratedSetterFuncs.c +24 -0
  53. data/src/nginx_module/Configuration.c +7 -3
  54. data/src/nginx_module/ContentHandler.c +0 -2
  55. data/src/nginx_module/LocationConfig/AutoGeneratedCreateFunction.c +16 -0
  56. data/src/nginx_module/LocationConfig/AutoGeneratedHeaderSerialization.c +30 -0
  57. data/src/nginx_module/LocationConfig/AutoGeneratedManifestGeneration.c +29 -0
  58. data/src/nginx_module/LocationConfig/AutoGeneratedMergeFunction.c +6 -0
  59. data/src/nginx_module/LocationConfig/AutoGeneratedStruct.h +11 -0
  60. data/src/nginx_module/ngx_http_passenger_module.c +2 -2
  61. data/src/nodejs_supportlib/vendor-copy/winston/lib/winston/logger.js +0 -0
  62. data/src/ruby_supportlib/phusion_passenger.rb +8 -8
  63. data/src/ruby_supportlib/phusion_passenger/admin_tools/memory_stats.rb +1 -1
  64. data/src/ruby_supportlib/phusion_passenger/apache2/config_options.rb +15 -0
  65. data/src/ruby_supportlib/phusion_passenger/constants.rb +3 -1
  66. data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +4 -2
  67. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +20 -0
  68. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +1 -1
  69. data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +1 -1
  70. data/src/ruby_supportlib/phusion_passenger/rack/thread_handler_extension.rb +10 -0
  71. data/src/ruby_supportlib/phusion_passenger/request_handler.rb +7 -6
  72. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +13 -0
  73. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/builtin_engine.rb +3 -2
  74. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +1 -1
  75. data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +15 -11
  76. metadata +11 -4
@@ -116,6 +116,7 @@ using namespace std;
116
116
  * controller_threads unsigned integer - default,read_only
117
117
  * default_abort_websockets_on_process_shutdown boolean - default(true)
118
118
  * default_app_file_descriptor_ulimit unsigned integer - -
119
+ * default_bind_address string - default("127.0.0.1")
119
120
  * default_environment string - default("production")
120
121
  * default_force_max_concurrent_requests_per_process integer - default(-1)
121
122
  * default_friendly_error_pages string - default("auto")
@@ -133,6 +134,7 @@ using namespace std;
133
134
  * default_server_port unsigned integer - default
134
135
  * default_spawn_method string - default("smart")
135
136
  * default_sticky_sessions boolean - default(false)
137
+ * default_sticky_sessions_cookie_attributes string - default("SameSite=Lax; Secure;")
136
138
  * default_sticky_sessions_cookie_name string - default("_passenger_route")
137
139
  * default_user string - default("nobody")
138
140
  * disable_log_prefix boolean - default(false)
@@ -162,7 +164,7 @@ using namespace std;
162
164
  * security_update_checker_interval unsigned integer - default(86400)
163
165
  * security_update_checker_proxy_url string - -
164
166
  * security_update_checker_url string - default("https://securitycheck.phusionpassenger.com/v1/check.json")
165
- * server_software string - default("Phusion_Passenger/6.0.3")
167
+ * server_software string - default("Phusion_Passenger/6.0.7")
166
168
  * show_version_in_header boolean - default(true)
167
169
  * single_app_mode_app_root string - default,read_only
168
170
  * single_app_mode_app_start_command string - read_only
@@ -123,6 +123,7 @@ private:
123
123
  HashedStaticString PASSENGER_SHOW_VERSION_IN_HEADER;
124
124
  HashedStaticString PASSENGER_STICKY_SESSIONS;
125
125
  HashedStaticString PASSENGER_STICKY_SESSIONS_COOKIE_NAME;
126
+ HashedStaticString PASSENGER_STICKY_SESSIONS_COOKIE_ATTRIBUTES;
126
127
  HashedStaticString PASSENGER_REQUEST_OOB_WORK;
127
128
  HashedStaticString REMOTE_ADDR;
128
129
  HashedStaticString REMOTE_PORT;
@@ -87,6 +87,7 @@ parseControllerBenchmarkMode(const StaticString &mode) {
87
87
  * client_freelist_limit unsigned integer - default(0)
88
88
  * default_abort_websockets_on_process_shutdown boolean - default(true)
89
89
  * default_app_file_descriptor_ulimit unsigned integer - -
90
+ * default_bind_address string - default("127.0.0.1")
90
91
  * default_environment string - default("production")
91
92
  * default_force_max_concurrent_requests_per_process integer - default(-1)
92
93
  * default_friendly_error_pages string - default("auto")
@@ -104,6 +105,7 @@ parseControllerBenchmarkMode(const StaticString &mode) {
104
105
  * default_server_port unsigned integer required -
105
106
  * default_spawn_method string - default("smart")
106
107
  * default_sticky_sessions boolean - default(false)
108
+ * default_sticky_sessions_cookie_attributes string - default("SameSite=Lax; Secure;")
107
109
  * default_sticky_sessions_cookie_name string - default("_passenger_route")
108
110
  * default_user string - default("nobody")
109
111
  * graceful_exit boolean - default(true)
@@ -113,7 +115,7 @@ parseControllerBenchmarkMode(const StaticString &mode) {
113
115
  * multi_app boolean - default(true),read_only
114
116
  * request_freelist_limit unsigned integer - default(1024)
115
117
  * response_buffer_high_watermark unsigned integer - default(134217728)
116
- * server_software string - default("Phusion_Passenger/6.0.3")
118
+ * server_software string - default("Phusion_Passenger/6.0.7")
117
119
  * show_version_in_header boolean - default(true)
118
120
  * start_reading_after_accept boolean - default(true)
119
121
  * stat_throttle_rate unsigned integer - default(10)
@@ -154,12 +156,14 @@ private:
154
156
  add("default_server_port", UINT_TYPE, REQUIRED);
155
157
  add("default_sticky_sessions", BOOL_TYPE, OPTIONAL, false);
156
158
  add("default_sticky_sessions_cookie_name", STRING_TYPE, OPTIONAL, DEFAULT_STICKY_SESSIONS_COOKIE_NAME);
159
+ add("default_sticky_sessions_cookie_attributes", STRING_TYPE, OPTIONAL, DEFAULT_STICKY_SESSIONS_COOKIE_ATTRIBUTES);
157
160
  add("server_software", STRING_TYPE, OPTIONAL, SERVER_TOKEN_NAME "/" PASSENGER_VERSION);
158
161
  add("vary_turbocache_by_cookie", STRING_TYPE, OPTIONAL);
159
162
 
160
163
  add("default_friendly_error_pages", STRING_TYPE, OPTIONAL, "auto");
161
164
  add("default_environment", STRING_TYPE, OPTIONAL, DEFAULT_APP_ENV);
162
165
  add("default_spawn_method", STRING_TYPE, OPTIONAL, DEFAULT_SPAWN_METHOD);
166
+ add("default_bind_address", STRING_TYPE, OPTIONAL, DEFAULT_BIND_ADDRESS);
163
167
  add("default_load_shell_envvars", BOOL_TYPE, OPTIONAL, false);
164
168
  add("default_meteor_app_settings", STRING_TYPE, OPTIONAL);
165
169
  add("default_app_file_descriptor_ulimit", UINT_TYPE, OPTIONAL);
@@ -419,11 +423,13 @@ public:
419
423
  StaticString defaultServerPort;
420
424
  StaticString serverSoftware;
421
425
  StaticString defaultStickySessionsCookieName;
426
+ StaticString defaultStickySessionsCookieAttributes;
422
427
  StaticString defaultVaryTurbocacheByCookie;
423
428
 
424
429
  StaticString defaultFriendlyErrorPages;
425
430
  StaticString defaultEnvironment;
426
431
  StaticString defaultSpawnMethod;
432
+ StaticString defaultBindAddress;
427
433
  StaticString defaultMeteorAppSettings;
428
434
  unsigned int defaultAppFileDescriptorUlimit;
429
435
  unsigned int defaultMinInstances;
@@ -451,11 +457,13 @@ public:
451
457
  defaultServerPort(psg_pstrdup(pool, config["default_server_port"].asString())),
452
458
  serverSoftware(psg_pstrdup(pool, config["server_software"].asString())),
453
459
  defaultStickySessionsCookieName(psg_pstrdup(pool, config["default_sticky_sessions_cookie_name"].asString())),
460
+ defaultStickySessionsCookieAttributes(psg_pstrdup(pool, config["default_sticky_sessions_cookie_attributes"].asString())),
454
461
  defaultVaryTurbocacheByCookie(psg_pstrdup(pool, config["vary_turbocache_by_cookie"].asString())),
455
462
 
456
463
  defaultFriendlyErrorPages(psg_pstrdup(pool, config["default_friendly_error_pages"].asString())),
457
464
  defaultEnvironment(psg_pstrdup(pool, config["default_environment"].asString())),
458
465
  defaultSpawnMethod(psg_pstrdup(pool, config["default_spawn_method"].asString())),
466
+ defaultBindAddress(psg_pstrdup(pool, config["default_bind_address"].asString())),
459
467
  defaultMeteorAppSettings(psg_pstrdup(pool, config["default_meteor_app_settings"].asString())),
460
468
  defaultAppFileDescriptorUlimit(config["default_app_file_descriptor_ulimit"].asUInt()),
461
469
  defaultMinInstances(config["default_min_instances"].asUInt()),
@@ -768,6 +768,19 @@ Controller::constructHeaderBuffersForResponse(Request *req, struct iovec *buffer
768
768
  dataSize += baseURI.size();
769
769
  INC_BUFFER_ITER(i);
770
770
 
771
+
772
+ StaticString stickyAttributes = req->options.stickySessionsCookieAttributes;
773
+ if (stickyAttributes.size() > 0) {
774
+ PUSH_STATIC_BUFFER("; ");
775
+ if (buffers != NULL) {
776
+ BEGIN_PUSH_NEXT_BUFFER();
777
+ buffers[i].iov_base = (void *) stickyAttributes.data();
778
+ buffers[i].iov_len = stickyAttributes.size();
779
+ }
780
+ dataSize += stickyAttributes.size();
781
+ INC_BUFFER_ITER(i);
782
+ }
783
+
771
784
  PUSH_STATIC_BUFFER("\r\n");
772
785
  }
773
786
 
@@ -153,6 +153,7 @@ Controller::initializePoolOptions(Client *client, Request *req, RequestAnalysis
153
153
 
154
154
  if (options != NULL) {
155
155
  req->options = **options;
156
+ fillPoolOption(req, req->options.baseURI, "!~SCRIPT_NAME");
156
157
  } else {
157
158
  createNewPoolOptions(client, req, hAppGroupName);
158
159
  }
@@ -199,9 +200,11 @@ Controller::fillPoolOptionsFromConfigCaches(Options &options,
199
200
  options.forceMaxConcurrentRequestsPerProcess = requestConfig->defaultForceMaxConcurrentRequestsPerProcess;
200
201
  options.environment = requestConfig->defaultEnvironment;
201
202
  options.spawnMethod = requestConfig->defaultSpawnMethod;
203
+ options.bindAddress = requestConfig->defaultBindAddress;
202
204
  options.loadShellEnvvars = requestConfig->defaultLoadShellEnvvars;
203
205
  options.statThrottleRate = mainConfig.statThrottleRate;
204
206
  options.maxRequests = requestConfig->defaultMaxRequests;
207
+ options.stickySessionsCookieAttributes = requestConfig->defaultStickySessionsCookieAttributes;
205
208
 
206
209
  /******************************/
207
210
  }
@@ -365,6 +368,7 @@ Controller::createNewPoolOptions(Client *client, Request *req,
365
368
  fillPoolOption(req, options.group, "!~PASSENGER_GROUP");
366
369
  fillPoolOption(req, options.minProcesses, "!~PASSENGER_MIN_PROCESSES");
367
370
  fillPoolOption(req, options.spawnMethod, "!~PASSENGER_SPAWN_METHOD");
371
+ fillPoolOption(req, options.bindAddress, "!~PASSENGER_DIRECT_INSTANCE_REQUEST_ADDRESS");
368
372
  fillPoolOption(req, options.appStartCommand, "!~PASSENGER_APP_START_COMMAND");
369
373
  fillPoolOptionSecToMsec(req, options.startTimeout, "!~PASSENGER_START_TIMEOUT");
370
374
  fillPoolOption(req, options.maxPreloaderIdleTime, "!~PASSENGER_MAX_PRELOADER_IDLE_TIME");
@@ -377,6 +381,7 @@ Controller::createNewPoolOptions(Client *client, Request *req,
377
381
  fillPoolOption(req, options.fileDescriptorUlimit, "!~PASSENGER_APP_FILE_DESCRIPTOR_ULIMIT");
378
382
  fillPoolOption(req, options.raiseInternalError, "!~PASSENGER_RAISE_INTERNAL_ERROR");
379
383
  fillPoolOption(req, options.lveMinUid, "!~PASSENGER_LVE_MIN_UID");
384
+ fillPoolOption(req, options.stickySessionsCookieAttributes, "!~PASSENGER_STICKY_SESSIONS_COOKIE_ATTRIBUTES");
380
385
 
381
386
  // maxProcesses is configured per-application by the (Enterprise) maxInstances option (and thus passed
382
387
  // via request headers). In OSS the max processes can also be configured, but on a global level
@@ -70,6 +70,7 @@ Controller::preinitialize() {
70
70
  PASSENGER_SHOW_VERSION_IN_HEADER = "!~PASSENGER_SHOW_VERSION_IN_HEADER";
71
71
  PASSENGER_STICKY_SESSIONS = "!~PASSENGER_STICKY_SESSIONS";
72
72
  PASSENGER_STICKY_SESSIONS_COOKIE_NAME = "!~PASSENGER_STICKY_SESSIONS_COOKIE_NAME";
73
+ PASSENGER_STICKY_SESSIONS_COOKIE_ATTRIBUTES = "!~PASSENGER_STICKY_SESSIONS_COOKIE_ATTRIBUTES";
73
74
  PASSENGER_REQUEST_OOB_WORK = "!~Request-OOB-Work";
74
75
  REMOTE_ADDR = "!~REMOTE_ADDR";
75
76
  REMOTE_PORT = "!~REMOTE_PORT";
@@ -173,6 +173,9 @@ coreUsage() {
173
173
  printf(" --sticky-sessions-cookie-name NAME\n");
174
174
  printf(" Cookie name to use for sticky sessions.\n");
175
175
  printf(" Default: " DEFAULT_STICKY_SESSIONS_COOKIE_NAME "\n");
176
+ printf(" --sticky-sessions-cookie-attributes 'NAME1=VALUE1; NAME2'\n");
177
+ printf(" The attributes to use for the sticky session cookie.\n");
178
+ printf(" Default: " DEFAULT_STICKY_SESSIONS_COOKIE_ATTRIBUTES "\n");
176
179
  printf(" --vary-turbocache-by-cookie NAME\n");
177
180
  printf(" Vary the turbocache by the cookie of the given name\n");
178
181
  printf(" --disable-turbocaching\n");
@@ -251,6 +251,17 @@ public:
251
251
  */
252
252
  StaticString spawnMethod;
253
253
 
254
+ /**
255
+ * The address that Passenger binds to in order to allow sending HTTP
256
+ * requests to individual application processes.
257
+ *
258
+ * @hinted_parseable
259
+ * @require_non_empty
260
+ * @pass_during_handshake
261
+ * @non_confidential
262
+ */
263
+ StaticString bindAddress;
264
+
254
265
  /**
255
266
  * The base URI on which the app runs. If the app is running on the
256
267
  * root URI, then this value must be "/".
@@ -51,6 +51,7 @@ Passenger::SpawningKit::Config::internStrings() {
51
51
  totalSize += appType.size() + 1;
52
52
  totalSize += appEnv.size() + 1;
53
53
  totalSize += spawnMethod.size() + 1;
54
+ totalSize += bindAddress.size() + 1;
54
55
  totalSize += baseURI.size() + 1;
55
56
  totalSize += user.size() + 1;
56
57
  totalSize += group.size() + 1;
@@ -90,6 +91,8 @@ Passenger::SpawningKit::Config::internStrings() {
90
91
  pos = appendData(pos, end, "\0", 1);
91
92
  pos = appendData(pos, end, spawnMethod);
92
93
  pos = appendData(pos, end, "\0", 1);
94
+ pos = appendData(pos, end, bindAddress);
95
+ pos = appendData(pos, end, "\0", 1);
93
96
  pos = appendData(pos, end, baseURI);
94
97
  pos = appendData(pos, end, "\0", 1);
95
98
  pos = appendData(pos, end, user);
@@ -147,6 +150,10 @@ Passenger::SpawningKit::Config::internStrings() {
147
150
  spawnMethod = StaticString(pos, tmpSize);
148
151
  pos += tmpSize + 1;
149
152
 
153
+ tmpSize = bindAddress.size();
154
+ bindAddress = StaticString(pos, tmpSize);
155
+ pos += tmpSize + 1;
156
+
150
157
  tmpSize = baseURI.size();
151
158
  baseURI = StaticString(pos, tmpSize);
152
159
  pos += tmpSize + 1;
@@ -221,6 +228,10 @@ Passenger::SpawningKit::Config::validate(vector<StaticString> &errors) const {
221
228
  ok = false;
222
229
  errors.push_back(P_STATIC_STRING("spawn_method may not be empty"));
223
230
  }
231
+ if (OXT_UNLIKELY(bindAddress.empty())) {
232
+ ok = false;
233
+ errors.push_back(P_STATIC_STRING("bind_address may not be empty"));
234
+ }
224
235
  if (OXT_UNLIKELY(baseURI.empty())) {
225
236
  ok = false;
226
237
  errors.push_back(P_STATIC_STRING("base_uri may not be empty"));
@@ -287,6 +298,7 @@ Passenger::SpawningKit::Config::getConfidentialFieldsToPassToApp() const {
287
298
  doc["app_type"] = appType.toString();
288
299
  doc["app_env"] = appEnv.toString();
289
300
  doc["spawn_method"] = spawnMethod.toString();
301
+ doc["bind_address"] = bindAddress.toString();
290
302
  doc["base_uri"] = baseURI.toString();
291
303
  doc["user"] = user.toString();
292
304
  doc["group"] = group.toString();
@@ -340,6 +352,7 @@ Passenger::SpawningKit::Config::getNonConfidentialFieldsToPassToApp() const {
340
352
  doc["app_type"] = appType.toString();
341
353
  doc["app_env"] = appEnv.toString();
342
354
  doc["spawn_method"] = spawnMethod.toString();
355
+ doc["bind_address"] = bindAddress.toString();
343
356
  doc["base_uri"] = baseURI.toString();
344
357
  doc["user"] = user.toString();
345
358
  doc["group"] = group.toString();
@@ -134,6 +134,7 @@ protected:
134
134
  config->group = info.groupname;
135
135
 
136
136
  extraArgs["spawn_method"] = options.spawnMethod.toString();
137
+ config->bindAddress = options.bindAddress;
137
138
 
138
139
  /******************/
139
140
  /******************/
@@ -415,9 +415,11 @@ doSleep(int sec) {
415
415
 
416
416
  static void
417
417
  maybeDeletePidFile() {
418
+ up_privilege();
418
419
  if (pidFile != NULL) {
419
420
  unlink(pidFile);
420
421
  }
422
+ down_privilege();
421
423
  }
422
424
 
423
425
  static void
@@ -103,6 +103,7 @@ using namespace std;
103
103
  * daemonize boolean - default(false)
104
104
  * default_abort_websockets_on_process_shutdown boolean - default(true)
105
105
  * default_app_file_descriptor_ulimit unsigned integer - -
106
+ * default_bind_address string - default("127.0.0.1")
106
107
  * default_environment string - default("production")
107
108
  * default_force_max_concurrent_requests_per_process integer - default(-1)
108
109
  * default_friendly_error_pages string - default("auto")
@@ -120,6 +121,7 @@ using namespace std;
120
121
  * default_server_port unsigned integer - default
121
122
  * default_spawn_method string - default("smart")
122
123
  * default_sticky_sessions boolean - default(false)
124
+ * default_sticky_sessions_cookie_attributes string - default("SameSite=Lax; Secure;")
123
125
  * default_sticky_sessions_cookie_name string - default("_passenger_route")
124
126
  * default_user string - default("nobody")
125
127
  * disable_log_prefix boolean - default(false)
@@ -151,7 +153,7 @@ using namespace std;
151
153
  * security_update_checker_interval unsigned integer - default(86400)
152
154
  * security_update_checker_proxy_url string - -
153
155
  * security_update_checker_url string - default("https://securitycheck.phusionpassenger.com/v1/check.json")
154
- * server_software string - default("Phusion_Passenger/6.0.3")
156
+ * server_software string - default("Phusion_Passenger/6.0.7")
155
157
  * setsid boolean - default(false)
156
158
  * show_version_in_header boolean - default(true)
157
159
  * single_app_mode_app_root string - default,read_only
@@ -183,7 +183,7 @@ static const char *
183
183
  cmd_passenger_enterprise_only(cmd_parms *cmd, void *pcfg, const char *arg) {
184
184
  return "this feature is only available in Phusion Passenger Enterprise. "
185
185
  "You are currently running the open source Phusion Passenger Enterprise. "
186
- "Please learn more about and/or buy Phusion Passenger Enterprise at https://www.phusionpassenger.com/enterprise";
186
+ "Please learn more about and/or buy Phusion Passenger Enterprise at https://www.phusionpassenger.com/features#premium-features";
187
187
  }
188
188
 
189
189
  static const char *
@@ -172,6 +172,11 @@ extern "C" const command_rec passenger_commands[] = {
172
172
  NULL,
173
173
  RSRC_CONF,
174
174
  "The user that Phusion Passenger applications must run as when user switching fails or is disabled."),
175
+ AP_INIT_TAKE1("PassengerDirectInstanceRequestAddress",
176
+ (Take1Func) cmd_passenger_direct_instance_request_address,
177
+ NULL,
178
+ RSRC_CONF | ACCESS_CONF,
179
+ "The address that Passenger binds to in order to allow sending HTTP requests to individual application processes."),
175
180
  AP_INIT_FLAG("PassengerDisableAnonymousTelemetry",
176
181
  (FlagFunc) cmd_passenger_disable_anonymous_telemetry,
177
182
  NULL,
@@ -412,6 +417,11 @@ extern "C" const command_rec passenger_commands[] = {
412
417
  NULL,
413
418
  RSRC_CONF | ACCESS_CONF | OR_ALL,
414
419
  "Whether to enable sticky sessions."),
420
+ AP_INIT_TAKE1("PassengerStickySessionsCookieAttributes",
421
+ (Take1Func) cmd_passenger_sticky_sessions_cookie_attributes,
422
+ NULL,
423
+ RSRC_CONF | ACCESS_CONF | OR_ALL,
424
+ "The attributes to use for the sticky session cookie."),
415
425
  AP_INIT_TAKE1("PassengerStickySessionsCookieName",
416
426
  (Take1Func) cmd_passenger_sticky_sessions_cookie_name,
417
427
  NULL,
@@ -179,6 +179,11 @@ ConfigManifestGenerator::autoGenerated_setAppConfigDefaults() {
179
179
  "PassengerAppType",
180
180
  P_STATIC_STRING("Autodetected"));
181
181
 
182
+ addOptionsContainerStaticDefaultStr(
183
+ defaultAppConfigContainer,
184
+ "PassengerDirectInstanceRequestAddress",
185
+ P_STATIC_STRING("127.0.0.1"));
186
+
182
187
  addOptionsContainerStaticDefaultInt(
183
188
  defaultAppConfigContainer,
184
189
  "PassengerForceMaxConcurrentRequestsPerProcess",
@@ -305,6 +310,11 @@ ConfigManifestGenerator::autoGenerated_setLocationConfigDefaults() {
305
310
  "PassengerStickySessions",
306
311
  false);
307
312
 
313
+ addOptionsContainerStaticDefaultStr(
314
+ defaultLocConfigContainer,
315
+ "PassengerStickySessionsCookieAttributes",
316
+ DEFAULT_STICKY_SESSIONS_COOKIE_ATTRIBUTES);
317
+
308
318
  addOptionsContainerStaticDefaultStr(
309
319
  defaultLocConfigContainer,
310
320
  "PassengerStickySessionsCookieName",
@@ -319,6 +319,21 @@ cmd_passenger_default_user(cmd_parms *cmd, void *pcfg, const char *arg) {
319
319
  return NULL;
320
320
  }
321
321
 
322
+ static const char *
323
+ cmd_passenger_direct_instance_request_address(cmd_parms *cmd, void *pcfg, const char *arg) {
324
+ const char *err = ap_check_cmd_context(cmd, NOT_IN_FILES);
325
+ if (err != NULL) {
326
+ return err;
327
+ }
328
+
329
+ DirConfig *config = (DirConfig *) pcfg;
330
+ config->mDirectInstanceRequestAddressSourceFile = cmd->directive->filename;
331
+ config->mDirectInstanceRequestAddressSourceLine = cmd->directive->line_num;
332
+ config->mDirectInstanceRequestAddressExplicitlySet = true;
333
+ config->mDirectInstanceRequestAddress = arg;
334
+ return NULL;
335
+ }
336
+
322
337
  static const char *
323
338
  cmd_passenger_disable_anonymous_telemetry(cmd_parms *cmd, void *pcfg, const char *arg) {
324
339
  const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
@@ -903,6 +918,16 @@ cmd_passenger_sticky_sessions(cmd_parms *cmd, void *pcfg, const char *arg) {
903
918
  return NULL;
904
919
  }
905
920
 
921
+ static const char *
922
+ cmd_passenger_sticky_sessions_cookie_attributes(cmd_parms *cmd, void *pcfg, const char *arg) {
923
+ DirConfig *config = (DirConfig *) pcfg;
924
+ config->mStickySessionsCookieAttributesSourceFile = cmd->directive->filename;
925
+ config->mStickySessionsCookieAttributesSourceLine = cmd->directive->line_num;
926
+ config->mStickySessionsCookieAttributesExplicitlySet = true;
927
+ config->mStickySessionsCookieAttributes = arg;
928
+ return NULL;
929
+ }
930
+
906
931
  static const char *
907
932
  cmd_passenger_sticky_sessions_cookie_name(cmd_parms *cmd, void *pcfg, const char *arg) {
908
933
  DirConfig *config = (DirConfig *) pcfg;
@@ -75,6 +75,9 @@ createDirConfig_autoGenerated(DirConfig *config) {
75
75
  */
76
76
  config->mBufferResponse = Apache2Module::UNSET;
77
77
  config->mBufferUpload = Apache2Module::UNSET;
78
+ /*
79
+ * config->mDirectInstanceRequestAddress: default initialized
80
+ */
78
81
  config->mEnabled = Apache2Module::UNSET;
79
82
  config->mErrorOverride = Apache2Module::UNSET;
80
83
  config->mForceMaxConcurrentRequestsPerProcess = UNSET_INT_VALUE;
@@ -115,6 +118,9 @@ createDirConfig_autoGenerated(DirConfig *config) {
115
118
  * config->mStartupFile: default initialized
116
119
  */
117
120
  config->mStickySessions = Apache2Module::UNSET;
121
+ /*
122
+ * config->mStickySessionsCookieAttributes: default initialized
123
+ */
118
124
  /*
119
125
  * config->mStickySessionsCookieName: default initialized
120
126
  */
@@ -132,6 +138,7 @@ createDirConfig_autoGenerated(DirConfig *config) {
132
138
  config->mBaseURIsSourceLine = 0;
133
139
  config->mBufferResponseSourceLine = 0;
134
140
  config->mBufferUploadSourceLine = 0;
141
+ config->mDirectInstanceRequestAddressSourceLine = 0;
135
142
  config->mEnabledSourceLine = 0;
136
143
  config->mErrorOverrideSourceLine = 0;
137
144
  config->mForceMaxConcurrentRequestsPerProcessSourceLine = 0;
@@ -154,6 +161,7 @@ createDirConfig_autoGenerated(DirConfig *config) {
154
161
  config->mStartTimeoutSourceLine = 0;
155
162
  config->mStartupFileSourceLine = 0;
156
163
  config->mStickySessionsSourceLine = 0;
164
+ config->mStickySessionsCookieAttributesSourceLine = 0;
157
165
  config->mStickySessionsCookieNameSourceLine = 0;
158
166
  config->mUserSourceLine = 0;
159
167
 
@@ -167,6 +175,7 @@ createDirConfig_autoGenerated(DirConfig *config) {
167
175
  config->mBaseURIsExplicitlySet = false;
168
176
  config->mBufferResponseExplicitlySet = false;
169
177
  config->mBufferUploadExplicitlySet = false;
178
+ config->mDirectInstanceRequestAddressExplicitlySet = false;
170
179
  config->mEnabledExplicitlySet = false;
171
180
  config->mErrorOverrideExplicitlySet = false;
172
181
  config->mForceMaxConcurrentRequestsPerProcessExplicitlySet = false;
@@ -189,6 +198,7 @@ createDirConfig_autoGenerated(DirConfig *config) {
189
198
  config->mStartTimeoutExplicitlySet = false;
190
199
  config->mStartupFileExplicitlySet = false;
191
200
  config->mStickySessionsExplicitlySet = false;
201
+ config->mStickySessionsCookieAttributesExplicitlySet = false;
192
202
  config->mStickySessionsCookieNameExplicitlySet = false;
193
203
  config->mUserExplicitlySet = false;
194
204
  }
@@ -61,6 +61,9 @@ constructRequestHeaders_autoGenerated(request_rec *r, DirConfig *config, std::st
61
61
  addHeader(result, StaticString("!~PASSENGER_APP_LOG_FILE",
62
62
  sizeof("!~PASSENGER_APP_LOG_FILE") - 1),
63
63
  config->mAppLogFile);
64
+ addHeader(result, StaticString("!~PASSENGER_DIRECT_INSTANCE_REQUEST_ADDRESS",
65
+ sizeof("!~PASSENGER_DIRECT_INSTANCE_REQUEST_ADDRESS") - 1),
66
+ config->mDirectInstanceRequestAddress);
64
67
  addHeader(r, result, StaticString("!~PASSENGER_FORCE_MAX_CONCURRENT_REQUESTS_PER_PROCESS",
65
68
  sizeof("!~PASSENGER_FORCE_MAX_CONCURRENT_REQUESTS_PER_PROCESS") - 1),
66
69
  config->mForceMaxConcurrentRequestsPerProcess);
@@ -115,6 +118,9 @@ constructRequestHeaders_autoGenerated(request_rec *r, DirConfig *config, std::st
115
118
  addHeader(result, StaticString("!~PASSENGER_STICKY_SESSIONS",
116
119
  sizeof("!~PASSENGER_STICKY_SESSIONS") - 1),
117
120
  config->mStickySessions);
121
+ addHeader(result, StaticString("!~PASSENGER_STICKY_SESSIONS_COOKIE_ATTRIBUTES",
122
+ sizeof("!~PASSENGER_STICKY_SESSIONS_COOKIE_ATTRIBUTES") - 1),
123
+ config->mStickySessionsCookieAttributes);
118
124
  addHeader(result, StaticString("!~PASSENGER_STICKY_SESSIONS_COOKIE_NAME",
119
125
  sizeof("!~PASSENGER_STICKY_SESSIONS_COOKIE_NAME") - 1),
120
126
  config->mStickySessionsCookieName);