diff --git a/Makefile b/Makefile index e3e9c9ed..b4e765bc 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,10 @@ pkg-update: pkg-remove: @GO15VENDOREXPERIMENT=1 govendor remove $(PKG) +release: build + @MINIO_RELEASE=OFFICIAL GO15VENDOREXPERIMENT=1 go build --ldflags $(BUILD_LDFLAGS) -o $(GOPATH)/bin/mc + @mkdir -p $(HOME)/.mc + install: gomake-all clean: diff --git a/README.md b/README.md index 0b98b5c4..ca399098 100644 --- a/README.md +++ b/README.md @@ -72,10 +72,6 @@ $ go get -u github.com/minio/mc Minio cloud storage server is hosted at ``https://play.minio.io:9000`` for public use. This service is primarily intended for developers and users to familiarize themselves with Amazon S3 compatible cloud storage. Minio runs with filesystem backend with auto-expiry for objects in about 24 hours. No account signup is required, which means S3 compatible tools and applications can access this service without access and secret keys. -## How to use mc? - -[![asciicast](https://asciinema.org/a/21576.png)](https://asciinema.org/a/21576?async) - ## Configuring mc for Amazon S3 Get your AccessKeyID and SecretAccessKey by following [AWS Credentials Guide](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSGettingStartedGuide/AWSCredentials.html). diff --git a/access-main.go b/access-main.go index 34ce0e5a..d3246959 100644 --- a/access-main.go +++ b/access-main.go @@ -54,19 +54,19 @@ FLAGS: {{end}} EXAMPLES: 1. Set bucket to "private" on Amazon S3 cloud storage. - $ mc {{.Name}} set private https://s3.amazonaws.com/burningman2011 + $ mc {{.Name}} set private s3.amazonaws.com/burningman2011 2. Set bucket to "public" on Amazon S3 cloud storage. - $ mc {{.Name}} set public https://s3.amazonaws.com/shared + $ mc {{.Name}} set public s3.amazonaws.com/shared 3. Set bucket to "authenticated" on Amazon S3 cloud storage to provide read access to IAM Authenticated Users group. - $ mc {{.Name}} set authorized https://s3.amazonaws.com/shared-authenticated + $ mc {{.Name}} set authorized s3.amazonaws.com/shared-authenticated 4. Get bucket permissions. - $ mc {{.Name}} get https://s3.amazonaws.com/shared + $ mc {{.Name}} get s3.amazonaws.com/shared 5. Get bucket permissions. - $ mc {{.Name}} get https://storage.googleapis.com/miniocloud + $ mc {{.Name}} get storage.googleapis.com/miniocloud `, } diff --git a/cat-main.go b/cat-main.go index 1470985a..a7edf3a3 100644 --- a/cat-main.go +++ b/cat-main.go @@ -54,7 +54,7 @@ FLAGS: {{end}} EXAMPLES: 1. Stream an object from Amazon S3 cloud storage to mplayer standard input. - $ mc {{.Name}} https://s3.amazonaws.com/ferenginar/klingon_opera_aktuh_maylotah.ogg | mplayer - + $ mc {{.Name}} s3.amazonaws.com/ferenginar/klingon_opera_aktuh_maylotah.ogg | mplayer - 2. Concantenate contents of file1.txt and stdin to standard output. $ mc {{.Name}} file1.txt - > file.txt diff --git a/config-host-main.go b/config-host-main.go index af5e2a38..9cf0c023 100644 --- a/config-host-main.go +++ b/config-host-main.go @@ -43,19 +43,19 @@ FLAGS: EXAMPLES: 1. Add host configuration for a URL, using default signature V4. For security reasons turn off bash history $ set +o history - $ mc config {{.Name}} add https://s3.amazonaws.com BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 + $ mc config {{.Name}} add s3.amazonaws.com BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 $ set -o history 2. Add host configuration for a URL, using signature V2. For security reasons turn off bash history $ set +o history - $ mc config {{.Name}} add https://storage.googleapis.com BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 S3v2 + $ mc config {{.Name}} add storage.googleapis.com BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 S3v2 $ set -o history 3. List all hosts. $ mc config {{.Name}} list 4. Remove host config. - $ mc config {{.Name}} remove https://s3.amazonaws.com + $ mc config {{.Name}} remove s3.amazonaws.com `, } @@ -171,9 +171,9 @@ func listHosts() { func removeHost(hostURL string) { if !isValidHostURL(hostURL) { - fatalIf(errDummy().Trace(hostURL), "Invalid host URL: ‘"+hostURL+"’ provided. Valid options are [https://example.test.io, https://bucket.s3.amazonaws.com].") + fatalIf(errDummy().Trace(hostURL), "Invalid host URL: ‘"+hostURL+"’ provided. Valid options are [http://example.test.io, https://bucket.s3.amazonaws.com].") } - if strings.TrimSpace(hostURL) == "https://dl.minio.io:9000" { + if strings.TrimSpace(hostURL) == "dl.minio.io:9000" { fatalIf(errDummy().Trace(hostURL), "‘"+hostURL+"’ is reserved hostname and cannot be removed.") } config, err := newConfig() @@ -202,7 +202,7 @@ func removeHost(hostURL string) { func addHost(newHostURL, accessKeyID, secretAccessKey, api string) { if !isValidHostURL(newHostURL) { fatalIf(errDummy().Trace(newHostURL), - "Invalid host URL: ‘"+newHostURL+"’ provided. Valid options are [https://example.test.io, https://bucket.s3.amazonaws.com].") + "Invalid host URL: ‘"+newHostURL+"’ provided. Valid options are [example.test.io, bucket.s3.amazonaws.com].") } if len(accessKeyID) != 0 { if !isValidAccessKey(accessKeyID) { diff --git a/cp-main.go b/cp-main.go index 8c7824f4..ad5c7c52 100644 --- a/cp-main.go +++ b/cp-main.go @@ -65,13 +65,13 @@ FLAGS: {{end}} EXAMPLES: 1. Copy a list of objects from local file system to Amazon S3 cloud storage. - $ mc {{.Name}} Music/*.ogg https://s3.amazonaws.com/jukebox/ + $ mc {{.Name}} Music/*.ogg s3.amazonaws.com/jukebox/ 2. Copy a folder recursively from Minio cloud storage to Amazon S3 cloud storage. - $ mc {{.Name}} --recursive https://play.minio.io:9000/mybucket/burningman2011/ https://s3.amazonaws.com/mybucket/ + $ mc {{.Name}} --recursive play.minio.io:9000/mybucket/burningman2011/ s3.amazonaws.com/mybucket/ 3. Copy multiple local folders recursively to Minio cloud storage. - $ mc {{.Name}} --recursive backup/2014/ backup/2015/ https://play.minio.io:9000/archive/ + $ mc {{.Name}} --recursive backup/2014/ backup/2015/ play.minio.io:9000/archive/ 4. Copy a bucket recursively from aliased Amazon S3 cloud storage to local filesystem on Windows. $ mc {{.Name}} --recursive s3/documents/2014/ C:\Backups\2014 diff --git a/diff-main.go b/diff-main.go index d6b70b3e..a53ed4ba 100644 --- a/diff-main.go +++ b/diff-main.go @@ -57,7 +57,7 @@ DESCRIPTION: EXAMPLES: 1. Compare a local folder with a folder on Amazon S3 cloud storage. - $ mc {{.Name}} ~/Photos https://s3.amazonaws.com/MyBucket/Photos + $ mc {{.Name}} ~/Photos s3.amazonaws.com/MyBucket/Photos 2. Compare two different folders on a local filesystem. $ mc {{.Name}} ~/Photos /Media/Backup/Photos diff --git a/ls-main.go b/ls-main.go index c9ba95d5..91229f87 100644 --- a/ls-main.go +++ b/ls-main.go @@ -59,10 +59,10 @@ FLAGS: {{end}} EXAMPLES: 1. List buckets on Amazon S3 cloud storage. - $ mc {{.Name}} https://s3.amazonaws.com/ + $ mc {{.Name}} s3.amazonaws.com 2. List buckets and all its contents from Amazon S3 cloud storage recursively. - $ mc {{.Name}} --recursive https://s3.amazonaws.com/ + $ mc {{.Name}} --recursive s3.amazonaws.com 3. List files recursively on a local filesystem on Microsoft Windows. $ mc {{.Name}} --recursive C:\Users\Worf\ diff --git a/mb-main.go b/mb-main.go index dcc04a7f..aa7a338e 100644 --- a/mb-main.go +++ b/mb-main.go @@ -50,10 +50,13 @@ FLAGS: {{end}} EXAMPLES: 1. Create a bucket on Amazon S3 cloud storage. - $ mc {{.Name}} https://s3.amazonaws.com/mynewbucket + $ mc {{.Name}} s3.amazonaws.com/mynewbucket 2. Create a new bucket on Google Cloud Storage. - $ mc {{.Name}} https://storage.googleapis.com/miniocloud + $ mc {{.Name}} storage.googleapis.com/miniocloud + + 3. Create a new bucket on Amazon S3 cloud storage, using virtual bucket request. + $ mc {{.Name}} ferenginar.s3.amazonaws.com 3. Create a new directory including its missing parents (equivalent to ‘mkdir -p’). $ mc {{.Name}} /tmp/this/new/dir1 diff --git a/mirror-main.go b/mirror-main.go index 00f16821..6ed8cd03 100644 --- a/mirror-main.go +++ b/mirror-main.go @@ -64,10 +64,10 @@ FLAGS: {{end}} EXAMPLES: 1. Mirror a bucket recursively from Minio cloud storage to a bucket on Amazon S3 cloud storage. - $ mc {{.Name}} https://play.minio.io:9000/photos/2014 https://s3.amazonaws.com/backup-photos + $ mc {{.Name}} play.minio.io:9000/photos/2014 s3.amazonaws.com/backup-photos 2. Mirror a local folder recursively to Minio cloud storage, Amazon S3 cloud storage and Google Cloud Storage. - $ mc {{.Name}} backup/ https://play.minio.io:9000/archive https://s3.amazonaws.com/archive https://storage.googleapis.com/miniocloud + $ mc {{.Name}} backup/ play.minio.io:9000/archive s3.amazonaws.com/archive storage.googleapis.com/miniocloud 3. Mirror a bucket from aliased Amazon S3 cloud storage to multiple folders on Windows. $ mc {{.Name}} s3/documents/2014/ C:\backup\2014 C:\shared\volume\backup\2014 diff --git a/pipe-main.go b/pipe-main.go index f3843222..cbafbe51 100644 --- a/pipe-main.go +++ b/pipe-main.go @@ -51,13 +51,13 @@ EXAMPLES: $ mc {{.Name}} /tmp/hello-world.go 2. Write contents of stdin to an object on Amazon S3 cloud storage. - $ mc {{.Name}} https://s3.amazonaws.com/personalbuck/meeting-notes.txt + $ mc {{.Name}} s3.amazonaws.com/personalbuck/meeting-notes.txt 3. Copy an ISO image to an object on Amazon S3 cloud storage and Google Cloud Storage simultaneously. - $ cat debian-8.2.iso | mc {{.Name}} https://s3.amazonaws.com/ferenginar/gnuos.iso https://storage.googleapis.com/miniocloud/gnuos.iso + $ cat debian-8.2.iso | mc {{.Name}} s3.amazonaws.com/ferenginar/gnuos.iso storage.googleapis.com/miniocloud/gnuos.iso 4. Stream MySQL database dump to Amazon S3 directly. - $ mysqldump -u root -p ******* accountsdb | mc {{.Name}} https://s3.amazonaws.com/ferenginar/backups/accountsdb-oct-9-2015.sql + $ mysqldump -u root -p ******* accountsdb | mc {{.Name}} s3.amazonaws.com/ferenginar/backups/accountsdb-oct-9-2015.sql `, } diff --git a/rm-main.go b/rm-main.go index 2da43647..a4d7c6f1 100644 --- a/rm-main.go +++ b/rm-main.go @@ -77,19 +77,19 @@ EXAMPLES: $ mc {{.Name}} 1999/old-backup.tgz 2. Remove contents of a folder, excluding its sub-folders. - $ mc {{.Name}} --force https://s3.amazonaws.com/jazz-songs/louis/ + $ mc {{.Name}} --force s3.amazonaws.com/jazz-songs/louis/ 3. Remove contents of a folder recursively. - $ mc {{.Name}} --force --recursive https://s3.amazonaws.com/jazz-songs/louis/ + $ mc {{.Name}} --force --recursive s3.amazonaws.com/jazz-songs/louis/ 4. Remove all matching objects with this prefix. - $ mc {{.Name}} --force https://s3.amazonaws.com/ogg/gunmetal + $ mc {{.Name}} --force s3.amazonaws.com/ogg/gunmetal 5. Drop an incomplete upload of an object. - $ mc {{.Name}} --incomplete https://s3.amazonaws.com/jazz-songs/louis/file01.mp3 + $ mc {{.Name}} --incomplete s3.amazonaws.com/jazz-songs/louis/file01.mp3 6. Drop all incomplete uploads recursively matching this prefix. - $ mc {{.Name}} --incomplete --force --recursive https://s3.amazonaws.com/jazz-songs/louis/ + $ mc {{.Name}} --incomplete --force --recursive s3.amazonaws.com/jazz-songs/louis/ `, } diff --git a/share-download-main.go b/share-download-main.go index 60767274..7baa3a7b 100644 --- a/share-download-main.go +++ b/share-download-main.go @@ -51,16 +51,16 @@ OPTIONS: {{end}} EXAMPLES: 1. Share this object with 7 days default expiry. - $ mc share {{.Name}} https://s3.amazonaws.com/backup/2006-Mar-1/backup.tar.gz + $ mc share {{.Name}} s3.amazonaws.com/backup/2006-Mar-1/backup.tar.gz 2. Share this object with 10 minutes expiry. - $ mc share {{.Name}} --expire=10m https://s3.amazonaws.com/backup/2006-Mar-1/backup.tar.gz + $ mc share {{.Name}} --expire=10m s3.amazonaws.com/backup/2006-Mar-1/backup.tar.gz 3. Share all objects under this folder with 5 days expiry. - $ mc share {{.Name}} --expire=120h https://s3.amazonaws.com/backup/ + $ mc share {{.Name}} --expire=120h s3.amazonaws.com/backup/ 4. Share all objects under this folder and all its sub-folders with 5 days expiry. - $ mc share {{.Name}} --recursive --expire=120h https://s3.amazonaws.com/backup/ + $ mc share {{.Name}} --recursive --expire=120h s3.amazonaws.com/backup/ `, } diff --git a/share-upload-main.go b/share-upload-main.go index 75f1143d..68bee58c 100644 --- a/share-upload-main.go +++ b/share-upload-main.go @@ -49,13 +49,13 @@ OPTIONS: {{end}} EXAMPLES: 1. Generate a curl command to allow upload access for a single object. Command expires after 7 days (default). - $ mc share {{.Name}} https://s3.amazonaws.com/backup/2006-Mar-1/backup.tar.gz + $ mc share {{.Name}} s3.amazonaws.com/backup/2006-Mar-1/backup.tar.gz 2. Generate a curl command to allow upload access to a folder. Command expires in 120 hours. - $ mc share {{.Name}} --expire=120h https://s3.amazonaws.com/backup/2007-Mar-2/... + $ mc share {{.Name}} --expire=120h s3.amazonaws.com/backup/2007-Mar-2/... 3. Generate a curl command to allow upload access of only '.png' images to a folder. Command expires in 2 hours. - $ mc share {{.Name}} --expire=2h --content-type=image/png https://s3.amazonaws.com/backup/2007-Mar-2/... + $ mc share {{.Name}} --expire=2h --content-type=image/png s3.amazonaws.com/backup/2007-Mar-2/... `, }