passenger 3.9.2.beta → 4.0.0.rc4

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 (159) hide show
  1. data/.travis.yml +3 -0
  2. data/NEWS +77 -7
  3. data/README.md +3 -11
  4. data/bin/passenger-install-apache2-module +24 -20
  5. data/bin/passenger-install-nginx-module +25 -23
  6. data/build/agents.rb +11 -0
  7. data/build/apache2.rb +9 -5
  8. data/build/basics.rb +37 -30
  9. data/build/common_library.rb +4 -1
  10. data/build/cplusplus_support.rb +5 -5
  11. data/build/cxx_tests.rb +28 -8
  12. data/build/integration_tests.rb +6 -3
  13. data/build/nginx.rb +3 -3
  14. data/build/packaging.rb +95 -57
  15. data/build/ruby_extension.rb +34 -21
  16. data/build/ruby_tests.rb +4 -2
  17. data/build/test_basics.rb +1 -1
  18. data/dev/run_travis.sh +36 -1
  19. data/doc/Users guide Apache.html +425 -308
  20. data/doc/Users guide Apache.idmap.txt +78 -70
  21. data/doc/Users guide Apache.index.sqlite3 +0 -0
  22. data/doc/Users guide Apache.txt +33 -92
  23. data/doc/Users guide Nginx.html +519 -220
  24. data/doc/Users guide Nginx.idmap.txt +78 -60
  25. data/doc/Users guide Nginx.txt +115 -26
  26. data/doc/Users guide Standalone.html +8 -2
  27. data/doc/users_guide_snippets/analysis_and_system_maintenance.txt +1 -7
  28. data/doc/users_guide_snippets/installation.txt +167 -22
  29. data/doc/users_guide_snippets/rackup_specifications.txt +4 -0
  30. data/doc/users_guide_snippets/since_version.txt +1 -0
  31. data/doc/users_guide_snippets/support_information.txt +3 -7
  32. data/doc/users_guide_snippets/tips.txt +0 -24
  33. data/ext/apache2/Configuration.cpp +11 -33
  34. data/ext/apache2/Configuration.hpp +3 -18
  35. data/ext/apache2/DirectoryMapper.h +20 -70
  36. data/ext/apache2/Hooks.cpp +2 -2
  37. data/ext/common/AgentsStarter.cpp +0 -2
  38. data/ext/common/AgentsStarter.h +0 -1
  39. data/ext/common/AgentsStarter.hpp +1 -3
  40. data/ext/common/ApplicationPool2/AppTypes.cpp +74 -0
  41. data/ext/common/ApplicationPool2/AppTypes.h +202 -0
  42. data/ext/common/ApplicationPool2/Common.h +12 -10
  43. data/ext/common/ApplicationPool2/DirectSpawner.h +256 -0
  44. data/ext/common/ApplicationPool2/DummySpawner.h +90 -0
  45. data/ext/common/ApplicationPool2/Group.h +311 -94
  46. data/ext/common/ApplicationPool2/Implementation.cpp +405 -145
  47. data/ext/common/ApplicationPool2/Options.h +24 -26
  48. data/ext/common/ApplicationPool2/PipeWatcher.h +20 -13
  49. data/ext/common/ApplicationPool2/Pool.h +326 -183
  50. data/ext/common/ApplicationPool2/Process.h +205 -55
  51. data/ext/common/ApplicationPool2/README.md +1 -1
  52. data/ext/common/ApplicationPool2/Session.h +21 -10
  53. data/ext/common/ApplicationPool2/SmartSpawner.h +801 -0
  54. data/ext/common/ApplicationPool2/Spawner.h +141 -1149
  55. data/ext/common/ApplicationPool2/SpawnerFactory.h +132 -0
  56. data/ext/common/ApplicationPool2/SuperGroup.h +146 -223
  57. data/ext/common/Constants.h +4 -2
  58. data/ext/common/Exceptions.h +23 -1
  59. data/ext/common/Logging.cpp +17 -6
  60. data/ext/common/Logging.h +37 -7
  61. data/ext/common/ResourceLocator.h +1 -1
  62. data/ext/common/Utils.cpp +49 -1
  63. data/ext/common/Utils.h +13 -4
  64. data/ext/common/{AnsiColorConstants.h → Utils/AnsiColorConstants.h} +0 -0
  65. data/ext/common/{BCrypt.cpp → Utils/BCrypt.cpp} +0 -0
  66. data/ext/common/{BCrypt.h → Utils/BCrypt.h} +0 -0
  67. data/ext/common/{Blowfish.c → Utils/Blowfish.c} +0 -0
  68. data/ext/common/{Blowfish.h → Utils/Blowfish.h} +0 -0
  69. data/ext/common/Utils/CachedFileStat.hpp +27 -25
  70. data/ext/common/Utils/Curl.h +184 -0
  71. data/ext/common/{HttpConstants.h → Utils/HttpConstants.h} +3 -0
  72. data/ext/common/Utils/IOUtils.cpp +6 -2
  73. data/ext/common/{IniFile.h → Utils/IniFile.h} +0 -0
  74. data/ext/common/Utils/LargeFiles.cpp +30 -0
  75. data/ext/common/Utils/LargeFiles.h +40 -0
  76. data/ext/common/Utils/StrIntUtils.cpp +72 -8
  77. data/ext/common/Utils/StrIntUtils.h +24 -2
  78. data/ext/common/Utils/StringMap.h +12 -2
  79. data/ext/common/Utils/VariantMap.h +51 -2
  80. data/ext/common/Utils/jsoncpp.cpp +1 -1
  81. data/ext/common/agents/Base.cpp +147 -11
  82. data/ext/common/agents/HelperAgent/AgentOptions.h +14 -6
  83. data/ext/common/agents/HelperAgent/Main.cpp +79 -19
  84. data/ext/common/agents/HelperAgent/RequestHandler.h +36 -16
  85. data/ext/common/agents/LoggingAgent/LoggingServer.h +3 -5
  86. data/ext/common/agents/LoggingAgent/Main.cpp +2 -4
  87. data/ext/common/agents/LoggingAgent/RemoteSender.h +18 -24
  88. data/ext/common/agents/SpawnPreparer.cpp +7 -0
  89. data/ext/common/agents/Watchdog/Main.cpp +96 -38
  90. data/ext/nginx/Configuration.c +26 -22
  91. data/ext/nginx/Configuration.h +4 -2
  92. data/ext/nginx/ContentHandler.c +23 -52
  93. data/ext/nginx/ContentHandler.h +5 -11
  94. data/ext/nginx/config +10 -3
  95. data/ext/nginx/ngx_http_passenger_module.c +21 -6
  96. data/ext/nginx/ngx_http_passenger_module.h +4 -1
  97. data/ext/oxt/dynamic_thread_group.hpp +9 -1
  98. data/ext/oxt/system_calls.cpp +2 -2
  99. data/ext/ruby/extconf.rb +2 -1
  100. data/helper-scripts/backtrace-sanitizer.rb +2 -0
  101. data/helper-scripts/wsgi-loader.py +54 -21
  102. data/lib/phusion_passenger.rb +5 -3
  103. data/lib/phusion_passenger/abstract_installer.rb +18 -41
  104. data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
  105. data/lib/phusion_passenger/admin_tools/server_instance.rb +2 -2
  106. data/lib/phusion_passenger/common_library.rb +23 -3
  107. data/lib/phusion_passenger/debug_logging.rb +10 -3
  108. data/lib/phusion_passenger/packaging.rb +1 -0
  109. data/lib/phusion_passenger/platform_info.rb +113 -115
  110. data/lib/phusion_passenger/platform_info/compiler.rb +224 -134
  111. data/lib/phusion_passenger/platform_info/cxx_portability.rb +143 -0
  112. data/lib/phusion_passenger/platform_info/depcheck.rb +371 -0
  113. data/lib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +124 -0
  114. data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +97 -0
  115. data/lib/phusion_passenger/platform_info/depcheck_specs/gems.rb +39 -0
  116. data/lib/phusion_passenger/platform_info/depcheck_specs/libs.rb +118 -0
  117. data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +137 -0
  118. data/lib/phusion_passenger/platform_info/depcheck_specs/utilities.rb +15 -0
  119. data/lib/phusion_passenger/platform_info/operating_system.rb +6 -5
  120. data/lib/phusion_passenger/platform_info/ruby.rb +45 -34
  121. data/lib/phusion_passenger/request_handler.rb +35 -22
  122. data/lib/phusion_passenger/request_handler/thread_handler.rb +5 -6
  123. data/lib/phusion_passenger/ruby_core_enhancements.rb +7 -1
  124. data/lib/phusion_passenger/standalone/runtime_installer.rb +43 -34
  125. data/lib/phusion_passenger/utils/robust_interruption.rb +34 -18
  126. data/passenger.gemspec +25 -0
  127. data/resources/templates/standalone/config.erb +3 -1
  128. data/test/config.json.travis +2 -2
  129. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +37 -5
  130. data/test/cxx/ApplicationPool2/PoolTest.cpp +143 -50
  131. data/test/cxx/ApplicationPool2/ProcessTest.cpp +8 -0
  132. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +28 -17
  133. data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +31 -26
  134. data/test/cxx/RequestHandlerTest.cpp +17 -1
  135. data/test/cxx/UtilsTest.cpp +84 -10
  136. data/test/integration_tests/apache2_tests.rb +49 -163
  137. data/test/integration_tests/hello_world_wsgi_spec.rb +2 -2
  138. data/test/integration_tests/mycook_spec.rb +1 -1
  139. data/test/integration_tests/nginx_tests.rb +37 -19
  140. data/test/ruby/request_handler_spec.rb +1 -0
  141. data/test/ruby/spec_helper.rb +52 -1
  142. data/test/stub/nginx/nginx.conf.erb +2 -0
  143. data/test/stub/rack/start.rb +5 -0
  144. data/test/stub/rails3.0/Gemfile.lock +30 -30
  145. data/test/stub/rails3.1/Gemfile +1 -1
  146. data/test/stub/rails3.1/Gemfile.lock +3 -3
  147. data/test/stub/rails3.2/Gemfile +1 -1
  148. data/test/stub/rails3.2/Gemfile.lock +4 -4
  149. data/test/stub/rails_apps/2.3/mycook/app/controllers/welcome_controller.rb +1 -1
  150. data/test/stub/rails_apps/2.3/mycook/app/helpers/recipes_helper.rb +2 -0
  151. data/test/stub/rails_apps/2.3/mycook/app/helpers/test_helper.rb +2 -0
  152. data/test/stub/rails_apps/2.3/mycook/app/helpers/uploads_helper.rb +2 -0
  153. data/test/stub/rails_apps/2.3/mycook/app/helpers/welcome_helper.rb +2 -0
  154. data/test/support/nginx_controller.rb +2 -1
  155. metadata +160 -156
  156. data/build/gempackagetask.rb +0 -99
  157. data/build/packagetask.rb +0 -186
  158. data/ext/common/StringListCreator.h +0 -83
  159. data/lib/phusion_passenger/dependencies.rb +0 -657
