aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.default.pl3
-rwxr-xr-xperl/cgi.pl14
2 files changed, 11 insertions, 6 deletions
diff --git a/config.default.pl b/config.default.pl
index 326ddcf..0e7e6bf 100644
--- a/config.default.pl
+++ b/config.default.pl
@@ -1,7 +1,5 @@
# always assume anything to do with files or directories is ran at project root
-no warnings;
-
use constant {
# If you're using lighttpd, set this to 1
@@ -10,6 +8,7 @@ BARE_REQUEST => 0,
IMMORTAL => 1, # will continue handling request after death/error
+LOG_FILE => '/tmp/gorillanest.log',
DB_FILE => 'gorillanest.sqlite3', # sqlite3
SOCKET_FILE => '/tmp/gorillanest.socket',
diff --git a/perl/cgi.pl b/perl/cgi.pl
index d19c915..b802979 100755
--- a/perl/cgi.pl
+++ b/perl/cgi.pl
@@ -21,8 +21,14 @@ use Data::Dumper;
use Git::Repository;
use lib qw(. ..);
-BEGIN { require 'config.default.pl'; }
-BEGIN { require 'config.pl' if -f 'config.pl'; }
+BEGIN {
+ # ignores redefinition... and everything else
+ open my $stderr, '>&', \*STDERR;
+ open STDERR, '>', '/dev/null';
+ require 'config.default.pl';
+ require 'config.pl' if -f 'config.pl';
+ open STDERR, '>&', $stderr;
+}
sub info {
warn join(' ', @_);
@@ -87,13 +93,13 @@ my $dbfile = DB_FILE;
my %data = (
found => 0,
-);
+ );
my %routes = (
'/' => sub { GN::index($root); },
'/~([\w.]+)' => sub { GN::user($root, @_) },
'/~([\w.]+)/([\w.]+)' => sub { GN::repository($root, @_) },
-);
+ );
my %route_regex_cache = map { $_ => qr{^$_$} } keys %routes;
sub master {