From: Emil Williams Date: Thu, 21 Aug 2025 02:06:04 +0000 (+0000) Subject: Shut It Down! X-Git-Url: https://git.xolatile.top/?a=commitdiff_plain;h=c257a3cbe2e83ebefef330d64c4ac7fc94ffc8a5;p=gorillanest.git Shut It Down! --- 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 {