@@ -1,99 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Passenger note: this file is copied from Rake 0.8.1. The task names
3
- # have been changed.
4
-
5
- # Define a package task library to aid in the definition of GEM
6
- # packages.
7
-
8
- require 'rubygems'
9
- require 'rake'
10
- require 'build/packagetask'
11
- require 'rubygems/user_interaction'
12
- require 'rubygems/builder'
13
-
14
- module Rake
15
-
16
- # Create a package based upon a Gem spec. Gem packages, as well as
17
- # zip files and tar/gzipped packages can be produced by this task.
18
- #
19
- # In addition to the Rake targets generated by PackageTask, a
20
- # GemPackageTask will also generate the following tasks:
21
- #
22
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.gem"</b>]
23
- # Create a Ruby GEM package with the given name and version.
24
- #
25
- # Example using a Ruby GEM spec:
26
- #
27
- # require 'rubygems'
28
- #
29
- # spec = Gem::Specification.new do |s|
30
- # s.platform = Gem::Platform::RUBY
31
- # s.summary = "Ruby based make-like utility."
32
- # s.name = 'rake'
33
- # s.version = PKG_VERSION
34
- # s.requirements << 'none'
35
- # s.require_path = 'lib'
36
- # s.autorequire = 'rake'
37
- # s.files = PKG_FILES
38
- # s.description = <<EOF
39
- # Rake is a Make-like program implemented in Ruby. Tasks
40
- # and dependencies are specified in standard Ruby syntax.
41
- # EOF
42
- # end
43
- #
44
- # Rake::GemPackageTask.new(spec) do |pkg|
45
- # pkg.need_zip = true
46
- # pkg.need_tar = true
47
- # end
48
- #
49
- class GemPackageTask < PackageTask
50
- # Ruby GEM spec containing the metadata for this package. The
51
- # name, version and package_files are automatically determined
52
- # from the GEM spec and don't need to be explicitly provided.
53
- attr_accessor :gem_spec
54
-
55
- # Create a GEM Package task library. Automatically define the gem
56
- # if a block is given. If no block is supplied, then +define+
57
- # needs to be called to define the task.
58
- def initialize(gem_spec)
59
- init(gem_spec)
60
- yield self if block_given?
61
- define if block_given?
62
- end
63
-
64
- # Initialization tasks without the "yield self" or define
65
- # operations.
66
- def init(gem)
67
- super(gem.name, gem.version)
68
- @gem_spec = gem
69
- @package_files += gem_spec.files if gem_spec.files
70
- end
71
-
72
- # Create the Rake tasks and actions specified by this
73
- # GemPackageTask. (+define+ is automatically called if a block is
74
- # given to +new+).
75
- def define
76
- super
77
- task :package => ['package:gem']
78
- desc "Build the gem file #{gem_file}"
79
- task 'package:gem' => ["#{package_dir}/#{gem_file}"]
80
- file "#{package_dir}/#{gem_file}" => [package_dir] + @gem_spec.files do
81
- when_writing("Creating GEM") {
82
- Gem::Builder.new(gem_spec).build
83
- verbose(true) {
84
- mv gem_file, "#{package_dir}/#{gem_file}"
85
- }
86
- }
87
- end
88
- end
89
-
90
- def gem_file
91
- if @gem_spec.platform == Gem::Platform::RUBY
92
- "#{package_name}.gem"
93
- else
94
- "#{package_name}-#{@gem_spec.platform}.gem"
95
- end
96
- end
97
-
98
- end
99
- end
@@ -1,186 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # Passenger note: this file is copied from Rake 0.8.1. The task names
3
- # have been changed.
4
-
5
- # Define a package task libarary to aid in the definition of
6
- # redistributable package files.
7
-
8
- require 'rake'
9
- require 'rake/tasklib'
10
-
11
- module Rake
12
-
13
- # Create a packaging task that will package the project into
14
- # distributable files (e.g zip archive or tar files).
15
- #
16
- # The PackageTask will create the following targets:
17
- #
18
- # [<b>:package</b>]
19
- # Create all the requested package files.
20
- #
21
- # [<b>:clobber_package</b>]
22
- # Delete all the package files. This target is automatically
23
- # added to the main clobber target.
24
- #
25
- # [<b>:repackage</b>]
26
- # Rebuild the package files from scratch, even if they are not out
27
- # of date.
28
- #
29
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tgz"</b>]
30
- # Create a gzipped tar package (if <em>need_tar</em> is true).
31
- #
32
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tar.gz"</b>]
33
- # Create a gzipped tar package (if <em>need_tar_gz</em> is true).
34
- #
35
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.tar.bz2"</b>]
36
- # Create a bzip2'd tar package (if <em>need_tar_bz2</em> is true).
37
- #
38
- # [<b>"<em>package_dir</em>/<em>name</em>-<em>version</em>.zip"</b>]
39
- # Create a zip package archive (if <em>need_zip</em> is true).
40
- #
41
- # Example:
42
- #
43
- # Rake::PackageTask.new("rake", "1.2.3") do |p|
44
- # p.need_tar = true
45
- # p.package_files.include("lib/**/*.rb")
46
- # end
47
- #
48
- class PackageTask < TaskLib
49
- # Name of the package (from the GEM Spec).
50
- attr_accessor :name
51
-
52
- # Version of the package (e.g. '1.3.2').
53
- attr_accessor :version
54
-
55
- # Directory used to store the package files (default is 'pkg').
56
- attr_accessor :package_dir
57
-
58
- # True if a gzipped tar file (tgz) should be produced (default is false).
59
- attr_accessor :need_tar
60
-
61
- # True if a gzipped tar file (tar.gz) should be produced (default is false).
62
- attr_accessor :need_tar_gz
63
-
64
- # True if a bzip2'd tar file (tar.bz2) should be produced (default is false).
65
- attr_accessor :need_tar_bz2
66
-
67
- # True if a zip file should be produced (default is false)
68
- attr_accessor :need_zip
69
-
70
- # List of files to be included in the package.
71
- attr_accessor :package_files
72
-
73
- # Tar command for gzipped or bzip2ed archives. The default is 'tar'.
74
- attr_accessor :tar_command
75
-
76
- # Zip command for zipped archives. The default is 'zip'.
77
- attr_accessor :zip_command
78
-
79
- # Create a Package Task with the given name and version.
80
- def initialize(name=nil, version=nil)
81
- init(name, version)
82
- yield self if block_given?
83
- define unless name.nil?
84
- end
85
-
86
- # Initialization that bypasses the "yield self" and "define" step.
87
- def init(name, version)
88
- @name = name
89
- @version = version
90
- @package_files = Rake::FileList.new
91
- @package_dir = 'pkg'
92
- @need_tar = false
93
- @need_tar_gz = false
94
- @need_tar_bz2 = false
95
- @need_zip = false
96
- @tar_command = 'tar'
97
- @zip_command = 'zip'
98
- end
99
-
100
- # Create the tasks defined by this task library.
101
- def define
102
- fail "Version required (or :noversion)" if @version.nil?
103
- @version = nil if :noversion == @version
104
-
105
- desc "Build all the packages"
106
- task :package
107
-
108
- desc "Force a rebuild of the package files"
109
- task 'package:force' => ['package:clean', :package]
110
-
111
- desc "Remove package products"
112
- task 'package:clean' do
113
- rm_r package_dir rescue nil
114
- end
115
-
116
- task :clean => ['package:clean']
117
-
118
- [
119
- [need_tar, tgz_file, "z"],
120
- [need_tar_gz, tar_gz_file, "z"],
121
- [need_tar_bz2, tar_bz2_file, "j"]
122
- ].each do |(need, file, flag)|
123
- if need
124
- task :package => ["#{package_dir}/#{file}"]
125
- file "#{package_dir}/#{file}" => [package_dir_path] + package_files do
126
- chdir(package_dir) do
127
- sh %{#{@tar_command} #{flag}cvf #{file} #{package_name}}
128
- end
129
- end
130
- end
131
- end
132
-
133
- if need_zip
134
- task :package => ["#{package_dir}/#{zip_file}"]
135
- file "#{package_dir}/#{zip_file}" => [package_dir_path] + package_files do
136
- chdir(package_dir) do
137
- sh %{#{@zip_command} -r #{zip_file} #{package_name}}
138
- end
139
- end
140
- end
141
-
142
- directory package_dir
143
-
144
- file package_dir_path => @package_files do
145
- mkdir_p package_dir rescue nil
146
- @package_files.each do |fn|
147
- f = File.join(package_dir_path, fn)
148
- fdir = File.dirname(f)
149
- mkdir_p(fdir) if !File.exist?(fdir)
150
- if File.directory?(fn)
151
- mkdir_p(f)
152
- else
153
- rm_f f
154
- safe_ln(fn, f)
155
- end
156
- end
157
- end
158
- self
159
- end
160
-
161
- def package_name
162
- @version ? "#{@name}-#{@version}" : @name
163
- end
164
-
165
- def package_dir_path
166
- "#{package_dir}/#{package_name}"
167
- end
168
-
169
- def tgz_file
170
- "#{package_name}.tgz"
171
- end
172
-
173
- def tar_gz_file
174
- "#{package_name}.tar.gz"
175
- end
176
-
177
- def tar_bz2_file
178
- "#{package_name}.tar.bz2"
179
- end
180
-
181
- def zip_file
182
- "#{package_name}.zip"
183
- end
184
- end
185
-
186
- end
@@ -1,83 +0,0 @@
1
- /*
2
- * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2010 Phusion
4
- *
5
- * "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in
15
- * all copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
- * THE SOFTWARE.
24
- */
25
- #ifndef _PASSENGER_STRING_LIST_CREATOR_H_
26
- #define _PASSENGER_STRING_LIST_CREATOR_H_
27
-
28
- #include <string>
29
- #include <vector>
30
- #include <boost/shared_ptr.hpp>
31
- #include "Utils.h"
32
- #include "Utils/Base64.h"
33
-
34
- namespace Passenger {
35
-
36
- using namespace std;
37
- using namespace boost;
38
-
39
- typedef vector<string> StringList;
40
- typedef shared_ptr<StringList> StringListPtr;
41
-
42
-
43
- class StringListCreator {
44
- public:
45
- virtual ~StringListCreator() {}
46
-
47
- /** May throw arbitrary exceptions. */
48
- virtual const StringListPtr getItems() const = 0;
49
- };
50
-
51
- typedef shared_ptr<StringListCreator> StringListCreatorPtr;
52
-
53
- class SimpleStringListCreator: public StringListCreator {
54
- public:
55
- StringListPtr items;
56
-
57
- SimpleStringListCreator() {
58
- items = ptr(new StringList());
59
- }
60
-
61
- SimpleStringListCreator(const StaticString &data) {
62
- items = ptr(new StringList());
63
- string buffer = Base64::decode(data);
64
- if (!buffer.empty()) {
65
- string::size_type start = 0, pos;
66
- const string &const_buffer(buffer);
67
- while ((pos = const_buffer.find('\0', start)) != string::npos) {
68
- items->push_back(const_buffer.substr(start, pos - start));
69
- start = pos + 1;
70
- }
71
- }
72
- }
73
-
74
- virtual const StringListPtr getItems() const {
75
- return items;
76
- }
77
- };
78
-
79
- typedef shared_ptr<SimpleStringListCreator> SimpleStringListCreatorPtr;
80
-
81
- } // namespace Passenger
82
-
83
- #endif /* _PASSENGER_STRING_LIST_CREATOR_H_ */
@@ -1,657 +0,0 @@
1
- # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010, 2011, 2012 Phusion
3
- #
4
- # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
-
24
- require 'rbconfig'
25
- require 'phusion_passenger'
26
- require 'phusion_passenger/packaging'
27
- require 'phusion_passenger/platform_info'
28
- require 'phusion_passenger/platform_info/apache'
29
- require 'phusion_passenger/platform_info/ruby'
30
- require 'phusion_passenger/platform_info/linux'
31
- require 'phusion_passenger/platform_info/curl'
32
-
33
- module PhusionPassenger
34
-
35
- # Represents a dependency software that Passenger requires. It's used by the
36
- # installer to check whether all dependencies are available. A Dependency object
37
- # contains full information about a dependency, such as its name, code for
38
- # detecting whether it is installed, and installation instructions for the
39
- # current platform.
40
- class Dependency # :nodoc: all
41
- [:name, :install_command, :install_instructions, :install_comments,
42
- :website, :website_comments, :provides].each do |attr_name|
43
- attr_writer attr_name
44
-
45
- define_method(attr_name) do
46
- call_init_block
47
- return instance_variable_get("@#{attr_name}")
48
- end
49
- end
50
-
51
- def initialize(&block)
52
- @included_by = []
53
- @init_block = block
54
- end
55
-
56
- def define_checker(&block)
57
- @checker = block
58
- end
59
-
60
- def check
61
- call_init_block
62
- result = Result.new
63
- @checker.call(result)
64
- return result
65
- end
66
-
67
- private
68
- class Result
69
- def found(*args)
70
- if args.empty?
71
- @found = true
72
- else
73
- @found = args.first
74
- end
75
- end
76
-
77
- def not_found
78
- found(false)
79
- end
80
-
81
- def found?
82
- return !@found.nil? && @found
83
- end
84
-
85
- def found_at
86
- if @found.is_a?(TrueClass) || @found.is_a?(FalseClass)
87
- return nil
88
- else
89
- return @found
90
- end
91
- end
92
- end
93
-
94
- def call_init_block
95
- if @init_block
96
- init_block = @init_block
97
- @init_block = nil
98
- init_block.call(self)
99
- end
100
- end
101
- end
102
-
103
- # Namespace which contains the different dependencies that Passenger may require.
104
- # See Dependency for more information.
105
- module Dependencies # :nodoc: all
106
- # Returns whether fastthread is a required dependency for the current
107
- # Ruby interpreter.
108
- def self.fastthread_required?
109
- return (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby") && RUBY_VERSION < "1.8.7"
110
- end
111
-
112
- # Returns whether Mizuho is required in order to be able to package all files
113
- # in the packaging list.
114
- def self.mizuho_required?
115
- return Packaging::ASCII_DOCS.any? do |fn|
116
- !File.exist?("#{PhusionPassenger.doc_dir}/#{fn}")
117
- end
118
- end
119
-
120
- GCC = Dependency.new do |dep|
121
- dep.name = "GNU C++ compiler"
122
- dep.define_checker do |result|
123
- gxx = PlatformInfo.find_command('g++')
124
- if gxx.nil?
125
- result.not_found
126
- else
127
- result.found(gxx)
128
- end
129
- end
130
- if RUBY_PLATFORM =~ /linux/
131
- tags = PlatformInfo.linux_distro_tags
132
- if tags.include?(:debian)
133
- dep.install_command = "apt-get install build-essential"
134
- elsif tags.include?(:mandriva)
135
- dep.install_command = "urpmi gcc-c++"
136
- elsif tags.include?(:redhat)
137
- dep.install_command = "yum install gcc-c++"
138
- elsif tags.include?(:gentoo)
139
- dep.install_command = "emerge -av gcc"
140
- end
141
- elsif RUBY_PLATFORM =~ /darwin/
142
- dep.install_instructions = "Please install the Apple Development Tools: http://developer.apple.com/tools/"
143
- end
144
- dep.website = "http://gcc.gnu.org/"
145
- end
146
-
147
- Make = Dependency.new do |dep|
148
- dep.name = "The 'make' tool"
149
- dep.define_checker do |result|
150
- make = PlatformInfo.find_command('make')
151
- if make
152
- result.found(make)
153
- else
154
- result.not_found
155
- end
156
- end
157
- if RUBY_PLATFORM =~ /linux/
158
- case PlatformInfo.linux_distro
159
- when :ubuntu, :debian
160
- dep.install_command = "apt-get install build-essential"
161
- when :rhel, :fedora, :centos
162
- dep.install_command = "yum install make"
163
- end
164
- elsif RUBY_PLATFORM =~ /darwin/
165
- dep.install_instructions = "Please install the Apple Development Tools: http://developer.apple.com/tools/"
166
- end
167
- dep.website = "http://www.gnu.org/software/make/"
168
- end
169
-
170
- GnuMake = Dependency.new do |dep|
171
- dep.name = "GNU make"
172
- dep.define_checker do |result|
173
- make = PlatformInfo.gnu_make
174
- if make
175
- result.found(make)
176
- else
177
- result.not_found
178
- end
179
- end
180
- if RUBY_PLATFORM =~ /linux/
181
- case PlatformInfo.linux_distro
182
- when :ubuntu, :debian
183
- dep.install_command = "apt-get install build-essential"
184
- when :rhel, :fedora, :centos
185
- dep.install_command = "yum install make"
186
- end
187
- elsif RUBY_PLATFORM =~ /darwin/
188
- dep.install_instructions = "Please install the Apple Development Tools: http://developer.apple.com/tools/"
189
- end
190
- dep.website = "http://www.gnu.org/software/make/"
191
- end
192
-
193
- DownloadTool = Dependency.new do |dep|
194
- dep.name = "A download tool like 'wget' or 'curl'"
195
- dep.define_checker do |result|
196
- tool = PlatformInfo.find_command('wget')
197
- if tool
198
- result.found(tool)
199
- else
200
- tool = PlatformInfo.find_command('curl')
201
- if tool
202
- result.found(tool)
203
- else
204
- result.not_found
205
- end
206
- end
207
- end
208
- if RUBY_PLATFORM =~ /linux/
209
- case PlatformInfo.linux_distro
210
- when :ubuntu, :debian
211
- dep.install_command = "apt-get install wget curl"
212
- when :rhel, :fedora, :centos
213
- dep.install_command = "yum install wget curl"
214
- end
215
- else
216
- dep.install_instructions = "Please install either wget (http://www.gnu.org/software/wget/) or curl (http://curl.haxx.se/)."
217
- end
218
- end
219
-
220
- Ruby_DevHeaders = Dependency.new do |dep|
221
- dep.name = "Ruby development headers"
222
- dep.define_checker do |result|
223
- require 'rbconfig'
224
- begin
225
- require 'mkmf'
226
- if defined?(::RbConfig)
227
- config = ::RbConfig::CONFIG
228
- else
229
- config = ::Config::CONFIG
230
- end
231
- header_dir = config['rubyhdrdir'] || config['archdir']
232
- result.found(File.exist?("#{header_dir}/ruby.h"))
233
- rescue LoadError, SystemExit
234
- # On RedHat/Fedora/CentOS, if ruby-devel is not installed then
235
- # mkmf.rb will print an error and call 'exit'. So here we
236
- # catch SystemExit.
237
- result.not_found
238
- end
239
- end
240
- if RUBY_PLATFORM =~ /linux/
241
- tags = PlatformInfo.linux_distro_tags
242
- if tags.include?(:debian)
243
- dep.install_command = "apt-get install ruby1.8-dev"
244
- elsif tags.include?(:mandriva)
245
- dep.install_command = "urpmi urpmi ruby-RubyGems"
246
- elsif tags.include?(:redhat)
247
- dep.install_command = "yum install ruby-devel"
248
- elsif tags.include?(:gentoo)
249
- dep.install_command = "emerge -av ruby"
250
- end
251
- elsif RUBY_PLATFORM =~ /freebsd/
252
- dep.install_command = "make -C /usr/ports/lang/ruby18 install"
253
- end
254
- dep.website = "http://www.ruby-lang.org/"
255
- dep.install_instructions = "Please reinstall Ruby by downloading it from <b>#{dep.website}</b>"
256
- end
257
-
258
- Ruby_OpenSSL = Dependency.new do |dep|
259
- dep.name = "OpenSSL support for Ruby"
260
- dep.define_checker do |result|
261
- begin
262
- require 'openssl'
263
- result.found
264
- rescue LoadError
265
- result.not_found
266
- end
267
- end
268
- if RUBY_PLATFORM =~ /linux/
269
- case PlatformInfo.linux_distro
270
- when :ubuntu, :debian
271
- dep.install_command = "apt-get install libopenssl-ruby"
272
- end
273
- end
274
- if dep.install_command.nil?
275
- dep.website = "http://www.ruby-lang.org/"
276
- dep.install_instructions = "Please (re)install Ruby with OpenSSL " <<
277
- "support by downloading it from <b>#{dep.website}</b>."
278
- end
279
- end
280
-
281
- RubyGems = Dependency.new do |dep|
282
- dep.name = "RubyGems"
283
- dep.define_checker do |result|
284
- begin
285
- require 'rubygems'
286
- result.found
287
- rescue LoadError
288
- result.not_found
289
- end
290
- end
291
- dep.website = "http://www.rubygems.org/"
292
- dep.install_instructions = "Please download it from <b>#{dep.website}</b>. " <<
293
- "Extract the tarball, and run <b>ruby setup.rb</b>"
294
- end
295
-
296
- Rake = Dependency.new do |dep|
297
- dep.name = "Rake"
298
- dep.define_checker do |result|
299
- if PlatformInfo.rake.nil?
300
- result.not_found
301
- else
302
- result.found(PlatformInfo.rake)
303
- end
304
- end
305
- dep.website = "http://rake.rubyforge.org/"
306
- dep.install_instructions = "Please install RubyGems first, then run <b>#{PlatformInfo.gem_command || "gem"} install rake</b>"
307
- end
308
-
309
- Apache2 = Dependency.new do |dep|
310
- dep.name = "Apache 2"
311
- dep.define_checker do |result|
312
- if PlatformInfo.httpd.nil?
313
- result.not_found
314
- else
315
- result.found(PlatformInfo.httpd)
316
- end
317
- end
318
- if RUBY_PLATFORM =~ /linux/
319
- tags = PlatformInfo.linux_distro_tags
320
- if tags.include?(:debian)
321
- dep.install_command = "apt-get install apache2-mpm-prefork"
322
- elsif tags.include?(:mandriva)
323
- dep.install_command = "urpmi apache"
324
- elsif tags.include?(:redhat)
325
- dep.install_command = "yum install httpd"
326
- elsif tags.include?(:gentoo)
327
- dep.install_command = "emerge -av apache"
328
- end
329
- elsif RUBY_PLATFORM =~ /freebsd/
330
- dep.install_command = "make -C /usr/ports/www/apache22 install"
331
- dep.provides = [Apache2_DevHeaders, APR_DevHeaders, APU_DevHeaders]
332
- end
333
- dep.website = "http://httpd.apache.org/"
334
- end
335
-
336
- Apache2_DevHeaders = Dependency.new do |dep|
337
- dep.name = "Apache 2 development headers"
338
- dep.define_checker do |result|
339
- if PlatformInfo.apxs2.nil?
340
- result.not_found
341
- else
342
- result.found(PlatformInfo.apxs2)
343
- end
344
- end
345
- if RUBY_PLATFORM =~ /linux/
346
- tags = PlatformInfo.linux_distro_tags
347
- if tags.include?(:debian)
348
- dep.install_command = "apt-get install apache2-prefork-dev"
349
- dep.provides = [Apache2]
350
- elsif tags.include?(:mandriva)
351
- dep.install_command = "urpmi apache-devel"
352
- dep.provides = [Apache2]
353
- elsif tags.include?(:redhat)
354
- dep.install_command = "yum install httpd-devel"
355
- dep.provides = [Apache2]
356
- elsif tags.include?(:gentoo)
357
- dep.install_command = "emerge -av apache"
358
- dep.provides = [Apache2]
359
- end
360
- elsif RUBY_PLATFORM =~ /freebsd/
361
- dep.install_command = "make -C /usr/ports/www/apache22 install"
362
- end
363
- dep.website = "http://httpd.apache.org/"
364
- end
365
-
366
- APR_DevHeaders = Dependency.new do |dep|
367
- dep.name = "Apache Portable Runtime (APR) development headers"
368
- dep.define_checker do |result|
369
- if PlatformInfo.apr_config.nil?
370
- result.not_found
371
- else
372
- result.found(PlatformInfo.apr_config)
373
- end
374
- end
375
- if RUBY_PLATFORM =~ /linux/
376
- tags = PlatformInfo.linux_distro_tags
377
- if tags.include?(:debian)
378
- dep.install_command = "apt-get install libapr1-dev"
379
- elsif tags.include?(:mandriva)
380
- dep.install_command = "urpmi libapr-devel"
381
- elsif tags.include?(:redhat)
382
- dep.install_command = "yum install apr-devel"
383
- elsif tags.include?(:gentoo)
384
- dep.install_command = "emerge -av apr"
385
- end
386
- elsif RUBY_PLATFORM =~ /darwin/
387
- dep.install_instructions = "Please install Apache from MacPorts, which will " <<
388
- "provide APR automatically. <b>Or</b>, if you're installing against MacOS X's " <<
389
- "default provided Apache, then please install the OS X Developer SDK."
390
- end
391
- dep.website = "http://httpd.apache.org/"
392
- dep.website_comments = "APR is an integrated part of Apache."
393
- end
394
-
395
- APU_DevHeaders = Dependency.new do |dep|
396
- dep.name = "Apache Portable Runtime Utility (APU) development headers"
397
- dep.define_checker do |result|
398
- if PlatformInfo.apu_config.nil?
399
- result.not_found
400
- else
401
- result.found(PlatformInfo.apu_config)
402
- end
403
- end
404
- if RUBY_PLATFORM =~ /linux/
405
- tags = PlatformInfo.linux_distro_tags
406
- if tags.include?(:debian)
407
- dep.install_command = "apt-get install libaprutil1-dev"
408
- elsif tags.include?(:mandriva)
409
- dep.install_command = "urpmi libapr-util-devel"
410
- elsif tags.include?(:redhat)
411
- dep.install_command = "yum install apr-util-devel"
412
- end
413
- elsif RUBY_PLATFORM =~ /darwin/
414
- dep.install_instructions = "Please install Apache from MacPorts, which will " <<
415
- "provide APU automatically. <b>Or</b>, if you're installing against MacOS X's " <<
416
- "default provided Apache, then please install the OS X Developer SDK."
417
- end
418
- dep.website = "http://httpd.apache.org/"
419
- dep.website_comments = "APR Utility is an integrated part of Apache."
420
- end
421
-
422
- FastThread = Dependency.new do |dep|
423
- dep.name = "fastthread"
424
- dep.define_checker do |result|
425
- begin
426
- begin
427
- require 'rubygems'
428
- rescue LoadError
429
- end
430
- require 'fastthread'
431
- result.found
432
- rescue LoadError
433
- result.not_found
434
- end
435
- end
436
- dep.install_instructions = "Please install RubyGems first, then run <b>#{PlatformInfo.gem_command || "gem"} install fastthread</b>"
437
- end
438
-
439
- Rack = Dependency.new do |dep|
440
- dep.name = "rack"
441
- dep.define_checker do |result|
442
- begin
443
- begin
444
- require 'rubygems'
445
- rescue LoadError
446
- end
447
- require 'rack'
448
- result.found
449
- rescue LoadError
450
- result.not_found
451
- end
452
- end
453
- dep.install_instructions = "Please install RubyGems first, then run <b>#{PlatformInfo.gem_command || "gem"} install rack</b>"
454
- end
455
-
456
- Curl_Dev = Dependency.new do |dep|
457
- dep.name = "Curl development headers with SSL support"
458
- dep.define_checker do |result|
459
- source_file = "#{PlatformInfo.tmpexedir}/passenger-curl-check.c"
460
- output_file = "#{PlatformInfo.tmpexedir}/passenger-curl-check"
461
- begin
462
- found = true
463
- File.open(source_file, 'w') do |f|
464
- f.puts("#include <curl/curl.h>")
465
- f.puts("int main() {")
466
- f.puts(" curl_global_init(CURL_GLOBAL_ALL);")
467
- f.puts(" return 0;")
468
- f.puts("}")
469
- end
470
- Dir.chdir(File.dirname(source_file)) do
471
- command = "(gcc #{ENV['CFLAGS']} " +
472
- "-o '#{output_file}' '#{source_file}' " +
473
- "#{PlatformInfo.curl_flags} #{PlatformInfo.curl_libs}) " +
474
- ">/dev/null 2>/dev/null"
475
- if !system(command)
476
- found = false
477
- end
478
- end
479
-
480
- if found && !PlatformInfo.curl_supports_ssl?
481
- dep.install_comments = "Curl was found, but it doesn't support SSL."
482
- found = false
483
- end
484
- result.found(found)
485
- ensure
486
- File.unlink(source_file) rescue nil
487
- File.unlink(output_file) rescue nil
488
- end
489
- end
490
- dep.install_instructions = "Please download Curl from <b>http://curl.haxx.se/libcurl</b> " +
491
- "and make sure you install it <b>with SSL support</b>."
492
- if RUBY_PLATFORM =~ /linux/
493
- tags = PlatformInfo.linux_distro_tags
494
- if tags.include?(:debian)
495
- dep.install_instructions = "Please run " +
496
- "<b>apt-get install libcurl4-openssl-dev</b> " +
497
- "or <b>libcurl4-gnutls-dev</b>, whichever you prefer."
498
- elsif tags.include?(:redhat)
499
- begin
500
- release = File.read("/etc/redhat-release")
501
- rescue
502
- release = nil
503
- end
504
- if release =~ /release 4/
505
- # http://code.google.com/p/phusion-passenger/issues/detail?id=554
506
- dep.install_command = "yum install zlib-devel e2fsprogs-devel krb5-devel libidn-devel"
507
- else
508
- dep.install_command = "yum install curl-devel"
509
- end
510
- end
511
- end
512
- end
513
-
514
- OpenSSL_Dev = Dependency.new do |dep|
515
- dep.name = "OpenSSL development headers"
516
- dep.define_checker do |result|
517
- source_file = "#{PlatformInfo.tmpexedir}/passenger-openssl-check.c"
518
- object_file = "#{PlatformInfo.tmpexedir}/passenger-openssl-check.o"
519
- begin
520
- File.open(source_file, 'w') do |f|
521
- f.write("#include <openssl/ssl.h>")
522
- end
523
- Dir.chdir(File.dirname(source_file)) do
524
- if system("(gcc #{ENV['CFLAGS']} -c '#{source_file}') >/dev/null 2>/dev/null")
525
- result.found
526
- else
527
- result.not_found
528
- end
529
- end
530
- ensure
531
- File.unlink(source_file) rescue nil
532
- File.unlink(object_file) rescue nil
533
- end
534
- end
535
- if RUBY_PLATFORM =~ /linux/
536
- tags = PlatformInfo.linux_distro_tags
537
- if tags.include?(:debian)
538
- dep.install_command = "apt-get install libssl-dev"
539
- elsif tags.include?(:redhat)
540
- dep.install_command = "yum install openssl-devel"
541
- end
542
- end
543
- dep.website = "http://www.openssl.org/"
544
- end
545
-
546
- Zlib_Dev = Dependency.new do |dep|
547
- dep.name = "Zlib development headers"
548
- dep.define_checker do |result|
549
- source_file = "#{PlatformInfo.tmpexedir}/zlib-check.c"
550
- object_file = "#{PlatformInfo.tmpexedir}/zlib-check.o"
551
- begin
552
- File.open(source_file, 'w') do |f|
553
- f.write("#include <zlib.h>")
554
- end
555
- Dir.chdir(File.dirname(source_file)) do
556
- if system("(g++ -c zlib-check.c) >/dev/null 2>/dev/null")
557
- result.found
558
- else
559
- result.not_found
560
- end
561
- end
562
- ensure
563
- File.unlink(source_file) rescue nil
564
- File.unlink(object_file) rescue nil
565
- end
566
- end
567
- if RUBY_PLATFORM =~ /linux/
568
- tags = PlatformInfo.linux_distro_tags
569
- if tags.include?(:debian)
570
- dep.install_command = "apt-get install zlib1g-dev"
571
- elsif tags.include?(:mandriva)
572
- dep.install_command = "urpmi zlib1-devel"
573
- elsif tags.include?(:redhat)
574
- dep.install_command = "yum install zlib-devel"
575
- end
576
- end
577
- dep.website = "http://www.zlib.net/"
578
- end
579
-
580
- PCRE_Dev = Dependency.new do |dep|
581
- dep.name = "PCRE development headers"
582
- dep.define_checker do |result|
583
- source_file = "#{PlatformInfo.tmpexedir}/pcre-check.c"
584
- object_file = "#{PlatformInfo.tmpexedir}/pcre-check.o"
585
- begin
586
- File.open(source_file, 'w') do |f|
587
- f.write("#include <pcre.h>")
588
- end
589
- Dir.chdir(File.dirname(source_file)) do
590
- if system("(g++ -c pcre-check.c) >/dev/null 2>/dev/null")
591
- result.found
592
- else
593
- result.not_found
594
- end
595
- end
596
- ensure
597
- File.unlink(source_file) rescue nil
598
- File.unlink(object_file) rescue nil
599
- end
600
- end
601
- if RUBY_PLATFORM =~ /linux/
602
- tags = PlatformInfo.linux_distro_tags
603
- if tags.include?(:debian)
604
- dep.install_command = "apt-get install libpcre3-dev"
605
- end
606
- end
607
- dep.website = "http://www.pcre.org/"
608
- end
609
-
610
- Daemon_Controller = Dependency.new do |dep|
611
- dep.name = "daemon_controller >= 1.1.0"
612
- dep.install_instructions = "Please install RubyGems first, then run " <<
613
- "<b>#{PlatformInfo.gem_command || "gem"} install daemon_controller</b>"
614
- dep.define_checker do |result|
615
- begin
616
- begin
617
- require 'rubygems'
618
- rescue LoadError
619
- end
620
- require 'daemon_controller'
621
- begin
622
- require 'daemon_controller/version'
623
- too_old = DaemonController::VERSION_STRING < '1.1.0'
624
- rescue LoadError
625
- too_old = true
626
- end
627
- if too_old
628
- result.not_found
629
- dep.install_instructions = "Your version of daemon_controller is too old. " <<
630
- "Please upgrade with the following commands:\n" <<
631
- " <b>#{PlatformInfo.gem_command || "gem"} uninstall FooBarWidget-daemon_controller</b>\n" <<
632
- " <b>#{PlatformInfo.gem_command || "gem"} install daemon_controller</b>"
633
- else
634
- result.found
635
- end
636
- rescue LoadError
637
- result.not_found
638
- end
639
- end
640
- end
641
-
642
- Mizuho = Dependency.new do |dep|
643
- dep.name = "Mizuho"
644
- dep.define_checker do |result|
645
- mizuho = PlatformInfo.find_command('mizuho')
646
- if mizuho.nil?
647
- result.not_found
648
- else
649
- result.found(mizuho)
650
- end
651
- end
652
- dep.website = "http://github.com/FooBarWidget/mizuho"
653
- dep.install_instructions = "Please install RubyGems first, then run <b>#{PlatformInfo.gem_command || "gem"} install mizuho</b>"
654
- end
655
- end
656
-
657
- end # module PhusionPassenger