From 55b70c5943e225fdb0e2e31205563e92735d15b9 Mon Sep 17 00:00:00 2001 From: Lewis Marshall Date: Tue, 18 Sep 2018 17:29:21 +0100 Subject: [PATCH] Add a s3 path style option --- cli.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli.go b/cli.go index 9ba0c64..ec7eb2f 100644 --- a/cli.go +++ b/cli.go @@ -78,6 +78,10 @@ func newCliApplication() *cli.App { Name: "endpoint-url", Usage: "the aws s3 endpoint to use", }, + cli.BoolFlag{ + Name: "s3-path-style", + Usage: "use a path instead of DNS for bucket name", + }, cli.StringFlag{ Name: "environment-file", Usage: "a file containing a list of environment variables", @@ -194,6 +198,9 @@ func (r *cliCommand) getCredentials() func(cx *cli.Context) error { endpoint := cx.GlobalString("endpoint-url") config.Endpoint = &endpoint } + if cx.GlobalBool("s3-path-style") { + config.S3ForcePathStyle = aws.Bool(true) + } // step: are we using static credentials if cx.GlobalString("access-key") != "" || cx.GlobalString("secret-ket") != "" {