@ -99,13 +99,13 @@ const gcsGatewayTemplate = `NAME:
{ { . HelpName } } - { { . Usage } }
{ { . HelpName } } - { { . Usage } }
USAGE :
USAGE :
{ { . HelpName } } { { if . VisibleFlags } } [ FLAGS ] { { end } } PROJECTID
{ { . HelpName } } { { if . VisibleFlags } } [ FLAGS ] { { end } } [ PROJECTID ]
{ { if . VisibleFlags } }
{ { if . VisibleFlags } }
FLAGS :
FLAGS :
{ { range . VisibleFlags } } { { . } }
{ { range . VisibleFlags } } { { . } }
{ { end } } { { end } }
{ { end } } { { end } }
PROJECTID :
PROJECTID :
GCS project id , there are no defaults this is mandatory .
GCS project - id should be provided if GOOGLE_APPLICATION_CREDENTIALS environmental variable is not set .
ENVIRONMENT VARIABLES :
ENVIRONMENT VARIABLES :
ACCESS :
ACCESS :
@ -115,6 +115,9 @@ ENVIRONMENT VARIABLES:
BROWSER :
BROWSER :
MINIO_BROWSER : To disable web browser access , set this value to "off" .
MINIO_BROWSER : To disable web browser access , set this value to "off" .
GCS credentials file :
GOOGLE_APPLICATION_CREDENTIALS : Path to credentials . json
EXAMPLES :
EXAMPLES :
1. Start minio gateway server for GCS backend .
1. Start minio gateway server for GCS backend .
$ export GOOGLE_APPLICATION_CREDENTIALS = / path / to / credentials . json
$ export GOOGLE_APPLICATION_CREDENTIALS = / path / to / credentials . json
@ -319,7 +322,12 @@ func gcsGatewayMain(ctx *cli.Context) {
cli . ShowCommandHelpAndExit ( ctx , "gcs" , 1 )
cli . ShowCommandHelpAndExit ( ctx , "gcs" , 1 )
}
}
if ! isValidGCSProjectIDFormat ( ctx . Args ( ) . First ( ) ) {
projectID := ctx . Args ( ) . First ( )
if projectID == "" && os . Getenv ( "GOOGLE_APPLICATION_CREDENTIALS" ) == "" {
errorIf ( errGCSProjectIDNotFound , "project-id should be provided as argument or GOOGLE_APPLICATION_CREDENTIALS should be set with path to credentials.json" )
cli . ShowCommandHelpAndExit ( ctx , "gcs" , 1 )
}
if projectID != "" && ! isValidGCSProjectIDFormat ( projectID ) {
errorIf ( errGCSInvalidProjectID , "Unable to start GCS gateway with %s" , ctx . Args ( ) . First ( ) )
errorIf ( errGCSInvalidProjectID , "Unable to start GCS gateway with %s" , ctx . Args ( ) . First ( ) )
cli . ShowCommandHelpAndExit ( ctx , "gcs" , 1 )
cli . ShowCommandHelpAndExit ( ctx , "gcs" , 1 )
}
}