summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-04-04 05:05:04 +0200
committerDylan William Hardison <dylan@hardison.net>2018-06-28 22:41:54 +0200
commited6d5cdaaeac6422e5933e4e8138b481e35ab4f3 (patch)
tree821e7a1330326e5d9630560076049bce01f3c3d6 /Bugzilla
parent5d6d68697dceec6a8c5a8947118abe527ad09ba1 (diff)
downloadbugzilla-ed6d5cdaaeac6422e5933e4e8138b481e35ab4f3.tar.gz
bugzilla-ed6d5cdaaeac6422e5933e4e8138b481e35ab4f3.tar.xz
initial proof of concept of mojolicious inside bmo
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/CGI/Mojo.pm29
-rw-r--r--Bugzilla/Constants.pm2
-rw-r--r--Bugzilla/Install/Filesystem.pm1
-rw-r--r--Bugzilla/ModPerl.pm7
4 files changed, 39 insertions, 0 deletions
diff --git a/Bugzilla/CGI/Mojo.pm b/Bugzilla/CGI/Mojo.pm
new file mode 100644
index 000000000..0ae12f976
--- /dev/null
+++ b/Bugzilla/CGI/Mojo.pm
@@ -0,0 +1,29 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
+package Bugzilla::CGI::Mojo;
+use 5.10.1;
+use Moo;
+
+has 'controller' => (
+ is => 'ro',
+ handles => [qw(param cookie)],
+);
+
+sub script_name {
+ my ($self) = @_;
+
+ return $self->controller->req->env->{SCRIPT_NAME};
+}
+
+sub Vars {
+ my ($self) = @_;
+
+ return $self->controller->req->query_params->to_hash;
+}
+
+1; \ No newline at end of file
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm
index 3aa7b0fa4..8ef776f96 100644
--- a/Bugzilla/Constants.pm
+++ b/Bugzilla/Constants.pm
@@ -130,6 +130,7 @@ use Memoize;
USAGE_MODE_JSON
USAGE_MODE_TEST
USAGE_MODE_REST
+ USAGE_MODE_MOJO
ERROR_MODE_WEBPAGE
ERROR_MODE_DIE
@@ -487,6 +488,7 @@ use constant USAGE_MODE_EMAIL => 3;
use constant USAGE_MODE_JSON => 4;
use constant USAGE_MODE_TEST => 5;
use constant USAGE_MODE_REST => 6;
+use constant USAGE_MODE_MOJO => 7;
# Error modes. Default set by Bugzilla->usage_mode (so ERROR_MODE_WEBPAGE
# usually). Use with Bugzilla->error_mode.
diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm
index 003be22e4..739ea9a0a 100644
--- a/Bugzilla/Install/Filesystem.pm
+++ b/Bugzilla/Install/Filesystem.pm
@@ -214,6 +214,7 @@ sub FILESYSTEM {
# users to be able to cron them or otherwise run
# them as a secure user, like the webserver owner.
'*.cgi' => { perms => WS_EXECUTE },
+ '*.psgi' => { perms => CGI_READ },
'whineatnews.pl' => { perms => WS_EXECUTE },
'collectstats.pl' => { perms => WS_EXECUTE },
'importxml.pl' => { perms => WS_EXECUTE },
diff --git a/Bugzilla/ModPerl.pm b/Bugzilla/ModPerl.pm
index 19cd1128f..6f7ed22e9 100644
--- a/Bugzilla/ModPerl.pm
+++ b/Bugzilla/ModPerl.pm
@@ -109,6 +109,13 @@ ErrorDocument 500 /errors/500.html
require valid-user
</Location>
+<Location /new>
+ SetHandler perl-script
+ PerlResponseHandler Plack::Handler::Apache2
+ PerlSetEnv MOJO_HOME [% cgi_path %]
+ PerlSetVar psgi_app [% cgi_path %]/new.psgi
+</Location>
+
# directory rules for all the other places we have .htaccess files
[% FOREACH htaccess IN htaccess_files %]
# from [% htaccess.file %]