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 && \
make install make install
run mkdir -p /opt/data/plans run rm -rf /tmp/minisign && \
mkdir -p /opt/data/plans
copy schema.sql /opt/data copy schema.sql /opt/data
run cat /opt/data/schema.sql | sqlite3 /opt/data/users.db run cat /opt/data/schema.sql | sqlite3 /opt/data/users.db
run rm /opt/data/schema.sql run rm /opt/data/schema.sql

View File

@ -99,6 +99,38 @@ if (defined $ENV{'LOCAL_DOMAINS'}) {
################# #################
# Request Routing # Request Routing
################# #################
#
my $routes = [
{
path => qr/^\/plan\/([^\/]{$minimum_email_length,$maximum_email_length})$/,
methods => {
GET => {handler => \&get_plan, valid_types => ['application/json', 'text/plain']},
HEAD => {handler => \&get_plan, valid_types => ['application/json', 'text/plain']},
PUT => {handler => \&update_plan, valid_types => ['application/json']}
}
},
{
path => qr/^\/token$/,
methods => {
GET => {handler => \&get_token, valid_types => ['application/json']},
DELETE => {handler => \&delete_token, valid_types => ['application/json']}
}
},
{
path => qr/^\/users\/([^\/]{$minimum_email_length,$maximum_email_length})\/pwchange$/,
methods => {
GET => {handler => \&get_pwtoken, valid_types => ['application/json']},
PUT => {handler => \&update_password, valid_types => ['application/json']}
}
},
{
path => qr/^\/users\/([^\/]{$minimum_email_length,$maximum_email_length})$/,
methods => {
POST => {handler => \&create_user, valid_types => ['application/json']},
PUT => {handler => \&validate_email, valid_types => ['application/json']}
}
},
];
sub handle_request { sub handle_request {
my ($self, $cgi) = @_; my ($self, $cgi) = @_;
@ -124,38 +156,6 @@ if (defined $ENV{'LOCAL_DOMAINS'}) {
$cgi->param('json-body', {}); $cgi->param('json-body', {});
} }
my $routes = [
{
path => qr/^\/plan\/([^\/]{$minimum_email_length,$maximum_email_length})$/,
methods => {
GET => {handler => \&get_plan, valid_types => ['application/json', 'text/plain']},
HEAD => {handler => \&get_plan, valid_types => ['application/json', 'text/plain']},
PUT => {handler => \&update_plan, valid_types => ['application/json']}
}
},
{
path => qr/^\/token$/,
methods => {
GET => {handler => \&get_token, valid_types => ['application/json']},
DELETE => {handler => \&delete_token, valid_types => ['application/json']}
}
},
{
path => qr/^\/users\/([^\/]{$minimum_email_length,$maximum_email_length})\/pwchange$/,
methods => {
GET => {handler => \&get_pwtoken, valid_types => ['application/json']},
PUT => {handler => \&update_password, valid_types => ['application/json']}
}
},
{
path => qr/^\/users\/([^\/]{$minimum_email_length,$maximum_email_length})$/,
methods => {
POST => {handler => \&create_user, valid_types => ['application/json']},
PUT => {handler => \&validate_email, valid_types => ['application/json']}
}
},
];
eval { eval {
util_log("REQ $req_id $method $path"); util_log("REQ $req_id $method $path");