diff --git a/.gitignore b/.gitignore index bf59535..9c2ec04 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ MANIFEST* META.*/ MYMETA.* pm_to_blib +sakisafe.log +f/ diff --git a/http/Makefile.PL b/http/Makefile.PL index 476e434..cb476f4 100644 --- a/http/Makefile.PL +++ b/http/Makefile.PL @@ -1,3 +1,5 @@ +use v5.36; + use ExtUtils::MakeMaker; WriteMakefile( @@ -7,7 +9,9 @@ WriteMakefile( "List::MoreUtils" => 0, "Term::ANSIColor" => 0, "MIME::Types" => 0, - "Path::Tiny" => 0 + "Path::Tiny" => 0, + "Mojolicious::Plugin::RenderFile" => 0, + "Mojolicious::Routes::Pattern" => 0 }, EXE_FILES => ['sakisafe.pl'] ); diff --git a/http/sakisafe.pl b/http/sakisafe.pl index 7990fac..54b287c 100755 --- a/http/sakisafe.pl +++ b/http/sakisafe.pl @@ -22,7 +22,7 @@ pledge("stdio cpath rpath wpath inet flock fattr") if $^O eq "openbsd"; my $MAX_SIZE = 1024 * 1024 * 100; -my @BANNED = path('banned.txt')->slurp_utf8 || qw(); # Add banned IP addresses here +my @BANNED = eval { path('banned.txt')->slurp_utf8 } or qw(); # Add banned IP addresses here my $dirname; my $link; @@ -119,8 +119,8 @@ get '/f/:dir/#name' => sub ($c) { content_disposition => 'inline' ); -} -; +}; + app->max_request_size( 1024 * 1024 * 100 ); post '/upload' => sub ($c) { handle_file($c) };