|
|
|
@ -180,14 +180,20 @@ const ( |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
// Returns access and secretkey set from environment variables.
|
|
|
|
|
func mustGetGatewayCredsFromEnv() (accessKey, secretKey string) { |
|
|
|
|
func mustGetGatewayConfigFromEnv() (string, string, string) { |
|
|
|
|
// Fetch access keys from environment variables.
|
|
|
|
|
accessKey = os.Getenv("MINIO_ACCESS_KEY") |
|
|
|
|
secretKey = os.Getenv("MINIO_SECRET_KEY") |
|
|
|
|
accessKey := os.Getenv("MINIO_ACCESS_KEY") |
|
|
|
|
secretKey := os.Getenv("MINIO_SECRET_KEY") |
|
|
|
|
if accessKey == "" || secretKey == "" { |
|
|
|
|
fatalIf(errors.New("Missing credentials"), "Access and secret keys are mandatory to run Minio gateway server.") |
|
|
|
|
} |
|
|
|
|
return accessKey, secretKey |
|
|
|
|
|
|
|
|
|
region := globalMinioDefaultRegion |
|
|
|
|
if v := os.Getenv("MINIO_REGION"); v != "" { |
|
|
|
|
region = v |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return accessKey, secretKey, region |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Set browser setting from environment variables
|
|
|
|
@ -336,14 +342,13 @@ func gcsGatewayMain(ctx *cli.Context) { |
|
|
|
|
// Handler for 'minio gateway'.
|
|
|
|
|
func gatewayMain(ctx *cli.Context, backendType gatewayBackend) { |
|
|
|
|
// Fetch access and secret key from env.
|
|
|
|
|
accessKey, secretKey := mustGetGatewayCredsFromEnv() |
|
|
|
|
accessKey, secretKey, region := mustGetGatewayConfigFromEnv() |
|
|
|
|
|
|
|
|
|
// Fetch browser env setting
|
|
|
|
|
mustSetBrowserSettingFromEnv() |
|
|
|
|
|
|
|
|
|
// Initialize new gateway config.
|
|
|
|
|
|
|
|
|
|
newGatewayConfig(accessKey, secretKey, globalMinioDefaultRegion) |
|
|
|
|
newGatewayConfig(accessKey, secretKey, region) |
|
|
|
|
|
|
|
|
|
// Get quiet flag from command line argument.
|
|
|
|
|
quietFlag := ctx.Bool("quiet") || ctx.GlobalBool("quiet") |
|
|
|
|