fix(s3): DigitalOcean storage buckets do not work

This commit is contained in:
peaklabs-dev
2025-01-25 23:40:40 +01:00
parent 91d90ccb6c
commit 12c7ee2879
3 changed files with 0 additions and 9 deletions

View File

@@ -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 {

View File

@@ -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(),
]); ]);

View File

@@ -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(),
]); ]);
} }