Better S3 backup generation support
This commit is contained in:
parent
3e04540c38
commit
c4e9c0a4ba
2 changed files with 3 additions and 3 deletions
|
@ -3,11 +3,11 @@
|
||||||
namespace Pterodactyl\Extensions\Backups;
|
namespace Pterodactyl\Extensions\Backups;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Aws\S3\S3Client;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Aws\S3\S3MultiRegionClient;
|
|
||||||
use League\Flysystem\AdapterInterface;
|
use League\Flysystem\AdapterInterface;
|
||||||
use League\Flysystem\AwsS3v3\AwsS3Adapter;
|
use League\Flysystem\AwsS3v3\AwsS3Adapter;
|
||||||
use League\Flysystem\Memory\MemoryAdapter;
|
use League\Flysystem\Memory\MemoryAdapter;
|
||||||
|
@ -160,7 +160,7 @@ class BackupManager
|
||||||
$config['credentials'] = Arr::only($config, ['key', 'secret', 'token']);
|
$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'] ?? []);
|
return new AwsS3Adapter($client, $config['bucket'], $config['prefix'] ?? '', $config['options'] ?? []);
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ class InitiateBackupService
|
||||||
$client->getCommand('PutObject', [
|
$client->getCommand('PutObject', [
|
||||||
'Bucket' => $adapter->getBucket(),
|
'Bucket' => $adapter->getBucket(),
|
||||||
'Key' => $path,
|
'Key' => $path,
|
||||||
'ContentType' => 'binary/octet-stream',
|
'ContentType' => 'application/x-gzip',
|
||||||
]),
|
]),
|
||||||
CarbonImmutable::now()->addMinutes(30)
|
CarbonImmutable::now()->addMinutes(30)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue