From 1d5312943550b2bbebbdd0238e786b61c28fa68b Mon Sep 17 00:00:00 2001 From: Rawley <75388349+rawleyfowler@users.noreply.github.com> Date: Tue, 14 Mar 2023 12:14:48 +0000 Subject: [PATCH 1/2] Add Dockerfile (#22) * added perl makefile * fixup gitignore and eval * add docker file --- http/Dockerfile | 15 +++++++++++++++ http/Makefile.PL | 2 +- http/sakisafe.pl | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 http/Dockerfile diff --git a/http/Dockerfile b/http/Dockerfile new file mode 100644 index 0000000..1ac00ee --- /dev/null +++ b/http/Dockerfile @@ -0,0 +1,15 @@ +FROM perl:latest AS build + +EXPOSE 3000 + +COPY . /sakisafe +COPY ./public /sakisafe/public + +WORKDIR /sakisafe + +RUN perl "Makefile.PL" +RUN make install +RUN cpan List::MoreUtils Path::Tiny MIME::Types Mojolicious Mojolicious::Plugin::RenderFile Mojolicious::Routes::Pattern + +FROM build +CMD ["perl", "sakisafe.pl", "daemon"] diff --git a/http/Makefile.PL b/http/Makefile.PL index cb476f4..441bf8f 100644 --- a/http/Makefile.PL +++ b/http/Makefile.PL @@ -4,7 +4,7 @@ use ExtUtils::MakeMaker; WriteMakefile( NAME => 'sakisafe', - PREREQ_PM => { + CONFIGURE_REQUIRES => { "Mojolicious" => 0, "List::MoreUtils" => 0, "Term::ANSIColor" => 0, diff --git a/http/sakisafe.pl b/http/sakisafe.pl index 54b287c..c7bb595 100755 --- a/http/sakisafe.pl +++ b/http/sakisafe.pl @@ -129,7 +129,7 @@ app->start; # Index template -#By default Mojolicious gets the "directory root" from the "public" +# By default Mojolicious gets the "directory root" from the "public" # directory, so the css and the favicon from the "public" directory, # in the root of this repo. From 338c4c27718fd00af4adb9636c123479df044068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Palomares=20Pizarro?= Date: Wed, 15 Mar 2023 14:54:25 +0100 Subject: [PATCH 2/2] Added POD documentation to sakisafe.pl --- http/sakisafe.pl | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/http/sakisafe.pl b/http/sakisafe.pl index c7bb595..c3b24b5 100755 --- a/http/sakisafe.pl +++ b/http/sakisafe.pl @@ -118,7 +118,6 @@ get '/f/:dir/#name' => sub ($c) { format => $ext, content_disposition => 'inline' ); - }; app->max_request_size( 1024 * 1024 * 100 ); @@ -190,3 +189,28 @@ __DATA__ + + +=pod + +=head1 sakisafe + +sakisafe is a web application using the Mojolicious framework which +allow users to simply upload and share files. + +=head2 synopsis + +C<./sakisafe.pl daemon -m production> + +This will start sakisafe in port 3000. Which should be proxied with +nginx or any reverse proxy software. + +=head2 license + +The Unlicense. + +=head2 author + +Raoul Vaughn + +=cut