mirror of
https://github.com/restic/restic.git
synced 2026-11-06 15:29:21 +00:00
s3: add option to disable AWS dual-stack endpoints (#22060)
Co-authored-by: Michael Eischer <michael.eischer@fau.de>
This commit is contained in:
1 parent
b5463d900d
commit
83a2726a30
4 files changed
+23
No files matched your search
@@ -32,6 +32,7 @@ type Config struct {
|
||||
Region string `option:"region" help:"set region"`
|
||||
BucketLookup string `option:"bucket-lookup" help:"bucket lookup style: 'auto', 'dns', or 'path'"`
|
||||
ListObjectsV1 bool `option:"list-objects-v1" help:"use deprecated V1 api for ListObjects calls"`
|
||||
DisableDualstack bool `option:"disable-dualstack" help:"do not use AWS S3 dual-stack endpoints, which VPC endpoints do not support"`
|
||||
UnsafeAnonymousAuth bool `option:"unsafe-anonymous-auth" help:"use anonymous authentication"`
|
||||
|
||||
// For testing only
|
||||
|
||||
@@ -89,6 +89,12 @@ func open(cfg Config, rt http.RoundTripper) (*s3, error) {
|
||||
return nil, errors.Wrap(err, "minio.New")
|
||||
}
|
||||
|
||||
if cfg.DisableDualstack {
|
||||
// VPC interface and gateway endpoints have no dual-stack support, so
|
||||
// resolving to one makes the bucket unreachable from within the VPC
|
||||
client.SetS3EnableDualstack(false)
|
||||
}
|
||||
|
||||
be := &s3{
|
||||
client: client,
|
||||
cfg: cfg,
|
||||
|
||||
Reference in new issue
Block a user