passenger 4.0.30 → 4.0.31
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.
- data.tar.gz.asc +7 -7
- data/NEWS +31 -0
- data/bin/passenger +5 -5
- data/bin/passenger-config +6 -126
- data/bin/passenger-install-apache2-module +108 -26
- data/bin/passenger-install-nginx-module +81 -27
- data/bin/passenger-memory-stats +7 -6
- data/bin/passenger-status +13 -10
- data/build/agents.rb +8 -12
- data/build/apache2.rb +12 -7
- data/build/basics.rb +28 -20
- data/build/common_library.rb +4 -4
- data/build/cplusplus_support.rb +4 -4
- data/build/cxx_tests.rb +5 -3
- data/build/debian.rb +1 -2
- data/build/integration_tests.rb +25 -9
- data/build/misc.rb +2 -2
- data/build/oxt_tests.rb +5 -6
- data/build/packaging.rb +72 -40
- data/build/ruby_tests.rb +5 -1
- data/build/test_basics.rb +1 -2
- data/debian.template/locations.ini.template +1 -0
- data/debian.template/rules.template +2 -1
- data/dev/install_scripts_bootstrap_code.rb +42 -0
- data/dev/run_travis.sh +1 -0
- data/dev/runner +27 -0
- data/doc/Packaging.txt.md +5 -10
- data/doc/Users guide Apache.idmap.txt +3 -1
- data/doc/Users guide Apache.txt +5 -3
- data/doc/Users guide Nginx.idmap.txt +9 -5
- data/doc/Users guide Nginx.txt +47 -17
- data/doc/users_guide_snippets/environment_variables.txt +2 -2
- data/doc/users_guide_snippets/installation.txt +6 -2
- data/doc/users_guide_snippets/tips.txt +4 -0
- data/ext/apache2/Hooks.cpp +16 -3
- data/ext/common/Account.h +6 -5
- data/ext/common/AgentsStarter.h +1 -1
- data/ext/common/ApplicationPool2/Common.h +72 -0
- data/ext/common/ApplicationPool2/Group.h +263 -148
- data/ext/common/ApplicationPool2/Implementation.cpp +66 -44
- data/ext/common/ApplicationPool2/Options.h +1 -7
- data/ext/common/ApplicationPool2/Pool.h +96 -72
- data/ext/common/ApplicationPool2/Process.h +12 -17
- data/ext/common/ApplicationPool2/Socket.h +4 -4
- data/ext/common/ApplicationPool2/SuperGroup.h +20 -17
- data/ext/common/Constants.h +15 -1
- data/ext/common/MessageServer.h +22 -0
- data/ext/common/Utils.cpp +4 -1
- data/ext/common/Utils.h +3 -1
- data/ext/common/Utils/StrIntUtils.h +1 -0
- data/ext/common/Utils/Timer.h +15 -1
- data/ext/common/Utils/utf8/checked.h +0 -0
- data/ext/common/Utils/utf8/core.h +0 -0
- data/ext/common/Utils/utf8/unchecked.h +0 -0
- data/ext/common/agents/Base.cpp +59 -35
- data/ext/common/agents/HelperAgent/Main.cpp +23 -12
- data/ext/common/agents/HelperAgent/RequestHandler.h +10 -1
- data/ext/common/agents/LoggingAgent/FilterSupport.h +9 -5
- data/ext/common/agents/TempDirToucher.c +12 -3
- data/ext/common/agents/Watchdog/Main.cpp +8 -2
- data/ext/nginx/ConfigurationCommands.c +10 -0
- data/ext/nginx/ConfigurationFields.h +2 -0
- data/ext/nginx/ContentHandler.c +32 -19
- data/ext/nginx/CreateLocationConfig.c +5 -0
- data/ext/nginx/MergeLocationConfig.c +6 -0
- data/ext/nginx/config +13 -6
- data/ext/ruby/passenger_native_support.c +61 -2
- data/helper-scripts/classic-rails-loader.rb +9 -10
- data/helper-scripts/classic-rails-preloader.rb +10 -11
- data/helper-scripts/node-loader.js +3 -2
- data/helper-scripts/rack-loader.rb +8 -9
- data/helper-scripts/rack-preloader.rb +9 -10
- data/lib/phusion_passenger.rb +36 -7
- data/lib/phusion_passenger/abstract_installer.rb +16 -15
- data/lib/phusion_passenger/active_support3_extensions/init.rb +1 -1
- data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
- data/lib/phusion_passenger/admin_tools/server_instance.rb +5 -5
- data/lib/phusion_passenger/analytics_logger.rb +3 -3
- data/lib/phusion_passenger/classic_rails/thread_handler_extension.rb +1 -1
- data/lib/phusion_passenger/config.rb +125 -0
- data/lib/phusion_passenger/config/about_command.rb +183 -0
- data/lib/phusion_passenger/config/command.rb +57 -0
- data/lib/phusion_passenger/config/restart_app_command.rb +146 -0
- data/lib/phusion_passenger/config/utils.rb +108 -0
- data/lib/phusion_passenger/console_text_template.rb +2 -1
- data/lib/phusion_passenger/constants.rb +7 -2
- data/lib/phusion_passenger/loader_shared_helpers.rb +12 -21
- data/lib/phusion_passenger/message_client.rb +15 -4
- data/lib/phusion_passenger/native_support.rb +116 -98
- data/lib/phusion_passenger/nginx/config_options.rb +5 -0
- data/lib/phusion_passenger/platform_info.rb +1 -1
- data/lib/phusion_passenger/platform_info/apache.rb +9 -5
- data/lib/phusion_passenger/platform_info/apache_detector.rb +5 -6
- data/lib/phusion_passenger/platform_info/binary_compatibility.rb +3 -3
- data/lib/phusion_passenger/platform_info/compiler.rb +29 -11
- data/lib/phusion_passenger/platform_info/curl.rb +1 -1
- data/lib/phusion_passenger/platform_info/cxx_portability.rb +30 -16
- data/lib/phusion_passenger/platform_info/depcheck.rb +6 -6
- data/lib/phusion_passenger/platform_info/linux.rb +2 -2
- data/lib/phusion_passenger/platform_info/operating_system.rb +25 -5
- data/lib/phusion_passenger/platform_info/ruby.rb +7 -4
- data/lib/phusion_passenger/platform_info/zlib.rb +1 -1
- data/lib/phusion_passenger/plugin.rb +0 -1
- data/lib/phusion_passenger/preloader_shared_helpers.rb +1 -1
- data/lib/phusion_passenger/public_api.rb +1 -1
- data/lib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
- data/lib/phusion_passenger/request_handler.rb +8 -9
- data/lib/phusion_passenger/request_handler/thread_handler.rb +21 -9
- data/lib/phusion_passenger/ruby_core_enhancements.rb +1 -1
- data/lib/phusion_passenger/standalone/app_finder.rb +2 -2
- data/lib/phusion_passenger/standalone/command.rb +10 -8
- data/lib/phusion_passenger/standalone/help_command.rb +1 -1
- data/lib/phusion_passenger/standalone/main.rb +3 -3
- data/lib/phusion_passenger/standalone/package_runtime_command.rb +2 -2
- data/lib/phusion_passenger/standalone/runtime_installer.rb +55 -13
- data/lib/phusion_passenger/standalone/runtime_locator.rb +3 -3
- data/lib/phusion_passenger/standalone/start_command.rb +6 -7
- data/lib/phusion_passenger/standalone/status_command.rb +1 -1
- data/lib/phusion_passenger/standalone/stop_command.rb +1 -1
- data/lib/phusion_passenger/standalone/utils.rb +1 -1
- data/lib/phusion_passenger/standalone/version_command.rb +2 -3
- data/lib/phusion_passenger/utils.rb +1 -1
- data/lib/phusion_passenger/utils/download.rb +1 -2
- data/lib/phusion_passenger/utils/file_system_watcher.rb +1 -1
- data/lib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
- data/lib/phusion_passenger/utils/tee_input.rb +1 -1
- data/lib/phusion_passenger/utils/terminal_choice_menu.rb +217 -0
- data/lib/phusion_passenger/utils/unseekable_socket.rb +1 -1
- data/resources/templates/apache2/config_snippets.txt.erb +2 -3
- data/resources/templates/apache2/deployment_example.txt.erb +2 -2
- data/resources/templates/apache2/notify_apache_module_installed.txt.erb +3 -0
- data/resources/templates/nginx/config_snippets.txt.erb +1 -1
- data/resources/templates/nginx/deployment_example.txt.erb +2 -2
- data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +11 -5
- data/rpm/Vagrantfile +1 -0
- data/test/cxx/ApplicationPool2/PoolTest.cpp +224 -35
- data/test/cxx/ApplicationPool2/ProcessTest.cpp +6 -6
- data/test/cxx/MessagePassingTest.cpp +1 -1
- data/test/cxx/RequestHandlerTest.cpp +26 -26
- data/test/integration_tests/apache2_tests.rb +162 -243
- data/test/integration_tests/native_packaging_spec.rb +10 -10
- data/test/integration_tests/nginx_tests.rb +87 -107
- data/test/integration_tests/shared/example_webapp_tests.rb +246 -0
- data/test/integration_tests/source_packaging_test.rb +2 -1
- data/test/integration_tests/standalone_tests.rb +34 -19
- data/test/ruby/admin_tools_spec.rb +4 -4
- data/test/ruby/analytics_logger_spec.rb +1 -1
- data/test/ruby/debug_logging_spec.rb +2 -2
- data/test/ruby/message_channel_spec.rb +1 -1
- data/test/ruby/request_handler_spec.rb +171 -64
- data/test/ruby/shared/loader_sharedspec.rb +5 -5
- data/test/ruby/shared/rails/analytics_logging_extensions_sharedspec.rb +2 -2
- data/test/ruby/spec_helper.rb +4 -4
- data/test/ruby/standalone/runtime_installer_spec.rb +1 -1
- data/test/ruby/standalone/runtime_locator_spec.rb +1 -1
- data/test/ruby/utils/file_system_watcher_spec.rb +1 -1
- data/test/ruby/utils/hosts_file_parser.rb +1 -1
- data/test/ruby/utils/unseekable_socket_spec.rb +1 -1
- data/test/ruby/utils_spec.rb +4 -4
- data/test/stub/apache2/httpd.conf.erb +5 -0
- data/test/stub/index.html +1 -0
- data/test/stub/rack/config.ru +80 -33
- data/test/stub/{rails_apps/1.2/empty/app/models → rack/public}/.gitignore +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/Rakefile +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/application_controller.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/recipes_controller.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/uploads_controller.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/welcome_controller.rb +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/app/helpers/application_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/recipes_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/test_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/uploads_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/welcome_helper.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/layouts/default.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/create.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/index.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/new.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/index.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/new.html.erb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/cached.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/index.rhtml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/boot.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/database.yml +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environment.rb +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/environments/development.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environments/production.rb +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/inflections.rb +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/mime_types.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/routes.rb +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/log/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/.htaccess +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/404.html +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/422.html +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/500.html +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.cgi +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.fcgi +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.rb +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/favicon.ico +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/angrywizard.gif +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/cookbook.gif +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/header.png +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/images/rails.png +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/robots.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/uploads.html +0 -0
- data/test/stub/{rails_apps/1.2/empty/db → rails2.3-mycook/public/uploads}/.gitignore +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/welcome/cached.html +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/about +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/console +0 -0
- data/test/stub/{rails_apps/2.2/empty → rails2.3-mycook}/script/dbconsole +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/destroy +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/generate +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/benchmarker +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/profiler +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/performance/request +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/plugin +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/inspector +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/reaper +0 -0
- data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/spawner +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/runner +0 -0
- data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/server +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/uploads.html +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/welcome/cached.html +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/cache/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/pids/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sessions/useless.txt +0 -0
- data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sockets/useless.txt +0 -0
- data/test/stub/rails2.3/app/controllers/foo_controller.rb +1 -1
- data/test/stub/rails2.3/config/routes.rb +1 -2
- data/test/stub/wsgi/passenger_wsgi.py +47 -8
- data/test/stub/{rails_apps/1.2/empty/public/stylesheets → wsgi/public}/.gitignore +0 -0
- data/test/support/apache2_controller.rb +2 -2
- data/test/support/nginx_controller.rb +11 -5
- data/test/support/placebo-preloader.rb +2 -2
- data/test/support/test_helper.rb +26 -7
- metadata +78 -240
- metadata.gz.asc +7 -7
- data/debian.template/repack.sh +0 -42
- data/debian.template/watch +0 -3
- data/test/integration_tests/cgi_environment_spec.rb +0 -36
- data/test/integration_tests/hello_world_rack_spec.rb +0 -43
- data/test/integration_tests/hello_world_wsgi_spec.rb +0 -41
- data/test/integration_tests/mycook_spec.rb +0 -166
- data/test/stub/rack/public/rack.jpg +0 -0
- data/test/stub/rails_apps/1.2/empty/.gitignore +0 -3
- data/test/stub/rails_apps/1.2/empty/app/controllers/application.rb +0 -7
- data/test/stub/rails_apps/1.2/empty/config/boot.rb +0 -108
- data/test/stub/rails_apps/1.2/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/1.2/empty/config/environment.rb +0 -66
- data/test/stub/rails_apps/1.2/empty/config/environments/development.rb +0 -21
- data/test/stub/rails_apps/1.2/empty/config/environments/production.rb +0 -18
- data/test/stub/rails_apps/1.2/empty/config/environments/staging.rb +0 -18
- data/test/stub/rails_apps/1.2/empty/config/environments/test.rb +0 -19
- data/test/stub/rails_apps/1.2/empty/config/routes.rb +0 -23
- data/test/stub/rails_apps/1.2/empty/doc/README_FOR_APP +0 -2
- data/test/stub/rails_apps/1.2/empty/public/.htaccess +0 -40
- data/test/stub/rails_apps/1.2/empty/public/500.html +0 -30
- data/test/stub/rails_apps/1.2/empty/public/dispatch.cgi +0 -10
- data/test/stub/rails_apps/1.2/empty/public/dispatch.fcgi +0 -24
- data/test/stub/rails_apps/1.2/empty/public/dispatch.rb +0 -10
- data/test/stub/rails_apps/1.2/empty/public/robots.txt +0 -1
- data/test/stub/rails_apps/1.2/empty/script/about +0 -3
- data/test/stub/rails_apps/1.2/empty/script/breakpointer +0 -3
- data/test/stub/rails_apps/1.2/empty/script/console +0 -3
- data/test/stub/rails_apps/1.2/empty/script/destroy +0 -3
- data/test/stub/rails_apps/1.2/empty/script/generate +0 -3
- data/test/stub/rails_apps/1.2/empty/script/plugin +0 -3
- data/test/stub/rails_apps/1.2/empty/script/runner +0 -3
- data/test/stub/rails_apps/1.2/empty/script/server +0 -3
- data/test/stub/rails_apps/1.2/empty/test/test_helper.rb +0 -28
- data/test/stub/rails_apps/2.0/empty/.gitignore +0 -3
- data/test/stub/rails_apps/2.0/empty/Rakefile +0 -10
- data/test/stub/rails_apps/2.0/empty/app/controllers/application.rb +0 -10
- data/test/stub/rails_apps/2.0/empty/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.0/empty/app/models/.gitignore +0 -0
- data/test/stub/rails_apps/2.0/empty/config/boot.rb +0 -108
- data/test/stub/rails_apps/2.0/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/2.0/empty/config/environment.rb +0 -59
- data/test/stub/rails_apps/2.0/empty/config/environments/production.rb +0 -18
- data/test/stub/rails_apps/2.0/empty/config/environments/staging.rb +0 -18
- data/test/stub/rails_apps/2.0/empty/config/environments/test.rb +0 -22
- data/test/stub/rails_apps/2.0/empty/config/routes.rb +0 -35
- data/test/stub/rails_apps/2.0/empty/db/.gitignore +0 -0
- data/test/stub/rails_apps/2.0/empty/doc/README_FOR_APP +0 -2
- data/test/stub/rails_apps/2.0/empty/public/.htaccess +0 -40
- data/test/stub/rails_apps/2.0/empty/public/404.html +0 -30
- data/test/stub/rails_apps/2.0/empty/public/dispatch.cgi +0 -10
- data/test/stub/rails_apps/2.0/empty/public/dispatch.fcgi +0 -24
- data/test/stub/rails_apps/2.0/empty/public/dispatch.rb +0 -10
- data/test/stub/rails_apps/2.0/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.0/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.0/empty/public/stylesheets/.gitignore +0 -0
- data/test/stub/rails_apps/2.0/empty/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.0/empty/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.0/empty/script/process/inspector +0 -3
- data/test/stub/rails_apps/2.0/empty/script/process/reaper +0 -3
- data/test/stub/rails_apps/2.0/empty/script/process/spawner +0 -3
- data/test/stub/rails_apps/2.0/empty/test/test_helper.rb +0 -38
- data/test/stub/rails_apps/2.2/empty/.gitignore +0 -3
- data/test/stub/rails_apps/2.2/empty/Rakefile +0 -10
- data/test/stub/rails_apps/2.2/empty/app/controllers/application.rb +0 -15
- data/test/stub/rails_apps/2.2/empty/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.2/empty/app/models/.gitignore +0 -0
- data/test/stub/rails_apps/2.2/empty/config/boot.rb +0 -109
- data/test/stub/rails_apps/2.2/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/2.2/empty/config/environment.rb +0 -75
- data/test/stub/rails_apps/2.2/empty/config/environments/development.rb +0 -17
- data/test/stub/rails_apps/2.2/empty/config/environments/production.rb +0 -24
- data/test/stub/rails_apps/2.2/empty/config/environments/staging.rb +0 -24
- data/test/stub/rails_apps/2.2/empty/config/environments/test.rb +0 -22
- data/test/stub/rails_apps/2.2/empty/config/initializers/inflections.rb +0 -10
- data/test/stub/rails_apps/2.2/empty/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails_apps/2.2/empty/config/initializers/new_rails_defaults.rb +0 -17
- data/test/stub/rails_apps/2.2/empty/config/locales/en.yml +0 -5
- data/test/stub/rails_apps/2.2/empty/config/routes.rb +0 -43
- data/test/stub/rails_apps/2.2/empty/db/.gitignore +0 -0
- data/test/stub/rails_apps/2.2/empty/doc/README_FOR_APP +0 -5
- data/test/stub/rails_apps/2.2/empty/public/404.html +0 -30
- data/test/stub/rails_apps/2.2/empty/public/422.html +0 -30
- data/test/stub/rails_apps/2.2/empty/public/500.html +0 -33
- data/test/stub/rails_apps/2.2/empty/public/dispatch.cgi +0 -10
- data/test/stub/rails_apps/2.2/empty/public/dispatch.fcgi +0 -24
- data/test/stub/rails_apps/2.2/empty/public/dispatch.rb +0 -10
- data/test/stub/rails_apps/2.2/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.2/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.2/empty/public/robots.txt +0 -5
- data/test/stub/rails_apps/2.2/empty/public/stylesheets/.gitignore +0 -0
- data/test/stub/rails_apps/2.2/empty/script/about +0 -4
- data/test/stub/rails_apps/2.2/empty/script/console +0 -3
- data/test/stub/rails_apps/2.2/empty/script/destroy +0 -3
- data/test/stub/rails_apps/2.2/empty/script/generate +0 -3
- data/test/stub/rails_apps/2.2/empty/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.2/empty/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.2/empty/script/performance/request +0 -3
- data/test/stub/rails_apps/2.2/empty/script/plugin +0 -3
- data/test/stub/rails_apps/2.2/empty/script/process/inspector +0 -3
- data/test/stub/rails_apps/2.2/empty/script/process/reaper +0 -3
- data/test/stub/rails_apps/2.2/empty/script/process/spawner +0 -3
- data/test/stub/rails_apps/2.2/empty/script/runner +0 -3
- data/test/stub/rails_apps/2.2/empty/script/server +0 -3
- data/test/stub/rails_apps/2.2/empty/test/performance/browsing_test.rb +0 -9
- data/test/stub/rails_apps/2.2/empty/test/test_helper.rb +0 -38
- data/test/stub/rails_apps/2.3/empty/.gitignore +0 -3
- data/test/stub/rails_apps/2.3/empty/Rakefile +0 -10
- data/test/stub/rails_apps/2.3/empty/app/controllers/application_controller.rb +0 -10
- data/test/stub/rails_apps/2.3/empty/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.3/empty/app/models/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/empty/config/boot.rb +0 -110
- data/test/stub/rails_apps/2.3/empty/config/database.yml +0 -31
- data/test/stub/rails_apps/2.3/empty/config/environment.rb +0 -41
- data/test/stub/rails_apps/2.3/empty/config/environments/development.rb +0 -17
- data/test/stub/rails_apps/2.3/empty/config/environments/production.rb +0 -28
- data/test/stub/rails_apps/2.3/empty/config/environments/staging.rb +0 -28
- data/test/stub/rails_apps/2.3/empty/config/environments/test.rb +0 -28
- data/test/stub/rails_apps/2.3/empty/config/initializers/backtrace_silencers.rb +0 -7
- data/test/stub/rails_apps/2.3/empty/config/initializers/inflections.rb +0 -10
- data/test/stub/rails_apps/2.3/empty/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails_apps/2.3/empty/config/initializers/new_rails_defaults.rb +0 -21
- data/test/stub/rails_apps/2.3/empty/config/initializers/session_store.rb +0 -15
- data/test/stub/rails_apps/2.3/empty/config/locales/en.yml +0 -5
- data/test/stub/rails_apps/2.3/empty/config/routes.rb +0 -43
- data/test/stub/rails_apps/2.3/empty/db/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/empty/db/seeds.rb +0 -7
- data/test/stub/rails_apps/2.3/empty/doc/README_FOR_APP +0 -2
- data/test/stub/rails_apps/2.3/empty/public/404.html +0 -30
- data/test/stub/rails_apps/2.3/empty/public/422.html +0 -30
- data/test/stub/rails_apps/2.3/empty/public/500.html +0 -30
- data/test/stub/rails_apps/2.3/empty/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.3/empty/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.3/empty/public/robots.txt +0 -5
- data/test/stub/rails_apps/2.3/empty/public/stylesheets/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/empty/script/about +0 -4
- data/test/stub/rails_apps/2.3/empty/script/console +0 -3
- data/test/stub/rails_apps/2.3/empty/script/dbconsole +0 -3
- data/test/stub/rails_apps/2.3/empty/script/destroy +0 -3
- data/test/stub/rails_apps/2.3/empty/script/generate +0 -3
- data/test/stub/rails_apps/2.3/empty/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.3/empty/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.3/empty/script/plugin +0 -3
- data/test/stub/rails_apps/2.3/empty/script/runner +0 -3
- data/test/stub/rails_apps/2.3/empty/script/server +0 -3
- data/test/stub/rails_apps/2.3/empty/test/performance/browsing_test.rb +0 -9
- data/test/stub/rails_apps/2.3/empty/test/test_helper.rb +0 -38
- data/test/stub/rails_apps/2.3/mycook/Rakefile +0 -10
- data/test/stub/rails_apps/2.3/mycook/app/helpers/application_helper.rb +0 -3
- data/test/stub/rails_apps/2.3/mycook/config/environments/development.rb +0 -18
- data/test/stub/rails_apps/2.3/mycook/config/initializers/inflections.rb +0 -10
- data/test/stub/rails_apps/2.3/mycook/config/initializers/mime_types.rb +0 -5
- data/test/stub/rails_apps/2.3/mycook/public/404.html +0 -30
- data/test/stub/rails_apps/2.3/mycook/public/422.html +0 -30
- data/test/stub/rails_apps/2.3/mycook/public/500.html +0 -30
- data/test/stub/rails_apps/2.3/mycook/public/favicon.ico +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/images/rails.png +0 -0
- data/test/stub/rails_apps/2.3/mycook/public/robots.txt +0 -5
- data/test/stub/rails_apps/2.3/mycook/public/uploads/.gitignore +0 -0
- data/test/stub/rails_apps/2.3/mycook/script/about +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/console +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/dbconsole +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/destroy +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/generate +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/performance/benchmarker +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/performance/profiler +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/performance/request +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/plugin +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/process/inspector +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/process/reaper +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/process/spawner +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/runner +0 -3
- data/test/stub/rails_apps/2.3/mycook/script/server +0 -3
- data/test/stub/wsgi/public/wsgi-snake.jpg +0 -0
@@ -58,14 +58,13 @@ module App
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def self.init_passenger
|
61
|
-
|
62
|
-
require 'phusion_passenger'
|
61
|
+
require "#{options["ruby_libdir"]}/phusion_passenger"
|
63
62
|
PhusionPassenger.locate_directories(options["passenger_root"])
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
PhusionPassenger.require_passenger_lib 'native_support'
|
64
|
+
PhusionPassenger.require_passenger_lib 'ruby_core_enhancements'
|
65
|
+
PhusionPassenger.require_passenger_lib 'utils/tmpdir'
|
66
|
+
PhusionPassenger.require_passenger_lib 'loader_shared_helpers'
|
67
|
+
PhusionPassenger.require_passenger_lib 'request_handler'
|
69
68
|
LoaderSharedHelpers.init
|
70
69
|
@@options = LoaderSharedHelpers.sanitize_spawn_options(@@options)
|
71
70
|
Utils.passenger_tmpdir = options["generation_dir"]
|
@@ -118,11 +117,11 @@ module App
|
|
118
117
|
LoaderSharedHelpers.after_loading_app_code(options)
|
119
118
|
|
120
119
|
if Rails::VERSION::STRING >= '2.3.0'
|
121
|
-
|
120
|
+
PhusionPassenger.require_passenger_lib 'rack/thread_handler_extension'
|
122
121
|
RequestHandler::ThreadHandler.send(:include, Rack::ThreadHandlerExtension)
|
123
122
|
app = ActionController::Dispatcher.new
|
124
123
|
else
|
125
|
-
|
124
|
+
PhusionPassenger.require_passenger_lib 'classic_rails/thread_handler_extension'
|
126
125
|
RequestHandler::ThreadHandler.send(:include, ClassicRails::ThreadHandlerExtension)
|
127
126
|
app = nil
|
128
127
|
end
|
@@ -150,7 +149,7 @@ module App
|
|
150
149
|
handshake_and_read_startup_request
|
151
150
|
init_passenger
|
152
151
|
handler = load_app
|
153
|
-
|
152
|
+
LoaderSharedHelpers.advertise_readiness
|
154
153
|
LoaderSharedHelpers.advertise_sockets(STDOUT, handler)
|
155
154
|
puts "!> "
|
156
155
|
handler.main_loop
|
@@ -61,15 +61,14 @@ module App
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def self.init_passenger
|
64
|
-
|
65
|
-
require 'phusion_passenger'
|
64
|
+
require "#{options["ruby_libdir"]}/phusion_passenger"
|
66
65
|
PhusionPassenger.locate_directories(options["passenger_root"])
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
66
|
+
PhusionPassenger.require_passenger_lib 'native_support'
|
67
|
+
PhusionPassenger.require_passenger_lib 'ruby_core_enhancements'
|
68
|
+
PhusionPassenger.require_passenger_lib 'utils/tmpdir'
|
69
|
+
PhusionPassenger.require_passenger_lib 'preloader_shared_helpers'
|
70
|
+
PhusionPassenger.require_passenger_lib 'loader_shared_helpers'
|
71
|
+
PhusionPassenger.require_passenger_lib 'request_handler'
|
73
72
|
LoaderSharedHelpers.init
|
74
73
|
PreloaderSharedHelpers.init
|
75
74
|
@@options = LoaderSharedHelpers.sanitize_spawn_options(@@options)
|
@@ -147,11 +146,11 @@ module App
|
|
147
146
|
|
148
147
|
LoaderSharedHelpers.before_handling_requests(true, options)
|
149
148
|
if Rails::VERSION::STRING >= '2.3.0'
|
150
|
-
|
149
|
+
PhusionPassenger.require_passenger_lib 'rack/thread_handler_extension'
|
151
150
|
RequestHandler::ThreadHandler.send(:include, Rack::ThreadHandlerExtension)
|
152
151
|
app = ActionController::Dispatcher.new
|
153
152
|
else
|
154
|
-
|
153
|
+
PhusionPassenger.require_passenger_lib 'classic_rails/thread_handler_extension'
|
155
154
|
RequestHandler::ThreadHandler.send(:include, ClassicRails::ThreadHandlerExtension)
|
156
155
|
app = nil
|
157
156
|
end
|
@@ -164,7 +163,7 @@ module App
|
|
164
163
|
exit exit_code_for_exception(e)
|
165
164
|
end
|
166
165
|
|
167
|
-
|
166
|
+
LoaderSharedHelpers.advertise_readiness
|
168
167
|
LoaderSharedHelpers.advertise_sockets(STDOUT, handler)
|
169
168
|
puts "!> "
|
170
169
|
return handler
|
@@ -159,7 +159,8 @@ function installServer() {
|
|
159
159
|
"This means that the first http.Server object for which listen() is called, " +
|
160
160
|
"is automatically installed as the Phusion Passenger request handler. " +
|
161
161
|
"If you want to create and listen on multiple http.Server object then " +
|
162
|
-
"you should disable auto-install mode."
|
162
|
+
"you should disable auto-install mode. Please read " +
|
163
|
+
"http://stackoverflow.com/questions/20645231/phusion-passenger-error-http-server-listen-was-called-more-than-once/20645549");
|
163
164
|
}
|
164
165
|
}
|
165
166
|
|
@@ -168,7 +169,7 @@ function listenAndMaybeInstall(port) {
|
|
168
169
|
if (!PhusionPassenger._appInstalled) {
|
169
170
|
return installServer.apply(this, arguments);
|
170
171
|
} else {
|
171
|
-
throw new Error("You may only call listen('passenger') once");
|
172
|
+
throw new Error("You may only call listen('passenger') once. Please read http://stackoverflow.com/questions/20645231/phusion-passenger-error-http-server-listen-was-called-more-than-once/20645549");
|
172
173
|
}
|
173
174
|
} else {
|
174
175
|
return this.originalListen.apply(this, arguments);
|
@@ -40,15 +40,14 @@ module App
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def self.init_passenger
|
43
|
-
|
44
|
-
require 'phusion_passenger'
|
43
|
+
require "#{options["ruby_libdir"]}/phusion_passenger"
|
45
44
|
PhusionPassenger.locate_directories(options["passenger_root"])
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
45
|
+
PhusionPassenger.require_passenger_lib 'native_support'
|
46
|
+
PhusionPassenger.require_passenger_lib 'ruby_core_enhancements'
|
47
|
+
PhusionPassenger.require_passenger_lib 'utils/tmpdir'
|
48
|
+
PhusionPassenger.require_passenger_lib 'loader_shared_helpers'
|
49
|
+
PhusionPassenger.require_passenger_lib 'request_handler'
|
50
|
+
PhusionPassenger.require_passenger_lib 'rack/thread_handler_extension'
|
52
51
|
LoaderSharedHelpers.init
|
53
52
|
@@options = LoaderSharedHelpers.sanitize_spawn_options(@@options)
|
54
53
|
Utils.passenger_tmpdir = options["generation_dir"]
|
@@ -99,7 +98,7 @@ module App
|
|
99
98
|
load_app
|
100
99
|
LoaderSharedHelpers.before_handling_requests(false, options)
|
101
100
|
handler = RequestHandler.new(STDIN, options.merge("app" => app))
|
102
|
-
|
101
|
+
LoaderSharedHelpers.advertise_readiness
|
103
102
|
LoaderSharedHelpers.advertise_sockets(STDOUT, handler)
|
104
103
|
puts "!> "
|
105
104
|
handler.main_loop
|
@@ -65,16 +65,15 @@ module App
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def self.init_passenger
|
68
|
-
|
69
|
-
require 'phusion_passenger'
|
68
|
+
require "#{options["ruby_libdir"]}/phusion_passenger"
|
70
69
|
PhusionPassenger.locate_directories(options["passenger_root"])
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
70
|
+
PhusionPassenger.require_passenger_lib 'native_support'
|
71
|
+
PhusionPassenger.require_passenger_lib 'ruby_core_enhancements'
|
72
|
+
PhusionPassenger.require_passenger_lib 'utils/tmpdir'
|
73
|
+
PhusionPassenger.require_passenger_lib 'preloader_shared_helpers'
|
74
|
+
PhusionPassenger.require_passenger_lib 'loader_shared_helpers'
|
75
|
+
PhusionPassenger.require_passenger_lib 'request_handler'
|
76
|
+
PhusionPassenger.require_passenger_lib 'rack/thread_handler_extension'
|
78
77
|
LoaderSharedHelpers.init
|
79
78
|
PreloaderSharedHelpers.init
|
80
79
|
@@options = LoaderSharedHelpers.sanitize_spawn_options(@@options)
|
@@ -138,7 +137,7 @@ module App
|
|
138
137
|
exit exit_code_for_exception(e)
|
139
138
|
end
|
140
139
|
|
141
|
-
|
140
|
+
LoaderSharedHelpers.advertise_readiness
|
142
141
|
LoaderSharedHelpers.advertise_sockets(STDOUT, handler)
|
143
142
|
puts "!> "
|
144
143
|
return handler
|
data/lib/phusion_passenger.rb
CHANGED
@@ -30,7 +30,7 @@ module PhusionPassenger
|
|
30
30
|
|
31
31
|
PACKAGE_NAME = 'passenger'
|
32
32
|
# Run 'rake ext/common/Constants.h' after changing this number.
|
33
|
-
VERSION_STRING = '4.0.
|
33
|
+
VERSION_STRING = '4.0.31'
|
34
34
|
|
35
35
|
PREFERRED_NGINX_VERSION = '1.4.4'
|
36
36
|
NGINX_SHA256_CHECKSUM = '7c989a58e5408c9593da0bebcd0e4ffc3d892d1316ba5042ddb0be5b0b4102b9'
|
@@ -71,7 +71,10 @@ module PhusionPassenger
|
|
71
71
|
OPTIONAL_LOCATIONS_INI_FIELDS = [
|
72
72
|
# Directory in which downloaded Phusion Passenger binaries are stored.
|
73
73
|
# Only available when originally packaged.
|
74
|
-
:download_cache_dir
|
74
|
+
:download_cache_dir,
|
75
|
+
# Directory in which the build system's output is stored, e.g.
|
76
|
+
# the compiled agent executables. Only available when originally packaged.
|
77
|
+
:buildout_dir
|
75
78
|
].freeze
|
76
79
|
|
77
80
|
# Follows the logic of ext/common/ResourceLocator.h, so don't forget to modify that too.
|
@@ -83,13 +86,22 @@ module PhusionPassenger
|
|
83
86
|
filename = root_or_file
|
84
87
|
options = parse_ini_file(filename)
|
85
88
|
|
86
|
-
@natively_packaged
|
89
|
+
@natively_packaged = get_bool_option(filename, options, 'natively_packaged')
|
90
|
+
if natively_packaged?
|
91
|
+
@native_packaging_method = get_option(filename, options, 'native_packaging_method')
|
92
|
+
end
|
87
93
|
REQUIRED_LOCATIONS_INI_FIELDS.each do |field|
|
88
94
|
instance_variable_set("@#{field}", get_option(filename, options, field.to_s).freeze)
|
89
95
|
end
|
90
96
|
OPTIONAL_LOCATIONS_INI_FIELDS.each do |field|
|
91
97
|
instance_variable_set("@#{field}", get_option(filename, options, field.to_s, false).freeze)
|
92
98
|
end
|
99
|
+
if !originally_packaged?
|
100
|
+
# Since these options are only supposed to be available when
|
101
|
+
# originally packaged, force them to be nil when natively packaged.
|
102
|
+
@download_cache_dir = nil
|
103
|
+
@buildout_dir = nil
|
104
|
+
end
|
93
105
|
else
|
94
106
|
@source_root = File.dirname(File.dirname(FILE_LOCATION))
|
95
107
|
@natively_packaged = false
|
@@ -106,6 +118,7 @@ module PhusionPassenger
|
|
106
118
|
@ruby_extension_source_dir = "#{@source_root}/ext/ruby"
|
107
119
|
@nginx_module_source_dir = "#{@source_root}/ext/nginx"
|
108
120
|
@download_cache_dir = "#{@source_root}/download_cache"
|
121
|
+
@buildout_dir = "#{@source_root}/buildout"
|
109
122
|
REQUIRED_LOCATIONS_INI_FIELDS.each do |field|
|
110
123
|
if instance_variable_get("@#{field}").nil?
|
111
124
|
raise "BUG: @#{field} not set"
|
@@ -124,6 +137,12 @@ module PhusionPassenger
|
|
124
137
|
return @natively_packaged
|
125
138
|
end
|
126
139
|
|
140
|
+
# If Phusion Passenger is natively packaged, returns which packaging
|
141
|
+
# method was used. Can be 'deb' or 'rpm'.
|
142
|
+
def self.native_packaging_method
|
143
|
+
return @native_packaging_method
|
144
|
+
end
|
145
|
+
|
127
146
|
# Whether the current Phusion Passenger installation is installed
|
128
147
|
# from a release package, e.g. an official gem or official tarball.
|
129
148
|
# Retruns false if e.g. the gem was built by the user, or if this
|
@@ -140,7 +159,6 @@ module PhusionPassenger
|
|
140
159
|
|
141
160
|
# Generate getters for the directory types in locations.ini.
|
142
161
|
getters_code = ""
|
143
|
-
@ruby_libdir = File.dirname(FILE_LOCATION)
|
144
162
|
(REQUIRED_LOCATIONS_INI_FIELDS + OPTIONAL_LOCATIONS_INI_FIELDS).each do |field|
|
145
163
|
getters_code << %Q{
|
146
164
|
def self.#{field}
|
@@ -180,9 +198,20 @@ module PhusionPassenger
|
|
180
198
|
end
|
181
199
|
|
182
200
|
|
183
|
-
|
184
|
-
|
185
|
-
|
201
|
+
# Instead of calling `require 'phusion_passenger/foo'`, you should call
|
202
|
+
# `PhusionPassenger.require_passenger_lib 'foo'`. This is because when Phusion
|
203
|
+
# Passenger is natively packaged, it may still be run with arbitrary Ruby
|
204
|
+
# interpreters. Adding ruby_libdir to $LOAD_PATH is then dangerous because ruby_libdir
|
205
|
+
# may be the distribution's Ruby's vendor_ruby directory, which may be incompatible
|
206
|
+
# with the active Ruby interpreter. This method looks up the exact filename directly.
|
207
|
+
#
|
208
|
+
# Using this method also has two more advantages:
|
209
|
+
#
|
210
|
+
# 1. It is immune to Bundler's load path mangling code.
|
211
|
+
# 2. It is faster than plan require() because it doesn't need to
|
212
|
+
# scan the entire load path.
|
213
|
+
def self.require_passenger_lib(name)
|
214
|
+
require("#{ruby_libdir}/phusion_passenger/#{name}")
|
186
215
|
end
|
187
216
|
|
188
217
|
|
@@ -21,13 +21,12 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
require 'phusion_passenger/utils/download'
|
24
|
+
PhusionPassenger.require_passenger_lib 'constants'
|
25
|
+
PhusionPassenger.require_passenger_lib 'console_text_template'
|
26
|
+
PhusionPassenger.require_passenger_lib 'platform_info'
|
27
|
+
PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
|
28
|
+
PhusionPassenger.require_passenger_lib 'utils/ansi_colors'
|
29
|
+
PhusionPassenger.require_passenger_lib 'utils/download'
|
31
30
|
require 'fileutils'
|
32
31
|
require 'logger'
|
33
32
|
require 'etc'
|
@@ -132,7 +131,7 @@ protected
|
|
132
131
|
puts "<banner>Checking for required software...</banner>"
|
133
132
|
puts
|
134
133
|
|
135
|
-
|
134
|
+
PhusionPassenger.require_passenger_lib 'platform_info/depcheck'
|
136
135
|
specs, ids = dependencies
|
137
136
|
runner = PlatformInfo::Depcheck::ConsoleRunner.new
|
138
137
|
|
@@ -257,7 +256,7 @@ protected
|
|
257
256
|
puts "We're sorry, but it looks like this installer ran into an unexpected problem.\n" +
|
258
257
|
"Please visit the following website for support. We'll do our best to help you.\n\n" +
|
259
258
|
" <b>#{SUPPORT_URL}</b>\n\n" +
|
260
|
-
"When submitting a support inquiry, please copy and paste the entire
|
259
|
+
"When submitting a support inquiry, please copy and paste the entire installer\n" +
|
261
260
|
"output."
|
262
261
|
rescue Exception => e2
|
263
262
|
# Raise original exception so that it doesn't get lost.
|
@@ -399,7 +398,7 @@ protected
|
|
399
398
|
end
|
400
399
|
|
401
400
|
def rake(*args)
|
402
|
-
|
401
|
+
PhusionPassenger.require_passenger_lib 'platform_info/ruby'
|
403
402
|
if !PlatformInfo.rake_command
|
404
403
|
puts_error 'Cannot find Rake.'
|
405
404
|
raise Abort
|
@@ -408,7 +407,7 @@ protected
|
|
408
407
|
end
|
409
408
|
|
410
409
|
def rake!(*args)
|
411
|
-
|
410
|
+
PhusionPassenger.require_passenger_lib 'platform_info/ruby'
|
412
411
|
if !PlatformInfo.rake_command
|
413
412
|
puts_error 'Cannot find Rake.'
|
414
413
|
raise Abort
|
@@ -417,10 +416,12 @@ protected
|
|
417
416
|
end
|
418
417
|
|
419
418
|
def download(url, output, options = {})
|
420
|
-
logger
|
421
|
-
|
422
|
-
|
423
|
-
|
419
|
+
options[:logger] ||= begin
|
420
|
+
logger = Logger.new(STDOUT)
|
421
|
+
logger.level = Logger::WARN
|
422
|
+
logger.formatter = proc { |severity, datetime, progname, msg| "*** #{msg}\n" }
|
423
|
+
logger
|
424
|
+
end
|
424
425
|
return PhusionPassenger::Utils::Download.download(url, output, options)
|
425
426
|
end
|
426
427
|
|
@@ -21,8 +21,8 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
|
-
|
25
|
-
|
24
|
+
PhusionPassenger.require_passenger_lib 'platform_info/apache'
|
25
|
+
PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
|
26
26
|
|
27
27
|
module PhusionPassenger
|
28
28
|
module AdminTools
|
@@ -26,11 +26,11 @@ require 'rexml/document'
|
|
26
26
|
require 'fileutils'
|
27
27
|
require 'socket'
|
28
28
|
require 'ostruct'
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
PhusionPassenger.require_passenger_lib 'admin_tools'
|
30
|
+
PhusionPassenger.require_passenger_lib 'constants'
|
31
|
+
PhusionPassenger.require_passenger_lib 'utils'
|
32
|
+
PhusionPassenger.require_passenger_lib 'message_channel'
|
33
|
+
PhusionPassenger.require_passenger_lib 'message_client'
|
34
34
|
|
35
35
|
module PhusionPassenger
|
36
36
|
module AdminTools
|
@@ -22,9 +22,9 @@
|
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
24
|
require 'thread'
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
PhusionPassenger.require_passenger_lib 'utils'
|
26
|
+
PhusionPassenger.require_passenger_lib 'debug_logging'
|
27
|
+
PhusionPassenger.require_passenger_lib 'message_channel'
|
28
28
|
|
29
29
|
module PhusionPassenger
|
30
30
|
|
@@ -22,7 +22,7 @@
|
|
22
22
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23
23
|
# THE SOFTWARE.
|
24
24
|
|
25
|
-
|
25
|
+
PhusionPassenger.require_passenger_lib 'classic_rails/cgi_fixed'
|
26
26
|
module PhusionPassenger
|
27
27
|
module ClassicRails
|
28
28
|
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# Phusion Passenger - https://www.phusionpassenger.com/
|
2
|
+
# Copyright (c) 2013 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
|
+
PhusionPassenger.require_passenger_lib 'constants'
|
25
|
+
|
26
|
+
module PhusionPassenger
|
27
|
+
|
28
|
+
# Core of the `passenger-config` command. Dispatches a subcommand to a specific class.
|
29
|
+
module Config
|
30
|
+
KNOWN_COMMANDS = [
|
31
|
+
["restart-app", "RestartAppCommand"],
|
32
|
+
["about", "AboutCommand"]
|
33
|
+
]
|
34
|
+
|
35
|
+
ABOUT_OPTIONS = [
|
36
|
+
"root",
|
37
|
+
"includedir",
|
38
|
+
"nginx-addon-dir",
|
39
|
+
"nginx-libs",
|
40
|
+
"compiled",
|
41
|
+
"natively-packaged",
|
42
|
+
"installed-from-release-package",
|
43
|
+
"make-locations-ini",
|
44
|
+
"detect-apache2",
|
45
|
+
"ruby-command",
|
46
|
+
"ruby-libdir",
|
47
|
+
"rubyext-compat-id",
|
48
|
+
"cxx-compat-id",
|
49
|
+
"version"
|
50
|
+
]
|
51
|
+
|
52
|
+
def self.run!(argv)
|
53
|
+
command_class, new_argv = lookup_command_class_by_argv(argv)
|
54
|
+
if help_requested?(argv)
|
55
|
+
help
|
56
|
+
elsif command_class
|
57
|
+
command = command_class.new(new_argv)
|
58
|
+
command.run
|
59
|
+
else
|
60
|
+
help
|
61
|
+
abort
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.help
|
66
|
+
puts "Usage: passenger-config <COMMAND> [options]"
|
67
|
+
puts "Tool for controlling or configurating a #{PROGRAM_NAME} instance or installation."
|
68
|
+
puts
|
69
|
+
puts "Available commands:"
|
70
|
+
KNOWN_COMMANDS.each do |props|
|
71
|
+
command_class = lookup_command_class_by_class_name(props[1])
|
72
|
+
printf " %-15s %s\n", props[0], command_class.description
|
73
|
+
end
|
74
|
+
puts
|
75
|
+
puts "Type 'passenger-config <COMMAND> --help' for more information."
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
def self.help_requested?(argv)
|
80
|
+
return argv.size == 1 && (argv[0] == "--help" || argv[0] == "-h" || argv[0] == "help")
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.lookup_command_class_by_argv(argv)
|
84
|
+
return nil if argv.empty?
|
85
|
+
|
86
|
+
# Compatibility with version <= 4.0.29: try to pass all
|
87
|
+
# --switch invocations to AboutCommand.
|
88
|
+
if argv[0] =~ /^--/
|
89
|
+
name = argv[0].sub(/^--/, '')
|
90
|
+
if ABOUT_OPTIONS.include?(name)
|
91
|
+
command_class = lookup_command_class_by_class_name("AboutCommand")
|
92
|
+
return [command_class, argv]
|
93
|
+
else
|
94
|
+
return nil
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# Convert "passenger-config help <COMMAND>" to "passenger-config <COMMAND> --help".
|
99
|
+
if argv.size == 2 && argv[0] == "help"
|
100
|
+
argv = [argv[1], "--help"]
|
101
|
+
end
|
102
|
+
|
103
|
+
KNOWN_COMMANDS.each do |props|
|
104
|
+
if argv[0] == props[0]
|
105
|
+
command_class = lookup_command_class_by_class_name(props[1])
|
106
|
+
new_argv = argv[1 .. -1]
|
107
|
+
return [command_class, new_argv]
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
return nil
|
112
|
+
end
|
113
|
+
|
114
|
+
def self.lookup_command_class_by_class_name(class_name)
|
115
|
+
base_name = class_name.gsub(/[A-Z]/) do |match|
|
116
|
+
"_" + match[0..0].downcase
|
117
|
+
end
|
118
|
+
base_name.sub!(/^_/, '')
|
119
|
+
base_name << ".rb"
|
120
|
+
PhusionPassenger.require_passenger_lib("config/#{base_name}")
|
121
|
+
return PhusionPassenger::Config.const_get(class_name)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
end # module PhusionPassenger
|