From 5ac448e57e94bb8f286df0cfcebb7dfed066ed40 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Wed, 20 Jun 2018 17:10:32 -0400 Subject: add hypnotoad to vagrant --- Bugzilla/DaemonControl.pm | 2 +- Bugzilla/Quantum.pm | 3 --- Bugzilla/Quantum/Plugin/Glue.pm | 9 ++++++++- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/DaemonControl.pm b/Bugzilla/DaemonControl.pm index 19bc440f7..9cea1a898 100644 --- a/Bugzilla/DaemonControl.pm +++ b/Bugzilla/DaemonControl.pm @@ -105,7 +105,7 @@ sub run_httpd { # or else apache will kill its parent. setsid(); $ENV{BUGZILLA_HTTPD_ARGS} = encode_json(\@args); - my @command = ( $^X, '/app/bugzilla.pl', 'daemon', "--listen=http://*:$ENV{PORT}" ); + my @command = ( $^X, '/app/local/bin/hypnotoad', '/app/bugzilla.pl', '-f' ); exec @command or die "failed to exec $command[0] $!"; }, diff --git a/Bugzilla/Quantum.pm b/Bugzilla/Quantum.pm index 7209a204b..d9bb7a75a 100644 --- a/Bugzilla/Quantum.pm +++ b/Bugzilla/Quantum.pm @@ -33,9 +33,6 @@ sub startup { my ($self) = @_; $self->plugin('Bugzilla::Quantum::Plugin::Glue'); - my $port = $ENV{PORT} // 3000; - untaint($port); - $self->config(hypnotoad => {listen => ["http://*:$port"]}); my $r = $self->routes; Bugzilla::Quantum::CGI->load_all($r); diff --git a/Bugzilla/Quantum/Plugin/Glue.pm b/Bugzilla/Quantum/Plugin/Glue.pm index b46ffb1e1..19896817c 100644 --- a/Bugzilla/Quantum/Plugin/Glue.pm +++ b/Bugzilla/Quantum/Plugin/Glue.pm @@ -29,6 +29,13 @@ sub register { } } + # hypnotoad is weird and doesn't look for MOJO_LISTEN itself. + $app->config( + hypnotoad => { + listen => [ $ENV{MOJO_LISTEN} ], + }, + ); + $app->hook( around_dispatch => sub { my ($next, $c) = @_; @@ -86,4 +93,4 @@ sub register { -1; \ No newline at end of file +1; -- cgit v1.2.3-24-g4f1b