--- /dev/null
+#!/usr/bin/env perl
+
+use File::Basename qw(basename dirname);
+use File::Spec::Functions qw(catfile catdir);
+use Cwd qw(realpath);
+our $BUGZILLA_DIR;
+
+BEGIN {
+ require lib;
+ $BUGZILLA_DIR = dirname(dirname(realpath(__FILE__)));
+ lib->import(
+ $BUGZILLA_DIR,
+ catdir($BUGZILLA_DIR, 'lib'),
+ catdir($BUGZILLA_DIR, qw(local lib perl5))
+ );
+}
+use Env qw(@PATH @PERL5LIB $MOJO_LISTEN $BUGZILLA_ALLOW_INSECURE_HTTP MOJO_REVERSE_PROXY);
+
+chdir $BUGZILLA_DIR;
+
+my $cert_file = catfile($BUGZILLA_DIR, 'bmo-web.vm.pem');
+my $key_file = catfile($BUGZILLA_DIR, 'bmo-web.vm-key.pem');
+
+if ($MOJO_LISTEN && -f $cert_file && -f $key_file) {
+ $MOJO_LISTEN .= ",https://*:443?cert=$cert_file&key=$key_file";
+}
+
+push @PERL5LIB, catdir($BUGZILLA_DIR, qw(local lib perl5));
+unshift @PATH, catdir($BUGZILLA_DIR, qw(local bin));
+$BUGZILLA_ALLOW_INSECURE_HTTP //= 1;
+$MOJO_REVERSE_PROXY //= $BUGZILLA_DIR ne '/vagrant';
+
+my @files
+ = ('Bugzilla.pm', 'Bugzilla', glob("*.cgi"), 'extensions', 'template');
+my @watch = map { ('-w' => $_) } (@files);
+
+exec morbo => @watch, '-v', 'bugzilla.pl';
copy: src=re.pl dest=/usr/local/bin/re.pl mode=0755
- name: copy start_morbo
- copy: src=start_morbo dest=/usr/local/bin/start_morbo mode=0755
+ file: path=/usr/local/bin/start_morbo src=/vagrant/scripts/start_morbo state=link force=true
- name: copy use-nytprof
copy: src=use-nytprof dest=/usr/local/bin/use-nytprof mode=0755
+++ /dev/null
-#!/usr/bin/env perl
-
-my $cert_file = '/vagrant/bmo-web.vm.pem';
-my $key_file = '/vagrant/bmo-web.vm-key.pem';
-my $listen = 'http://*:80';
-
-if (-f $cert_file && -f $key_file) {
- $listen .= ",https://*:443?cert=$cert_file&key=$key_file";
-}
-
-$ENV{PERL5LIB} = '/vagrant/local/lib/perl5';
-$ENV{PATH} = "/vagrant/local/bin:$ENV{PATH}";
-$ENV{MOJO_LISTEN} = $listen;
-$ENV{BUGZILLA_ALLOW_INSECURE_HTTP} = 1;
-
-my @files
- = ('Bugzilla.pm', 'Bugzilla', glob("*.cgi"), 'extensions', 'template');
-my @watch = map { ('-w' => $_) } (@files);
-
-system morbo => @watch, '-v', 'bugzilla.pl';