diff --git a/cmd/gateway/manta/gateway-manta.go b/cmd/gateway/manta/gateway-manta.go index 16f51f0a6..8cc3b7b38 100644 --- a/cmd/gateway/manta/gateway-manta.go +++ b/cmd/gateway/manta/gateway-manta.go @@ -117,12 +117,16 @@ EXAMPLES: } func mantaGatewayMain(ctx *cli.Context) { + args := ctx.Args() + if !ctx.Args().Present() { + args = cli.Args{"https://us-east.manta.joyent.com"} + } + // Validate gateway arguments. - host := ctx.Args().First() - // Validate gateway arguments. - logger.FatalIf(minio.ValidateGatewayArguments(ctx.GlobalString("address"), host), "Invalid argument") + logger.FatalIf(minio.ValidateGatewayArguments(ctx.GlobalString("address"), args.First()), "Invalid argument") - minio.StartGateway(ctx, &Manta{host}) + // Start the gateway.. + minio.StartGateway(ctx, &Manta{args.First()}) } // Manta implements Gateway. @@ -139,17 +143,22 @@ func (g *Manta) Name() string { // talk to manta remote backend. func (g *Manta) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) { var err error + var secure bool var signer authentication.Signer var endpoint = defaultMantaURL ctx := context.Background() if g.host != "" { - endpoint, _, err = minio.ParseGatewayEndpoint(g.host) + endpoint, secure, err = minio.ParseGatewayEndpoint(g.host) if err != nil { return nil, err } + if secure { + endpoint = "https://" + endpoint + } else { + endpoint = "http://" + endpoint + } } - if overrideRoot, ok := os.LookupEnv("MANTA_ROOT"); ok { mantaRoot = overrideRoot } diff --git a/docs/gateway/manta.md b/docs/gateway/manta.md index e3073f0a0..052dacbd3 100644 --- a/docs/gateway/manta.md +++ b/docs/gateway/manta.md @@ -20,6 +20,27 @@ export MANTA_KEY_MATERIAL=~/.ssh/id_rsa export MANTA_SUBUSER=devuser minio gateway manta ``` + +## Run Minio Gateway for Manta Object Storage Custom Endpoints +### Using Docker +``` +docker run -p 9000:9000 --name manta-s3 \ + -e "MINIO_ACCESS_KEY=joyentaccountname" \ + -e "MINIO_SECRET_KEY=joyentkeyid" \ + -e "MANTA_KEY_MATERIAL=~/.ssh/id_rsa" \ + -e "MANTA_SUBUSER=devuser" + minio/minio gateway manta https://manta_service_endpoint:port +``` + +### Using Binary +``` +export MINIO_ACCESS_KEY=joyentaccountname +export MINIO_SECRET_KEY=joyentkeyid +export MANTA_KEY_MATERIAL=~/.ssh/id_rsa +export MANTA_SUBUSER=devuser +minio gateway manta https://manta_service_endpoint:port +``` + ## Test using Minio Browser Minio Gateway comes with an embedded web based object browser. Point your web browser to http://127.0.0.1:9000 to ensure that your server has started successfully.