fix(s3): DigitalOcean storage buckets do not work
This commit is contained in:
@@ -40,11 +40,6 @@ class S3Storage extends BaseModel
|
|||||||
return "{$this->endpoint}/{$this->bucket}";
|
return "{$this->endpoint}/{$this->bucket}";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isDigitalOcean()
|
|
||||||
{
|
|
||||||
return str($this->endpoint)->contains('digitaloceanspaces.com');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testConnection(bool $shouldSave = false)
|
public function testConnection(bool $shouldSave = false)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
@@ -208,7 +208,6 @@ function deleteBackupsS3(string|array|null $filenames, S3Storage $s3): void
|
|||||||
'bucket' => $s3->bucket,
|
'bucket' => $s3->bucket,
|
||||||
'endpoint' => $s3->endpoint,
|
'endpoint' => $s3->endpoint,
|
||||||
'use_path_style_endpoint' => true,
|
'use_path_style_endpoint' => true,
|
||||||
'bucket_endpoint' => $s3->isDigitalOcean(),
|
|
||||||
'aws_url' => $s3->awsUrl(),
|
'aws_url' => $s3->awsUrl(),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@@ -4,8 +4,6 @@ use App\Models\S3Storage;
|
|||||||
|
|
||||||
function set_s3_target(S3Storage $s3)
|
function set_s3_target(S3Storage $s3)
|
||||||
{
|
{
|
||||||
$is_digital_ocean = false;
|
|
||||||
|
|
||||||
config()->set('filesystems.disks.custom-s3', [
|
config()->set('filesystems.disks.custom-s3', [
|
||||||
'driver' => 's3',
|
'driver' => 's3',
|
||||||
'region' => $s3['region'],
|
'region' => $s3['region'],
|
||||||
@@ -14,7 +12,6 @@ function set_s3_target(S3Storage $s3)
|
|||||||
'bucket' => $s3['bucket'],
|
'bucket' => $s3['bucket'],
|
||||||
'endpoint' => $s3['endpoint'],
|
'endpoint' => $s3['endpoint'],
|
||||||
'use_path_style_endpoint' => true,
|
'use_path_style_endpoint' => true,
|
||||||
'bucket_endpoint' => $s3->isDigitalOcean(),
|
|
||||||
'aws_url' => $s3->awsUrl(),
|
'aws_url' => $s3->awsUrl(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user