passenger 4.0.33 → 4.0.34
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.
- checksums.yaml +15 -0
- checksums.yaml.gz.asc +12 -0
- data.tar.gz.asc +7 -7
- data/NEWS +60 -0
- data/bin/passenger-config +1 -1
- data/bin/passenger-install-apache2-module +510 -40
- data/bin/passenger-install-nginx-module +26 -2
- data/build/cxx_tests.rb +1 -1
- data/build/documentation.rb +19 -21
- data/build/integration_tests.rb +39 -12
- data/build/misc.rb +18 -0
- data/build/packaging.rb +116 -56
- data/build/rpm.rb +20 -11
- data/build/ruby_tests.rb +2 -3
- data/build/test_basics.rb +9 -0
- data/debian.template/passenger.conf +2 -0
- data/debian.template/passenger.load +2 -0
- data/dev/run_travis.sh +3 -5
- data/dev/test_rpm_packaging.sh +28 -0
- data/doc/Users guide Apache.idmap.txt +6 -4
- data/doc/users_guide_snippets/installation.txt +20 -2
- data/doc/users_guide_snippets/tips.txt +1 -1
- data/ext/common/ApplicationPool2/Pool.h +1 -1
- data/ext/common/Constants.h +5 -1
- data/ext/common/agents/HelperAgent/RequestHandler.h +1 -1
- data/ext/common/agents/Watchdog/AgentWatcher.cpp +20 -0
- data/ext/common/agents/Watchdog/Main.cpp +10 -0
- data/ext/ruby/passenger_native_support.c +23 -11
- data/helper-scripts/classic-rails-loader.rb +9 -3
- data/helper-scripts/classic-rails-preloader.rb +10 -4
- data/helper-scripts/download_binaries/extconf.rb +46 -22
- data/helper-scripts/meteor-loader.rb +0 -1
- data/helper-scripts/node-loader.js +2 -1
- data/helper-scripts/prespawn +7 -1
- data/helper-scripts/rack-loader.rb +32 -3
- data/helper-scripts/rack-preloader.rb +10 -4
- data/lib/phusion_passenger.rb +40 -21
- data/lib/phusion_passenger/abstract_installer.rb +7 -4
- data/lib/phusion_passenger/analytics_logger.rb +4 -3
- data/lib/phusion_passenger/config/about_command.rb +27 -6
- data/lib/phusion_passenger/{config.rb → config/main.rb} +3 -2
- data/lib/phusion_passenger/config/restart_app_command.rb +1 -1
- data/lib/phusion_passenger/config/validate_install_command.rb +231 -0
- data/lib/phusion_passenger/constants.rb +2 -0
- data/lib/phusion_passenger/loader_shared_helpers.rb +92 -19
- data/lib/phusion_passenger/native_support.rb +33 -11
- data/lib/phusion_passenger/packaging.rb +1 -0
- data/lib/phusion_passenger/platform_info.rb +5 -2
- data/lib/phusion_passenger/platform_info/apache.rb +229 -60
- data/lib/phusion_passenger/platform_info/apache_detector.rb +26 -31
- data/lib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +4 -4
- data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +4 -4
- data/lib/phusion_passenger/platform_info/depcheck_specs/libs.rb +1 -1
- data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +1 -1
- data/lib/phusion_passenger/platform_info/linux.rb +2 -1
- data/lib/phusion_passenger/platform_info/ruby.rb +7 -0
- data/lib/phusion_passenger/preloader_shared_helpers.rb +2 -1
- data/lib/phusion_passenger/request_handler.rb +2 -1
- data/lib/phusion_passenger/request_handler/thread_handler.rb +2 -1
- data/lib/phusion_passenger/standalone/runtime_installer.rb +35 -13
- data/lib/phusion_passenger/standalone/start_command.rb +2 -2
- data/lib/phusion_passenger/utils.rb +1 -23
- data/lib/phusion_passenger/utils/ansi_colors.rb +7 -1
- data/lib/phusion_passenger/utils/download.rb +36 -2
- data/lib/phusion_passenger/utils/native_support_utils.rb +65 -0
- data/resources/templates/apache2/apache_install_broken.txt.erb +20 -0
- data/resources/templates/apache2/config_snippets.txt.erb +2 -4
- data/resources/templates/apache2/present_choice_for_no_update_config.txt.erb +5 -0
- data/resources/templates/installer_common/cannot_access_files_as_root.txt.erb +15 -0
- data/resources/templates/installer_common/run_installer_as_root.txt.erb +6 -3
- data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +1 -1
- data/resources/templates/nginx/other_nginx_installations_exist.txt.erb +17 -0
- data/rpm/apache-passenger.conf.in +26 -0
- data/rpm/config.json +30 -0
- data/rpm/passenger.logrotate +7 -0
- data/rpm/passenger.spec.template +456 -0
- data/rpm/passenger_dynamic_thread_group.patch +16 -0
- data/rpm/passenger_tests_default_config_example.patch +44 -0
- data/rpm/rubygem-passenger-4.0.18-GLIBC_HAVE_LONG_LONG.patch +21 -0
- data/rpm/rubygem-passenger-4.0.18-gcc47-include-sys_types.patch +45 -0
- data/test/config.json.rpm-automation +15 -0
- data/test/integration_tests/downloaded_binaries_tests.rb +80 -2
- data/test/integration_tests/native_packaging_spec.rb +136 -44
- data/test/integration_tests/standalone_tests.rb +2 -11
- data/test/ruby/analytics_logger_spec.rb +65 -19
- data/test/ruby/utils_spec.rb +2 -0
- metadata +532 -548
- metadata.gz.asc +7 -7
- data/resources/templates/apache2/no_write_permission_to_passenger_root.txt.erb +0 -9
- data/rpm/README.rdoc +0 -117
- data/rpm/config/apache-passenger.conf.in +0 -19
- data/rpm/config/nginx-passenger.conf.in +0 -10
- data/rpm/config/rubygem-passenger.te +0 -10
- data/rpm/doc/README.nginx-alternatives +0 -5
- data/rpm/doc/example_yum_repository_htaccess +0 -5
- data/rpm/doc/footer.shtml +0 -12
- data/rpm/doc/header.shtml +0 -156
- data/rpm/nginx-alternatives.spec +0 -97
- data/rpm/passenger-release.spec +0 -91
- data/rpm/passenger.spec +0 -667
- data/rpm/patches/passenger-force-native.patch +0 -63
- data/rpm/release/RPM-GPG-KEY-stealthymonkeys +0 -33
- data/rpm/release/build-release.sh +0 -35
- data/rpm/release/build.rb +0 -301
- data/rpm/release/create-mirrors.sh +0 -16
- data/rpm/release/mirrors +0 -1
- data/rpm/release/mock-repo/comps.xml +0 -21
- data/rpm/release/mock-repo/rubygem-daemon_controller-0.2.5-1.noarch.rpm +0 -0
- data/rpm/release/mock-repo/rubygem-file-tail-1.0.5-1.noarch.rpm +0 -0
- data/rpm/release/mock-repo/rubygem-spruz-0.2.2-1.noarch.rpm +0 -0
- data/rpm/release/mocksetup-first.sh +0 -102
- data/rpm/release/mocksetup.sh +0 -67
@@ -36,6 +36,9 @@ module PlatformInfo
|
|
36
36
|
# many people have multiple Apache installations on their system, but they
|
37
37
|
# don't know about that, or they don't know how to compile against the
|
38
38
|
# correct Apache installation. This tool helps them.
|
39
|
+
#
|
40
|
+
# If you use this class to log things to the terminal, then be sure to set
|
41
|
+
# the terminal color to Utils::AnsiColors::DEFAULT_TERMINAL_COLOR.
|
39
42
|
class ApacheDetector
|
40
43
|
class Result
|
41
44
|
# These are required and are never nil.
|
@@ -56,9 +59,9 @@ class ApacheDetector
|
|
56
59
|
log " Main executable: #{httpd}"
|
57
60
|
log " Control command: #{ctl}"
|
58
61
|
log " Config file : #{config_file}"
|
59
|
-
log " Error log file : #{error_log}"
|
62
|
+
log " Error log file : #{error_log || 'unknown'}"
|
60
63
|
log ""
|
61
|
-
log " To install
|
64
|
+
log " To install #{PROGRAM_NAME} against this specific Apache version:"
|
62
65
|
log " #{PlatformInfo.ruby_command} #{PhusionPassenger.bin_dir}/passenger-install-apache2-module --apxs2-path='#{apxs2}'"
|
63
66
|
log ""
|
64
67
|
log " To start, stop or restart this specific Apache version:"
|
@@ -66,9 +69,11 @@ class ApacheDetector
|
|
66
69
|
log " #{ctl} stop"
|
67
70
|
log " #{ctl} restart"
|
68
71
|
log ""
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
+
if error_log
|
73
|
+
log " To troubleshoot, please read the logs in this file:"
|
74
|
+
log " #{error_log}"
|
75
|
+
log ""
|
76
|
+
end
|
72
77
|
end
|
73
78
|
|
74
79
|
private
|
@@ -85,9 +90,9 @@ class ApacheDetector
|
|
85
90
|
PlatformInfo.verbose = true
|
86
91
|
PlatformInfo.log_implementation = lambda do |message|
|
87
92
|
if message =~ /: found$/
|
88
|
-
log("<green>
|
93
|
+
log("<green> --> #{message}</green>")
|
89
94
|
else
|
90
|
-
log("
|
95
|
+
log(" --> #{message}")
|
91
96
|
end
|
92
97
|
end
|
93
98
|
end
|
@@ -115,10 +120,11 @@ class ApacheDetector
|
|
115
120
|
log "Detecting main Apache executable..."
|
116
121
|
result.httpd = PlatformInfo.httpd(:apxs2 => apxs2)
|
117
122
|
if result.httpd
|
123
|
+
log "Detecting version..."
|
118
124
|
if result.version = PlatformInfo.httpd_version(:httpd => result.httpd)
|
119
|
-
log "
|
125
|
+
log " --> #{result.version}"
|
120
126
|
else
|
121
|
-
log "<red>Cannot detect version!</red>"
|
127
|
+
log "<red> --> Cannot detect version!</red>"
|
122
128
|
result.httpd = nil
|
123
129
|
end
|
124
130
|
end
|
@@ -128,31 +134,28 @@ class ApacheDetector
|
|
128
134
|
result.httpd = nil if !result.ctl
|
129
135
|
end
|
130
136
|
if result.httpd
|
137
|
+
log "Detecting configuration file location..."
|
131
138
|
result.config_file = PlatformInfo.httpd_default_config_file(:httpd => result.httpd)
|
132
139
|
if result.config_file
|
133
|
-
log "
|
140
|
+
log " --> #{result.config_file}"
|
134
141
|
else
|
135
|
-
log "<red>Cannot detect default config file location!</red>"
|
142
|
+
log "<red> --> Cannot detect default config file location!</red>"
|
136
143
|
result.httpd = nil
|
137
144
|
end
|
138
145
|
end
|
139
146
|
if result.httpd
|
147
|
+
log "Detecting error log file..."
|
140
148
|
result.error_log = PlatformInfo.httpd_actual_error_log(:httpd => result.httpd)
|
141
149
|
if result.error_log
|
142
|
-
log "
|
150
|
+
log " --> #{result.error_log}"
|
143
151
|
else
|
144
|
-
log "<red>Cannot detect error log file!</red>"
|
145
|
-
result.httpd = nil
|
152
|
+
log "<red> --> Cannot detect error log file!</red>"
|
146
153
|
end
|
147
154
|
end
|
148
155
|
if result.httpd
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
log "Detecting a2enmod and a2dismod..."
|
153
|
-
result.a2enmod = PlatformInfo.a2enmod(:apxs2 => apxs2)
|
154
|
-
result.a2dismod = PlatformInfo.a2dismod(:apxs2 => apxs2)
|
155
|
-
end
|
156
|
+
log "Detecting a2enmod and a2dismod..."
|
157
|
+
result.a2enmod = PlatformInfo.a2enmod(:apxs2 => apxs2)
|
158
|
+
result.a2dismod = PlatformInfo.a2dismod(:apxs2 => apxs2)
|
156
159
|
end
|
157
160
|
if result.httpd
|
158
161
|
log "<green>Found a usable Apache installation using #{apxs2}.</green>"
|
@@ -178,19 +181,11 @@ class ApacheDetector
|
|
178
181
|
log " <b>#{PhusionPassenger.bin_dir}/passenger-install-apache2-module</b>"
|
179
182
|
log ""
|
180
183
|
log "If you are sure that you have Apache installed, please read the documentation:"
|
181
|
-
log "
|
182
|
-
log " section 'Installation' -> 'Customizing the compilation process' ->"
|
183
|
-
log " 'Forcing location of command line tools and dependencies'"
|
184
|
-
log " * Or visit the online version:"
|
185
|
-
log " <b>#{APACHE2_DOC_URL}#_forcing_location_of_command_line_tools_and_dependencies</b>"
|
184
|
+
log "<b>#{APACHE2_DOC_URL}#forcing_location_of_command_line_tools_and_dependencies</b>"
|
186
185
|
elsif @results.size > 1
|
187
186
|
log "<yellow>WARNING: You have multiple Apache installations on your system!</yellow>"
|
188
187
|
log "You are strongly recommended to read this section of the documentation:"
|
189
|
-
log "
|
190
|
-
log " section 'Installation' -> 'Customizing the compilation process' ->"
|
191
|
-
log " 'Forcing location of command line tools and dependencies'"
|
192
|
-
log " * Or visit the online version:"
|
193
|
-
log " <b>#{APACHE2_DOC_URL}#_forcing_location_of_command_line_tools_and_dependencies</b>"
|
188
|
+
log "<b>#{APACHE2_DOC_URL}#multiple_apache_installs</b>"
|
194
189
|
end
|
195
190
|
end
|
196
191
|
|
@@ -2,7 +2,7 @@ define 'apache2' do
|
|
2
2
|
name 'Apache 2'
|
3
3
|
website 'http://httpd.apache.org/'
|
4
4
|
define_checker do
|
5
|
-
|
5
|
+
PhusionPassenger.require_passenger_lib 'platform_info/apache'
|
6
6
|
if check_for_command(PlatformInfo.httpd)
|
7
7
|
{
|
8
8
|
:found => true,
|
@@ -32,7 +32,7 @@ define 'apache2-dev' do
|
|
32
32
|
name "Apache 2 development headers"
|
33
33
|
website "http://httpd.apache.org/"
|
34
34
|
define_checker do
|
35
|
-
|
35
|
+
PhusionPassenger.require_passenger_lib 'platform_info/apache'
|
36
36
|
if PlatformInfo.apxs2
|
37
37
|
{
|
38
38
|
:found => true,
|
@@ -64,7 +64,7 @@ define 'apr-dev' do
|
|
64
64
|
name "Apache Portable Runtime (APR) development headers"
|
65
65
|
website "http://httpd.apache.org/"
|
66
66
|
define_checker do
|
67
|
-
|
67
|
+
PhusionPassenger.require_passenger_lib 'platform_info/apache'
|
68
68
|
if PlatformInfo.apr_config
|
69
69
|
{
|
70
70
|
:found => true,
|
@@ -97,7 +97,7 @@ define 'apu-dev' do
|
|
97
97
|
name "Apache Portable Runtime Utility (APU) development headers"
|
98
98
|
website "http://httpd.apache.org/"
|
99
99
|
define_checker do
|
100
|
-
|
100
|
+
PhusionPassenger.require_passenger_lib 'platform_info/apache'
|
101
101
|
if PlatformInfo.apu_config
|
102
102
|
{
|
103
103
|
:found => true,
|
@@ -2,7 +2,7 @@ define 'cc' do
|
|
2
2
|
name "C compiler"
|
3
3
|
website "http://gcc.gnu.org/"
|
4
4
|
define_checker do
|
5
|
-
|
5
|
+
PhusionPassenger.require_passenger_lib 'platform_info/compiler'
|
6
6
|
check_for_command(PlatformInfo.cc, false)
|
7
7
|
end
|
8
8
|
|
@@ -27,7 +27,7 @@ define 'c++' do
|
|
27
27
|
name "C++ compiler"
|
28
28
|
website "http://gcc.gnu.org/"
|
29
29
|
define_checker do
|
30
|
-
|
30
|
+
PhusionPassenger.require_passenger_lib 'platform_info/compiler'
|
31
31
|
check_for_command(PlatformInfo.cxx, false)
|
32
32
|
end
|
33
33
|
|
@@ -51,7 +51,7 @@ end
|
|
51
51
|
define 'make' do
|
52
52
|
name "The 'make' tool"
|
53
53
|
define_checker do
|
54
|
-
|
54
|
+
PhusionPassenger.require_passenger_lib 'platform_info/compiler'
|
55
55
|
check_for_command(PlatformInfo.make)
|
56
56
|
end
|
57
57
|
|
@@ -75,7 +75,7 @@ end
|
|
75
75
|
define 'gmake' do
|
76
76
|
name "GNU make"
|
77
77
|
define_checker do
|
78
|
-
|
78
|
+
PhusionPassenger.require_passenger_lib 'platform_info/compiler'
|
79
79
|
check_for_command(PlatformInfo.gnu_make)
|
80
80
|
end
|
81
81
|
|
@@ -17,7 +17,7 @@ define 'libcurl-dev' do
|
|
17
17
|
name "Curl development headers with SSL support"
|
18
18
|
website "http://curl.haxx.se/libcurl"
|
19
19
|
define_checker do
|
20
|
-
|
20
|
+
PhusionPassenger.require_passenger_lib 'platform_info/curl'
|
21
21
|
result = { :found => false }
|
22
22
|
|
23
23
|
if !(curl_config = PlatformInfo.find_command('curl-config'))
|
@@ -112,7 +112,7 @@ define 'rake' do
|
|
112
112
|
name "Rake (associated with #{ruby_command})"
|
113
113
|
website "http://rake.rubyforge.org/"
|
114
114
|
define_checker do
|
115
|
-
|
115
|
+
PhusionPassenger.require_passenger_lib 'platform_info/ruby'
|
116
116
|
if result = PlatformInfo.rake_command
|
117
117
|
{ :found => true,
|
118
118
|
"Location" => result }
|
@@ -48,7 +48,14 @@ module PlatformInfo
|
|
48
48
|
# In case of RVM this function will return the path to the RVM wrapper script
|
49
49
|
# that executes the current Ruby interpreter in the currently active gem set.
|
50
50
|
def self.ruby_command
|
51
|
+
# Detect usage of gem-wrappers: https://github.com/rvm/gem-wrappers
|
52
|
+
# This is currently used by RVM >= 1.25, although it's not exclusive to RVM.
|
53
|
+
if GEM_HOME && File.exist?("#{GEM_HOME}/wrappers/ruby")
|
54
|
+
return "#{GEM_HOME}/wrappers/ruby"
|
55
|
+
end
|
56
|
+
|
51
57
|
if in_rvm?
|
58
|
+
# Detect old-school RVM wrapper script location.
|
52
59
|
name = rvm_ruby_string
|
53
60
|
dirs = rvm_paths
|
54
61
|
if name && dirs
|
@@ -31,7 +31,7 @@ module PhusionPassenger
|
|
31
31
|
module PreloaderSharedHelpers
|
32
32
|
extend self
|
33
33
|
|
34
|
-
def init
|
34
|
+
def init(options)
|
35
35
|
if !Kernel.respond_to?(:fork)
|
36
36
|
message = "Smart spawning is not available on this Ruby " +
|
37
37
|
"implementation because it does not support `Kernel.fork`. "
|
@@ -42,6 +42,7 @@ module PreloaderSharedHelpers
|
|
42
42
|
end
|
43
43
|
raise(message)
|
44
44
|
end
|
45
|
+
return options
|
45
46
|
end
|
46
47
|
|
47
48
|
def accept_and_process_next_client(server_socket)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: binary
|
2
2
|
# Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
# Copyright (c) 2010-
|
3
|
+
# Copyright (c) 2010-2014 Phusion
|
4
4
|
#
|
5
5
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
#
|
@@ -28,6 +28,7 @@ PhusionPassenger.require_passenger_lib 'constants'
|
|
28
28
|
PhusionPassenger.require_passenger_lib 'public_api'
|
29
29
|
PhusionPassenger.require_passenger_lib 'message_client'
|
30
30
|
PhusionPassenger.require_passenger_lib 'debug_logging'
|
31
|
+
PhusionPassenger.require_passenger_lib 'native_support'
|
31
32
|
PhusionPassenger.require_passenger_lib 'utils'
|
32
33
|
PhusionPassenger.require_passenger_lib 'utils/tmpdir'
|
33
34
|
PhusionPassenger.require_passenger_lib 'ruby_core_enhancements'
|
@@ -25,6 +25,7 @@ PhusionPassenger.require_passenger_lib 'constants'
|
|
25
25
|
PhusionPassenger.require_passenger_lib 'debug_logging'
|
26
26
|
PhusionPassenger.require_passenger_lib 'message_channel'
|
27
27
|
PhusionPassenger.require_passenger_lib 'utils'
|
28
|
+
PhusionPassenger.require_passenger_lib 'utils/native_support_utils'
|
28
29
|
PhusionPassenger.require_passenger_lib 'utils/unseekable_socket'
|
29
30
|
|
30
31
|
module PhusionPassenger
|
@@ -192,7 +193,7 @@ private
|
|
192
193
|
if headers_data.nil?
|
193
194
|
return
|
194
195
|
end
|
195
|
-
headers = Utils.split_by_null_into_hash(headers_data)
|
196
|
+
headers = Utils::NativeSupportUtils.split_by_null_into_hash(headers_data)
|
196
197
|
if @connect_password && headers[PASSENGER_CONNECT_PASSWORD] != @connect_password
|
197
198
|
warn "*** Passenger RequestHandler warning: " <<
|
198
199
|
"someone tried to connect with an invalid connect password."
|
@@ -136,7 +136,7 @@ protected
|
|
136
136
|
@working_dir = PhusionPassenger::Utils.mktmpdir("passenger.", PlatformInfo.tmpexedir)
|
137
137
|
@nginx_version ||= PREFERRED_NGINX_VERSION
|
138
138
|
@download_binaries = true if !defined?(@download_binaries)
|
139
|
-
@binaries_url_root ||=
|
139
|
+
@binaries_url_root ||= PhusionPassenger.binaries_sites
|
140
140
|
end
|
141
141
|
|
142
142
|
def after_install
|
@@ -233,9 +233,8 @@ private
|
|
233
233
|
|
234
234
|
puts " --> Downloading #{PROGRAM_NAME} support binaries for your platform"
|
235
235
|
basename = "support-#{PlatformInfo.cxx_binary_compatibility_id}.tar.gz"
|
236
|
-
url = "#{@binaries_url_root}/#{PhusionPassenger::VERSION_STRING}/#{basename}"
|
237
236
|
tarball = "#{@working_dir}/#{basename}"
|
238
|
-
if !
|
237
|
+
if !download_support_file(basename, tarball)
|
239
238
|
puts " No binaries are available for your platform. Will compile them from source"
|
240
239
|
return false
|
241
240
|
end
|
@@ -278,16 +277,8 @@ private
|
|
278
277
|
|
279
278
|
puts " --> Downloading web helper for your platform"
|
280
279
|
basename = "webhelper-#{@nginx_version}-#{PlatformInfo.cxx_binary_compatibility_id}.tar.gz"
|
281
|
-
url = "#{@binaries_url_root}/#{PhusionPassenger::VERSION_STRING}/#{basename}"
|
282
280
|
tarball = "#{@working_dir}/#{basename}"
|
283
|
-
|
284
|
-
logger.level = Logger::WARN
|
285
|
-
logger.formatter = proc { |severity, datetime, progname, msg| " #{msg}\n" }
|
286
|
-
result = download(url, tarball,
|
287
|
-
:cacert => PhusionPassenger.binaries_ca_cert_path,
|
288
|
-
:use_cache => true,
|
289
|
-
:logger => logger)
|
290
|
-
if !result
|
281
|
+
if !download_support_file(basename, tarball)
|
291
282
|
puts " No binary is available for your platform. Will compile it from source."
|
292
283
|
return false
|
293
284
|
end
|
@@ -378,7 +369,7 @@ private
|
|
378
369
|
def compile_support_binaries
|
379
370
|
begin_progress_bar
|
380
371
|
show_progress(0, 1, 1, 1, "Preparing #{PROGRAM_NAME}...")
|
381
|
-
Dir.chdir(PhusionPassenger.
|
372
|
+
Dir.chdir(PhusionPassenger.build_system_dir) do
|
382
373
|
args = "nginx_without_native_support" +
|
383
374
|
" CACHING=false" +
|
384
375
|
" OUTPUT_DIR='#{@support_dir}'"
|
@@ -542,6 +533,37 @@ private
|
|
542
533
|
end
|
543
534
|
return true
|
544
535
|
end
|
536
|
+
|
537
|
+
def download_support_file(name, output)
|
538
|
+
logger = Logger.new(STDOUT)
|
539
|
+
logger.level = Logger::WARN
|
540
|
+
logger.formatter = proc do |severity, datetime, progname, msg|
|
541
|
+
msg.gsub(/^/, " ") + "\n"
|
542
|
+
end
|
543
|
+
|
544
|
+
if @binaries_url_root.is_a?(String)
|
545
|
+
sites = [{ :url => @binaries_url_root }]
|
546
|
+
else
|
547
|
+
sites = @binaries_url_root
|
548
|
+
end
|
549
|
+
sites.each_with_index do |site, i|
|
550
|
+
if real_download_support_file(site, name, output, logger)
|
551
|
+
logger.warn "Download OK!" if i > 0
|
552
|
+
return true
|
553
|
+
elsif i != sites.size - 1
|
554
|
+
logger.warn "Trying next mirror..."
|
555
|
+
end
|
556
|
+
end
|
557
|
+
return false
|
558
|
+
end
|
559
|
+
|
560
|
+
def real_download_support_file(site, name, output, logger)
|
561
|
+
url = "#{site[:url]}/#{VERSION_STRING}/#{name}"
|
562
|
+
return download(url, output,
|
563
|
+
:cacert => site[:cacert],
|
564
|
+
:logger => logger,
|
565
|
+
:use_cache => true)
|
566
|
+
end
|
545
567
|
|
546
568
|
def run_command_with_throbber(command, status_text)
|
547
569
|
backlog = ""
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Phusion Passenger - https://www.phusionpassenger.com/
|
2
|
-
# Copyright (c) 2010-
|
2
|
+
# Copyright (c) 2010-2014 Phusion
|
3
3
|
#
|
4
4
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
5
5
|
#
|
@@ -467,7 +467,7 @@ private
|
|
467
467
|
def ensure_runtime_installed
|
468
468
|
if @runtime_locator.everything_installed?
|
469
469
|
if !File.exist?(@runtime_locator.find_nginx_binary)
|
470
|
-
error "The
|
470
|
+
error "The web helper binary '#{@runtime_locator.find_nginx_binary}' does not exist."
|
471
471
|
exit 1
|
472
472
|
end
|
473
473
|
else
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: binary
|
2
2
|
# Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
# Copyright (c) 2010
|
3
|
+
# Copyright (c) 2010-2014 Phusion
|
4
4
|
#
|
5
5
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
6
6
|
#
|
@@ -22,12 +22,6 @@
|
|
22
22
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
23
|
# THE SOFTWARE.
|
24
24
|
|
25
|
-
begin
|
26
|
-
require 'rubygems'
|
27
|
-
rescue LoadError
|
28
|
-
end
|
29
|
-
PhusionPassenger.require_passenger_lib 'native_support'
|
30
|
-
|
31
25
|
module PhusionPassenger
|
32
26
|
|
33
27
|
# Utility functions.
|
@@ -181,22 +175,6 @@ module Utils
|
|
181
175
|
return output
|
182
176
|
end
|
183
177
|
|
184
|
-
if defined?(PhusionPassenger::NativeSupport)
|
185
|
-
# Split the given string into an hash. Keys and values are obtained by splitting the
|
186
|
-
# string using the null character as the delimitor.
|
187
|
-
def split_by_null_into_hash(data)
|
188
|
-
return PhusionPassenger::NativeSupport.split_by_null_into_hash(data)
|
189
|
-
end
|
190
|
-
else
|
191
|
-
NULL = "\0".freeze
|
192
|
-
|
193
|
-
def split_by_null_into_hash(data)
|
194
|
-
args = data.split(NULL, -1)
|
195
|
-
args.pop
|
196
|
-
return Hash[*args]
|
197
|
-
end
|
198
|
-
end
|
199
|
-
|
200
178
|
####################################
|
201
179
|
end
|
202
180
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Phusion Passenger - https://www.phusionpassenger.com/
|
2
|
-
# Copyright (c) 2010 Phusion
|
2
|
+
# Copyright (c) 2010-2014 Phusion
|
3
3
|
#
|
4
4
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
5
5
|
#
|
@@ -27,7 +27,9 @@ module Utils
|
|
27
27
|
module AnsiColors
|
28
28
|
RESET = "\e[0m".freeze
|
29
29
|
BOLD = "\e[1m".freeze
|
30
|
+
DGRAY = "\e[90m".freeze
|
30
31
|
RED = "\e[31m".freeze
|
32
|
+
ORANGE = "\e[38;5;214m".freeze
|
31
33
|
GREEN = "\e[32m".freeze
|
32
34
|
YELLOW = "\e[33m".freeze
|
33
35
|
WHITE = "\e[37m".freeze
|
@@ -47,7 +49,9 @@ module AnsiColors
|
|
47
49
|
|
48
50
|
def ansi_colorize(text)
|
49
51
|
text = text.gsub(%r{<b>(.*?)</b>}m, "#{BOLD}\\1#{DEFAULT_TERMINAL_COLOR}")
|
52
|
+
text.gsub!(%r{<dgray>(.*?)</dgray>}m, "#{BOLD}#{DGRAY}\\1#{DEFAULT_TERMINAL_COLOR}")
|
50
53
|
text.gsub!(%r{<red>(.*?)</red>}m, "#{BOLD}#{RED}\\1#{DEFAULT_TERMINAL_COLOR}")
|
54
|
+
text.gsub!(%r{<orange>(.*?)</orange>}m, "#{BOLD}#{ORANGE}\\1#{DEFAULT_TERMINAL_COLOR}")
|
51
55
|
text.gsub!(%r{<green>(.*?)</green>}m, "#{BOLD}#{GREEN}\\1#{DEFAULT_TERMINAL_COLOR}")
|
52
56
|
text.gsub!(%r{<yellow>(.*?)</yellow>}m, "#{BOLD}#{YELLOW}\\1#{DEFAULT_TERMINAL_COLOR}")
|
53
57
|
text.gsub!(%r{<banner>(.*?)</banner>}m, "#{BOLD}#{BLUE_BG}#{YELLOW}\\1#{DEFAULT_TERMINAL_COLOR}")
|
@@ -56,7 +60,9 @@ module AnsiColors
|
|
56
60
|
|
57
61
|
def strip_color_tags(text)
|
58
62
|
text = text.gsub(%r{<b>(.*?)</b>}m, "\\1")
|
63
|
+
text = text.gsub(%r{<dgray>(.*?)</dgray>}m, "\\1")
|
59
64
|
text.gsub!(%r{<red>(.*?)</red>}m, "\\1")
|
65
|
+
text.gsub!(%r{<orange>(.*?)</orange>}m, "\\1")
|
60
66
|
text.gsub!(%r{<green>(.*?)</green>}m, "\\1")
|
61
67
|
text.gsub!(%r{<yellow>(.*?)</yellow>}m, "\\1")
|
62
68
|
text.gsub!(%r{<banner>(.*?)</banner>}m, "\\1")
|