diff options
| author | Emil Williams | 2025-08-21 02:06:04 +0000 |
|---|---|---|
| committer | Emil Williams | 2025-08-21 02:06:04 +0000 |
| commit | c257a3cbe2e83ebefef330d64c4ac7fc94ffc8a5 (patch) | |
| tree | 6d9f2806df63b3942e39a6697d01eec93c554b3c /perl/cgi.pl | |
| parent | 48d408d4ecdb992552a4560c95d147605dcdfba0 (diff) | |
| download | gorillanest-c257a3cbe2e83ebefef330d64c4ac7fc94ffc8a5.tar.xz gorillanest-c257a3cbe2e83ebefef330d64c4ac7fc94ffc8a5.tar.zst | |
Shut It Down!
Diffstat (limited to 'perl/cgi.pl')
| -rwxr-xr-x | perl/cgi.pl | 14 |
1 files changed, 10 insertions, 4 deletions
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 { |
