Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add a host config parameter for S3 storages
  • Loading branch information
tonycoz committed Jul 22, 2016
1 parent b55d4af commit baf657a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions site/cgi-bin/modules/BSE/Storage/AmazonS3.pm
Expand Up @@ -5,7 +5,7 @@ our @ISA = qw(BSE::Storage::Base);
use Net::Amazon::S3;
use Carp qw(confess);

our $VERSION = "1.000";
our $VERSION = "1.001";

sub new {
my ($class, %opts) = @_;
Expand All @@ -19,6 +19,7 @@ sub new {
or confess "Missing $key from configuration";
}
$self->{prefix} = $self->configure('prefix', '');
$self->{host} = $self->configure('host', 's3.amazonaws.com');

return $self;
}
Expand All @@ -30,7 +31,8 @@ sub _connect {
(
{
aws_access_key_id => $self->{keyid},
aws_secret_access_key => $self->{accesskey}
aws_secret_access_key => $self->{accesskey},
host => $self->{host},
}
);

Expand Down Expand Up @@ -142,9 +144,17 @@ BSE::Storage::AmazonS3 - storage that stores via Amazon S3.
accesskey=...
bucket=ftppassword
cond=...
host=...
=head1 DESCRIPTION
This is a BSE storage that accesses the remote store via Amazon S3.
C<host> must be set to the end-point matching the location of the
bucket, see:
http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
for details. Defaults to C<s3.amazonaws.com> if not set.
=cut

0 comments on commit baf657a

Please sign in to comment.