Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor 28 generic s3 #45

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Storage/Device/BackBlaze.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Utopia\Storage\Device\S3;


class BackBlaze extends S3
{
/**
Expand Down Expand Up @@ -31,8 +32,8 @@ class BackBlaze extends S3
*/
public function __construct(string $root, string $accessKey, string $secretKey, string $bucket, string $region = self::US_WEST_004, string $acl = self::ACL_PRIVATE)
{
parent::__construct($root, $accessKey, $secretKey, $bucket, $region, $acl);
$this->headers['host'] = $bucket . '.' . 's3' . '.' . $region . '.backblazeb2.com';
$hostName = $bucket . '.' . 's3' . '.' . $region . '.backblazeb2.com';
parent::__construct($root, $accessKey, $secretKey, $bucket, $region, $acl, $hostName);
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/Storage/Device/DOSpaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Utopia\Storage\Device\S3;


class DOSpaces extends S3
{
/**
Expand All @@ -29,8 +30,8 @@ class DOSpaces extends S3
*/
public function __construct(string $root, string $accessKey, string $secretKey, string $bucket, string $region = self::NYC3, string $acl = self::ACL_PRIVATE)
{
parent::__construct($root, $accessKey, $secretKey, $bucket, $region, $acl);
$this->headers['host'] = $bucket . '.' . $region . '.digitaloceanspaces.com';
$hostName = $bucket . '.' . $region . '.digitaloceanspaces.com';
parent::__construct($root, $accessKey, $secretKey, $bucket, $region, $acl, $hostName);
}

/**
Expand Down
13 changes: 7 additions & 6 deletions src/Storage/Device/Linode.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

use Utopia\Storage\Device\S3;


class Linode extends S3
{
/**
* Regions constants
*
*/
const EU_CENTRAL_1='eu-central-1';
const US_SOUTHEAST_1='us-southeast-1';
const US_EAST_1='us-east-1';
const AP_SOUTH_1='ap-south-1';
const EU_CENTRAL_1 = 'eu-central-1';
const US_SOUTHEAST_1 = 'us-southeast-1';
const US_EAST_1 = 'us-east-1';
const AP_SOUTH_1 = 'ap-south-1';


/**
Expand All @@ -28,8 +29,8 @@ class Linode extends S3
*/
public function __construct(string $root, string $accessKey, string $secretKey, string $bucket, string $region = self::EU_CENTRAL_1, string $acl = self::ACL_PRIVATE)
{
parent::__construct($root, $accessKey, $secretKey, $bucket, $region, $acl);
$this->headers['host'] = $bucket.'.'.$region.'.'.'linodeobjects.com';
$hostName = $bucket.'.'.$region.'.linodeobjects.com';
parent::__construct($root, $accessKey, $secretKey, $bucket, $region, $acl, $hostName);
}

/**
Expand Down
Loading