From 8bbc156ca9a4bf3bfff8a9b7014a002808b1b7f0 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 23 Dec 2015 20:46:43 +0100 Subject: Bug 1201113: Support to run Bugzilla as a PSGI application r=dylan --- Bugzilla/Install/Filesystem.pm | 1 + Bugzilla/Install/Requirements.pm | 21 +++++++++++++++++++++ Bugzilla/Install/Util.pm | 10 ++++++++++ 3 files changed, 32 insertions(+) (limited to 'Bugzilla/Install') diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index 5f5677460..e17285b2f 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -167,6 +167,7 @@ sub FILESYSTEM { 'install-module.pl' => { perms => OWNER_EXECUTE }, 'clean-bug-user-last-visit.pl' => { perms => WS_EXECUTE }, + 'app.psgi' => { perms => CGI_READ }, 'Bugzilla.pm' => { perms => CGI_READ }, "$localconfig*" => { perms => CGI_READ }, 'bugzilla.dtd' => { perms => WS_SERVE }, diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index 9a03968d7..a48778c1b 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -312,6 +312,26 @@ sub OPTIONAL_MODULES { version => 0, feature => ['jsonrpc'], }, + { + package => 'Plack', + module => 'Plack', + # 1.0031 contains a security fix which would affect us. + # It also fixes warnings thrown in Perl 5.20 and newer. + version => 1.0031, + feature => ['psgi'], + }, + { + package => 'CGI-Compile', + module => 'CGI::Compile', + version => 0, + feature => ['psgi'], + }, + { + package => 'CGI-Emulate-PSGI', + module => 'CGI::Emulate::PSGI', + version => 0, + feature => ['psgi'], + }, { package => 'Test-Taint', module => 'Test::Taint', @@ -474,6 +494,7 @@ use constant FEATURE_FILES => ( 'Bugzilla/WebService.pm', 'Bugzilla/WebService/*.pm'], rest => ['Bugzilla/WebService/Server/REST.pm', 'rest.cgi', 'Bugzilla/WebService/Server/REST/Resources/*.pm'], + psgi => ['app.psgi'], moving => ['importxml.pl'], auth_ldap => ['Bugzilla/Auth/Verify/LDAP.pm'], auth_radius => ['Bugzilla/Auth/Verify/RADIUS.pm'], diff --git a/Bugzilla/Install/Util.pm b/Bugzilla/Install/Util.pm index c05037061..82752b961 100644 --- a/Bugzilla/Install/Util.pm +++ b/Bugzilla/Install/Util.pm @@ -34,6 +34,7 @@ our @EXPORT_OK = qw( extension_requirement_packages extension_template_directory extension_web_directory + i_am_persistent indicate_progress install_string include_languages @@ -83,6 +84,10 @@ sub get_version_and_os { os_ver => $os_details[3] }; } +sub i_am_persistent { + return ($ENV{MOD_PERL} || $ENV{BZ_PLACK}) ? 1 : 0; +} + sub _extension_paths { my $dir = bz_locations()->{'extensionsdir'}; my @extension_items = glob("$dir/*"); @@ -711,6 +716,11 @@ binary, if the binary is in the C. Returns a hash containing information about what version of Bugzilla we're running, what perl version we're using, and what OS we're running on. +=item C + +Returns true if Bugzilla is running in a persistent environment, such as +mod_perl or PSGI. Returns false if running in mod_cgi mode. + =item C Returns the language to use based on the LC_CTYPE value returned by the OS. -- cgit v1.2.3-24-g4f1b