clean up minisign source during docker build

This commit is contained in:
Rudis Muiznieks 2020-07-23 18:45:16 -05:00
parent f4eda3697e
commit d0eee0c992
2 changed files with 35 additions and 33 deletions

View File

@ -15,7 +15,9 @@ run mkdir -p /tmp/minisign && \
make && \
make install
run mkdir -p /opt/data/plans
run rm -rf /tmp/minisign && \
mkdir -p /opt/data/plans
copy schema.sql /opt/data
run cat /opt/data/schema.sql | sqlite3 /opt/data/users.db
run rm /opt/data/schema.sql

View File

@ -99,31 +99,7 @@ if (defined $ENV{'LOCAL_DOMAINS'}) {
#################
# Request Routing
#################
sub handle_request {
my ($self, $cgi) = @_;
# assign a random request id for anonymous logging
my $req_id = util_token(12);
$cgi->param('request_id', $req_id);
my $path = $cgi->path_info();
$path =~ s{^https?://([^/:]+)(:\d+)?/}{/};
$cgi->{'.path_info'} = '/index.html' if $path eq '/';
my $method = $cgi->request_method();
my $accept = HTTP::Accept->new($cgi->http('Accept'));
$cgi->param('accept', $accept);
my $body = $cgi->param('POSTDATA') || $cgi->param('PUTDATA');
if (defined $body) {
eval {
$cgi->param('json-body', decode_json($body));
};
if ($@) {
print_json_response($cgi, 400, {error => 'Unable to parse json payload.'});
return;
}
} else {
$cgi->param('json-body', {});
}
#
my $routes = [
{
path => qr/^\/plan\/([^\/]{$minimum_email_length,$maximum_email_length})$/,
@ -156,6 +132,30 @@ if (defined $ENV{'LOCAL_DOMAINS'}) {
},
];
sub handle_request {
my ($self, $cgi) = @_;
# assign a random request id for anonymous logging
my $req_id = util_token(12);
$cgi->param('request_id', $req_id);
my $path = $cgi->path_info();
$path =~ s{^https?://([^/:]+)(:\d+)?/}{/};
$cgi->{'.path_info'} = '/index.html' if $path eq '/';
my $method = $cgi->request_method();
my $accept = HTTP::Accept->new($cgi->http('Accept'));
$cgi->param('accept', $accept);
my $body = $cgi->param('POSTDATA') || $cgi->param('PUTDATA');
if (defined $body) {
eval {
$cgi->param('json-body', decode_json($body));
};
if ($@) {
print_json_response($cgi, 400, {error => 'Unable to parse json payload.'});
return;
}
} else {
$cgi->param('json-body', {});
}
eval {
util_log("REQ $req_id $method $path");