* For products that are directories (like manuals), allow a default
suffix other than index.html to be declared. E.g. if a build does echo "doc manual $out manual.html" >> $out/nix-support/hydra-build-products the default link for the product is http://localhost:3000/build/417/download/1/manual.html but other files are also accessible, e.g. http://localhost:3000/build/417/download/1/style.css
This commit is contained in:
@ -80,13 +80,17 @@ sub loadLog {
|
||||
|
||||
|
||||
sub download : Chained('build') PathPart('download') {
|
||||
my ($self, $c, $productnr, $filename, @path) = @_;
|
||||
my ($self, $c, $productnr, @path) = @_;
|
||||
|
||||
my $product = $c->stash->{build}->buildproducts->find({productnr => $productnr});
|
||||
notFound($c, "Build doesn't have a product $productnr.") if !defined $product;
|
||||
|
||||
notFound($c, "Product " . $product->path . " has disappeared.") unless -e $product->path;
|
||||
|
||||
# If the product has a name, then the first path element can be
|
||||
# ignored (it's the name included in the URL for informational purposes).
|
||||
shift @path if $product->name;
|
||||
|
||||
# Security paranoia.
|
||||
foreach my $elem (@path) {
|
||||
error($c, "Invalid filename $elem.") if $elem !~ /^$pathCompRE$/;
|
||||
@ -104,6 +108,8 @@ sub download : Chained('build') PathPart('download') {
|
||||
|
||||
notFound($c, "File $path does not exist.") if !-e $path;
|
||||
|
||||
notFound($c, "Path $path is a directory.") if -d $path;
|
||||
|
||||
$c->serve_static_file($path);
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
|
||||
__PACKAGE__->load_classes;
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QcB8T/bY2/Pw34uuYXt2Cw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hRwus0A1vxnFCzQxghFgTw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -36,8 +36,8 @@ __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
|
||||
__PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7Th7GxvR7m/DdodQqlmJXQ
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:H25BhHe9wbU6nj6fSKjZnw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -28,13 +28,15 @@ __PACKAGE__->add_columns(
|
||||
{ data_type => "text", is_nullable => 0, size => undef },
|
||||
"description",
|
||||
{ data_type => "text", is_nullable => 0, size => undef },
|
||||
"defaultpath",
|
||||
{ data_type => "text", is_nullable => 0, size => undef },
|
||||
);
|
||||
__PACKAGE__->set_primary_key("build", "productnr");
|
||||
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:FFVpdoV0vBLhF9yyKJSoTA
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rfkj/A+Li7Q0hWydqtJHAw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -31,8 +31,8 @@ __PACKAGE__->set_primary_key("id");
|
||||
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CkjyZptB79J32VhDbXhKEg
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wmL9881G+dZrgHKM83dHXw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -27,8 +27,8 @@ __PACKAGE__->set_primary_key("id");
|
||||
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HeodRHEOs/do8RKwDJhaXg
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6cTj5JovtTmtemvQjWtucQ
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -35,8 +35,8 @@ __PACKAGE__->set_primary_key("id", "stepnr");
|
||||
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kKpIuRMrqdh7m4M5XPIEgg
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LyNlkn5XjBnLp7M4ipB/ZQ
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -76,8 +76,8 @@ __PACKAGE__->has_many(
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:fGOOscNFEgDZpeVpA6HH0w
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8U9CmcfeowLJVViKiR3n1g
|
||||
|
||||
__PACKAGE__->has_many(dependents => 'Hydra::Schema::BuildInputs', 'dependency');
|
||||
|
||||
|
@ -22,8 +22,8 @@ __PACKAGE__->add_columns(
|
||||
__PACKAGE__->set_primary_key("srcpath", "sha256hash");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0wY3JTSelPQSTbxpNQDJjg
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+F3EiYsvXuOjnGDrkhLxng
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -20,8 +20,8 @@ __PACKAGE__->add_columns(
|
||||
__PACKAGE__->set_primary_key("uri", "revision");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:eZPs3SB3XZW5BNQOQFrFBw
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:O0QvXjOulMVTjhW4rRHkmQ
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -31,8 +31,8 @@ __PACKAGE__->belongs_to(
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:atlyxsSKg41KbDkbCfuvHQ
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qXh+0QbMUHIDmQCG9T5qdA
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -43,8 +43,8 @@ __PACKAGE__->has_many(
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:85ro4sVmhc3HwAjgoA6p6w
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TUTdwfhSsFMKBXa/wKenOQ
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -50,8 +50,8 @@ __PACKAGE__->has_many(
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c5PqrzN43jEGGrzKqI6WWQ
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dVevQ8lPI2/IRpYoJgzLBA
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -45,8 +45,8 @@ __PACKAGE__->has_many(
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7iZYMDM+wn+Neud0Fm1ZMA
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Q5mSKzMxB9px2ja8NjK/9Q
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -32,8 +32,8 @@ __PACKAGE__->belongs_to(
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rs3CRPpzFi30sAeHVe1yQA
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+Ky8V3sZIgT22hgF27Y0cw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -29,8 +29,8 @@ __PACKAGE__->has_many(
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PA+dfXHaBsSx9kE1mEZZ9w
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:f+4AnWTJsi4RDfxoJxECgw
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -16,8 +16,8 @@ __PACKAGE__->add_columns(
|
||||
__PACKAGE__->set_primary_key("system");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:olHboRdtxD6E7Ukr4aCLCA
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Af/LU15/hpXngfrBrDMI/A
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -17,8 +17,8 @@ __PACKAGE__->set_primary_key("username", "role");
|
||||
__PACKAGE__->belongs_to("username", "Hydra::Schema::Users", { username => "username" });
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Q7Nd3wv7Y3184GhkE/pdFA
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/yDlbFhRYDzf+0VHzygrhA
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
@ -30,8 +30,8 @@ __PACKAGE__->has_many(
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-04 14:50:30
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z8fRKy//Mx8wqymMgOcrWA
|
||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-06 14:20:12
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d7M/Q6OucU9NUCSB5zZK7Q
|
||||
|
||||
|
||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||
|
Reference in New Issue
Block a user