From c4e9c0a4baf6af057e87316cccf3ed9c81fa8aec Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 3 May 2020 20:49:09 -0700 Subject: [PATCH] Better S3 backup generation support --- app/Extensions/Backups/BackupManager.php | 4 ++-- app/Services/Backups/InitiateBackupService.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Extensions/Backups/BackupManager.php b/app/Extensions/Backups/BackupManager.php index 36384297d..fda52f90a 100644 --- a/app/Extensions/Backups/BackupManager.php +++ b/app/Extensions/Backups/BackupManager.php @@ -3,11 +3,11 @@ namespace Pterodactyl\Extensions\Backups; use Closure; +use Aws\S3\S3Client; use Illuminate\Support\Arr; use Illuminate\Support\Str; use Webmozart\Assert\Assert; use InvalidArgumentException; -use Aws\S3\S3MultiRegionClient; use League\Flysystem\AdapterInterface; use League\Flysystem\AwsS3v3\AwsS3Adapter; use League\Flysystem\Memory\MemoryAdapter; @@ -160,7 +160,7 @@ class BackupManager $config['credentials'] = Arr::only($config, ['key', 'secret', 'token']); } - $client = new S3MultiRegionClient($config); + $client = new S3Client($config); return new AwsS3Adapter($client, $config['bucket'], $config['prefix'] ?? '', $config['options'] ?? []); } diff --git a/app/Services/Backups/InitiateBackupService.php b/app/Services/Backups/InitiateBackupService.php index fd4e53a2e..da11d9224 100644 --- a/app/Services/Backups/InitiateBackupService.php +++ b/app/Services/Backups/InitiateBackupService.php @@ -154,7 +154,7 @@ class InitiateBackupService $client->getCommand('PutObject', [ 'Bucket' => $adapter->getBucket(), 'Key' => $path, - 'ContentType' => 'binary/octet-stream', + 'ContentType' => 'application/x-gzip', ]), CarbonImmutable::now()->addMinutes(30) );