Compare commits

..
2828 Commits
Author SHA1 Message Date
Harshavardhana 1dea194699 minio-go: Vendorize with new changes. 2016-02-05 23:10:09 -08:00
Krishna Srinivas 4569e519c5 Merge pull request #1598 from harshavardhana/query
rm: List wouldn't progress for files with special characters.
2016-02-02 15:17:04 +05:30
Harshavardhana 0236dcf780 rm: List wouldn't progress for files with special characters.
This patch addresses this problem - fixes #1591
2016-02-02 01:28:04 -08:00
Krishna Srinivas 5e5ad3367d Merge pull request #1597 from harshavardhana/progress-bar
progressBar: Finish progress bar if total is greater than 0
2016-02-02 14:54:59 +05:30
Harshavardhana 744b4728d1 progressBar: Finish progress bar if total is greater than 0
In case of 'mc mirror' => mc prints an erroneous progress bar
with 0bytes.

```
mc mirror /usr/local/Cellar/go/1.5.3/libexec play/test123/libexec
0 B / ?  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓  0.00 % 0
```

This patch fixes #1592
2016-02-01 13:36:23 -08:00
Anand Babu (AB) Periasamy f811b029b1 Merge pull request #1595 from harshavardhana/path-url
url: Error out if the aliased URL has host entry.
2016-02-01 11:44:10 +01:00
Harshavardhana 8b77f918b3 url: Error out if the aliased URL has host entry.
```
mc ls http://localhost:9000/
```

ends up listing `mc ls /`, This is confusing and should be
treated as an error, allow only aliased operations.
2016-02-01 02:41:04 -08:00
Anand Babu (AB) Periasamy c5453d1528 Merge pull request #1590 from harshavardhana/url
urlAlias: Handle forward slashes on windows.
2016-01-27 23:21:48 -08:00
Harshavardhana fc668edadf urlAlias: Handle forward slashes on windows.
On windows
```
> mc ls s3/ --> Fails
```

Since most of our examples talk about '/', we should handle
this cleanly for windows.
2016-01-27 14:34:12 -08:00
Anand Babu (AB) Periasamy 01b0928989 Merge pull request #1588 from harshavardhana/handle-paths
cp/mirror: Handle path constructions properly across operating systems.
2016-01-26 18:27:13 -08:00
Harshavardhana 0a4fce57cf cp/mirror: Handle path constructions properly across operating systems.
```
mc cp -r localhost\testbucket\bin C:\destination
```

Following syntax is supposed to copy only 'bin' inside C:\destination.
Due to url construction issues this leads to 'testbucket' instead being
copied as the top level directory.

With this fix the url construction becomes more cross platform friendly.
2016-01-26 18:21:34 -08:00
Anand Babu (AB) Periasamy 257321c425 Merge pull request #1587 from harshavardhana/fix-listing-order
ls: Make recursive and non-recursive behave the same way
2016-01-26 18:16:27 -08:00
Harshavardhana 3b5dcd478a ls: Make recursive and non-recursive behave the same way
Outputs for recursive today

```
$ mc ls -r /tmp/value/
[2016-01-25 12:27:01 PST]    52B test.go
[2016-01-26 11:36:22 PST] 4.2KiB test.txt
[2016-01-26 11:45:22 PST]   102B test/
[2016-01-26 11:45:22 PST] 4.2KiB test/README.md
```

and Outputs for non recursive today differ lexically.

```
$ mc ls  /tmp/value/
[2016-01-26 11:45:22 PST]   102B test/
[2016-01-25 12:27:01 PST]    52B test.go
[2016-01-26 11:36:22 PST] 4.2KiB test.txt
```

To fix this issue we need to capture the ending '/' as
well part of the names while sorting the output. This
patch addresses this problem.
2016-01-26 18:11:24 -08:00
Anand Babu (AB) Periasamy 5c52a0adae Merge pull request #1586 from harshavardhana/ls-truncate
ls: On windows truncate the directory prefixes properly.
2016-01-26 00:29:19 -08:00
Harshavardhana d572648261 ls: On windows truncate the directory prefixes properly.
Fixes #1585
2016-01-25 21:34:16 -08:00
Anand Babu (AB) Periasamy 85e8b542de Merge pull request #1583 from harshavardhana/make-bucket
re-vendorize minio-go with new URL handling changes
2016-01-25 16:55:45 -08:00
Harshavardhana 3a3dbb2722 minio-go: vendorize to new libs.
Fixes - #1579
2016-01-25 16:39:24 -08:00
Krishna Srinivas 47cd83c71c Merge pull request #1582 from harshavardhana/add-missing
update: Add missing '/' from update url.
2016-01-25 23:19:04 +05:30
Harshavardhana 700f261b86 update: Add missing '/' from update url.
Fixes #1581
2016-01-25 09:39:56 -08:00
Anand Babu (AB) Periasamy 3f3adb1858 Merge pull request #1580 from harshavardhana/re-vendorize
mc: Vendorize to new changes.
2016-01-25 01:04:34 -08:00
Harshavardhana 9a40a67410 mc: Vendorize to new changes.
- Fix 0byte file uploads to be not uploaded as multipart.
- Fix bucket requests to have a '/' at the end
  for path style - fixes #1579
- Handle progress bar, if pb.Total is '0'.
2016-01-25 01:00:47 -08:00
Anand Babu (AB) Periasamy cfac37f53b Merge pull request #1544 from harshavardhana/merge-vendorize
mc: Vendorize to new API changes.
2016-01-23 23:57:59 -08:00
Harshavardhana a769ce6439 mc: Vendorize to new API changes.
This vendorization uses the new set of API changes which
we are brought in.

With this new change Bucket regions are handled transparently
without any region lookup or local map. This makes overall code
seamless and easy to use.

Fixes - #1541 (cp corruption while uploading large files to s3)
Fixes - #1542 (cp checkCopySyntax failed)
Fixes - #1537 (regions will be handled seamelessly now for all buckets)
Fixes - #1538 (fixes access control policy for google cloud storage)
Fixes - #1547 (session resume completes without copying all the files)
Fixes - #1559 (poor network connectivity, causes timing out)
2016-01-23 23:53:27 -08:00
Harshavardhana 951067295e Merge pull request #1575 from fwessels/master
Added alias argument for adding host with config
2016-01-18 08:58:33 -08:00
frankw bd97054b93 Added alias argument for adding host with config 2016-01-18 14:02:34 +01:00
Harshavardhana 796d36083d Merge pull request #1573 from vadmeste/did_you_mean
Add Damerau Levenshtein algo to suggest more alternatives to mistyped…
2016-01-13 12:57:19 -08:00
Anis Elleuch acc4b97483 Add Damerau Levenshtein algo to suggest more alternatives to mistyped commmands 2016-01-13 21:32:23 +01:00
Harshavardhana d92a93566b Merge pull request #1572 from vadmeste/host_add_api_optional
Make API argument in config host add cmd optional
2016-01-10 11:18:21 -08:00
Anis Elleuch 244d377f0a Make API argument in config host add cmd optional 2016-01-10 14:47:48 +01:00
Harshavardhana e958557d28 Merge pull request #1571 from vadmeste/fix_error_reporting_issue
Fix ls error msg
2016-01-09 09:52:35 -08:00
Anis Elleuch 3b35f44eba Fix ls error msg 2016-01-09 15:46:52 +01:00
Anand Babu (AB) Periasamy c26c61d3c4 Merge pull request #1570 from harshavardhana/diff-alias
diff/mirror: Handle aliases properly now.
2016-01-08 21:27:11 -08:00
Harshavardhana b347137d88 diff/mirror: Handle aliases properly now. 2016-01-08 21:24:07 -08:00
Anand Babu (AB) Periasamy 99e12696eb Merge pull request #1569 from harshavardhana/rm-all
rm: Fix alias URL handling in rm.
2016-01-08 20:59:17 -08:00
Harshavardhana f01dc5b60c rm: Fix alias URL handling in rm. 2016-01-08 20:51:28 -08:00
Anand Babu (AB) Periasamy 50240b0a1e Merge pull request #1568 from harshavardhana/mirror
mirror/cp: Remove aliases from being printed in json output. - fixes #1563
2016-01-08 19:23:14 -08:00
Harshavardhana 11b286c149 mirror/cp: Remove aliases from being printed in json output. - fixes #1563
Additionally save expanded targetURL also part of session.
2016-01-08 18:44:39 -08:00
Harshavardhana fa87ad6b37 Merge pull request #1566 from vadmeste/subcommands_has_help_flag
Emphasize that subcommands have a help flag
2016-01-08 11:09:26 -08:00
Harshavardhana dd50ad532e Merge pull request #1565 from koolhead17/patch-4
Update README.md
2016-01-08 10:32:09 -08:00
Anis Elleuch 31b07812cb Emphasize that subcommands have a help flag 2016-01-08 19:14:47 +01:00
koolhead17 e59ba922bd Update README.md
minor change with adding "--help" option
2016-01-08 23:38:34 +05:30
Harshavardhana 008a5f00de Merge pull request #1564 from abperiasamy/as60-exit-bug
return non-zero exit code in case of session failure
2016-01-08 10:00:19 -08:00
Anand Babu (AB) Periasamy 8a91ec65ce return non-zero exit code in case of session failure 2016-01-08 09:55:13 -08:00
Harshavardhana 35cdba2204 Merge pull request #1561 from vadmeste/trivial_fixes
Trivial fix of cmd error message, the same for missing dependencies in checkdeps.sh
2016-01-07 15:04:52 -08:00
Anis Elleuch 664f982833 Trivial fix of cmd error message, the same for missing dependencies in checkdeps.sh 2016-01-07 22:49:47 +01:00
Harshavardhana c08ebb25cd Merge pull request #1558 from abperiasamy/cache-client
cache and re-use minio S3 client
2015-12-31 17:22:53 -08:00
Anand Babu (AB) Periasamy f7cdbc2583 cache and re-use minio S3 client 2015-12-31 17:02:08 -08:00
Harshavardhana d47faa3256 Merge pull request #1556 from koolhead17/patch-3
Update INSTALLGO.md
2015-12-29 23:52:36 -08:00
koolhead17 9cd535a6cd Update INSTALLGO.md
minor fix.
2015-12-30 12:14:35 +05:30
Harshavardhana b6fe0d2529 Merge pull request #1555 from abperiasamy/config-v7
new alias style and numerous cleanups.
2015-12-28 15:35:21 -08:00
Anand Babu (AB) Periasamy 0bd1edfd8f new alias style and numerous cleanups. 2015-12-28 15:31:52 -08:00
Harshavardhana 7ee79bc960 Merge pull request #1553 from harshavardhana/update-links
update: update urls for 'mc'
2015-12-23 18:44:41 -08:00
Harshavardhana 29f46b833c update: update urls for 'mc' 2015-12-23 16:56:03 -08:00
Krishna Srinivas c888977e51 Merge pull request #1551 from harshavardhana/hostconfig
mc: Fix host example URL.
2015-12-18 13:25:23 +05:30
Harshavardhana fbdae31d5b mc: Fix host example URL. 2015-12-17 15:55:22 -08:00
Anand Babu (AB) Periasamy fe27a5c415 Merge pull request #1546 from harshavardhana/mirror
session: mc session resume <session-id>
2015-12-11 18:29:27 -08:00
Harshavardhana 8686fe725f session: mc session resume <session-id>
Fixes #1545
2015-12-11 18:25:16 -08:00
Krishna Srinivas 23992411cc Merge pull request #1540 from harshavardhana/bring-user-package
pkg/user: Bring user package from server and use it here in place of …
2015-12-09 14:16:12 +05:30
Harshavardhana 727538fa8c pkg/user: Bring user package from server and use it here in place of userCurrent. 2015-12-08 20:35:01 -08:00
Harshavardhana dfc0dc3042 Merge pull request #1539 from arschles/alpine
porting userCurrent from the minio project
2015-12-08 19:39:20 -08:00
Aaron Schlesinger a4bc2c2be1 porting userCurrent from the minio project 2015-12-08 19:35:22 -08:00
Harshavardhana 3f6053822f Maintainers document updated. 2015-12-08 11:13:01 -08:00
Harshavardhana 9fed1d73ee Merge pull request #1535 from harshavardhana/fix-bug
fs: Make sure to negate the seeked offset if size is not negative.
2015-12-05 17:57:08 -08:00
Harshavardhana 3782c4abe0 fs: Make sure to negate the seeked offset if size is not negative. 2015-12-05 17:52:45 -08:00
Harshavardhana 2663de4489 Merge pull request #1534 from harshavardhana/contentdb
contentType: use contentDB package from server.
2015-12-04 17:31:12 -08:00
Harshavardhana 36e7e42637 contentType: use contentDB package from server. 2015-12-04 16:28:26 -08:00
Harshavardhana 3f91446e6e Merge pull request #1524 from harshavardhana/build
tests: Merge minio-tests into 'mc'
2015-12-02 16:37:42 -08:00
Harshavardhana 278701db48 tests: Merge minio-tests into 'mc'
From now on 'make all-tests' to run our integration tests.
2015-12-02 16:32:48 -08:00
Harshavardhana 5104938796 Merge pull request #1523 from harshavardhana/build
build: Turn off downloading go1.5.1 for windows builds.
2015-12-02 16:06:48 -08:00
Harshavardhana 062e75617d build: Turn off downloading go1.5.1 for windows builds.
AppVeyor service migrated Golang to default 1.5.1
2015-12-02 16:01:53 -08:00
Harshavardhana 4d339f7373 Update README.md 2015-12-02 12:01:22 -08:00
Harshavardhana db9f5b3890 Merge pull request #1522 from harshavardhana/add-release
makefile: Add release make tag.
2015-12-02 11:33:14 -08:00
Harshavardhana 18d0df16bc makefile: Add release make tag. 2015-12-02 11:26:08 -08:00
Harshavardhana e866b69baf Merge pull request #1521 from harshavardhana/is-complete
incomplete-upload: Listing should handle incomplete upload prefixes a…
2015-12-02 10:40:06 -08:00
Harshavardhana 8949e30524 incomplete-upload: Listing should handle incomplete upload prefixes as well.
Fixes #1514
2015-12-02 10:36:56 -08:00
Harshavardhana 791199e11c Merge pull request #1520 from harshavardhana/alias
aliasconfig: Verify only os.PathSeparator contains not suffix.
2015-12-02 10:26:43 -08:00
Harshavardhana 479b69487d aliasconfig: Verify only os.PathSeparator contains not suffix.
Fixes #1518
2015-12-02 10:20:43 -08:00
Harshavardhana 0f1388aec2 Merge pull request #1519 from harshavardhana/normalize-url
aliasconfig: Alias construction should happen properly for multiple aliases.
2015-12-02 10:04:08 -08:00
Harshavardhana fb133b6cce aliasconfig: Alias construction should happen properly for multiple aliases.
Fixes #1518
2015-12-02 09:57:40 -08:00
Harshavardhana f463a45c7b Merge pull request #1517 from harshavardhana/signature
signature-presign: new minio-go vendorized fixes #1515
2015-12-02 09:45:28 -08:00
Harshavardhana 759fb1f079 signature-presign: new minio-go vendorized fixes #1515 2015-12-02 09:41:25 -08:00
Harshavardhana 0fd1e3c387 Merge pull request #1511 from harshavardhana/fs-client-new
fs: More changes related to symlink handling.
2015-11-30 16:46:01 -08:00
Harshavardhana 3b95a39e3a fs: More changes related to symlink handling. 2015-11-30 16:13:27 -08:00
Harshavardhana 7bd78afc3a Merge pull request #1510 from harshavardhana/fs-client
fs: Simplify windows symlink lstat handling.
2015-11-30 16:12:37 -08:00
Harshavardhana 93e26e9032 fs: Simplify windows symlink lstat handling. 2015-11-30 15:28:56 -08:00
Harshavardhana ca5d829158 Merge pull request #1509 from harshavardhana/update
update: Fix update command.
2015-11-30 14:56:29 -08:00
Harshavardhana a92a9e4c73 update: Fix update command. 2015-11-30 14:45:54 -08:00
Harshavardhana 10d6e18600 Merge pull request #1508 from harshavardhana/fix-bug
windows: internal multiparts should use platform specific tempfile lo…
2015-11-30 13:06:39 -08:00
Harshavardhana dbdcdff874 windows: internal multiparts should use platform specific tempfile location 2015-11-30 13:02:53 -08:00
Harshavardhana c573ccf641 Merge pull request #1507 from harshavardhana/fix-region
region: Resolve region properly, if fails return the error.
2015-11-30 12:28:18 -08:00
Harshavardhana 3b7d63bbf3 region: Resolve region properly, if fails return the error.
Fixes #1503
2015-11-30 12:25:45 -08:00
Harshavardhana de463d2ada Merge pull request #1506 from harshavardhana/fs-cp
cp: Working resumable cp fixes #1505
2015-11-30 11:05:08 -08:00
Harshavardhana 1664551119 cp: Working resumable cp fixes #1505 2015-11-30 10:57:54 -08:00
Harshavardhana cc78c1c5df Merge pull request #1504 from harshavardhana/mc-cp
cp/mirror: URL syntax needs to know if URL is of virtual style
2015-11-30 08:19:38 -08:00
Harshavardhana 99cc307a62 cp/mirror: URL syntax needs to know if URL is of virtual style
Fixes #1502
2015-11-30 08:16:06 -08:00
Anand Babu (AB) Periasamy 5acdfaf413 Merge pull request #1498 from abperiasamy/pipe-fs-bug
handle stdin pipe properly
2015-11-29 22:45:21 -08:00
Anand Babu (AB) Periasamy aea88d3756 handle stdin pipe properly 2015-11-29 22:29:17 -08:00
Anand Babu (AB) Periasamy 4769531b3a Merge pull request #1497 from abperiasamy/pipe-arg
check for pipe args
2015-11-29 21:35:27 -08:00
Anand Babu (AB) Periasamy a38318e6af check for pipe args 2015-11-29 21:31:48 -08:00
Harshavardhana 4c3ea052c4 Merge pull request #1496 from harshavardhana/mirror-pie
mirror/pipe: Enable mirror and pipe back now they do not work for mul…
2015-11-29 14:46:55 -08:00
Harshavardhana 9219e1a320 mirror/pipe: Enable mirror and pipe back now they do not work for multiple targets. 2015-11-29 14:43:11 -08:00
Harshavardhana 59659f5bed Merge pull request #1495 from harshavardhana/resumable
putTarget: Reintroduce size this time pipe can upload upto 5TB
2015-11-28 22:22:45 -08:00
Harshavardhana 4485529911 putTarget: Reintroduce size this time pipe can upload upto 5TB 2015-11-28 22:17:22 -08:00
Harshavardhana 96afead3f1 Merge pull request #1489 from harshavardhana/resumable-downloads
mc: resumable downloads
2015-11-28 18:04:11 -08:00
Harshavardhana 1badfc8a04 :mc: resumable downloads and support incomplete files on file system. 2015-11-28 18:00:53 -08:00
Anand Babu (AB) Periasamy 1d07866fd3 Merge pull request #1494 from abperiasamy/short-commit-id
fix short-commit-id to 12 digits
2015-11-27 11:38:50 -08:00
Anand Babu (AB) Periasamy e98c9b3625 fix short-commit-id to 12 digits 2015-11-27 11:26:09 -08:00
Harshavardhana 6d542975be Merge pull request #1493 from harshavardhana/globals
globals: setGlobals() - quiet, debug, json, noColor for both app and …
2015-11-25 15:43:21 -08:00
Harshavardhana 97090aee0c globals: setGlobals() - quiet, debug, json, noColor for both app and command specific. 2015-11-25 15:40:20 -08:00
Anand Babu (AB) Periasamy 1429d26507 Merge pull request #1492 from abperiasamy/global-help
support global flags for both commands and global main
2015-11-25 15:13:50 -08:00
Anand Babu (AB) Periasamy f94989dc0a support global flags for both commands and global main
Change-Id: If0939b52ad3ccb8d5ada0118515c2ad398bceef0
2015-11-25 15:08:16 -08:00
Harshavardhana 9fe3b00394 Merge pull request #1491 from harshavardhana/console
console: Print Debug when DebugPrint set to true.
2015-11-25 01:25:11 -08:00
Harshavardhana f94399b01c console: Print in Debug when DebugPrint set to true. 2015-11-25 01:22:17 -08:00
Harshavardhana 71c03aa9d0 Merge pull request #1488 from harshavardhana/share
share: Move to --recursive instead of --starts-with for consistency.
2015-11-24 21:30:24 -08:00
Harshavardhana 841c65c867 share: Move to --recursive instead of --starts-with for consistency.
- if URL ends with "/" and no --recursive option exit properly.
- if recursive is given no matter what key is specified it is regarded
  as prefix.
- if no recursive option and no "/" suffix is provided is treated as
  exact object name.
2015-11-24 21:22:53 -08:00
Harshavardhana 38631e0f34 Merge pull request #1487 from abperiasamy/sep-global-flags
organize global flags after cmd flag
2015-11-24 17:16:26 -08:00
Anand Babu (AB) Periasamy 8fc138f3a0 organize global flags after cmd flag 2015-11-24 16:59:46 -08:00
Harshavardhana de760d4efb Merge pull request #1485 from harshavardhana/incomplete
rm: For incomplete uploads do not issue a stat request.
2015-11-24 14:16:58 -08:00
Harshavardhana 67809d105b rm: For incomplete uploads do not issue a stat request. 2015-11-24 14:13:43 -08:00
Anand Babu (AB) Periasamy 5425d62130 Merge pull request #1484 from abperiasamy/type-d-enhanced
enhance type D to support files and dirs with recursive flag
2015-11-24 13:29:08 -08:00
Anand Babu (AB) Periasamy 681f389228 enhance type D to support files and dirs with recursive flag 2015-11-24 13:15:04 -08:00
Harshavardhana 997527ee6c Merge pull request #1483 from harshavardhana/alias-config
config/alias: Handle multiple aliases.
2015-11-23 20:05:30 -08:00
Harshavardhana ae74a0d25b config/alias: Handle multiple aliases. 2015-11-23 20:02:27 -08:00
Harshavardhana c4b8aaa2b2 Merge pull request #1482 from harshavardhana/milkway
region: minio server and minio-go now honor 'us-east-1' as default re…
2015-11-23 14:14:10 -08:00
Harshavardhana 5a30dadbe3 region: minio server and minio-go now honor 'us-east-1' as default region 2015-11-23 14:09:12 -08:00
Harshavardhana 7c75879e4d Merge pull request #1480 from harshavardhana/starts-with
share/download: add --starts-with flag and remove '...' we don't have…
2015-11-23 12:35:32 -08:00
Harshavardhana aa3007bcd0 share/download: add --starts-with flag and remove '...' we don't have that anymore.
- Fixes bug when prefix is available and should be prepended to the key.
- Fixes another bug to avoid doing URL stat for upload, its not needed.

Fixes #1478
2015-11-23 12:33:08 -08:00
Harshavardhana 598be201f3 Merge pull request #1477 from harshavardhana/empty-tests
tests: Remove empty tests.
2015-11-22 18:22:29 -08:00
Harshavardhana 7df4766c93 tests: Remove empty tests. 2015-11-22 15:26:17 -08:00
Harshavardhana e8b7a403a2 Merge pull request #1476 from harshavardhana/update-readme
doc: Fix README.md
2015-11-22 15:22:17 -08:00
Harshavardhana 9771f2eb27 doc: Fix README.md 2015-11-22 15:17:49 -08:00
Harshavardhana 9479c999f2 Merge pull request #1475 from harshavardhana/session-fix
session: remove unnecessary fatal even for successful resume.
2015-11-22 11:14:37 -08:00
Harshavardhana d8e8fb0089 session: remove unnecessary fatal even for successful resume.
Fixes #1474
2015-11-22 01:11:00 -08:00
Harshavardhana 9ee1913e93 Merge pull request #1473 from harshavardhana/fix-bug
mc: Fix setGlobalContext across all commands.
2015-11-22 00:41:04 -08:00
Harshavardhana fd1cde749a mc: Fix setGlobalContext across all commands.
- Always set globals from context before validating input arguments.
- Add missing os.Exit(1) from console.Fatal{f,ln} which was
  accidentally removed from previous commits.

Fixes #1472
2015-11-22 00:33:35 -08:00
Harshavardhana 9432addb14 Merge pull request #1471 from harshavardhana/newchanges
minio/minio-go: re-vendorize with new changes
2015-11-21 19:25:53 -08:00
Harshavardhana 7e5f4776ca minio/minio-go: re-vendorize with new changes
Fixes #1470
2015-11-21 19:22:40 -08:00
Anand Babu (AB) Periasamy f578358ab8 Merge pull request #1469 from abperiasamy/setglobals
set globals from context from each command main
2015-11-21 18:56:15 -08:00
Anand Babu (AB) Periasamy 558c20e1e3 set globals from context from each command main 2015-11-21 18:26:58 -08:00
Harshavardhana 50c5d6429f Merge pull request #1468 from harshavardhana/remove-is-exited
testing: Remove all the console IsExited/IsError testing.
2015-11-21 18:00:29 -08:00
Harshavardhana 3f52c951e7 testing: Remove all the console IsExited/IsError testing. 2015-11-21 17:55:42 -08:00
Harshavardhana 11b82a6268 Merge pull request #1467 from harshavardhana/fix-ls
ls: Fix ls output - fixes #1466
2015-11-21 17:00:36 -08:00
Harshavardhana cc0cde16c6 ls: Fix ls output - fixes #1466 2015-11-21 16:57:44 -08:00
Harshavardhana 4cd9421080 Merge pull request #1465 from harshavardhana/config
config: Simplify config further, add more docs.
2015-11-21 16:49:45 -08:00
Harshavardhana 39ba33f4c6 config: Simplify config further, add more docs. 2015-11-21 16:32:34 -08:00
Harshavardhana 2151c98abb Merge pull request #1461 from abperiasamy/globals2cmdflags
global flags are replaced with command speific flags, but still retai…
2015-11-21 15:20:18 -08:00
Anand Babu (AB) Periasamy 269ac7b105 global flags are replaced with command speific flags, but still retain global behavior 2015-11-21 14:20:00 -08:00
Anand Babu (AB) Periasamy 6a2b4e959d Merge pull request #1460 from abperiasamy/globals-restruct
restructure globals and some bug fixes related to globals
2015-11-21 12:57:28 -08:00
Anand Babu (AB) Periasamy 052f73f348 restructure globals and some bug fixes related to globals 2015-11-21 12:43:21 -08:00
Harshavardhana d81eaf56fa Merge pull request #1459 from harshavardhana/add-csv
config/host: Add import command to import csv credentials file.
2015-11-21 11:48:34 -08:00
Harshavardhana 7355eecf56 config/csv: Add config import command for importing csv credential files.
- Much needed cleanup of 'config' handling code.
- Adds a new CSVUnmarshal, unmarshalling to a struct from a csv file.

Fixes #1422
2015-11-21 11:42:14 -08:00
Harshavardhana c78b6e6645 Merge pull request #1458 from harshavardhana/missing
ls: Add missing content Time from listing buckets in recursive operation
2015-11-20 15:49:26 -08:00
Harshavardhana 0671f246ad ls: Add missing content Time from listing buckets in recursive operation
Fixes #1457
2015-11-20 15:47:05 -08:00
Harshavardhana cface860c5 Merge pull request #1456 from harshavardhana/fix-cp
cp: TypeC should print an error if source is directory and no recursi…
2015-11-20 11:45:39 -08:00
Harshavardhana 11ea306ad2 cp: TypeC should print an error if source is directory and no recursive option is provided
Fixes #1454
2015-11-20 11:42:53 -08:00
Harshavardhana 88f188d202 Merge pull request #1453 from harshavardhana/add-release-scripts
release: Add release scripts.
2015-11-19 21:07:06 -08:00
Harshavardhana d08392ba40 release: Add release scripts. 2015-11-19 21:04:57 -08:00
Harshavardhana 79474d117f Merge pull request #1452 from harshavardhana/fix-windows
ls: Fix a windows issue during listing.
2015-11-19 20:33:09 -08:00
Harshavardhana 6e56f06bd3 ls: Fix a windows issue. 2015-11-19 20:29:33 -08:00
Harshavardhana 1167b2f231 Merge pull request #1451 from harshavardhana/http
doc: Improve examples.
2015-11-19 19:32:06 -08:00
Harshavardhana de9380dd9d doc: Improve examples. 2015-11-19 19:24:25 -08:00
Harshavardhana 2f0acf91fa Merge pull request #1450 from harshavardhana/trace
trace: Add missing traces.
2015-11-19 17:28:06 -08:00
Harshavardhana c757cf1829 trace: Add missing traces. 2015-11-19 17:23:00 -08:00
Harshavardhana 02041802fe Merge pull request #1449 from harshavardhana/url-prefix
url: prefixExists should be isURLPrefixExists
2015-11-19 15:06:00 -08:00
Harshavardhana 2a9293b79f url: prefixExists should be isURLPrefixExists 2015-11-19 15:02:55 -08:00
Harshavardhana 16405682f8 Merge pull request #1447 from krishnasrinivas/mb-check-bucketname-isvalid
check bucketname validity
2015-11-19 14:52:16 -08:00
Krishna Srinivas bbf0f7687c check bucketname validity 2015-11-19 14:42:32 -08:00
Harshavardhana c96117fa5d Merge pull request #1448 from harshavardhana/type-a-cp
cp: In TypeA no need to verify target
2015-11-19 13:28:32 -08:00
Harshavardhana 5f2417c8ad cp: In TypeA no need to verify target
Fixes #1446
2015-11-19 13:20:18 -08:00
Harshavardhana 3e1819a33f Merge pull request #1445 from harshavardhana/session-trie
session: Make session resume more user friendly
2015-11-19 13:11:30 -08:00
Harshavardhana 1a85e97050 session: Make session resume more user friendly 2015-11-19 13:08:13 -08:00
Harshavardhana 670fac2afb Merge pull request #1444 from abperiasamy/cp-recur
new recursive cp and session
2015-11-19 12:49:19 -08:00
Harshavardhana 67fc0a61fe Merge pull request #1443 from krishnasrinivas/rm-url2dircontent
mc ls fails when there is a broken symlink - fixes #1442
2015-11-19 12:48:16 -08:00
Anand Babu (AB) Periasamy 123fde256e new recursive cp and session 2015-11-19 12:41:55 -08:00
Krishna Srinivas 1778d6a448 mc ls fails when there is a broken symlink - fixes #1442 2015-11-19 12:09:20 -08:00
Harshavardhana e6e5524d73 Merge pull request #1441 from harshavardhana/fix-flags
rm: Fix flags and doc
2015-11-19 11:29:58 -08:00
Harshavardhana 446cae9820 rm: Fix flags and doc 2015-11-19 11:26:28 -08:00
Harshavardhana 9ba8219481 Merge pull request #1439 from harshavardhana/cleanup
session/mirror: cleanup session flags
2015-11-19 02:16:56 -08:00
Harshavardhana 569dd41ec5 session/mirror: cleanup session flags 2015-11-19 02:14:15 -08:00
Harshavardhana 9c226b0836 Merge pull request #1438 from harshavardhana/session
session: Move to session v4
2015-11-19 01:16:49 -08:00
Harshavardhana 58056b0331 session: Move to session v4 2015-11-19 01:14:16 -08:00
Harshavardhana ba31d5812f Merge pull request #1437 from harshavardhana/hostconfig
config: Add proper keys for tests
2015-11-19 00:46:41 -08:00
Harshavardhana 628e8734ce config: Add proper keys for tests 2015-11-19 00:44:01 -08:00
Harshavardhana 26fa3ce647 Merge pull request #1436 from harshavardhana/config-fix
config: Extensive changes to config and host handling
2015-11-19 00:22:57 -08:00
Harshavardhana da65cbae06 config: Extensive changes to config and host handling
- alias now expands for all match aliases and also any matching hosts.
   Example:-  mc ls -r s3.amazonaws.com/ferenginar/bin

 - not globs, no hosts - only fully qualified URLs are stored in config.
 - everywhere use 'args2URLs()' getAliasURL should be used internally.
2015-11-19 00:20:11 -08:00
Harshavardhana a106443505 Merge pull request #1435 from krishnasrinivas/session-delete-all
Add 4th example for mc session to show deletion of all sessions
2015-11-18 23:59:35 -08:00
Krishna Srinivas 36505dfd2c Add 4th example for mc session to show deletion of all sessions 2015-11-18 23:13:24 -08:00
Harshavardhana ad2cd0d529 Merge pull request #1433 from krishnasrinivas/stat-on-rm
Do a stat on files for non-recursive rm before removing to detect non-existing files
2015-11-18 22:42:49 -08:00
Krishna Srinivas cecc409a71 Do a stat on files for non-recursive rm before removing to detect non-existing files 2015-11-18 22:26:07 -08:00
Harshavardhana 65723f1fce Merge pull request #1431 from harshavardhana/minio-go
minio-go: Turn off calculating size for incomplete uploads.
2015-11-18 20:49:41 -08:00
Harshavardhana 3c8afb2877 minio-go: Turn off calculating size for incomplete uploads.
Calculating sizes for large multipart uploads can get
really slower - disable it for now.
2015-11-18 20:46:42 -08:00
Harshavardhana f248536162 Merge pull request #1430 from harshavardhana/mirror-cmd
mirror: Do not verify for deprecated recursive URLs
2015-11-18 20:29:06 -08:00
Harshavardhana b36ae24f86 mirror: Do not verify for deprecated recursive URLs 2015-11-18 20:24:31 -08:00
Harshavardhana 22b409f535 Merge pull request #1429 from harshavardhana/minio-cli
cli: Remove the errant newline upon error printing
2015-11-18 20:14:24 -08:00
Harshavardhana 2349ebda6b cli: Remove the errant newline upon error printing.
Fixes #1354
2015-11-18 20:10:39 -08:00
Harshavardhana 1dfc28dbc7 Merge pull request #1428 from harshavardhana/readme
mc: Fix help flag add 'h' and update README.md
2015-11-18 19:17:04 -08:00
Harshavardhana 2eb9e58771 mc: Fix help flag add 'h' and update README.md 2015-11-18 19:13:13 -08:00
Harshavardhana 3d29ad2c17 Merge pull request #1427 from krishnasrinivas/s3go-returns-client-error
s3.go should return client.PathInsufficientPermission{} for access denied errors fixes #1421
2015-11-18 18:33:20 -08:00
Krishna Srinivas b03deb9d3c s3.go should return client.PathInsufficientPermission{} for access denied errors fixes #1421 2015-11-18 18:18:06 -08:00
Harshavardhana 54864b12b4 Merge pull request #1426 from harshavardhana/fs-s3
fs/s3: Simplify fs and further add more documentation.
2015-11-18 18:17:28 -08:00
Harshavardhana 83d2accd5b fs/s3: Simplify fs and further add more documentation. 2015-11-18 18:11:18 -08:00
Harshavardhana 28c9d83cc4 Merge pull request #1425 from krishnasrinivas/remove-test-for-invalid-case
remove negetive testcase for cp as we don't handle it
2015-11-18 18:09:41 -08:00
Krishna Srinivas d4d14eb67b remove negetive testcase for cp as we don't handle it 2015-11-18 17:41:08 -08:00
Harshavardhana 93de4ebfd1 Merge pull request #1419 from harshavardhana/documentation
doc: Add various missing documentation across the codebase.
2015-11-18 12:58:27 -08:00
Harshavardhana 34c9896d1d doc: Add various missing documentation across the codebase. 2015-11-18 12:52:46 -08:00
Harshavardhana ca245999d5 Merge pull request #1418 from harshavardhana/config-fixes
config: fix config version 6 by removing glob hosts
2015-11-18 00:57:25 -08:00
Harshavardhana 097b337545 Merge pull request #1417 from krishnasrinivas/1410
during Put() fs returns client.PathInsufficientPermission{} for EPERM - fixes #1410
2015-11-18 00:53:48 -08:00
Harshavardhana 6db5b8fddc config: fix config version 6 by removing glob hosts 2015-11-18 00:52:08 -08:00
Krishna Srinivas e7002e097b during Put() fs returns client.PathInsufficientPermission{} for EPERM - fixes #1410 2015-11-18 00:48:44 -08:00
Harshavardhana d8c60b998c Merge pull request #1416 from harshavardhana/json-msg
json: JSON messages now have proper status field for all messages
2015-11-18 00:28:03 -08:00
Harshavardhana d5dd4fb5bd json: JSON messages now have proper status field for all messages
Fixes - #1369
2015-11-18 00:24:32 -08:00
Harshavardhana b007b7cf91 Merge pull request #1415 from krishnasrinivas/1371
rm on non-empty dir was wrongly printing that it was removed - fixes #1371
2015-11-18 00:18:45 -08:00
Krishna Srinivas 054aaadde8 rm on non-empty dir was wrongly printing that it was removed - fixes #1371 2015-11-18 00:09:25 -08:00
Anand Babu (AB) Periasamy 1ebcf98a6f Merge pull request #1414 from abperiasamy/fake-rm
fake flag for remove
2015-11-17 23:58:07 -08:00
Harshavardhana 0e2ab60c15 Merge pull request #1412 from krishnasrinivas/1404
detect invalid bucketname for mirror #1404
2015-11-17 23:56:54 -08:00
Harshavardhana c5984150d3 Merge pull request #1409 from krishnasrinivas/diff-continue-on
diff - continue on non-fatal error. refactor to remove unneeded goroutine
2015-11-17 23:56:22 -08:00
Anand Babu (AB) Periasamy 5f01f6d98c fake flag for remove 2015-11-17 23:55:27 -08:00
Krishna Srinivas 454261962e detect invalid bucketname for mirror #1404 2015-11-17 23:47:14 -08:00
Krishna Srinivas 61ec25d2bf diff - continue on non-fatal error. refactor to remove unneeded goroutine 2015-11-17 23:46:55 -08:00
Harshavardhana 2a3485b4be Merge pull request #1413 from harshavardhana/atomic
quick: Sync() not turned of by default
2015-11-17 23:45:35 -08:00
Harshavardhana fa497d3811 quick: Sync() not turned of by default 2015-11-17 23:42:07 -08:00
Anand Babu (AB) Periasamy 1c1cd2aa7e Merge pull request #1411 from abperiasamy/rm-recur
rm recursive flag and remove per folder
2015-11-17 23:41:41 -08:00
Anand Babu (AB) Periasamy 75409ca9b5 rm recursive flag and remove per folder 2015-11-17 23:34:58 -08:00
Anand Babu (AB) Periasamy 8becf5fc64 Merge pull request #1408 from abperiasamy/diff-h
implement -h flag
2015-11-17 21:25:35 -08:00
Anand Babu (AB) Periasamy f7bf20e4ce implement -h flag 2015-11-17 21:16:56 -08:00
Harshavardhana a089e541cc Merge pull request #1407 from harshavardhana/s3-host
config: Remove support for glob URLs, simply rely on strings suffix matching
2015-11-17 20:53:15 -08:00
Harshavardhana 6e9ec398da config: Remove support for glob URLs, simply rely on strings suffix matching. 2015-11-17 20:49:48 -08:00
Anand Babu (AB) Periasamy 7bb90683c2 Merge pull request #1406 from abperiasamy/share-recur-flag
recursive and directory based sharing
2015-11-17 20:38:19 -08:00
Anand Babu (AB) Periasamy 2db255c276 recursive and directory based sharing 2015-11-17 20:32:40 -08:00
Harshavardhana 330cfe65bb Merge pull request #1405 from krishnasrinivas/return-client-type-perm-error
fs get() should return client.PathInsufficientPermission{} in case of EPERM error
2015-11-17 19:56:55 -08:00
Krishna Srinivas b2da734ec9 fs get() should return client.PathInsufficientPermission{} in case of EPERM error 2015-11-17 19:51:57 -08:00
Harshavardhana a7c02c675e Merge pull request #1403 from krishnasrinivas/src-target-not-same
Source and Destination can not be same
2015-11-17 19:05:09 -08:00
Krishna Srinivas 43eda0e93f Source and Destination can not be same 2015-11-17 18:27:42 -08:00
Harshavardhana 3eda3bfd44 Merge pull request #1402 from harshavardhana/local
local: alias localhost:9000 - fixes #1383
2015-11-17 18:22:23 -08:00
Harshavardhana 0945e3b872 local: alias localhost:9000 - fixes #1383 2015-11-17 18:20:29 -08:00
Harshavardhana d66c79370c Merge pull request #1401 from harshavardhana/list
ls: Non-existant file or prefix throw an error
2015-11-17 18:02:35 -08:00
Harshavardhana 5f9055e7fd ls: Non-existant file or prefix throw an error 2015-11-17 17:58:58 -08:00
Harshavardhana 1673f9cd10 Merge pull request #1398 from krishnasrinivas/continue-on-eperm-for-cp-mirror
exit mc on any critical error during cp/mirror #1378
2015-11-17 17:51:56 -08:00
Harshavardhana 05675c3022 Merge pull request #1393 from abperiasamy/ls-recur-flag
use recursive flag for ls
2015-11-17 17:51:48 -08:00
Harshavardhana 3f59c3d27a Merge pull request #1400 from harshavardhana/rm-delete
rm: Fix wasn't proper in previous commit fix it
2015-11-17 17:44:22 -08:00
Harshavardhana 1a6c7ffd95 rm: Fix wasn't proper in previous commit fix it 2015-11-17 17:39:36 -08:00
Harshavardhana b481b4f1c3 Merge pull request #1399 from harshavardhana/rm-main
rm: Do not try to remove the '.'
2015-11-17 17:15:49 -08:00
Harshavardhana 6b4d976755 rm: Do not try to remove the '.' 2015-11-17 17:13:02 -08:00
Krishna Srinivas fd82bbf453 exit mc on any critical error during cp/mirror #1378 2015-11-17 17:03:55 -08:00
Harshavardhana 1d2aa6bcf3 Merge pull request #1397 from krishnasrinivas/session-resume-error-1390
quick users atomic package to Save() #1390
2015-11-17 16:36:28 -08:00
Krishna Srinivas b745676a24 quick users atomic package to Save() #1390 2015-11-17 16:33:12 -08:00
Harshavardhana cc434c43d1 Merge pull request #1396 from harshavardhana/errors
mb: Print proper messages for make buckets.
2015-11-17 16:26:15 -08:00
Harshavardhana 389020b340 mb: Print proper messages for make buckets.
Fixes #1366
2015-11-17 16:22:20 -08:00
Harshavardhana 17bfd21ac8 Merge pull request #1395 from harshavardhana/pipe
pipe: On windows there is no stderr use stdin
2015-11-17 16:01:44 -08:00
Harshavardhana 1a8dad77ee pipe: On windows there is no stderr use stdin
Fixes - #1372
2015-11-17 15:56:54 -08:00
Anand Babu (AB) Periasamy 4ee7cb92e0 use recursive flag for ls 2015-11-17 15:55:43 -08:00
Harshavardhana 24bf38a053 Merge pull request #1394 from harshavardhana/console
console: Avoid printing tags for null inputs Fatalln, Errorln, Debugln.
2015-11-17 15:15:03 -08:00
Harshavardhana 2419ca9c4d console: Avoid printing tags for null inputs Fatalln, Errorln, Debugln.
- fixes #1362
2015-11-17 15:04:02 -08:00
Harshavardhana 550f47371f Merge pull request #1392 from harshavardhana/pipe
pipe: Print a helpful message for s3 upon invalid arguments.
2015-11-17 14:51:56 -08:00
Harshavardhana 9caa205f40 pipe: Print a helpful message for s3 upon invalid arguments.
Fixes #1373
2015-11-17 14:49:18 -08:00
Harshavardhana eada588802 Merge pull request #1391 from harshavardhana/list
ls: listing fixes for all the bugs we found
2015-11-17 14:36:42 -08:00
Harshavardhana 1c2f292f77 ls: listing fixes for all the bugs we found
- fixes #1356
- fixes #1355
- fixes #1358
2015-11-17 14:32:45 -08:00
Anand Babu (AB) Periasamy 8b897f169a Merge pull request #1389 from abperiasamy/share-color-fix
fix coloring bug in json message
2015-11-17 11:35:11 -08:00
Anand Babu (AB) Periasamy d43416ca17 fix coloring bug in json message 2015-11-17 11:31:37 -08:00
Harshavardhana 3c10e77ab6 Merge pull request #1388 from harshavardhana/multiple-args
args: Multiple args shouldn't fail in bettween, should continue and p…
2015-11-17 10:51:21 -08:00
Harshavardhana 4bd5f3063a args: Multiple args shouldn't fail in bettween, should continue and print errors if any
Fixes #1365
2015-11-17 10:48:31 -08:00
Harshavardhana a2b522da10 Merge pull request #1387 from harshavardhana/remove-unneccessary-trim
ls: Fix ls output fixes #1359
2015-11-17 10:01:33 -08:00
Harshavardhana c76787c363 ls: Fix ls output fixes #1359 2015-11-17 09:52:27 -08:00
Harshavardhana 9a92298cca Merge pull request #1386 from harshavardhana/docs
docs: Changes necessary for comprehensive doc changes
2015-11-17 09:30:00 -08:00
Harshavardhana cbb937139e docs: Changes necessary for comprehensive doc changes
Fixes #1385, #1384, #1381, #1367, #1363
2015-11-17 09:14:57 -08:00
Harshavardhana 2132576d49 Merge pull request #1353 from harshavardhana/url-list
ls: handle cases of non-existant directories
2015-11-16 18:54:02 -08:00
Harshavardhana f686fc6ef4 ls: handle cases of non-existant directories 2015-11-16 18:49:18 -08:00
Harshavardhana b627ca12e5 Merge pull request #1352 from harshavardhana/mirror-url
mirror: Remove checkSyntax target exists for mirror
2015-11-16 18:48:48 -08:00
Harshavardhana 2a4c7151f3 mirror: Remove checkSyntax target exists for mirror 2015-11-16 18:46:52 -08:00
Harshavardhana 425b18a9c9 Merge pull request #1351 from harshavardhana/accounting-reader
cp/mirror: avoid catch all interface{}
2015-11-16 18:32:13 -08:00
Harshavardhana 0e56a3b900 cp/mirror: avoid catch all interface{} for readers. 2015-11-16 18:29:59 -08:00
Harshavardhana 0a3cc546a5 Merge pull request #1349 from harshavardhana/cp
cp: fix prefix handling in TypeC for object storage
2015-11-16 18:17:21 -08:00
Harshavardhana aa3eacecf2 cp: fix prefix handling in TypeC for object storage 2015-11-16 18:15:25 -08:00
Anand Babu (AB) Periasamy e63405bd96 Merge pull request #1350 from abperiasamy/recur-mirror-arg
Check for invalid recursive target arg
2015-11-16 17:51:53 -08:00
Anand Babu (AB) Periasamy 814ba2cd97 Check for invalid recursive target arg 2015-11-16 17:48:45 -08:00
Harshavardhana fa9e1bc6df Merge pull request #1346 from harshavardhana/help-flag
help: Print help flags properly
2015-11-16 16:18:00 -08:00
Harshavardhana a218b3d2bc help: Print help flags properly 2015-11-16 16:02:13 -08:00
Anand Babu (AB) Periasamy 876873ec6f Merge pull request #1345 from abperiasamy/pipe-stdin
when target is empty, pipe stdin to stdout
2015-11-16 13:01:09 -08:00
Anand Babu (AB) Periasamy f529106f80 when target is empty, pipe stdin to stdout 2015-11-16 12:55:32 -08:00
Anand Babu (AB) Periasamy 4df9c08972 Merge pull request #1344 from abperiasamy/help-fix
show help flag for mc
2015-11-16 12:55:01 -08:00
Anand Babu (AB) Periasamy e1763a057b show help flag for mc 2015-11-16 12:52:54 -08:00
Harshavardhana baadb0d77e Merge pull request #1343 from harshavardhana/minio-go-2
minio-go/vendor: Add proper return on 301 for all apis.
2015-11-16 12:37:24 -08:00
Harshavardhana 2320487dcb minio-go/vendor: Add proper return on 301 for all apis. 2015-11-16 12:31:45 -08:00
Anand Babu (AB) Periasamy 5391cf80a4 Merge pull request #1342 from abperiasamy/share-cmd
support multu-args for share command and also update minio-go
2015-11-16 11:24:22 -08:00
Harshavardhana 888e187a69 Merge pull request #1341 from harshavardhana/minio-go
vendor/minio-go: Add proper error message for 301 Temporary redirect
2015-11-16 11:24:08 -08:00
Anand Babu (AB) Periasamy f78e197de3 support multu-args for share command and also update minio-go 2015-11-16 11:15:18 -08:00
Harshavardhana 3fb6d7f1bd vendor/minio-go: Add proper error message for 301 Temporary redirect 2015-11-16 11:10:58 -08:00
Harshavardhana 295fed8b06 Merge pull request #1340 from harshavardhana/cp-url
cp: Fix a crash in cp - fixes #1336
2015-11-16 10:17:07 -08:00
Harshavardhana b10f709c09 cp: Fix a crash in cp - fixes #1336 2015-11-16 10:09:47 -08:00
Harshavardhana c7ab507354 Merge pull request #1339 from harshavardhana/listing
ls: listing bug fixed for prefixes which do not start with .
2015-11-16 10:09:01 -08:00
Harshavardhana ff13eb5764 ls: listing bug fixed for prefixes which do not start with . 2015-11-16 10:00:26 -08:00
Harshavardhana 4248f5c996 Merge pull request #1338 from harshavardhana/help-rewrite
help: Re-write help style now each command has --help
2015-11-16 02:23:47 -08:00
Harshavardhana 7831917901 help: Re-write help style now each command has --help 2015-11-16 02:21:44 -08:00
Anand Babu (AB) Periasamy 97abe0b87f Merge pull request #1335 from abperiasamy/diff-mesg
fix doc strings
2015-11-16 00:18:43 -08:00
Anand Babu (AB) Periasamy 19453ed798 fix doc strings 2015-11-16 00:07:52 -08:00
Harshavardhana b15e1e49fc Merge pull request #1334 from harshavardhana/session
session: Cleanup session combine v1, v2 to legacy
2015-11-15 23:16:44 -08:00
Harshavardhana afcb9223e4 session: Cleanup session combine v1, v2 to legacy 2015-11-15 23:13:24 -08:00
Harshavardhana b889dc7c99 Merge pull request #1333 from harshavardhana/cp
cp: more trimming necessary.
2015-11-15 23:10:15 -08:00
Harshavardhana eb35b5d9ee cp: more trimming necessary. 2015-11-15 23:06:57 -08:00
Harshavardhana 659a795ac4 Merge pull request #1332 from harshavardhana/cp
cp: Fix cp command behavior for s3/bucketname/prefix... operations
2015-11-15 22:45:17 -08:00
Harshavardhana a3522a2962 cp: Fix cp command behavior for s3/bucketname/prefix... operations 2015-11-15 22:42:44 -08:00
Harshavardhana 13a83d19db Merge pull request #1331 from krishnasrinivas/diff-prefix-recursive-fix
diff, mirror always take directories as arguments and always does rec…
2015-11-15 22:34:00 -08:00
Krishna Srinivas 7999472cb7 diff, mirror always take directories as arguments and always does recursive operations 2015-11-15 22:22:58 -08:00
Harshavardhana 2d221b656c Merge pull request #1330 from abperiasamy/config-legacy
move older versions of config to config-legacy.go
2015-11-15 22:06:14 -08:00
Anand Babu (AB) Periasamy e6a96a411a move older versions of config to config-legacy.go 2015-11-15 21:39:12 -08:00
Anand Babu (AB) Periasamy e65af14868 Merge pull request #1329 from abperiasamy/access-review
access command review
2015-11-15 21:31:04 -08:00
Anand Babu (AB) Periasamy 4af9e0e83c access command review 2015-11-15 21:16:39 -08:00
Harshavardhana 2bcef94ed5 Merge pull request #1328 from harshavardhana/fix-listing
s3: Fix listing of buckets to match with or without trailing '/'
2015-11-15 21:13:23 -08:00
Harshavardhana 36c66d7aa1 s3: Fix listing of buckets to match with or without trailing '/' 2015-11-15 21:11:10 -08:00
Harshavardhana 527cd0e661 Merge pull request #1327 from abperiasamy/update-rewrite
update command rewrite
2015-11-15 20:58:27 -08:00
Anand Babu (AB) Periasamy 44f03bede1 update command rewrite 2015-11-15 20:54:56 -08:00
Anand Babu (AB) Periasamy f2aa4a112d Merge pull request #1326 from abperiasamy/help-fixes
fixes related to help handling
2015-11-15 20:11:13 -08:00
Anand Babu (AB) Periasamy 39f7441790 fixes related to help handling 2015-11-15 20:05:58 -08:00
Harshavardhana 321e1aa039 Merge pull request #1325 from harshavardhana/windows-fixes
fs: windows fixes for list handling
2015-11-15 18:13:48 -08:00
Harshavardhana 7856e331a1 fs: windows fixes for list handling 2015-11-15 17:50:01 -08:00
Harshavardhana 4ae29d6dd9 Merge pull request #1308 from krishnasrinivas/mirror-cleanup
deltaSourceTargets() cleanup, also fixes #1262
2015-11-15 16:30:29 -08:00
Krishna Srinivas d75690c4fd cleanup for mirror and diff on the way it calculates difference between directories, also fixes #1262 2015-11-15 16:28:04 -08:00
Harshavardhana 127b72ab9f Merge pull request #1324 from harshavardhana/cleanup-cp
fs: avoid nil derefence in fs listRecursive()
2015-11-15 16:24:50 -08:00
Harshavardhana cf76387dea fs: avoid nil derefence in fs listRecursive() 2015-11-15 16:21:39 -08:00
Harshavardhana 9335f9cf04 Merge pull request #1323 from harshavardhana/share
share/list: clean share list
2015-11-15 14:01:18 -08:00
Harshavardhana 516a377bad share/list: clean share list 2015-11-15 13:51:23 -08:00
Harshavardhana c3331213bc Merge pull request #1322 from harshavardhana/fs-behave
fs: Make fs behave like s3 for prefix directories
2015-11-15 13:21:29 -08:00
Harshavardhana 540b72426a fs: Make fs behave like s3 for prefix directories 2015-11-15 13:17:17 -08:00
Harshavardhana 68d6066778 Merge pull request #1321 from harshavardhana/url-join
url: urlJoinPath should work on trailing slashes now.
2015-11-15 12:51:57 -08:00
Harshavardhana c68af8451b url: urlJoinPath should work on trailing slashes now. 2015-11-15 12:49:53 -08:00
Anand Babu (AB) Periasamy 3c0f3134ca add url tests 2015-11-15 11:43:59 -08:00
Harshavardhana 55a20d91aa Merge pull request #1319 from harshavardhana/sort-byname
fs: Non-recursive send in sorted order, note will be slow for large d…
2015-11-15 11:42:14 -08:00
Harshavardhana 47f1d2487b fs: Non-recursive send in sorted order, note will be slow for large directories 2015-11-15 11:39:32 -08:00
Harshavardhana ee5e47c967 Merge pull request #1318 from harshavardhana/update-command
share/access: update command docs formatting
2015-11-15 02:28:19 -08:00
Harshavardhana 20a78ba84c share/access: update command docs formatting 2015-11-15 02:20:52 -08:00
Anand Babu (AB) Periasamy 995d2b1045 Merge pull request #1317 from abperiasamy/version-fixes
version command rewrite
2015-11-14 23:51:15 -08:00
Anand Babu (AB) Periasamy 16faf7ed3e version command rewrite 2015-11-14 23:48:29 -08:00
Anand Babu (AB) Periasamy c4283ab48f Merge pull request #1315 from abperiasamy/help
new help command
2015-11-14 23:44:19 -08:00
Anand Babu (AB) Periasamy dfbd6e6567 new help command 2015-11-14 23:37:00 -08:00
Harshavardhana f94fca577b Merge pull request #1316 from harshavardhana/put-object
cp/mirror: Now putObject does single Put for 0byte sized files
2015-11-14 23:32:02 -08:00
Harshavardhana d9ecccaef2 cp/mirror: Now putObject does single Put for 0byte sized files
Fixes #1313
2015-11-14 23:29:09 -08:00
Anand Babu (AB) Periasamy e453443637 Merge pull request #1312 from abperiasamy/colorize-nil
handle non-existant color calls
2015-11-14 20:42:09 -08:00
Anand Babu (AB) Periasamy fb39bcba80 handle non-existant color calls 2015-11-14 20:39:23 -08:00
Anand Babu (AB) Periasamy f37fdd8b81 Merge pull request #1311 from abperiasamy/share-rewrite
share rewrite
2015-11-14 20:31:12 -08:00
Anand Babu (AB) Periasamy 365a7579bf share rewrite 2015-11-14 20:16:30 -08:00
Harshavardhana ca0aaa2871 Merge pull request #1307 from harshavardhana/url-content
ls: if the top-level URL path has a separator return quickly
2015-11-14 14:59:12 -08:00
Harshavardhana d4015c454b ls: if the top-level URL path has a separator return quickly 2015-11-14 14:56:54 -08:00
Harshavardhana af91cd28cb Merge pull request #1306 from harshavardhana/update
config: Add host for all matching entries.
2015-11-14 13:02:48 -08:00
Harshavardhana 17526e5cb6 config: Add host for all matching entries. 2015-11-14 12:56:21 -08:00
Harshavardhana 6731541217 Merge pull request #1305 from harshavardhana/urlcontent
ls: Fix inconsistent ls output
2015-11-14 12:13:09 -08:00
Harshavardhana 15a0466966 ls: Fix inconsistent ls output 2015-11-14 12:09:28 -08:00
Harshavardhana 4c3f28f7dc Merge pull request #1304 from harshavardhana/readme
doc: More changes pending to README.md
2015-11-14 02:39:06 -08:00
Harshavardhana f31e90f4a2 doc: More changes pending to README.md 2015-11-14 02:30:52 -08:00
Harshavardhana 565bf235db Merge pull request #1303 from minio/readme-update
Update README.md
2015-11-14 02:08:24 -08:00
Harshavardhana 5f56efb956 Update README.md 2015-11-14 02:03:46 -08:00
Harshavardhana 3f1ebdd846 Merge pull request #1302 from harshavardhana/32bit
386: Support 'mc' for linux 32bit operating systems
2015-11-13 23:28:21 -08:00
Harshavardhana 5ba1266f5b 386: Support 'mc' for linux 32bit operating systems 2015-11-13 23:22:00 -08:00
Harshavardhana 5b5327d61a Merge pull request #1301 from harshavardhana/config
config: Migration remove unnecessary s3 host configs
2015-11-13 22:44:09 -08:00
Harshavardhana bfde2b119a config: Migration remove unnecessary s3 host configs 2015-11-13 22:40:44 -08:00
Harshavardhana e1c5cddc60 Merge pull request #1300 from harshavardhana/build-date
update: Support backward compatible date format
2015-11-13 22:15:00 -08:00
Harshavardhana 07abb224e6 update: Support backward compatible date formate 2015-11-13 22:12:30 -08:00
Harshavardhana 2e072ec010 Merge pull request #1299 from harshavardhana/update
update: Fix update command with new changes to dl.minio.io
2015-11-13 20:31:29 -08:00
Harshavardhana 836c78bc72 update: Fix update command with new changes to dl.minio.io 2015-11-13 20:28:07 -08:00
Harshavardhana 40b5548838 Merge pull request #1298 from krishnasrinivas/use-single-connection
Fix to use single connection to the server
2015-11-13 20:00:06 -08:00
Krishna Srinivas 2ea16262e0 Fix to use single connection to the server 2015-11-13 19:55:26 -08:00
Harshavardhana e8e2d4a6c4 Merge pull request #1297 from harshavardhana/vendor
url: simplify url handling in ls, cp, mirror
2015-11-13 19:41:57 -08:00
Harshavardhana 75f27fa74c url: simplify url handling in ls, cp, mirror 2015-11-13 19:38:15 -08:00
Harshavardhana 91b02672d5 Merge pull request #1296 from harshavardhana/simplify
copy: Simplify copy handling for TypeC
2015-11-13 16:15:28 -08:00
Harshavardhana f419064871 copy: Simplify copy handling for TypeC 2015-11-13 16:10:16 -08:00
Harshavardhana cced0b79ec Merge pull request #1295 from krishnasrinivas/prefix-rm
Fix for prefix based rm
2015-11-13 15:22:33 -08:00
Krishna Srinivas eb78783c3f Fix for prefix based rm
"mc rm asd..." where asd is a prefix, not a directory
2015-11-13 14:35:45 -08:00
Harshavardhana 2f30f6728d Merge pull request #1292 from harshavardhana/new-changes
vendor: setBucketRegion simplified and make it part of private config…
2015-11-13 02:16:07 -08:00
Harshavardhana d03681df74 vendor: setBucketRegion simplified and make it part of private config funtion 2015-11-13 02:10:52 -08:00
Harshavardhana 20bdadaf22 Merge pull request #1290 from harshavardhana/fill-path
fs: Fill path variables into error properly
2015-11-13 01:31:32 -08:00
Harshavardhana 3790cf557a fs: Fill path variables into error properly 2015-11-13 01:28:04 -08:00
Harshavardhana dd81951f51 Merge pull request #1289 from harshavardhana/url-handling
error-handling: Add proper typed errors and converged code url2Content.
2015-11-13 00:27:04 -08:00
Harshavardhana 940fd7c608 error-handling: Add proper typed errors and converged code url2Content. 2015-11-13 00:24:09 -08:00
Harshavardhana 97381f67ca Merge pull request #1288 from harshavardhana/s3-bug
s3/gcs: now all combinations and permutations work for URLs with buck…
2015-11-12 20:33:53 -08:00
Harshavardhana 22051bb8af s3/gcs: now all combinations and permutations work for URLs with buckets in different regions.
- <bucket>.s3.amazonaws.com with <bucket> in us-west-2 re-writes
   the URL to s3-us-west-2.amazonaws.com.
 - <bucket>.s3-us-west-2.amazonaws.com doesn't need and translation,
   call goes directly to s3-us-west-2.amazonaws.com
2015-11-12 20:29:20 -08:00
Harshavardhana bdb04d5dc8 Merge pull request #1287 from krishnasrinivas/rm-remove-force
Remove --force option from cp as url2stat() on s3 checks were slowing things down
2015-11-12 19:56:44 -08:00
Krishna Srinivas dc4b903be9 Remove --force option from cp as url2stat() on s3 checks were slowing things down 2015-11-12 19:13:14 -08:00
Harshavardhana cf40673309 Merge pull request #1280 from krishnasrinivas/vendor-update
fix to make mc work with <bucket>.s3.amazonaws.com style hostname
2015-11-12 16:28:05 -08:00
Krishna Srinivas 4f9589ef79 vendor update for minio-go 2015-11-12 16:04:32 -08:00
Harshavardhana 2a72d6b494 Merge pull request #1286 from harshavardhana/list-only
config: list hosts only present in config.
2015-11-12 13:44:19 -08:00
Harshavardhana 54e24eccaa config: list hosts only present in config.
Fixes #1285
2015-11-12 13:34:05 -08:00
Harshavardhana a523baf1fc Merge pull request #1284 from harshavardhana/share
share: Fix share command for google cloud
2015-11-12 12:10:16 -08:00
Harshavardhana eb10e0e089 share: Fix share command for google cloud
Fixes #1282
2015-11-12 12:05:36 -08:00
Anand Babu (AB) Periasamy 61062dd999 Merge pull request #1283 from abperiasamy/review-session
review session code
2015-11-12 11:55:49 -08:00
Anand Babu (AB) Periasamy d917951b58 review session code 2015-11-12 11:46:06 -08:00
Harshavardhana cdf1980666 Merge pull request #1281 from koolhead17/patch-2
Update INSTALLGO.md
2015-11-12 10:16:16 -08:00
koolhead17 e060875409 Update INSTALLGO.md
Added the .bash_profile changes for mac & modified .bashrc content for ubuntu.
2015-11-12 19:01:05 +05:30
Harshavardhana 299fea13d5 Merge pull request #1279 from abperiasamy/review-multiple-cmds
review of cp ls mirror pipe and rm
2015-11-12 01:42:03 -08:00
Anand Babu (AB) Periasamy 3950402c89 review of cp ls mirror pipe and rm 2015-11-12 01:34:43 -08:00
Harshavardhana bb06a6a733 Merge pull request #1278 from harshavardhana/s3-ls
fs: Make fs behave like s3 - fixes #1246
2015-11-12 01:33:59 -08:00
Harshavardhana 5018b01a51 fs: Make fs behave like s3 - fixes #1246 2015-11-12 01:26:47 -08:00
Anand Babu (AB) Periasamy d8d7e89a42 Merge pull request #1277 from abperiasamy/cat-review
cat code review
2015-11-12 00:17:41 -08:00
Anand Babu (AB) Periasamy 881a8a1366 cat code review 2015-11-12 00:12:11 -08:00
Harshavardhana 930ea1badd Merge pull request #1276 from harshavardhana/config
config: migrate to new configV6
2015-11-12 00:09:28 -08:00
Harshavardhana 824a6b8cb8 config: migrate to new configV6
Fixes #1266

- add "*s3*amazonaws.com" as part of the new config.
- add "*storage.googleapis.com" as part of the new config.
2015-11-12 00:04:41 -08:00
Harshavardhana 6c605df8a3 Merge pull request #1275 from koolhead17/patch-1
Update INSTALLGO.md
2015-11-12 00:01:12 -08:00
koolhead17 21cf62912e Update INSTALLGO.md
Added more information regarding souring  Go environment and testing the setup.
2015-11-12 13:19:50 +05:30
Anand Babu (AB) Periasamy 6cd0ca9c51 Merge pull request #1274 from abperiasamy/mb-review
mb code review
2015-11-11 23:29:18 -08:00
Anand Babu (AB) Periasamy 49d5cd6b63 mb code review 2015-11-11 23:25:46 -08:00
Harshavardhana bd2573f210 Merge pull request #1272 from harshavardhana/incomplete
rm/ls: Remove and List incomplete uploads properly
2015-11-11 21:38:26 -08:00
Harshavardhana 9480f8c9ae rm/ls: Remove and List incomplete uploads properly
Fixes #1271
2015-11-11 21:35:51 -08:00
Anand Babu (AB) Periasamy 27c3bb1e2c Merge pull request #1269 from abperiasamy/ls-overhaul
simplify ls command
2015-11-11 17:48:19 -08:00
Anand Babu (AB) Periasamy ed0dbb835b simplify ls command 2015-11-11 17:45:20 -08:00
Harshavardhana 20b546b361 Merge pull request #1268 from krishnasrinivas/virtual-style-bucket-share-upload-fix
Fix unexpected padding of bucket name with "mc share upload" #1263
2015-11-11 17:42:29 -08:00
Krishna Srinivas 900770abfd Fix unexpected padding of bucket name with "mc share upload" #1263 2015-11-11 17:35:29 -08:00
Harshavardhana 1534003e95 Merge pull request #1267 from harshavardhana/mc-s3
s3: Change s3 behavior - for virtual style requests filter buckets out.
2015-11-11 16:35:42 -08:00
Harshavardhana 5afc55acb7 s3: Change s3 behavior - for virtual style requests filter buckets out.
Fixes #1264
2015-11-11 16:31:54 -08:00
Harshavardhana 1021d0b336 Merge pull request #1265 from harshavardhana/fs-walk
fs: Implement custom walk to handle sorting properly
2015-11-11 14:47:57 -08:00
Harshavardhana 6f7e752aa0 fs: Implement custom walk to handle sorting properly 2015-11-11 14:43:18 -08:00
Harshavardhana fa85630cf7 Merge pull request #1261 from harshavardhana/mirror
mirror: Fix handling of preceding separators from source
2015-11-11 02:04:23 -08:00
Harshavardhana 7d3b1a6ddb mirror: Fix handling of preceding separators from source
Filesystem now never replies back directories for recursive usecase.
2015-11-11 02:01:54 -08:00
Anand Babu (AB) Periasamy d757a36e97 Merge pull request #1259 from abperiasamy/readme-fix
format fix
2015-11-11 00:23:39 -08:00
Anand Babu (AB) Periasamy 6176771556 format fix 2015-11-11 00:20:36 -08:00
Anand Babu (AB) Periasamy f5ee78faa6 Merge pull request #1258 from minio/abperiasamy-patch-1
pig became pipe
2015-11-11 00:18:03 -08:00
Anand Babu (AB) Periasamy 3422bab341 pig became pipe 2015-11-11 00:09:25 -08:00
Anand Babu (AB) Periasamy 287ef7a9a8 Merge pull request #1257 from abperiasamy/pig2pipe
pig became pipe
2015-11-11 00:06:59 -08:00
Anand Babu (AB) Periasamy 32c7590621 pig became pipe 2015-11-11 00:04:01 -08:00
Harshavardhana 9c98d7eaee Merge pull request #1256 from harshavardhana/cleanup-cp-mirror
cp/mirror: cleanup - now support `--force` flag
2015-11-10 23:49:53 -08:00
Harshavardhana d6c16ad597 cp/mirror: cleanup - now support --force flag 2015-11-10 23:47:02 -08:00
Anand Babu (AB) Periasamy 286fe7fd7b Merge pull request #1255 from abperiasamy/console-cleanup
simplify setting console theme
2015-11-10 16:47:57 -08:00
Anand Babu (AB) Periasamy 970927cc6b simplify setting console theme 2015-11-10 16:45:32 -08:00
Harshavardhana fc6a2971cb Merge pull request #1254 from harshavardhana/alias
alias: Support aliases with preceding separators
2015-11-10 12:58:21 -08:00
Harshavardhana 08697dc332 alias: Support aliases with preceding separators 2015-11-10 12:53:49 -08:00
Harshavardhana d16e1f6d40 Merge pull request #1253 from harshavardhana/fix-mirror
mirror: Fix mirror command
2015-11-10 12:53:00 -08:00
Harshavardhana 39edb01800 mirror: Fix mirror command
Add proper trimming of prefixes, to properly verify targets and its
contents.

This bug creeped in after recent URL changes.
2015-11-10 12:50:30 -08:00
Harshavardhana 12b26375e2 Merge pull request #1252 from harshavardhana/add-scanbar
diff: Add scanBar for recursive diff
2015-11-10 02:01:12 -08:00
Harshavardhana 8f11c67956 diff: Add scanBar for recursive diff 2015-11-10 01:58:06 -08:00
Harshavardhana ebf96ea853 Merge pull request #1251 from harshavardhana/fix-bug
signature: Fix a bug in signature v2
2015-11-10 00:29:30 -08:00
Harshavardhana 6333935562 signature: Fix a bug in signature v2 2015-11-10 00:26:30 -08:00
Harshavardhana 09f696c640 Merge pull request #1250 from harshavardhana/google-cloud
doc: Add google cloud storage
2015-11-09 23:49:52 -08:00
Harshavardhana 08c90a2c03 doc: Add google cloud storage 2015-11-09 23:46:46 -08:00
Harshavardhana b7dc5414d8 Merge pull request #1249 from harshavardhana/signature
minio-go: update to new version of minio-go
2015-11-09 23:10:59 -08:00
Harshavardhana 03e9fa70dd minio-go: update to new version of minio-go
This change comes with wider re-structure inside minio-go and lots
of code cleanup.
2015-11-09 23:03:45 -08:00
Harshavardhana 3fca2428ad Merge pull request #1248 from harshavardhana/cleanup
diff: Cleanup diff
2015-11-09 16:42:00 -08:00
Harshavardhana dc985953e4 diff: Cleanup diff
- overall simplification and reduction in repetitive code.
- use select for multi channel synchronization.
2015-11-09 16:37:54 -08:00
Harshavardhana 04b4ef4928 Merge pull request #1247 from harshavardhana/list
copy: Fix copyURLsTypeC style of copying with or without separator.
2015-11-08 15:31:43 -08:00
Harshavardhana 6d86cbc686 copy: Fix copyURLsTypeC style of copying with or without separator.
- `mc cp pkg... test` copies all `pkg` including itself
- `mc cp pkg/... test` copies all content inside `pkg` excluding `pkg`
2015-11-08 15:24:38 -08:00
Harshavardhana 93ec567278 Merge pull request #1245 from harshavardhana/list
cleanup: Cleanup across code base.
2015-11-08 13:30:04 -08:00
Harshavardhana 6a8224b4ab cleanup: Cleanup across code base.
- improve on code comments, needs more work this is a first cut.
- improve on naming conventions and simplification as and when
  necessary.
2015-11-08 13:22:32 -08:00
Harshavardhana 4441c9bb31 Merge pull request #1244 from harshavardhana/windows
build: Evaluate ldflags properly
2015-11-08 03:54:17 -08:00
Harshavardhana 56ccca29f9 build: Evaluate ldflags properly 2015-11-08 03:50:29 -08:00
Anand Babu (AB) Periasamy 26ebf2d028 Merge pull request #1243 from abperiasamy/rm-rewrite
simplify rm code
2015-11-08 03:38:13 -08:00
Anand Babu (AB) Periasamy 3d847915c7 simplify rm code 2015-11-08 03:32:31 -08:00
Harshavardhana 2617b62ed3 Merge pull request #1242 from harshavardhana/fix-more-listing
list: Fix more listing bugs
2015-11-08 02:51:31 -08:00
Harshavardhana fb48c24176 list: Fix more listing bugs 2015-11-08 02:49:09 -08:00
Harshavardhana c37824d058 Merge pull request #1241 from harshavardhana/listing-fixes
list: Fix listing command output
2015-11-08 00:12:34 -08:00
Harshavardhana cb87550978 list: Fix listing command output
Fix all the incorrectness behavior of `ls` introduced after
recent changes.
2015-11-08 00:07:11 -08:00
Harshavardhana b71e2b4962 Merge pull request #1240 from harshavardhana/url-changes
structure: Move client.Content to return a URL object
2015-11-07 22:19:15 -08:00
Harshavardhana b9033d1cac structure: Move client.Content to return a URL object
This change is needed to avoid extensive string manipulation
of URLs throughout the code base.

A client interface sends back data as a proper URL object,
this facilitates us to avoid unnecessary string manipulation
by making code more cleaner.
2015-11-07 22:12:52 -08:00
Anand Babu (AB) Periasamy d8efa979ff Merge pull request #1239 from abperiasamy/perr
fixed variable naming conventions
2015-11-07 18:31:58 -08:00
Anand Babu (AB) Periasamy d634e3883a fixed variable naming conventions 2015-11-07 17:00:20 -08:00
Anand Babu (AB) Periasamy 27a8e64350 Merge pull request #1238 from abperiasamy/prints
Prints cleanup
2015-11-07 16:44:54 -08:00
Anand Babu (AB) Periasamy 334e864eea Prints cleanup 2015-11-07 16:41:42 -08:00
Harshavardhana 6534268dc2 Merge pull request #1236 from harshavardhana/minio-go-legacy-merge
signature: Update new minio-go, bring in comprehensive Signature support
2015-11-06 23:50:19 -08:00
Harshavardhana 8273192dcf signature: Update new minio-go, bring in comprehensive Signature support 2015-11-06 23:46:16 -08:00
Harshavardhana 5572d47cd2 Merge pull request #1235 from harshavardhana/remove-static
build: Remove ldflags
2015-11-06 17:44:42 -08:00
Harshavardhana 234c3906d4 build: Remove ldflags 2015-11-06 17:41:15 -08:00
Harshavardhana ffd1f54b55 Merge pull request #1234 from harshavardhana/listing-bug
list: Move `incomplete` as last argument.
2015-11-06 16:22:58 -08:00
Harshavardhana 8de841cd69 list: Move incomplete as last argument.
implement args.Head() to handle this case smoothly.
2015-11-06 16:17:15 -08:00
Harshavardhana 9f206f590f Merge pull request #1233 from harshavardhana/make-static
build: Make by default static builds for mc
2015-11-05 22:48:20 -08:00
Harshavardhana 503e746778 build: Make by default static builds for mc 2015-11-05 22:39:05 -08:00
Harshavardhana c3e7786c92 Merge pull request #1232 from harshavardhana/update-docs
Update docs for share, session and config
2015-11-04 20:29:18 -08:00
Harshavardhana 540b76fb9c Update docs for share, session and config 2015-11-04 20:14:01 -08:00
Harshavardhana 65d39bbfa9 Merge pull request #1231 from minio/add-google-storage-inst
Add AWS and Google Cloud instructions in README.md
2015-11-03 18:36:15 -08:00
Harshavardhana d9d9f6f63c Update README.md 2015-11-03 18:33:39 -08:00
Harshavardhana c67dfa8da3 Merge pull request #1230 from minio/update-readme
Update README.md
2015-11-03 18:09:16 -08:00
Harshavardhana 2a8dd4b553 Update README.md 2015-11-03 18:05:10 -08:00
Harshavardhana 69ca816fd8 Merge pull request #1229 from harshavardhana/build-ldflags
build: Populate mcVersion through ldflags
2015-11-02 12:51:34 -08:00
Harshavardhana 123e44d8c5 build: Populate mcVersion through ldflags
By default binary built through 'go get github.com/minio/mc'. Will be
considered UNOFFICIAL.GOGET with not versioning, 'go get' binaries
cannot use 'mc update' functionality.

First reasoning towards this is - go build tools have no way to specifying
versions and releases unlike `npm`. For this reason alone we have to
differentiate OFFICIAL and UNOFFICIAL.

Now a 'make' will build appropriate binaries, while 'go get' becomes UNOFFICIAL.
2015-11-02 12:42:17 -08:00
Harshavardhana a719323cdd Merge pull request #1228 from harshavardhana/write-pending-tests
Finish off some pending tests for cp, mirror, pig, version, share
2015-10-29 19:06:58 -07:00
Harshavardhana aedd2d2c39 Add version test 2015-10-29 19:03:40 -07:00
Harshavardhana 9447548805 Add share tests 2015-10-29 18:50:15 -07:00
Harshavardhana a17cb6037d Add pig failure test 2015-10-29 18:34:10 -07:00
Harshavardhana 619bc1bf23 Add mirror and cp tests 2015-10-29 18:12:04 -07:00
Harshavardhana e65b55e01a Merge pull request #1227 from winchram/devel
mirror: refactor session creation
2015-10-29 17:56:20 -07:00
Winch Ram 0ab5e27456 mirror: refactor session creation
Previously session creation was written in a way to work unsorted
source and targets content, but reality is source and targets give
contents in sorted order always.

This patch fixes session creation to use pre-sorted source and targets
content.

Signed-off-by: Winch Ram <winchram@gmail.com>
2015-10-30 06:14:07 +05:30
Harshavardhana 4ecade6ca6 Merge pull request #1225 from krishnasrinivas/rmprogress
"rm" progress output
2015-10-28 20:56:22 -07:00
Krishna Srinivas d9fa12d862 "rm" progress output 2015-10-28 20:52:10 -07:00
Harshavardhana c4dbd82f7d Merge pull request #1224 from minio/harshavardhana-patch-1
Update INSTALLGO.md
2015-10-28 17:16:42 -07:00
Harshavardhana a584e6ce14 Update INSTALLGO.md 2015-10-28 15:41:47 -07:00
Harshavardhana adc391d0b6 Merge pull request #1223 from harshavardhana/strings-compare
Remove usage of strings.Compare - always golangs native checks like "…
2015-10-28 13:58:15 -07:00
Harshavardhana f4a00c9904 Remove usage of strings.Compare - always golangs native checks like ">, <, ==" for strings 2015-10-28 13:47:49 -07:00
Harshavardhana cab949b88f Merge pull request #1222 from harshavardhana/directory-symlink
Handle directory symlink navigation
2015-10-28 00:17:31 -07:00
Harshavardhana 671ce5242d Handle directory symlink navigation 2015-10-28 00:13:20 -07:00
Harshavardhana b89fe068e9 Merge pull request #1221 from harshavardhana/handle-directorys
Handle directories and print proper errors for cp
2015-10-27 18:18:56 -07:00
Harshavardhana 76a47677c3 Handle directories and print proper errors for cp 2015-10-27 17:47:15 -07:00
Harshavardhana 4d2d32e661 Merge pull request #1218 from harshavardhana/segfault
Fix rm segfault - fail on catastrophic error
2015-10-25 14:38:45 -07:00
Harshavardhana d85973042c Fix rm segfault - fail on catastrophic error
fixes #1216
2015-10-25 14:26:49 -07:00
Harshavardhana 8570a25709 Merge pull request #1217 from harshavardhana/construct-url
Construct url properly, use filepath.Join only for paths
2015-10-25 13:42:11 -07:00
Harshavardhana 23e1d34d64 Construct url properly, use filepath.Join only for paths
fixes #1215
2015-10-25 13:38:25 -07:00
Harshavardhana d23dcd8204 Merge pull request #1214 from harshavardhana/mc-release
Pick release tag from mcReleaseTag
2015-10-25 11:16:48 -07:00
Harshavardhana a0d7e5f9be Pick release tag from mcReleaseTag 2015-10-25 11:12:36 -07:00
Harshavardhana a20c5518b1 Merge pull request #1213 from harshavardhana/update-probe
Update probe with new changes and setAppInfo for probe
2015-10-25 11:09:41 -07:00
Harshavardhana ae447a96ad Update probe with new changes and setAppInfo for probe 2015-10-25 11:05:12 -07:00
Harshavardhana 7452f7b1d2 Merge pull request #1211 from abperiasamy/fix-config-v3-migrate
fix config v3 fix function
2015-10-24 01:47:56 -07:00
Anand Babu (AB) Periasamy 00611fb35b fix config v3 fix function 2015-10-24 00:52:25 -07:00
Harshavardhana fb6e9476fc Merge pull request #1210 from harshavardhana/api-public-cloud
Update minio-go-legacy, now mc fully supports Google Cloud Storage - …
2015-10-23 20:43:41 -07:00
Harshavardhana 079becd49e Update minio-go-legacy, now mc fully supports Google Cloud Storage - fixes #1185 2015-10-23 20:41:08 -07:00
Anand Babu (AB) Periasamy 8ad658058b Merge pull request #1209 from abperiasamy/fix-vendor-json
fix vendors.json with new govendor
2015-10-23 20:10:07 -07:00
Anand Babu (AB) Periasamy d4b6b180ad fix vendors.json with new govendor 2015-10-23 20:04:03 -07:00
Anand Babu (AB) Periasamy 5ca65022c3 Merge pull request #1208 from abperiasamy/pkg-update
added pkg-update to update a vendorized package
2015-10-23 17:47:11 -07:00
Anand Babu (AB) Periasamy 86edabd264 added pkg-update to update a vendorized package 2015-10-23 17:44:17 -07:00
Anand Babu (AB) Periasamy 89b2ddd9f9 Merge pull request #1207 from abperiasamy/probe-update
updated probe
2015-10-23 17:39:30 -07:00
Anand Babu (AB) Periasamy 48adfcdcd8 updated probe 2015-10-23 17:35:21 -07:00
Harshavardhana 009c1fd8ce Merge pull request #1205 from harshavardhana/incomplete-upload
Merge RemoveIncompleteUpload() into Remove
2015-10-22 15:21:06 -07:00
Harshavardhana f94de478c3 Merge RemoveIncompleteUpload() into Remove 2015-10-22 15:18:11 -07:00
Harshavardhana 1ee1b984b8 Merge pull request #1204 from harshavardhana/remove-object
Simplify client interface
2015-10-22 10:54:29 -07:00
Harshavardhana 795a8edf64 Simplify client interface 2015-10-22 10:47:24 -07:00
Anand Babu (AB) Periasamy 47991fba6c Merge pull request #1203 from abperiasamy/root-ok
remove root check
2015-10-22 00:18:57 -07:00
Anand Babu (AB) Periasamy 3d6b19f833 remove root check 2015-10-22 00:13:32 -07:00
Harshavardhana 3473c88e95 Merge pull request #1202 from minio/abperiasamy-patch-1
"go get -u" by default
2015-10-22 00:02:15 -07:00
Anand Babu (AB) Periasamy 322f1a0561 go get -u" 2015-10-21 23:49:28 -07:00
Harshavardhana 118d7e3bb4 Merge pull request #1201 from krishnasrinivas/rename-drop-to-remove
Rename DropIncompleteUpload to RemoveIncompleteUpload
2015-10-21 23:41:32 -07:00
Krishna Srinivas 513ab017b9 Rename DropIncompleteUpload to RemoveIncompleteUpload 2015-10-21 22:25:27 -07:00
Harshavardhana 706124b248 Merge pull request #1200 from krishnasrinivas/fs-rm-recursive
Support for "rm" of localdir/prefix...
2015-10-21 18:51:10 -07:00
Krishna Srinivas b240c7c88a Support for "rm" of localdir/prefix... 2015-10-21 18:46:19 -07:00
Harshavardhana 491a6ab31c Merge pull request #1199 from krishnasrinivas/fs-ls-recursive-fix
recursive 'mc ls' on filesystem gives error #1198
2015-10-21 18:43:20 -07:00
Krishna Srinivas e9bc4af214 recursive 'mc ls' on filesystem gives error #1198 2015-10-21 18:10:40 -07:00
Harshavardhana ca6075e776 Merge pull request #1197 from krishnasrinivas/bug-1196
recursive ls on object storage was giving incorrect output fix for #1196
2015-10-21 15:08:43 -07:00
Krishna Srinivas 1cab0c2c24 recursive ls on object storage was giving incorrect output
fix for #1196
2015-10-21 14:55:00 -07:00
Harshavardhana 53d32e31db Merge pull request #1195 from krishnasrinivas/removeincompleteuploads-testcase
test case for "mc rm"
2015-10-21 09:23:05 -07:00
Krishna Srinivas d11767771c test case for "mc rm" 2015-10-21 02:05:30 -07:00
Harshavardhana e74615943c Merge pull request #1194 from harshavardhana/rm-code-simplify
Improve upon the argument verification - use the existing primitives from cli package
2015-10-20 20:50:58 -07:00
Harshavardhana 2f46510d26 Improve upon the argument verification - use the existing primitives from cli package 2015-10-20 20:47:08 -07:00
Harshavardhana 56ee709f16 Merge pull request #1193 from krishnasrinivas/removeincompleteuploads
Support for "mc rm s3/bucket/dir/... incomplete force"
2015-10-20 19:50:43 -07:00
Krishna Srinivas a3b49bdd34 Support for "mc rm s3/bucket/dir/... incomplete force" 2015-10-20 19:40:21 -07:00
Harshavardhana 548f410ea7 Merge pull request #1192 from harshavardhana/arm-support
Add arm support for build scripts
2015-10-20 11:58:01 -07:00
Harshavardhana 9ccd387bc6 Add arm support for build scripts 2015-10-20 11:48:36 -07:00
Harshavardhana cbf1cc0206 Merge pull request #1191 from harshavardhana/list-multipart-objects
Implement `mc ls incomplete s3/bucketname`
2015-10-19 22:30:52 -07:00
Harshavardhana 1eb171544f Implement mc ls incomplete s3/bucketname 2015-10-19 22:28:34 -07:00
Harshavardhana 21f8f55176 Merge pull request #1189 from krishnasrinivas/delete-object
support for "rm" of objects and buckets
2015-10-19 15:34:44 -07:00
Krishna Srinivas b4c78a33ff support for "rm" of objects and buckets 2015-10-19 15:11:59 -07:00
Krishna Srinivas 2a3b201457 vendor update minio-go-legacy 2015-10-19 15:09:44 -07:00
Krishna Srinivas 7f7e4cc330 vendor update minio-go 2015-10-19 15:09:44 -07:00
Harshavardhana 302d2c967f Merge pull request #1190 from krishnasrinivas/remove-newline
remove the un-needed space character in help display which would make…
2015-10-17 10:22:20 -07:00
Krishna Srinivas b73d4662e8 remove the un-needed space character in help display which would make the shell prompt offset by a space char. 2015-10-17 02:55:19 -07:00
Harshavardhana 881c12ddf1 Merge pull request #1188 from harshavardhana/mc-package
Migrate mc package to minio-xl from minio/minio repo for probe/quick
2015-10-17 00:32:03 -07:00
Harshavardhana f85e8827e1 Migrate mc package to minio-xl from minio/minio repo for probe/quick 2015-10-17 00:24:14 -07:00
Harshavardhana ed85b64fd5 Merge pull request #1187 from harshavardhana/relax-etag
Relax strict ETag requirement for Get and Head requests
2015-10-13 17:30:27 -07:00
Harshavardhana ee212e5b52 Relax strict ETag requirement for Get and Head requests 2015-10-13 17:22:51 -07:00
Harshavardhana 8f08a067c4 Merge pull request #1186 from harshavardhana/mc-share
Fix mc share download for special character encoding
2015-10-13 10:22:55 -07:00
Harshavardhana 0f8f5ae6b6 Fix mc share download for special character encoding
mc share download would fail to generate or generate a wrong signature
for a URLs with special unencoded characters.

This issue was limited to signature v2.
2015-10-13 10:14:26 -07:00
Harshavardhana 3d12efaaca Update README.md 2015-10-12 21:41:38 -07:00
Harshavardhana 30f08b054f Merge pull request #1184 from harshavardhana/move-to-zip
Do not use msi installation during testing, use zip file much faster
2015-10-12 12:14:24 -07:00
Harshavardhana 096b229e03 Do not use msi installation during testing, use zip file much faster 2015-10-12 12:07:52 -07:00
Harshavardhana 7eb149d49c Merge pull request #1183 from harshavardhana/infiniteloop-bug
Fix an infinite loop bug
2015-10-12 10:55:16 -07:00
Harshavardhana ccf7613e87 Fix an infinite loop bug
While doing recursive listing of objects and object prefixes which have
non encoded characters for example ``++`` leads to S3 sending same replies
for all subsequent ``ListObjects()`` request. Essentially leading to an
infinite loop.
2015-10-12 10:49:54 -07:00
Harshavardhana 2218eaefd3 Merge pull request #1182 from harshavardhana/reduce-operations
Reduce number of operations on windows build
2015-10-11 11:44:38 -07:00
Harshavardhana ca2525bb63 Reduce number of operations on windows build 2015-10-11 11:41:32 -07:00
Anand Babu (AB) Periasamy 78a2c33b00 Merge pull request #1181 from abperiasamy/commom-methods-cleanup
target2Client and source2Client methods are not necessary
2015-10-11 03:19:23 -07:00
Anand Babu (AB) Periasamy 636f243dcc target2client and source2client methods are not necessary 2015-10-11 03:07:47 -07:00
Anand Babu (AB) Periasamy 7ce37ea115 Merge pull request #1180 from abperiasamy/pig
new pig command
2015-10-11 01:48:42 -07:00
Anand Babu (AB) Periasamy 21a90da0bf new pig command 2015-10-11 01:45:32 -07:00
Harshavardhana a1365f63f0 Merge pull request #1179 from harshavardhana/implement-proper-checks
Always make sure to verify argument validation in checkSyntax**.
2015-10-10 13:09:30 -07:00
Harshavardhana c4b9891c6e Always make sure to verify argument validation in checkSyntax**.
Cleanup share-upload.go to be aware of different argument validation.
2015-10-10 13:05:33 -07:00
Harshavardhana f730083872 Merge pull request #1177 from krishnasrinivas/share-output-cleanup
mc share output cleanup
2015-10-09 17:53:54 -07:00
Krishna Srinivas ef98d5963b mc share output cleanup 2015-10-09 16:56:25 -07:00
Harshavardhana 1d51b376e7 Merge pull request #1178 from harshavardhana/accounting-reader
Use FormatBytes from pb project for a consistent view
2015-10-09 15:47:23 -07:00
Harshavardhana 918b5c06a0 Use FormatBytes from pb project for a consistent view 2015-10-09 15:35:18 -07:00
Harshavardhana 31a72a02d2 Merge pull request #1176 from harshavardhana/accounting-reader-for-quiet-mode
Add new accounting reader which prints Total transferred and Average …
2015-10-09 13:16:45 -07:00
Harshavardhana 26cb1e7ae3 Add new accounting reader fixes #1162
Just like how a progress bar keeps track of data transfer
and average speed. Accounting reader implements similar
functionalities for calculating average speed, total transferred.

This accounting information is printed at the end of the copy or mirror
operation in quiet mode.
2015-10-09 12:29:13 -07:00
Anand Babu (AB) Periasamy f49cac08b9 Merge pull request #1175 from abperiasamy/cat-enhancements
Interpret - as stdin
2015-10-08 23:32:14 -07:00
Anand Babu (AB) Periasamy 4782259e57 Interpret - as stdin 2015-10-08 23:29:27 -07:00
Anand Babu (AB) Periasamy ca7f612ac4 Interpret - as stdin 2015-10-08 23:02:16 -07:00
Harshavardhana b1ae9bbfa3 Merge pull request #1174 from krishnasrinivas/presigned-post-s3v2
presigned post for s3v2
2015-10-08 19:13:23 -07:00
Krishna Srinivas 18c0671c7e Presigned post enabled for s3v2 2015-10-08 17:28:37 -07:00
Krishna Srinivas 6ff16c0a0e vendor update for minio-go-legacy 2015-10-08 17:28:37 -07:00
Harshavardhana 98129e8400 Merge pull request #1173 from harshavardhana/cursor-animate
Add cursor animate to mirror
2015-10-08 16:35:53 -07:00
Harshavardhana e03315ba44 Add cursor animate to mirror 2015-10-08 16:24:20 -07:00
Harshavardhana d3f7a28f14 Merge pull request #1172 from harshavardhana/broken-symlink
Handle errors coming in through List avoid crashes
2015-10-08 16:23:45 -07:00
Harshavardhana 0d63b236e8 Handle errors coming in through List avoid crashes 2015-10-08 16:17:37 -07:00
Harshavardhana 5f6990014d Merge pull request #1171 from harshavardhana/streaming-input-changes
Anticipating streaming input vendorize changes from minio-go, minio-g…
2015-10-08 15:30:07 -07:00
Harshavardhana 16d489fa3b Anticipating streaming input vendorize changes from minio-go, minio-go-legacy.
Progressbar doesn't add to Total value if its a streaming input, this provides
us infinite progress bar.
2015-10-08 15:26:05 -07:00
Harshavardhana db4387c56a Merge pull request #1170 from vadmeste/process_symlink_loop_error
Relax `too many levels symlink error` when traversing folders/files
2015-10-08 15:15:33 -07:00
Anis Elleuch 45b1351991 Relax too many levels symlink error when traversing folders/files 2015-10-08 22:56:59 +01:00
Harshavardhana 4354c139a0 Merge pull request #1169 from harshavardhana/fix-mirror-crash
In case of errors not all the cases have content.Content as non nil -…
2015-10-08 14:03:06 -07:00
Harshavardhana 0175f11388 In case of errors not all the cases have content.Content as non nil - fixes #1166 2015-10-08 13:59:49 -07:00
Harshavardhana 1fb55f7685 Merge pull request #1168 from krishnasrinivas/mc-upload-presign
mc share upload
2015-10-08 13:49:24 -07:00
Krishna Srinivas aa53fb19f9 Break share main file into subcommands files - upload, download, list 2015-10-08 13:43:41 -07:00
Krishna Srinivas 7ec74a33ce Implement mc share upload and mc share download 2015-10-08 13:20:29 -07:00
Krishna Srinivas 7c251c314b Vendor update for github.com/minio/minio-go 2015-10-08 13:20:24 -07:00
Krishna Srinivas 428cc1eed6 Vendor update for github.com/minio/minio/pkg/quick package 2015-10-08 13:19:42 -07:00
Harshavardhana e3f3698526 Merge pull request #1167 from harshavardhana/add-colors
Add new --colors option for choosing different coloring styles for co…
2015-10-07 17:28:09 -07:00
Harshavardhana 6d95872ad8 Add new --colors option for choosing different coloring styles for console printing
Each command implements and interprets the following coloring styles

 - ``dark`` - default coloring style picks up palette colors Cyan, Red, Blue, White etc
 - ``light`` - lighter chooses white colored console printing.
 - ``nocolor`` - nocolor is for console printing without any colors.

All coloring internally use ASCII color schemes, portable across all known OS.
2015-10-07 17:08:42 -07:00
Harshavardhana f38e0569a6 Merge pull request #1165 from harshavardhana/palette-theme
Add SetCustomPalette rather than theme
2015-10-07 12:59:57 -07:00
Harshavardhana dbe53325b0 Add SetCustomPalette rather than theme 2015-10-07 12:54:35 -07:00
Harshavardhana 4787a7b2a3 Merge pull request #1164 from harshavardhana/add-error
Improve mirror error message
2015-10-06 11:15:45 -07:00
Harshavardhana 87aadd20ec Improve mirror error message 2015-10-06 11:12:16 -07:00
Harshavardhana 9d96acfd01 Merge pull request #1163 from krishnasrinivas/mirror-fix3
trailing slash was not enforced on sourceClnt - fixes #1158
2015-10-05 20:59:49 -07:00
Krishna Srinivas 9b45038a78 trailing slash was not enforced on sourceClnt #1158 2015-10-05 20:54:42 -07:00
Harshavardhana d750398f4d Bump to new version 2015-10-05 10:53:04 -07:00
Harshavardhana 344a73b04c Merge pull request #1161 from harshavardhana/version
Migrate vendoring to new location
2015-10-05 10:40:30 -07:00
Harshavardhana 45c8db4bf8 Migrate vendoring to new location 2015-10-05 10:34:39 -07:00
Harshavardhana 78e03eda9b Merge pull request #1159 from harshavardhana/remove-diff
Remove diff dependency on sorted-list
2015-10-04 11:34:00 -07:00
Harshavardhana 1f61963420 Remove diff dependency on sorted-list
Recursively filesystem is sorted by default, there is no reason to
store temporary files so that we can loop on them later.

This change does direct streaming diff - since both first and second
URL for the arguments are guaranteed to provide lexically correct output.

We can remove the necessity of creating new temporary files.
2015-10-04 11:26:16 -07:00
Harshavardhana be02966161 Merge pull request #1157 from krishnasrinivas/remove-patricia
Remove patricia dependency
2015-10-04 11:05:04 -07:00
Krishna Srinivas 070e7244b2 Remove patricia dependency 2015-10-03 17:23:47 -07:00
Harshavardhana 6c2e6489ea Merge pull request #1151 from krishnasrinivas/mirror-fix2
mirror - dump the sorted list of source and destinations to local dis…
2015-10-03 14:54:39 -07:00
Harshavardhana e748db5c1f Merge pull request #1156 from harshavardhana/quick-changes
Move to new changes in pkg/quick with json parse error formatting
2015-10-03 12:35:25 -07:00
Harshavardhana 9b024156a5 Move to new changes in pkg/quick with json parse error formatting
Thanks to Anis Elleuch for really good work.
2015-10-03 12:28:36 -07:00
Krishna Srinivas 9c23a4349c mirror - dump the sorted list of source and destinations to local disk and find the files that need to be mirrored 2015-10-03 02:02:25 -07:00
Harshavardhana 2307456c66 Merge pull request #1155 from harshavardhana/sorted-list
Avoid pointer reference of immutable methods
2015-10-02 17:54:53 -07:00
Harshavardhana 67d6a47746 Avoid pointer reference of immutable methods 2015-10-02 17:51:44 -07:00
Harshavardhana 1866c82eee Merge pull request #1152 from harshavardhana/relative-url-handling
Move to new changes in minio-go and minio-go-legacy to use relative URL's in http request
2015-10-02 12:45:16 -07:00
Harshavardhana cae4dc04be Move to new changes in minio-go to use relative URL's in http request
This change is necessary to cater for S3 clones which do not support

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2

Fixes the issue https://github.com/minio/minio-go/issues/167
2015-10-02 12:40:19 -07:00
Harshavardhana c456724838 Merge pull request #1150 from harshavardhana/share-works-withminio
Now share URL works with minio server
2015-10-01 10:33:15 -07:00
Harshavardhana e1351bb998 Now share URL works with minio server 2015-10-01 10:27:42 -07:00
Harshavardhana acf5be8d16 Merge pull request #1148 from krishnasrinivas/diff-fix2
diff - dump the sorted list of source and destination to local disk file and then diff from the local files
2015-09-30 21:10:48 -07:00
Krishna Srinivas 3211d184e5 diff - dump the sorted list of source and destination to local disk file and then diff from the local files 2015-09-30 21:05:09 -07:00
Harshavardhana 3229948e5a Merge pull request #1149 from harshavardhana/cyan-notify
Change update coloring to Cyan as its more brighter on windows cmd :-)
2015-09-30 17:27:04 -07:00
Harshavardhana 886bc77e15 Change update coloring to Cyan as its more brighter on windows cmd :-) 2015-09-30 16:42:34 -07:00
Harshavardhana d1f298c4a2 Merge pull request #1147 from harshavardhana/bucket-exists
Copy should verify for only buckets
2015-09-30 13:11:00 -07:00
Harshavardhana 0564b683a5 Copy should verify for only buckets 2015-09-30 13:07:11 -07:00
Harshavardhana 338fc6b85f Merge pull request #1146 from harshavardhana/windows
Strconv for UID on windows doesn't work since UID is not an number on…
2015-09-30 12:47:37 -07:00
Harshavardhana 0f51ca0a77 Strconv for UID on windows doesn't work since UID is not an number on windows
There is no portable way to know, ignore root check for windows for now.
2015-09-30 12:42:19 -07:00
Harshavardhana de95ef43a1 Merge pull request #1145 from harshavardhana/fix-segfault
Fix a segfault in mc for progress bar theme init
2015-09-30 12:41:33 -07:00
Harshavardhana f86efb7c36 Fix a segfault in mc for progress bar theme init 2015-09-30 12:36:11 -07:00
Krishna Srinivas 2b0276bd6c rename newSID to randomID 2015-09-30 01:03:11 -07:00
Harshavardhana 4671e01dbf Merge pull request #1143 from harshavardhana/add-appveyor-windows-builds
Add windows builds for mc
2015-09-29 19:02:08 -07:00
Harshavardhana 7de3c677df Add windows builds for mc 2015-09-29 18:57:23 -07:00
Harshavardhana 5a2928de7d Merge pull request #1142 from harshavardhana/session-v2
Do not default to saving session on errors, instead save session for …
2015-09-29 14:26:25 -07:00
Harshavardhana 15cf02643d Do not default to saving session on errors, instead save session for specific errors 2015-09-29 14:23:25 -07:00
Harshavardhana 699e239953 Merge pull request #1112 from vadmeste/fix_ls_error_with_json_enabled
Fix printing fatal message prefix when json flag is enabled
2015-09-29 12:04:11 -07:00
Anis ELLEUCH 14572a7aa5 Factor out repetitive fatal and error quit routines 2015-09-29 19:31:43 +01:00
Harshavardhana 0edeac6be1 Merge pull request #1141 from harshavardhana/newcp-bar
Rename newCpBar to newProgressBar, move setting console color for pro…
2015-09-29 10:48:56 -07:00
Harshavardhana 6781591143 Rename newCpBar to newProgressBar, move setting console color for progress outside of console 2015-09-29 10:47:19 -07:00
Harshavardhana 44e15c726a Merge pull request #1140 from harshavardhana/update-to-new-probe
Update to new version of probe
2015-09-29 10:22:28 -07:00
Harshavardhana 638efef814 Update to new version of probe 2015-09-29 10:19:03 -07:00
Harshavardhana 14daf88890 Merge pull request #1139 from harshavardhana/virtual-styled
Add proper comment for virtual styled host
2015-09-29 00:40:35 -07:00
Harshavardhana 0462d30807 Add proper comment for virtual styled host 2015-09-29 00:39:10 -07:00
Harshavardhana 23168be49c Merge pull request #1138 from harshavardhana/fix-hang
Fix hang cp and mirror hang in --quiet and --json modes upon error
2015-09-29 00:33:20 -07:00
Harshavardhana c9f2cf97bb Fix hang cp and mirror hang in --quiet and --json modes upon error 2015-09-29 00:32:07 -07:00
Harshavardhana c21793b363 Merge pull request #1137 from harshavardhana/fix-bugs
Fix bugs related to cp, mirror code argument validation
2015-09-29 00:19:06 -07:00
Harshavardhana ee65cf7ab8 Fix bugs related to cp, mirror code argument validation 2015-09-29 00:17:16 -07:00
Harshavardhana 306e36ef57 Merge pull request #1136 from harshavardhana/add-tests
Add more coverage tests
2015-09-28 23:29:40 -07:00
Harshavardhana ce7ecef8ae Add more coverage tests 2015-09-28 23:26:12 -07:00
Harshavardhana 9fa96a7882 Merge pull request #1135 from harshavardhana/exit-not
Do not exit for common filesystem errors - for cp, mirror
2015-09-28 14:31:23 -07:00
Harshavardhana fe9f1b9032 Do not exit for common filesystem errors - for cp, mirror
- Broken Symlink
  - No Such file or directory, Permission Denied
  - Ignore broken directory symlinks
2015-09-28 14:29:36 -07:00
Harshavardhana 21eb2e4f93 Revert "file.Write() can be used directly instead of file.File.Write()"
This reverts commit 78f58eaa62.
2015-09-28 14:15:21 -07:00
Harshavardhana 1bc9f2bbad Merge pull request #1134 from harshavardhana/session-v2
file.Write() can be used directly instead of file.File.Write()
2015-09-28 14:13:50 -07:00
Harshavardhana 78f58eaa62 file.Write() can be used directly instead of file.File.Write() 2015-09-28 14:11:54 -07:00
Harshavardhana 696a980575 Merge pull request #1133 from harshavardhana/config-path
Add more tests, overall coverage now stands for 42.6%
2015-09-28 11:14:38 -07:00
Harshavardhana ffc015fe1d Add more tests, coverage now stands for 42.6% 2015-09-28 11:07:20 -07:00
Harshavardhana 53f83dfe57 Add some comments for migration 2015-09-28 10:40:19 -07:00
Anand Babu (AB) Periasamy 4e5fd1dbb1 Updated jobs section 2015-09-26 15:35:03 -07:00
Harshavardhana 7af15e02cb Merge pull request #1132 from harshavardhana/handle-url
Handle parsing for url with ':' only
2015-09-26 00:24:06 -07:00
Harshavardhana 6949965ac7 Handle parsing for url with ':' only 2015-09-26 00:22:17 -07:00
Harshavardhana ef08b38bed Merge pull request #1131 from harshavardhana/error-if
Print friendly message rather than fatalIf and exit cleanly.
2015-09-25 20:53:53 -07:00
Harshavardhana 1e346fc118 Print friendly message rather than fatalIf and exit cleanly. 2015-09-25 20:52:16 -07:00
Harshavardhana f8d26ebac7 Merge pull request #1130 from krishnasrinivas/session-datafile-optimization
Avoid syncing session datafile when there is no change to the datafile
2015-09-25 20:42:48 -07:00
Krishna Srinivas 28ee8e56a5 Avoid syncing session datafile when there is no change to the datafile 2015-09-25 19:41:38 -07:00
Harshavardhana 6e3e29538e Merge pull request #1129 from harshavardhana/support-virtual-style-buckets
Support virtual styled buckets with signature v2
2015-09-24 11:46:51 -07:00
Harshavardhana d955a31b19 Support virtual styled buckets with signature v2 2015-09-24 11:42:44 -07:00
Harshavardhana 2fd97a6faa Merge pull request #1128 from harshavardhana/s3v2-s3v4
Move http trace to a common code, implement trace
2015-09-23 23:20:17 -07:00
Harshavardhana a20364694d Move http trace to a common code, implement trace 2015-09-23 23:18:34 -07:00
Harshavardhana 147e698326 Merge pull request #1127 from harshavardhana/remove-redundant
Remove redundant genversion.go
2015-09-23 09:19:31 -07:00
Harshavardhana 27599f864b Remove redundant genversion.go 2015-09-23 09:17:58 -07:00
Harshavardhana d9145cb85f Merge pull request #1125 from harshavardhana/signature-v2
Signature v2 should be redacted properly - in debug mode
2015-09-23 00:02:30 -07:00
Harshavardhana 8b00a29ab8 Signature v2 should be redacted properly 2015-09-23 00:01:34 -07:00
Harshavardhana 5a2520e88f Merge pull request #1124 from harshavardhana/fix-error
Fix error message for Last-Modified parsing failure - fixes #1123
2015-09-22 23:52:27 -07:00
Harshavardhana 24c5cc61a2 Fix error message for Last-Modified parsing failure - fixes #1123 2015-09-22 23:50:27 -07:00
Harshavardhana 3d40ea764e Merge pull request #1121 from harshavardhana/version
Fix mcVersion and keep it in http.TimeFormat by default
2015-09-22 14:36:47 -07:00
Harshavardhana 6295a1910e Fix mcVersion and keep it in http.TimeFormat by default 2015-09-22 14:34:53 -07:00
Anand Babu (AB) Periasamy 173e530d97 Merge pull request #1120 from abperiasamy/flicker-free-scanbar
flicker free scanbar
2015-09-22 04:13:00 -07:00
Anand Babu (AB) Periasamy dc3a647dfe flicker free scanbar 2015-09-22 04:10:48 -07:00
Harshavardhana d86c7cc793 Merge pull request #1119 from harshavardhana/update-vendorized-pkg
Update minio-go and minio-go-legacy
2015-09-22 03:01:49 -07:00
Harshavardhana 75511caeb3 Update minio-go and minio-go-legacy 2015-09-22 02:58:29 -07:00
Harshavardhana 49daef8312 Merge pull request #1118 from harshavardhana/hostconfig
Make sure that if we find the exact match reply quickly, do not go through globURL ref #1111
2015-09-22 02:22:16 -07:00
Harshavardhana f365542228 Make sure that if we find the exact match reply quickly, do not go through globURL ref #1111 2015-09-22 02:19:53 -07:00
Harshavardhana 268a233409 Merge pull request #1117 from harshavardhana/verify-runtime
checkGolangVersion() make it hard dependency.
2015-09-22 01:20:55 -07:00
Harshavardhana f84ffa62ea checkGolangVersion() make it hard dependency. 2015-09-22 01:16:42 -07:00
Harshavardhana 5c90c28c14 Merge pull request #1116 from harshavardhana/write-api-name
Write API name properly
2015-09-22 00:40:33 -07:00
Harshavardhana 9594ab0105 Write API name properly 2015-09-22 00:38:46 -07:00
Harshavardhana 2b2ee03223 Merge pull request #1115 from harshavardhana/configv4-to-configv5
migrate from ConfigV4 to ConfigV5, rename Signature to API
2015-09-21 22:43:17 -07:00
Harshavardhana 6a493df5eb migrate from ConfigV4 to ConfigV5, rename Signature to API 2015-09-21 22:36:50 -07:00
Harshavardhana 45faafa491 Bump to new version 2015-09-21 21:02:32 -07:00
Harshavardhana 3eba7ef7ef Merge pull request #1114 from harshavardhana/add-support-for-signaturev2
Add support for signature v2 - fixes #1111
2015-09-21 21:01:37 -07:00
Harshavardhana e8e24ca723 Add support for signature v2 - fixes #1111 2015-09-21 21:00:07 -07:00
Harshavardhana 5c491076e1 Merge pull request #1113 from harshavardhana/testing-json
Disable JSON based testing, reduce ls tests to its context only
2015-09-19 19:44:19 -07:00
Harshavardhana b8bd40e685 Disable JSON based testing, reduce ls tests to its context only 2015-09-19 19:42:25 -07:00
Harshavardhana e220bb7873 Merge pull request #1110 from harshavardhana/authorization
In HTTP Trace do not add Authorization header in frivolous way
2015-09-18 15:11:15 -07:00
Harshavardhana 6c52ffe6bf In HTTP Trace do not add Authorization header in frivolous way 2015-09-18 15:08:32 -07:00
Harshavardhana c9d145c40f Merge pull request #1109 from harshavardhana/tests-travis
Add tests only in travis-ci
2015-09-17 22:54:07 -07:00
Harshavardhana 12fa13ef0f Add tests only in travis-ci 2015-09-17 22:52:58 -07:00
Harshavardhana c0275302bd Merge pull request #1108 from harshavardhana/golint-fixes
Fix golint complaints
2015-09-17 19:00:04 -07:00
Harshavardhana c60d2ac8d7 Fix golint complaints 2015-09-17 18:58:19 -07:00
Harshavardhana 2a99791c71 Merge pull request #1107 from harshavardhana/bucket-exists
Stat() on a URL shouldn't fail, just treat as a regular directory
2015-09-17 14:44:28 -07:00
Harshavardhana 6166351774 Stat() on a URL shouldn't fail, just treat as a regular directory 2015-09-17 14:43:04 -07:00
Harshavardhana c4f3805619 Merge pull request #1106 from harshavardhana/new-changes
Now each large file uploads are done in parallel, bring changes from minio-go
2015-09-16 15:24:17 -07:00
Harshavardhana caca0105f9 Now each large file operations are parallel, bring changes from minio-go 2015-09-16 15:22:29 -07:00
Harshavardhana 56a87ff005 Merge pull request #1105 from harshavardhana/checkdeps
bump checkdeps GO_VERSION to 1.5.1
2015-09-16 13:09:14 -07:00
Harshavardhana c312d1f871 bump checkdeps GO_VERSION to 1.5.1 2015-09-16 13:06:25 -07:00
Harshavardhana abc72529be Merge pull request #1104 from harshavardhana/trim-prefix
Trim prefix from recursive multiple args output in ls
2015-09-16 03:12:47 -07:00
Harshavardhana 8adfb595b7 Trim prefix from recursive multiple args output in ls 2015-09-16 03:11:39 -07:00
Harshavardhana 3341299c5a Merge pull request #1103 from harshavardhana/ls-main
Change the 'ls' output behavior
2015-09-16 03:03:41 -07:00
Harshavardhana 8164410b4e Change the 'ls' output behavior
- do not add odd prefixes like GNU 'ls' since it clobbers users view
- add minio specific to differentiate the users view of 'ls' output

Rather than having output in the following manner

```
$ mc ls pkg vendor
pkg:
client console

vendor:
github.com
```

It should be

```
$ mc ls pkg vendor
pkg/client
pkg/console
vendor/github.com
```

This way the differentiation and the API is not disturbed.

This patch fixes this issue.
2015-09-16 03:01:29 -07:00
Harshavardhana 33b18def4e Merge pull request #1102 from harshavardhana/vadmeste-ls_show_folder_names
ls modifications - always print files first and folders at the end for multiple arguments
2015-09-15 23:05:52 -07:00
Harshavardhana dad28fbe16 ls modifications - always print for multiple arguments files first and directories second 2015-09-15 23:03:45 -07:00
Harshavardhana b7e6a4358b Changes to test framework, remove references to 'Cmd'wq 2015-09-15 21:47:38 -07:00
Harshavardhana 265d532237 Make changes over vadmestes changes 2015-09-15 20:55:32 -07:00
Anis ELLEUCH b7fbd307d4 Print folder names when the user asks to list several folders 2015-09-15 20:55:32 -07:00
Harshavardhana 6ebd998adf Merge pull request #1101 from harshavardhana/time-fix
Show seconds and minutes only when hours and days are non zero
2015-09-14 13:13:02 -07:00
Harshavardhana a46ac38207 Show seconds and minutes only when hours and days are non zero 2015-09-14 13:11:41 -07:00
Harshavardhana 725847bd49 Merge pull request #1100 from harshavardhana/null-ptr
Fix a null pointer bug in share URL migration
2015-09-14 13:04:39 -07:00
Harshavardhana 4365adea52 Fix a null pointer bug in share URL migration 2015-09-14 13:03:03 -07:00
Harshavardhana 70c57c1892 Merge pull request #1099 from harshavardhana/prefix-match
Add missing prefix match comment
2015-09-14 12:59:59 -07:00
Harshavardhana 788dd9efa1 Add missing prefix match comment 2015-09-14 12:57:54 -07:00
Harshavardhana 6fae61ba06 Merge pull request #1098 from harshavardhana/add-closest-command
when Invalid command is passed, print closest known prefix using trie structure
2015-09-14 01:43:20 -07:00
Harshavardhana e9be0976ab when Invalid command is passed, print closest known prefix using trie structure 2015-09-14 01:40:48 -07:00
Harshavardhana 9f7b950f66 Merge pull request #1097 from harshavardhana/share-migrate-v2
Share migrate to V2 version moving from type map to array.
2015-09-13 13:47:37 -07:00
Harshavardhana 1a74e98b23 Share migrate to V2 version moving from type map to array. 2015-09-13 13:45:54 -07:00
Harshavardhana 1323822596 Merge pull request #1096 from harshavardhana/printer
Each command messages now implement String()/JSON()
2015-09-13 02:23:44 -07:00
Harshavardhana 36e2c1813d Each command messages now implement
- String() for colorized output
  - JSON() for json marshalled output

All messages should adhere to this interface unless its
explicitly not necessary in some cases.
2015-09-13 02:20:43 -07:00
Harshavardhana 3014a25bf4 Merge pull request #1095 from harshavardhana/humanize-duration
Humanize time.duration properly
2015-09-12 21:55:24 -07:00
Harshavardhana a14d526dcd Humanize time.duration properly 2015-09-12 21:51:29 -07:00
Harshavardhana c60c48ad73 Merge pull request #1094 from harshavardhana/add-create
Create an empty urls.json if doesn't exist while reading.
2015-09-12 18:43:02 -07:00
Harshavardhana 303b94e8c3 Create an empty urls.json if doesn't exist while reading. 2015-09-12 18:41:35 -07:00
Anand Babu (AB) Periasamy 80b9d388a4 Merge pull request #1093 from abperiasamy/share-fix
share url bug fixes
2015-09-12 18:21:02 -07:00
Anand Babu (AB) Periasamy 47b8267b5f share url bug fixes 2015-09-12 18:12:33 -07:00
Harshavardhana bfef4b05fa Merge pull request #1092 from harshavardhana/share-list
Store list of shared URLs locally until their expiry, this implements…
2015-09-11 18:10:46 -07:00
Harshavardhana 46b740f07c Store list of shared URLs locally until their expiry, this implements 'mc share list' command 2015-09-11 18:04:10 -07:00
Harshavardhana 5f737eb2bc Merge pull request #1091 from harshavardhana/simplify
Simplify newVersion in runtime checks
2015-09-10 00:31:50 -07:00
Harshavardhana 848e06f922 Simplify newVersion in runtime checks 2015-09-10 00:28:48 -07:00
Anand Babu (AB) Periasamy 3a9b2064f6 separate mutex for internal and external locking 2015-09-09 22:21:06 -07:00
Harshavardhana 942a633c67 Merge pull request #1087 from harshavardhana/go-vet
Add go tool vet checks and also enable detecting invalid shadow variables
2015-09-09 16:01:20 -07:00
Harshavardhana 1f63bb2dfe Add go tool vet checks and also enable detecting invalid shadow variables 2015-09-09 15:58:59 -07:00
Harshavardhana 2e631a2552 Merge pull request #1086 from harshavardhana/verify-runtime
Disallow users running 'mc' as root
2015-09-09 15:52:34 -07:00
Harshavardhana 311a80b6e8 Disallow users running 'mc' as root 2015-09-09 15:49:22 -07:00
Harshavardhana cd29b01531 Merge pull request #1085 from harshavardhana/golang-runtime
Bump minGolangRuntimeVersion to 1.5.1
2015-09-09 15:00:07 -07:00
Harshavardhana 343f2a6acf Bump minGolangRuntimeVersion to 1.5.1 2015-09-09 14:58:20 -07:00
Harshavardhana 1616f7eaa4 Merge pull request #1084 from harshavardhana/shadow
Avoid shadowing by using unique variables as necessary
2015-09-08 23:31:48 -07:00
Harshavardhana abbfa4b13f Avoid shadowing by using unique variables as necessary 2015-09-08 23:28:56 -07:00
Harshavardhana 75046f2fe9 Merge pull request #1082 from harshavardhana/json
Remove hyphenated properties in json output, helps scripting and prog…
2015-09-07 17:15:50 -07:00
Harshavardhana f286159567 Remove hyphenated properties in json output, helps scripting and programming. 2015-09-07 17:12:49 -07:00
Harshavardhana 659f2368f1 Merge pull request #1081 from harshavardhana/documentation
Update documentation for mb, cp, mirror for files and folders with sp…
2015-09-07 01:23:18 -07:00
Harshavardhana c50b16c70f Update documentation for mb, cp, mirror for files and folders with space characters 2015-09-07 01:22:14 -07:00
Harshavardhana 88f9563366 Merge pull request #1080 from harshavardhana/help
Add cli updates amd change mb help a bit
2015-09-05 22:48:16 -07:00
Harshavardhana bf22c490a3 Add cli updates amd change mb help a bit 2015-09-05 22:46:23 -07:00
Harshavardhana 0eb1403caf Update README.md 2015-09-05 17:22:41 -07:00
Harshavardhana ab4b66db02 Bump to new version 2015-09-05 16:44:00 -07:00
Harshavardhana e08e230970 Merge pull request #1079 from harshavardhana/fix-alias-bug
Fix alias bug
2015-09-05 16:42:06 -07:00
Harshavardhana e69b7253df Fix alias bug 2015-09-05 16:34:04 -07:00
Harshavardhana feebfa8154 Bump to new version 2015-09-05 15:02:47 -07:00
Harshavardhana b328e322e0 Merge pull request #1078 from harshavardhana/windows
Add junction and symlink handling for windows only
2015-09-04 23:06:45 -07:00
Harshavardhana 2549415a87 Add junction and symlink handling for windows only 2015-09-04 23:01:51 -07:00
Harshavardhana 44886581c2 Merge pull request #1077 from harshavardhana/security
Add help for turn off/on bash history for config host command
2015-09-04 18:35:37 -07:00
Harshavardhana 247a289dbf Add help for turn off/on bash history for config host command 2015-09-04 18:33:58 -07:00
Harshavardhana fb3fa7ee8a Merge pull request #1076 from harshavardhana/readlink-bug-windows
golang filepath.EvalSymlinks doesn't handle juntion files, handle them fixes #1076
2015-09-04 13:33:29 -07:00
Harshavardhana 2bca24e0fa golang filepath.EvalSymlinks doesn't handle juntion files handle them - fixes #1076 2015-09-04 13:32:00 -07:00
Harshavardhana 043d33fd49 Merge pull request #1074 from harshavardhana/add-config-version
Add config version command
2015-09-02 00:59:51 -07:00
Harshavardhana bc6b3bf2ae Add config version command 2015-09-02 00:57:31 -07:00
Harshavardhana 4398374cd4 Merge pull request #1073 from harshavardhana/add-alias-host-command
Move primitives for add, list, remove into their own subcommands as a…
2015-09-01 20:00:32 -07:00
Harshavardhana c46ea80fff Move primitives for add, list, remove into their own subcommands as alias,host etc. 2015-09-01 19:58:33 -07:00
Harshavardhana bb4e3bc1eb Merge pull request #1072 from harshavardhana/enforcing-mirror
Do not enforce mirror source to have ... convention, let it be recurs…
2015-09-01 15:46:07 -07:00
Harshavardhana 8aba0aed50 Do not enforce mirror source to have ... convention, let it be recursive always 2015-09-01 15:43:57 -07:00
Harshavardhana fee0ebf6a2 Merge pull request #1071 from harshavardhana/change-help-messages
Simplify help messages
2015-09-01 14:58:47 -07:00
Harshavardhana aaec806897 Simplify help messages 2015-09-01 14:54:13 -07:00
Harshavardhana 6c3d920924 Merge pull request #1070 from harshavardhana/disable-acl
Enable get/set for access command
2015-09-01 11:25:45 -07:00
Harshavardhana 45be233d23 Enable get/set for access command 2015-09-01 11:19:36 -07:00
Harshavardhana 53fc1c7b38 Disable ACL's for filesystem as it doesn't bring any direct meaning 2015-09-01 10:47:52 -07:00
Anand Babu (AB) Periasamy d89ebd1a36 Merge pull request #1069 from abperiasamy/url-alias-fix
URL related bug fixes and cleanup
2015-08-30 02:16:12 -07:00
Anand Babu (AB) Periasamy fddcb821fa URL related bug fixes and cleanup 2015-08-30 02:14:24 -07:00
Anand Babu (AB) Periasamy 908b58f4c5 Merge pull request #1068 from abperiasamy/fix-doc-typo
fix alias help text
2015-08-29 19:30:26 -07:00
Anand Babu (AB) Periasamy 7607f0490d fix alias help text 2015-08-29 19:28:35 -07:00
Anand Babu (AB) Periasamy fdeaa69915 Merge pull request #1067 from abperiasamy/alias-path-sep
only honor alias for path-separated prefixes
2015-08-29 18:28:08 -07:00
Anand Babu (AB) Periasamy b5b738f93c only honor alias for path-separated prefixes 2015-08-29 18:22:47 -07:00
Anand Babu (AB) Periasamy 4a36bf0965 Merge pull request #1066 from abperiasamy/new-alias
alias support with colon requirement
2015-08-29 18:05:56 -07:00
Anand Babu (AB) Periasamy 91100b72ed alias support with colon requirement 2015-08-29 18:02:32 -07:00
Harshavardhana 5c4b949996 Merge pull request #1065 from harshavardhana/migrate-messages
Improve config migrate messages
2015-08-29 13:06:08 -07:00
Harshavardhana 5288f0fffa Improve config migrate messages 2015-08-29 13:03:09 -07:00
Harshavardhana fc9088142b Merge pull request #1064 from abperiasamy/auto-quiet
Auto quiet
2015-08-29 12:29:13 -07:00
Anand Babu (AB) Periasamy 0fbcfa5de0 automatically enable quiet-mode if terminal capabilities are limited 2015-08-29 12:25:03 -07:00
Anand Babu (AB) Periasamy 29389323c0 Merge remote-tracking branch 'upstream/master' 2015-08-29 00:41:19 -07:00
Harshavardhana 957d4e08cc Fix typo, pushing this in 2015-08-29 00:40:38 -07:00
Harshavardhana 0885b85c76 Fix typo 2015-08-29 00:33:01 -07:00
Harshavardhana 45b0c0452b Merge pull request #1063 from harshavardhana/fix-broken-config
Fix config v3 for previous reverts
2015-08-29 00:28:35 -07:00
Harshavardhana 7e5820a815 Fix config v3 for previous reverts 2015-08-29 00:27:11 -07:00
Harshavardhana 535fdbeec7 Merge pull request #1062 from harshavardhana/update-wording
Change update-wording to add chmod 755
2015-08-28 23:35:51 -07:00
Harshavardhana e1f08e53f6 Change update-wording to add chmod 755 2015-08-28 23:34:45 -07:00
Harshavardhana cb034d649d Merge pull request #1061 from harshavardhana/access-key-id
Move to version 3, jsonify config version from now on
2015-08-28 23:30:46 -07:00
Harshavardhana 4d716f2956 Move to version 3, jsonify config version from now on 2015-08-28 23:29:37 -07:00
Harshavardhana f831d94d3f Revert "Change ACL to Access"
This reverts commit 68b3b0aac2.

Revert "Object ACL now propagates through ACL config, update minio-go library to bing in SetObjectACL() support"

This reverts commit 6816542c7a.
2015-08-28 22:37:10 -07:00
Harshavardhana 1f66a418d4 Merge pull request #1060 from harshavardhana/change-acl
Change ACL to Access
2015-08-28 21:37:11 -07:00
Harshavardhana 68b3b0aac2 Change ACL to Access 2015-08-28 21:35:07 -07:00
Harshavardhana 2cc75994c9 Merge pull request #1059 from harshavardhana/object-acl-support
Object ACL now propagates through ACL config, update minio-go library…
2015-08-28 21:22:06 -07:00
Harshavardhana 6816542c7a Object ACL now propagates through ACL config, update minio-go library to bing in SetObjectACL() support 2015-08-28 21:20:41 -07:00
Harshavardhana 59e47310fd Merge pull request #1058 from harshavardhana/experimental
Making experimental release, no tagging needed
2015-08-28 12:22:54 -07:00
Harshavardhana 316b048ff1 Making experimental release, no tagging needed 2015-08-28 12:21:21 -07:00
Harshavardhana 3d6e7495ac Merge pull request #1057 from harshavardhana/anonymous_put_object
Allow anonymous putObject() over publicly writable buckets
2015-08-28 00:46:17 -07:00
Harshavardhana 3ed07aa29d Allow anonymous putObject() over publicly writable buckets 2015-08-28 00:42:06 -07:00
Harshavardhana 3b60ed2e30 Merge pull request #1056 from harshavardhana/share-message
Converge shareMessage into shareDuration
2015-08-27 18:57:05 -07:00
Harshavardhana a6cd6939c2 Converge shareMessage into shareDuration 2015-08-27 18:55:12 -07:00
Harshavardhana 62be42fdd1 Merge pull request #1055 from harshavardhana/share-command
Implement custom share duration to print in Days() as well
2015-08-27 18:40:35 -07:00
Harshavardhana 3777c0039c Implement custom share duration to print in Days() as well 2015-08-27 18:38:01 -07:00
Harshavardhana 59031593dd Update README.md 2015-08-26 13:11:20 -07:00
Harshavardhana 58de53db94 Bump to new release - RELEASE.Wed-Aug-26-19-58-04-GMT-2015 2015-08-26 12:58:40 -07:00
Harshavardhana a04e3c990f Merge pull request #1054 from harshavardhana/nocolor
Add nocolor flag to disable coloring if necessary proactively
2015-08-26 12:35:17 -07:00
Harshavardhana 0dda19490e Add nocolor flag to disable coloring if necessary proactively 2015-08-26 12:34:08 -07:00
Harshavardhana 79dcf714f8 Merge pull request #1053 from harshavardhana/format-help
Format help for all commands
2015-08-25 20:15:27 -07:00
Harshavardhana cbc9d96d50 Format help for all commands 2015-08-25 20:13:50 -07:00
Harshavardhana fa3631710f Merge pull request #1052 from harshavardhana/config-main
Add remove alias command
2015-08-25 18:04:25 -07:00
Harshavardhana 40b93efd8b Add remove alias command 2015-08-25 18:02:27 -07:00
Harshavardhana eaa7ca31ce Merge pull request #1051 from harshavardhana/comments
Add proper comments.
2015-08-25 17:00:22 -07:00
Harshavardhana c48a98de62 Add proper comments. 2015-08-25 16:54:55 -07:00
Harshavardhana 3a027a4b19 Merge pull request #1050 from harshavardhana/acl-permission
Move from acl to access-perms
2015-08-25 16:42:45 -07:00
Harshavardhana 57658835b8 Move from acl to access-perms 2015-08-25 16:41:12 -07:00
Harshavardhana 596289e8cc Merge pull request #1049 from harshavardhana/diff-main
Add checkDiffSyntax() for diff command
2015-08-25 16:11:17 -07:00
Harshavardhana 5ffc13a4a1 Add checkDiffSyntax() for diff command 2015-08-25 15:59:48 -07:00
Harshavardhana 525e126f66 Merge pull request #1048 from harshavardhana/windows
Close session pro-actively during clear all session
2015-08-25 14:23:27 -07:00
Harshavardhana 1ce6f7cbc7 Close session pro-actively during clear all session 2015-08-25 14:21:33 -07:00
Harshavardhana 16e0c86a6b Merge pull request #1047 from harshavardhana/master
Define error for windows, minor fix pushing in
2015-08-25 00:44:17 -07:00
Harshavardhana f65c87730f Define error for windows, minor fix pushing in 2015-08-25 00:42:24 -07:00
Harshavardhana c02163dac9 Merge pull request #1046 from harshavardhana/update-json-error-container
Updates now handle release and experimental updates
2015-08-25 00:34:56 -07:00
Harshavardhana cb0f5a5b19 Updates now handle release and experimental updates
- add checkUpdateSyntax and also add json output for update messages
- additionally this commit also includes error Container for consistent outputs
  in case of errors, very handy to write scripts around

   ```bash
    $ mc --json ls test | jq .error
    null
    null
    { error }
    null
    ...
    ```
2015-08-25 00:26:23 -07:00
Anand Babu (AB) Periasamy 8864b67231 Merge pull request #1045 from abperiasamy/error2probe
convert remaining typed errors to probe errors
2015-08-24 22:35:35 -07:00
Anand Babu (AB) Periasamy bb3c89d844 convert remaining typed errors to probe errors 2015-08-24 22:29:50 -07:00
Harshavardhana 1d2fb927dc Merge pull request #1044 from harshavardhana/checksyntax-cmd
Add checkCommandSyntax for all commands
2015-08-24 19:33:28 -07:00
Harshavardhana 3df07ac29f Add checkCommandSyntax for all commands 2015-08-24 19:31:30 -07:00
Harshavardhana edf651ce4a Merge pull request #1043 from harshavardhana/prepare-urls
Handle errors and clearing previous outputs - json output shouldn't have colors
2015-08-24 17:18:21 -07:00
Harshavardhana 1e67db0aef Handle errors and clearing previous outputs - json output shouldn't have colors 2015-08-24 17:17:11 -07:00
Harshavardhana 8ba0869e69 Merge pull request #1042 from abperiasamy/threadsafe-err
thread-safe typed errors
2015-08-24 12:56:49 -07:00
Anand Babu (AB) Periasamy 831db52dcf thread-safe typed errors 2015-08-24 12:55:11 -07:00
Harshavardhana 3d69860b5e Merge pull request #1041 from harshavardhana/session-list
Move coloring to their own main* functions
2015-08-24 12:14:42 -07:00
Harshavardhana a06a926b66 Move coloring to their own main* functions 2015-08-24 12:12:25 -07:00
Harshavardhana a2d1243206 Merge pull request #1040 from harshavardhana/diff-color
Make sure to colorize diff types properly, also handle proper newlines
2015-08-24 11:53:17 -07:00
Harshavardhana bd547d9084 Make sure to colorize diff types properly, also handle proper newlines 2015-08-24 11:51:57 -07:00
Anand Babu (AB) Periasamy 0716232411 Merge pull request #1039 from abperiasamy/err-update-8
re-vendorize probe and simplfy typed errors
2015-08-24 04:20:08 -07:00
Anand Babu (AB) Periasamy 40ff9f1033 re-vendorize probe and simplfy typed errors 2015-08-24 04:09:18 -07:00
Harshavardhana 0ee26b9f6c Merge pull request #1038 from harshavardhana/diff-converge
Converge on diff{} to DiffMessage{}
2015-08-24 01:05:11 -07:00
Harshavardhana e895837428 Converge on diff{} to DiffMessage{} 2015-08-24 01:03:13 -07:00
Harshavardhana d1757b34c5 Merge pull request #1037 from harshavardhana/diff-type-size
diff should handle type and size as well in recursive diff
2015-08-24 00:08:37 -07:00
Harshavardhana 3e5178ddb2 diff should handle type and size as well in recursive diff 2015-08-24 00:02:50 -07:00
Harshavardhana 5453f6c784 Merge pull request #1036 from vadmeste/show_correct_dependencies_version
Show correct needed dependencies versions in checkdeps
2015-08-23 19:09:38 -07:00
Anis ELLEUCH 03bc6bd6ec Show correct needed dependencies versions in checkdeps 2015-08-23 11:42:12 +01:00
Harshavardhana 1556ff7a8d Merge pull request #1035 from harshavardhana/mirror
Recursively progress along with errors if possible
2015-08-23 02:32:03 -07:00
Harshavardhana 492340b3d8 Recursively progress along with errors if possible 2015-08-23 02:30:47 -07:00
Harshavardhana 3ae608a3b1 Merge pull request #1034 from harshavardhana/formatting
End sentences with a . for readability
2015-08-23 01:36:42 -07:00
Harshavardhana f089dc1b68 End sentences with a . for readability 2015-08-23 01:35:32 -07:00
Harshavardhana dd5314a938 Merge pull request #1033 from harshavardhana/json-review
Fixes for json review #1
2015-08-23 01:25:55 -07:00
Harshavardhana b9c28d588b Fixes for json review #1 2015-08-23 01:24:04 -07:00
Anand Babu (AB) Periasamy 84be3bd9fb Merge pull request #1031 from abperiasamy/err-update-7
Err update 7
2015-08-22 23:28:06 -07:00
Anand Babu (AB) Periasamy f2899ef228 replaced panic with probe 2015-08-22 23:26:56 -07:00
Anand Babu (AB) Periasamy 099b4478d6 replaced panic with probe 2015-08-22 23:25:11 -07:00
Anand Babu (AB) Periasamy d8bb1e9fd6 replaced panic with probe 2015-08-22 23:22:17 -07:00
Anand Babu (AB) Periasamy 34a0d64f97 Merge pull request #1030 from abperiasamy/err-update-6
final review of all error messages
2015-08-22 23:17:31 -07:00
Anand Babu (AB) Periasamy e61ad067cd final review of all error messages 2015-08-22 23:15:30 -07:00
Anand Babu (AB) Periasamy a816d62ac1 Merge pull request #1029 from abperiasamy/err-update-5
final update and tiny fixes
2015-08-22 22:33:17 -07:00
Anand Babu (AB) Periasamy 1c313ef773 final update and tiny fixes 2015-08-22 22:31:15 -07:00
Harshavardhana 8dc00830ea Merge pull request #1028 from harshavardhana/update
Add pkg-add and pkg-remove Makefile options for easily removing and a…
2015-08-22 21:41:09 -07:00
Harshavardhana c08b44e419 Add pkg-add and pkg-remove Makefile options for easily removing and adding new packages 2015-08-22 21:25:12 -07:00
Anand Babu (AB) Periasamy 07c8850724 Merge pull request #1027 from abperiasamy/err-update-4
error messages and tiny bug fixes
2015-08-22 19:50:02 -07:00
Anand Babu (AB) Periasamy 0de688948a error messages and tiny bug fixes 2015-08-22 19:47:11 -07:00
Harshavardhana 722e02b243 Merge pull request #1026 from harshavardhana/runtime
Setting mc runtime version to be minimum golang 1.5
2015-08-22 19:16:29 -07:00
Harshavardhana 8aed4091b4 Setting mc runtime version to be 1.5 2015-08-22 19:13:33 -07:00
Harshavardhana d723e87c54 Merge pull request #1025 from harshavardhana/migrate
Migrate to golang1.5 with new GO15VENDOREXPERIMENT enabled
2015-08-22 19:05:39 -07:00
Harshavardhana a0e66ce640 Migrate to golang1.5 with new GO15VENDOREXPERIMENT enabled 2015-08-22 19:04:17 -07:00
Anand Babu (AB) Periasamy 8a9e3b7e05 Merge pull request #1024 from abperiasamy/diff-err-update
diff error handling update
2015-08-22 16:50:11 -07:00
Anand Babu (AB) Periasamy 4d136c6605 diff error handling update 2015-08-22 16:48:55 -07:00
Harshavardhana 3ad696ea85 Merge pull request #1023 from harshavardhana/diffmsg
Use DiffMessage rather than diffV1
2015-08-22 02:57:02 -07:00
Harshavardhana ae0f3b1474 Use DiffMessage rather than diffV1 2015-08-22 02:55:53 -07:00
Harshavardhana 6b41276a46 Merge pull request #1022 from abperiasamy/err-update-3
error messages update
2015-08-22 02:50:02 -07:00
Anand Babu (AB) Periasamy 154c229324 error messages update 2015-08-22 02:47:35 -07:00
Harshavardhana 56f74ac604 Merge pull request #1021 from harshavardhana/alias
Add alias list command to list all the added aliases
2015-08-22 02:25:12 -07:00
Harshavardhana 355027df2e Add alias list command to list all the added aliases 2015-08-22 02:23:39 -07:00
Anand Babu (AB) Periasamy 7629faa2e6 Merge pull request #1020 from abperiasamy/err-update-2
second update to error messages
2015-08-22 02:15:26 -07:00
Anand Babu (AB) Periasamy b10d2648e8 second update to error messages 2015-08-22 02:14:00 -07:00
Harshavardhana 2e1c97f83b Merge pull request #1019 from harshavardhana/migrate
Migrate to PresignedGetObject from PresignedGetPartialObject() as the…
2015-08-21 20:40:25 -07:00
Harshavardhana c992bb682f Migrate to PresignedGetObject from PresignedGetPartialObject() as the latter was of no real use 2015-08-21 20:39:22 -07:00
Anand Babu (AB) Periasamy 0785fff42b Merge pull request #1018 from abperiasamy/error-messages-update
updated error messages
2015-08-21 17:52:17 -07:00
Anand Babu (AB) Periasamy 7d624457b0 updated error messages 2015-08-21 17:47:45 -07:00
Harshavardhana a342f545ee Merge pull request #1017 from harshavardhana/migrate
Migrate to newer version of config '2'
2015-08-20 21:05:17 -07:00
Harshavardhana 878c8e2693 Migrate to newer version of config '2' 2015-08-20 21:03:39 -07:00
Harshavardhana 479a340f19 Merge pull request #1016 from harshavardhana/improve-error-messages
Improve error messages
2015-08-20 17:26:17 -07:00
Harshavardhana dfd1b29d5f Improve error messages 2015-08-20 17:22:38 -07:00
Harshavardhana e254216106 Merge pull request #1015 from harshavardhana/mailmap-update
update AB's contributors email
2015-08-20 16:17:37 -07:00
Harshavardhana dfe5541f04 update AB's contributors email 2015-08-20 16:16:17 -07:00
Harshavardhana 09656f034e Merge pull request #1014 from harshavardhana/pr_out_print_progress_bar_messages
Print progress bar messages
2015-08-20 00:10:48 -07:00
Harshavardhana c4e5cc8127 Print progress bar messages 2015-08-20 00:10:00 -07:00
Anand Babu (AB) Periasamy e9980865f3 Merge pull request #1013 from abperiasamy/access-error-review
probe update and access command error messages updated
2015-08-19 23:25:35 -07:00
Anand Babu (AB) Periasamy 754dc8849e probe update and access command error messages update 2015-08-19 23:22:39 -07:00
Harshavardhana cc119a3b67 Merge pull request #1012 from harshavardhana/themes
Merge themes as settable from outside console, add a default theme as…
2015-08-19 23:10:33 -07:00
Harshavardhana cf5290ad74 Merge themes as settable from outside console, add a default theme as well. 2015-08-19 22:59:05 -07:00
Harshavardhana ec372eb47a Merge pull request #1011 from harshavardhana/addr_error_messages
Add error messages to fatalIf and errorIf
2015-08-19 17:15:00 -07:00
Harshavardhana fa0c9e38bb Add error messages to fatalIf and errorIf 2015-08-19 17:11:34 -07:00
Harshavardhana b323c96343 Merge pull request #1010 from harshavardhana/json_messages
Handle json and regular printing for all commands in their own respec…
2015-08-19 12:55:16 -07:00
Harshavardhana 4c521fa2b2 Handle json and regular printing for all commands in their own respective files for readability 2015-08-19 12:53:53 -07:00
Harshavardhana 9b07069623 Merge pull request #1009 from harshavardhana/syscall
piping cli help output leads to error, fix it by ignoring syscall.EPIPE
2015-08-19 11:33:08 -07:00
Harshavardhana fe594e1b26 piping cli help output leads to error, fix it by ignoring syscall.EPIPE
without this fix - template tries to write to /dev/stdout even after its closed leading to a crash as below

~~~
panic: template: help:21:20: executing "help" at < https://s3.amazonaw...>: write /dev/stdout: broken pipe
~~~

Ignore syscall.EPIPE since its an expected result
2015-08-19 11:27:50 -07:00
Harshavardhana 56705ec1c6 Merge pull request #1008 from harshavardhana/remove_indent
Remove json indent for easing parsing
2015-08-19 02:39:12 -07:00
Harshavardhana 60a29bae96 Remove json indent for easing parsing
Indentation while it is nice, leads to issues when parsing where delimiters on
readline() will fail since we are sending many self contained json's in a streaming
fashion, having a proper readline() based delimiter is helpful in terms of parsing.
2015-08-19 02:38:09 -07:00
Anand Babu (AB) Periasamy f8fc43d76a Merge pull request #1007 from abperiasamy/error-handling-update
error handling updates
2015-08-19 01:35:01 -07:00
Anand Babu (AB) Periasamy c50bc9c22f error handling updates 2015-08-19 01:27:40 -07:00
Harshavardhana d6e8bd5ca9 Merge pull request #1006 from harshavardhana/error
Separate out Cause and full Debug message
2015-08-19 00:42:01 -07:00
Harshavardhana 3b7801751a Separate out Cause and full Debug 2015-08-19 00:39:09 -07:00
Harshavardhana 4b1e5944e6 Merge pull request #1005 from harshavardhana/error
Remove redundant error usage, use *probe.Error containerized
2015-08-19 00:30:30 -07:00
Harshavardhana 6d5b6e1d09 Remove redundant error usage, use *probe.Error containerized 2015-08-19 00:29:36 -07:00
Harshavardhana 2f4dd5b9f3 Merge pull request #1004 from harshavardhana/vendorize_error
update mc to new changes in probe and minio-go (0.2.2)
2015-08-19 00:03:25 -07:00
Harshavardhana 6173eff288 update mc to new changes in probe and minio-go (0.2.2) 2015-08-19 00:02:01 -07:00
Harshavardhana 6d4a5173fd Merge pull request #1003 from harshavardhana/error
Probe error should be marshalled as json.RawMessage to avoid re-encod…
2015-08-16 11:54:29 -07:00
Harshavardhana 6313bb2c46 Probe error should be marshalled as json.RawMessage to avoid re-encoding of an already marshalled string 2015-08-16 11:23:51 -07:00
Harshavardhana 27016a122e Merge pull request #1002 from harshavardhana/content
Add JSON() printing for error and fatal messages
2015-08-14 07:14:51 -07:00
Harshavardhana b3f907b19b Add JSON() printing for error and fatal messages 2015-08-14 07:13:27 -07:00
Harshavardhana e4aa57521d Merge pull request #1001 from harshavardhana/remove_version
Remove Version string from json printer, rename first-time.go to verif…
2015-08-13 21:02:04 -07:00
Harshavardhana 34818f875d Remove Version string from json prints, rename first-time.go to verify-runtime.go 2015-08-13 21:00:52 -07:00
Harshavardhana 7543b71aed Merge pull request #1000 from harshavardhana/version_cmd
Add new version command
2015-08-13 20:52:31 -07:00
Harshavardhana 192518d679 Add new version command 2015-08-13 20:50:32 -07:00
Harshavardhana ff27f3a0f3 Merge pull request #999 from harshavardhana/vendorize_quick
Move quick to server and vendorize it
2015-08-13 16:41:39 -07:00
Harshavardhana b743f88353 Move quick to server and vendorize it 2015-08-13 16:38:24 -07:00
Harshavardhana ab1f9aaaa8 Merge pull request #998 from harshavardhana/maintainers
Add maintainers file
2015-08-13 11:29:41 -07:00
Harshavardhana 05675cbd14 Add maintainers file 2015-08-13 11:28:13 -07:00
Harshavardhana c5e656372d Merge pull request #997 from harshavardhana/races-fixed
Fix test cases where cp and mirror would fail
2015-08-12 22:17:15 -07:00
Harshavardhana 99f53fe45d Fix test cases where cp and mirror would fail
- globalQuietFlag and globalJSONFlag should be checked in conjunction
  for terminal features to be disabled. Otherwise ioctl fails for
  calculating the term size.

- Avoid unnecessary scoping for probe, it has two different error sets now
2015-08-12 22:11:31 -07:00
Harshavardhana e2c4d25e86 Merge pull request #996 from harshavardhana/migrate-to-govendor
Migrate to govendor to avoid limitations of godep
2015-08-12 19:15:20 -07:00
Harshavardhana 3caee383f0 Migrate to govendor to avoid limitations of godep
- over the course of a project history every maintainer needs to update
  its dependency packages, the problem essentially with godep is manipulating
  GOPATH - this manipulation leads to static objects created at different locations
  which end up conflicting with the overall functionality of golang.

  This also leads to broken builds on many platforms. There is no easier way out of
  this other than asking users to do 'godep restore' all the time which perhaps as
  a practice doesn't sound clean, also has its own set of problems.

- govendor on the other hand is a right tool but a stop gap tool until we wait for
  golangs official 1.5 version which fixes this vendoring issue once and for all.

- govendor makes sure that the import paths are re-written instead of manipulating
  GOPATH.

  This has advantages
    - no more compiled objects being referenced in GOPATH and build time GOPATH
      manging which leads to conflicts.
    - proper import paths referencing the exact package a project is dependent on.

  govendor is simple and provides the minimal necessary tooling to achieve this.

  For now this is the right solution.
2015-08-12 19:04:16 -07:00
Harshavardhana 7201658ee8 Merge pull request #995 from harshavardhana/improve-share
Improve share command
2015-08-12 17:01:12 -07:00
Harshavardhana 3185ca1146 Improve share command 2015-08-12 17:00:07 -07:00
Harshavardhana d7c730cd59 Merge pull request #994 from harshavardhana/folder
Rename conf-dir to config-folder to be consistent with our naming con…
2015-08-12 16:20:54 -07:00
Harshavardhana abbf27ca01 Rename conf-dir to config-folder to be consistent with our naming convention regarding folders v/s directories 2015-08-12 16:17:29 -07:00
Harshavardhana 1afd94c9d5 Merge pull request #993 from harshavardhana/rename-alias
Rename --alias to --mimic, remove --force flag
2015-08-12 16:03:50 -07:00
Harshavardhana 38a25410ef Rename --alias to --mimic, remove --force flag 2015-08-12 16:02:11 -07:00
Harshavardhana 1129bcec30 Merge pull request #992 from harshavardhana/turn-off-coloring
Turn off coloring when terminals are not tty even for os.Stdout
2015-08-12 15:12:34 -07:00
Harshavardhana 0571fe67a2 Turn off coloring when terminals are not tty even for os.Stdout 2015-08-12 15:11:15 -07:00
Harshavardhana 87d37521c8 Merge pull request #991 from krishnasrinivas/rename-config-to-conf-dir
rename --config to --conf-dir and do firstTimeRun() after setMcConfig…
2015-08-12 14:19:15 -07:00
Krishna Srinivas 22d7258a0e rename --config to --conf-dir and do firstTimeRun() after setMcConfigDir() 2015-08-13 02:37:35 +05:30
Harshavardhana a62a936c9d Merge pull request #990 from harshavardhana/settheme-issue
Possible fix for SetTheme issue
2015-08-12 12:48:58 -07:00
Harshavardhana 40d096353d Possible fix for SetTheme issue 2015-08-12 12:48:00 -07:00
Harshavardhana 03542acc1d Merge pull request #989 from harshavardhana/rename-mainfuncs
Rename all main command actions into main<Command> from run<Command>Cmd
2015-08-12 01:27:50 -07:00
Harshavardhana 6a59d9a046 Rename all main command actions into main<Command> from run<Command>Cmd 2015-08-12 01:26:35 -07:00
Harshavardhana ac3e399d69 Merge pull request #988 from harshavardhana/deps-update
Update minio-go to latest release 0.2.1
2015-08-12 01:11:25 -07:00
Harshavardhana 703addae62 update minio-go to latest release 0.2.1 2015-08-12 01:10:24 -07:00
Harshavardhana e86395917b Merge pull request #987 from harshavardhana/simplify-strings
Simplify and enhance error strings
2015-08-12 01:09:57 -07:00
Harshavardhana 413ce3995e Simplify and enhance error strings 2015-08-12 01:05:02 -07:00
Harshavardhana abccc35d37 Merge pull request #986 from harshavardhana/print-json
Print json output for share urls as well
2015-08-11 23:18:46 -07:00
Harshavardhana ed70bbb7e3 Print json output for share urls as well 2015-08-11 23:17:23 -07:00
Harshavardhana 8ee45d8f72 Merge pull request #985 from harshavardhana/probe-from-server
Move to server package for probe
2015-08-10 20:25:21 -07:00
Harshavardhana 25e5ea2574 Move to server package for probe 2015-08-10 19:49:57 -07:00
Harshavardhana 6e9d7f40c2 Merge pull request #984 from harshavardhana/pr_out_move_from_fatal_error_to_fatalif_errorif
Move from Fatal/Error to fatalIf/errorIf
2015-08-09 22:42:41 -07:00
Harshavardhana ae2a20dffc Move from Fatal/Error to fatalIf/errorIf 2015-08-09 22:41:49 -07:00
Anand Babu (AB) Periasamy f1589263e7 Merge pull request #983 from abperiasamy/cat-rewrite
cat rewrite
2015-08-09 22:25:43 -07:00
Anand Babu (AB) Periasamy ed4bbaafaf cat rewrite 2015-08-09 22:22:18 -07:00
Anand Babu (AB) Periasamy b751fa2372 Merge pull request #982 from abperiasamy/quick-fix
remove unnecessary pointer to interface
2015-08-09 19:44:26 -07:00
Anand Babu (AB) Periasamy 0a42c4e9a3 remove unnecessary pointer to interface 2015-08-09 19:43:11 -07:00
Anand Babu (AB) Periasamy 64c73f9f9e Merge pull request #981 from abperiasamy/make-fix
handle grepping stdout and stderr of go tools properly
2015-08-09 19:37:25 -07:00
Anand Babu (AB) Periasamy 1c35f28f75 handle grepping stdout and stderr of go tools properly 2015-08-09 19:34:37 -07:00
Harshavardhana 36b9a4d3e6 Merge pull request #980 from harshavardhana/pr_out_move_to_new_changes_in_minio_go
Move to new changes in minio-go
2015-08-08 23:49:31 -07:00
Harshavardhana d76070aeda Move to new changes in minio-go 2015-08-08 23:44:27 -07:00
Harshavardhana d399d4f694 Merge pull request #979 from harshavardhana/pr_out_move_testing_into_its_own_package_test_and_probe_newerror_
Move testing into its own <package>_test, add probe.NewError() new changes
2015-08-08 11:18:20 -07:00
Harshavardhana c97c2a77b5 Move testing into its own <package>_test, add probe.NewError() new changes 2015-08-08 11:16:36 -07:00
Harshavardhana e4dbd19c9f Merge pull request #978 from harshavardhana/pr_out_handle_virtual_bucket_style_urls_too
Handle virtual bucket style urls too
2015-08-07 12:10:39 -07:00
Harshavardhana ca107a154c Handle virtual bucket style urls too 2015-08-07 12:08:51 -07:00
Harshavardhana 6358f0f3a4 Merge pull request #977 from harshavardhana/pr_out_probe_moves_closer_to_mc_also_brings_in_changes_by_avoiding_it_behave_like_an_error_interface_
Probe moves closer to mc, also brings in changes by avoiding it behave like an error interface{}
2015-08-07 00:57:20 -07:00
Harshavardhana 202f9e7646 Probe moves closer to mc, also brings in changes by avoiding it behave like an error interface{} 2015-08-07 00:53:37 -07:00
Harshavardhana 28e8be6f0a Merge pull request #976 from harshavardhana/pr_out_update_share_command_template
update share command template
2015-08-06 23:53:23 -07:00
Harshavardhana 75bf5d7c78 update share command template 2015-08-06 23:52:05 -07:00
Harshavardhana e2d5698fbb Merge pull request #975 from harshavardhana/pr_out_share_command_now_honors_expiration_option
share command now honors expiration option
2015-08-06 23:37:29 -07:00
Harshavardhana f752ac3ae4 share command now honors expiration option 2015-08-06 23:34:39 -07:00
Harshavardhana 2ec0c2c4f1 Merge pull request #974 from harshavardhana/pr_out_report_proper_errors_for_share
Report proper errors for share
2015-08-06 22:32:34 -07:00
Harshavardhana c0935724ce Report proper errors for share 2015-08-06 22:30:36 -07:00
Harshavardhana 7288668ec1 Merge pull request #973 from harshavardhana/pr_out_add_proper_scoping_for_probe_error_and_error_interface
Add proper scoping for *probe.Error and error interface
2015-08-06 22:11:47 -07:00
Harshavardhana 23378ff3ef Add proper scoping for *probe.Error and error interface 2015-08-06 22:10:48 -07:00
Harshavardhana edab06f3e4 Merge pull request #972 from harshavardhana/pr_out_add_share_command_leveraging_new_presignedurl_api_from_minio_go
Add ``share`` command leveraging new PresignedURL API from minio-go
2015-08-06 22:10:09 -07:00
Harshavardhana c36ed96f26 Add `share` command leveraging new PresignedURL API from minio-go 2015-08-06 21:52:53 -07:00
Harshavardhana 8c1805d2e9 Merge pull request #971 from harshavardhana/pr_out_add_krishna_to_contributors_list
Add krishna to contributors list
2015-08-04 23:51:37 -07:00
Harshavardhana 7e2dc8d438 Add krishna to contributors list 2015-08-04 23:50:31 -07:00
Harshavardhana a390a488ed Merge pull request #970 from harshavardhana/pr_out_fix_console_issues_related_to_os_stderr_and_terminal_handling
Fix console issues related to os.Stderr and terminal handling
2015-08-04 23:22:32 -07:00
Harshavardhana 26eb25bb92 Fix console issues related to os.Stderr and terminal handling 2015-08-04 23:21:37 -07:00
Harshavardhana b6a2e5c4af Add diff json 2015-08-04 21:41:26 -07:00
Harshavardhana c163b66826 Merge pull request #967 from harshavardhana/pr_out_fix_signature_issues_second_attempt
Fix signature issues, second attempt
2015-08-04 15:13:18 -07:00
Harshavardhana 970e24b9c0 Fix signature issues, second attempt 2015-08-04 15:12:01 -07:00
Harshavardhana f29876f32f Merge pull request #966 from harshavardhana/pr_out_fix_signature_issues_in_turn_fixing_mirror_issues
Fix signature issues, in-turn fixing mirror issues
2015-08-04 00:15:32 -07:00
Harshavardhana eaec7b356d Fix signature issues, in-turn fixing mirror issues 2015-08-04 00:14:29 -07:00
Harshavardhana 41f35c9e82 Fix a really bad bug, avoid over-writing targetClnt URL(), copy the pointer properly 2015-08-03 22:20:11 -07:00
Harshavardhana e6fd52f026 Rename ifFatal and ifError as Fatal, Error 2015-08-03 22:19:45 -07:00
Harshavardhana faf415d08f Merge pull request #965 from harshavardhana/pr_out_handle_errors_better_with_new_changes_changes_across_cp_mirror_mb
Handle errors better with new changes, changes across cp, mirror, mb
2015-08-03 21:17:56 -07:00
Harshavardhana e003a242f6 Handle errors better with new changes, changes across cp, mirror, mb 2015-08-03 21:13:29 -07:00
Harshavardhana 08252acba7 Merge pull request #964 from harshavardhana/pr_out_only_mirror_regular_files
Only mirror regular files
2015-08-03 19:10:19 -07:00
Harshavardhana 4c7559317d Only mirror regular files 2015-08-03 19:08:33 -07:00
Harshavardhana 64b8782af3 Merge pull request #963 from harshavardhana/pr_out_fix_more_scoping_issues_with_new_probe_error_v_s_error
Fix more scoping issues with new probe.Error v/s error
2015-08-03 11:20:55 -07:00
Harshavardhana 9ba648084e Fix more scoping issues with new probe.Error v/s error 2015-08-03 11:19:22 -07:00
Harshavardhana 616cc698c8 Merge pull request #962 from harshavardhana/pr_out_migrating_from_iodine_to_probe
Migrating from iodine to probe
2015-08-03 11:05:36 -07:00
Harshavardhana e7dab5f1cf Migrating from iodine to probe 2015-08-03 11:04:34 -07:00
Harshavardhana 8cebe7880f Merge pull request #961 from harshavardhana/pr_out_deprecate_make_go_fall_back_to_makefile
deprecate make.go; fall back to Makefile
2015-07-31 17:24:42 -07:00
Harshavardhana 4aa908f392 deprecate make.go; fall back to Makefile 2015-07-31 17:23:55 -07:00
Harshavardhana e7ff64ceb2 Merge pull request #960 from harshavardhana/pr_out_default_to_delta_calculation_for_mirror_all_last_remaining_types_removed
Default to delta calculation for mirror - all last remaining types removed
2015-07-31 15:56:57 -07:00
Harshavardhana 892c9b86a6 Default to delta calculation for mirror - all last remaining types removed 2015-07-31 15:51:15 -07:00
Harshavardhana cbab2fe504 Merge pull request #959 from harshavardhana/pr_out_fix_broken_diff_behavior_using_absoluate_url_s_is_wrong_use_relative_instead
Fix broken diff behavior - using absolute URL's is wrong, use relative instead
2015-07-31 12:54:12 -07:00
Harshavardhana e8a5e68e3c Fix broken diff behavior - using absolute URL's is wrong, use relative instead 2015-07-31 12:42:52 -07:00
Harshavardhana 007a3c3497 No types in mirror command anymore 2015-07-31 00:26:10 -07:00
Harshavardhana 3750cef29e Merge pull request #957 from harshavardhana/pr_out_change_more_cast_to_mirror_and_fix_some_typos 2015-07-30 23:20:40 -07:00
Harshavardhana a700e37cf5 Change more cast to 'mirror' and fix some typos 2015-07-30 23:20:12 -07:00
Harshavardhana 37fac50f35 Merge pull request #956 from harshavardhana/pr_out_cast_to_mirror 2015-07-30 23:11:38 -07:00
Harshavardhana 4d2be23260 cast to mirror 2015-07-30 23:10:47 -07:00
Harshavardhana e09389ecd4 Merge pull request #955 from harshavardhana/pr_out_add_cursor_animation_for_diff_command
Add cursor animation for diff command
2015-07-30 21:24:52 -07:00
Harshavardhana ddf5c7bccc Add cursor animation for diff command 2015-07-30 21:23:56 -07:00
Harshavardhana 802e9ad72c Merge pull request #954 from harshavardhana/pr_out_diff_now_has_recursive_listing_and_matching_based_on_patricia_trie 2015-07-30 20:46:05 -07:00
Harshavardhana fa27eb71e4 Diff now has recursive listing and matching based on patricia trie 2015-07-30 20:44:56 -07:00
Harshavardhana ded42e0df2 Rename cast to mirror 2015-07-30 16:20:07 -07:00
Harshavardhana 7ea2a9a361 Merge pull request #953 from harshavardhana/pr_out_add_support_for_virtual_styled_hosts_and_update_godeps
Add support for virtual styled hosts and update godeps
2015-07-30 13:18:30 -07:00
Harshavardhana 7ef19ab316 Add support for virtual styled hosts and update godeps 2015-07-30 13:15:57 -07:00
Harshavardhana f1e05ad9d8 Merge pull request #952 from harshavardhana/pr_out_use_values_from_url_object_rather_than_hardcoded_entries
Use values from url object rather than hardcoded entries
2015-07-30 10:59:12 -07:00
Harshavardhana 27e6cf466e Use values from url object rather than hardcoded entries 2015-07-30 10:57:49 -07:00
Harshavardhana 32d70bfd2e Merge pull request #951 from krishnasrinivas/bucket-name-split
Fix path when bucket is specified as part of domain name
2015-07-30 10:48:53 -07:00
Krishna Srinivas 15fb024b81 Fix path when bucket is specified as part of domain name 2015-07-30 22:35:00 +05:30
Harshavardhana d2561afa4a Merge pull request #950 from harshavardhana/pr_out_support_virtual_host_styled_requests_convert_them_to_path_style_properly 2015-07-29 23:45:20 -07:00
Harshavardhana b0e7f435c8 Support virtual host styled requests, convert them to path style properly 2015-07-29 23:44:26 -07:00
Harshavardhana 3dcbd9014b Merge pull request #949 from harshavardhana/pr_out_add_path_to_if_path_is_null_string 2015-07-29 23:28:34 -07:00
Harshavardhana 68d72feeb7 Add path to '/' if path is null string 2015-07-29 23:27:18 -07:00
Harshavardhana 59bf426abb Merge pull request #948 from harshavardhana/pr_out_fix_a_config_corruption_bug_when_config_json_has_wrong_json_format_would_lead_to_overwriting_the_previous_config_json 2015-07-29 23:19:06 -07:00
Harshavardhana 88bef1c60a Fix a config corruption bug when config.json has wrong json format, would lead to overwriting the previous config.json 2015-07-29 23:14:48 -07:00
Harshavardhana 4175ca310c Merge pull request #947 from harshavardhana/pr_out_minior_typo_rename_sync_to_cast
minior: typo rename sync to cast
2015-07-28 22:59:35 -07:00
Harshavardhana 545ff44e54 minior: typo rename sync to cast 2015-07-28 22:58:53 -07:00
Harshavardhana 4a488cac3b Merge pull request #946 from harshavardhana/pr_out_fix_deps_scripts_add_a_working_osx_support
Fix deps scripts, add a working osx support
2015-07-27 19:16:30 -07:00
Harshavardhana ebcc4bf8d3 Fix deps scripts, add a working osx support 2015-07-27 19:15:14 -07:00
Harshavardhana 111a3101fd Merge pull request #945 from harshavardhana/pr_out_fix_progress_bar_style_and_cursors_for_darwin
Fix progress bar style and cursors for darwin
2015-07-27 19:11:25 -07:00
Harshavardhana e0862ac4ca Fix progress bar style and cursors for darwin 2015-07-27 19:05:12 -07:00
Harshavardhana 2503198f7d Merge pull request #944 from harshavardhana/pr_out_add_copy_and_cast_limited_tests
Add copy and cast limited tests
2015-07-27 22:26:36 +00:00
Harshavardhana 16fdb569c9 Add copy and cast limited tests 2015-07-27 15:25:34 -07:00
Harshavardhana f8fb3e1489 Merge pull request #943 from harshavardhana/pr_out_remove_upstream_go_version_package_write_a_simpler_version_parsing_and_use_it
Remove upstream go-version package, write a simpler version parsing and use it
2015-07-27 20:28:54 +00:00
Harshavardhana b47cf08d51 Remove upstream go-version package, write a simpler version parsing and use it 2015-07-27 13:27:47 -07:00
Harshavardhana 24b81da3ed Merge pull request #942 from harshavardhana/pr_out_fix_windows_version_issue_with_golang_beta_and_rc_releases_also_add_new_tag_version_format_for_versions
Fix windows version issue with golang beta and rc releases, also add new Tag version format for versions
2015-07-27 19:54:52 +00:00
Harshavardhana e9cbe61222 Fix windows version issue with golang beta and rc releases, also add new Tag version format for versions 2015-07-27 12:53:56 -07:00
Harshavardhana da2f3c826c Merge pull request #941 from harshavardhana/pr_out_cast_url_should_in_typec_should_verify_target_is_dir_or_exit_if_doesn_t_exist_let_it_create_one
In casttypeC should verify target is Dir() or exit, if doesn't exist let it create one
2015-07-26 21:26:07 +00:00
Harshavardhana a38764ca86 In casttypeC should verify target is Dir() or exit, if doesn't exist let it create one 2015-07-26 14:25:06 -07:00
Harshavardhana 4c72d23a89 Merge pull request #940 from harshavardhana/pr_out_let_target_directory_be_created_if_doesn_t_exist_with_prefix_path
Let target directory be created if doesn't exist with prefix path
2015-07-26 21:01:41 +00:00
Harshavardhana 847ef58642 Let target directory be created if doesn't exist with prefix path 2015-07-26 13:40:27 -07:00
Harshavardhana ecf020c382 Merge pull request #939 from harshavardhana/pr_out_check_for_url_s_when_target_path_doesn_t_have_bucket_error_out_quickly
Check for url's when target path doesn't have bucket, error out quickly
2015-07-26 19:16:30 +00:00
Harshavardhana 0f3e494de4 Check for url's when target path doesn't have bucket, error out quickly 2015-07-26 12:12:46 -07:00
Harshavardhana 845edec98a Merge pull request #938 from harshavardhana/pr_out_autogenerate_config_for_the_first_time_no_more_config_generate
Autogenerate config, for the first time no more config generate
2015-07-26 07:24:49 +00:00
Harshavardhana 4eb519fa6c Autogenerate config, for the first time no more config generate 2015-07-26 00:24:08 -07:00
Harshavardhana 6ecfdc879b Merge pull request #937 from harshavardhana/pr_out_add_go_version_dependency_add_first_time_go_to_check_for_golang_version
Add go-version dependency, add first-time.go to check for golang version
2015-07-26 07:05:38 +00:00
Harshavardhana feca7e196e Add go-version dependency, add first-time.go to check for golang version 2015-07-26 00:04:42 -07:00
Harshavardhana e3a5244a0b Merge pull request #936 from harshavardhana/pr_out_update_packages_for_avoiding_a_possible_windows_bug_in_go_humanize
update packages for avoiding a possible windows bug in go-humanize
2015-07-26 05:09:11 +00:00
Harshavardhana 5956dd6855 update packages for avoiding a possible windows bug in go-humanize 2015-07-25 22:08:35 -07:00
Harshavardhana bae203577e Merge pull request #935 from harshavardhana/pr_out_allow_migration_for_custom_config_location
Allow migration for custom config location
2015-07-26 04:38:27 +00:00
Harshavardhana e6a57e4afa Allow migration for custom config location 2015-07-25 21:37:19 -07:00
Harshavardhana e851f3ce0d Merge pull request #934 from harshavardhana/pr_out_fix_session_delete_bug_in_docopy_and_docast_session
Fix session delete bug in doCopy and doCast session
2015-07-26 04:02:54 +00:00
Harshavardhana c253ad76a8 Fix session delete bug in doCopy and doCast session 2015-07-25 21:02:03 -07:00
Harshavardhana 933c998cc2 Merge pull request #933 from harshavardhana/pr_out_fix_a_windows_bug_also_rename_remove_to_delete
Fix a windows bug, also rename Remove to Delete
2015-07-26 03:43:04 +00:00
Harshavardhana e1c77841a7 Fix a windows bug, also rename Remove to Delete 2015-07-25 20:42:15 -07:00
Harshavardhana 76fa1139bd Merge pull request #932 from harshavardhana/pr_out_add_remove_method_for_session_close_becomes_the_new_save_
Add Remove() method for session, Close() becomes the new Save()
2015-07-26 02:58:42 +00:00
Harshavardhana 04fbff76a9 Add Remove() method for session, Close() becomes the new Save() 2015-07-25 19:56:38 -07:00
Harshavardhana d7e707030d Merge pull request #931 from harshavardhana/pr_out_add_mb_related_tests
Add mb related tests
2015-07-25 06:47:43 +00:00
Harshavardhana 42053a39ae Add mb related tests 2015-07-24 23:46:47 -07:00
Harshavardhana 57badb956e Merge pull request #930 from harshavardhana/pr_out_use_the_new_extrainfo_functionality
use the new ExtraInfo functionality
2015-07-25 06:36:18 +00:00
Harshavardhana df4184de88 use the new ExtraInfo functionality 2015-07-24 23:35:36 -07:00
Harshavardhana a573d5df90 Merge pull request #929 from harshavardhana/pr_out_add_session_tests
Add session context tests
2015-07-25 05:13:44 +00:00
Harshavardhana 322bba2353 Add session context tests 2015-07-24 22:13:04 -07:00
Harshavardhana ba09793f63 Merge pull request #928 from harshavardhana/pr_out_rename_product_to_new_convention
Rename product to new convention
2015-07-25 01:25:21 +00:00
Harshavardhana 5af70f5e49 Rename product to new convention 2015-07-24 18:23:12 -07:00
Harshavardhana 877a3af3f9 Merge pull request #927 from harshavardhana/pr_out_add_diff_cli_context_tests
Add diff cli context tests
2015-07-24 23:31:36 +00:00
Harshavardhana cd1f80c442 Add diff cli context tests 2015-07-24 16:30:43 -07:00
Harshavardhana 2a6cced987 Merge pull request #926 from harshavardhana/pr_out_add_cast_syntax_check_logic
Add cast syntax check logic
2015-07-24 21:46:03 +00:00
Harshavardhana 1afc92cb49 Add cast syntax check logic
-- TypeA for both cast and copy targetURL check shouldn't fail it it doesn't exist
   such is a common occurrence of not having a target, instead we verify if it exists
   is it a directory?
-- Rename all 'directory' references to folder
2015-07-24 14:43:47 -07:00
Harshavardhana df494eafdc Merge pull request #925 from harshavardhana/pr_out_add_command_context_testing
Add command context testing
2015-07-24 19:43:28 +00:00
Harshavardhana b90e016892 Add command context testing 2015-07-24 12:42:33 -07:00
Anand Babu (AB) Periasamy 4ab2f637a4 Merge pull request #924 from abperiasamy/cp-url-improvements
cp url syntax checker and some fixes
2015-07-24 12:25:54 -07:00
Anand Babu (AB) Periasamy 9dd27c5e57 cp url syntax checker and some fixes 2015-07-24 12:24:21 -07:00
Harshavardhana 8549c43a5c Merge pull request #923 from harshavardhana/pr_out_verify_for_mc_config_exists_for_cp_and_cast_commands
Verify if mc config exists for cp and cast commands
2015-07-24 05:50:03 +00:00
Harshavardhana 2f253f68b6 Verify if mc config exists for cp and cast commands 2015-07-23 22:49:12 -07:00
Harshavardhana 615852d4e6 Merge pull request #922 from harshavardhana/pr_out_add_cp_cast_guess_url_type_tests
Add cp cast guess URL type tests
2015-07-24 05:36:03 +00:00
Harshavardhana 090554c3e2 Add cp cast guess URL type tests 2015-07-23 22:34:41 -07:00
Harshavardhana f3db91d643 Merge pull request #921 from harshavardhana/pr_out_add_common_test_methods
Add common methods test
2015-07-24 04:01:41 +00:00
Harshavardhana f14f983a76 Add common methods test 2015-07-23 21:00:45 -07:00
Harshavardhana ff427b8bff Merge pull request #920 from harshavardhana/pr_out_make_copy_look_like_cast
Make copy look like cast in URL handling
2015-07-24 03:35:34 +00:00
Harshavardhana f06456ddd1 Make copy look like cast in URL handling 2015-07-23 20:34:31 -07:00
Harshavardhana 3eed72a411 Merge pull request #919 from harshavardhana/pr_out_add_proper_errors
Add proper errors
2015-07-24 00:40:47 +00:00
Harshavardhana 0f23c1a3d7 Add proper errors 2015-07-23 17:38:53 -07:00
Harshavardhana fca55cac43 Merge pull request #918 from harshavardhana/pr_out_add_tests_reported_by_go_coverage
Add tests reported by go coverage
2015-07-23 23:35:05 +00:00
Harshavardhana 6ed78e32d9 Add tests reported by go coverage 2015-07-23 16:34:21 -07:00
Harshavardhana 15ddb479eb Update CONTRIBUTING.md 2015-07-23 16:05:20 -07:00
Harshavardhana b1c69be074 Update CONTRIBUTING.md 2015-07-23 16:04:57 -07:00
Harshavardhana 9306f286ae Merge pull request #917 from harshavardhana/pr_out_add_slack_secure_build_reports
Add slack secure build reports
2015-07-23 21:42:32 +00:00
Harshavardhana aa87e56ad4 Add slack secure build reports 2015-07-23 14:40:25 -07:00
Harshavardhana 4da25f0694 Merge pull request #916 from harshavardhana/pr_out_do_not_overwrite_if_user_already_had_expected_entries
Do not overwrite if user already had expected entries
2015-07-23 21:38:35 +00:00
Harshavardhana ee0fe86178 Do not overwrite if user already had expected entries 2015-07-23 14:35:57 -07:00
Harshavardhana 879c90973c Merge pull request #915 from harshavardhana/pr_out_add_migration_code_for_migrating_from_config_version_1_0_0_to_1_0_1
Add migration code for migrating from config version 1.0.0 to 1.0.1
2015-07-23 21:33:18 +00:00
Harshavardhana 2e23ca3ce9 Add migration code for migrating from config version 1.0.0 to 1.0.1 2015-07-23 14:32:21 -07:00
Harshavardhana 975047de75 Merge pull request #914 from harshavardhana/pr_out_add_localhost_and_127_0_0_1_entries_into_config_json
Add localhost and 127.0.0.1 entries into config.json
2015-07-23 17:48:22 +00:00
Harshavardhana 9f4e87339c Add localhost and 127.0.0.1 entries into config.json 2015-07-23 10:46:13 -07:00
Harshavardhana d7f6bd1f4e Merge pull request #912 from harshavardhana/pr_out_rename_cmd_into_command_main_go
Rename cmd-* into <command>-main.go
2015-07-23 06:27:51 +00:00
Harshavardhana 8335d9cbcf Rename cmd-* into <command>-main.go 2015-07-22 23:27:06 -07:00
Harshavardhana 97e699e35c Merge pull request #911 from harshavardhana/pr_out_handle_cases_where_prefix_exists_or_not_for_both_cast_and_cp
Handle cases where prefix exists or not for both cast and cp
2015-07-23 06:24:33 +00:00
Harshavardhana 56a725ef18 Handle cases where prefix exists or not for both cast and cp 2015-07-22 23:22:19 -07:00
Harshavardhana 1ab9dd76c6 Merge pull request #910 from harshavardhana/pr_out_remove_unncessary_stat_checks_for_typec_in_cp_and_cast_fixes_803
Remove unncessary stat() checks for TypeC in cp and cast - fixes #803
2015-07-23 03:54:16 +00:00
Harshavardhana 71ed556dd0 Remove unncessary stat() checks for TypeC in cp and cast - fixes #803 2015-07-22 20:53:21 -07:00
Harshavardhana 964fdf7565 Merge pull request #909 from harshavardhana/pr_out_update_to_new_minio_go_changes_related_to_x_amz_id_2
Update to new minio-go changes related to x-amz-id-2
2015-07-23 03:04:18 +00:00
Harshavardhana 5b1816ab63 Update to new minio-go changes related to x-amz-id-2 2015-07-22 20:03:25 -07:00
Harshavardhana 9707acfd17 Merge pull request #908 from harshavardhana/pr_out_return_back_object_already_exists_for_methodnotallowed
Return back object already exists for methodnotallowed
2015-07-22 02:20:52 +00:00
Harshavardhana 304254863f Return back object already exists for methodnotallowed 2015-07-21 19:15:43 -07:00
Anand Babu (AB) Periasamy 2ee8a82c60 Merge pull request #907 from abperiasamy/disable-target-stat
do not stat on url prepration. disable force flag
2015-07-21 19:14:04 -07:00
Anand Babu (AB) Periasamy 7c2f3fbe4e do not stat on url prepration. disable force flag 2015-07-21 19:13:10 -07:00
Harshavardhana b6e638fd36 Merge pull request #906 from abperiasamy/improved-cast-cmd
improved cast
2015-07-22 01:40:20 +00:00
Anand Babu (AB) Periasamy 69e27e8bbc improved cast 2015-07-21 18:34:11 -07:00
Anand Babu (AB) Periasamy da46b10aa3 Merge pull request #905 from abperiasamy/fatal-err-str
fix error strings
2015-07-19 15:30:29 -07:00
Anand Babu (AB) Periasamy f2434591d9 fix error strings 2015-07-19 15:27:30 -07:00
Anand Babu (AB) Periasamy aa8c846224 Merge pull request #904 from abperiasamy/syntax-checker-new
cleaner syntax checker
2015-07-18 20:28:21 -07:00
Anand Babu (AB) Periasamy 7af254f500 cleaner syntax checker 2015-07-18 20:26:38 -07:00
Harshavardhana b0975c830d Merge pull request #903 from abperiasamy/cast-syntax-checker
syntax checker for cast command
2015-07-19 02:32:45 +00:00
Anand Babu (AB) Periasamy 9f5f1e9a53 syntax checker for cast command 2015-07-18 19:25:10 -07:00
Harshavardhana 35bb168649 Merge pull request #902 from harshavardhana/pr_out_allow_copy_for_virtual_files
Allow copy for virtual files
2015-07-18 23:32:05 +00:00
Harshavardhana 38149f5ba1 Allow copy for virtual files 2015-07-18 16:30:36 -07:00
Harshavardhana 41c4f932f3 Merge pull request #901 from harshavardhana/pr_out_migrate_to_upstream_gopkg_in_check_v1
Migrate to upstream gopkg.in/check.v1
2015-07-18 22:53:15 +00:00
Harshavardhana f717e9b560 Migrate to upstream gopkg.in/check.v1 2015-07-18 15:52:17 -07:00
Harshavardhana 8790188473 Merge pull request #900 from harshavardhana/pr_out_rename_sync_to_cast
Rename `sync` to `cast`
2015-07-18 01:29:10 +00:00
Harshavardhana 363c06d8f7 Rename sync to cast 2015-07-17 18:27:45 -07:00
Harshavardhana 6066e4a953 Merge pull request #899 from harshavardhana/pr_out_sort_sessions_before_printing 2015-07-17 17:12:11 +00:00
Harshavardhana 9418317014 Sort sessions before printing 2015-07-17 10:08:56 -07:00
Harshavardhana c88771a341 Update README.md 2015-07-16 23:56:15 -07:00
Harshavardhana 6d24b3767b Merge pull request #898 from harshavardhana/pr_out_add_force_flag_support_to_avoid_over_writing_destination
Add force flag support to avoid over-writing destination
2015-07-17 05:42:00 +00:00
Harshavardhana f8eaa96b1d Add force flag support to avoid over-writing destination 2015-07-16 22:39:48 -07:00
Harshavardhana f3f6b7478b Merge pull request #897 from harshavardhana/pr_out_formally_now_sync_supports_file_and_directories
Formally now sync supports file and directories
2015-07-17 03:07:03 +00:00
Harshavardhana 7e0fce66e7 Formally now sync supports file and directories mix-match 2015-07-16 20:04:46 -07:00
Harshavardhana 5b60b65c08 Merge pull request #896 from harshavardhana/pr_out_some_gocoverage_fixes 2015-07-17 03:00:23 +00:00
Harshavardhana 5cb7d510e5 Some gocoverage fixes 2015-07-16 19:38:40 -07:00
Anand Babu (AB) Periasamy 11619b779c Merge pull request #895 from abperiasamy/sync-url-rewrite
rewrite of sync url processing
2015-07-16 19:32:23 -07:00
Anand Babu (AB) Periasamy 54183d783b rewrite of sync url processing 2015-07-16 19:29:33 -07:00
Harshavardhana 1792ff20c1 Merge pull request #894 from harshavardhana/pr_out_add_more_cleanups_and_bug_fixes_from_minio_go_move_to_v0_2_0
Add more cleanups and bug-fixes from minio-go - move to v0.2.0
2015-07-17 01:23:35 +00:00
Harshavardhana 3b1c288d03 Add more cleanups and bug-fixes from minio-go - move to v0.2.0 2015-07-16 18:21:56 -07:00
Harshavardhana 84fcbff4d5 Merge pull request #893 from harshavardhana/pr_out_add_bug_fixes_from_minio_go
Add bug fixes from minio-go
2015-07-16 06:33:45 +00:00
Harshavardhana 3ce5b481ca Add bug fixes from minio-go 2015-07-15 23:32:58 -07:00
Harshavardhana 18dadd443f Update README.md 2015-07-15 23:32:01 -07:00
Harshavardhana daab7b9678 Merge pull request #891 from harshavardhana/pr_out_use_console_json_to_print_in_api_style_for_session_ls_cp_and_sync
Use console.JSON to print in API style for session, ls, cp and sync
2015-07-16 06:19:19 +00:00
Harshavardhana 97f693ce1f Use console.JSON to print in API style for session, ls, cp and sync 2015-07-15 23:18:08 -07:00
Harshavardhana af3974db8c Merge pull request #890 from harshavardhana/pr_out_implement_newiodine_in_a_simpler_way
Implement NewIodine() in a simpler way
2015-07-16 01:40:16 +00:00
Harshavardhana 25ada41480 Implement NewIodine() in a simpler way 2015-07-15 18:39:17 -07:00
Harshavardhana 8fa80fbf37 Revert "Add mc top level error handling without printing stack traces."
This reverts commit ab4f64b5e3.
2015-07-15 17:25:42 -07:00
Harshavardhana fd400930e6 Merge pull request #889 from harshavardhana/pr_out_add_mc_top_level_error_handling_without_printing_stack_traces 2015-07-16 00:14:51 +00:00
Harshavardhana ab4f64b5e3 Add mc top level error handling without printing stack traces. 2015-07-15 16:53:28 -07:00
Harshavardhana 1d76b592a3 Merge pull request #888 from harshavardhana/pr_out_put_dependency_updates_into_a_shell_script
Put dependency updates into a shell script
2015-07-15 21:25:23 +00:00
Harshavardhana 3118ed0c64 Put dependency updates into a shell script 2015-07-15 14:24:17 -07:00
Harshavardhana 2782a8e923 Merge pull request #887 from harshavardhana/pr_out_ts_getsize_error_should_be_failed 2015-07-15 18:37:22 +00:00
Harshavardhana c40cb27d19 ts.GetSize() error should fail on error 2015-07-15 11:33:12 -07:00
Anand Babu (AB) Periasamy b491372d5b Merge pull request #886 from abperiasamy/scanbar-prefix
fix scanbar prefix printing for large prefixes
2015-07-15 11:16:58 -07:00
Anand Babu (AB) Periasamy 790179e268 fix scanbar prefix printing for large prefixes 2015-07-15 11:13:31 -07:00
Harshavardhana ed7f7f1058 Merge pull request #885 from harshavardhana/pr_out_update_golang_library_for_new_responses_and_restructuring
update golang library for new responses and restructuring
2015-07-15 17:06:04 +00:00
Harshavardhana 7cc4f4e1ab update golang library for new responses and restructuring 2015-07-15 10:00:11 -07:00
Anand Babu (AB) Periasamy deb6312983 Merge pull request #884 from abperiasamy/version-parsing
fix version parsing for --version
2015-07-14 18:58:10 -07:00
Anand Babu (AB) Periasamy 4990aafb10 fix version parsing for --version 2015-07-14 18:56:37 -07:00
Harshavardhana 351b008768 Merge pull request #883 from harshavardhana/pr_out_revert_to_older_behavior_for_multipart_put_update_to_new_minio_go
Revert to older behavior for multipart put, update to new minio-go
2015-07-14 23:58:36 +00:00
Harshavardhana 530b8f1089 Revert to older behavior for multipart put, update to new minio-go 2015-07-14 16:57:41 -07:00
Harshavardhana 92240c52fa Merge pull request #882 from harshavardhana/pr_out_remove_atomic_package_not_needed_anymore
Remove atomic package, not needed anymore
2015-07-14 23:51:20 +00:00
Harshavardhana 0bdb5bdc5f Remove atomic package, not needed anymore 2015-07-14 16:50:16 -07:00
Harshavardhana 71f29417c7 Merge pull request #881 from harshavardhana/pr_out_remove_cp_and_sync_tests_for_now_bring_them_back_with_console_test_additionally_close_datafp_inside_session_close_
Remove cp and sync tests for now, bring them back with console.Test, additionally close DataFP inside session.Close()
2015-07-14 23:49:31 +00:00
Harshavardhana 3414a0fd3b Remove cp and sync tests for now, bring them back with console.Test, additionally close DataFP inside session.Close() 2015-07-14 16:43:32 -07:00
Harshavardhana 91760753a7 Merge pull request #880 from harshavardhana/pr_out_cleanup_minio_remote_struct_printing_for_info_error_and_fatal_simplifying_overall_error_handling
Cleanup minio, remote struct printing for Info, Error and Fatal - simplifying overall error handling
2015-07-14 18:03:14 +00:00
Harshavardhana d4047ca899 Cleanup minio, remote struct printing for Info, Error and Fatal - simplifying overall error handling 2015-07-14 11:02:04 -07:00
Harshavardhana 1aa3496142 Merge pull request #879 from harshavardhana/pr_out_remove_yielder_not_needed_anymore
Remove yielder not needed anymore
2015-07-14 04:52:48 +00:00
Harshavardhana 931a788c54 Remove yielder not needed anymore 2015-07-13 21:49:48 -07:00
Harshavardhana 8f55f7e232 Merge pull request #878 from harshavardhana/pr_out_add_syncqueue_cpqueue_back_into_defer
Add syncQueue, cpQueue back into defer
2015-07-14 04:44:19 +00:00
Harshavardhana db679e58ff Add syncQueue, cpQueue back into defer 2015-07-13 21:42:53 -07:00
Anand Babu (AB) Periasamy 22982d392b Merge pull request #877 from harshavardhana/pr_out_add_close_methods_for_proxy_readers
Add Close() methods for proxy readers
2015-07-13 17:00:08 -07:00
Harshavardhana f8940d2832 Add Close() methods for proxy readers 2015-07-13 16:45:33 -07:00
Harshavardhana e7be47ac7f Merge pull request #875 from harshavardhana/pr_out_fix_hangs_in_cp_and_sync_with_quiet_and_json_flag
Fix hangs in cp and sync with --quiet and json flag
2015-07-13 23:24:49 +00:00
Harshavardhana 6079e1ba7b Update to latest minio-go 2015-07-13 16:22:30 -07:00
Harshavardhana 420b5d286c Fix hangs in cp and sync with --quiet and json flag 2015-07-13 16:19:46 -07:00
Anand Babu (AB) Periasamy be08d24743 Merge pull request #876 from abperiasamy/quiet-bug-fix
fixes quiet mode hang issue
2015-07-13 16:09:56 -07:00
Anand Babu (AB) Periasamy 693c3ddd06 fixes quiet mode hang issue 2015-07-13 16:08:15 -07:00
Anand Babu (AB) Periasamy c7de6a99e3 Merge pull request #874 from abperiasamy/config-path
support for custom --config dir
2015-07-13 15:38:14 -07:00
Anand Babu (AB) Periasamy de8b99c4ff support for custom --config dir 2015-07-13 15:35:53 -07:00
Harshavardhana f179be69dd Merge pull request #872 from harshavardhana/pr_out_remove_minio_cli_dependency_for_make_go
Remove minio/cli dependency for make.go
2015-07-13 18:46:57 +00:00
Harshavardhana cb5c7c49f3 Remove minio/cli dependency for make.go 2015-07-13 11:45:56 -07:00
Harshavardhana a0c453a6fe Merge pull request #871 from harshavardhana/pr_out_remove_infomessage_structs_we_don_t_need_to_add_this_as_api_handling_for_json
Remove InfoMessage structs, we don't need to add this as API handling for json
2015-07-13 16:42:36 +00:00
Harshavardhana 25237c4e20 Remove InfoMessage structs, we don't need to add this as API handling for json 2015-07-13 09:40:29 -07:00
Harshavardhana 3cb18d71e6 Merge pull request #870 from harshavardhana/pr_out_cosmetic_changes_for_cmd_cp 2015-07-13 16:34:57 +00:00
Harshavardhana 7c7981658b Cosmetic changes for cmd cp 2015-07-13 09:33:08 -07:00
Harshavardhana 3f608d2d0a Merge pull request #869 from harshavardhana/pr_out_remove_countlock_not_needed_anymore
Remove countlock not needed anymore
2015-07-13 16:21:32 +00:00
Harshavardhana 940fa484a8 Remove countlock not needed anymore 2015-07-13 09:20:21 -07:00
Anand Babu (AB) Periasamy 5110e2a99f Merge pull request #868 from abperiasamy/cp-resume-ression
command to resume session for copy
2015-07-12 21:05:55 -07:00
Anand Babu (AB) Periasamy 848faea935 command to resume session for copy 2015-07-12 21:05:24 -07:00
Harshavardhana 9d9ef82dc7 Merge pull request #867 from abperiasamy/sessionV2
Session V2 implementation for copy and sync
2015-07-13 03:56:44 +00:00
Anand Babu (AB) Periasamy 6dcd73551c Session V2 implementation for copy and sync 2015-07-12 20:47:49 -07:00
Harshavardhana c29e9bc92d Merge pull request #866 from harshavardhana/pr_out_make_json_umarshalling_as_part_of_print_structs
Make json umarshalling as part of print-structs
2015-07-12 16:57:39 +00:00
Harshavardhana f10801fb18 Make json umarshalling as part of print-structs 2015-07-12 09:55:30 -07:00
Harshavardhana dc9c57123f Merge pull request #865 from harshavardhana/pr_out_simplify_console_removing_lot_of_custom_json_unmarshal_code
Simplify console removing lot of custom json unmarshal code
2015-07-12 16:21:03 +00:00
Harshavardhana 694cc7bb8e Simplify console removing lot of custom json unmarshal code 2015-07-12 09:18:20 -07:00
Harshavardhana 706c4d1291 Merge pull request #864 from harshavardhana/pr_out_fix_data_race_reported_by_golang_1_5 2015-07-11 04:05:36 +00:00
Harshavardhana 7b1ed5b824 Fix data race reported by golang 1.5 2015-07-10 21:04:35 -07:00
Harshavardhana 25eb49335a Merge pull request #863 from harshavardhana/pr_out_revert_correct_definition_of_diff_definition_is_accurate
Revert "Correct definition of diff" - definition is accurate
2015-07-10 01:15:31 +00:00
Harshavardhana ae6661d2ba Revert "Correct definition of diff" - definition is accurate
Diff is not specific to size alone, so the wording is not accurate, reverting

This reverts commit 8b83b525ac.
2015-07-09 18:13:48 -07:00
Harshavardhana cc9603f91a Merge pull request #862 from harshavardhana/pr_out_add_bosky_as_part_of_contributors_list
Add bosky as part of contributors list
2015-07-09 17:44:19 +00:00
Harshavardhana 15b4a89831 Add bosky as part of contributors list 2015-07-09 10:41:37 -07:00
Harshavardhana 564797fd1f Merge pull request #861 from bosky101/feature/diff-docs
Correct definition of diff
2015-07-09 17:38:40 +00:00
Bosky 8b83b525ac Correct definition of diff
Make it more clear that size difference is done
2015-07-09 16:56:30 +05:30
Harshavardhana 3e418a00c8 Merge pull request #860 from harshavardhana/pr_out_let_localhost_also_have_its_access_keys_and_secret_id 2015-07-09 04:52:22 +00:00
Harshavardhana 6c10632901 Let localhost also have its access keys and secret id 2015-07-08 21:51:28 -07:00
Harshavardhana e4048e106e Merge pull request #859 from harshavardhana/pr_out_update_to_new_changes_in_minio_go 2015-07-09 01:21:29 +00:00
Harshavardhana 3e575bbab7 Update to new changes in minio-go 2015-07-08 18:19:56 -07:00
Harshavardhana 7c2e610cd3 Merge pull request #858 from harshavardhana/pr_out_update_to_latest_minio_go_with_listobjects_handling_for_listing_of_more_than_1000_entries_when_there_are_delimiters_and_prefixes 2015-07-08 05:38:02 +00:00
Harshavardhana 6d2acec237 Update to latest minio-go with Listobjects() handling for listing of more than 1000 entries when there are delimiters and prefixes 2015-07-07 22:37:07 -07:00
Harshavardhana cc4a96b1ee Merge pull request #857 from harshavardhana/pr_out_add_atomic_package_for_atomic_file_writes_use_that_in_quick_config 2015-07-07 19:21:13 +00:00
Harshavardhana f368e89d9c Add atomic package for atomic file writes, use that in quick config 2015-07-07 12:16:56 -07:00
Harshavardhana 907b6f3025 Merge pull request #856 from vadmeste/quick_config_atomic_save
Avoid possible corrupted data when saving with quick
2015-07-07 19:11:42 +00:00
Anis Elleuch c8662c67c2 Avoid corrupted data when saving with quick 2015-07-07 16:40:38 +01:00
Harshavardhana e7183fa5d5 Merge pull request #855 from harshavardhana/pr_out_fix_unicode_progress_bar_characters
Fix unicode progress bar characters
2015-07-05 21:40:39 +00:00
Harshavardhana 72f699c30a Fix unicode progress bar characters 2015-07-05 14:35:22 -07:00
Harshavardhana 368d99f0ea Merge pull request #854 from harshavardhana/pr_out_add_unicode_block_character_for_progress_bar_on_linux_and_darwin 2015-07-05 18:05:12 +00:00
Harshavardhana 609ebb421b Add unicode block character for progress bar on linux and darwin 2015-07-05 11:03:58 -07:00
Harshavardhana 98aec1eb92 Merge pull request #853 from harshavardhana/pr_out_going_to_use_minio_pb_forked_version_as_primary_since_we_might_make_more_changes_in_future 2015-07-05 08:18:42 +00:00
Harshavardhana 12680b6fbf Going to use minio/pb forked version as primary, since we might make more changes in future.
While we submit all our changes upstream
2015-07-05 01:16:51 -07:00
Harshavardhana 072106ec30 Merge pull request #852 from vadmeste/enhance_pb_render
Prettify the progress bar output
2015-07-05 08:11:03 +00:00
Anis Elleuch 883d24aa8f Fix the output overlapping between progress bar and error messages 2015-07-05 09:08:17 +01:00
Harshavardhana 2ee60b494b Merge pull request #851 from vadmeste/use_all_instead_of_astersik_in_session_cmd
Asterisk in session clear cmd is interpreted by bash if not escaped. Use 'all' keyword instead.
2015-07-03 17:09:30 +00:00
Anis Elleuch 6b54e2401e Asterisk in session clear cmd is interpreted by bash if not escaped. Use 'all' keyword instead. 2015-07-03 07:03:57 +01:00
Harshavardhana 6a81ec1434 Merge pull request #850 from harshavardhana/pr_out_user_struct_instead_of_bool_for_saving_session_saves_a_1byte 2015-07-01 18:34:01 +00:00
Harshavardhana 7314071070 User struct{} instead of bool for saving session, saves a 1byte 2015-07-01 11:31:32 -07:00
Harshavardhana 6f431d0737 Merge pull request #849 from vadmeste/pr_out_protect_progress_bar_by_a_mutex
Protect progress bar printing by the mutex
2015-07-01 17:49:14 +00:00
Anis Elleuch 3550b85cc7 Protect progress bar printing by the mutex 2015-07-01 17:40:45 +01:00
Harshavardhana b0deba6bab Merge pull request #848 from harshavardhana/pr_out_add_fakereader_to_sessions_to_populate_progress_bar_as_it_builds_and_skips_previously_uploaded_files 2015-06-30 22:26:39 +00:00
Harshavardhana d2c2064b25 Add fakeReader to sessions to populate progress bar as it builds and skips previously uploaded files 2015-06-30 15:24:09 -07:00
Harshavardhana c4001938c8 Merge pull request #847 from harshavardhana/pr_out_root_path_working_directory 2015-06-30 18:07:06 +00:00
Harshavardhana 30e49ba525 root-path --> working-directory 2015-06-30 11:03:32 -07:00
Harshavardhana b876bafde7 Merge pull request #846 from harshavardhana/pr_out_treating_json_as_quiet_mode_for_cp_and_sync_operations 2015-06-30 17:29:11 +00:00
Harshavardhana 46bf1af56c Treating --json as quiet mode for cp and sync operations 2015-06-30 10:26:48 -07:00
Harshavardhana c522b5bee5 Merge pull request #845 from harshavardhana/pr_out_mc_session_related_changes
mc session related changes
2015-06-30 06:13:56 +00:00
Harshavardhana 9971d4964c mc session related changes 2015-06-29 23:12:28 -07:00
Harshavardhana 00fdf7d926 Merge pull request #844 from harshavardhana/pr_out_save_session_rootpath_to_handle_sessions_from_anywhere_relative_or_absolute
Save session rootPath to handle sessions from anywhere, relative or absolute
2015-06-29 20:45:21 +00:00
Harshavardhana d76cdd35d6 Save session rootPath to handle sessions from anywhere, relative or absolute 2015-06-29 13:41:59 -07:00
Harshavardhana 91fbce7fa5 Merge pull request #843 from vadmeste/session_cmd_fixes 2015-06-25 17:29:17 +00:00
Anis Elleuch 9a1397c441 Show help when the user enters an incorrect session subcommand
This reverts commit 320c60bb86b788fdf5fe05832db78aeb1809f47a.
2015-06-25 18:27:23 +01:00
Harshavardhana 6dd02b8a36 Merge pull request #841 from harshavardhana/pr_out_bump_to_new_version_release_1435182969 2015-06-24 22:02:44 +00:00
Harshavardhana 4b5b623ecc Bump to new version - release-1435182969 2015-06-24 14:58:59 -07:00
Harshavardhana 6fe23f9930 Merge pull request #840 from harshavardhana/pr_out_handle_messages_for_writing_aliases_and_configuration_file_differently 2015-06-24 12:20:34 -07:00
Harshavardhana 18effa33da Handle messages for writing aliases and configuration file differently 2015-06-24 12:16:45 -07:00
Harshavardhana 3eecf2569a Merge pull request #839 from harshavardhana/pr_out_rename_ismcconfigexist_to_ismcconfigexists_for_brevity 2015-06-23 20:29:29 -07:00
Harshavardhana 7848ffd99c Rename isMcConfigExist to isMcConfigExists for brevity 2015-06-23 20:28:12 -07:00
Harshavardhana 0137bf9909 Merge pull request #838 from harshavardhana/pr_out_simplify_target2client_and_sourc2client_usage_use_url2stat_ 2015-06-23 16:53:34 -07:00
Harshavardhana 01b10bd4b1 Simplify target2Client and sourc2Client usage - use url2Stat() 2015-06-23 16:49:23 -07:00
Harshavardhana 6736b26906 Merge pull request #837 from harshavardhana/pr_out_bring_iodine_changes_into_mc 2015-06-23 13:44:21 -07:00
Harshavardhana 350499b78c Bring iodine changes into mc 2015-06-23 13:42:45 -07:00
Harshavardhana 21017ddcd3 Merge pull request #836 from harshavardhana/pr_out_add_session_tests 2015-06-22 17:21:09 -07:00
Harshavardhana e8762f442b Add session tests 2015-06-22 17:20:03 -07:00
Harshavardhana ca98985de4 Merge pull request #835 from harshavardhana/pr_out_fix_sync_bug_when_in_typea_and_typeb_sync_style_source_doesn_t_exist 2015-06-22 15:59:07 -07:00
Harshavardhana 9b901bac21 Fix sync bug when in TypeA and TypeB sync style source doesn't exist 2015-06-22 15:57:02 -07:00
Harshavardhana 4b88ad7786 Move to structure printing everywhere, fix incorrect iodine usage at few places 2015-06-22 15:29:36 -07:00
Harshavardhana ecfbc3c453 Merge pull request #833 from harshavardhana/pr_out_print_sessions_just_like_ls 2015-06-22 14:58:25 -07:00
Harshavardhana 7ee4692ceb Print sessions just like ls 2015-06-22 14:57:06 -07:00
Harshavardhana 51a333749c Merge pull request #832 from vadmeste/fix_help_session_cmd
Fix simple typo in session command help
2015-06-22 12:29:16 -07:00
Anis Elleuch 1b3f08e9d0 Fix simple typo in session command help 2015-06-22 20:26:27 +01:00
Harshavardhana d21b2ebedb Merge pull request #831 from harshavardhana/pr_out_add_more_structured_informational_messages 2015-06-22 11:36:11 -07:00
Harshavardhana 1dbb2e2b96 Add more structured informational messages 2015-06-22 11:33:14 -07:00
Harshavardhana d99063a11f Merge pull request #830 from harshavardhana/pr_out_attempt_to_make_informational_message_a_structure 2015-06-22 07:46:33 -07:00
Harshavardhana 1983caf2e2 Attempt to make informational message a structure 2015-06-22 07:44:08 -07:00
Harshavardhana 301d01daea Merge pull request #829 from harshavardhana/pr_out_update_sync_session_document 2015-06-20 21:55:37 -07:00
Harshavardhana 33afbbc4e9 Update sync session docs 2015-06-20 21:53:59 -07:00
Harshavardhana 0841eba62b Merge pull request #828 from harshavardhana/pr_out_simplify_session_handlers 2015-06-20 21:06:04 -07:00
Harshavardhana 938959e702 Simplify session handlers 2015-06-20 21:04:23 -07:00
Harshavardhana 32545881ff Merge pull request #827 from harshavardhana/pr_out_add_sync_session_deprecate_uuid_usage_move_to_a_fixed_length_random_english_characters 2015-06-20 20:40:43 -07:00
Harshavardhana a0ab414764 Add sync session, deprecate UUID usage move to a fixed length random english characters 2015-06-20 20:39:35 -07:00
Harshavardhana 080f972e99 Merge pull request #826 from harshavardhana/pr_out_add_session_tests_fix_some_bugs_in_session_handling 2015-06-20 19:39:07 -07:00
Harshavardhana 14e33416e7 Add session tests, fix some bugs in session handling 2015-06-20 19:36:19 -07:00
Harshavardhana bd61542673 Merge pull request #825 from harshavardhana/pr_out_cp_sessions_now_work_properly 2015-06-20 18:19:43 -07:00
Harshavardhana 20b99021cc Cp sessions now work properly 2015-06-20 18:17:18 -07:00
Harshavardhana 4182aee07f Merge pull request #824 from harshavardhana/pr_out_add_resume_session_command 2015-06-20 16:18:36 -07:00
Harshavardhana 7bc4f99bfb Add resume session command 2015-06-20 16:17:29 -07:00
Harshavardhana 677a484215 Merge pull request #823 from harshavardhana/pr_out_use_session_now_saves_in_transit_information_remove_usage_of_sync_pool_not_needed
use session now saves in-transit information, remove usage of sync.Pool not needed
2015-06-20 16:01:08 -07:00
Harshavardhana 157bf10372 use session now saves in-transit information, remove usage of sync.Pool not needed 2015-06-20 15:54:49 -07:00
Harshavardhana 8cff0fe99b Merge pull request #822 from harshavardhana/pr_out_fix_a_bug_in_session_clear 2015-06-19 21:43:27 -07:00
Harshavardhana 93259fe0f9 Fix a bug in session clear 2015-06-19 21:41:25 -07:00
Harshavardhana 50f8ec5541 Merge pull request #821 from harshavardhana/pr_out_use_docopycmd_for_now 2015-06-19 21:40:01 -07:00
Harshavardhana da195b9b3a use doCopyCmd for now 2015-06-19 21:38:32 -07:00
Harshavardhana 0e9124fdbb Merge pull request #820 from harshavardhana/pr_out_add_session_command_first_cut 2015-06-19 21:34:09 -07:00
Harshavardhana 183396ebb1 Add session handling for cp 2015-06-19 21:30:48 -07:00
Harshavardhana 7284c4a767 Add trap function to trap os.Kill and os.Interrupt 2015-06-19 18:45:04 -07:00
Harshavardhana de16a72e29 Add session command, first cut 2015-06-19 17:31:21 -07:00
Harshavardhana fe185941fb Merge pull request #818 from harshavardhana/pr_out_remove_path_join_usage_as_its_not_portable 2015-06-18 11:21:11 -07:00
Harshavardhana f63e913060 Remove path.Join usage as its not portable
Thanks to Mattn <mattn.jp@gmail.com> for inputs
2015-06-18 11:05:26 -07:00
Harshavardhana 7dabe2ea55 Merge pull request #816 from harshavardhana/pr_out_turn_off_boxed_ui_for_update_notification_on_smaller_terminals
Turn off boxed UI for update notification on smaller terminals
2015-06-17 20:38:39 -07:00
Harshavardhana 8b42e6bed6 Turn off boxed UI for update notification on smaller terminals 2015-06-17 20:34:56 -07:00
Harshavardhana 9e85d367df Merge pull request #815 from harshavardhana/pr_out_do_not_reply_back_isbrokensymlink_for_enoent_return_only_if_its_a_symlink 2015-06-17 18:31:17 -07:00
Harshavardhana dc4067314a Do not reply back ISBrokenSymlink{} for ENOENT, return only if its a Symlink
Make a new release
2015-06-17 18:29:20 -07:00
Harshavardhana 64b920c2c8 Update README.md 2015-06-17 14:21:20 -07:00
Harshavardhana 67d9ab98a4 Merge pull request #814 from harshavardhana/pr_out_making_caption_fixed_length_and_bumping_caption_usage_to_18
Making caption fixed length and bumping caption usage to 18%
2015-06-16 21:36:03 -07:00
Harshavardhana b7b626b04e Making caption fixed length and bumping caption usage to 18% 2015-06-16 21:33:57 -07:00
Harshavardhana 3ee1b6b4a8 Merge pull request #813 from harshavardhana/pr_out_remove_git_revision_not_needed
Remove git revision, not needed
2015-06-16 19:35:53 -07:00
Harshavardhana ff7a7d09d5 Remove git revision, not needed 2015-06-16 19:34:16 -07:00
Harshavardhana 9610887b22 Merge pull request #812 from harshavardhana/pr_out_add_more_elaborate_tag_this_time_in_string_epoch_gitrev_format
Add more elaborate tag this time in [STRING-EPOCH-GITREV] format
2015-06-16 18:31:47 -07:00
Harshavardhana 0ea95ce6eb Add more elaborate tag this time in [STRING-EPOCH-GITREV] format 2015-06-16 18:30:34 -07:00
Harshavardhana bb790ed1fd Merge pull request #811 from harshavardhana/pr_out_add_tag_date_with_make_go_formatted_with_git_check_format_ref_standards 2015-06-16 17:49:22 -07:00
Harshavardhana 72f15dbffe Add tag date with make.go formatted with git-check-format-ref standards 2015-06-16 17:42:33 -07:00
Harshavardhana ece37013aa Update README.md 2015-06-16 16:10:51 -07:00
Harshavardhana 88c637326c Update README.md 2015-06-16 16:08:03 -07:00
Harshavardhana bbce2295cf Update README.md 2015-06-16 16:07:08 -07:00
Harshavardhana 2f8c574a70 Update README.md 2015-06-16 15:59:52 -07:00
Harshavardhana 78334d34e0 Merge pull request #810 from harshavardhana/pr_out_code_cleanup_and_readability_for_mc 2015-06-16 14:19:58 -07:00
Harshavardhana dbb35c185a Code cleanup and readability for mc 2015-06-16 14:17:01 -07:00
Harshavardhana 976ceba27c Merge pull request #809 from harshavardhana/pr_out_update_to_new_changes_in_minio_go
Update to new changes in minio-go
2015-06-16 12:35:43 -07:00
Harshavardhana 6f08c452b3 Update to new changes in minio-go 2015-06-16 12:32:39 -07:00
Harshavardhana 757e866b94 Merge pull request #808 from harshavardhana/pr_out_fixup_checkdep_sh 2015-06-16 02:33:20 -07:00
Harshavardhana 6b48655fee Fixup checkdep.sh 2015-06-16 02:32:26 -07:00
Harshavardhana 6222df0e2a Merge pull request #807 from harshavardhana/pr_out_make_sure_to_skip_broken_links 2015-06-16 02:32:08 -07:00
Harshavardhana b7e06060b3 Make sure to skip broken links 2015-06-16 02:30:13 -07:00
Harshavardhana 39886661a4 Merge pull request #806 from harshavardhana/pr_out_trim_caption_for_just_file_names_and_getfixedwidth_for_10_ 2015-06-16 02:13:36 -07:00
Harshavardhana 476e184a90 Trim caption for just file names and getFixedWidth for 10%.
Remove spaces in between unicode characters, these were causing spurious space characters
2015-06-16 02:12:29 -07:00
Harshavardhana 0357efbdef Merge pull request #805 from harshavardhana/pr_out_add_console_rotator 2015-06-16 00:16:10 -07:00
Harshavardhana 11e7f1778d Add console rotator 2015-06-16 00:15:14 -07:00
Harshavardhana e4eb41f747 Merge pull request #804 from harshavardhana/pr_out_move_to_a_more_portable_bar_prefix_approach_from_progress_bar
Move to a more portable bar.Prefix approach from progress bar
2015-06-15 19:54:25 -07:00
Harshavardhana 501eaa9e16 Move to a more portable bar.Prefix approach from progress bar 2015-06-15 19:50:13 -07:00
Harshavardhana a9bfe95b2f Merge pull request #802 from harshavardhana/pr_out_an_attempt_to_fix_windows_caption_behavior_wip 2015-06-15 16:07:08 -07:00
Harshavardhana 2e763fff3f An attempt to fix windows caption behavior 2015-06-15 16:02:22 -07:00
Harshavardhana 0238e8305b Merge pull request #801 from harshavardhana/pr_out_now_printing_makes_sure_to_show_console_after_erasing_current_line 2015-06-15 12:18:22 -07:00
Harshavardhana 318f9add62 Now printing makes sure to show console after erasing current line 2015-06-15 12:16:52 -07:00
Harshavardhana 2b3f975361 Merge pull request #800 from harshavardhana/pr_out_re_arrange_cp_bar_a_bit_for_readablity
Re-arrange cp-bar a bit for readablity
2015-06-15 10:45:18 -07:00
Harshavardhana 70783a187f Re-arrange cp-bar a bit for readablity and rename it to pb.go 2015-06-15 10:43:19 -07:00
Anand Babu (AB) Periasamy 6339dc5ffe Merge pull request #799 from abperiasamy/caption-bug
fix race in pgbar printing
2015-06-15 03:35:14 -07:00
Anand Babu (AB) Periasamy 4df88191c6 fix race in pgbar printing 2015-06-15 03:33:49 -07:00
Anand Babu (AB) Periasamy b2cbef0e36 Merge pull request #798 from abperiasamy/pgbar-firsttime-cursor-movement
do not move/delete console output before printing anything
2015-06-15 02:55:18 -07:00
Anand Babu (AB) Periasamy 2b86af52d6 do not move/delete console output before printing anything 2015-06-15 02:51:41 -07:00
Harshavardhana 064148560c Merge pull request #797 from harshavardhana/pr_out_bring_in_new_changes_from_minio_go
Bring in new changes from minio-go
2015-06-13 22:16:55 -07:00
Harshavardhana 11c3c5e742 Bring in new changes from minio-go 2015-06-13 22:15:50 -07:00
Harshavardhana a295b752e5 Merge pull request #796 from harshavardhana/pr_out_convert_all_errors_new_and_fmt_errorf_to_typed_errors 2015-06-13 21:38:29 -07:00
Harshavardhana c04acf4d50 Convert all errors.New and fmt.Errorf to typed errors 2015-06-13 21:36:42 -07:00
Harshavardhana 4b99854f4d Merge pull request #795 from harshavardhana/pr_out_handle_broken_symlinks
Handle broken symlinks
2015-06-13 20:31:36 -07:00
Harshavardhana 112f4ec56c Handle broken symlinks 2015-06-13 20:30:47 -07:00
Harshavardhana 9ca8ffc6e8 Merge pull request #794 from harshavardhana/pr_out_use_more_ascii_escape_sequences_to_redraw_current_lines_with_caption 2015-06-13 20:16:52 -07:00
Harshavardhana 2a1ed46929 Use more ascii escape sequences to redraw current lines with caption 2015-06-13 20:15:03 -07:00
Harshavardhana 868a7c898c Merge pull request #793 from harshavardhana/pr_out_simplify_cp_and_sync_routines_don_t_forget_to_close_syncqueue_channel_ 2015-06-13 20:06:27 -07:00
Harshavardhana 0935a7b3d3 Simplify cp and sync routines - don't forget to close syncQueue channel :-) 2015-06-13 20:05:03 -07:00
Harshavardhana 9e3487fa56 Merge pull request #792 from harshavardhana/pr_out_pass_in_variables_into_go_routines
Pass in variables into go routines
2015-06-13 19:31:34 -07:00
Harshavardhana 13c3bfefef Pass in variables into go routines 2015-06-13 19:28:12 -07:00
Frederick F. Kautz IV 4792fd1172 Merge pull request #791 from fkautz/pr_out_testing_to_see_if_the_error_is_an_errorresponse_if_it_isn_t_just_pass_as_is 2015-06-12 21:52:19 -07:00
Frederick F. Kautz IV ed7b8a092c Testing to see if the error is an errorresponse. If it isn't, just pass as is. 2015-06-12 21:50:30 -07:00
Harshavardhana b308a5025f Merge pull request #789 from harshavardhana/pr_out_handle_message_for_windows_for_update_command
Handle message for windows for update command
2015-06-12 19:27:56 -07:00
Harshavardhana 715c7e507b Handle message for windows for update command 2015-06-12 19:16:27 -07:00
Harshavardhana a6163f603e Add missing var error for windows, minor change pushing in 2015-06-12 18:44:05 -07:00
Harshavardhana c2eebb193c Merge pull request #788 from harshavardhana/pr_out_add_windows_specific_path_normalizer
Add windows specific path normalizer
2015-06-12 18:42:11 -07:00
Harshavardhana f9d8fd5128 Add windows specific path normalizer 2015-06-12 18:40:45 -07:00
Harshavardhana 5b2b90bebe Merge pull request #787 from harshavardhana/pr_out_fix_mcconfigdir_path_test_for_windows 2015-06-12 15:50:11 -07:00
Harshavardhana cbe93ae9c3 Fix mcConfigDir path test for windows 2015-06-12 15:48:42 -07:00
Harshavardhana c06a43c0d7 Merge pull request #786 from harshavardhana/pr_out_add_proper_error_output_in_make_go
Add proper error output in make.go
2015-06-12 15:39:21 -07:00
Harshavardhana 51e40a88fd Add proper error output in make.go 2015-06-12 15:37:51 -07:00
Harshavardhana 46fb22e84d Merge pull request #785 from harshavardhana/pr_out_windows_fix_for_directory_crawling 2015-06-12 12:17:56 -07:00
Harshavardhana d6a651e334 Windows fix for directory crawling 2015-06-12 12:16:09 -07:00
Harshavardhana 3df6ec9c79 Merge pull request #784 from harshavardhana/pr_out_ignore_readlink_errors 2015-06-11 22:39:43 -07:00
Harshavardhana 05f94b258d Ignore readlink errors 2015-06-11 22:38:29 -07:00
Harshavardhana 1ec3324b06 Merge pull request #783 from harshavardhana/pr_out_add_xml_naming_for_structure_ignore_location_constraint 2015-06-11 21:33:39 -07:00
Harshavardhana 298c3d59de Add XML Naming for structure, ignore location constraint 2015-06-11 21:32:00 -07:00
Harshavardhana ad787da3cd Merge pull request #782 from harshavardhana/pr_out_handle_windows_path_and_do_not_perform_translation_for_url_type_of_filesystem 2015-06-11 21:12:08 -07:00
Harshavardhana 1516549e66 Handle windows path and do not perform translation for url type of filesystem 2015-06-11 21:10:49 -07:00
Harshavardhana 114299070c Merge pull request #781 from harshavardhana/pr_out_make_sure_the_appversion_set_is_a_proper_formatted_time_string 2015-06-11 20:42:13 -07:00
Harshavardhana 4ddf93baa5 Make sure the AppVersion set is a proper formatted time string 2015-06-11 20:40:58 -07:00
Harshavardhana 08c14df9df Merge pull request #780 from harshavardhana/pr_out_add_gomaxprocs_default_tp_numcpus_and_update_version
Add gomaxprocs default to NumCPUs() and update version
2015-06-11 19:08:32 -07:00
Harshavardhana 7a3bfcfac5 Add gomaxprocs default to NumCPUs() and update version 2015-06-11 19:07:04 -07:00
Harshavardhana d18cee70ee Merge pull request #779 from harshavardhana/pr_out_move_away_from_using_pointers_for_cpurls
Move away from using pointers for cpURLs
2015-06-11 19:05:56 -07:00
Harshavardhana d52bbf6134 Move away from using pointers for cpURLs 2015-06-11 19:03:33 -07:00
Harshavardhana 84da2396c7 Update to new minio-go 2015-06-11 15:51:27 -07:00
Harshavardhana 388c443010 Merge pull request #778 from harshavardhana/pr_out_move_to_upstream_progress_bar_deleting_our_fork_needed_patches_merged_by_upstream_maintainer 2015-06-11 14:50:02 -07:00
Harshavardhana eb5d6ab84f Move to upstream progress bar, deleting our fork - needed patches merged by upstream maintainer 2015-06-11 14:47:18 -07:00
Harshavardhana 921153341b Merge pull request #777 from harshavardhana/pr_out_add_errinvalidtheme_and_before_should_reply_back_to_cli_as_error 2015-06-11 14:38:58 -07:00
Harshavardhana dae79df316 Add errInvalidTheme and .Before should reply back to cli as error 2015-06-11 14:36:35 -07:00
Harshavardhana 0f14199a2b Merge pull request #776 from harshavardhana/pr_out_use_sync_pool_for_config
use sync.Pool for config
2015-06-11 11:52:38 -07:00
Harshavardhana 147a3d5a70 use sync.Pool for config 2015-06-11 11:50:54 -07:00
Harshavardhana 8d118c0b1f Merge pull request #775 from harshavardhana/pr_out_use_url_separator_everywhere_that_is_needed
Use url.Separator everywhere that is needed
2015-06-10 21:55:19 -07:00
Harshavardhana 08d38fb7da Use url.Separator everywhere that is needed 2015-06-10 21:54:05 -07:00
Harshavardhana e6ad28079b Merge pull request #774 from harshavardhana/pr_out_remove_delimiter_constant_use_c_hosturl_separator 2015-06-10 21:33:36 -07:00
Harshavardhana 81b417bc53 Remove delimiter constant, use c.hostURL.Separator 2015-06-10 21:32:19 -07:00
Harshavardhana 2c92125fb3 Merge pull request #773 from harshavardhana/pr_out_no_need_to_set_regions_through_s3_go_library_does_it_automatically 2015-06-10 21:25:59 -07:00
Harshavardhana 8bc17e5b2b No need to set regions through s3.go, library does it automatically 2015-06-10 21:24:03 -07:00
Harshavardhana 6cd52821c2 Merge pull request #772 from harshavardhana/pr_out_minor_changes_to_minio_go_library_update_it_here_also_update_version_go 2015-06-10 21:18:05 -07:00
Harshavardhana 7ae885fdcd Minor changes to minio-go library, update it here - also update version.go 2015-06-10 21:16:31 -07:00
Frederick F. Kautz IV 6b05292865 Merge pull request #771 from fkautz/pr_out_mc_uploads_with_default_application_octet_stream 2015-06-10 20:19:07 -07:00
Frederick F. Kautz IV 10f995d723 mc uploads with default application/octet-stream 2015-06-10 20:17:52 -07:00
Harshavardhana 890983ea5f Merge pull request #770 from harshavardhana/pr_out_use_yielder_inside_cmd_cp_and_sync
Use yielder inside cmd cp and sync
2015-06-10 19:56:07 -07:00
Harshavardhana 1fdb689f16 Use yielder inside cmd cp and sync 2015-06-10 19:54:42 -07:00
Anand Babu (AB) Periasamy 465973f360 yielding reader 2015-06-10 19:29:01 -07:00
Frederick F. Kautz IV 788b860827 Merge pull request #769 from fkautz/pr_out_renaming_getobject_to_getpartialobject 2015-06-10 19:27:47 -07:00
Frederick F. Kautz IV 36552f4d03 Renaming GetObject to GetPartialObject 2015-06-10 19:24:44 -07:00
Harshavardhana e7ec83d94a Merge pull request #768 from harshavardhana/pr_out_update_docs_remove_stale_documentation
Update docs/* remove stale documentation
2015-06-10 18:36:25 -07:00
Harshavardhana 8befc50050 Update docs/* remove stale documentation 2015-06-10 18:34:46 -07:00
Harshavardhana 8ad8fde146 Merge pull request #767 from harshavardhana/pr_out_add_tests_for_sync_command
Add tests for sync command
2015-06-10 18:09:30 -07:00
Harshavardhana c0570b41fe Add tests for sync command 2015-06-10 18:08:17 -07:00
Harshavardhana 474380a051 Merge pull request #766 from harshavardhana/pr_out_make_channels_bufferred_upto_10000_for_cp_and_sync_to_fill_in_during_prepareurls_stage
Make channels bufferred upto 10000 for cp and sync to fill in during prepareURLs stage
2015-06-10 17:33:25 -07:00
Harshavardhana 9a06671ac7 Make channels bufferred upto 10000 for cp and sync to fill in during prepareURLs stage 2015-06-10 17:26:58 -07:00
Harshavardhana 76322c3f90 Merge pull request #765 from harshavardhana/pr_out_finally_sync_command_works_as_expected 2015-06-10 16:19:46 -07:00
Harshavardhana 1bbbe933ff Finally sync command works as expected 2015-06-10 16:18:30 -07:00
Harshavardhana 0e91aa8a50 Merge pull request #764 from harshavardhana/pr_out_handle_errors_properly_with_sync_command 2015-06-10 13:48:35 -07:00
Harshavardhana ddeb132eb9 Handle errors properly with sync command 2015-06-10 13:47:23 -07:00
Harshavardhana 3b0c7e168b Merge pull request #763 from harshavardhana/pr_out_minor_change_print_proper_errors_for_cmd_sync
Minor change print proper errors for cmd-sync
2015-06-10 10:48:46 -07:00
Harshavardhana c0bd41f446 Minor change print proper errors for cmd-sync 2015-06-10 10:46:00 -07:00
Harshavardhana d4e0bb275f Merge pull request #762 from harshavardhana/pr_out_update_to_new_error_related_changes_in_minio_go
update to new error related changes in minio-go
2015-06-10 00:43:15 -07:00
Harshavardhana 1bb4aa62ea update to new error related changes in minio-go 2015-06-10 00:39:04 -07:00
Harshavardhana 9910b878c7 Merge pull request #761 from harshavardhana/pr_out_update_new_video_link 2015-06-09 23:07:11 -07:00
Harshavardhana 6e395d3bf5 Update new video link 2015-06-09 23:06:49 -07:00
Anand Babu (AB) Periasamy b8f156d2ad Merge pull request #760 from abperiasamy/put-targets-bug
fixed syncronization bug in put targets function
2015-06-09 20:45:23 -07:00
Anand Babu (AB) Periasamy 9aaa614ff5 fixed syncronization bug in put targets function 2015-06-09 20:40:27 -07:00
Harshavardhana 87ad3d5e43 Merge pull request #759 from harshavardhana/pr_out_do_not_exit_on_ls_error
Do not exit on ls error
2015-06-09 19:38:27 -07:00
Harshavardhana 6997a953ee Do not exit on ls error 2015-06-09 19:17:34 -07:00
Harshavardhana 87dc4647ac Merge pull request #757 from harshavardhana/pr_out_sync_command_now_works 2015-06-09 11:42:50 -07:00
Harshavardhana e76ac3978c Sync command now works 2015-06-09 11:41:26 -07:00
Harshavardhana 77b4ec5e7e Merge pull request #756 from harshavardhana/pr_out_all_methods_use_now_target2client_source2client_url2client_helpers
All methods use now target2Client, source2Client, url2Client helpers
2015-06-09 11:09:23 -07:00
Harshavardhana 95f61bd6d4 Update all tests with new changes 2015-06-09 11:08:01 -07:00
Harshavardhana 168926fa06 All methods use now target2Client, source2Client, url2Client helpers 2015-06-09 10:37:48 -07:00
Harshavardhana f34742b539 Add URL() method 2015-06-09 10:37:20 -07:00
Anand Babu (AB) Periasamy 9b10c3fb68 Sync command 2015-06-08 22:58:28 -07:00
Harshavardhana 600331ddc9 Merge pull request #754 from harshavardhana/pr_out_rename_all_http_references_to_https 2015-06-08 21:15:13 -07:00
Harshavardhana 127027e1f8 Rename all http references to https 2015-06-08 21:13:12 -07:00
Harshavardhana 7eac8f0eca Merge pull request #753 from harshavardhana/pr_out_fix_updates_to_not_depend_on_lastmodified_header_use_a_json_to_indicate_latest_build_and_path
Fix updates to not depend on LastModified header, use a json to indicate latest build and path
2015-06-08 16:48:49 -07:00
Harshavardhana 4bf5b19274 Fix updates to not depend on LastModified header, use a json to indicate latest build and path 2015-06-08 16:47:48 -07:00
Harshavardhana efff048d84 Merge pull request #752 from harshavardhana/pr_out_more_prefix_url_cleanup
More prefix url cleanup
2015-06-08 11:49:43 -07:00
Harshavardhana e53f009a9d More prefix url fixes, all combinations work as intended 2015-06-08 11:47:28 -07:00
Harshavardhana 71b34e4347 Add some comments in ls.go 2015-06-08 02:17:22 -07:00
Harshavardhana 58d832bcd0 Update all dependencies 2015-06-08 01:44:57 -07:00
Harshavardhana 6c7dbcaf4e More prefix url cleanup 2015-06-07 02:55:29 -07:00
Harshavardhana 9f8040f645 Merge pull request #751 from harshavardhana/pr_out_move_diff_also_away_from_prefixed_url 2015-06-06 21:58:05 -07:00
Harshavardhana 98a5cf648b Move diff also away from prefixed url 2015-06-06 21:49:50 -07:00
Harshavardhana 3ee63f8d1b Merge pull request #750 from harshavardhana/pr_out_now_fs_behaves_similar_to_s3_style_delimited_output 2015-06-06 21:24:24 -07:00
Harshavardhana e95c3bd3e8 Now fs behaves similar to s3 style delimited output 2015-06-06 21:23:33 -07:00
Harshavardhana bc7ff1c875 Merge pull request #749 from harshavardhana/pr_out_add_version_to_repo_to_make_a_new_release_just_do_make_release_to_build_the_binary
Add version to repo, to make a new release just do "make release" to build the binary
2015-06-06 19:52:39 -07:00
Harshavardhana dd7673e4dd Add version to repo, to make a new release just do "make release" to build the binary 2015-06-06 19:51:39 -07:00
Harshavardhana 7c37a34064 Merge pull request #748 from harshavardhana/pr_out_now_alias_provides_consistent_list_output 2015-06-06 19:30:13 -07:00
Harshavardhana bdff69f7b4 Now alias:... provides consistent list output 2015-06-06 19:29:02 -07:00
Harshavardhana f09dba2333 Merge pull request #747 from harshavardhana/pr_out_fix_bug_in_recursive_listing_in_mc_update_minio_go
Fix bug in recursive listing in mc, update minio-go
2015-06-06 16:58:26 -07:00
Harshavardhana 911accab45 Fix bug in recursive listing in mc, update minio-go 2015-06-06 16:57:29 -07:00
Anand Babu (AB) Periasamy 9395bb3d52 Merge pull request #746 from abperiasamy/recur-url-prefix
prefix with parent path for dir... case
2015-06-06 15:16:17 -07:00
Anand Babu (AB) Periasamy 4da1d24405 prefix with parent path for dir... case 2015-06-06 15:11:03 -07:00
Harshavardhana e11987dcbe Merge pull request #745 from harshavardhana/pr_out_delimit_fs_output_similar_to_s3_no_special_handling_needed 2015-06-06 12:32:45 -07:00
Harshavardhana 33f4c65349 Delimit fs output similar to s3, no special handling needed 2015-06-06 12:29:12 -07:00
Anand Babu (AB) Periasamy e8254223e9 Merge pull request #744 from abperiasamy/portable-path
portable path separator
2015-06-06 12:06:26 -07:00
Anand Babu (AB) Periasamy 396cb83db0 portable path separator 2015-06-06 12:04:21 -07:00
Harshavardhana fc049a3df8 Merge pull request #743 from harshavardhana/pr_out_make_fs_also_consistent_with_s3_output 2015-06-06 12:00:29 -07:00
Harshavardhana b999e08610 Make fs also consistent with s3 output 2015-06-06 11:58:52 -07:00
Harshavardhana 8e34555067 Merge pull request #742 from harshavardhana/pr_out_return_back_normal_object_names_not_url_s
Return back normal object names not URL's
2015-06-06 11:27:24 -07:00
Harshavardhana 535fb0cae6 Return back normal object names not URL's 2015-06-06 11:25:28 -07:00
Harshavardhana 5f0a89de1d Merge pull request #741 from harshavardhana/pr_out_remove_redundant_date_go_script 2015-06-06 02:10:19 -07:00
Harshavardhana ec23d22584 Remove redundant date.go script 2015-06-06 02:09:12 -07:00
Harshavardhana ee9dfbf723 Merge pull request #737 from harshavardhana/pr_out_moving_to_go_run_make_go_first_cut 2015-06-06 01:22:21 -07:00
Harshavardhana d320b5c0ec Moving to 'go run make.go', all builds are release builds for now 2015-06-06 01:20:39 -07:00
Anand Babu (AB) Periasamy 760e32a2a9 Merge pull request #740 from abperiasamy/rename-register-cmd
rename to registerCmd
2015-06-05 22:20:29 -07:00
Anand Babu (AB) Periasamy 04c09d3ca8 Merge pull request #739 from abperiasamy/cp-sync-recursive-prefix
handle recursive prefix properly for cp and sync as well
2015-06-05 22:17:39 -07:00
Anand Babu (AB) Periasamy 7d7f6c6bb2 handle recursive prefix properly for cp and sync as well 2015-06-05 22:15:24 -07:00
Anand Babu (AB) Periasamy e0eedba4d6 Merge pull request #738 from abperiasamy/recursive-preix
handle recursive prefix properly
2015-06-05 21:52:17 -07:00
Anand Babu (AB) Periasamy 3439ca5fde handle recursive prefix properly 2015-06-05 21:49:33 -07:00
Anand Babu (AB) Periasamy 425b46abab rename to registerCmd 2015-06-05 16:43:27 -07:00
Anand Babu (AB) Periasamy dda0b75a97 Merge pull request #736 from abperiasamy/trim-partial-name
trim partial names for bar caption
2015-06-04 21:04:21 -07:00
Anand Babu (AB) Periasamy c460127fa9 trim partial names for bar caption 2015-06-04 21:01:20 -07:00
Harshavardhana 118d0e56cf Merge pull request #735 from harshavardhana/pr_out_handle_prefixed_recursive_behavior_and_mimick_filesystem_behavior 2015-06-04 19:52:09 -07:00
Harshavardhana 4709af19ab Handle prefixed recursive behavior and mimick filesystem behavior 2015-06-04 19:50:56 -07:00
Anand Babu (AB) Periasamy b2e4ea9d1c Merge pull request #734 from abperiasamy/trim-filename
trim long filenames in progress bar caption
2015-06-04 16:40:58 -07:00
Anand Babu (AB) Periasamy 7ba6bce961 trim long filenames in progress bar caption 2015-06-04 16:37:06 -07:00
Harshavardhana c288a31537 Merge pull request #733 from harshavardhana/pr_out_do_not_attempt_to_restor_while_saving_new_deps
Do not attempt to restor while saving new deps
2015-06-04 16:30:29 -07:00
Harshavardhana c8bf76e9e4 Do not attempt to restor while saving new deps 2015-06-04 16:28:36 -07:00
Harshavardhana 92fe1a98e5 Merge pull request #732 from harshavardhana/pr_out_implement_custom_date_command_for_cross_platform_portability 2015-06-04 12:04:49 -07:00
Harshavardhana b5a940e739 Implement custom date command for cross platform portability 2015-06-04 12:02:49 -07:00
Harshavardhana 11dba09271 Merge pull request #731 from harshavardhana/pr_out_move_everything_from_uint64_to_int64
Move everything from uint64 to int64
2015-06-03 22:23:41 -07:00
Harshavardhana 112adec910 Move everything from uint64 to int64 2015-06-03 22:22:03 -07:00
Harshavardhana ffcf77d000 Merge pull request #730 from abperiasamy/broken-pipe
handle broken pipe for cat
2015-06-03 21:02:42 -07:00
Anand Babu (AB) Periasamy 5ed828f26a handle broken pipe for cat 2015-06-03 19:48:09 -07:00
Harshavardhana f83b99e19f Merge pull request #729 from abperiasamy/silly-opitimization 2015-06-03 15:19:54 -07:00
Anand Babu (AB) Periasamy 1f963c2feb silly optimization 2015-06-03 15:17:51 -07:00
Anand Babu (AB) Periasamy 13d206a38c Merge pull request #728 from vadmeste/pr_out_two_lines_progres_bar
Show the progress bar title in its own dedicated line
2015-06-03 14:59:34 -07:00
Anis Elleuch 4de9d69d17 Avoid showing the progress bar until copying really starts 2015-06-03 22:21:54 +01:00
Anis Elleuch 2f47edb2e3 Show the progress bar title in its own dedicated line 2015-06-03 22:20:35 +01:00
Harshavardhana ca7ef0c5ef Merge pull request #727 from vadmeste/pr_out_show_current_copied_file
Make copying command more informative especially with several source files
2015-06-02 13:18:55 -07:00
Anis Elleuch 0d09189e4a Make copying command more informative especially with several source files 2015-06-02 20:01:27 +01:00
Harshavardhana 15719e3ebd Merge pull request #726 from harshavardhana/pr_out_package_changes_to_minio 2015-06-02 00:51:50 -07:00
Harshavardhana f524e491c2 Package changes to minio 2015-06-01 22:20:16 -07:00
Harshavardhana b954d437aa Merge pull request #725 from harshavardhana/pr_out_bring_new_changes_from_minio_go_to_mc 2015-06-01 21:48:00 -07:00
Harshavardhana 0a44c7454d Bring new changes from minio-go to mc 2015-06-01 21:45:04 -07:00
Harshavardhana 9780e06f64 Merge pull request #724 from harshavardhana/pr_out_why_only_modularize_cmd_do_flags_as_well 2015-05-31 02:02:26 -07:00
Harshavardhana d98b419a6a Why only modularize cmd, do flags as well 2015-05-31 02:01:02 -07:00
Harshavardhana ac1faf4f8c Merge pull request #723 from harshavardhana/pr_out_update_to_new_changes_in_minio_go 2015-05-30 19:58:13 -07:00
Harshavardhana dc48521d20 Update to new changes in minio-go 2015-05-30 19:56:36 -07:00
Anand Babu (AB) Periasamy b12f377461 Merge pull request #722 from abperiasamy/modular-options
further modularize command options
2015-05-30 19:40:07 -07:00
Anand Babu (AB) Periasamy 31d1c25aa7 further modularize command options 2015-05-30 19:39:06 -07:00
Anand Babu (AB) Periasamy 21cb3f3b6d Merge pull request #721 from abperiasamy/ls-alias
alias support for ls
2015-05-30 18:05:10 -07:00
Anand Babu (AB) Periasamy 22da2bab5c alias support for ls 2015-05-30 18:03:34 -07:00
Anand Babu (AB) Periasamy 148da6cef7 Merge pull request #720 from abperiasamy/global-alias
global alias option
2015-05-30 17:50:45 -07:00
Anand Babu (AB) Periasamy fefdbd35ed global alias option 2015-05-30 17:49:08 -07:00
Anand Babu (AB) Periasamy 0cacad1f20 Merge pull request #719 from abperiasamy/doc-reorg
reorg doc strings
2015-05-30 17:42:22 -07:00
Anand Babu (AB) Periasamy 2c1c5254c7 reorg doc strings 2015-05-30 17:33:18 -07:00
Anand Babu (AB) Periasamy 9b0ebd54fc Merge pull request #718 from abperiasamy/remove-retry
remove retry capability
2015-05-30 16:55:16 -07:00
Anand Babu (AB) Periasamy d57fdd909f remove retry capability 2015-05-30 16:53:34 -07:00
Anand Babu (AB) Periasamy 7ee7bad1af Merge pull request #717 from abperiasamy/cp-diff
removed copy-same-object check and some cleanup
2015-05-30 15:44:39 -07:00
Anand Babu (AB) Periasamy 69dbb658e1 removed copy-same-object check and some cleanup 2015-05-30 15:43:32 -07:00
Anand Babu (AB) Periasamy beb5b7af3a Update README.md 2015-05-30 12:40:46 -07:00
Anand Babu (AB) Periasamy 92fb98eb34 Merge pull request #716 from abperiasamy/synchronize-pbbuilder-and-sync
synchronize pb go routine with sync go routines
2015-05-30 12:28:12 -07:00
Anand Babu (AB) Periasamy 4ef1eb0b81 synchronize pb go routine with sync go routines 2015-05-30 12:27:01 -07:00
Anand Babu (AB) Periasamy 6b716bac73 Merge pull request #715 from abperiasamy/intMax
replace intMax with math.Max
2015-05-30 12:25:05 -07:00
Anand Babu (AB) Periasamy 69562deb23 replace intMax with math.Max 2015-05-30 12:16:58 -07:00
Harshavardhana 66767ef962 Merge pull request #714 from harshavardhana/pr_out_update_to_new_changes_in_minio_go 2015-05-29 23:38:06 -07:00
Harshavardhana 3779e3f314 Update to new changes in minio-go 2015-05-29 23:35:43 -07:00
Harshavardhana 0b84e50053 Merge pull request #713 from harshavardhana/pr_out_fix_update_url 2015-05-29 01:33:04 -07:00
Harshavardhana 7c05adb9b3 Fix update URL 2015-05-29 01:30:27 -07:00
Harshavardhana 8920998a99 Merge pull request #711 from abperiasamy/yield-progressbar
yield CPU to progress bar builder
2015-05-29 01:15:05 -07:00
Harshavardhana a8961d6719 Merge pull request #712 from harshavardhana/pr_out_remove_reason_prefix_for_error_prints
Remove Reason: prefix for error prints
2015-05-29 01:15:00 -07:00
Harshavardhana a772ef963b Remove Reason: prefix for error prints 2015-05-29 01:12:56 -07:00
Anand Babu (AB) Periasamy 690bb2d705 yield CPU to progress bar builder 2015-05-29 01:03:26 -07:00
Harshavardhana 3103411e6d Merge pull request #710 from harshavardhana/pr_out_update_to_new_changes_in_minio_go_library_and_make_related_modifications_in_mc
Update to new changes in minio-go library and make related modifications in mc
2015-05-28 19:18:58 -07:00
Harshavardhana aa0347f59b Update to new changes in minio-go library and make related modifications in mc 2015-05-28 19:13:36 -07:00
Harshavardhana 59d4e64dcc Merge pull request #709 from harshavardhana/pr_out_handle_permission_errors_for_progress_bar 2015-05-28 11:08:46 -07:00
Harshavardhana 9da87f5113 Handle permission errors for progress bar 2015-05-28 11:07:20 -07:00
Harshavardhana 87ce028ccc Update README.md 2015-05-27 20:04:25 -07:00
Harshavardhana 07d2b280a9 Update README.md 2015-05-27 19:09:55 -07:00
Harshavardhana d91145cbfd Merge pull request #708 from minio/harshavardhana-patch-1
Update README.md
2015-05-27 17:54:45 -07:00
Harshavardhana a50aa2406f Update README.md 2015-05-27 17:46:25 -07:00
Harshavardhana 545dd1e45a Merge pull request #707 from minio/harshavardhana-go-installation
Create INSTALLGO.md
2015-05-27 17:42:50 -07:00
Harshavardhana 230235e0eb Create INSTALLGO.md 2015-05-27 17:39:51 -07:00
Harshavardhana 23d7be0f61 Merge pull request #706 from harshavardhana/pr_out_update_cmd_options_with_new_updated_readme_md 2015-05-27 16:59:19 -07:00
Harshavardhana 852590012d Update cmd-options with new updated README.md 2015-05-27 16:56:47 -07:00
Harshavardhana 512a52bcfc Merge pull request #705 from harshavardhana/pr_out_add_stderr_to_support_piped_nocolor_output
Add stderr to support piped nocolor output
2015-05-27 16:53:02 -07:00
Harshavardhana 8f52126efb Merge pull request #704 from minio/harshavardhana-readme-changes
Update README.md
2015-05-27 16:50:57 -07:00
Harshavardhana e75adf8363 Update README.md 2015-05-27 16:48:22 -07:00
Harshavardhana 8422db004c Add stderr to support piped nocolor output 2015-05-27 15:40:41 -07:00
Harshavardhana 274dae59f3 Merge pull request #703 from harshavardhana/pr_out_fix_a_nil_reference_remove_erroneous_usage_of_url_parse_use_client_parse_unexport_progress_method 2015-05-27 15:33:53 -07:00
Harshavardhana df176c30a8 Fix a nil reference remove erroneous usage of url.Parse() use client.Parse(), unexport progress() method 2015-05-27 15:32:17 -07:00
Harshavardhana d80f63ea38 Merge pull request #702 from harshavardhana/pr_out_ignore_non_regular_files_after_following_the_file 2015-05-27 13:44:56 -07:00
Harshavardhana 0edf9e2c59 Ignore non regular files after following the file 2015-05-27 13:43:20 -07:00
Harshavardhana 3d43576e39 Merge pull request #701 from vadmeste/pr_out_fix_sync_cmd_with_single_core
Fix sync cmd with single CPU core
2015-05-27 11:28:49 -07:00
Anis Elleuch a00091ffee Fix sync cmd with single CPU core 2015-05-27 18:51:39 +01:00
Anand Babu (AB) Periasamy d977f208ba Merge pull request #700 from abperiasamy/countlock
new countlocker to balance progress bar and copy routines
2015-05-27 04:12:46 -07:00
Anand Babu (AB) Periasamy 98299b267e new countlocker to balance progress bar and copy routines 2015-05-27 04:10:51 -07:00
Harshavardhana ee8d608690 Merge pull request #699 from harshavardhana/pr_out_command_diff_now_properly_supports_recursive_diff 2015-05-26 19:23:05 -07:00
Harshavardhana 0674ce8085 Command diff now properly supports recursive diff 2015-05-26 19:21:58 -07:00
Harshavardhana a65f431004 Handle symlinks by making them behave like hardlinks 2015-05-26 19:06:29 -07:00
Harshavardhana 0d03b7838f Update to new changes in minio-go related to userAgent 2015-05-26 18:03:06 -07:00
Harshavardhana eac7e5c192 Merge pull request #698 from harshavardhana/pr_out_implement_console_fatals_errors_infos_prints_for_structure_input_and_printing 2015-05-26 18:00:50 -07:00
Harshavardhana 25f847b3b6 Implement console.Fatals, Errors, Infos, Prints for structure input and printing 2015-05-26 17:59:35 -07:00
Harshavardhana a1f24bdc61 Merge pull request #697 from vadmeste/pr_out_fix_cp_hang_when_quiet_enabled
Fix cp cmd freeze when quiet enabled
2015-05-26 14:05:40 -07:00
Anis Elleuch 600a55d369 Fix cp cmd freeze when quiet enabled 2015-05-26 22:01:54 +01:00
Harshavardhana 3e24f7ae21 Merge pull request #696 from harshavardhana/pr_out_update_mc_to_new_changes_in_minio_go_related_to_time_formatting
Update mc to new changes in minio-go related to time formatting
2015-05-25 20:18:02 -07:00
Harshavardhana e6e563d599 Update mc to new changes in minio-go related to time formatting 2015-05-25 20:16:46 -07:00
Harshavardhana 76746687c0 Merge pull request #695 from harshavardhana/pr_out_add_barmsg_to_carry_error_method_to_purge_erroneous_size_upon_cp_error 2015-05-25 12:43:13 -07:00
Harshavardhana 947b2b8d67 Add barMsg to carry Error() method to purge erroneous size upon cp error 2015-05-25 12:41:57 -07:00
Harshavardhana c3eeee74e6 Handle too many open files, this time during reader() not being closed 2015-05-25 12:33:33 -07:00
Harshavardhana 7a4100410c Merge pull request #694 from harshavardhana/pr_out_change_range_to_simpler_for_loop_range_over_array_of_interfaces_doesn_t_seem_to_work 2015-05-25 11:37:05 -07:00
Harshavardhana 76c3345f47 Change range to simpler for loop, range over array of interfaces{} doesn't seem to work 2015-05-25 11:30:48 -07:00
Harshavardhana 8ecd5d300b Merge pull request #693 from harshavardhana/pr_out_bring_back_support_for_formatted_strings 2015-05-24 19:26:19 -07:00
Harshavardhana 5515e627d4 Bring back support for Formatted strings 2015-05-24 19:23:31 -07:00
Anand Babu (AB) Periasamy 902ea723d7 Merge pull request #692 from abperiasamy/httptrace
http tracing improvements
2015-05-24 19:12:39 -07:00
Anand Babu (AB) Periasamy a3601baf8e http tracing improvements 2015-05-24 19:07:55 -07:00
Harshavardhana 49abf7579b Merge pull request #691 from harshavardhana/pr_out_add_progress_bar_as_a_new_theme_element 2015-05-24 14:31:46 -07:00
Harshavardhana 3dd6b53c55 Add progress bar as a new theme element 2015-05-24 14:30:28 -07:00
Harshavardhana b88b4ee917 Merge pull request #690 from harshavardhana/pr_out_add_missing_string_method_for_errormessage_struct_as_well 2015-05-24 13:14:35 -07:00
Harshavardhana eeb71d212a Add missing String() method for ErrorMessage struct as well 2015-05-24 13:13:28 -07:00
Harshavardhana a532b6528f Merge pull request #689 from harshavardhana/pr_out_remove_console_to_depend_on_its_own_structures_instead_let_it_deal_with_interface_ 2015-05-24 13:02:07 -07:00
Harshavardhana 192285c2af Remove console to depend on its own structures, instead let it deal with interface{} 2015-05-24 12:58:30 -07:00
Anand Babu (AB) Periasamy 85f5689013 Merge pull request #688 from abperiasamy/regex-redact-auth
regex based auth keys redact
2015-05-23 20:06:02 -07:00
Anand Babu (AB) Periasamy 64c890498f regex based auth keys redact 2015-05-23 20:04:51 -07:00
Anand Babu (AB) Periasamy ff9087fc01 Merge pull request #687 from abperiasamy/accesskey
default access and secret key notice
2015-05-23 19:01:30 -07:00
Anand Babu (AB) Periasamy d7fbef2ba5 default access and secret key notice 2015-05-23 19:00:06 -07:00
Harshavardhana 39d4d3b3f9 Merge pull request #686 from harshavardhana/pr_out_move_mc_to_minio_go_from_objectstorage_go 2015-05-23 16:13:54 -07:00
Harshavardhana 9c136efa4d Move mc to minio-go from objectstorage-go 2015-05-23 16:10:58 -07:00
Harshavardhana a8a61c982b Merge pull request #684 from harshavardhana/pr_out_handle_0byte_file_downloads_properly 2015-05-23 13:02:34 -07:00
Harshavardhana 8b0f9b7018 Handle 0byte file downloads properly 2015-05-23 13:01:01 -07:00
Harshavardhana f87363a9f0 Merge pull request #683 from harshavardhana/pr_out_update_to_new_changes_in_objectstorage_go 2015-05-23 12:17:25 -07:00
Harshavardhana d2bfe75bee Update to new changes in objectstorage-go 2015-05-23 11:59:30 -07:00
Harshavardhana 4782e2663f Merge pull request #682 from harshavardhana/pr_out_add_contributors_file 2015-05-23 11:49:30 -07:00
Harshavardhana 70d58a8fdf Add contributors file 2015-05-23 11:44:40 -07:00
Harshavardhana 46ea9c57c6 Merge pull request #681 from harshavardhana/pr_out_add_recursive_listing_with_s3_ 2015-05-22 19:54:57 -07:00
Harshavardhana b4649291f1 Add recursive listing with s3:... 2015-05-22 19:51:56 -07:00
Harshavardhana 380807ad59 Merge pull request #680 from harshavardhana/pr_out_on_windows_display_directories_with_forward_slash_and_also_interpret_prefixes 2015-05-22 19:34:21 -07:00
Harshavardhana 5ce6cc8e37 On windows display directories with forward slash and also interpret prefixes 2015-05-22 19:33:26 -07:00
Harshavardhana a2cb6eacb0 Merge pull request #679 from harshavardhana/pr_out_fix_missing_work_from_diff_command 2015-05-22 18:41:49 -07:00
Harshavardhana 429ff61174 Fix missing work from diff command 2015-05-22 18:40:46 -07:00
Harshavardhana 146ff6fed3 Merge pull request #678 from harshavardhana/pr_out_refactoring_console_printing_style_supports_json_even_for_error_messages_now_fixes_418 2015-05-22 18:34:16 -07:00
Harshavardhana 54d0f9c553 Refactoring console printing style, supports --json even for error messages now - fixes #418 2015-05-22 18:27:07 -07:00
Harshavardhana 190afa70a1 Merge pull request #676 from harshavardhana/pr_out_move_debug_prints_back_into_console 2015-05-21 22:55:32 -07:00
Harshavardhana edb8381400 Refactor debugging output, implement --json output currently only supported on 'ls' 2015-05-21 22:30:32 -07:00
Harshavardhana b80394c842 Merge pull request #675 from harshavardhana/pr_out_break_diff_into_simpler_functions 2015-05-21 20:41:39 -07:00
Harshavardhana d04f63c9eb Break diff into simpler functions 2015-05-21 20:40:14 -07:00
Harshavardhana f448f1222e Merge pull request #674 from harshavardhana/pr_out_fix_diff_handling_of_non_existant_files_from_source_and_target 2015-05-21 20:33:52 -07:00
Harshavardhana fffb947e66 Fix diff handling of non-existant files from source and target 2015-05-21 20:32:29 -07:00
Harshavardhana 7e418e64e8 Merge pull request #673 from harshavardhana/pr_out_fix_a_windows_url_object_to_string_conversion_and_add_relevant_tests 2015-05-21 19:11:32 -07:00
Harshavardhana 1297d36580 Fix a windows URL object to String() conversion, and add relevant tests 2015-05-21 19:06:34 -07:00
Harshavardhana 24803e108b Merge pull request #669 from vadmeste/pr_out_fix_colored_output_for_windows 2015-05-21 18:38:44 -07:00
Harshavardhana 3d8ae39803 Merge pull request #672 from harshavardhana/pr_out_reorder_options_print_only_error_messages 2015-05-21 18:09:43 -07:00
Harshavardhana aeaf8d4055 Reorder options, print only error messages 2015-05-21 18:08:12 -07:00
Harshavardhana 0f4f59c1a0 Merge pull request #671 from harshavardhana/pr_out_expand_aliasnames_honoring_ 2015-05-21 17:15:57 -07:00
Harshavardhana b4d64badc7 Expand aliasnames honoring "/" 2015-05-21 17:14:39 -07:00
Harshavardhana 1d676a25c6 Merge pull request #670 from harshavardhana/pr_out_finish_object_handlers_for_mc_commands_updated_relevant_tests_respectively 2015-05-21 16:54:10 -07:00
Harshavardhana a0177fc1fe Finish object handlers for mc commands, updated relevant tests respectively 2015-05-21 16:52:25 -07:00
Anis Elleuch 1c85ce6c69 Fix output coloring in Windows Command Prompt 2015-05-21 23:34:59 +01:00
Harshavardhana c086903519 Merge pull request #668 from harshavardhana/pr_out_add_typed_test_with_cp 2015-05-21 15:01:30 -07:00
Harshavardhana e5ede4635d Add typeD test with cp 2015-05-21 14:59:18 -07:00
Harshavardhana 386b511544 Merge pull request #667 from harshavardhana/pr_out_implement_s3_module_tests_for_objectoperations
Implement s3 module tests for objectOperations
2015-05-21 12:19:03 -07:00
Harshavardhana 2fc0e6fa1f Implement s3 module tests for objectOperations 2015-05-21 12:11:31 -07:00
Harshavardhana 2396778818 Merge pull request #666 from harshavardhana/pr_out_update_to_new_changes_in_objectstorage_go 2015-05-21 01:43:20 -07:00
Harshavardhana ab943b9956 Update to new changes in objectstorage-go 2015-05-21 01:38:11 -07:00
Harshavardhana 03bd8942f4 Merge pull request #665 from harshavardhana/pr_out_add_s3_module_tests_for_bucketoperations 2015-05-21 01:36:42 -07:00
Harshavardhana ec2124efc1 Add s3 module tests for BucketOperations 2015-05-21 01:34:34 -07:00
Harshavardhana 607b39222c Merge pull request #664 from harshavardhana/pr_out_improve_tests_add_setupsuite_and_teardownsuite
Improve tests add SetUpSuite and TearDownSuite
2015-05-21 01:21:54 -07:00
Harshavardhana 1e924378cf Improve tests add SetUpSuite and TearDownSuite 2015-05-21 00:58:12 -07:00
Harshavardhana 12f0a396a6 Merge pull request #663 from harshavardhana/pr_out_implement_cp_tests 2015-05-20 21:46:33 -07:00
Harshavardhana 1a319b80ad Implement cp tests
-- update bar.Total with atomic.AddInt64
-- expose console mutex Lock/Unlock()
-- send errors in cp over channels
2015-05-20 21:43:58 -07:00
Harshavardhana 94ad5934c8 Merge pull request #662 from harshavardhana/pr_out_change_closed_brackets_to_quote_characters_and_remove_brackets_for_reason
Change closed brackets to quote characters and remove brackets for Reason
2015-05-20 20:52:58 -07:00
Harshavardhana 26fbc3bc20 Change closed brackets to quote characters and remove brackets for Reason 2015-05-20 20:51:44 -07:00
Harshavardhana ca26714a0d Merge pull request #661 from harshavardhana/pr_out_implement_cat_tests 2015-05-20 19:56:12 -07:00
Harshavardhana e0e860588a Implement cat tests 2015-05-20 19:54:34 -07:00
Harshavardhana 72a9d5c5c8 Merge pull request #660 from harshavardhana/pr_out_fix_stat_url_sent_back_on_stat_ 2015-05-20 19:42:02 -07:00
Harshavardhana 1c899e5059 Fix stat URL sent back on Stat() 2015-05-20 19:40:30 -07:00
Harshavardhana afe89bc44e Merge pull request #659 from harshavardhana/pr_out_implement_diff_tests 2015-05-20 18:40:24 -07:00
Harshavardhana b2ab1d6bff Implement diff tests 2015-05-20 18:29:40 -07:00
Harshavardhana af3d8c4701 Implement ls tests 2015-05-20 18:29:40 -07:00
Harshavardhana 1c7a9f5d48 Merge pull request #658 from harshavardhana/pr_out_add_new_tests_for_common_methods 2015-05-20 17:08:20 -07:00
Harshavardhana b94e67e57f Add new tests for common methods, make necessary changes to support testing config file creation 2015-05-20 17:04:42 -07:00
Harshavardhana 7878be2cc9 Merge pull request #657 from harshavardhana/pr_out_update_to_new_changes_in_multipart_handling_in_objectstorage_go 2015-05-20 14:38:58 -07:00
Harshavardhana 6d9872d26e Update to new changes in multipart handling in objectstorage-go 2015-05-20 14:35:31 -07:00
Harshavardhana b4c4300e2c Merge pull request #656 from harshavardhana/pr_out_complete_fs_tests_for_objectrange_and_list_recursive 2015-05-20 11:52:29 -07:00
Harshavardhana 31e24bfb29 Complete fs tests for objectRange and List recursive 2015-05-20 11:45:27 -07:00
Harshavardhana 9041b12d72 Merge pull request #655 from harshavardhana/pr_out_remove_frivolous_newlines_from_diff 2015-05-20 11:22:35 -07:00
Harshavardhana bb374980eb Remove frivolous newlines from diff 2015-05-20 11:16:50 -07:00
Harshavardhana 7f9c241acf Merge pull request #654 from harshavardhana/pr_out_re_arrange_command_definitions_in_order_of_cli_command_ordering 2015-05-20 02:54:56 -07:00
Harshavardhana c5435ee854 Re-arrange command definitions, in order of cli command ordering 2015-05-20 02:52:08 -07:00
Harshavardhana 913f63144d Merge pull request #653 from harshavardhana/pr_out_simplify_listing_recursively_into_one_function_diff_now_supports_filename_directory_style
Simplify listing recursively into one function, diff now supports <filename> <directory> style
2015-05-20 02:46:35 -07:00
Harshavardhana dcccafacbe Simplify listing recursively into one function, diff now supports <filename> <directory> style 2015-05-20 02:44:15 -07:00
Harshavardhana c8a60e3781 Change diff command properly to send messages over channels 2015-05-20 00:56:10 -07:00
Harshavardhana 55d039d122 Merge pull request #652 from harshavardhana/pr_out_if_target_exists_skip_for_both_sync_and_cp 2015-05-19 19:39:57 -07:00
Harshavardhana f8fdfced8f If target exists skip for both sync and cp 2015-05-19 19:23:40 -07:00
Anand Babu (AB) Periasamy 7213aec662 Merge pull request #651 from abperiasamy/diff-command
diff command for mc
2015-05-19 19:00:23 -07:00
Anand Babu (AB) Periasamy 726780c79d diff command for mc 2015-05-19 18:57:21 -07:00
Harshavardhana f681700365 Merge pull request #650 from harshavardhana/pr_out_final_working_full_utf_8_support 2015-05-19 17:36:12 -07:00
Harshavardhana 201e6eb78a Final working full utf-8 support 2015-05-19 17:35:03 -07:00
Harshavardhana 29bdbaa77f Merge pull request #649 from harshavardhana/pr_out_s3_minio_now_take_different_types_of_encoded_characters 2015-05-19 16:49:37 -07:00
Harshavardhana 1aaf37cb87 S3/Minio now take different types of encoded characters 2015-05-19 16:40:34 -07:00
Harshavardhana 9fdc8448a7 Merge pull request #648 from harshavardhana/pr_out_cleanup_fs_tests 2015-05-19 12:38:26 -07:00
Harshavardhana e0e52cfe05 Cleanup fs tests 2015-05-19 12:37:23 -07:00
Harshavardhana 6bb208ed9d Merge pull request #647 from harshavardhana/pr_out_simplify_getobject_putobject_to_not_use_md5sum_for_now 2015-05-19 12:31:47 -07:00
Harshavardhana fc660f1350 Simplify GetObject, PutObject to not use md5sum for now. 2015-05-19 12:29:52 -07:00
Harshavardhana 09b9665069 Merge pull request #646 from harshavardhana/pr_out_improve_and_use_regexp_for_scheme_validation 2015-05-19 11:20:00 -07:00
Harshavardhana dad7af0fe3 Improve and use regexp for Scheme validation 2015-05-19 11:18:22 -07:00
Harshavardhana dc3f4b3950 Merge pull request #645 from harshavardhana/pr_out_implement_our_own_url_parse_with_minimal_functionality 2015-05-18 22:41:38 -07:00
Harshavardhana 082bb23a71 Implement our own url.Parse with minimal functionality 2015-05-18 22:40:32 -07:00
Harshavardhana 0987e29242 Merge pull request #644 from harshavardhana/pr_out_rename_copy_to_cp 2015-05-18 20:57:52 -07:00
Harshavardhana 9f17f4ff83 Rename copy to cp 2015-05-18 20:56:22 -07:00
Harshavardhana ab01681be5 Merge pull request #643 from harshavardhana/pr_out_fix_a_bug_for_last_part_not_being_uploaded_due_to_lack_of_short_read_error_handling 2015-05-18 18:01:46 -07:00
Harshavardhana a9504e870b Fix a bug for last part not being uploaded due to lack of short read error handling 2015-05-18 18:00:25 -07:00
Harshavardhana 153c2116a8 Merge pull request #642 from harshavardhana/pr_out_add_windows_related_path_handling_now_recursive_cp_sync_works_properly 2015-05-18 17:40:09 -07:00
Harshavardhana 9e508f0dfe Add windows related path handling, now recursive cp, sync works properly 2015-05-18 17:38:30 -07:00
Harshavardhana 6018033458 Merge pull request #641 from harshavardhana/pr_out_use_adduseragent_function_and_make_appropriate_changes_in_mc 2015-05-18 16:57:10 -07:00
Harshavardhana 78317836ec Use AddUserAgent function and make appropriate changes in mc 2015-05-18 16:54:00 -07:00
Harshavardhana 2b2e31eb37 Merge pull request #640 from harshavardhana/pr_out_remove_dependency_on_url_parse_use_client_parse_implementation 2015-05-18 16:52:40 -07:00
Harshavardhana 8a8fd82853 Remove dependency on url.Parse() use client.Parse implementation 2015-05-18 16:51:04 -07:00
Harshavardhana 3ed4ce0aa4 Merge pull request #639 from harshavardhana/pr_out_bring_fixes_from_objectstorage_go 2015-05-18 13:20:33 -07:00
Harshavardhana f18f36a77b Bring fixes from objectstorage-go 2015-05-18 13:19:14 -07:00
Harshavardhana 8e0f6ceadc Merge pull request #638 from harshavardhana/pr_out_bring_in_new_changes_from_objectstorage_go_which_allow_for_recursive_infinite_putobject_operation 2015-05-17 15:52:32 -07:00
Harshavardhana 3899c03722 Bring in new changes from objectstorage-go which allow for recursive infinite putObject() operation 2015-05-17 15:51:29 -07:00
Harshavardhana b7d3fe1b02 Merge pull request #637 from harshavardhana/pr_out_update_to_new_changes_in_objectstorage_go
Update to new changes in objectstorage-go
2015-05-17 13:30:11 -07:00
Harshavardhana dfcb5bd729 Update to new changes in objectstorage-go 2015-05-17 13:28:57 -07:00
Harshavardhana 22557b43d4 Merge pull request #636 from harshavardhana/pr_out_convert_writers_to_blocking_readers 2015-05-17 12:55:37 -07:00
Harshavardhana a862c41590 Re-enable progress bar with a NewProxyReader 2015-05-17 12:48:27 -07:00
Harshavardhana 0a2626b71b Update to new changes in objectstorage-go 2015-05-17 03:12:39 -07:00
Harshavardhana ff3d9fa815 Convert writers to Blocking readers 2015-05-17 02:30:19 -07:00
Harshavardhana b5432366c6 Merge pull request #635 from harshavardhana/pr_out_print_proper_error_messages_for_cp 2015-05-16 18:44:32 -07:00
Harshavardhana de92f4ef31 Print proper error messages for cp 2015-05-16 18:42:22 -07:00
Anand Babu (AB) Periasamy 02eca69929 Merge pull request #634 from abperiasamy/config-cache
cache repeated config loads
2015-05-16 18:36:16 -07:00
Anand Babu (AB) Periasamy d1a22403e5 cache repeated config loads 2015-05-16 18:32:35 -07:00
Harshavardhana 4855479035 Merge pull request #633 from harshavardhana/pr_out_collate_isatty_code_for_bsd_and_linux 2015-05-16 18:29:03 -07:00
Harshavardhana e6d6375039 Collate isatty() code for bsd and linux 2015-05-16 18:27:05 -07:00
Harshavardhana a815192dc7 Merge pull request #632 from harshavardhana/pr_out_add_function_isatty_to_detect_if_stdout_for_console_is_a_terminal_if_not_disable_coloring 2015-05-16 18:14:36 -07:00
Harshavardhana 6d4a7c5e7b Add function isatty() to detect if Stdout for console is a terminal, if not disable coloring - fixes #631
Necessary when one has to pipe ``mc`` output to non terminal applications like ``less`` ``more`` etc.
2015-05-16 18:11:56 -07:00
Harshavardhana 3c25d79555 Merge pull request #630 from harshavardhana/pr_out_quiet_mode_support_for_copy_and_sync 2015-05-16 17:32:35 -07:00
Anand Babu (AB) Periasamy b35ab2f873 quiet mode support for copy and sync 2015-05-16 17:30:58 -07:00
Harshavardhana f37c85d9c6 Merge pull request #629 from harshavardhana/pr_out_update_to_new_changes_in_objectstorage_go 2015-05-16 17:15:15 -07:00
Harshavardhana ab6fe3e95a Update to new changes in objectstorage-go 2015-05-16 17:12:36 -07:00
Harshavardhana a2b8f053b0 Merge pull request #627 from harshavardhana/pr_out_now_cp_and_sync_work_for_objectstorage_urls 2015-05-16 16:54:33 -07:00
Harshavardhana 8f8b442075 Now cp and sync work for objectstorage URLs 2015-05-16 16:39:55 -07:00
Harshavardhana bf15a0c268 Merge pull request #626 from harshavardhana/pr_out_add_sync_automata_valid_cases 2015-05-16 15:39:41 -07:00
Harshavardhana 703dc21857 Add sync automata valid cases 2015-05-16 15:38:00 -07:00
Harshavardhana 128be5c1dc Merge pull request #624 from vadmeste/pr_out_fix_cp_with_single_core 2015-05-16 15:21:20 -07:00
Harshavardhana 65e38b5e5e Merge pull request #625 from harshavardhana/pr_out_fix_region_handling_inside_client_s3 2015-05-16 15:21:11 -07:00
Harshavardhana 45760226f3 Fix region handling inside client/s3 2015-05-16 15:18:34 -07:00
Anis Elleuch f8b98893bc Fix copy cmd when the host has only one CPU core 2015-05-16 23:16:40 +01:00
Harshavardhana 102ec394b6 filepath.Match on http prefixed globURL will fail if matched with only u.Host, config can have non absolute globURLs 2015-05-16 14:57:47 -07:00
Harshavardhana 3c8643a335 Merge pull request #623 from harshavardhana/pr_out_returning_right_after_docopy_error_we_should_just_print_the_error_and_move_forward 2015-05-16 14:35:06 -07:00
Harshavardhana 8299edc82c Returning right after doCopy error, we should just print the error and move forward 2015-05-16 14:33:35 -07:00
Harshavardhana 44fd69dc5a Merge pull request #622 from harshavardhana/pr_out_implement_sync_command_leveraging_cp_code 2015-05-16 13:30:56 -07:00
Harshavardhana ea833d8ca3 Implement sync command, leveraging cp code 2015-05-16 13:29:31 -07:00
Anand Babu (AB) Periasamy 8af7457fc6 Merge pull request #621 from abperiasamy/url-type
support string type natively within URLType
2015-05-16 13:05:15 -07:00
Anand Babu (AB) Periasamy 8823cec39d support string type natively within URLType 2015-05-16 13:01:14 -07:00
Anand Babu (AB) Periasamy 4e14d2c6f9 Merge pull request #620 from abperiasamy/remove-get-host-url
reduce url.Parse dependency
2015-05-16 12:46:40 -07:00
Anand Babu (AB) Periasamy c6168d3511 reduce url.Parse dependency 2015-05-16 12:43:56 -07:00
Harshavardhana 4f8052b67c Merge pull request #619 from harshavardhana/pr_out_fix_consistency_of_ls_output 2015-05-16 12:40:44 -07:00
Harshavardhana d45463ea41 Fix consistency of ls output 2015-05-16 12:39:21 -07:00
Harshavardhana bae89e2632 Couple of bug fixes in cp command for objectstorage 2015-05-16 12:28:04 -07:00
Anand Babu (AB) Periasamy 066896a1b3 Merge pull request #618 from abperiasamy/remove-cp-methods
removed cp-methods.go and renamed files with underscore
2015-05-16 02:38:50 -07:00
Anand Babu (AB) Periasamy 0a25574101 removed cp-methods.go and renamed files with underscore 2015-05-16 02:35:04 -07:00
Harshavardhana 9dc155552d Merge pull request #617 from harshavardhana/pr_out_some_cleanup_sync_to_be_enabled 2015-05-16 02:17:50 -07:00
Harshavardhana af7d43dfe6 Some cleanup, sync to be enabled 2015-05-16 02:16:13 -07:00
Harshavardhana 164c8b8eea Merge pull request #616 from harshavardhana/pr_out_right_fix_for_progressbar_segfault_is_not_not_initiating_finish_for_an_unstarted_progress_bar 2015-05-16 01:44:33 -07:00
Harshavardhana 4527519575 Right fix for progressbar segfault is not not initiating Finish() for an unstarted progress bar 2015-05-16 01:42:54 -07:00
Harshavardhana ba10419b3a Revert "Migrate pb to minio/pb with some changes"
This reverts commit 0fd38593d6.
2015-05-16 01:30:12 -07:00
Harshavardhana abf6796a62 Merge pull request #615 from harshavardhana/pr_out_migrate_pb_to_minio_pb_with_some_changes 2015-05-15 23:30:50 -07:00
Harshavardhana 0fd38593d6 Migrate pb to minio/pb with some changes 2015-05-15 23:29:37 -07:00
Harshavardhana 5709e10e8e Merge pull request #614 from minio/cp-changes 2015-05-15 23:10:06 -07:00
Anand Babu (AB) Periasamy 90d4b452a9 Copy rewrite 2015-05-15 23:08:39 -07:00
Harshavardhana 13e6311f30 Merge pull request #613 from harshavardhana/pr_out_mc_update_has_no_arguments_and_errors_are_now_meaningful
mc update has no arguments and errors are now meaningful
2015-05-15 22:49:45 -07:00
Harshavardhana 25e4eb8b5b mc update has no arguments and errors are now meaningful 2015-05-15 22:48:43 -07:00
Harshavardhana a537e64ba4 Merge pull request #612 from harshavardhana/pr_out_update_to_new_changes_in_objecstorage_go
Update to new changes in objecstorage-go
2015-05-15 22:28:24 -07:00
Harshavardhana f8531ea6ec Update to new changes in objecstorage-go 2015-05-15 22:15:38 -07:00
Harshavardhana afcd1deac8 Merge pull request #611 from harshavardhana/pr_out_add_dl_minio_io_into_default_config_list 2015-05-15 18:38:43 -07:00
Harshavardhana 538eadc71a Add dl.minio.io into default config list 2015-05-15 18:37:45 -07:00
Harshavardhana 652c97bf2a Merge pull request #610 from harshavardhana/pr_out_ignore_multipart_object_etag_string_amazon_doesn_t_guarantee_them_to_be_md5sum_of_the_object 2015-05-15 14:05:42 -07:00
Harshavardhana fb6808b754 Ignore multipart object Etag string, amazon doesn't guarantee them to be md5sum of the object 2015-05-15 14:03:37 -07:00
Harshavardhana 27e9403a3a Merge pull request #609 from harshavardhana/pr_out_close_open_files_in_fs_put_this_leads_to_too_many_open_files 2015-05-15 13:58:28 -07:00
Harshavardhana 21943d6416 Close open files in fs_put, this leads to too many open files 2015-05-15 13:54:58 -07:00
Harshavardhana f687cf16ba Merge pull request #608 from harshavardhana/pr_out_update_to_new_changes_in_objectstorage_go_fixes_289 2015-05-15 13:08:07 -07:00
Harshavardhana c2a4e6354c Update to new changes in objectstorage-go, fixes #289 2015-05-15 13:06:47 -07:00
Harshavardhana fc0bd85fac Merge pull request #607 from harshavardhana/pr_out_update_mc_to_new_changes_in_objectstorage_go
Update mc to new changes in objectstorage-go
2015-05-14 18:27:22 -07:00
Harshavardhana 74856029a3 Update mc to new changes in objectstorage-go 2015-05-14 18:26:13 -07:00
Harshavardhana 952057e937 Merge pull request #606 from vadmeste/pr_out_add_freebsd_support
Add FreeBSD support
2015-05-14 14:15:56 -07:00
Anis Elleuch 4f783ce840 Add FreeBSD support 2015-05-14 21:11:06 +00:00
Harshavardhana 08af4324fd Merge pull request #605 from harshavardhana/pr_out_do_not_add_region_for_mc_since_mc_treats_with_urls_not_regions 2015-05-13 20:12:41 -07:00
Harshavardhana f4983de475 Do not add region for mc, since mc treats with URLs not regions 2015-05-13 20:12:13 -07:00
Harshavardhana 88bdf0ee16 Merge pull request #604 from harshavardhana/pr_out_initial_attempt_to_move_mc_to_objecstorage_go 2015-05-13 19:37:54 -07:00
Harshavardhana e4f9152bcd If Object size is 0, treat it like a directory for object storage 2015-05-13 19:36:54 -07:00
Harshavardhana 1983717ed9 Update with new changes from objectstorage-go 2015-05-13 19:06:27 -07:00
Harshavardhana cd93bfd251 Migrate mc s3 client code to objecstorage-go library, now all requests from mc are signature v4 authenticated 2015-05-13 19:05:31 -07:00
Harshavardhana 9eb8314e41 Merge pull request #603 from harshavardhana/pr_out_more_code_moving_from_minio_io_to_minio 2015-05-11 16:44:32 -07:00
Harshavardhana 9c0ff1749c More code moving from Minio-io to minio 2015-05-11 16:44:19 -07:00
Harshavardhana e25022a6ed Merge pull request #602 from harshavardhana/pr_out_move_from_minio_io_to_minio_for_godeps 2015-05-11 16:39:29 -07:00
Harshavardhana f7b49f741a Move from minio-io to minio, for Godeps 2015-05-11 16:39:05 -07:00
Harshavardhana 9bd9edfd74 Merge pull request #601 from harshavardhana/pr_out_change_minio_io_to_minio
Change minio-io to minio
2015-05-11 16:31:28 -07:00
Harshavardhana e4a77c7391 Change minio-io to minio 2015-05-11 16:24:26 -07:00
Harshavardhana 8535172a95 Merge pull request #600 from harshavardhana/pr_out_combine_get_and_getpartial_to_be_getobject_with_offset_and_length_parameters 2015-05-11 15:42:52 -07:00
Harshavardhana 1c4351979a Combine Get() and GetPartial to be GetObject() with offset and length parameters
- GetObject(0, 0) does a full download on the object
 - GetObject(n, m) does a partial download on the object at offset n upto length m
2015-05-11 15:02:45 -07:00
Harshavardhana 0ff33a2d48 Merge pull request #599 from harshavardhana/pr_out_add_new_option_for_bucket_acl_named_authenticated_read_to_provide_read_access_to_all_users_who_are_part_of_authenticatedusers_group 2015-05-08 21:14:08 -07:00
Harshavardhana e57e6de098 Add new option for bucket ACL named `authenticated-read`
This provides read access to all users who are part of AuthenticatedUsers group

~~~
  $ mc access authenticated https://s3.amazonaws.com/bucketname
~~~
2015-05-08 21:12:32 -07:00
Harshavardhana b7b96ef221 Merge pull request #598 from harshavardhana/pr_out_update_mc_documetation_move_everything_pointing_to_localhost_to_play_minio_io
Update mc documetation move everything pointing to localhost to play.minio.io
2015-05-08 20:56:22 -07:00
Harshavardhana 6a6f2ec6f9 Update mc documetation move everything pointing to localhost to play.minio.io 2015-05-08 20:55:05 -07:00
Harshavardhana 5a69d76b93 Set X-Amz-Date properly for mc 2015-05-08 16:09:25 -07:00
Harshavardhana 3dda3a6448 Merge pull request #597 from harshavardhana/pr_out_revert_remove_md5_requirement_for_etag_apparently_we_need_it_
Revert "Remove MD5 requirement for ETag" - apparently we need it :(
2015-05-08 15:06:24 -07:00
Harshavardhana 78a9f175e5 Revert "Remove MD5 requirement for ETag" - apparently we need it :(
This reverts commit 7103a9433b.
2015-05-08 15:00:41 -07:00
Harshavardhana c2569d01ff Merge pull request #596 from harshavardhana/pr_out_remove_md5_requirement_for_etag 2015-05-08 13:31:13 -07:00
Harshavardhana 7103a9433b Remove MD5 requirement for ETag 2015-05-08 13:28:31 -07:00
Harshavardhana 2994a88f71 Merge pull request #594 from harshavardhana/pr_out_now_listobjectsrecursive_does_more_than_just_1000keys 2015-05-05 01:42:05 -07:00
Harshavardhana ab76d6d0f6 Now listObjectsRecursive() does more than just 1000keys 2015-05-05 01:40:28 -07:00
Harshavardhana 35613c2dfc Merge pull request #593 from harshavardhana/pr_out_minor_change_use_write_instead_of_io_writestring_ 2015-05-02 22:24:58 -07:00
Harshavardhana dc86452713 Minor change use .Write() instead of io.WriteString() 2015-05-02 22:23:45 -07:00
Harshavardhana 59a2992bfc Merge pull request #592 from harshavardhana/pr_out_fix_signature_calculation_bug 2015-05-02 19:58:38 -07:00
Harshavardhana 5023b37850 Fix signature calculation bug 2015-05-02 19:56:58 -07:00
Harshavardhana 1a91919666 Merge pull request #591 from harshavardhana/pr_out_simplifying_further_and_couple_of_bugs_fixed 2015-05-02 16:03:21 -07:00
Harshavardhana 26c09aeba7 Simplifying further and couple of bugs fixed 2015-05-02 16:01:52 -07:00
Harshavardhana 30634205be Merge pull request #590 from harshavardhana/pr_out_unstruct_client_functions 2015-05-02 14:05:29 -07:00
Harshavardhana 607d86e5c3 Add few more tests 2015-05-02 14:04:29 -07:00
Harshavardhana f914a059d3 Use console.Debugln instead of log.Debug.Println 2015-05-02 12:32:21 -07:00
Harshavardhana f4f691f2af Remove deps on aws-sdk we use our own 2015-05-02 12:00:07 -07:00
Harshavardhana beab21d3fe xml to abstract map is not necessary, we should just use struct based 2015-05-02 11:46:35 -07:00
Harshavardhana 766dbfa559 "unstruct client functions"
Original-Author: Anand Babu Periasamy <ab@minio.io>
2015-05-02 11:41:30 -07:00
Harshavardhana 62f1b22295 Merge pull request #589 from harshavardhana/pr_out_full_cleanup_of_s3_client_for_mc 2015-05-02 11:29:46 -07:00
Harshavardhana 78a78c072a Full cleanup of s3 client for mc 2015-05-02 11:28:31 -07:00
Harshavardhana 8010ffe997 Merge pull request #588 from harshavardhana/pr_out_fix_mc_cat_bug_for_sudo_terminals 2015-05-01 21:10:38 -07:00
Harshavardhana 945ae36101 Fix mc cat bug for sudo terminals 2015-05-01 21:09:40 -07:00
Harshavardhana 28315e7492 Merge pull request #585 from harshavardhana/pr_out_osx_support_thanks_to_sri_h2o_ai 2015-05-01 01:12:25 -07:00
Harshavardhana a0e7b8cfaf OSX Support :-) - thanks to sri@h2o.ai 2015-05-01 01:09:58 -07:00
Harshavardhana 0eb1fea912 Merge pull request #584 from harshavardhana/pr_out_cmd_update_now_has_a_standard_url 2015-05-01 00:26:55 -07:00
Harshavardhana d35e75ef4b Cmd update now has a standard URL 2015-05-01 00:23:15 -07:00
Harshavardhana c1e6a8a0df Merge pull request #583 from harshavardhana/pr_out_bucketfromhost_was_buggy_remove_it_we_have_better_ways_to_grab_bucketnames 2015-04-30 21:02:41 -07:00
Harshavardhana a74dce0412 bucketFromHost() was buggy remove it, we have better ways to grab bucketNames 2015-04-30 21:00:28 -07:00
Frederick F. Kautz IV 011608d60f Merge pull request #578 from fkautz/pr_out_running_gofmt_version_on_aws_sdk_go 2015-04-30 19:55:25 -07:00
Frederick F. Kautz IV 8cb8cb3405 Running gofmt on aws-sdk-go 2015-04-30 19:53:13 -07:00
Harshavardhana 0de32c8453 Merge pull request #582 from harshavardhana/pr_out_relax_the_requirement_for_accesskey_for_listbuckets_for_non_amazonaws_requests 2015-04-30 16:43:31 -07:00
Harshavardhana 7fe1c4af97 Relax the requirement for AccessKey for listbuckets() for non amazonaws requests 2015-04-30 16:39:10 -07:00
Harshavardhana e3ede0eba8 Merge pull request #581 from harshavardhana/pr_out_access_validation_only_for_listbuckets_all_others_do_not_explicitly_require_auth_verification 2015-04-30 14:09:56 -07:00
Harshavardhana c4d954b614 Access validation only for ListBuckets(), all others do not explicitly require Auth verification 2015-04-30 14:05:50 -07:00
Harshavardhana 9833697e0a Add more fixes and helpful messaging
- check for config file for each command, prior to error out properly
  - hostconfig doesn't do any key verification, let client s3 verify it as needed
  - mc update change URL pointed to dl.minio.io minio server, still not functional yet
2015-04-30 14:03:06 -07:00
Harshavardhana c061f7d844 Merge pull request #580 from minio-io/revert-579-janitor_client
Revert "unstruct client functions"
2015-04-29 21:29:33 -07:00
Harshavardhana 1ceed3dc20 Revert "unstruct client functions" 2015-04-29 21:28:28 -07:00
Anand Babu (AB) Periasamy 3ec4e85f92 Merge pull request #579 from abperiasamy/janitor_client
unstruct client functions
2015-04-29 19:07:12 -07:00
Anand Babu (AB) Periasamy 0d191ceb83 unstruct client functions 2015-04-29 19:06:42 -07:00
Harshavardhana 8b7da1b3f3 Merge pull request #577 from harshavardhana/pr_out_add_testing_code_for_cmdaccess_ 2015-04-29 14:06:39 -07:00
Harshavardhana 2f9e7d4dbf Add testing code for CmdAccess() 2015-04-29 14:01:30 -07:00
Harshavardhana b958e2b83f Merge pull request #576 from harshavardhana/pr_out_add_missing_info 2015-04-29 12:10:14 -07:00
Harshavardhana 481d5758ef Add missing info 2015-04-29 12:09:55 -07:00
Harshavardhana 8f50f87914 Merge pull request #575 from harshavardhana/pr_out_fix_the_bug_re_introduced_from_previous_fixes 2015-04-29 01:43:40 -07:00
Harshavardhana 1732243672 Fix the bug re-introduced from previous fixes 2015-04-29 01:43:23 -07:00
Harshavardhana 5c4f5a6b9a Merge pull request #574 from harshavardhana/pr_out_getbuilddate_should_be_time_time_and_handle_it_gracefully 2015-04-29 00:06:11 -07:00
Harshavardhana 8d68154498 getBuildDate() should be time.Time and handle it gracefully 2015-04-29 00:04:28 -07:00
Harshavardhana 05aff42f7f Merge pull request #573 from harshavardhana/pr_out_objecturl_in_s3client_should_construct_pathstyle_url 2015-04-28 23:46:33 -07:00
Harshavardhana 47e9a48577 objectURL in s3Client should construct PathStyle URL for non amazon hosts 2015-04-28 23:45:59 -07:00
Harshavardhana afe28a46f7 Merge pull request #572 from harshavardhana/pr_out_handle_symlink_appropriately_with_mc_ls_for_filesystem 2015-04-28 23:27:50 -07:00
Harshavardhana 5ca4280ea0 Handle symlink appropriately with mc ls for filesystem 2015-04-28 23:26:17 -07:00
Harshavardhana eb8982882b Merge pull request #571 from harshavardhana/pr_out_update_cli_and_add_customapphelptemplate 2015-04-28 21:24:04 -07:00
Harshavardhana fc6c6ff03a Update cli and add CustomAppHelpTemplate 2015-04-28 21:21:45 -07:00
Harshavardhana 152edd3b30 Merge pull request #570 from harshavardhana/pr_out_update_cli_and_relevant_changes_in_mc 2015-04-28 21:04:06 -07:00
Harshavardhana dfbc501246 Update cli and relevant changes in mc 2015-04-28 21:02:33 -07:00
Harshavardhana 6e3740d161 Merge pull request #569 from harshavardhana/pr_out_add_documentation_for_update_and_use_pathstyle_for_play_minio_io_for_now 2015-04-28 19:46:29 -07:00
Harshavardhana 1e38777fd2 Add documentation for update, and use PathStyle for play.minio.io for now 2015-04-28 19:45:05 -07:00
Harshavardhana a7065d9670 Merge pull request #568 from harshavardhana/pr_out_add_play_minio_io_as_default 2015-04-28 19:20:43 -07:00
Harshavardhana 1474fb20db Add play.minio.io as default 2015-04-28 19:17:59 -07:00
Harshavardhana ea3b8ffa01 Merge pull request #567 from harshavardhana/pr_out_make_alias_a_subcommand_and_part_of_config_subcommand 2015-04-28 18:24:27 -07:00
Harshavardhana 6e426b2939 Make alias a subcommand and part of config subcommand 2015-04-28 18:23:02 -07:00
Harshavardhana aa8d133943 Merge pull request #566 from harshavardhana/pr_out_handle_errors_properly_in_cp 2015-04-28 17:47:57 -07:00
Harshavardhana 89ecd00f93 Handle errors properly in cp 2015-04-28 17:45:19 -07:00
Harshavardhana 700b34c57c Merge pull request #565 from harshavardhana/pr_out_implement_sync_command_for_single_source_multiple_targets 2015-04-28 13:25:11 -07:00
Harshavardhana 29562bc887 Implement sync command for single source multiple targets 2015-04-28 13:06:56 -07:00
Harshavardhana 8ba6261e18 Make getURL - getExpandedURL 2015-04-28 12:50:44 -07:00
Harshavardhana 46308dc6ad Merge pull request #564 from fkautz/pr_out_updating_from_go1_4_1_to_go1_4_2 2015-04-28 12:39:40 -07:00
Harshavardhana 3717cbf23c Merge pull request #563 from harshavardhana/pr_out_add_mc_cp_to_support_source1_source2_target 2015-04-28 12:39:35 -07:00
Frederick F. Kautz IV ba12fb7ce6 Updating from go1.4.1 to go1.4.2 2015-04-28 12:37:43 -07:00
Harshavardhana 8ffd8d0f26 User folder instead of directories in documentation 2015-04-28 12:15:09 -07:00
Harshavardhana 23cee677b7 Add ./mc cp to support <source1> <source2> <target> 2015-04-28 11:59:48 -07:00
Harshavardhana 79fc597dd0 Merge pull request #562 from harshavardhana/pr_out_bring_old_documentation_back 2015-04-28 11:24:05 -07:00
Harshavardhana 744ed7dcd1 Bring old documentation back 2015-04-28 11:03:34 -07:00
Harshavardhana c3b79d24f4 Merge pull request #561 from harshavardhana/pr_out_review_code_comments_and_restructure_part_of_451 2015-04-28 02:52:32 -07:00
Harshavardhana e79bd7a4d5 Review code comments and restructure, part of #451 2015-04-28 02:51:17 -07:00
Harshavardhana f22819d93b Merge pull request #560 from harshavardhana/pr_out_review_comments_part_of_451 2015-04-28 02:37:17 -07:00
Harshavardhana 41637a2155 Review comments, part of #451 2015-04-28 02:35:46 -07:00
Harshavardhana d5a65b0460 Merge pull request #559 from harshavardhana/pr_out_update_ls_docs_and_fix_a_bug 2015-04-27 21:26:01 -07:00
Harshavardhana bb065502dd Update ls docs and fix a bug 2015-04-27 21:20:21 -07:00
Harshavardhana 1e9728b7df Merge pull request #558 from harshavardhana/pr_out_non_recursive_ls_fixes_479 2015-04-27 20:58:55 -07:00
Harshavardhana f24a42a32b Non recursive ls - fixes #479 2015-04-27 20:57:17 -07:00
Harshavardhana d3de408292 Merge pull request #557 from harshavardhana/pr_out_fix_a_datarace_in_testcmdcatfile_testcmdcatobject_test_cases 2015-04-27 17:55:43 -07:00
Harshavardhana 4df161e14f Fix a datarace in TestCmdCatFile/TestCmdCatObject test cases 2015-04-27 17:54:04 -07:00
Harshavardhana 91855f335d Another change to get ./mc cp closer to unix cp 2015-04-27 17:49:39 -07:00
Harshavardhana 944acb7040 Merge pull request #556 from harshavardhana/pr_out_update_cp_documentation_no_multi_target 2015-04-27 16:48:55 -07:00
Harshavardhana dbf388863d Update cp documentation no multi target 2015-04-27 16:47:06 -07:00
Harshavardhana b9a53bbf14 Merge pull request #555 from harshavardhana/pr_out_erroneous_console_prefix_being_printed 2015-04-27 16:36:42 -07:00
Harshavardhana eaa16201fc Erroneous console prefix being printed 2015-04-27 16:36:28 -07:00
Harshavardhana e342bfa197 Merge pull request #553 from harshavardhana/pr_out_implement_multipart_upload_library_functions 2015-04-27 14:49:44 -07:00
Harshavardhana 5468c97f0e Implement multipart upload library functions 2015-04-27 14:41:13 -07:00
Harshavardhana 8e72dafdd9 Merge pull request #552 from harshavardhana/pr_out_fix_cmd_access_retry_code 2015-04-27 13:23:12 -07:00
Harshavardhana dd8672a6ce Fix cmd-access retry code 2015-04-27 13:21:02 -07:00
Harshavardhana a99f5e1b36 Merge pull request #551 from harshavardhana/pr_out_adding_proper_builddate_now_through_ldflags 2015-04-27 13:09:39 -07:00
Harshavardhana a5f63483bf Adding proper buildDate, now through ldflags 2015-04-27 13:08:04 -07:00
Harshavardhana 4ba29a14f1 Merge pull request #550 from harshavardhana/pr_out_make_sure_to_set_the_date_s_properly_in_s3client 2015-04-27 04:32:18 -07:00
Harshavardhana 877d32236c Make sure to set the Date's properly in s3Client 2015-04-27 04:30:49 -07:00
Harshavardhana f0842dbb6d Merge pull request #549 from harshavardhana/pr_out_fix_for_439_simplify_config_handling
Fix for #439 - simplify config handling
2015-04-26 19:17:53 -07:00
Harshavardhana 9711642f1d Fix for #439 - simplify config handling 2015-04-26 19:16:12 -07:00
Harshavardhana c57c3ddbf6 Make cmd-config simpler, context processing happens only by one function 2015-04-26 19:11:38 -07:00
Harshavardhana 78a46f02b8 Merge pull request #548 from harshavardhana/pr_out_fix_an_error_in_recursive_behavior_for_filesystem
Fix an error in recursive behavior for filesystem
2015-04-26 17:53:26 -07:00
Harshavardhana 7b55d29a80 Fix an error in recursive behavior for filesystem 2015-04-26 17:52:19 -07:00
Harshavardhana 82cc2c2bee Merge pull request #547 from harshavardhana/pr_out_re_implement_s3tests_with_minio_io_check_fixes_432
Re-implement s3tests with minio-io/check - fixes #432
2015-04-26 16:56:37 -07:00
Harshavardhana 81379a01c7 Re-implement s3tests with minio-io/check - fixes #432 2015-04-26 16:55:10 -07:00
Harshavardhana b366d55f35 Merge pull request #546 from harshavardhana/pr_out_recursive_copy_with_prefix_works_now_fixes_496 2015-04-26 16:04:17 -07:00
Harshavardhana 511416b0f9 Recursive copy with prefix works now fixes - #496 2015-04-26 16:02:57 -07:00
Harshavardhana 2a15316d66 Merge pull request #544 from harshavardhana/pr_out_re_implement_cp_make_it_closer_to_regular_unix_cp 2015-04-26 15:26:06 -07:00
Harshavardhana a9317ba22f Add recursive copy 2015-04-26 15:24:16 -07:00
Harshavardhana 339ecbe4ac Update documentation 2015-04-26 04:59:39 -07:00
Harshavardhana 17f9a0e18e Now mc cat is multi source 2015-04-26 04:59:39 -07:00
Harshavardhana 8eefa26719 Re-implement cp make it closer to regular unix cp 2015-04-26 04:59:39 -07:00
Harshavardhana 59441175d1 Merge pull request #545 from harshavardhana/pr_out_update_cli_with_new_changes 2015-04-26 04:58:56 -07:00
Harshavardhana 51f3448ff8 Update cli with new changes 2015-04-26 04:58:04 -07:00
Anand Babu (AB) Periasamy fc09bf65ee Merge pull request #543 from abperiasamy/md5sum-path-bug
fixes md5sum version bug when the binary is not found on current dir
2015-04-26 02:54:38 -07:00
Anand Babu (AB) Periasamy d495a0f64f fixes md5sum version bug when the binary is not found on current dir 2015-04-26 02:36:38 -07:00
Harshavardhana dd8733de75 Merge pull request #542 from harshavardhana/pr_out_add_proper_retry_mechanisms_and_print_that_in_magenta_color 2015-04-25 23:10:12 -07:00
Harshavardhana 62750317d4 Add proper retry() mechanisms and print that in Magenta color 2015-04-25 23:08:44 -07:00
Harshavardhana eb6f73b639 Merge pull request #541 from harshavardhana/pr_out_ignore_if_the_keys_are_still_based_on_default_configuration 2015-04-25 21:34:30 -07:00
Harshavardhana 34d2ca98a3 Ignore if the keys are still based on default configuration 2015-04-25 21:31:05 -07:00
Harshavardhana ac26070fed Merge pull request #540 from harshavardhana/pr_out_merge_fs_from_unix_and_windows_there_are_no_further_differences 2015-04-25 00:48:02 -07:00
Harshavardhana 93cb35e847 Merge fs from unix and windows, there are no further differences 2015-04-25 00:45:23 -07:00
Harshavardhana fcf5e39f56 Merge pull request #539 from harshavardhana/pr_out_add_license_and_create_a_new_file_license_google 2015-04-24 21:18:10 -07:00
Harshavardhana 31ddab431e Add license and create a new file LICENSE.GOOGLE 2015-04-24 21:17:01 -07:00
Anand Babu (AB) Periasamy fbcb93b766 Merge pull request #538 from abperiasamy/hashbin
Version is now based on MD5SUM of its binary
2015-04-24 20:49:51 -07:00
Harshavardhana 58fa59a144 Merge pull request #537 from harshavardhana/pr_out_simplify_cat_by_using_put_since_now_put_supports_calculating_md5sum_internally_and_report_errors_on_close_ 2015-04-24 20:47:50 -07:00
Harshavardhana d291706014 Simplify cat by using Put(), since now Put() supports calculating md5sum internally
and report errors on Close()
2015-04-24 20:46:43 -07:00
Anand Babu (AB) Periasamy e359d125a5 Version is now based on MD5SUM of its binary 2015-04-24 20:46:42 -07:00
Harshavardhana 9fb94c72a1 Filesystem now calculates md5sum and returns 2015-04-24 20:15:57 -07:00
Frederick F. Kautz IV 155239996f Merge pull request #535 from fkautz/pr_out_deleting_unnecessary_gitattributes 2015-04-24 20:07:16 -07:00
Frederick F. Kautz IV 333ea21160 Deleting unnecessary gitattributes 2015-04-24 20:04:37 -07:00
Frederick F. Kautz IV fa56120e90 Merge pull request #534 from fkautz/pr_out_version_number_now_set_through_ldflags_in_makefile 2015-04-24 20:00:14 -07:00
Frederick F. Kautz IV daf36c40e6 Version number now set through ldflags in makefile 2015-04-24 19:59:22 -07:00
Harshavardhana f8ac1b96d1 Move blockingwriter to client interface 2015-04-24 19:38:14 -07:00
Harshavardhana 3b176633d0 Merge pull request #533 from harshavardhana/pr_out_do_not_attempt_stat_for_destination_fixes_copy_to_objectstorage_bug 2015-04-24 14:03:41 -07:00
Harshavardhana b4c70f1a95 Do not attempt Stat() for destination fixes copy to objectstorage bug 2015-04-24 14:02:29 -07:00
Anand Babu (AB) Periasamy a3d46f5930 Merge pull request #532 from abperiasamy/scrolling-progressbar-bug
fix scrolling progressbar bug
2015-04-24 12:03:25 -07:00
Anand Babu (AB) Periasamy 409309442e fix scrolling progressbar bug 2015-04-24 12:01:28 -07:00
Harshavardhana c1f0409792 Merge pull request #531 from harshavardhana/pr_out_merge_getobjectmetadata_into_stat_now_stat_returns_properly_using_filetype 2015-04-24 11:18:48 -07:00
Harshavardhana 04fc519ce2 Merge GetObjectMetadata() into Stat(), now Stat() returns properly using FileType
FileType is going to be used to differentiate between directory, file/bucket, object respectively
2015-04-24 11:16:27 -07:00
Anand Babu (AB) Periasamy cbaae55d0a Merge pull request #530 from abperiasamy/stderr
Console outputs Fatal, Error and Debug messages on os.stderr
2015-04-24 04:05:28 -07:00
Anand Babu (AB) Periasamy 514b848d46 Console outputs Fatal, Error and Debug messages on os.stderr 2015-04-24 04:01:55 -07:00
Harshavardhana 030c4fc82c Merge pull request #529 from harshavardhana/pr_out_implement_access_command
Implement access command
2015-04-24 02:11:30 -07:00
Harshavardhana 4e05b59298 Implement access command 2015-04-24 02:09:27 -07:00
Harshavardhana 27eecfcb9f Merge pull request #528 from harshavardhana/pr_out_make_some_doc_changes_to_cat_cmd 2015-04-23 23:17:09 -07:00
Harshavardhana bc68f1d9f4 Make some doc changes to cat cmd 2015-04-23 23:16:02 -07:00
Harshavardhana d5f4c1531c Merge pull request #527 from harshavardhana/pr_out_add_buckets_to_have_same_coloring_as_directories 2015-04-23 22:45:18 -07:00
Harshavardhana 518fa8a2cf Add buckets to have same coloring as directories 2015-04-23 22:44:05 -07:00
Harshavardhana 86c5986df3 Merge pull request #526 from harshavardhana/pr_out_print_ls_with_special_color_for_directories 2015-04-23 21:37:25 -07:00
Frederick F. Kautz IV 520ae61b15 Merge pull request #525 from fkautz/pr_out_running_goimports_on_cmd_cat_go 2015-04-23 21:37:17 -07:00
Harshavardhana 17d0f05560 Print ls with special color for directories 2015-04-23 21:36:12 -07:00
Frederick F. Kautz IV e2ed40f638 Running goimports on cmd-cat.go 2015-04-23 21:36:09 -07:00
Frederick F. Kautz IV 0695460549 Merge pull request #524 from fkautz/pr_out_adding_copyright_to_cmd_cat_go 2015-04-23 21:33:58 -07:00
Frederick F. Kautz IV 15fe8c2329 Adding copyright to cmd-cat.go 2015-04-23 21:32:40 -07:00
Frederick F. Kautz IV fa825b57b4 Merge pull request #522 from fkautz/pr_out_fix_md5sum_failing_on_success 2015-04-23 21:29:38 -07:00
Frederick F. Kautz IV 01ebdd418c Fix md5sum failing on success 2015-04-23 21:28:25 -07:00
Anand Babu (AB) Periasamy 4540e4e3c6 Merge pull request #523 from abperiasamy/error-msg-review
console enhancements, consistent error message and janitor duty - fixes #431
2015-04-23 21:28:11 -07:00
Anand Babu (AB) Periasamy c09ce54090 console enhancements, consistent error message and janitor duty 2015-04-23 21:25:10 -07:00
Frederick F. Kautz IV 4f2b4f9881 Merge pull request #521 from fkautz/pr_out_removing_completed_todos 2015-04-23 20:57:43 -07:00
Frederick F. Kautz IV 7f05e34bf1 Removing completed TODOs 2015-04-23 20:56:49 -07:00
Frederick F. Kautz IV 57a8f21fe8 Merge pull request #520 from fkautz/pr_out_removing_unnecessary_error_suppression_code_from_cat 2015-04-23 20:55:52 -07:00
Frederick F. Kautz IV 5da118366a Removing unnecessary error suppression code from cat 2015-04-23 20:54:43 -07:00
Frederick F. Kautz IV 54e8b2d422 Merge pull request #519 from fkautz/pr_out_adding_human_readable_error_messages_to_cat 2015-04-23 20:53:29 -07:00
Frederick F. Kautz IV a640af6043 Adding human readable error messages to cat 2015-04-23 20:52:33 -07:00
Harshavardhana 0657b87018 Merge pull request #518 from harshavardhana/pr_out_migrate_fully_to_list_with_channel_everywhere_deprecate_old_list_api 2015-04-23 20:38:04 -07:00
Harshavardhana 9f97409362 Migrate fully to List() with channel everywhere, deprecate old List() API 2015-04-23 20:36:44 -07:00
Frederick F. Kautz IV 47e6784da4 Merge pull request #517 from fkautz/pr_out_adding_error_messages 2015-04-23 20:34:50 -07:00
Frederick F. Kautz IV 39c336bbd1 Adding error messages 2015-04-23 20:33:22 -07:00
Frederick F. Kautz IV 234ff7e7c1 Merge pull request #516 from fkautz/pr_out_returning_1_on_cat_error 2015-04-23 20:28:27 -07:00
Frederick F. Kautz IV fcece3b238 Returning 1 on cat error 2015-04-23 20:26:02 -07:00
Frederick F. Kautz IV 142e569527 Merge pull request #515 from fkautz/pr_out_adding_mc_cat 2015-04-23 20:23:56 -07:00
Frederick F. Kautz IV 1843bd7fc9 Adding mc cat 2015-04-23 20:23:01 -07:00
Harshavardhana 6f8bac1e95 Merge pull request #514 from harshavardhana/pr_out_add_listonchannel_for_fs_unix_windows_and_cmd_ls 2015-04-23 20:05:37 -07:00
Harshavardhana 972c476e36 Add ListOnChannel() for fs{unix,windows} and cmd-ls 2015-04-23 20:02:48 -07:00
Frederick F. Kautz IV 59356a443b Merge pull request #511 from fkautz/pr_out_fixing_panic 2015-04-23 19:22:13 -07:00
Frederick F. Kautz IV 7b6f264529 Fixing panic 2015-04-23 19:07:27 -07:00
Harshavardhana 1f0d1547c7 Merge pull request #512 from harshavardhana/pr_out_cleanup_s3_api_further 2015-04-23 19:04:48 -07:00
Harshavardhana e6fea12bc2 Cleanup s3 API further 2015-04-23 18:57:30 -07:00
Harshavardhana 87e6aba02b Merge pull request #509 from harshavardhana/pr_out_listonchannel_now_listbuckets_and_objects_through_channel_replies 2015-04-23 18:05:41 -07:00
Harshavardhana 527b1ca96d ListOnChannel() - now listbuckets and objects through channel replies.
Still doesn't do full recursive of all objects based on marker, that is the next step.
2015-04-23 18:01:12 -07:00
Harshavardhana 431143f7d0 Merge pull request #508 from abperiasamy/win-ls-single-item-bug 2015-04-23 16:05:07 -07:00
Harshavardhana 687e24c5a6 Merge pull request #507 from harshavardhana/pr_out_return_proper_err_back_from_put_through_response 2015-04-23 16:04:16 -07:00
Harshavardhana 33dbf0e16c Return proper err back from Put() through response
This still doesn't fix the issue of progress bar completion, since there are no
Closers() involved for progress bar and multiwriter. A Write() wouldn't fail
for a 403 if the. So io.CopyN has no way to reply back proper error.
2015-04-23 16:02:24 -07:00
Anand Babu (AB) Periasamy 1a83cf3c5c do find style listing on windows as well 2015-04-23 16:02:16 -07:00
Harshavardhana 6be627246b Merge pull request #506 from harshavardhana/pr_out_ignore_signrequest_for_get_and_getpartial_if_accesskeys_are_empty_missed_from_previous_commit 2015-04-23 14:29:26 -07:00
Harshavardhana 45951e3f13 Ignore signRequest for Get() and GetPartial() if accesskeys are empty, missed from previous commit 2015-04-23 14:27:57 -07:00
Harshavardhana ef5b20dc2f Merge pull request #505 from harshavardhana/pr_out_now_bucket_creation_requires_a_simple_cannedacls_to_start_with 2015-04-23 14:25:01 -07:00
Harshavardhana c120a5853d Now bucket creation requires a simple CannedACLs to start with
$ ./mc mb <acl_type> <target>
2015-04-23 14:22:48 -07:00
Anand Babu (AB) Periasamy 2177a82b6d Merge pull request #504 from abperiasamy/ls-single-item-bug
fix dir listing bug and find style output
2015-04-23 12:59:48 -07:00
Anand Babu (AB) Periasamy 0a50606cbd fix dir listing bug and find style output 2015-04-23 12:50:31 -07:00
Harshavardhana 256d7c4443 Merge pull request #503 from harshavardhana/pr_out_add_bucket_acl_support 2015-04-23 12:30:42 -07:00
Harshavardhana c8ca983373 Just Stat() the bucket on targets, buckets should be created through ./mc mb 2015-04-23 12:27:58 -07:00
Harshavardhana 4e53814cc3 Add bucket ACL support 2015-04-23 12:10:51 -07:00
Anand Babu (AB) Periasamy e9de80ebac Merge pull request #502 from abperiasamy/no-color-for-win
no color for win for now
2015-04-23 03:14:27 -07:00
Anand Babu (AB) Periasamy 94d89c2181 no color for win for now 2015-04-23 03:10:36 -07:00
Anand Babu (AB) Periasamy 36dd68344e Merge pull request #501 from abperiasamy/ls-humanize-size
Humanize ls size field
2015-04-23 01:48:19 -07:00
Anand Babu (AB) Periasamy 61779502fb Humanize ls size field 2015-04-23 01:46:05 -07:00
Anand Babu (AB) Periasamy 59497020f2 Merge pull request #500 from abperiasamy/theme-fields
Theme fields
2015-04-23 01:24:37 -07:00
Anand Babu (AB) Periasamy eb29760aec update console package and add additional nocolor check 2015-04-23 01:17:50 -07:00
Anand Babu (AB) Periasamy 16e8cec82a field specific color theme 2015-04-23 01:02:17 -07:00
Anand Babu (AB) Periasamy f92babe623 Merge pull request #499 from abperiasamy/theme-improvements
console theme improvements
2015-04-22 18:09:46 -07:00
Anand Babu (AB) Periasamy b923232e9f console theme improvements 2015-04-22 18:05:42 -07:00
Harshavardhana 41fd17db50 Merge pull request #498 from harshavardhana/pr_out_a_parial_fix_for_496_strip_down_objectprefixes_during_list_
A parial fix for #496, strip down objectPrefixes during List()
2015-04-22 14:02:07 -07:00
Harshavardhana e4b122ee9d A parial fix for #496, strip down objectPrefixes during List() 2015-04-22 13:58:48 -07:00
Harshavardhana ee92e6de8b Merge pull request #497 from harshavardhana/pr_out_fix_a_crash_on_windows_when_source_is_malformed 2015-04-22 13:22:27 -07:00
Harshavardhana 7ec954a78b Fix a crash on windows when source is malformed 2015-04-22 13:20:02 -07:00
Frederick F. Kautz IV 10ad6465ee Merge pull request #495 from fkautz/pr_out_remove_printing_stack_trace_in_cmd_cp_recursive 2015-04-22 12:12:14 -07:00
Frederick F. Kautz IV d8e4a77280 Remove printing stack trace in cmd cp recursive 2015-04-22 12:09:32 -07:00
Harshavardhana 957ab79328 Fix a typo, pushing it in 2015-04-22 11:59:56 -07:00
Harshavardhana 63c9d93469 Merge pull request #494 from harshavardhana/pr_out_make_default_client_type_as_filesystem 2015-04-22 11:56:44 -07:00
Harshavardhana 3af75c8aba Make default client type as Filesystem 2015-04-22 11:53:27 -07:00
Harshavardhana 24ba355be7 Merge pull request #493 from harshavardhana/pr_out_fix_error_path_variable_on_windows 2015-04-22 11:27:03 -07:00
Harshavardhana 60ec7d2713 Fix error path variable on Windows 2015-04-22 11:24:36 -07:00
Harshavardhana 131a1e6b7f Merge pull request #492 from harshavardhana/pr_out_reply_messages_from_docopycmdrecursive_and_do_not_exit_on_errors_during_docopycmd_ 2015-04-22 01:43:35 -07:00
Harshavardhana d5b0edc7c0 Reply messages from doCopyCmdRecursive() and do not exit on errors during doCopyCmd() 2015-04-22 01:41:13 -07:00
Harshavardhana cde3fb6161 Merge pull request #491 from harshavardhana/pr_out_disallow_bucket_creation_with_uppercase_letters 2015-04-22 01:34:41 -07:00
Harshavardhana dc200a62fc Disallow `bucket` creation with uppercase letters 2015-04-22 01:22:22 -07:00
Harshavardhana 10d1c13a0b Merge pull request #490 from harshavardhana/pr_out_handle_errors_properly_also_remove_need_for_normalizing_path_on_windows 2015-04-22 00:18:37 -07:00
Harshavardhana 0eaf7ec5b4 Handle errors properly, also remove need for normalizing path on windows 2015-04-22 00:17:01 -07:00
Harshavardhana 629a4c1cd4 Merge pull request #488 from harshavardhana/pr_out_fix_listcmd_makebucketcmd_for_multi_target 2015-04-21 16:35:50 -07:00
Frederick F. Kautz IV 8f193cb651 Merge pull request #487 from fkautz/pr_out_fixing_errors_in_docopycmd 2015-04-21 16:31:12 -07:00
Harshavardhana e3c1b8eabc Fix ListCmd() MakeBucketCmd() for multi target 2015-04-21 16:29:33 -07:00
Frederick F. Kautz IV 2ba56b286c Fixing errors in doCopyCmd 2015-04-21 16:26:30 -07:00
Harshavardhana 9f3e7b5621 Merge pull request #486 from abperiasamy/url-escape
replace net/url parser with simple filepath parsing
2015-04-21 16:11:51 -07:00
Frederick F. Kautz IV 9fb3e76e3a Merge pull request #485 from fkautz/pr_out_removing_duplication_in_docopycmdrecursive_now_depends_on_docopycmd 2015-04-21 16:09:27 -07:00
Anand Babu (AB) Periasamy 5a7b8da98d replace net/url parser with simple filepath parsing 2015-04-21 16:05:16 -07:00
Frederick F. Kautz IV 3ae23a9a85 Removing duplication in doCopyCmdRecursive, now depends on doCopyCmd 2015-04-21 16:03:40 -07:00
Harshavardhana 8813ecd24d Merge pull request #484 from harshavardhana/pr_out_remove_r_introduct_as_recursive_keyword 2015-04-21 15:44:06 -07:00
Harshavardhana 2474545a45 Remove -r introduce ... as recursive keyword 2015-04-21 15:41:30 -07:00
Harshavardhana 15bda586f0 Merge pull request #483 from harshavardhana/pr_out_add_support_for_127_0_0_1_as_well_fixes_467 2015-04-21 15:19:51 -07:00
Harshavardhana 3ac36d1f95 Add skip localhost and 127.0.0.1 - treat them as special case in getHostConfig - fixes #467 2015-04-21 15:15:20 -07:00
Harshavardhana 84a82143bc Merge pull request #478 from harshavardhana/pr_out_migrate_to_quick_config_qdb_takes_the_high_road 2015-04-21 13:54:14 -07:00
Harshavardhana 095ae11caf Migrate to quick Config, qdb takes the high road 2015-04-21 13:47:46 -07:00
Frederick F. Kautz IV 776d554cad Merge pull request #476 from fkautz/pr_out_minor_formatting_cleanup 2015-04-21 12:45:15 -07:00
Frederick F. Kautz IV c608a142f9 Minor formatting cleanup 2015-04-21 12:33:32 -07:00
Harshavardhana 6a1065459f Merge pull request #475 from harshavardhana/pr_out_rename_q_quick
Rename q --> quick
2015-04-21 11:45:42 -07:00
Harshavardhana aae9ee1327 Rename q --> quick 2015-04-21 11:32:25 -07:00
Harshavardhana 173fcf06bb Merge pull request #474 from harshavardhana/pr_out_rename_qconfig_as_q_as_it_makes_sense_to_call_it_q_config_instead_of_qconfig_config 2015-04-21 03:25:01 -07:00
Harshavardhana 90825c5ff9 Rename qconfig as q as it makes sense to call it q.Config instead of qconfig.Config
- one more test added for CheckData()
2015-04-21 03:22:14 -07:00
Anand Babu (AB) Periasamy 100c5a9db7 Merge pull request #473 from abperiasamy/qconfig
qconfig for config and state files
2015-04-21 01:23:17 -07:00
Anand Babu (AB) Periasamy c6a1799a0f qconfig for config and state files 2015-04-21 01:21:09 -07:00
Harshavardhana 2cc6db2162 Merge pull request #472 from harshavardhana/pr_out_implement_simple_authkey_and_console_tests 2015-04-21 01:15:42 -07:00
Harshavardhana b42d3a3af7 Implement simple authkey and console tests 2015-04-21 01:14:28 -07:00
Harshavardhana 6adb5e5217 Move getHostConfig() outside of getNewClient(), waiting on new qConfig to simplify this further 2015-04-21 01:14:28 -07:00
Frederick F. Kautz IV cd5cad755f Merge pull request #471 from fkautz/pr_out_adding_comment 2015-04-20 21:02:43 -07:00
Frederick F. Kautz IV 9e3ca3a92f Adding comment 2015-04-20 21:01:41 -07:00
Frederick F. Kautz IV ff698f1c1a Merge pull request #470 from fkautz/pr_out_adding_more_tests_for_cp_fixing_few_minor_bugs 2015-04-20 20:54:37 -07:00
Frederick F. Kautz IV 02c2616dc4 Adding more tests for cp, fixing few minor bugs 2015-04-20 20:53:20 -07:00
Frederick F. Kautz IV 0c8d955e73 Merge pull request #469 from fkautz/pr_out_full_coverage_of_domb 2015-04-20 19:38:20 -07:00
Frederick F. Kautz IV e61639897d Full coverage of doMb 2015-04-20 19:35:56 -07:00
Harshavardhana f818440833 Merge pull request #468 from harshavardhana/pr_out_windows_fixes_for_get_getobjectmetadata_and_list_
Windows fixes for Get(), GetObjectMetadata() and List()
2015-04-20 18:07:34 -07:00
Harshavardhana d7e4be17b0 Windows fixes for Get(), GetObjectMetadata() and List() 2015-04-20 18:04:17 -07:00
Frederick F. Kautz IV 59ebf12a6f Merge pull request #466 from fkautz/pr_out_adding_tests_for_cmd_common_isvalidretry 2015-04-20 17:03:40 -07:00
Frederick F. Kautz IV ca64587c96 Adding tests for cmd-common isValidRetry 2015-04-20 17:01:44 -07:00
Frederick F. Kautz IV 6109b2a6ff Merge pull request #465 from fkautz/pr_out_removing_unnecessary_match 2015-04-20 16:28:52 -07:00
Frederick F. Kautz IV a8e97f35a5 Removing unnecessary match 2015-04-20 16:27:15 -07:00
Harshavardhana 1bf61f990d Merge pull request #463 from harshavardhana/pr_out_add_filesystem_windows_support_also_cannot_reproduce_281_anymore_fixes_281 2015-04-20 16:17:46 -07:00
Harshavardhana ccd63ab302 Add filesystem Windows support, also cannot reproduce #281 anymore - fixes #281 2015-04-20 16:15:21 -07:00
Frederick F. Kautz IV b940312b13 Merge pull request #462 from fkautz/pr_out_adding_auth_tests 2015-04-20 15:42:19 -07:00
Frederick F. Kautz IV e2bae764fa Adding auth tests 2015-04-20 15:28:46 -07:00
Frederick F. Kautz IV bba4b46c87 Merge pull request #460 from fkautz/pr_out_updating_clbanning_mxj 2015-04-20 15:16:27 -07:00
Frederick F. Kautz IV 7b0a4a9da6 Updating clbanning/mxj 2015-04-20 15:13:36 -07:00
Harshavardhana 5e3368c04a Merge pull request #461 from harshavardhana/pr_out_make_sure_to_properly_exit_if_requested_theme_not_available_also_re_structure_console_package_a_bit 2015-04-20 13:22:23 -07:00
Harshavardhana af1cb1b478 Make sure to properly exit if requested theme not available, also re-structure console package a bit 2015-04-20 13:19:52 -07:00
Frederick F. Kautz IV 0c7805e65f Merge pull request #459 from fkautz/pr_out_renaming_statbucket_to_stat 2015-04-20 12:52:22 -07:00
Frederick F. Kautz IV 33869c524a Renaming StatBucket to Stat 2015-04-20 12:47:11 -07:00
Harshavardhana cce6a25b14 Merge pull request #458 from harshavardhana/pr_out_fix_a_bug_introduced_in_qdb_migration_commit_27d87fdd8ec268446c238009cb86af1b255582dc_when_config_file_doesn_t_exist 2015-04-20 12:25:35 -07:00
Harshavardhana 12a7895710 Fix a bug introduced in qdb migration commit 27d87fdd8e when config file doesn't exist 2015-04-20 12:23:21 -07:00
Harshavardhana 9a5d145f33 Merge pull request #457 from harshavardhana/pr_out_for_mc_cp_if_target_doesn_t_have_a_bucket_try_to_create_one_just_like_its_recursive_version 2015-04-20 02:41:11 -07:00
Harshavardhana 94ca6ffac1 For ./mc cp if target doesn't have a bucket try to create one, just like its recursive version 2015-04-20 02:37:28 -07:00
Harshavardhana a4c1d26ccb Implement fsClient tests - fixes #433 2015-04-20 02:34:06 -07:00
Harshavardhana f0aceedbd3 Merge pull request #456 from harshavardhana/pr_out_add_missing_assertexpectations_for_previous_commit 2015-04-20 01:19:23 -07:00
Harshavardhana a2b886a6e9 Add missing AssertExpectations() for previous commit 2015-04-20 01:17:52 -07:00
Harshavardhana 7adbf1b800 Merge pull request #455 from harshavardhana/pr_out_enable_testcopyrecursive_back_test_passes_cleanly_now 2015-04-20 01:10:42 -07:00
Harshavardhana d66898048d Enable TestCopyRecursive() back, test passes cleanly now 2015-04-20 01:05:21 -07:00
Harshavardhana 0951211515 Merge pull request #454 from harshavardhana/pr_out_add_a_new_retry_flag_to_change_default_retry_count 2015-04-19 22:47:45 -07:00
Harshavardhana d407c753c5 Add a new --retry flag to change default retry count 2015-04-19 22:46:23 -07:00
Harshavardhana e728cd9857 Add 'isValidRetry()' to retry for only network level errors 2015-04-19 22:46:00 -07:00
Harshavardhana 5d2da2ff30 ./mc ls and mb were printing redundant prefixes - fix them 2015-04-19 22:02:39 -07:00
Harshavardhana d420a59025 Merge pull request #453 from harshavardhana/pr_out_fix_incomplete_progressbar_problem_we_should_proactively_finish_progressbar_fixes_452 2015-04-19 21:44:26 -07:00
Harshavardhana 51032e9773 Fix incomplete progressBar problem, we should proactively .Finish() progressbar - fixes #452
Previously wouldn't flush out remaining data, it would work for Object Storage
Get()/Put() due to invariable delays and overhead.
2015-04-19 21:40:48 -07:00
Harshavardhana 87a230ea11 Update Godeps mxj and pb 2015-04-19 21:27:42 -07:00
Harshavardhana 7afa620afa Merge pull request #444 from harshavardhana/pr_out_now_clients_only_take_urls 2015-04-19 19:58:33 -07:00
Harshavardhana f37412777a Fix various merge conflicts, TestCopyRecursive() disabled for now will renable after fixing it 2015-04-19 19:56:29 -07:00
Harshavardhana ac4e5a88b8 Add help as reserved argument for aliasName 2015-04-19 19:39:59 -07:00
Harshavardhana 7487f6fe9c Print proper messages in retry() loop 2015-04-19 19:39:59 -07:00
Harshavardhana a2098d865c Remove redundant config check command, config is validated at mc start anyways 2015-04-19 19:39:03 -07:00
Harshavardhana df94fdf08a Rename parseURL to getURL, since parsing is outside of mc context now 2015-04-19 19:39:02 -07:00
Harshavardhana 8bc587b8cf Now clients only take URLs - fixes #425
- Interface change, takes only minimal arguments
 - Passing URLs all the way down
 - Bucket and Object awareness only at per client level
2015-04-19 19:39:02 -07:00
Frederick F. Kautz IV 8a0958776e Merge pull request #447 from fkautz/pr_out_adding_more_error_returning_for_ls_cmd 2015-04-18 21:58:32 -07:00
Frederick F. Kautz IV aae6b25262 Adding more error returning for ls cmd 2015-04-18 21:55:30 -07:00
Frederick F. Kautz IV 4b4f17eee2 Merge pull request #446 from fkautz/pr_out_converting_recursive_copy_to_not_fatal_out_but_return_errors 2015-04-18 21:02:20 -07:00
Frederick F. Kautz IV 8b585ae245 Converting recursive copy to not fatal out but return errors 2015-04-18 21:00:47 -07:00
Frederick F. Kautz IV 512f12cf3c Merge pull request #445 from fkautz/pr_out_add_more_tests_fix_attempted_creation_of_bucket_with_file_system 2015-04-18 19:48:53 -07:00
Frederick F. Kautz IV 2f0013fb38 Add more tests, fix attempted creation of bucket with file system 2015-04-18 19:47:54 -07:00
Frederick F. Kautz IV 3423435974 Merge pull request #443 from fkautz/pr_out_splitting_mb_to_be_more_testable 2015-04-18 19:25:07 -07:00
Frederick F. Kautz IV f10da22642 Splitting mb to be more testable 2015-04-18 19:23:50 -07:00
Frederick F. Kautz IV da4fa69626 Merge pull request #442 from fkautz/pr_out_dropping_cyclomatic_complexity_back_down_to_15 2015-04-18 19:15:42 -07:00
Frederick F. Kautz IV 7b35ad9afb Dropping cyclomatic complexity back down to 15 2015-04-18 19:14:19 -07:00
Anand Babu (AB) Periasamy 77de9035d3 Merge pull request #441 from abperiasamy/remove-debug
remove DEBUG message
2015-04-18 19:11:50 -07:00
Anand Babu (AB) Periasamy 7c71fb85a3 remove DEBUG message 2015-04-18 19:10:13 -07:00
Anand Babu (AB) Periasamy da86e36dcf Merge pull request #440 from abperiasamy/err-msg-update
update error message for config generate
2015-04-18 19:09:26 -07:00
Anand Babu (AB) Periasamy 8635773258 update error message for config generate 2015-04-18 19:05:38 -07:00
Frederick F. Kautz IV 808f9529e8 Merge pull request #438 from fkautz/pr_out_adding_more_tests 2015-04-18 19:01:19 -07:00
Frederick F. Kautz IV 445508c1b0 Adding more tests 2015-04-18 19:00:12 -07:00
Anand Babu (AB) Periasamy 6996803192 Merge pull request #437 from abperiasamy/deepdiff
qdb store diff keys and deep diff
2015-04-18 18:42:03 -07:00
Anand Babu (AB) Periasamy f7656e0946 qdb store diff keys and deep diff 2015-04-18 18:40:17 -07:00
Frederick F. Kautz IV dd44d3355f Merge pull request #436 from fkautz/pr_out_adding_test_for_ls_cmd 2015-04-18 18:34:11 -07:00
Frederick F. Kautz IV 91c408551e Adding test for ls cmd 2015-04-18 18:32:09 -07:00
Harshavardhana 6a22df287a Merge pull request #435 from harshavardhana/pr_out_move_major_url_handling_into_client_as_part_of_425 2015-04-18 17:30:06 -07:00
Harshavardhana 8606a7db9b Move major url handling into client as part of #425 2015-04-18 17:29:01 -07:00
Harshavardhana ba071d24bf Merge pull request #434 from harshavardhana/pr_out_check_if_err_is_nil_from_saveconfig_before_switch_type_fixes_427 2015-04-18 16:54:33 -07:00
Harshavardhana 32d6a2be82 Check if err is nil from saveConfig() before switch type - fixes #427 2015-04-18 16:51:54 -07:00
Harshavardhana 16e3cc4729 Merge pull request #430 from harshavardhana/pr_out_error_messages_simplified_now_with_reason_fixes_286 2015-04-18 16:47:28 -07:00
Harshavardhana 4b50a2bac3 Error messages simplified now with reason - fixes #286 2015-04-18 16:46:26 -07:00
Frederick F. Kautz IV df049336bf Merge pull request #429 from fkautz/pr_out_fixing_build 2015-04-18 16:36:17 -07:00
Frederick F. Kautz IV 7c2e859ec8 fixing build 2015-04-18 16:35:09 -07:00
Frederick F. Kautz IV d95b2f33f4 Merge pull request #428 from fkautz/pr_out_refactoring_dolistcmd_to_be_more_testable 2015-04-18 16:33:36 -07:00
Frederick F. Kautz IV 2a28b2b1fb Refactoring doListCmd to be more testable 2015-04-18 16:33:26 -07:00
Frederick F. Kautz IV 6e7d7aa7ee Merge pull request #426 from fkautz/pr_out_renaming_docmdlist_to_runcmdlist 2015-04-18 16:09:59 -07:00
Frederick F. Kautz IV 1f6273ec04 Renaming doCmdList to runCmdList 2015-04-18 16:08:11 -07:00
Harshavardhana 7c2992e1d1 Merge pull request #423 from harshavardhana/pr_out_make_all_lexical_paths_file_path_path_path_path_behave_similar_fixes_419
Make all lexical paths file:///<path> ../<path> <path>/../../<path - behave similar - fixes #419
2015-04-18 14:25:49 -07:00
Harshavardhana e58844ead5 Make all lexical paths file:///<path> ../<path> <path>/../../<path - behave similar - fixes #419
./mc ls, ./mc mb, ./mc cp supported and overall code simplification
2015-04-18 14:24:33 -07:00
Frederick F. Kautz IV 711b684994 Merge pull request #424 from fkautz/pr_out_we_shouldn_t_make_code_more_complex_to_make_gocyclo_happy_raising_gocyclo_limit 2015-04-18 12:09:51 -07:00
Frederick F. Kautz IV 5691629ecd we shouldn't make code more complex to make gocyclo happy. raising gocyclo limit 2015-04-18 10:05:18 -07:00
Anand Babu (AB) Periasamy 426a12f0b9 Merge pull request #422 from abperiasamy/remove-retry-struct
replaced retry with simple loop
2015-04-18 00:23:02 -07:00
Anand Babu (AB) Periasamy b77ea5e763 replaced retry with simple loop 2015-04-18 00:19:08 -07:00
Frederick F. Kautz IV 449ac416f0 Merge pull request #415 from fkautz/pr_out_adding_recursive_copy_test 2015-04-17 21:35:10 -07:00
Frederick F. Kautz IV ddbe0eee63 Adding recursive copy test 2015-04-17 21:33:48 -07:00
Harshavardhana be3b420bba Merge pull request #416 from harshavardhana/pr_out_revert_alias_behavior_make_it_passthrough_and_make_object_storage_errors_human_readable 2015-04-17 21:32:35 -07:00
Harshavardhana c706e152c6 Revert Alias behavior, make it passthrough and make Object Storage errors human readable 2015-04-17 21:31:15 -07:00
Harshavardhana 1f9136ffc5 Print proper errors message received on the wire from any Object Storage 2015-04-17 20:54:24 -07:00
Harshavardhana 29cdb51e06 Merge pull request #414 from harshavardhana/pr_out_review_error_messages_part_of_286 2015-04-17 20:33:11 -07:00
Harshavardhana 39d3f1439b Review error messages part of #286 2015-04-17 20:31:35 -07:00
Harshavardhana 5f4d89ccd5 Deprecate bash-completion support 2015-04-17 20:17:27 -07:00
Frederick F. Kautz IV 07ddad4b1c Merge pull request #413 from fkautz/pr_out_adding_more_mocks 2015-04-17 20:06:07 -07:00
Frederick F. Kautz IV 1daee3e076 Adding more mocks 2015-04-17 20:04:54 -07:00
Frederick F. Kautz IV bc89b4acbb Merge pull request #411 from fkautz/pr_out_recreating_mock_for_new_test 2015-04-17 19:23:15 -07:00
Harshavardhana aee3fddeb2 Merge pull request #412 from harshavardhana/pr_out_migrate_config_to_qdb
Migrate config to qdb
2015-04-17 18:30:17 -07:00
Harshavardhana 27d87fdd8e Migrate config to qdb 2015-04-17 18:28:18 -07:00
Frederick F. Kautz IV 2b4da8aa12 Recreating mock for new test 2015-04-17 18:24:46 -07:00
Frederick F. Kautz IV 08f868df82 Merge pull request #410 from fkautz/pr_out_moving_getnewclient_to_manager 2015-04-17 17:38:38 -07:00
Frederick F. Kautz IV d2e68e4ab3 Moving getNewClient to manager 2015-04-17 17:37:25 -07:00
Harshavardhana 8e7640ff4a Merge pull request #409 from harshavardhana/pr_out_qdb_should_use_reflection_to_get_the_original_data_from_json_marshal_unmarshal
QDB should use reflection to get the original data from json Marshal/Unmarshal
2015-04-17 17:35:07 -07:00
Harshavardhana 529f513efb QDB should use reflection to get the original data from json Marshal/Unmarshal 2015-04-17 17:33:12 -07:00
Frederick F. Kautz IV d0e55550a5 Merge pull request #408 from fkautz/pr_out_removing_context_build_dep_from_docopycmdrecursive 2015-04-17 17:28:20 -07:00
Frederick F. Kautz IV 721d7d0bea Removing context build dep from doCopyCmdRecursive 2015-04-17 17:27:17 -07:00
Frederick F. Kautz IV af756ad02e Merge pull request #407 from fkautz/pr_out_moving_client_manager_to_commons 2015-04-17 17:16:33 -07:00
Frederick F. Kautz IV baa14b99ff Merge pull request #406 from fkautz/pr_out_minor_cleanup 2015-04-17 17:13:09 -07:00
Frederick F. Kautz IV 1f2220e260 Moving client manager to commons 2015-04-17 17:12:42 -07:00
Frederick F. Kautz IV 40a78491a7 Minor cleanup 2015-04-17 17:03:37 -07:00
Anand Babu (AB) Periasamy c0d95a52c7 Merge pull request #404 from abperiasamy/win-color
disable console theme on Windows
2015-04-17 16:32:12 -07:00
Anand Babu (AB) Periasamy 040b15b240 disable console theme on Windows 2015-04-17 16:31:30 -07:00
Harshavardhana 23e6a3f6c3 Merge pull request #403 from abperiasamy/remove-urltype
replace urltype to string
2015-04-17 16:18:17 -07:00
Anand Babu (AB) Periasamy b28541a1b6 replace urltype to string 2015-04-17 16:12:03 -07:00
Harshavardhana f815ad45a0 Merge pull request #402 from harshavardhana/pr_out_bring_multipartupload_interface_stubs 2015-04-16 23:46:37 -07:00
Harshavardhana 5d1ec28e9d Bring MultiPartUpload interface stubs 2015-04-16 23:44:47 -07:00
Harshavardhana f393d390bb Merge pull request #401 from harshavardhana/pr_out_implement_recursive_upload_to_many_targets
Implement recursive upload to many targets
2015-04-16 21:14:49 -07:00
Harshavardhana 37d3e54859 Implement recursive upload to many targets 2015-04-16 21:12:36 -07:00
Harshavardhana 2b8e531ec7 Merge pull request #400 from harshavardhana/pr_out_move_retry_to_try_
Move retry to try()
2015-04-16 20:54:39 -07:00
Frederick F. Kautz IV 09bf5f8474 Merge pull request #399 from fkautz/pr_out_minor_edit_normalizing_go_imports 2015-04-16 20:53:03 -07:00
Harshavardhana 378314a3a7 Move retry to try() 2015-04-16 20:52:30 -07:00
Frederick F. Kautz IV 5d18863f15 minor edit, normalizing go imports 2015-04-16 20:51:22 -07:00
Frederick F. Kautz IV 11063214f9 Merge pull request #398 from fkautz/pr_out_speeding_up_travis_by_not_testing_on_1_4 2015-04-16 20:33:36 -07:00
Frederick F. Kautz IV a5e5a1191a Speeding up travis by not testing on 1.4 2015-04-16 20:31:34 -07:00
Frederick F. Kautz IV 5b287dbab1 Merge pull request #396 from fkautz/pr_out_adding_test_for_copy 2015-04-16 20:29:02 -07:00
Frederick F. Kautz IV 8b5eff1040 Adding test for copy 2015-04-16 20:27:19 -07:00
Anand Babu (AB) Periasamy 012243bf97 Merge pull request #397 from abperiasamy/url2urlStr
handle URL as a string instead of url.URL
2015-04-16 20:26:07 -07:00
Anand Babu (AB) Periasamy 490c9939b2 handle URL as a string instead of url.URL 2015-04-16 20:24:18 -07:00
Harshavardhana a4b8e7253c Merge pull request #393 from harshavardhana/pr_out_now_newreq_doesn_t_panic_inside_returns_err_properly_use_iodine 2015-04-16 20:21:11 -07:00
Harshavardhana d38b93ad0d Simplify retry() code further 2015-04-16 20:19:07 -07:00
Harshavardhana 1f230fb2ce Now newReq() doesn't panic inside, returns err properly - use iodine 2015-04-16 20:17:18 -07:00
Harshavardhana 1468cc47ff Add retries 5 times currently supported for ./mc ls, ./mc mb 2015-04-16 20:17:18 -07:00
Anand Babu (AB) Periasamy 3bdcc1e993 Merge pull request #395 from abperiasamy/replace-mini-copy
Modern Copy to Mini Copy
2015-04-16 20:15:28 -07:00
Anand Babu (AB) Periasamy 90f853a00f Modern Copy to Mini Copy 2015-04-16 20:13:52 -07:00
Anand Babu (AB) Periasamy 642cf34e9b Merge pull request #394 from abperiasamy/urltype-win
detect URL type + win support
2015-04-16 20:01:25 -07:00
Anand Babu (AB) Periasamy 2da1d3dd68 get URL type + win support 2015-04-16 19:59:15 -07:00
Frederick F. Kautz IV 83e0d2d727 Merge pull request #392 from fkautz/pr_out_adding_more_error_checking 2015-04-16 19:24:52 -07:00
Frederick F. Kautz IV 7d8e065548 Adding more error checking 2015-04-16 19:23:13 -07:00
Frederick F. Kautz IV 1f32af47ac Merge pull request #391 from fkautz/pr_out_better_error_handling_in_docopycmd 2015-04-16 19:18:54 -07:00
Frederick F. Kautz IV 8927a626d2 Better error handling in doCopyCmd 2015-04-16 19:16:28 -07:00
Anand Babu (AB) Periasamy 7ee94dda3c Merge pull request #390 from abperiasamy/json-win
support DOS format config file on MS Windows OS
2015-04-16 19:16:21 -07:00
Anand Babu (AB) Periasamy a24af2098e support DOS format config file on MS Windows OS 2015-04-16 19:12:59 -07:00
Frederick F. Kautz IV 5c7b278a72 Merge pull request #389 from fkautz/pr_out_wrapping_client_calls_around_a_client_manager_to_facilitate_testing 2015-04-16 18:31:40 -07:00
Frederick F. Kautz IV c780040870 Wrapping client calls around a client manager to facilitate testing 2015-04-16 18:29:00 -07:00
Frederick F. Kautz IV 610a1c0841 Merge pull request #388 from fkautz/pr_out_extracting_url_parsing_from_docopycmd_to_runcopycmd 2015-04-16 18:22:48 -07:00
Frederick F. Kautz IV 7af0c630e3 Extracting URL parsing from doCopyCmd to runCopyCmd 2015-04-16 18:21:13 -07:00
Frederick F. Kautz IV 282a947587 Merge pull request #387 from fkautz/pr_out_first_round_of_copy_refactoring_to_be_more_testable 2015-04-16 18:14:53 -07:00
Frederick F. Kautz IV 5863d7078a First round of copy refactoring to be more testable 2015-04-16 18:13:33 -07:00
Harshavardhana 92b9074d1f Merge pull request #386 from harshavardhana/pr_out_implement_getpartial_for_fsclient_and_renamed_files_unix_go_as_we_bring_in_windows_specific_support 2015-04-16 17:38:28 -07:00
Harshavardhana f6463dec1f Implement GetPartial() for fsClient, and renamed files _unix.go as we bring in windows specific support 2015-04-16 17:36:42 -07:00
Harshavardhana 644b0952f1 Merge pull request #385 from harshavardhana/pr_out_remove_dead_error 2015-04-16 17:03:44 -07:00
Harshavardhana 0d972285a1 Remove dead error 2015-04-16 17:02:13 -07:00
Frederick F. Kautz IV a746db9d2d Merge pull request #384 from fkautz/pr_out_disable_bash_completion_fixes_379 2015-04-16 16:01:24 -07:00
Frederick F. Kautz IV 1ac8895014 Disable bash completion. Fixes #379. 2015-04-16 15:58:50 -07:00
Harshavardhana 0eaf6ddb5f Merge pull request #383 from harshavardhana/pr_out_prefix_error_messages_with_mc_part_of_286 2015-04-16 15:57:27 -07:00
Harshavardhana 0935573255 Prefix error messages with mc: part of #286 2015-04-16 15:53:33 -07:00
Harshavardhana 0702f392ba Merge pull request #382 from harshavardhana/pr_out_implment_recursive_upload_and_download_fixes_372_373
Implment recursive upload and download - fixes #372 #373
2015-04-16 02:11:06 -07:00
Harshavardhana 31e873faf6 Implment recursive upload and download - fixes #372 #373
- currently only supports single target
2015-04-16 02:05:00 -07:00
Harshavardhana 2055d66138 Merge pull request #381 from harshavardhana/pr_out_enhance_getobjectmetadata_to_return_etag_as_well_precursor_to_recursive_cp 2015-04-16 00:56:01 -07:00
Harshavardhana 97511ca6b8 Enhance GetObjectMetadata() to return ETag as well, precursor to "recursive" cp 2015-04-16 00:51:53 -07:00
Harshavardhana ccf6f279d5 Merge pull request #380 from harshavardhana/pr_out_support_putbucket_for_fsclient_to_do_subdirectories 2015-04-14 22:38:10 -07:00
Harshavardhana 473013dd17 Support PutBucket() for fsClient to do subdirectories 2015-04-14 22:30:15 -07:00
Anand Babu (AB) Periasamy 767b18cc31 Merge pull request #378 from abperiasamy/quiet
issue#371 implement --quiet
2015-04-14 19:39:22 -07:00
Anand Babu (AB) Periasamy 5583555ca8 issue#371 implement --quiet 2015-04-14 19:38:17 -07:00
Frederick F. Kautz IV 3c46eeb43b Merge pull request #377 from fkautz/pr_out_removing_dead_code 2015-04-14 18:31:28 -07:00
Frederick F. Kautz IV e722892d9d Removing dead code 2015-04-14 18:29:13 -07:00
Frederick F. Kautz IV d6932a2ccc Merge pull request #376 from fkautz/pr_out_iodine_traces_only_print_with_debug_flag_fixes_283 2015-04-14 18:25:29 -07:00
Frederick F. Kautz IV d14e4f4473 Iodine traces only print with --debug flag. Fixes #283 2015-04-14 18:23:01 -07:00
Frederick F. Kautz IV 579b5374ed Merge pull request #375 from fkautz/pr_out_removing_quiet_dead_code_will_be_implemented_gh_issue_exists 2015-04-14 17:56:51 -07:00
Frederick F. Kautz IV d1a216c10a Removing quiet, dead code. Will be implemented (gh issue exists) 2015-04-14 17:54:43 -07:00
Frederick F. Kautz IV e5efa23d81 Merge pull request #369 from fkautz/pr_out_cmd_ls_now_treats_urltype_file_as_list_objects_instead_of_list_buckets_always_closes_365 2015-04-14 16:29:51 -07:00
Frederick F. Kautz IV 72ec63fbab cmd-ls now treats urlType=file as list objects instead of list buckets always. Closes #365. 2015-04-14 16:20:22 -07:00
Frederick F. Kautz IV 00985b5989 Merge pull request #368 from fkautz/pr_out_fix_for_list_objects_permissions_should_be_in_walk_itself_not_after_walk_fixes_364 2015-04-14 14:49:27 -07:00
Frederick F. Kautz IV dbcf66a5e8 Fix for list objects permissions should be in walk itself, not after walk. Fixes #364. 2015-04-14 14:16:49 -07:00
Frederick F. Kautz IV 11e0d9c927 Merge pull request #367 from fkautz/pr_out_fs_driver_ignores_directories_and_files_it_has_no_access_to 2015-04-14 14:08:57 -07:00
Frederick F. Kautz IV b5cf534915 fs driver ignores directories and files it has no access to 2015-04-14 14:01:03 -07:00
Harshavardhana 1f7f080936 Merge pull request #363 from harshavardhana/pr_out_simplify_console_further 2015-04-14 05:14:53 -07:00
Harshavardhana 6bfb0b0b7c Simplify console further 2015-04-14 05:12:45 -07:00
Anand Babu (AB) Periasamy c1ecbac689 Merge pull request #362 from abperiasamy/color-theme
console theme
2015-04-14 02:56:31 -07:00
Anand Babu (AB) Periasamy b0cae379fa console theme 2015-04-14 02:55:04 -07:00
Frederick F. Kautz IV 374e7696fa Merge pull request #361 from fkautz/pr_out_reenabling_go_vet 2015-04-13 21:29:00 -07:00
Frederick F. Kautz IV d31e915df6 Reenabling go vet 2015-04-13 21:27:10 -07:00
Harshavardhana 75e35a372c Merge pull request #360 from harshavardhana/pr_out_implement_qdb_store_merge_diff_functionality 2015-04-13 20:48:39 -07:00
Harshavardhana 9b8df8b79a Implement Qdb Store - Merge/Diff functionality 2015-04-13 20:45:37 -07:00
Harshavardhana 93bc32ceba Merge pull request #359 from harshavardhana/pr_out_add_windows_examples_for_cp_ls 2015-04-13 17:15:12 -07:00
Harshavardhana 539a3bde7c Add windows examples for cp, ls 2015-04-13 17:10:56 -07:00
Harshavardhana 35b3dc48b9 Merge pull request #358 from harshavardhana/pr_out_add_url_parse_for_c_windows_path 2015-04-13 16:46:07 -07:00
Harshavardhana 5ea8e2b633 Add url parse for C:\ windows path 2015-04-13 16:40:56 -07:00
Frederick F. Kautz IV c1e577b9f3 Merge pull request #357 from fkautz/pr_out_removing_unneeded_deps_from_checkdeps 2015-04-13 16:38:45 -07:00
Frederick F. Kautz IV 450b99f2b9 Removing unneeded deps from checkdeps 2015-04-13 11:49:59 -07:00
Frederick F. Kautz IV 33c939f8b4 Merge pull request #356 from fkautz/pr_out_renaming_statobject_to_getobjectmetadata 2015-04-13 11:44:46 -07:00
Frederick F. Kautz IV c9b01650fd Renaming StatObject to GetObjectMetadata 2015-04-13 11:44:39 -07:00
Harshavardhana ad3eb5af96 Merge pull request #355 from harshavardhana/pr_out_statbucket_should_honor_http_statusmovedpermanently_returned_by_s3
StatBucket() should honor http.StatusMovedPermanently returned by S3
2015-04-13 04:15:33 -07:00
Harshavardhana 539b073147 StatBucket() should honor http.StatusMovedPermanently returned by S3 2015-04-13 04:13:39 -07:00
Harshavardhana 35a3af3d38 Implement blockingWriter for fsClient just like s3 2015-04-13 04:12:38 -07:00
Harshavardhana ab812e1055 Contract url parser into urlParser object 2015-04-13 04:12:03 -07:00
Harshavardhana c5e7b47fce Merge pull request #354 from harshavardhana/pr_out_make_mc_ls_multi_target
Make ./mc ls multi-target
2015-04-12 23:43:49 -07:00
Harshavardhana 4f3db3d263 Make ./mc ls multi-target 2015-04-12 23:42:16 -07:00
Harshavardhana c999798d5e Merge pull request #353 from harshavardhana/pr_out_now_mc_config_handles_and_documents_config_generation_fixes_341
Now mc config handles and documents config generation - fixes #341
2015-04-12 23:32:53 -07:00
Harshavardhana 36a5d3a05a Now mc config handles and documents config generation - fixes #341 2015-04-12 23:29:10 -07:00
Harshavardhana 8d928bc449 Merge pull request #351 from harshavardhana/pr_out_fix_alias_handling_fixes_350 2015-04-12 17:58:20 -07:00
Harshavardhana 5665d28a7c Fix alias handling, fixes #350 2015-04-12 17:56:50 -07:00
Frederick F. Kautz IV 3233be9928 Merge pull request #352 from fkautz/pr_out_reordering_getnewclient_parameters 2015-04-12 17:47:55 -07:00
Frederick F. Kautz IV 53c534dea9 Reordering getNewClient parameters 2015-04-12 17:47:41 -07:00
Harshavardhana 837b28983f Merge pull request #349 from harshavardhana/pr_out_update_license_headers_to_modern_copy_c
Update license headers to Modern Copy (C)
2015-04-12 16:02:31 -07:00
Harshavardhana 8b811f6ac9 Update license headers to Modern Copy (C) 2015-04-12 16:00:50 -07:00
Harshavardhana 93c9011861 Separate out Put() operation for readablity, rename functions SourceReader and TargetWriters 2015-04-12 15:53:26 -07:00
Harshavardhana 26b8d6fd62 Fix Auth handling bug - fixes #348, no accesskeyid and secretid as valid case 2015-04-12 15:52:30 -07:00
Harshavardhana 2982439407 Add more typed errors and remove references for fmt.Errorf and errors.New 2015-04-12 15:51:21 -07:00
Frederick F. Kautz IV 743d6d9b7a Merge pull request #347 from fkautz/pr_out_adding_slack_notifications 2015-04-12 11:46:13 -07:00
Frederick F. Kautz IV 320f938bc0 Adding slack notifications 2015-04-12 11:44:44 -07:00
Frederick F. Kautz IV 302870ea08 Merge pull request #346 from fkautz/pr_out_fix_build 2015-04-12 11:42:36 -07:00
Frederick F. Kautz IV 20c83f53ce Fix build 2015-04-12 11:35:39 -07:00
Frederick F. Kautz IV 5ae3081d35 Merge pull request #345 from fkautz/pr_out_s3_put_writer_now_blocks_on_close 2015-04-12 11:26:14 -07:00
Frederick F. Kautz IV c479b3833f s3 put writer now blocks on close 2015-04-12 11:26:05 -07:00
Harshavardhana 18617b6050 Merge pull request #344 from harshavardhana/pr_out_remove_site_ 2015-04-11 21:53:32 -07:00
Harshavardhana 02e34dc177 Remove site/* 2015-04-11 21:53:17 -07:00
Harshavardhana 1464871cbb Merge pull request #343 from harshavardhana/pr_out_improve_errors_strictly_type_them_first_cut_286
Improve errors strictly type them, first cut #286
2015-04-11 21:52:01 -07:00
Harshavardhana 0508022597 Improve errors strictly type them, first cut #286 2015-04-11 21:48:00 -07:00
Frederick F. Kautz IV b270a4d6ba Merge pull request #339 from fkautz/pr_out_minor_cleanup_from_refactoring 2015-04-11 21:33:39 -07:00
Frederick F. Kautz IV 5528ebdf71 Minor cleanup from refactoring 2015-04-11 21:32:25 -07:00
Frederick F. Kautz IV 7550571ece Refactoring copy and put to work with writers instead of readers 2015-04-11 21:30:24 -07:00
Harshavardhana da0479fa22 Merge pull request #338 from harshavardhana/pr_out_turn_off_unicode_box_drawing_on_windows_print_with_simple_ansi_characters_fixes_285
Turn off unicode box drawing on windows, print with simple ANSI characters - fixes #285
2015-04-11 21:29:51 -07:00
Harshavardhana 577d747bf1 Turn off unicode box drawing on windows, print with simple ANSI characters - fixes #285 2015-04-11 21:27:50 -07:00
Harshavardhana d42d70bee3 Merge pull request #337 from harshavardhana/pr_out_add_make_bucket_multi_target_fixes_288
Add make bucket multi target - fixes #288
2015-04-11 21:08:22 -07:00
Harshavardhana 58fd38d703 Add make bucket multi target - fixes #288 2015-04-11 21:06:28 -07:00
Harshavardhana aa0c4ac256 Merge pull request #336 from harshavardhana/pr_out_all_commands_now_work_with_fs_client_fixes_290
All commands now work with fs client - fixes #290
2015-04-11 20:55:41 -07:00
Harshavardhana 3914036db4 All commands now work with fs client - fixes #290 2015-04-11 20:53:53 -07:00
Anand Babu (AB) Periasamy 21a9d1f6f9 Merge pull request #335 from abperiasamy/user-agent
rfc compliant user-agent
2015-04-11 20:40:15 -07:00
Anand Babu (AB) Periasamy e49cb08c5e rfc compliant user-agent 2015-04-11 20:38:46 -07:00
Harshavardhana 0302336f44 Update README.md 2015-04-11 18:13:27 -07:00
Frederick F. Kautz IV c578e9a097 Merge pull request #334 from fkautz/pr_out_telling_travis_we_don_t_need_sudo_access_it_ll_run_in_a_docker_container_now
Telling travis we don't need sudo access, it'll run in a docker container now.
2015-04-11 18:01:03 -07:00
Frederick F. Kautz IV af44775163 Telling travis we don't need sudo access, it'll run in a docker container now. 2015-04-11 17:53:14 -07:00
Harshavardhana 9da23a64dc Merge pull request #333 from harshavardhana/pr_out_add_proper_path_check_for_mc 2015-04-11 17:34:08 -07:00
Harshavardhana 3971e97e5f Add proper path check for mc 2015-04-11 17:33:07 -07:00
Frederick F. Kautz IV 46bb259164 Merge pull request #332 from fkautz/pr_out_fixing_build 2015-04-11 17:15:44 -07:00
Frederick F. Kautz IV fb2643a06b Fixing build 2015-04-11 17:15:10 -07:00
Anand Babu (AB) Periasamy ad27c3080d Merge pull request #330 from abperiasamy/modern-copy
minio client becomes modern copy
2015-04-11 17:15:10 -07:00
Frederick F. Kautz IV 3f2724a015 Merge pull request #331 from fkautz/pr_out_starting_refactoring_of_cp_to_make_it_more_testable 2015-04-11 17:14:23 -07:00
Frederick F. Kautz IV f415472d37 Starting refactoring of cp to make it more testable 2015-04-11 17:14:12 -07:00
Anand Babu (AB) Periasamy e7a2699ab2 minio client becomes modern copy 2015-04-11 17:11:38 -07:00
Harshavardhana 87370b3cf6 Merge pull request #324 from harshavardhana/pr_out_move_from_file_to_fs_and_finish_listobjects_add_test_stubs 2015-04-11 17:04:21 -07:00
Harshavardhana afca8b620a Move from file to fs and finish ListObjects() - add test stubs 2015-04-11 17:02:35 -07:00
Harshavardhana 4206e3fc60 Update README.md 2015-04-11 16:42:15 -07:00
Harshavardhana bff0c8a971 Merge pull request #329 from harshavardhana/pr_out_travis_possible_build_fix 2015-04-11 16:37:03 -07:00
Harshavardhana a40c08bfae Travis possible build fix 2015-04-11 16:35:29 -07:00
Harshavardhana 2d29c9becb Merge pull request #328 from harshavardhana/pr_out_remove_yasm_dependency_for_mc 2015-04-11 16:08:18 -07:00
Harshavardhana a47bf39849 Remove yasm dependency for mc 2015-04-11 16:08:01 -07:00
Frederick F. Kautz IV 3659c50a86 Merge pull request #327 from fkautz/pr_out_adding_config_test 2015-04-11 16:05:41 -07:00
Frederick F. Kautz IV 63a0ab89fe Adding config test 2015-04-11 16:05:32 -07:00
Harshavardhana b88243714a Merge pull request #326 from harshavardhana/pr_out_add_travis_build 2015-04-11 16:04:54 -07:00
Harshavardhana 5191060e6c Add travis build 2015-04-11 16:04:19 -07:00
Harshavardhana 1d170e17a5 Merge pull request #325 from harshavardhana/pr_out_update_readme_md 2015-04-11 15:53:58 -07:00
Harshavardhana bd038b4b41 Update README.md 2015-04-11 15:53:40 -07:00
Harshavardhana 954952a49d Merge pull request #323 from harshavardhana/pr_out_few_more_changes_to_qdb 2015-04-11 01:45:37 -07:00
Harshavardhana 38767d57e9 Few more changes to qdb 2015-04-11 01:45:16 -07:00
Harshavardhana b1762d1446 Merge pull request #322 from harshavardhana/pr_out_add_locking_for_qdb 2015-04-11 01:40:31 -07:00
Harshavardhana d1eadd93d6 Add locking for qdb 2015-04-11 01:40:01 -07:00
Anand Babu (AB) Periasamy aa8be0c228 Merge pull request #321 from abperiasamy/qconfig-integrate
version compare method and tests
2015-04-11 01:03:12 -07:00
Anand Babu (AB) Periasamy f183dc4f92 version compare method and tests 2015-04-11 01:02:46 -07:00
Frederick F. Kautz IV 945943041d Merge pull request #320 from fkautz/pr_out_using_switch_instead_of_if_statement_for_path 2015-04-10 23:34:42 -07:00
Frederick F. Kautz IV fa62b85a5a Using switch instead of if statement for path 2015-04-10 23:34:34 -07:00
Harshavardhana 8879bc6986 Merge pull request #319 from harshavardhana/pr_out_add_notice 2015-04-10 21:25:05 -07:00
Harshavardhana 4d8b348e17 Add notice 2015-04-10 21:24:45 -07:00
Harshavardhana d30b84f2b8 Update README.md 2015-04-10 21:18:01 -07:00
Harshavardhana b4993d57f1 Merge pull request #318 from harshavardhana/pr_out_remove_docs_directory_approaching_self_documentation 2015-04-10 21:10:05 -07:00
Harshavardhana 1e8c803478 Remove docs directory, approaching self documentation 2015-04-10 21:09:45 -07:00
Frederick F. Kautz IV 02d4153ffd Merge pull request #317 from fkautz/pr_out_adding_test_function_for_getting_config_file 2015-04-10 18:42:21 -07:00
Frederick F. Kautz IV 295020468a Adding test function for getting config file 2015-04-10 18:42:07 -07:00
Harshavardhana 1ab9abf304 Merge pull request #316 from harshavardhana/pr_out_remove_mkdocs 2015-04-10 18:39:10 -07:00
Harshavardhana 253bcab416 Remove mkdocs 2015-04-10 18:35:46 -07:00
Anand Babu (AB) Periasamy 7479394538 Merge pull request #315 from abperiasamy/qconf
Keep Version struct as input
2015-04-10 18:34:50 -07:00
Anand Babu (AB) Periasamy bdea263f3a Keep Version struct as input 2015-04-10 18:33:37 -07:00
Frederick F. Kautz IV cb69289a7d Merge pull request #314 from fkautz/pr_out_getting_rid_of_get_trace_transport_method 2015-04-10 18:15:02 -07:00
Frederick F. Kautz IV 44c9c3397b Getting rid of get trace transport method 2015-04-10 18:12:49 -07:00
Frederick F. Kautz IV 05953cda89 Merge pull request #313 from fkautz/pr_out_removing_fatal_side_effects_from_get_bash_completion_config 2015-04-10 17:50:55 -07:00
Frederick F. Kautz IV 84c5c244b9 Removing fatal side effects from get bash completion config 2015-04-10 17:50:44 -07:00
Harshavardhana 64c0a75c59 Merge pull request #312 from harshavardhana/pr_out_build_fix 2015-04-10 17:34:11 -07:00
Harshavardhana a812c862e1 Build fix 2015-04-10 17:33:59 -07:00
Harshavardhana 046e2e78d0 Merge pull request #311 from harshavardhana/pr_out_improvements_on_qconfig 2015-04-10 17:32:04 -07:00
Harshavardhana 3f13630491 Merge pull request #310 from harshavardhana/pr_out_add_file_client_wip 2015-04-10 17:31:52 -07:00
Harshavardhana 3b6356416e Improvements on qconfig 2015-04-10 17:31:16 -07:00
Harshavardhana 51bb8f199b Add file client 2015-04-10 17:06:41 -07:00
Frederick F. Kautz IV d095b345e1 Merge pull request #309 from fkautz/pr_out_updating_how_config_files_are_retrieved 2015-04-10 14:29:45 -07:00
Frederick F. Kautz IV 37741a292a Updating how config files are retrieved 2015-04-10 14:29:12 -07:00
Anand Babu (AB) Periasamy d07d92a32b Merge pull request #308 from abperiasamy/qconfig
qconfig persistent config file and state store
2015-04-10 14:02:01 -07:00
Anand Babu (AB) Periasamy 1fc541202e qconfig persistent config file and state store 2015-04-10 14:00:54 -07:00
Frederick F. Kautz IV 931e347cae Merge pull request #307 from fkautz/pr_out_adding_tests_for_aliasexpand 2015-04-10 13:38:31 -07:00
Frederick F. Kautz IV a0e424c8d2 Adding tests for aliasExpand 2015-04-10 13:36:43 -07:00
Harshavardhana 40ac9b4b39 Merge pull request #306 from harshavardhana/pr_out_move_colors_to_console_package_now_implement_colored 2015-04-10 01:16:26 -07:00
Harshavardhana ad35fe72d0 Move colors to console package, now implement colored
- Fatal, Fatalf, Fatalln
 - Error, Errorln
 - Info, Infof, Infoln
2015-04-10 01:14:47 -07:00
Frederick F. Kautz IV 495e0f7511 Merge pull request #305 from fkautz/pr_out_fixing_lint 2015-04-10 00:17:02 -07:00
Frederick F. Kautz IV c018b58e08 Fixing lint 2015-04-10 00:16:52 -07:00
Frederick F. Kautz IV e90df68ab8 Merge pull request #304 from fkautz/pr_out_adding_more_tests_removed_alias_expander_dependency_on_config 2015-04-10 00:16:02 -07:00
Frederick F. Kautz IV 83d9ba24d3 Adding more tests, removed alias expander dependency on config 2015-04-10 00:15:54 -07:00
Frederick F. Kautz IV 0f992310a1 Merge pull request #303 from fkautz/pr_out_adding_deadcode_analyzer 2015-04-09 23:46:10 -07:00
Frederick F. Kautz IV 6e25b8959e Adding deadcode analyzer 2015-04-09 23:46:00 -07:00
Frederick F. Kautz IV 1c25da5081 Merge pull request #302 from fkautz/pr_out_removing_more_dead_code 2015-04-09 23:41:19 -07:00
Frederick F. Kautz IV c48fe39767 Removing more dead code 2015-04-09 23:41:11 -07:00
Frederick F. Kautz IV 4a0aa8b701 Merge pull request #301 from fkautz/pr_out_fix_build_break 2015-04-09 23:38:35 -07:00
Frederick F. Kautz IV 3fa6695142 Fix build break 2015-04-09 23:38:28 -07:00
Frederick F. Kautz IV df512e70ee Merge pull request #300 from fkautz/pr_out_minor_cleanup_of_pkg_client_code 2015-04-09 23:34:28 -07:00
Frederick F. Kautz IV a7b082a676 Minor cleanup of pkg/client code 2015-04-09 23:34:20 -07:00
Harshavardhana 5a0a5587ca Merge pull request #299 from harshavardhana/pr_out_add_missing_comments 2015-04-09 23:33:10 -07:00
Harshavardhana b6781c7152 Add missing comments 2015-04-09 23:32:50 -07:00
Frederick F. Kautz IV 73ff61a319 Merge pull request #298 from fkautz/pr_out_removing_more_dead_code 2015-04-09 20:35:46 -07:00
Frederick F. Kautz IV 31e9f50333 Removing more dead code 2015-04-09 20:35:33 -07:00
Frederick F. Kautz IV 8e5c524a9d Merge pull request #297 from fkautz/pr_out_removing_unused_colors_method 2015-04-09 20:28:19 -07:00
Frederick F. Kautz IV 70b909ec19 Removing unused colors method 2015-04-09 20:28:04 -07:00
Frederick F. Kautz IV a8c4ff4036 Merge pull request #296 from fkautz/pr_out_killing_an_unused_function 2015-04-09 20:26:37 -07:00
Frederick F. Kautz IV ab2fb8f1c6 Killing an unused function 2015-04-09 20:26:24 -07:00
Frederick F. Kautz IV b45b7a366d Merge pull request #295 from fkautz/pr_out_updating_error_printing_in_cmd_config 2015-04-09 20:21:28 -07:00
Frederick F. Kautz IV a7ffa3aba7 Updating error printing in cmd-config 2015-04-09 20:21:17 -07:00
Frederick F. Kautz IV d5baa821c5 Merge pull request #294 from fkautz/pr_out_updating_s3_timestamp_works_with_rfc3339 2015-04-09 20:20:26 -07:00
Frederick F. Kautz IV e55ff6a337 Updating s3 timestamp, works with RFC3339 2015-04-09 20:19:35 -07:00
Harshavardhana 862e4ba027 Merge pull request #293 from harshavardhana/pr_out_add_proper_collection_of_config_functions_to_manage_mc_configuration 2015-04-09 19:06:49 -07:00
Harshavardhana c8292b0391 Add proper collection of config functions to manage mc configuration.
Not intergrated yet.
2015-04-09 18:55:28 -07:00
Anand Babu (AB) Periasamy 1d52524f1f Merge pull request #282 from abperiasamy/show-cmd-help-no-arg
show help when no args are passed
2015-04-09 14:38:29 -07:00
Anand Babu (AB) Periasamy 87aa2539d0 show help when no args are passed 2015-04-09 14:37:29 -07:00
Harshavardhana 9e5b24ae41 Merge pull request #280 from harshavardhana/pr_out_remove_an_additional_newline 2015-04-09 03:57:13 -07:00
Harshavardhana 4b2af7d447 Remove an additional newline 2015-04-09 03:56:53 -07:00
Harshavardhana f276d24870 Merge pull request #279 from harshavardhana/pr_out_avoid_using_versions_for_mc_update_use_build_time_instead 2015-04-09 03:55:02 -07:00
Harshavardhana bec4dc2b6c Avoid using versions for ./mc update, use build time instead.
Also a minor fix in glob matching should be a proper HostURL
2015-04-09 03:53:32 -07:00
Anand Babu (AB) Periasamy 4e57bca160 Merge pull request #278 from abperiasamy/config
Config
2015-04-09 02:45:54 -07:00
Anand Babu (AB) Periasamy 22187fb0d7 config bug fixes and removed default-host support 2015-04-09 02:44:59 -07:00
Anand Babu (AB) Periasamy 99240bfb2d config bug fixes and removed default-host support 2015-04-09 02:41:59 -07:00
Frederick F. Kautz IV 0850aedd0c Merge pull request #277 from fkautz/pr_out_removing_more_unused_functions_and_variables 2015-04-08 23:21:13 -07:00
Frederick F. Kautz IV 4f4e472856 Removing more unused functions and variables 2015-04-08 23:21:05 -07:00
Frederick F. Kautz IV 4fbb1e33e4 Merge pull request #276 from fkautz/pr_out_simplifying_switch_case 2015-04-08 23:18:18 -07:00
Frederick F. Kautz IV a2d0bfdc62 Simplifying switch case 2015-04-08 23:18:07 -07:00
Frederick F. Kautz IV c8a96326ec Merge pull request #275 from fkautz/pr_out_removing_unused_code 2015-04-08 23:13:13 -07:00
Frederick F. Kautz IV 9f791493ae Removing unused code 2015-04-08 23:13:03 -07:00
Harshavardhana 22d9ab06f1 Merge pull request #274 from harshavardhana/pr_out_mc_client_interface_now_provides_typed_errors 2015-04-08 22:24:24 -07:00
Harshavardhana 6e9fe6dc56 mc client interface now provides typed errors 2015-04-08 22:21:01 -07:00
Harshavardhana d21d925bd4 Merge pull request #273 from harshavardhana/pr_out_add_mc_update_command 2015-04-08 21:44:48 -07:00
Harshavardhana e8baa6c8e9 Add ./mc update command 2015-04-08 21:41:59 -07:00
Frederick F. Kautz IV 608a1e78e0 Merge pull request #272 from fkautz/pr_out_running_goimports 2015-04-08 21:01:28 -07:00
Frederick F. Kautz IV bf3182ac6b Running goimports 2015-04-08 21:01:18 -07:00
Frederick F. Kautz IV f9f2087b2d Merge pull request #271 from fkautz/pr_out_updating_iodine 2015-04-08 19:48:02 -07:00
Frederick F. Kautz IV 540e0db62a Updating iodine 2015-04-08 19:47:23 -07:00
Frederick F. Kautz IV 047edd30f2 Merge pull request #270 from fkautz/pr_out_fixing_iodine_error_type 2015-04-08 19:12:58 -07:00
Frederick F. Kautz IV 63570f1dcf Fixing iodine error type 2015-04-08 19:12:50 -07:00
Frederick F. Kautz IV 63aad71dcd Merge pull request #269 from fkautz/pr_out_updating_last_config_error_check_to_no_longer_use_sprintf 2015-04-08 19:06:18 -07:00
Frederick F. Kautz IV 8474b4dbbf Updating last config error check to no longer use Sprintf 2015-04-08 19:06:10 -07:00
Frederick F. Kautz IV 1705852ba8 Merge pull request #268 from fkautz/pr_out_updating_debug_to_only_print_when_debug_mode_is_enabled_removed_init_function 2015-04-08 19:05:25 -07:00
Frederick F. Kautz IV ba49d34579 Updating debug to only print when debug mode is enabled. Removed init() function 2015-04-08 19:05:13 -07:00
Harshavardhana 7b7c4c2269 Merge pull request #266 from harshavardhana/pr_out_iodine_deps_now_coming_in_from_minio_io_pkg_iodine 2015-04-08 18:20:36 -07:00
Harshavardhana 8ea467294f iodine deps now coming in from minio-io/pkg/iodine 2015-04-08 18:19:51 -07:00
Harshavardhana 5ca54388d1 Merge pull request #265 from harshavardhana/pr_out_update_documentation 2015-04-08 17:03:12 -07:00
Harshavardhana abd2bd729b Update documentation 2015-04-08 17:02:50 -07:00
Harshavardhana 76d7710122 Merge pull request #264 from harshavardhana/pr_out_add_pkg_client_file_stub_file 2015-04-08 16:21:54 -07:00
Harshavardhana 0b583f6240 Add pkg/client/file stub file 2015-04-08 16:21:39 -07:00
Harshavardhana bb1324148f Revert "Get rid of client interface and move s3 back into a struct"
This reverts commit 4a2facfa7b.
2015-04-08 16:18:20 -07:00
Harshavardhana 166c6dc5b8 Add make bucket custom help template 2015-04-08 16:17:39 -07:00
Harshavardhana e9efc7870e Merge pull request #263 from harshavardhana/pr_out_get_rid_of_client_interface_and_move_s3_back_into_a_struct 2015-04-08 16:06:40 -07:00
Harshavardhana 4a2facfa7b Get rid of client interface and move s3 back into a struct 2015-04-08 16:06:25 -07:00
Harshavardhana 3af592d342 Merge pull request #262 from harshavardhana/pr_out_now_mc_on_windows_uses_c_users_username_mc_as_the_config_directory 2015-04-08 15:16:16 -07:00
Harshavardhana 3eac44879f Now mc on windows uses C:\Users\<Username>\mc as the config directory 2015-04-08 15:14:56 -07:00
Harshavardhana 5dd77e770f Fix typo 2015-04-08 13:58:25 -07:00
Harshavardhana 076d115046 Merge pull request #261 from harshavardhana/pr_out_cleanup_s3_client_iodize_it_as_well 2015-04-08 13:56:40 -07:00
Harshavardhana e279da678f Cleanup s3 client, iodize it as well 2015-04-08 13:56:20 -07:00
Frederick F. Kautz IV 961ff150f5 Merge pull request #260 from fkautz/pr_out_updating_how_colors_go_now_takes_variable_number_of_inputs 2015-04-08 13:37:25 -07:00
Frederick F. Kautz IV f9fb2077fd Updating how colors go, now takes variable number of inputs 2015-04-08 13:36:44 -07:00
Harshavardhana 8624c5060f Merge pull request #259 from harshavardhana/pr_out_remove_donut_and_other_deps_out_of_mc 2015-04-08 12:21:00 -07:00
Harshavardhana dd159a0f96 Remove donut and other deps out of mc 2015-04-08 11:23:49 -07:00
Frederick F. Kautz IV 09a38f33d2 Merge pull request #258 from fkautz/pr_out_adding_more_iodine_to_url_parser 2015-04-06 13:15:42 -07:00
Frederick F. Kautz IV fcf208b11f Adding more iodine to url parser 2015-04-06 13:15:32 -07:00
Frederick F. Kautz IV 3cd07c2b80 Merge pull request #257 from fkautz/pr_out_go_files_now_conform_to_gimports 2015-04-06 12:56:25 -07:00
Frederick F. Kautz IV 4fb394c982 go files now conform to gimports 2015-04-06 12:56:10 -07:00
Harshavardhana 61472bbd81 Merge pull request #256 from harshavardhana/pr_out_add_coloring_outside_of_iodine_moving_iodine_messages_to_log_debug 2015-04-06 12:51:23 -07:00
Harshavardhana 44d0f86e54 Add coloring outside of iodine, moving iodine messages to log.Debug 2015-04-06 12:50:15 -07:00
Frederick F. Kautz IV 649cb0cded Merge pull request #253 from fkautz/pr_out_adding_iodine_to_ls_and_mb 2015-04-06 12:30:05 -07:00
Frederick F. Kautz IV 3293d71516 Adding iodine to ls and mb 2015-04-06 12:29:27 -07:00
Harshavardhana c2baf8876d Merge pull request #255 from harshavardhana/pr_out_add_sprintf_format_strings 2015-04-06 12:20:22 -07:00
Harshavardhana 4f75905dbf Add Sprintf format strings 2015-04-06 12:20:10 -07:00
Harshavardhana a3dd22d110 Merge pull request #254 from harshavardhana/pr_out_move_from_mgutz_ansi_to_fatih_color_package_on_popularity_and_cleaner_api 2015-04-06 12:17:47 -07:00
Harshavardhana 9e7c367545 Move from mgutz/ansi to fatih/color package on popularity and cleaner API.
This package also supports Windows console coloring.
2015-04-06 12:17:34 -07:00
Frederick F. Kautz IV f9bc767a72 Merge pull request #252 from fkautz/pr_out_adding_iodine_to_cmd_ls_go 2015-04-06 12:12:48 -07:00
Frederick F. Kautz IV af3a4ed93e Adding iodine to cmd-ls.go 2015-04-06 12:12:35 -07:00
Frederick F. Kautz IV f4520a328b Merge pull request #251 from fkautz/pr_out_adding_iodine_to_cmd_config 2015-04-06 12:08:25 -07:00
Frederick F. Kautz IV 8e438a7473 Adding iodine to cmd-config 2015-04-06 12:08:17 -07:00
Frederick F. Kautz IV 1cc01d56d3 Merge pull request #250 from fkautz/pr_out_adding_more_iodine_to_cmd_common_go 2015-04-06 11:58:21 -07:00
Frederick F. Kautz IV 36e0846b26 Adding more iodine to cmd-common.go 2015-04-06 11:58:10 -07:00
Harshavardhana 672d1d8099 Merge pull request #249 from harshavardhana/pr_out_update_erasure_to_minio_io_erasure 2015-04-05 23:50:01 -07:00
Harshavardhana 450cb8802d Update erasure to minio-io/erasure 2015-04-05 23:49:43 -07:00
Harshavardhana df5570a0c9 Merge pull request #248 from harshavardhana/pr_out_length_of_items_to_be_zero_in_listobjects_is_a_valid_case 2015-04-05 23:46:32 -07:00
Harshavardhana f2c6faec66 Length of items to be zero in ListObjects is a valid case 2015-04-05 23:46:17 -07:00
Frederick F. Kautz IV 36b644ab4b Merge pull request #247 from fkautz/pr_out_adding_iodine_to_cmd_common 2015-04-05 21:45:56 -07:00
Frederick F. Kautz IV 73627de0ca Adding iodine to cmd-common 2015-04-05 21:45:38 -07:00
Frederick F. Kautz IV 45d936a5bd Merge pull request #246 from fkautz/pr_out_close_reader_to_prevent_fd_leak 2015-04-05 21:44:20 -07:00
Frederick F. Kautz IV e1a8a44d0f Close reader to prevent fd leak 2015-04-05 21:44:07 -07:00
Harshavardhana 53d6ba1712 Merge pull request #245 from harshavardhana/pr_out_multitarget_now_works_properly_fixes_244 2015-04-05 19:10:33 -07:00
Harshavardhana 118713814f Multitarget now works properly - fixes #244 2015-04-05 19:10:04 -07:00
Frederick F. Kautz IV 6aac499aa9 Merge pull request #243 from fkautz/pr_out_replacing_check_v1_with_minio_io_check_in_deps 2015-04-05 16:20:15 -07:00
Frederick F. Kautz IV e671ad0ca4 Replacing check.v1 with minio-io/check in deps 2015-04-05 16:19:41 -07:00
Frederick F. Kautz IV 1cd40a3507 Updating donut_test to use minio-io/check 2015-04-05 16:15:14 -07:00
Frederick F. Kautz IV aa4c7c8dcd Merge pull request #242 from fkautz/pr_out_updating_build_constants 2015-04-05 16:12:35 -07:00
Frederick F. Kautz IV a1188d9778 Updating build constants 2015-04-05 16:12:03 -07:00
Frederick F. Kautz IV 934bc87a1d Merge pull request #241 from fkautz/pr_out_updating_aliases_go_with_iodine 2015-04-05 16:01:00 -07:00
Frederick F. Kautz IV a05d5f0fd9 Updating aliases.go with iodine 2015-04-05 16:00:34 -07:00
Harshavardhana 0f92312653 Merge pull request #240 from harshavardhana/pr_out_update_donut_with_latest_changes 2015-04-05 16:00:32 -07:00
Harshavardhana d64658ed7b Update donut with latest changes 2015-04-05 16:00:05 -07:00
Frederick F. Kautz IV 03f7da784e Merge pull request #239 from fkautz/pr_out_updating_mxj_to_latest 2015-04-05 15:56:50 -07:00
Frederick F. Kautz IV e6a7d63609 Updating mxj to latest 2015-04-05 15:56:41 -07:00
Anand Babu (AB) Periasamy 0e7382bc5c Merge pull request #238 from abperiasamy/donut-cleanup
donut cleanup
2015-04-05 11:22:10 -07:00
Anand Babu (AB) Periasamy ec0360d9bd donut cleanup 2015-04-05 11:21:19 -07:00
Anand Babu (AB) Periasamy c892793810 Merge pull request #237 from abperiasamy/simplify-ls-cmd
simplify ls cmd as well
2015-04-05 01:47:59 -07:00
Anand Babu (AB) Periasamy af41562446 simplify ls cmd as well 2015-04-05 01:43:00 -07:00
Anand Babu (AB) Periasamy c6e45e9714 Merge pull request #236 from abperiasamy/list-obj-simple
Simplify ListObject API
2015-04-05 01:32:12 -07:00
Anand Babu (AB) Periasamy d7a12dcef4 Simplify ListObject API 2015-04-05 01:29:13 -07:00
Harshavardhana e6c6bedf76 Merge pull request #235 from harshavardhana/pr_out_appreciate_maxkeys_in_donut_listobjects_ 2015-04-05 01:07:59 -07:00
Harshavardhana a8434f9f40 Appreciate MaxKeys in donut ListObjects() 2015-04-05 01:07:37 -07:00
Harshavardhana ddf0150234 Update donut tests 2015-04-05 00:22:58 -07:00
Harshavardhana 1f898e125e out of memory issue fixed #234
This is fixed by removing bytes.Buffer to calculate md5 during upload
2015-04-04 22:23:07 -07:00
Harshavardhana 871e717a31 When using waitGroup avoid channel, they seem to hang 2015-04-04 19:50:03 -07:00
Harshavardhana a3196ae6ed Add iodine and other deps 2015-04-04 19:33:47 -07:00
Frederick F. Kautz IV aa63a9f4bd Merge pull request #233 from fkautz/pr_out_updating_multicopy_to_use_waitgroup_and_return_errors_instead_of_indexes 2015-04-04 19:24:25 -07:00
Frederick F. Kautz IV fe2e5b8a0a Updating multicopy to use waitgroup and return errors instead of indexes 2015-04-04 19:24:08 -07:00
Frederick F. Kautz IV 9144195d17 Adding iodine to main and cp 2015-04-04 19:08:16 -07:00
Harshavardhana eba7ee4e0c Update donut with new minio-io/donut changes
Merging this directly, due to some github.com issues
2015-04-04 18:35:23 -07:00
Harshavardhana 7931d66a23 Merge pull request #232 from harshavardhana/pr_out_cleanup_http_tracer_code 2015-04-04 18:30:06 -07:00
Harshavardhana 1d8564d003 cleanup http tracer code 2015-04-04 18:29:41 -07:00
Harshavardhana e3108dd37c Merge pull request #231 from harshavardhana/pr_out_add_new_cli_changes 2015-04-04 16:44:54 -07:00
Harshavardhana 9e265de883 Add new cli changes 2015-04-04 16:43:27 -07:00
Anand Babu (AB) Periasamy a4da5e74c8 Merge pull request #230 from abperiasamy/copy-multi-target
multi target copy
2015-04-04 14:09:28 -07:00
Anand Babu (AB) Periasamy 97ef5809ff multi target copy 2015-04-04 14:07:45 -07:00
Harshavardhana 3b49d62fe6 Merge pull request #229 from harshavardhana/pr_out_update_donut_to_minio_io_donut 2015-04-03 19:08:39 -07:00
Harshavardhana 0ed440e15a Update donut to minio-io/donut 2015-04-03 19:08:25 -07:00
Harshavardhana 83e85ee847 Merge pull request #228 from harshavardhana/pr_out_update_to_donut_changes_at_minio_io_donut 2015-04-03 16:05:10 -07:00
Harshavardhana d9837ce073 Update to donut changes at minio-io/donut
~~~
 Now erasure coding is based on number of disks i.e

      N = 1 (no erasure encoding or decoding)
      N > 1 (data chunks are K = quotient + remainder)
            (parity chunks are M = quotient)
      Where N is divided by 2
~~~
2015-04-03 15:59:40 -07:00
Anand Babu (AB) Periasamy b540688971 Merge pull request #227 from abperiasamy/unified-client
first step to rewrite copy cmd
2015-04-03 13:05:01 -07:00
Anand Babu (AB) Periasamy 02e7e35d7b first step to rewrite copy cmd 2015-04-03 12:56:28 -07:00
Harshavardhana 5ea9971c9b Merge pull request #226 from harshavardhana/pr_out_update_donut_to_new_changes_at_minio_io_donut 2015-04-02 18:36:31 -07:00
Harshavardhana cbbe7bd8b2 Update donut to new changes at minio-io/donut 2015-04-02 18:36:16 -07:00
Harshavardhana 7cf882f33e Merge pull request #225 from harshavardhana/pr_out_use_the_new_customhelptemplate_cli_command_option_for_detailed_help 2015-04-02 16:09:52 -07:00
Harshavardhana f4f6f138d7 Use the new CustomHelpTemplate cli.Command{} option for detailed help 2015-04-02 16:09:00 -07:00
Harshavardhana 4456b33b17 Merge pull request #224 from harshavardhana/pr_out_build_everything_by_default 2015-04-02 14:38:09 -07:00
Harshavardhana f37b63bf2c Build everything by default 2015-04-02 14:37:24 -07:00
Harshavardhana 292c484905 Merge pull request #223 from harshavardhana/pr_out_update_donut_to_minio_io_donut 2015-04-02 12:54:44 -07:00
Harshavardhana 5aaa533bda Update donut to minio-io/donut 2015-04-02 12:54:26 -07:00
Harshavardhana 3e9f582805 Merge pull request #222 from harshavardhana/pr_out_now_godep_is_minio_io_godep 2015-04-02 12:52:48 -07:00
Harshavardhana fc41ea94cc Now godep is minio-io/godep 2015-04-02 12:52:32 -07:00
Harshavardhana 967f1cb422 Merge pull request #221 from harshavardhana/pr_out_add_missing_globalmaxkeys 2015-04-01 22:28:54 -07:00
Harshavardhana a8c1507617 Add missing globalMaxKeys 2015-04-01 22:28:37 -07:00
Harshavardhana e99bb09f35 Merge pull request #220 from harshavardhana/pr_out_add_extra_information_into_mc_with_debug 2015-04-01 22:26:26 -07:00
Harshavardhana 45d32b6238 Add extra information into mc with --debug
~~~
MEM:
   Used: 143.48 KB | Allocated: 192.23 KB | Used-Heap: 143.48 KB | Allocated-Heap: 816.00 KB

PLATFORM:
   Host: command | OS: linux | Arch: amd64

RUNTIME:
   Version: go1.4 | CPUs: 4
~~~
2015-04-01 22:25:19 -07:00
Anand Babu (AB) Periasamy 3bd30b3dc5 Merge pull request #219 from abperiasamy/globals
move all global variables to globals
2015-04-01 20:09:41 -07:00
Anand Babu (AB) Periasamy ba233bab60 move all global variables to globals 2015-04-01 20:08:21 -07:00
Harshavardhana ff694ca0f3 Merge pull request #218 from harshavardhana/pr_out_update_erasure_package_from_minio_io_erasure 2015-04-01 19:14:32 -07:00
Harshavardhana 1381b51ad4 Update erasure package from minio-io/erasure 2015-04-01 19:14:18 -07:00
Harshavardhana 2b96f49e68 Merge pull request #217 from harshavardhana/pr_out_mc_now_resumes_donut_downloads_getpartialobject_implemented_for_donut_client 2015-04-01 18:51:27 -07:00
Harshavardhana 4d7471fed7 mc now resumes donut downloads, GetPartialObject() implemented for donut client 2015-04-01 18:50:50 -07:00
Harshavardhana 8b3d6fb80e Merge pull request #216 from harshavardhana/pr_out_update_erasure_code_to_latest 2015-04-01 16:51:05 -07:00
Harshavardhana 14a3d1d6ff Update erasure code to latest 2015-04-01 16:49:45 -07:00
Harshavardhana 621764d081 Merge pull request #215 from harshavardhana/pr_out_purge_xmltime 2015-04-01 13:34:53 -07:00
Harshavardhana 7e56f281fa Purge xmltime 2015-04-01 13:34:42 -07:00
Harshavardhana c72477dead Merge pull request #214 from harshavardhana/pr_out_simplify_donut_client_side 2015-04-01 13:23:34 -07:00
Harshavardhana 2803d404d5 Simplify donut client side 2015-04-01 13:21:41 -07:00
Harshavardhana a9e88ab7b0 Merge pull request #213 from harshavardhana/pr_out_remove_scsi_package 2015-04-01 12:59:58 -07:00
Harshavardhana 2a97f1674a Remove scsi package 2015-04-01 12:58:58 -07:00
Harshavardhana cef2a76748 Merge pull request #212 from harshavardhana/pr_out_make_everything_as_packages 2015-04-01 12:55:57 -07:00
Harshavardhana 720dab89e2 Make everything as packages
- minio-io/erasure
   - minio-io/donut
2015-04-01 12:55:25 -07:00
Harshavardhana aed14d18b1 Merge pull request #211 from harshavardhana/pr_out_now_progress_bar_is_support_for_put_object 2015-03-31 22:58:14 -07:00
Harshavardhana c7221386b2 Now progress bar is support for Put object 2015-03-31 22:57:36 -07:00
Harshavardhana 4111a974bd Merge pull request #210 from harshavardhana/pr_out_support_donut_ls_object_files 2015-03-31 21:39:07 -07:00
Harshavardhana 97bfec7cf1 Support donut ls object files 2015-03-31 21:38:51 -07:00
Harshavardhana 37942d8ab9 Merge pull request #209 from harshavardhana/pr_out_implement_stat_ 2015-03-31 20:38:54 -07:00
Harshavardhana 25c9a41bc1 Implement Stat() 2015-03-31 20:38:26 -07:00
Harshavardhana 4590209ff3 Merge pull request #208 from harshavardhana/pr_out_update_to_latest_changes_from_minio_io_donut_and_other_fixes 2015-03-31 16:35:08 -07:00
Harshavardhana a2cd9ebbc2 Update to latest changes from minio-io/donut and other fixes
completed work

  - ListObjects() - buckets(sorted)
  - ListBuckets() - objects(sorted)
  - Get() - object
  - Put() - object

TODO: further cleanups in progress
2015-03-31 16:28:22 -07:00
Harshavardhana 94eb935743 Merge pull request #207 from harshavardhana/pr_out_implement_getobject_multi_disk 2015-03-31 00:33:16 -07:00
Harshavardhana 939c52ef3a Implement GetObject() multi-disk 2015-03-31 00:32:56 -07:00
Harshavardhana 2571e801ff Merge pull request #206 from harshavardhana/pr_out_use_single_place_for_maxkeys_at_client_interface 2015-03-30 19:07:39 -07:00
Harshavardhana 7e6c1cc705 Use single place for Maxkeys at client interface 2015-03-30 19:07:23 -07:00
Harshavardhana 0c0fcedff9 Merge pull request #205 from harshavardhana/pr_out_mc_and_new_donut_now_supports_listobjects_ 2015-03-30 19:04:17 -07:00
Harshavardhana 5055071b8d mc and new Donut now supports ListObjects() 2015-03-30 19:04:00 -07:00
Harshavardhana 08919db278 Merge pull request #204 from harshavardhana/pr_out_build_fix_erroneous_change_in_previous_commit 2015-03-30 17:39:17 -07:00
Harshavardhana 18906bce8b Build fix erroneous change in previous commit 2015-03-30 17:38:58 -07:00
Harshavardhana 4db07943ee Merge pull request #203 from harshavardhana/pr_out_new_changes_put_object_donut_works_with_multi_disk 2015-03-30 17:25:47 -07:00
Harshavardhana 4648965761 New changes, Put object donut works with multi-disk 2015-03-30 17:25:23 -07:00
Harshavardhana 7c9c1cbf67 Merge pull request #202 from harshavardhana/pr_out_remove_detach_attach_make_donut_from_mc_cli_moved_to_minio_io_donut_project 2015-03-30 13:12:02 -07:00
Harshavardhana 5123aa5d05 Remove detach, attach, make donut from mc - cli moved to minio-io/donut project 2015-03-30 13:11:41 -07:00
Harshavardhana e5ddf80133 Merge pull request #201 from harshavardhana/pr_out_remove_stale_code 2015-03-30 01:18:17 -07:00
Harshavardhana 50b219fee7 Remove stale code 2015-03-30 01:17:50 -07:00
Harshavardhana e8ed0b24fd Merge pull request #200 from harshavardhana/pr_out_encoding_erasure_updates_from_minio_io_minio 2015-03-29 14:58:13 -07:00
Harshavardhana 27f9239c6c Encoding erasure updates from minio-io/minio 2015-03-29 14:57:59 -07:00
Harshavardhana e50eacfe7c Merge pull request #199 from harshavardhana/pr_out_enable_detachnode_implement_disk_makefile_and_disk_openfile 2015-03-29 13:33:56 -07:00
Harshavardhana fa5cfa9d02 Enable DetachNode, implement disk.MakeFile and disk.OpenFile 2015-03-29 13:33:20 -07:00
Harshavardhana 4495a805db Merge pull request #198 from harshavardhana/pr_out_refactor_to_move_code_inside_donut 2015-03-28 20:33:08 -07:00
Harshavardhana a286b12891 Refactor to move code inside Donut 2015-03-28 20:32:51 -07:00
Harshavardhana cb240845e0 Build fix 2015-03-28 20:13:35 -07:00
Harshavardhana f6f7e84d16 Merge pull request #197 from harshavardhana/pr_out_now_donut_with_erasure_largely_stub 2015-03-28 20:12:13 -07:00
Harshavardhana 0dc6fb1d40 Now donut with erasure, largely stub 2015-03-28 20:11:00 -07:00
Harshavardhana 2cbb75a947 Merge pull request #196 from harshavardhana/pr_out_update_cli_with_more_changes 2015-03-28 17:44:07 -07:00
Harshavardhana 22275eeea3 Update cli with more changes 2015-03-28 17:43:40 -07:00
Harshavardhana 979e267dc0 Merge pull request #195 from harshavardhana/pr_out_now_donut_ls_donut_mb_supported 2015-03-28 16:55:25 -07:00
Harshavardhana 92c608af31 Now donut ls, donut mb - supported 2015-03-28 16:54:56 -07:00
Harshavardhana cf2a3ee22b Merge pull request #194 from harshavardhana/pr_out_add_newbucket_and_some_more_api_changes 2015-03-28 14:33:53 -07:00
Harshavardhana 00916842b9 Add NewBucket() and some more api changes 2015-03-28 14:32:48 -07:00
Harshavardhana a28c4a0257 Merge pull request #193 from harshavardhana/pr_out_further_changes_to_new_donut 2015-03-28 12:40:39 -07:00
Harshavardhana fa959ef12b Further changes to new Donut 2015-03-28 12:39:55 -07:00
Anand Babu (AB) Periasamy 5555a7a136 Merge pull request #192 from abperiasamy/arg_parser
better args/url parssing
2015-03-27 14:38:35 -07:00
Anand Babu (AB) Periasamy a88f206f4b better args/url parssing 2015-03-27 14:19:32 -07:00
Harshavardhana 0c0fa18234 Merge pull request #191 from harshavardhana/pr_out_add_some_descriptions_on_donut_commands 2015-03-26 22:43:35 -07:00
Harshavardhana 74b0d08f4a Add some descriptions on donut commands 2015-03-26 22:43:07 -07:00
Harshavardhana 45b34d696a Merge pull request #190 from harshavardhana/pr_out_make_donut_commands_more_robust 2015-03-26 22:35:19 -07:00
Harshavardhana b62ee3d3dc Make donut commands more robust 2015-03-26 22:35:10 -07:00
Harshavardhana 77ffd998a1 Merge pull request #189 from harshavardhana/pr_out_new_simplified_donut_specification_improvements_over_previous_donut_implementation 2015-03-26 19:33:37 -07:00
Harshavardhana 4490a75256 New simplified Donut specification, improvements over previous donut implementation 2015-03-26 19:33:24 -07:00
Harshavardhana ccd9f8295d Merge pull request #188 from harshavardhana/pr_out_implement_attach_detach_disk_into_donut_config 2015-03-26 18:48:18 -07:00
Harshavardhana 381f071390 Implement attach, detach disk into donut config 2015-03-26 18:48:00 -07:00
Harshavardhana cfa45d88a9 Merge pull request #187 from harshavardhana/pr_out_add_new_commands_stub_re_arrange_options_as_below 2015-03-26 17:18:07 -07:00
Harshavardhana 8c191cdb23 Add new commands stub, re-arrange options as below
COMMANDS:
   make         make
   attach       attach disk
   detach       detach disk
   heal         heal donut
   rebalance    rebalance
   mb           mb
   cp           cp
   help, h      Shows a list of commands or help for one command
2015-03-26 17:17:40 -07:00
Harshavardhana bd0090484e Merge pull request #186 from harshavardhana/pr_out_add_donut_make_command 2015-03-26 17:07:06 -07:00
Harshavardhana a62661e5f0 Add donut make command 2015-03-26 17:06:27 -07:00
Harshavardhana 1b6a6b746e Merge pull request #185 from harshavardhana/pr_out_git_commit_hash_generator 2015-03-25 23:07:45 -07:00
Harshavardhana 4497de7f1d git commit hash generator 2015-03-25 23:07:33 -07:00
Harshavardhana 1c388fea0e Merge pull request #184 from harshavardhana/pr_out_revert_fix_commit_id 2015-03-25 21:53:38 -07:00
Harshavardhana 0c6fbe50a5 Revert "Fix commit id"
This reverts commit f227809fdb.
2015-03-25 21:53:23 -07:00
Harshavardhana 2384b9dafe Merge pull request #183 from harshavardhana/pr_out_fix_commit_id 2015-03-25 21:41:33 -07:00
Harshavardhana f227809fdb Fix commit id 2015-03-25 21:41:16 -07:00
Harshavardhana ee8c35cf79 Merge pull request #182 from harshavardhana/pr_out_update_iodine 2015-03-25 21:27:06 -07:00
Harshavardhana d54a9bca19 Update iodine 2015-03-25 21:26:57 -07:00
Harshavardhana 114d36e7b9 Merge pull request #181 from harshavardhana/pr_out_update_iodine_for_mc_donut 2015-03-25 21:25:05 -07:00
Harshavardhana 1ddcaebd53 Update iodine for mc donut 2015-03-25 21:24:48 -07:00
Harshavardhana 0822d65e7b Merge pull request #180 from harshavardhana/pr_out_cache_decode_matrix_tables_and_matrix 2015-03-25 19:12:18 -07:00
Anand Babu (AB) Periasamy 48cc36614d cache decode matrix tables and matrix 2015-03-25 19:11:56 -07:00
Harshavardhana acae0bb3a5 Merge pull request #179 from harshavardhana/pr_out_fix_golint_complaints 2015-03-25 18:59:58 -07:00
Harshavardhana 544f50705d Fix golint complaints 2015-03-25 18:59:45 -07:00
Harshavardhana 49828183c3 Merge pull request #178 from harshavardhana/pr_out_add_gocyclo_and_fix_all_its_complaints_use_15_as_cyclomatic_threshold 2015-03-25 18:42:42 -07:00
Harshavardhana 936fda7eac Add gocyclo and fix all its complaints use 15 as cyclomatic threshold 2015-03-25 18:39:42 -07:00
Harshavardhana fdf1658980 Merge pull request #177 from harshavardhana/pr_out_make_code_simpler 2015-03-25 14:24:20 -07:00
Harshavardhana 8d97d218de Make code simpler 2015-03-25 14:23:40 -07:00
Harshavardhana 464a2ec005 Merge pull request #176 from harshavardhana/pr_out_update_from_minio_io_minio 2015-03-25 13:33:52 -07:00
Harshavardhana 124aa34622 Update from minio-io/minio 2015-03-25 13:33:40 -07:00
Harshavardhana 45461ceca5 Merge pull request #175 from harshavardhana/pr_out_add_iodine_to_mc 2015-03-25 13:29:41 -07:00
Harshavardhana 1160f8ad53 Add iodine to mc 2015-03-25 13:29:32 -07:00
Harshavardhana c818f4fddc Merge pull request #174 from harshavardhana/pr_out_build_fix 2015-03-25 13:13:43 -07:00
Harshavardhana 71cdfe5d6f Build fix 2015-03-25 13:13:15 -07:00
Harshavardhana 07a34e98dd Merge pull request #173 from harshavardhana/pr_out_implement_donut_client_to_be_used_with_mc_now_supports_creating_bucket_cp_of_objects_in_and_out 2015-03-25 12:58:56 -07:00
Harshavardhana 3ea3256d87 Implement donut client to be used with mc now supports creating bucket, cp of objects in and out 2015-03-25 12:57:33 -07:00
Harshavardhana 7f029bb0f7 Merge pull request #172 from harshavardhana/pr_out_add_commitid_to_mc 2015-03-25 11:19:17 -07:00
Harshavardhana f6e530898c Add commitID to mc 2015-03-25 11:18:58 -07:00
Harshavardhana 5d1cd8f67b Merge pull request #171 from harshavardhana/pr_out_remove_erroneous_erasure_package_from_godeps_but_keep_split_package 2015-03-24 20:29:44 -07:00
Harshavardhana f56c05e554 Remove erroneous erasure package from Godeps, but keep split package 2015-03-24 20:28:22 -07:00
Harshavardhana 26b392a6ed Merge pull request #170 from harshavardhana/pr_out_move_from_codegangsta_cli_to_minio_io_cli_fork 2015-03-24 20:25:23 -07:00
Harshavardhana bcf41c53c2 Move From codegangsta/cli to minio-io/cli fork 2015-03-24 20:24:51 -07:00
Harshavardhana c8bb7edd08 Merge pull request #169 from harshavardhana/pr_out_erasure_technique_is_now_uint8_handle_it_appropriately 2015-03-24 19:14:54 -07:00
Harshavardhana dc1c59b245 Erasure technique is now uint8, handle it appropriately 2015-03-24 19:13:52 -07:00
Anand Babu (AB) Periasamy c73ebceca2 erasure encode janitor duty 2015-03-24 19:13:44 -07:00
Harshavardhana d1ad07fb62 Merge pull request #168 from harshavardhana/pr_out_handle_errors_properly_during_erasure_decoding_also_populate_technique_and_verify 2015-03-24 18:13:38 -07:00
Harshavardhana 23f14cfd09 Handle errors properly during erasure Decoding, also populate technique and verify 2015-03-24 18:13:18 -07:00
Harshavardhana a20e8e39ed Merge pull request #167 from harshavardhana/pr_out_move_donut_into_storage_exactly_like_minio_io_minio_project 2015-03-24 06:53:13 -07:00
Harshavardhana b124d66d14 Move donut into storage/ exactly like minio-io/minio project.
This would make it easier to pull in and merge changes.
2015-03-24 06:52:57 -07:00
Harshavardhana 016658e399 Merge pull request #166 from harshavardhana/pr_out_pull_changes_from_donut_at_minio_io_minio 2015-03-24 06:50:04 -07:00
Harshavardhana bb00c45c2f Pull changes from donut at Minio-io/minio 2015-03-24 06:49:23 -07:00
Harshavardhana 13a1c3f234 Merge pull request #165 from harshavardhana/pr_out_donut_cp_explicitly_issue_a_close_on_donutwriter 2015-03-23 19:47:16 -07:00
Harshavardhana 2dcd1fc543 Donut cp explicitly issue a Close() on DonutWriter 2015-03-23 19:47:04 -07:00
Harshavardhana 64862d3169 Merge pull request #164 from harshavardhana/pr_out_build_fix 2015-03-23 19:35:59 -07:00
Harshavardhana c8f254c6b2 Build fix 2015-03-23 19:35:42 -07:00
Harshavardhana 15bf7d0d25 Merge pull request #163 from harshavardhana/pr_out_move_back_to_functional_style_for_simplicity 2015-03-23 15:43:21 -07:00
Harshavardhana bd18e3c260 Move back to functional style for simplicity 2015-03-23 15:43:02 -07:00
Harshavardhana f028bdfd75 Merge pull request #162 from harshavardhana/pr_out_move_donut_cmd_into_mc 2015-03-23 14:18:10 -07:00
Harshavardhana deb889d2fb Move donut cmd into ./mc 2015-03-23 14:15:16 -07:00
Harshavardhana 760453fe32 Improve url parser, inherit url.URL 2015-03-23 14:08:33 -07:00
Harshavardhana 9754506a24 Merge pull request #161 from abperiasamy/parseopts 2015-03-23 13:33:35 -07:00
Anand Babu (AB) Periasamy 7259d50862 url parsers 2015-03-23 13:24:27 -07:00
Harshavardhana e7bfa896e9 Merge pull request #160 from harshavardhana/pr_out_implement_donutclient_stub_code_and_other_misc_changes 2015-03-23 00:53:28 -07:00
Harshavardhana 640d860616 Implement donutclient stub code, and other misc changes 2015-03-23 00:52:49 -07:00
Harshavardhana d233740e62 Merge pull request #159 from harshavardhana/pr_out_cleanup_janitor_duty 2015-03-22 20:38:48 -07:00
Anand Babu (AB) Periasamy a8987f924a Cleanup janitor duty 2015-03-22 20:37:41 -07:00
Harshavardhana e6062c518d Merge pull request #158 from harshavardhana/pr_out_co_incide_with_upstream_changes_and_other_misc_changes 2015-03-22 20:30:35 -07:00
Harshavardhana b078e877b3 Co-incide with upstream changes and other misc changes 2015-03-22 20:30:23 -07:00
Harshavardhana 117002a6b3 Merge pull request #157 from harshavardhana/pr_out_fix_composite_literal_uses_unkeyed_fields 2015-03-22 20:15:05 -07:00
Harshavardhana 03248884de Fix composite literal uses unkeyed fields 2015-03-22 20:14:53 -07:00
Harshavardhana 25969ef87a Merge pull request #154 from harshavardhana/pr_out_more_cleanup 2015-03-22 20:04:54 -07:00
Harshavardhana d1550045b3 Donut command 2015-03-22 20:03:39 -07:00
Harshavardhana d1068168dc Implementing client side donut 2015-03-22 20:03:32 -07:00
Harshavardhana 36a0bd6a78 Merge pull request #152 from harshavardhana/pr_out_add_support_for_proc_self_mountinfo 2015-03-21 21:19:03 -07:00
Harshavardhana 6e380c9247 Add support for /proc/self/mountinfo 2015-03-21 21:18:46 -07:00
Harshavardhana 394ef0daa8 Merge pull request #153 from harshavardhana/pr_out_build_fix_go_vet 2015-03-21 21:07:39 -07:00
Harshavardhana 4fceb5c496 Build fix go vet 2015-03-21 21:07:21 -07:00
Harshavardhana bff62f5c11 Merge pull request #151 from harshavardhana/pr_out_add_partition_map_to_scsi_list 2015-03-21 19:51:54 -07:00
Harshavardhana f52f2a7d0a Add Partition map to scsi list 2015-03-21 19:51:36 -07:00
Anand Babu (AB) Periasamy aa0e129597 Merge pull request #150 from abperiasamy/glob_match
glob matching for host configuration in config file
2015-03-20 02:55:08 -07:00
Anand Babu (AB) Periasamy b0479c729c glob matching for host configuration in config file 2015-03-20 02:53:46 -07:00
Anand Babu (AB) Periasamy 6d1e85b0a0 Merge pull request #149 from abperiasamy/config_improvements
new config file format and some restructuring
2015-03-19 18:12:39 -07:00
Anand Babu (AB) Periasamy b855e37945 new config file format and some restructuring 2015-03-19 18:09:56 -07:00
Harshavardhana e054fe651a Merge pull request #148 from harshavardhana/pr_out_move_from_mini_minimalist_for_all_license_headers 2015-03-19 15:05:51 -07:00
Harshavardhana 3403ef08f7 Move from Mini --> Minimalist for all license headers 2015-03-19 15:05:30 -07:00
Harshavardhana f7c83e51e9 Merge pull request #147 from harshavardhana/pr_out_add_scsi_detection_package_for_mc 2015-03-19 15:04:47 -07:00
Harshavardhana 15c53d8399 Add scsi detection package for mc.
This is a generic usable package to be wired up with donut,
eventually facilitating functionalities like 'add-disk', 'remove-disk'
2015-03-19 15:00:54 -07:00
Harshavardhana ed5bf50541 Merge pull request #146 from harshavardhana/pr_out_add_a_way_to_update_alias_using_alias_aliasname_url 2015-03-19 14:24:37 -07:00
Harshavardhana a911f67262 Add a way to update alias using --alias <aliasname> <url> 2015-03-19 14:24:27 -07:00
Harshavardhana a8384f52b2 Merge pull request #145 from harshavardhana/pr_out_update_client_examples_for_listobjects_put_getbucketpolicy 2015-03-19 12:25:53 -07:00
Harshavardhana 927e18a1ed Update client examples for ListObjects, Put/GetBucketPolicy 2015-03-19 12:25:07 -07:00
Harshavardhana b888e0f0b8 Merge pull request #144 from harshavardhana/pr_out_move_s3errors_and_make_it_part_of_standard_s3_package 2015-03-19 00:17:08 -07:00
Harshavardhana 4067b0be18 Move s3errors and make it part of standard s3 package.
Also update 'resourceList' with additional resources from
amazon api.
2015-03-19 00:15:44 -07:00
Harshavardhana 4807cf1eb7 Merge pull request #143 from harshavardhana/pr_out_move_checkdeps_to_buildscripts_additionally_add_patch_sh 2015-03-18 14:22:12 -07:00
Harshavardhana ac8a0e109f Move checkdeps to buildscripts/, additionally add patch.sh
patch.sh patches any source codepath with the patch provided,
for now the patch file included is a way to Hide flags for
codegangsta until it is merged upstream.

Not part of the build yet.
2015-03-18 11:20:26 -07:00
Harshavardhana 635507453e Update Godeps 2015-03-18 10:50:23 -07:00
Harshavardhana df83d1fdcb Merge pull request #142 from harshavardhana/pr_out_update_codegangsta_to_upstream_changes 2015-03-18 10:49:40 -07:00
Harshavardhana 1cbf56de81 Update codegangsta to upstream changes 2015-03-18 10:49:16 -07:00
Anand Babu (AB) Periasamy eece3fddf7 Merge pull request #141 from abperiasamy/second_alias
alias support for second url
2015-03-18 02:35:43 -07:00
Anand Babu (AB) Periasamy f146825cb3 alias support for second url 2015-03-18 02:30:11 -07:00
Harshavardhana 3ff31be6a2 Merge pull request #140 from harshavardhana/pr_out_if_config_json_is_not_created_yet_don_t_eagerly_error_out_handle_it_gracefully 2015-03-17 23:09:55 -07:00
Harshavardhana b378a0d8ae If config.json is not created yet, don't eagerly error out - handle it gracefully 2015-03-17 23:09:12 -07:00
Anand Babu (AB) Periasamy d36c968148 Merge pull request #139 from abperiasamy/checkdeps
use minio's checkdeps
2015-03-17 23:02:18 -07:00
Anand Babu (AB) Periasamy 1fc91fdda6 use minio's checkdeps 2015-03-17 22:58:44 -07:00
Harshavardhana 29adda9801 Merge pull request #138 from abperiasamy/alias_check
Alias check
2015-03-17 22:43:53 -07:00
Anand Babu (AB) Periasamy dc47ae2449 improvements to config file and alias 2015-03-17 22:35:58 -07:00
Anand Babu (AB) Periasamy b3110539a4 alias support 2015-03-17 22:35:58 -07:00
Harshavardhana e142984255 Merge pull request #137 from harshavardhana/pr_out_add_stub_options_and_rename_some_functions 2015-03-17 21:55:00 -07:00
Harshavardhana f7d2f2cf3b Add stub options and rename some functions 2015-03-17 21:54:27 -07:00
Harshavardhana d846c16a93 Merge pull request #136 from harshavardhana/pr_out_adding_erasure_package_copying_from_github_com_minio_io_erasure 2015-03-17 19:38:04 -07:00
Harshavardhana 3920afe120 Adding erasure package copying from github.com/minio-io/erasure 2015-03-17 19:37:10 -07:00
Harshavardhana 7edd0f5ce2 Merge pull request #134 from harshavardhana/pr_out_call_don_t_interfere_with_config_json_updates_while_calling_only_completion 2015-03-16 11:37:06 -07:00
Harshavardhana 302aa7084b Call don't interfere with config.json updates while calling only --completion 2015-03-16 11:35:51 -07:00
Harshavardhana 9ebc2aa138 Merge pull request #133 from harshavardhana/pr_out_remove_unneeded_map_allocation 2015-03-16 11:17:19 -07:00
Harshavardhana 7fd77f522f Remove unneeded Map allocation 2015-03-16 11:11:49 -07:00
Harshavardhana 5e5ff81292 Merge pull request #132 from harshavardhana/pr_out_move_from_fmt_errorf_to_errors_new 2015-03-15 19:53:05 -07:00
Harshavardhana 537fa331ba Move from fmt.Errorf to errors.New
In many cases fmt.Errorf is good enough, but since
error is an interface, you can use arbitrary data
structures as error values, to allow callers to
inspect the details of the error.
2015-03-15 19:52:35 -07:00
Harshavardhana 385abe1bef Merge pull request #131 from harshavardhana/pr_out_move_bash_completion_to_mc_config_subcommand 2015-03-15 18:37:26 -07:00
Harshavardhana 5416124514 Move bash completion to ./mc config subcommand 2015-03-15 18:36:35 -07:00
Harshavardhana f7562ad4a1 Merge pull request #130 from harshavardhana/pr_out_x2j_is_deprecated_new_one_is_to_use_mxj 2015-03-15 18:17:14 -07:00
Harshavardhana e8b2541603 x2j is deprecated - new-one is to use mxj 2015-03-15 18:16:23 -07:00
Harshavardhana 92e72cc760 Merge pull request #129 from harshavardhana/pr_out_do_not_upload_already_uploaded_objects 2015-03-15 17:46:08 -07:00
Harshavardhana 9da373b16d Do not upload already uploaded objects.
fix another bug in Get() and GetPartial()
2015-03-15 17:45:29 -07:00
Anand Babu (AB) Periasamy 38d80a4cd6 Merge pull request #128 from abperiasamy/utc_offset
remove utc offset while listing
2015-03-15 16:58:25 -07:00
Anand Babu (AB) Periasamy f49582d9c8 remove utc offset while listing 2015-03-15 16:56:24 -07:00
Harshavardhana ccc01e5523 Merge pull request #127 from harshavardhana/pr_out_build_fix_use_bucketfromhost 2015-03-15 16:43:46 -07:00
Harshavardhana b2e638105b Build fix use bucketFromHost 2015-03-15 16:43:27 -07:00
Anand Babu (AB) Periasamy b838ba9c3b Merge pull request #126 from abperiasamy/xmlerr
s3 error handling package
2015-03-15 16:42:57 -07:00
Anand Babu (AB) Periasamy 0ba286c359 s3 error handling package 2015-03-15 16:39:00 -07:00
Harshavardhana 9aa12a72e2 Merge pull request #125 from harshavardhana/pr_out_add_key_and_bucket_name_handling_for_s3_properly 2015-03-15 14:12:30 -07:00
Harshavardhana bbe0fc5303 Add key and bucket name handling for s3 properly 2015-03-15 14:12:11 -07:00
Harshavardhana a964b125e3 Merge pull request #124 from harshavardhana/pr_out_remove_redundant_app_name_internally_codegangsta_uses_os_args_0 2015-03-15 03:29:49 -07:00
Harshavardhana 59cfecf0d0 Remove redundant app.Name, internally codegangsta uses os.Args[0] 2015-03-15 03:29:18 -07:00
Harshavardhana d4f1cf51a5 Merge pull request #123 from harshavardhana/pr_out_update_codegangsta_with_upstream 2015-03-15 02:23:49 -07:00
Harshavardhana bbd3d51dfa Update codegangsta with upstream 2015-03-15 02:23:27 -07:00
Harshavardhana 4d7ab9e204 Merge pull request #122 from harshavardhana/pr_out_new_changes_coming 2015-03-15 01:06:57 -07:00
Harshavardhana 427e38d837 New changes coming
- moving away from improper s3:// URI to standard http URI's
  - migrate and test all commands ./mc ls, ./mc cp, ./mc cp -r
  - move s3-trace.go s3/pkg/trace.go, make it part of S3 package
    and document it.
  - various other cleanup.
2015-03-15 01:05:54 -07:00
Harshavardhana 2e69213d04 Merge pull request #120 from harshavardhana/pr_out_upload_files_if_bucket_is_empty 2015-03-13 17:17:26 -07:00
Harshavardhana 6facf352be Upload files if bucket is empty 2015-03-13 17:16:11 -07:00
Harshavardhana 50ddb74fba Merge pull request #119 from harshavardhana/pr_out_print_mc_ls_in_a_proper_format 2015-03-13 15:47:38 -07:00
Harshavardhana ee373be9c8 print ./mc ls in a proper format 2015-03-13 15:46:41 -07:00
Harshavardhana 1bda706663 Merge pull request #118 from harshavardhana/pr_out_update_docs 2015-03-13 03:20:23 -07:00
Harshavardhana be59793b78 Update docs 2015-03-13 03:18:59 -07:00
Harshavardhana b634ae33ac Merge pull request #117 from harshavardhana/pr_out_cosmetic_change_missed_in_previous_commit 2015-03-13 03:02:54 -07:00
Harshavardhana 721dc02918 Cosmetic change missed in previous commit 2015-03-13 03:02:16 -07:00
Harshavardhana 919ee7b270 Merge pull request #116 from harshavardhana/pr_out_add_recursive_directory_upload_and_bucket_download_support_for_mc_cp_with_r_deprecate_mc_sync 2015-03-13 03:01:02 -07:00
Harshavardhana 503fa1f239 Add recursive directory upload and bucket download
support for './mc cp' with -r, deprecate './mc sync'

 ```
  $ ./mc cp -r <directory_name> s3://<yourbucketname>
  $ ./mc cp -r s3://<yourbucketname> <directory_name>
 ```

NOTE: resume is not supported yet
2015-03-13 02:59:57 -07:00
Anand Babu (AB) Periasamy 9036aeeb55 Merge pull request #115 from abperiasamy/opt_uri
empty URI lists top level buckets now & other minor cleanups
2015-03-12 22:33:26 -07:00
Anand Babu (AB) Periasamy ac5a872220 empty URI lists top level buckets now & other minor cleanups 2015-03-12 22:30:51 -07:00
Harshavardhana 0e558ab3d8 Merge pull request #114 from harshavardhana/pr_out_refactor_mc_cp_with_various_modes_of_operation 2015-03-12 19:22:14 -07:00
Harshavardhana 8fd4e4a0bb Refactor ./mc cp with various modes of operation
- First mode of operation supports with style `Path` `S3Path` or `Path` `S3Bucket`
- Second mode of operation supports with style `S3Path` `Path` or `S3Path` `.`
- Third mode of operation supports with style `S3Path` `S3Path` or `S3Path` `S3Bucket`
2015-03-12 19:12:19 -07:00
Anand Babu (AB) Periasamy eb787b5a79 Merge pull request #113 from abperiasamy/transport_bug
fix transport nil bug
2015-03-12 19:10:03 -07:00
Anand Babu (AB) Periasamy 5c7aee2fb5 fix transport nil bug 2015-03-12 19:09:36 -07:00
Anand Babu (AB) Periasamy 98a9bc0b07 Merge pull request #112 from abperiasamy/http_verify
Http verify
2015-03-12 18:35:48 -07:00
Anand Babu (AB) Periasamy a5d8fc114c s3 generic validator and some improvements to httptrace 2015-03-12 18:27:40 -07:00
Harshavardhana 092f1ea511 Merge pull request #111 from harshavardhana/pr_out_build_fix 2015-03-11 18:17:27 -07:00
Harshavardhana 761a331ec4 Build fix 2015-03-11 18:17:04 -07:00
Harshavardhana 7cb1ebd930 Merge pull request #110 from harshavardhana/pr_out_more_restructue_and_add_a_new_cli_option_to_generate_bash_completion_file 2015-03-11 18:15:49 -07:00
Harshavardhana 7ef6214ddd More restructue and add a new cli option to generate bash completion file. 2015-03-11 18:14:19 -07:00
Anand Babu (AB) Periasamy c092140c0e Merge pull request #109 from abperiasamy/file_reorg
renamed source files appropriately
2015-03-11 15:20:45 -07:00
Anand Babu (AB) Periasamy 77207a7477 renamed source files appropriately 2015-03-11 15:17:27 -07:00
Anand Babu (AB) Periasamy 1b979c6e96 Merge pull request #108 from abperiasamy/quiet_flag
disable progress-bar for --quiet flag
2015-03-11 14:41:00 -07:00
Anand Babu (AB) Periasamy 3bcaa23c33 disable progress-bar for --quiet flag 2015-03-11 13:29:06 -07:00
Anand Babu (AB) Periasamy bb080a3fcd Merge pull request #106 from abperiasamy/debug_flag
replace --verbose with --debug and --quiet bool flags
2015-03-11 12:57:07 -07:00
Anand Babu (AB) Periasamy 59ae161e52 replace --verbose with --debug and --quiet bool flags 2015-03-11 12:54:01 -07:00
Harshavardhana bda4eb450d Merge pull request #105 from abperiasamy/httptrace
Tracing support for S3 client
2015-03-11 10:24:15 -07:00
Anand Babu (AB) Periasamy 2dcf5a0390 HTTP trace code vet'ed 2015-03-11 01:24:39 -07:00
Anand Babu (AB) Periasamy 09f72d6f2b improved httptrace framework 2015-03-11 01:24:39 -07:00
Anand Babu (AB) Periasamy ba0fdcaa33 httptrace first commit 2015-03-11 01:24:39 -07:00
Harshavardhana 74c42cccf2 Merge pull request #104 from harshavardhana/pr_out_add_wget_style_format_and_also_use_set_current_position_instead_of_add_ 2015-03-10 21:59:07 -07:00
Harshavardhana dda9d128d5 add wget style format and also use Set() current position instead of 'Add()' 2015-03-10 21:58:51 -07:00
Harshavardhana 3dd09a735a Merge pull request #103 from harshavardhana/pr_out_now_mc_cp_supports_resume_download 2015-03-10 20:32:20 -07:00
Harshavardhana d8328e1d0f Now ./mc cp supports resume download 2015-03-10 20:31:48 -07:00
Harshavardhana 9614b68a61 Merge pull request #102 from harshavardhana/pr_out_add_strict_build_with_vet_fmt_golint 2015-03-10 01:59:21 -07:00
Harshavardhana 306ddac9a7 Add strict build with vet, fmt, golint 2015-03-10 01:58:58 -07:00
Harshavardhana 447f3baec5 Merge pull request #101 from harshavardhana/pr_out_change_name_from_xmlformat_to_actual_understandable_name_iso8601format_ 2015-03-10 01:51:11 -07:00
Harshavardhana d690de5c45 Change name from xmlFormat to actual understandable name `iso8601Format` 2015-03-10 01:50:32 -07:00
Harshavardhana 3826620450 Merge pull request #100 from harshavardhana/pr_out_split_xmltime_to_new_file_and_update_licensing_information 2015-03-08 19:21:59 -07:00
Harshavardhana ab01be0e3c Split xmltime to new file and update licensing information 2015-03-08 19:18:50 -07:00
Harshavardhana bc0245549a Merge pull request #99 from harshavardhana/pr_out_code_cleanup_and_simplification 2015-03-08 18:49:27 -07:00
Harshavardhana f21dc1a990 Code cleanup and simplification
- Print in human-readable not amazon format
   - Send stat() before accessing object, error gracefully
   - Move client and bucket API operations to their own files
   - Remove unused functions, constants and variables
   - Rename API operations to sensible names
        * GetBucket --> ListObjects
        * Buckets --> ListBuckets
2015-03-08 18:47:45 -07:00
Anand Babu (AB) Periasamy d941a665bc Merge pull request #97 from abperiasamy/time_cleanup
xmltime for bucket response as well
2015-03-08 17:35:44 -07:00
Anand Babu (AB) Periasamy 196a334823 xmltime for bucket response as well 2015-03-08 17:33:55 -07:00
Harshavardhana 2a88c8706c Merge pull request #96 from abperiasamy/xml_time_format
xml encoded to native Time.time
2015-03-08 17:05:29 -07:00
Anand Babu (AB) Periasamy e74834745f xml encoded to native Time.time 2015-03-08 16:59:54 -07:00
Anand Babu (AB) Periasamy a72bff85a3 Merge pull request #95 from abperiasamy/comments
added comments
2015-03-08 14:32:03 -07:00
Anand Babu (AB) Periasamy 4eb8e65ebf added comments 2015-03-08 14:23:35 -07:00
Harshavardhana 124722f0bd Merge pull request #94 from harshavardhana/pr_out_simplify_mc_ls 2015-03-08 13:03:26 -07:00
Harshavardhana 8830b92080 Simplify ./mc ls 2015-03-08 13:02:15 -07:00
Anand Babu (AB) Periasamy 47f30cb0e9 Merge pull request #93 from abperiasamy/format_ls
humanize ls size
2015-03-08 11:27:39 -07:00
Anand Babu (AB) Periasamy 1694bd0b45 humanize ls size 2015-03-08 11:26:10 -07:00
Harshavardhana 3d2d8e4133 Merge pull request #92 from harshavardhana/pr_out_change_output_style_deprecating_dir_prefix 2015-03-08 03:52:02 -07:00
Harshavardhana 0b8e37202e Change output style deprecating DIR prefix 2015-03-08 03:50:46 -07:00
Harshavardhana 98afb5aa30 Merge pull request #90 from harshavardhana/pr_out_implement_color_coding_for_all_the_messages 2015-03-08 00:47:59 -08:00
Harshavardhana 3fb99cdce8 Implement color coding for all the messages
- Currently implemented are

     info() --- "green"
     infoCallback() --- "green"
     fatal() --- "red"
     warning() --- "yellow"
2015-03-08 00:43:05 -08:00
Harshavardhana 1e06e877d1 Merge pull request #89 from harshavardhana/pr_out_standardize_on_s3_as_the_default_uri_for_all_operations 2015-03-07 19:09:12 -08:00
Harshavardhana 10911e791f Standardize on s3:// as the default URI for all operations
- ./mc ls s3://<bucket>/<object>
       where <bucket> and <object> are optional

  - ./mc cp s3://<bucket>/<object> .
     Downloads <object> to your present working directory

  - ./mc cp <object> s3://<bucket>/<key>
     Uploads <object> to your <bucket> with name <key>
       where <key> is optional
2015-03-07 19:05:51 -08:00
Harshavardhana bddd21587c By default print everything inside a bucket 2015-03-07 18:28:41 -08:00
Harshavardhana 0347a2076c Merge pull request #88 from harshavardhana/pr_out_md5_b64_encoding_was_wrong_fix_it 2015-03-07 16:36:46 -08:00
Harshavardhana d1ce84d26e Md5 b64 encoding was wrong, fix it 2015-03-07 16:35:42 -08:00
Harshavardhana 2981e6688a Merge pull request #87 from harshavardhana/pr_out_unmarshal_should_be_a_pointer_otherwise 2015-03-07 15:20:37 -08:00
Harshavardhana 3b89e16ac7 Unmarshal should be a pointer otherwise
-- 2015/03/07 15:18:56 json: Unmarshal(nil *main.mcConfig)
2015-03-07 15:19:46 -08:00
Harshavardhana 77d546b0e9 Merge pull request #86 from harshavardhana/pr_out_calculate_md5sum_for_every_object_during_put_ 2015-03-07 15:02:26 -08:00
Harshavardhana f21af8ce8c Calculate md5sum for every object during Put() 2015-03-07 15:00:52 -08:00
Anand Babu (AB) Periasamy 1f0d7d3c82 Merge pull request #85 from abperiasamy/no_fixed_configbuffer
remove static allocation for config buffer
2015-03-07 12:49:14 -08:00
Anand Babu (AB) Periasamy 74b4668c4c remove static allocation for config buffer 2015-03-07 12:48:04 -08:00
Harshavardhana 73086201ab Merge pull request #84 from harshavardhana/pr_out_if_hostname_ip_s_ignore_subdomains 2015-03-07 02:48:00 -08:00
Harshavardhana 46ac2ec707 If hostname IP's ignore subdomains 2015-03-07 02:47:46 -08:00
Harshavardhana d83804cbba Merge pull request #83 from abperiasamy/core_improvements 2015-03-06 23:30:22 -08:00
Anand Babu (AB) Periasamy 67b044fb5f configuration and other misc improements 2015-03-06 17:21:58 -08:00
Anand Babu (AB) Periasamy 0ed018af3a Merge pull request #82 from abperiasamy/check_mkdocs
check for mkdocs dependency
2015-03-05 03:26:46 -08:00
Anand Babu (AB) Periasamy cb6ddd23a6 check for mkdocs dependency 2015-03-05 03:25:03 -08:00
Harshavardhana f139bfabc4 Cosmetic change 2015-03-05 02:32:25 -08:00
Harshavardhana 6fd634c154 Merge pull request #81 from harshavardhana/pr_out_keep_mc_specific_at_minio_mc_avoid_sudo_and_root_installs 2015-03-05 02:27:55 -08:00
Harshavardhana 593ef59999 Keep mc specific at '.minio/mc', avoid sudo and root installs 2015-03-05 02:27:19 -08:00
Harshavardhana ef9b98b17c Merge pull request #80 from harshavardhana/pr_out_user_net_url_and_remove_uri_implementation 2015-03-05 02:00:08 -08:00
Harshavardhana c35ad418aa User net/url and remove uri implementation 2015-03-05 01:59:54 -08:00
Harshavardhana ce249c0d47 Merge pull request #79 from harshavardhana/pr_out_add_bash_command_completion 2015-03-05 01:45:16 -08:00
Harshavardhana 28be1c55ac Add bash command completion 2015-03-05 01:45:03 -08:00
Harshavardhana 7df60328c2 Add bash autocompletion 2015-03-05 01:30:02 -08:00
Harshavardhana 3e1af5946c Merge pull request #78 from harshavardhana/pr_out_code_cleanup_and_standardizing_in_accordance_with_golang_coding_guidelines 2015-03-05 01:18:19 -08:00
Harshavardhana c1af2ccf67 Code cleanup and standardizing in accordance with Golang coding guidelines 2015-03-05 01:18:00 -08:00
Harshavardhana d6aaf2b7c5 Merge pull request #77 from harshavardhana/pr_out_fixed_mc_sync_dir_bug_exposed_after_previous_changes 2015-03-04 02:29:17 -08:00
Harshavardhana 97f3016fee Fixed ./mc sync <dir> bug exposed after previous changes 2015-03-04 02:29:07 -08:00
Harshavardhana 1bf6bd8b5b Merge pull request #76 from harshavardhana/pr_out_make_sure_to_trim_the_prefix_for_uri_path 2015-03-04 01:35:40 -08:00
Harshavardhana 8995a58287 make sure to trim the Prefix for uri.Path 2015-03-04 01:35:29 -08:00
Harshavardhana 10ebcc49eb Merge pull request #75 from harshavardhana/pr_out_previous_fix_was_incomplete_move_the_around_to_signature_consistency 2015-03-04 01:20:40 -08:00
Harshavardhana d7a9407a87 Previous fix was incomplete move the '/' around to signature consistency 2015-03-04 01:20:28 -08:00
Harshavardhana 2d9bb642ff Merge pull request #74 from harshavardhana/pr_out_now_cp_works_properly_with_amazons3 2015-03-04 01:15:42 -08:00
Harshavardhana 9910cbaabc Now cp works properly with AmazonS3 2015-03-04 01:15:30 -08:00
Harshavardhana e2814cd964 Merge pull request #73 from harshavardhana/pr_out_simplify_path_prefix_and_delimiters 2015-03-04 01:00:22 -08:00
Harshavardhana 09228f9569 Simplify path prefix and delimiters 2015-03-04 01:00:03 -08:00
Harshavardhana 1dddc9d139 Merge pull request #72 from harshavardhana/pr_out_verify_sync_to_be_a_directory 2015-03-03 16:22:45 -08:00
Harshavardhana cf024f19b6 Verify sync to be a directory 2015-03-03 16:22:28 -08:00
Harshavardhana 12b3a6bda8 Handle subdomains properly 2015-03-03 16:18:12 -08:00
Harshavardhana cbc76d2cd1 Merge pull request #71 from harshavardhana/pr_out_create_bucket_shouldn_t_use_domain_style_put_bucket_is_a_special_case 2015-03-03 16:09:57 -08:00
Harshavardhana 696577067b Create bucket shouldn't use domain style, put bucket is a special case 2015-03-03 16:09:31 -08:00
Harshavardhana a7d7b9d069 Merge pull request #70 from harshavardhana/pr_out_janitor_role_on_mc_and_fix_obvious_issues 2015-03-03 16:00:49 -08:00
Harshavardhana b78a36d7ac Janitor role on mc and fix obvious issues 2015-03-03 16:00:06 -08:00
Harshavardhana d2195617ba Merge pull request #69 from harshavardhana/pr_out_implement_progress_bar_using_pb_project_fixes_64 2015-03-01 23:46:58 -08:00
Harshavardhana 721a690ab5 Implement progress bar using 'pb' project - fixes #64 2015-03-01 23:43:16 -08:00
Harshavardhana ea9e5eaad4 Merge pull request #68 from harshavardhana/pr_out_if_s3_stat_fails_send_a_getbucket_with_prefix_set 2015-03-01 09:29:40 -08:00
Harshavardhana ed6cf244c5 if s3.Stat() fails, send a GetBucket with prefix set 2015-03-01 09:29:24 -08:00
Harshavardhana 93bfd43fed Merge pull request #67 from harshavardhana/pr_out_add_delimiter_and_prefix_support_for_ls 2015-02-28 15:43:35 -08:00
Harshavardhana e39e26bdea Add delimiter and prefix support for 'ls' 2015-02-28 15:43:04 -08:00
Harshavardhana d486e4332c Merge pull request #66 from harshavardhana/pr_out_add_support_for_marker_delimiter_prefix 2015-02-26 19:20:21 -08:00
Harshavardhana 861e305604 Add support for marker, delimiter, prefix 2015-02-26 19:19:49 -08:00
Harshavardhana f78df62a38 Merge pull request #60 from harshavardhana/pr_out_implement_basic_mc_sync_command 2015-02-25 02:09:31 -08:00
Harshavardhana cd519cec33 Implement basic 'mc sync' command
Usage:

   - ./mc sync docs

      -- Creates a bucket named ``docs``
      -- Copies all the files with in ``docs``
2015-02-25 02:09:07 -08:00
Harshavardhana 4187ba2ce2 Merge pull request #59 from harshavardhana/pr_out_add_env_variable_s3_endpoint 2015-02-25 00:12:04 -08:00
Harshavardhana 46facd1def Add env variable S3_ENDPOINT 2015-02-25 00:11:53 -08:00
Harshavardhana a3b302e996 Merge pull request #58 from vadmeste/add_and_report_missing_error_check
Add missing error check after Buckets() call
2015-02-24 23:59:41 -08:00
Anis Elleuch e506b0eec2 Add missing error check after Buckets() call 2015-02-25 08:58:12 +01:00
Harshavardhana 460e79fe0c Merge pull request #57 from harshavardhana/pr_out_build_fix 2015-02-24 17:39:52 -08:00
Harshavardhana 4a832b2919 Build fix 2015-02-24 17:39:41 -08:00
Harshavardhana 41d0647841 Merge pull request #56 from harshavardhana/pr_out_complete_ls_command_it_supports_now 2015-02-24 17:36:50 -08:00
Harshavardhana 6b685b744f Complete ls command it supports now
- ./mc ls
   [... list buckets ... ]

  - ./mc ls your-bucket
   [... list objects ... ]

  - ./mc ls your-bucket/object
   [date size object]
2015-02-24 17:36:04 -08:00
Harshavardhana eac632cc7a Merge pull request #55 from harshavardhana/pr_out_add_s3pathstyle_boolean_to_check_for_path_v_s_subdomain_requests 2015-02-24 14:13:37 -08:00
Harshavardhana f3ed11a363 Add s3pathstyle boolean to check for path v/s subdomain requests 2015-02-24 14:13:28 -08:00
Harshavardhana d5b6a07674 Merge pull request #54 from harshavardhana/pr_out_move_hostname_to_endpoint_remove_md5sum_calculation_for_now 2015-02-24 14:04:04 -08:00
Harshavardhana c0bdcad429 Move Hostname to Endpoint, remove md5sum calculation for now. 2015-02-24 13:57:23 -08:00
Harshavardhana 22b0a820b0 Merge pull request #53 from harshavardhana/pr_out_fix_get_policy_put_policy_invalid_entries 2015-02-23 02:06:49 -08:00
Harshavardhana c698b097aa Fix get-policy/put-policy invalid entries.
Also update documentation, to use subdomains for buckets as minio
server starts supporting subdomains.
2015-02-23 02:06:36 -08:00
Harshavardhana 237c3cdc38 Merge pull request #52 from harshavardhana/pr_out_provide_new_style 2015-02-20 20:30:42 -08:00
Harshavardhana 4e7f621ebd Provide new style
```
 $ ./mc cp s3://yourbucket/key .
 $ ./mc cp new-file s3://yourbucket
```
2015-02-20 20:26:13 -08:00
Harshavardhana afcd161ff7 Merge pull request #51 from harshavardhana/pr_out_cp_is_now_proper 2015-02-20 19:31:12 -08:00
Harshavardhana c61673957c `cp` is now proper 2015-02-20 19:30:53 -08:00
Harshavardhana b62aa980f1 Merge pull request #50 from harshavardhana/pr_out_add_example_bucket_policy 2015-02-20 19:14:50 -08:00
Harshavardhana 430efa4de8 Add example bucket policy 2015-02-20 19:13:58 -08:00
Harshavardhana 87c6b2335b Merge pull request #49 from harshavardhana/pr_out_there_is_no_golang_1_4_0_use_only_1_4 2015-02-13 19:09:31 -08:00
Harshavardhana cbf62f673a There is no golang 1.4.0 use only 1.4 2015-02-13 19:09:20 -08:00
Harshavardhana 6b2e444b59 Merge pull request #48 from vadmeste/use_bash_in_checkdeps
Use bash interpreter instead of sh
2015-02-13 13:47:44 -08:00
Anis Elleuch 43f08a4999 Use bash interpreter instead of sh 2015-02-13 22:42:45 +01:00
Harshavardhana f43485e9fc Merge pull request #47 from harshavardhana/pr_out_depend_on_go1_4 2015-02-13 03:01:20 -08:00
Harshavardhana 40b55d5c64 Depend on go1.4 2015-02-13 03:01:01 -08:00
Harshavardhana 0c85a8f748 Minior change 2015-02-10 03:12:31 -08:00
Harshavardhana 1ea97e5a07 Merge pull request #46 from harshavardhana/pr_out_secretkey_should_be_secretaccesskey 2015-02-10 03:09:30 -08:00
Harshavardhana 516631d388 Secretkey should be SecretAccessKey 2015-02-10 03:08:00 -08:00
Harshavardhana 8ae3f13df8 Merge pull request #45 from harshavardhana/pr_out_remove_unnecessary_cli_options 2015-02-09 22:57:24 -08:00
Harshavardhana 417a99f973 Remove unnecessary CLI options 2015-02-09 22:55:39 -08:00
Harshavardhana 3c5d6d4373 Minor update 2015-02-09 18:23:37 -08:00
Harshavardhana 1b6b4bd4cd Merge pull request #44 from harshavardhana/pr_out_update_docs_again_ 2015-02-09 18:20:45 -08:00
Harshavardhana 2a602627e1 update docs again :) 2015-02-09 18:20:33 -08:00
Harshavardhana cecfbc37a4 Merge pull request #43 from harshavardhana/pr_out_add_ruby_example 2015-02-09 18:17:53 -08:00
Harshavardhana 5187bad66c Add ruby example 2015-02-09 18:17:39 -08:00
Harshavardhana 121686c843 Merge pull request #42 from harshavardhana/pr_out_cosmetic_changes 2015-02-09 17:42:13 -08:00
Harshavardhana db1f9f550a Cosmetic changes 2015-02-09 17:42:02 -08:00
Harshavardhana 0447ebd828 Merge pull request #41 from harshavardhana/pr_out_update_boto3_python_document 2015-02-09 17:39:13 -08:00
Harshavardhana 39badc18bf Update boto3 python document 2015-02-09 17:39:00 -08:00
Harshavardhana 5e8e673e82 Merge pull request #40 from harshavardhana/pr_out_rename_mkdir_mb 2015-02-09 15:03:22 -08:00
Harshavardhana 4104278e98 Rename mkdir --> mb 2015-02-09 15:03:06 -08:00
Harshavardhana b793087f12 Merge pull request #39 from harshavardhana/pr_out_add_put_bucket 2015-02-09 13:57:15 -08:00
Harshavardhana cb824f0bf8 Add put bucket 2015-02-09 13:57:03 -08:00
Harshavardhana dec9b77995 Merge pull request #38 from harshavardhana/pr_out_add_gh_deploy 2015-02-09 13:42:19 -08:00
Harshavardhana 3e30ce60fa Add gh-deploy 2015-02-09 13:42:05 -08:00
Harshavardhana abd088e6bc Merge pull request #37 from harshavardhana/pr_out_update_docs 2015-02-09 13:28:52 -08:00
Harshavardhana 852fb59c15 Update docs 2015-02-09 13:28:37 -08:00
Harshavardhana b46b657f53 Merge pull request #36 from harshavardhana/pr_out_add_documentation 2015-02-09 13:16:41 -08:00
Harshavardhana 37e9f2b7cc Add documentation 2015-02-09 13:16:22 -08:00
Harshavardhana 53fba0bc6d Merge pull request #35 from harshavardhana/pr_out_squash_minio_package_into_s3_package 2015-02-08 18:02:08 -08:00
Harshavardhana 231f0c3efb Squash minio package into s3 package 2015-02-08 18:01:05 -08:00
Harshavardhana e1c93116d3 Merge pull request #34 from harshavardhana/pr_out_never_send_request_with_trailing_for_buckets 2015-02-06 20:40:13 -08:00
Harshavardhana 0298c3ddf6 Never send request with trailing '/' for buckets 2015-02-06 20:39:58 -08:00
Harshavardhana 27d3e89baa Merge pull request #33 from harshavardhana/pr_out_rename_secretaccess_to_secret_to_be_more_appropriate 2015-02-06 02:16:44 -08:00
Harshavardhana 43451eff68 Rename SecretAccess to Secret to be more appropriate 2015-02-06 02:16:35 -08:00
Harshavardhana 852d22dbf4 Merge pull request #32 from harshavardhana/pr_out_now_minio_client_can_access_minio_server_through_hmac_style_authentication 2015-02-06 01:38:03 -08:00
Harshavardhana b41278d4e7 Now minio client can access minio server through HMAC style authentication 2015-02-06 01:36:47 -08:00
Harshavardhana 4ef184483e Merge pull request #31 from harshavardhana/pr_out_disable_tls_for_now 2015-02-05 21:31:32 -08:00
Harshavardhana fe3b013532 Disable TLS for now 2015-02-05 21:30:35 -08:00
Harshavardhana ce37e24046 Merge pull request #30 from harshavardhana/pr_out_remove_cacerts_requirement 2015-01-30 16:23:47 -08:00
Harshavardhana 170f9bc9c7 Remove CACerts requirement 2015-01-30 16:23:23 -08:00
Harshavardhana b2fd5fd489 Merge pull request #29 from harshavardhana/pr_out_minio_client_now_has_ssl_support 2015-01-29 15:21:39 -08:00
Harshavardhana ed0a7e3c40 Minio client now has SSL support 2015-01-29 15:11:41 -08:00
Harshavardhana a0f5031396 Merge pull request #28 from harshavardhana/pr_out_remove_bucketlocation_function_minio_does_not_implement_such_a_resource 2015-01-28 15:36:38 -08:00
Harshavardhana deb11c2e32 Remove BucketLocation() function, minio does not implement such a resource 2015-01-28 15:36:27 -08:00
Harshavardhana a96aacd958 Merge pull request #27 from harshavardhana/pr_out_implement_minio_put_bucket 2015-01-24 19:02:40 -08:00
Harshavardhana 5d75e56b60 Implement minio 'put-bucket' 2015-01-24 19:01:04 -08:00
Harshavardhana 9fcf34b604 Merge pull request #26 from harshavardhana/pr_out_implement_minio_list_objects 2015-01-23 12:13:34 -08:00
Harshavardhana 619e8f7b01 Implement minio 'list-objects' 2015-01-23 12:13:17 -08:00
Harshavardhana 0985159422 Merge pull request #25 from harshavardhana/pr_out_implement_minio_list_buckets 2015-01-23 01:59:15 -08:00
Harshavardhana b5610793be Implement minio list-buckets 2015-01-23 01:58:29 -08:00
Harshavardhana b20438a812 Merge pull request #23 from harshavardhana/pr_out_add_minio_cli_move_s3_stuff_with_s3_prefix 2015-01-22 12:39:02 -08:00
Harshavardhana 741febd318 Add minio cli, move 's3' stuff with 's3' prefix 2015-01-22 12:38:02 -08:00
Harshavardhana 279826c3fa Merge pull request #22 from harshavardhana/pr_out_differentiate_commands_and_subcommands 2015-01-21 23:14:48 -08:00
Harshavardhana a8f0a7463f Differentiate commands and subcommands 2015-01-21 23:14:02 -08:00
Harshavardhana 25be6e137f Merge pull request #21 from harshavardhana/pr_out_implement_new_simple_minio_client 2015-01-21 15:30:08 -08:00
Harshavardhana 870faa6093 Implement new simple minio client 2015-01-21 15:29:48 -08:00
Harshavardhana 77e2a7d1a7 Merge pull request #20 from harshavardhana/pr_out_implement_mkdir 2015-01-20 15:45:51 -08:00
Harshavardhana 3e5f2322df Implement 'mkdir' 2015-01-20 15:45:25 -08:00
Harshavardhana e13a35e7f8 Merge pull request #19 from harshavardhana/pr_out_implement_ls 2015-01-20 15:18:15 -08:00
Harshavardhana aaca72d8b5 Implement 'ls' 2015-01-20 15:17:58 -08:00
Harshavardhana 17332b071c Merge pull request #18 from harshavardhana/pr_out_add_copyright_headers 2015-01-20 01:11:21 -08:00
Harshavardhana 115ae2ebc4 Add copyright headers 2015-01-20 01:11:05 -08:00
Harshavardhana be50346a32 Merge pull request #17 from harshavardhana/pr_out_bring_all_errors_to_common_location 2015-01-19 18:00:41 -08:00
Harshavardhana 8e0f5ae7b6 Bring all errors to common location 2015-01-19 18:00:14 -08:00
Harshavardhana 4c865cc056 Merge pull request #16 from harshavardhana/pr_out_enhance_cp_command_implements_add_another_package_uri 2015-01-19 17:39:42 -08:00
Harshavardhana 26efb4d8d5 Enhance 'cp' command implements, add another package 'uri'
- <S3Path> <LocalPath>
  - <LocalPath> <S3Path>

TODO
  - <S3Path> <S3Path>
  - <S3Path> <S3Bucket>
  - <LocalDir> <S3Bucket>

Added a new package called 'URI' for parsing URI schemes
in standard way.
2015-01-19 17:38:15 -08:00
Harshavardhana 62659bc936 Merge pull request #12 from harshavardhana/pr_out_implement_cp_command 2015-01-18 16:59:53 -08:00
Harshavardhana c4fcc3f2b7 Implement 'cp' command 2015-01-18 16:40:55 -08:00
Harshavardhana 925953f12d Merge pull request #11 from harshavardhana/pr_out_add_developer_contribution_guidelines 2015-01-18 15:44:37 -08:00
Harshavardhana 94b28bd7b6 Add developer contribution guidelines 2015-01-18 15:43:31 -08:00
Harshavardhana 6160287182 Merge pull request #10 from harshavardhana/pr_out_cleanup_s3_pkg_code 2015-01-18 13:21:00 -08:00
Harshavardhana d386c26807 Cleanup s3 pkg code 2015-01-18 13:19:47 -08:00
Harshavardhana b4b6de12f6 Merge pull request #9 from harshavardhana/pr_out_implement_configure_command_and_update_description 2015-01-18 13:14:51 -08:00
Harshavardhana da94ccfb0c Implement 'configure' command and update description 2015-01-18 13:12:39 -08:00
Harshavardhana 3d7fb09758 Merge pull request #8 from harshavardhana/pr_out_add_list_buckets 2015-01-17 23:08:12 -08:00
Harshavardhana 2bf9df089a Add 'list-buckets' 2015-01-17 23:06:50 -08:00
Harshavardhana f0716d86b7 Merge pull request #7 from harshavardhana/pr_out_add_apache_license_v2_0 2015-01-17 12:11:34 -08:00
Harshavardhana 66554d07a7 Add Apache License v2.0 2015-01-17 12:09:27 -08:00
Harshavardhana 3e4235a3f3 Merge pull request #5 from harshavardhana/pr_out_add_hostname 2015-01-17 11:56:37 -08:00
Harshavardhana 0b3fa735f5 Add hostname 2015-01-17 11:54:27 -08:00
Harshavardhana ff724a562e Merge pull request #4 from harshavardhana/pr_out_now_get_object_works_properly_and_other_cosmetic_changes 2015-01-17 01:33:10 -08:00
Harshavardhana deb84dfa2f Now get-object works properly, and other cosmetic changes 2015-01-17 01:32:05 -08:00
Harshavardhana 5b7fafb2e5 Merge pull request #3 from harshavardhana/pr_out_add_list_objects 2015-01-17 01:05:06 -08:00
Harshavardhana f53f03dcc1 Merge pull request #2 from harshavardhana/pr_out_add_get_object_put_object_in_accordance_with_aws_cli 2015-01-17 01:04:41 -08:00
Harshavardhana c0b5d042fd Add list-objects 2015-01-17 01:01:36 -08:00
Harshavardhana 29b975a4dd Add get-object, put-object in accordance with aws cli 2015-01-16 22:03:18 -08:00
Harshavardhana 63c7e12f16 Update readme.md 2015-01-15 22:30:51 -08:00
Harshavardhana 9e0bf4cf50 add new stubs for commands cp, mv, mb, rm 2015-01-15 22:29:22 -08:00
Harshavardhana f1eef8bd92 Update docs 2015-01-15 19:04:27 -08:00
Harshavardhana 8696850601 Implement new options 2015-01-15 18:45:25 -08:00
Harshavardhana 0746c84204 Implement initial cut of `mc` command 2015-01-15 18:00:19 -08:00
Harshavardhana 47735ca12f Add NewS3Client() function 2015-01-15 14:45:45 -08:00
Harshavardhana c5a6e559c0 Add top level files 2015-01-15 00:24:04 -08:00
Harshavardhana a34985479e A working s3Client library from Google 2015-01-15 00:20:16 -08:00
Harshavardhana 2de3b657b9 Initial commit 2015-01-14 00:21:08 -08:00
285 changed files with 38310 additions and 1103 deletions
-3
View File
@@ -1,3 +0,0 @@
.git
.gitea
out
-221
View File
@@ -1,221 +0,0 @@
name: release
on:
push:
branches: ['**']
workflow_dispatch:
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 45
permissions:
contents: read
env:
KIND: mc
BIN: mc
PKG: minio-mc
REGISTRY: git.vezha.io
steps:
- name: AC1 checkout the recipe
uses: https://git.vezha.io/actions/checkout@v4
with:
persist-credentials: false
- name: AC2 pins are complete and well formed
id: pins
run: sh vezha/gates.sh pins "$KIND" | tee -a "$GITHUB_ENV" | tee -a "$GITHUB_OUTPUT"
- name: AC3 no unpinned reference and workflow lint
run: sh vezha/gates.sh refs "$KIND"
- name: tools docker cli and jq
run: |
command -v docker >/dev/null 2>&1 || { apt-get update -qq; DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker.io >/dev/null; }
command -v jq >/dev/null 2>&1 || { apt-get update -qq; DEBIAN_FRONTEND=noninteractive apt-get install -y -qq jq >/dev/null; }
docker version --format 'client {{.Client.Version}} server {{.Server.Version}}'
jq --version
- name: AC1 provenance of the import, anonymous
run: sh vezha/gates.sh provenance-remote
- name: AC1 checkout the pinned upstream source
uses: https://git.vezha.io/actions/checkout@v4
with:
ref: ${{ steps.pins.outputs.UPSTREAM_COMMIT }}
path: src
fetch-depth: 1
persist-credentials: false
- name: AC1 source tree is at the pinned commit
run: sh vezha/gates.sh provenance-src
- name: AC7 source offer URLs answer anonymously
run: sh vezha/gates.sh source-urls
- name: negative controls, every gate must refuse its planted input
run: sh vezha/gates.sh self-test
- name: names and build arguments
run: |
TAG=$(sh vezha/gates.sh make-tag)
{ echo "TAG=$TAG"; echo "IMG=$REGISTRY/para/$PKG:$TAG"; echo "LOCAL=vezha-build-$KIND:$GITHUB_RUN_ID"; } >> "$GITHUB_ENV"
mkdir -p out
sh vezha/gates.sh pins "$KIND" | sed 's/^/--build-arg=/' > out/build-args
echo "tag $TAG"
- name: AC2 pins stage proves the source tree and the module
run: |
mapfile -t ARGS < out/build-args
docker build --target pins -f vezha/Dockerfile "${ARGS[@]}" -t "$LOCAL-pins" .
- name: AC4 build stage and binary hash A
run: |
mapfile -t ARGS < out/build-args
docker build --target build -f vezha/Dockerfile "${ARGS[@]}" -t "$LOCAL-build" .
cid=$(docker create "$LOCAL-build")
docker cp "$cid:/out/$BIN" "out/$BIN.a"
docker cp "$cid:/out/$BIN.sha256" out/sha.a
docker rm "$cid" > /dev/null
A=$(sha256sum "out/$BIN.a" | cut -d' ' -f1)
if [ "$A" != "$(cat out/sha.a)" ]; then
echo "REFUSED build: the extracted binary does not match the build stage's sha file"
exit 1
fi
echo "BINARY_SHA256=$A" >> "$GITHUB_ENV"
echo "binary sha256 A: $A"
- name: AC6 final image and content check
run: |
mapfile -t ARGS < out/build-args
sh vezha/gates.sh render-source vezha/SOURCE.tmpl vezha/SOURCE
docker build -f vezha/Dockerfile "${ARGS[@]}" "--build-arg=RECIPE_COMMIT=$GITHUB_SHA" "--build-arg=BINARY_SHA256=$BINARY_SHA256" -t "$IMG" .
RECIPE_COMMIT="$GITHUB_SHA" sh vezha/check-image.sh "$KIND" "$IMG"
- name: AC4 version output carries the pinned release and commit
run: |
out=$(docker run --rm --label "io.vezha.smoke=$GITHUB_RUN_ID" "$IMG" --version)
echo "$out"
case "$out" in
*"$UPSTREAM_RELEASE"*"commit-id=$UPSTREAM_COMMIT"*) echo "version output names $UPSTREAM_RELEASE and $UPSTREAM_COMMIT" ;;
*) echo "REFUSED version: --version does not name $UPSTREAM_RELEASE and commit-id=$UPSTREAM_COMMIT"; exit 1 ;;
esac
- name: AC5 reproducible, second no-cache build of the build stage
run: |
mapfile -t ARGS < out/build-args
docker build --no-cache --target build -f vezha/Dockerfile "${ARGS[@]}" -t "$LOCAL-build2" .
cid=$(docker create "$LOCAL-build2")
docker cp "$cid:/out/$BIN" "out/$BIN.b"
docker rm "$cid" > /dev/null
B=$(sha256sum "out/$BIN.b" | cut -d' ' -f1)
if [ "$B" != "$BINARY_SHA256" ]; then
echo "REFUSED reproducible: second build has sha256 $B, first has $BINARY_SHA256"
exit 1
fi
echo "both builds have sha256 $B"
- name: AC7 source offer in the image resolves anonymously
run: sh vezha/gates.sh source-offer "$IMG" "$KIND" "$UPSTREAM_RELEASE"
- name: AC8 smoke against the stopgap server
run: sh vezha/smoke.sh smoke git.vezha.io/para/minio@sha256:a1a8bd4ac40ad7881a245bab97323e18f971e4d4cba2c2007ec1bedd21cbaba2 "$IMG"
- name: AC10 preflight, write-once tag and the stopgap tags before
run: |
sh vezha/gates.sh preflight "$KIND" "$GITHUB_REF" "${MC_IMAGE:-}"
sh vezha/gates.sh tag "$PKG" "$TAG"
sh vezha/gates.sh stopgap | tee out/stopgap.before
- name: publish tools, pinned syft and oras installed before any login
if: github.ref == 'refs/heads/vezha'
run: |
curl -fsSLO https://github.com/anchore/syft/releases/download/v1.50.0/syft_1.50.0_linux_amd64.tar.gz
echo "bf7b29ff57f06da30918266a0e1c2885a8f99784798d1bdb1628886aa015d788 syft_1.50.0_linux_amd64.tar.gz" | sha256sum -c -
tar -xzf syft_1.50.0_linux_amd64.tar.gz syft
install -m 0755 syft /usr/local/bin/syft
curl -fsSLO https://github.com/oras-project/oras/releases/download/v1.3.3/oras_1.3.3_linux_amd64.tar.gz
echo "9ce999f8d2de03fc03968b29d743077a58783e545e5eaa53917ca177352d0e59 oras_1.3.3_linux_amd64.tar.gz" | sha256sum -c -
tar -xzf oras_1.3.3_linux_amd64.tar.gz oras
install -m 0755 oras /usr/local/bin/oras
syft version
oras version
- name: publish SBOM generated before the image
if: github.ref == 'refs/heads/vezha'
run: |
syft "docker:$IMG" -o "spdx-json=out/sbom.spdx.json"
test -s out/sbom.spdx.json
- name: publish login to the registry
if: github.ref == 'refs/heads/vezha'
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER || github.actor }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
sh vezha/gates.sh login-guard
echo "$REGISTRY_TOKEN" | docker login "$REGISTRY" -u "$REGISTRY_USER" --password-stdin
- name: publish SBOM artifact pushed before the image
if: github.ref == 'refs/heads/vezha'
run: cd out && oras push "$REGISTRY/para/$PKG-sbom:$TAG" --artifact-type application/spdx+json sbom.spdx.json:application/spdx+json
- name: publish the image and cross-check its digest
if: github.ref == 'refs/heads/vezha'
run: |
docker push "$IMG" | tee out/push.log
D=$(sed -n 's/.*digest: \(sha256:[0-9a-f]\{64\}\).*/\1/p' out/push.log | tail -1)
if [ -z "$D" ]; then
echo "REFUSED push: no digest in the push output"
exit 1
fi
R=$(sh vezha/gates.sh digest "$PKG" "$TAG")
if [ "$R" != "$D" ]; then
echo "REFUSED push: docker push printed $D but the registry serves $R for $TAG"
exit 1
fi
echo "DIGEST=$D" >> "$GITHUB_ENV"
- name: publish AC11 digest proof, pull by digest and compare the binary
if: github.ref == 'refs/heads/vezha'
run: |
REF="$REGISTRY/para/$PKG@$DIGEST"
docker rmi "$IMG" > /dev/null
sh vezha/gates.sh prove "$REF" "$BIN" "$BINARY_SHA256"
docker run --rm --label "io.vezha.smoke=$GITHUB_RUN_ID" "$REF" --version
oras pull "$REGISTRY/para/$PKG-sbom:$TAG" -o out/sbom-back
grep -q '"spdxVersion"' out/sbom-back/sbom.spdx.json
echo "the SBOM was pulled back and is SPDX JSON"
- name: publish AC11 the PUBLISHED line
if: github.ref == 'refs/heads/vezha'
run: |
LINE="PUBLISHED $REGISTRY/para/$PKG@$DIGEST tag=$TAG binary-sha256=$BINARY_SHA256"
echo "$LINE" | grep -Eq '^PUBLISHED git\.vezha\.io/para/(minio|minio-mc)@sha256:[0-9a-f]{64} tag=[a-z0-9._-]+ binary-sha256=[0-9a-f]{64}$' || { echo "REFUSED published: malformed line"; exit 1; }
echo "$LINE"
echo "$LINE" > out/published.txt
cd out && oras push "$REGISTRY/para/$PKG-published:$TAG" published.txt:text/plain
- name: publish AC10 stopgap tags unchanged after the run
if: github.ref == 'refs/heads/vezha'
run: |
sh vezha/gates.sh stopgap > out/stopgap.after
diff out/stopgap.before out/stopgap.after
echo "the stopgap tags resolve to the same digests as before the run"
- name: publish AC7 source offer of the pulled digest resolves anonymously
if: github.ref == 'refs/heads/vezha'
run: sh vezha/gates.sh source-offer "$REGISTRY/para/$PKG@$DIGEST" "$KIND" "$UPSTREAM_RELEASE"
- name: cleanup of this run's containers, networks, volumes and images
if: always()
run: |
for c in $(docker ps -aq --filter "label=io.vezha.smoke=$GITHUB_RUN_ID"); do docker rm -f "$c" > /dev/null 2>&1 || true; done
for n in $(docker network ls -q --filter "label=io.vezha.smoke=$GITHUB_RUN_ID"); do docker network rm "$n" > /dev/null 2>&1 || true; done
for v in $(docker volume ls -q --filter "label=io.vezha.smoke=$GITHUB_RUN_ID"); do docker volume rm "$v" > /dev/null 2>&1 || true; done
for i in "${LOCAL:-none}-pins" "${LOCAL:-none}-build" "${LOCAL:-none}-build2" "${IMG:-none}" "${REGISTRY}/para/${PKG}@${DIGEST:-none}"; do docker rmi "$i" > /dev/null 2>&1 || true; done
docker logout "$REGISTRY" > /dev/null 2>&1 || true
+4 -3
View File
@@ -1,3 +1,4 @@
/src/
/out/
/vezha/SOURCE
cover.out
mc
*~
*.test
+15
View File
@@ -0,0 +1,15 @@
# Generate CONTRIBUTORS.md: contributors.sh
# Tip for finding duplicates (besides scanning the output of CONTRIBUTORS.md for name
# duplicates that aren't also email duplicates): scan the output of:
# git log --format='%aE - %aN' | sort -uf
#
# For explanation on this file format: man git-shortlog
Anand Babu (AB) Periasamy <ab@minio.io> Anand Babu (AB) Periasamy <abperiasamy@users.noreply.github.com>
Anand Babu (AB) Periasamy <ab@minio.io> <ab@unlocksmith.org>
Anis Elleuch <vadmeste@gmail.com>
Frederick F. Kautz IV <fkautz@minio.io> <fkautz@alumni.cmu.edu>
Harshavardhana <harsha@minio.io> <harsha@harshavardhana.net>
Krishna Srinivas <krishna@minio.io> <krishna.srinivas@gmail.com>
Bosky <bosky@helpshift.com>
+25
View File
@@ -0,0 +1,25 @@
sudo: false
language: go
script:
- make test GOFLAGS="-race"
os:
- linux
- osx
env:
- ARCH=x86_64
- ARCH=i686
go:
- 1.5.2
- 1.5.3
script:
- diff -au <(gofmt -d *.go) <(printf "")
- diff -au <(gofmt -d pkg) <(printf "")
notifications:
slack:
secure: McinxQ4R/Yu2r/U8lVsdAIQ195Rf+3/Ku6DViWyqLHsTt5fTnVrSfbIKs8vy0t2A0bRLO6zv2xOSMWjfiimZLPMgMbMqLtTFEzUzB8RZyx2n2xgmL8q3gjXcLA3vkBreaRYCzJzX6DjvrxRfhyOg+BQHpLpACWik3FS/7VIdDCI=
+40
View File
@@ -0,0 +1,40 @@
### Setup your mc Github Repository
Fork [mc upstream](https://github.com/minio/mc/fork) source repository to your own personal repository.
```sh
$ mkdir -p $GOPATH/src/github.com/minio
$ cd $GOPATH/src/github.com/minio
$ git clone https://github.com/$USER_ID/mc
$ cd mc
$ make
$ mc --help
```
### Developer Guidelines
``mc`` welcomes your contribution. To make the process as seamless as possible, we ask for the following:
* Go ahead and fork the project and make your changes. We encourage pull requests to discuss code changes.
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
* If you have additional dependencies for ``mc``, ``mc`` manages its dependencies using [govendor](https://github.com/kardianos/govendor)
- Run `go get foo/bar`
- Edit your code to import foo/bar
- Run `make pkg-add PKG=foo/bar` from top-level folder
* If you have dependencies which needs to be removed from ``mc``
- Edit your code to not import foo/bar
- Run `make pkg-remove PKG=foo/bar` from top-level folder
* When you're ready to create a pull request, be sure to:
- Have test cases for the new code. If you have questions about how to do it, please ask in your pull request.
- Run `go fmt`
- Squash your commits into a single commit. `git rebase -i`. It's okay to force update your pull request.
- Make sure `make build` completes.
* Read [Effective Go](https://github.com/golang/go/wiki/CodeReviewComments) article from Golang project
- `mc` project is conformant with Golang style
- if you happen to observe offending code, please feel free to send a pull request
+9
View File
@@ -0,0 +1,9 @@
## Contributors
<!-- DO NOT EDIT - CONTRIBUTORS.md is autogenerated from git commit log by contributors.sh script. -->
- Anand Babu (AB) Periasamy <ab@minio.io>
- Anis Elleuch <vadmeste@gmail.com>
- Bosky <bosky@helpshift.com>
- Frederick F. Kautz IV <fkautz@minio.io>
- Harshavardhana <harsha@minio.io>
- Krishna Srinivas <krishna@minio.io>
+86
View File
@@ -0,0 +1,86 @@
## Ubuntu (Kylin) 14.04
### Build Dependencies
This installation guide is based on Ubuntu 14.04+ on x86-64 platform.
##### Install Git, GCC
```sh
$ sudo apt-get install git build-essential
```
##### Install Go 1.5+
Download Go 1.5+ from [https://golang.org/dl/](https://golang.org/dl/).
```sh
$ wget https://storage.googleapis.com/golang/go1.5.1.linux-amd64.tar.gz
$ mkdir -p ${HOME}/bin/
$ mkdir -p ${HOME}/go/
$ tar -C ${HOME}/bin/ -xzf go1.5.1.linux-amd64.tar.gz
```
##### Setup GOROOT and GOPATH
Add the following exports to your ``~/.bashrc``. Environment variable GOROOT specifies the location of your golang binaries
and GOPATH specifies the location of your project workspace.
```sh
export GOROOT=${HOME}/bin/go
export GOPATH=${HOME}/go
export PATH=$PATH:${HOME}/bin/go/bin:${GOPATH}/bin
```
##### Source the new environment
```sh
$ source ~/.bashrc
```
##### Testing it all
```sh
$ go env
```
## OS X (Yosemite) 10.10
### Build Dependencies
This installation document assumes OS X Yosemite 10.10+ on x86-64 platform.
##### Install brew
```sh
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```
##### Install Git, Python
```sh
$ brew install git python
```
##### Install Go 1.5+
Install golang binaries using `brew`
```sh
$ brew install go
$ mkdir -p $HOME/go
```
##### Setup GOROOT and GOPATH
Add the following exports to your ``~/.bash_profile``. Environment variable GOROOT specifies the location of your golang binaries
and GOPATH specifies the location of your project workspace.
```sh
export GOPATH=${HOME}/go
export GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6)
export GOROOT=$(brew --prefix)/Cellar/go/${GOVERSION}/libexec
export PATH=$PATH:${GOPATH}/bin
```
##### Source the new environment
```sh
$ source ~/.bash_profile
```
##### Testing it all
```sh
$ go env
```
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+41
View File
@@ -0,0 +1,41 @@
# For maintainers only
## Responsibilities
Please go through this link [Maintainer Responsibility](https://gist.github.com/abperiasamy/f4d9b31d3186bbd26522)
### Setup your mc Github Repository
Fork [mc upstream](https://github.com/minio/mc/fork) source repository to your own personal repository.
```bash
$ mkdir -p $GOPATH/src/github.com/minio
$ cd $GOPATH/src/github.com/minio
$ git clone https://github.com/$USER_ID/mc
$
```
``mc`` uses [govendor](https://github.com/kardianos/govendor) for its dependency management.
### To manage dependencies
#### Add new dependencies
- Run `go get foo/bar`
- Edit your code to import foo/bar
- Run `govendor add foo/bar` from top-level folder
#### Remove dependencies
- Run `govendor remove foo/bar`
#### Update dependencies
- Run `govendor remove +vendor`
- Run to update the dependent package `go get -u foo/bar`
- Run `govendor add +external`
### Making new releases
`mc` doesn't follow semantic versioning style, `mc` instead uses the release date and time as the release versions.
`make release` will install new released binary into your `GOPATH`
+85
View File
@@ -0,0 +1,85 @@
LDFLAGS := $(shell go run buildscripts/gen-ldflags.go)
BUILD_LDFLAGS := '$(LDFLAGS)'
all: install
checkdeps:
@echo "Checking deps:"
@(env bash $(PWD)/buildscripts/checkdeps.sh)
checkgopath:
@echo "Checking if project is at ${GOPATH}"
@for mcpath in $(echo ${GOPATH} | sed 's/:/\n/g'); do if [ ! -d ${mcpath}/src/github.com/minio/mc ]; then echo "Project not found in ${mcpath}, please follow instructions provided at https://github.com/minio/minio/blob/master/CONTRIBUTING.md#setup-your-minio-github-repository" && exit 1; fi done
@echo "BUILD_LDFLAGS: ${BUILD_LDFLAGS}"
getdeps: checkdeps checkgopath
@go get github.com/golang/lint/golint && echo "Installed golint:"
@go get golang.org/x/tools/cmd/vet && echo "Installed vet:"
@go get github.com/fzipp/gocyclo && echo "Installed gocyclo:"
@go get github.com/remyoudompheng/go-misc/deadcode && echo "Installed deadcode:"
# verifiers: getdeps vet fmt lint cyclo deadcode
verifiers: getdeps vet fmt lint cyclo deadcode
vet:
@echo "Running $@:"
@GO15VENDOREXPERIMENT=1 go tool vet -all *.go
@GO15VENDOREXPERIMENT=1 go tool vet -all ./pkg
@GO15VENDOREXPERIMENT=1 go tool vet -shadow=true *.go
@GO15VENDOREXPERIMENT=1 go tool vet -shadow=true ./pkg
fmt:
@echo "Running $@:"
@GO15VENDOREXPERIMENT=1 gofmt -s -l *.go
@GO15VENDOREXPERIMENT=1 gofmt -s -l pkg
lint:
@echo "Running $@:"
@GO15VENDOREXPERIMENT=1 golint .
@GO15VENDOREXPERIMENT=1 golint github.com/minio/mc/pkg...
cyclo:
@echo "Running $@:"
@GO15VENDOREXPERIMENT=1 gocyclo -over 40 *.go
@GO15VENDOREXPERIMENT=1 gocyclo -over 40 pkg
deadcode:
@echo "Running $@:"
@GO15VENDOREXPERIMENT=1 deadcode
build: verifiers
@echo "Installing mc:"
test: verifiers
@echo "Running all testing:"
@GO15VENDOREXPERIMENT=1 go test $(GOFLAGS) ./
@GO15VENDOREXPERIMENT=1 go test $(GOFLAGS) github.com/minio/mc/pkg...
gomake-all: build
@GO15VENDOREXPERIMENT=1 go build --ldflags $(BUILD_LDFLAGS) -o $(GOPATH)/bin/mc
@mkdir -p $(HOME)/.mc
coverage:
@GO15VENDOREXPERIMENT=1 go test -race -coverprofile=cover.out ./
@go tool cover -html=cover.out && echo "Visit your browser"
pkg-add:
@GO15VENDOREXPERIMENT=1 govendor add $(PKG)
pkg-update:
@GO15VENDOREXPERIMENT=1 govendor update $(PKG)
pkg-remove:
@GO15VENDOREXPERIMENT=1 govendor remove $(PKG)
install: gomake-all
all-tests: test
# TODO disable them for now.
#@./tests/test-minio.sh
release:
@./release.sh
clean:
@rm -fv cover.out
@rm -fv mc
+9
View File
@@ -0,0 +1,9 @@
Minio Client (C) 2014, 2015 Minio, Inc.
This product includes software developed at Minio, Inc.
(https://minio.io/).
The Minio project contains unmodified/modified subcomponents too with
separate copyright notices and license terms. Your use of the source
code for the these subcomponents is subject to the terms and conditions
of the following licenses.
+106
View File
@@ -0,0 +1,106 @@
# Minio Client (mc) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/minio/minio?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
``mc`` provides minimal tools to work with Amazon S3 compatible cloud storage and filesystems. It has features like resumable uploads/downloads, progress bar, parallel copy. ``mc`` is written in golang and released under [Apache license v2](./LICENSE).
## Commands
``mc`` implements the following commands
```
ls List files and folders.
mb Make a bucket or folder.
cat Display contents of a file.
pipe Write contents of stdin to one or more targets. When no target is specified, it writes to stdout.
share Generate URL for sharing.
cp Copy one or more objects to a target.
mirror Mirror folders recursively from a single source to many destinations.
diff Compute differences between two folders.
rm Remove file or bucket [WARNING: Use with care].
access Manage bucket access permissions.
session Manage saved sessions of cp and mirror operations.
config Manage configuration file.
update Check for a new software update.
version Print version.
```
## Install [![Build Status](https://api.travis-ci.org/minio/mc.svg?branch=master)](https://travis-ci.org/minio/mc) [![Build status](https://ci.appveyor.com/api/projects/status/3ng8bef7b3e1v763?svg=true)](https://ci.appveyor.com/project/harshavardhana/mc)
#### GNU/Linux
Download ``mc`` for:
- ``64-bit Intel`` from https://dl.minio.io/client/mc/release/linux-amd64/mc
- ``32-bit Intel`` from https://dl.minio.io/client/mc/release/linux-386/mc
- ``32-bit ARM`` from https://dl.minio.io/client/mc/release/linux-arm/mc
~~~
$ chmod +x mc
$ ./mc --help
~~~
#### OS X
Download ``mc`` from https://dl.minio.io/client/mc/release/darwin-amd64/mc
~~~
$ chmod 755 mc
$ ./mc --help
~~~
#### Microsoft Windows
Download ``mc`` for:
- ``64-bit`` from https://dl.minio.io/client/mc/release/windows-amd64/mc.exe
- ``32-bit`` from https://dl.minio.io/client/mc/release/windows-386/mc.exe
~~~
C:\Users\Username\Downloads> mc.exe --help
~~~
#### Source
<blockquote>
NOTE: Source installation is intended for only developers and advanced users. ‘mc update’ continuous delivery mechanism is not supported for ‘go get’ based binary builds. Please download official releases from https://minio.io/#mc.
</blockquote>
If you do not have a working Golang environment, please follow [Install Golang](./INSTALLGO.md).
```sh
$ GO15VENDOREXPERIMENT=1 go get -u github.com/minio/mc
```
## Public Minio Server
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.
## 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).
Once you have them update your ``~/.mc/config.json`` configuration file.
```
$ mc config host add <ALIAS> <YOUR-S3-ENDPOINT> <YOUR-ACCESS-KEY> <YOUR-SECRET-KEY> S3v4
```
Example
```
$ mc config host add mys3 https://s3.amazonaws.com BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12
```
NOTE: ``S3v4`` is default if not specified.
## Configure mc for Google Cloud Storage
Get your AccessKeyID and SecretAccessKey by following [Google Credentials Guide](https://cloud.google.com/storage/docs/migrating?hl=en#keys).
Once you have them update your ``~/.mc/config.json`` configuration file.
```
$ mc config host add <ALIAS> https://storage.googleapis.com <YOUR-ACCESS-KEY> <YOUR-SECRET-KEY> S3v2
```
NOTE: Google Cloud Storage only supports Legacy Signature Version ``2``, so you have to pick - ``S3v2``
## Contribute to Minio Client
Please follow Minio [Contributor's Guide](./CONTRIBUTING.md)
### Jobs
If you think in Lisp or Haskell and hack in go, you would blend right in. Send your github link to callhome@minio.io.
+205
View File
@@ -0,0 +1,205 @@
/*
* Minio Client, (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"encoding/json"
"strings"
"github.com/fatih/color"
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
)
var (
accessFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of access.",
},
}
)
// Set access permissions.
var accessCmd = cli.Command{
Name: "access",
Usage: "Manage bucket access permissions.",
Action: mainAccess,
Flags: append(accessFlags, globalFlags...),
CustomHelpTemplate: `Name:
mc {{.Name}} - {{.Usage}}
USAGE:
mc {{.Name}} [FLAGS] set PERMISSION TARGET [TARGET...]
mc {{.Name}} [FLAGS] get TARGET [TARGET...]
PERMISSION:
Allowed permissions are: [private, readonly, public, authorized].
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Set bucket to "private" on Amazon S3 cloud storage.
$ mc {{.Name}} set private s3/burningman2011
2. Set bucket to "public" on Amazon S3 cloud storage.
$ mc {{.Name}} set public s3/shared
3. Set bucket to "authenticated" on Amazon S3 cloud storage to provide read access to IAM Authenticated Users group.
$ mc {{.Name}} set authorized s3/shared-authenticated
4. Get bucket permissions.
$ mc {{.Name}} get s3/shared
5. Get bucket permissions.
$ mc {{.Name}} get gcs/miniocloud
`,
}
// accessMessage is container for access command on bucket success and failure messages.
type accessMessage struct {
Operation string `json:"operation"`
Status string `json:"status"`
Bucket string `json:"bucket"`
Perms accessPerms `json:"permission"`
}
// String colorized access message.
func (s accessMessage) String() string {
if s.Operation == "set" {
return console.Colorize("Access",
"Set access permission ‘"+string(s.Perms)+"’ updated successfully for ‘"+s.Bucket+"’")
}
if s.Operation == "get" {
return console.Colorize("Access",
"Access permission for ‘"+s.Bucket+"’"+" is ‘"+string(s.Perms)+"’")
}
// nothing to print
return ""
}
// JSON jsonified access message.
func (s accessMessage) JSON() string {
accessJSONBytes, e := json.Marshal(s)
fatalIf(probe.NewError(e), "Unable to marshal into JSON.")
return string(accessJSONBytes)
}
// checkAccessSyntax check for incoming syntax.
func checkAccessSyntax(ctx *cli.Context) {
if !ctx.Args().Present() {
cli.ShowCommandHelpAndExit(ctx, "access", 1) // last argument is exit code.
}
if len(ctx.Args()) < 2 {
cli.ShowCommandHelpAndExit(ctx, "access", 1) // last argument is exit code.
}
switch ctx.Args().First() {
case "set":
if len(ctx.Args().Tail()) < 2 {
cli.ShowCommandHelpAndExit(ctx, "access", 1) // last argument is exit code.
}
perms := accessPerms(ctx.Args().Tail().Get(0))
if !perms.isValidAccessPERM() {
fatalIf(errDummy().Trace(),
"Unrecognized permission ‘"+perms.String()+"’. Allowed values are [private, public, readonly, authorized].")
}
for _, arg := range ctx.Args().Tail().Tail() {
if strings.TrimSpace(arg) == "" {
fatalIf(errInvalidArgument().Trace(), "Unable to validate empty argument.")
}
}
case "get":
if len(ctx.Args().Tail()) < 1 {
cli.ShowCommandHelpAndExit(ctx, "access", 1) // last argument is exit code.
}
}
}
// doSetAccess do set access.
func doSetAccess(targetURL string, targetPERMS accessPerms) *probe.Error {
clnt, err := newClient(targetURL)
if err != nil {
return err.Trace(targetURL)
}
if err = clnt.SetBucketAccess(targetPERMS.String()); err != nil {
return err.Trace(targetURL, targetPERMS.String())
}
return nil
}
// doGetAccess do get access.
func doGetAccess(targetURL string) (perms accessPerms, err *probe.Error) {
clnt, err := newClient(targetURL)
if err != nil {
return "", err.Trace(targetURL)
}
acl, err := clnt.GetBucketAccess()
if err != nil {
return "", err.Trace(targetURL)
}
return aclToPerms(acl), nil
}
func mainAccess(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check 'access' cli arguments.
checkAccessSyntax(ctx)
// Additional command speific theme customization.
console.SetColor("Access", color.New(color.FgGreen, color.Bold))
switch ctx.Args().First() {
case "set":
perms := accessPerms(ctx.Args().Tail().First())
URLs := ctx.Args().Tail().Tail()
for _, targetURL := range URLs {
err := doSetAccess(targetURL, perms)
// Upon error, print and continue.
if err != nil {
errorIf(err.Trace(targetURL, string(perms)),
"Unable to set access permission ‘"+string(perms)+"’ for ‘"+targetURL+"’.")
continue
}
printMsg(accessMessage{
Status: "success",
Operation: "set",
Bucket: targetURL,
Perms: perms,
})
}
case "get":
URLs := ctx.Args().Tail()
for _, targetURL := range URLs {
perms, err := doGetAccess(targetURL)
if err != nil {
errorIf(err.Trace(targetURL), "Unable to get access permission for ‘"+targetURL+"’.")
continue
}
printMsg(accessMessage{
Status: "success",
Operation: "get",
Bucket: targetURL,
Perms: perms,
})
}
}
}
+96
View File
@@ -0,0 +1,96 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
// isValidAccessPERM - is provided access perm string supported.
func (b accessPerms) isValidAccessPERM() bool {
switch true {
case b.isPrivate():
fallthrough
case b.isReadOnly():
fallthrough
case b.isPublic():
fallthrough
case b.isAuthorized():
return true
default:
return false
}
}
// accessPerms - access level.
type accessPerms string
// different types of Access perm's currently supported by accesss command.
const (
accessPrivate = accessPerms("private")
accessReadOnly = accessPerms("readonly")
accessPublic = accessPerms("public")
accessAuthorized = accessPerms("authorized")
)
func (b accessPerms) String() string {
if !b.isValidAccessPERM() {
return string(b)
}
if b.isReadOnly() {
return "public-read"
}
if b.isPublic() {
return "public-read-write"
}
if b.isAuthorized() {
return "authenticated-read"
}
return "private"
}
// convert acl's to access perms
func aclToPerms(acl string) accessPerms {
switch acl {
case "private":
return accessPerms("private")
case "public-read":
return accessPerms("readonly")
case "public-read-write":
return accessPerms("public")
case "authenticated-read":
return accessPerms("authorized")
default:
return accessPerms(acl)
}
}
// isPrivate - is acl Private.
func (b accessPerms) isPrivate() bool {
return b == accessPrivate
}
// isPublicRead - is acl PublicRead.
func (b accessPerms) isReadOnly() bool {
return b == accessReadOnly
}
// isPublicReadWrite - is acl PublicReadWrite.
func (b accessPerms) isPublic() bool {
return b == accessPublic
}
// isAuthorized - is acl AuthorizedRead.
func (b accessPerms) isAuthorized() bool {
return b == accessAuthorized
}
+120
View File
@@ -0,0 +1,120 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"sync"
"sync/atomic"
"time"
)
// accounter keeps tabs of ongoing data transfer information.
type accounter struct {
current int64
Total int64
startTime time.Time
startValue int64
refreshRate time.Duration
currentValue int64
finishOnce sync.Once
isFinished chan struct{}
}
// Instantiate a new accounter.
func newAccounter(total int64) *accounter {
acct := &accounter{
Total: total,
startTime: time.Now(),
startValue: 0,
refreshRate: time.Millisecond * 200,
isFinished: make(chan struct{}),
currentValue: -1,
}
go acct.writer()
return acct
}
// write calculate the final speed.
func (a *accounter) write(current int64) float64 {
fromStart := time.Now().Sub(a.startTime)
currentFromStart := current - a.startValue
if currentFromStart > 0 {
speed := float64(currentFromStart) / (float64(fromStart) / float64(time.Second))
return speed
}
return 0.0
}
// writer update new accounting data for a specified refreshRate.
func (a *accounter) writer() {
a.Update()
for {
select {
case <-a.isFinished:
return
case <-time.After(a.refreshRate):
a.Update()
}
}
}
// accountStat cantainer for current stats captured.
type accountStat struct {
Total int64
Transferred int64
Speed float64
}
// Stat provides current stats captured.
func (a *accounter) Stat() accountStat {
var acntStat accountStat
a.finishOnce.Do(func() {
close(a.isFinished)
acntStat.Total = a.Total
acntStat.Transferred = a.current
acntStat.Speed = a.write(atomic.LoadInt64(&a.current))
})
return acntStat
}
// Update update with new values loaded atomically.
func (a *accounter) Update() {
c := atomic.LoadInt64(&a.current)
if c != a.currentValue {
a.write(c)
a.currentValue = c
}
}
// Set sets the current value atomically.
func (a *accounter) Set(n int64) *accounter {
atomic.StoreInt64(&a.current, n)
return a
}
// Add add to current value atomically.
func (a *accounter) Add(n int64) int64 {
return atomic.AddInt64(&a.current, n)
}
// Read implements Reader which internally updates current value.
func (a *accounter) Read(p []byte) (n int, err error) {
n = len(p)
a.Add(int64(n))
return
}
+167
View File
@@ -0,0 +1,167 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"bytes"
"io"
"net/http"
"path/filepath"
"regexp"
"strconv"
"strings"
"sync"
"time"
)
type objectAPIHandler struct {
lock *sync.Mutex
bucket string
object map[string][]byte
}
func (h objectAPIHandler) getHandler(w http.ResponseWriter, r *http.Request) {
h.lock.Lock()
defer h.lock.Unlock()
switch {
case r.URL.Path == "/":
response := []byte("<ListAllMyBucketsResult xmlns=\"http://doc.s3.amazonaws.com/2006-03-01\"><Buckets><Bucket><Name>bucket</Name><CreationDate>2015-05-20T23:05:09.230Z</CreationDate></Bucket></Buckets><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner></ListAllMyBucketsResult>")
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
w.Write(response)
return
case r.URL.Path == "/bucket":
_, ok := r.URL.Query()["acl"]
if ok {
response := []byte("<?xml version=\"1.0\" encoding=\"UTF-8\"?><AccessControlPolicy><Owner><ID>75aa57f09aa0c8caeab4f8c24e99d10f8e7faeebf76c078efc7c6caea54ba06a</ID><DisplayName>CustomersName@amazon.com</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><ID>75aa57f09aa0c8caeab4f8c24e99d10f8e7faeebf76c078efc7c6caea54ba06a</ID><DisplayName>CustomersName@amazon.com</DisplayName></Grantee><Permission>FULL_CONTROL</Permission></Grant></AccessControlList></AccessControlPolicy>")
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
w.Write(response)
return
}
fallthrough
case r.URL.Path == "/bucket":
response := []byte("<ListBucketResult xmlns=\"http://doc.s3.amazonaws.com/2006-03-01\"><Contents><ETag>b1946ac92492d2347c6235b4d2611184</ETag><Key>object0</Key><LastModified>2015-05-21T18:24:21.097Z</LastModified><Size>22061</Size><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><ETag>b1946ac92492d2347c6235b4d2611184</ETag><Key>object1</Key><LastModified>2015-05-21T18:24:21.097Z</LastModified><Size>22061</Size><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><ETag>b1946ac92492d2347c6235b4d2611184</ETag><Key>object2</Key><LastModified>2015-05-21T18:24:21.097Z</LastModified><Size>22061</Size><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><ETag>b1946ac92492d2347c6235b4d2611184</ETag><Key>object3</Key><LastModified>2015-05-21T18:24:21.097Z</LastModified><Size>22061</Size><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><ETag>b1946ac92492d2347c6235b4d2611184</ETag><Key>object4</Key><LastModified>2015-05-21T18:24:21.097Z</LastModified><Size>22061</Size><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><ETag>b1946ac92492d2347c6235b4d2611184</ETag><Key>object5</Key><LastModified>2015-05-21T18:24:21.097Z</LastModified><Size>22061</Size><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><ETag>b1946ac92492d2347c6235b4d2611184</ETag><Key>object6</Key><LastModified>2015-05-21T18:24:21.097Z</LastModified><Size>22061</Size><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><ETag>b1946ac92492d2347c6235b4d2611184</ETag><Key>object7</Key><LastModified>2015-05-21T18:24:21.097Z</LastModified><Size>22061</Size><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Delimiter></Delimiter><EncodingType></EncodingType><IsTruncated>false</IsTruncated><Marker></Marker><MaxKeys>1000</MaxKeys><Name>testbucket</Name><NextMarker></NextMarker><Prefix></Prefix></ListBucketResult>")
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
w.Write(response)
return
case r.URL.Path != "":
if _, ok := h.object[filepath.Base(r.URL.Path)]; !ok {
w.WriteHeader(http.StatusNotFound)
return
}
w.Header().Set("Content-Length", strconv.Itoa(len(h.object[filepath.Base(r.URL.Path)])))
w.Header().Set("Last-Modified", time.Now().UTC().Format(http.TimeFormat))
w.Header().Set("ETag", "b1946ac92492d2347c6235b4d2611184")
w.WriteHeader(http.StatusOK)
io.Copy(w, bytes.NewReader(h.object[filepath.Base(r.URL.Path)]))
return
}
}
func (h objectAPIHandler) headHandler(w http.ResponseWriter, r *http.Request) {
h.lock.Lock()
defer h.lock.Unlock()
switch {
case r.URL.Path == "/":
w.WriteHeader(http.StatusOK)
return
case r.URL.Path == "/bucket":
w.WriteHeader(http.StatusOK)
return
case r.URL.Path != "":
w.Header().Set("Content-Length", strconv.Itoa(len(h.object[filepath.Base(r.URL.Path)])))
w.Header().Set("Last-Modified", time.Now().UTC().Format(http.TimeFormat))
w.Header().Set("ETag", "b1946ac92492d2347c6235b4d2611184")
w.WriteHeader(http.StatusOK)
return
}
}
func isValidBucket(bucket string) bool {
if len(bucket) < 3 || len(bucket) > 63 {
return false
}
if bucket[0] == '.' || bucket[len(bucket)-1] == '.' {
return false
}
if match, _ := regexp.MatchString("\\.\\.", bucket); match == true {
return false
}
// We don't support buckets with '.' in them
match, _ := regexp.MatchString("^[a-zA-Z][a-zA-Z0-9\\-]+[a-zA-Z0-9]$", bucket)
return match
}
func (h objectAPIHandler) putHandler(w http.ResponseWriter, r *http.Request) {
h.lock.Lock()
defer h.lock.Unlock()
switch {
case r.URL.Path == "/":
w.WriteHeader(http.StatusBadRequest)
return
case r.URL.Path == "/bucket":
_, ok := r.URL.Query()["acl"]
if ok {
switch r.Header.Get("x-amz-acl") {
case "public-read-write":
fallthrough
case "public-read":
fallthrough
case "private":
fallthrough
case "authenticated-read":
w.WriteHeader(http.StatusOK)
return
default:
w.WriteHeader(http.StatusNotImplemented)
return
}
}
w.WriteHeader(http.StatusOK)
return
case r.URL.Path != "":
if !isValidBucket(strings.Split(r.URL.Path, "/")[1]) {
w.WriteHeader(http.StatusBadRequest)
return
}
length, e := strconv.Atoi(r.Header.Get("Content-Length"))
if e != nil {
w.WriteHeader(http.StatusBadRequest)
return
}
var buffer bytes.Buffer
if _, e = io.CopyN(&buffer, r.Body, int64(length)); e != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
h.object[filepath.Base(r.URL.Path)] = buffer.Bytes()
w.Header().Set("ETag", "b1946ac92492d2347c6235b4d2611184")
w.WriteHeader(http.StatusOK)
return
}
}
func (h objectAPIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
switch {
case r.Method == "GET":
h.getHandler(w, r)
case r.Method == "HEAD":
h.headHandler(w, r)
case r.Method == "PUT":
h.putHandler(w, r)
}
}
+47
View File
@@ -0,0 +1,47 @@
# version format
version: "{build}"
# Operating system (build VM template)
os: Windows Server 2012 R2
clone_folder: c:\gopath\src\github.com\minio\mc
# environment variables
environment:
GOPATH: c:\gopath
GO15VENDOREXPERIMENT: 1
# scripts that run after cloning repository
install:
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
- go version
- go env
- go get -u github.com/golang/lint/golint
- go get -u golang.org/x/tools/cmd/vet
- go get -u github.com/fzipp/gocyclo
- go get -u github.com/remyoudompheng/go-misc/deadcode
- go get -u github.com/alecthomas/gometalinter
- go get -u github.com/client9/misspell
# to run your custom scripts instead of automatic MSBuild
build_script:
- go tool vet -all ./pkg
- go tool vet -shadow=true ./pkg
- gofmt -s -l pkg
- golint .
- golint github.com/minio/mc/pkg...
- gometalinter --disable-all --linter='misspell:misspell ./*.go:PATH:LINE:COL:MESSAGE' --enable=misspell ./...
- gocyclo -over 40 pkg
- deadcode
- go test -race .
- go test -race github.com/minio/mc/pkg...
- go run buildscripts/gen-ldflags.go > temp.txt
- set /p LDFLAGS=<temp.txt
- go build -ldflags="%LDFLAGS%" -o %GOPATH%\bin\mc.exe
- mc version
# to disable automatic tests
test: off
# to disable deployment
deploy: off
+28
View File
@@ -0,0 +1,28 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
var (
// mcVersion - version time.RFC3339.
mcVersion = "UNOFFICIAL.GOGET"
// mcReleaseTag - release tag in TAG.%Y-%m-%dT%H-%M-%SZ.
mcReleaseTag = "UNOFFICIAL.GOGET"
// mcCommitID - latest commit id.
mcCommitID = "UNOFFICIAL.GOGET"
// mcShortCommitID - first 12 characters from mcCommitID.
mcShortCommitID = mcCommitID[:12]
)
+218
View File
@@ -0,0 +1,218 @@
#!/usr/bin/env bash
#
# Minio Client, (C) 2015 Minio, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
_init() {
shopt -s extglob
## Minimum required versions for build dependencies
GIT_VERSION="1.0"
GO_VERSION="1.5.1"
OSX_VERSION="10.8"
UNAME=$(uname -sm)
## Check all dependencies are present
MISSING=""
}
readlink() {
TARGET_FILE=$1
cd `dirname $TARGET_FILE`
TARGET_FILE=`basename $TARGET_FILE`
# Iterate down a (possible) chain of symlinks
while [ -L "$TARGET_FILE" ]
do
TARGET_FILE=$(env readlink $TARGET_FILE)
cd `dirname $TARGET_FILE`
TARGET_FILE=`basename $TARGET_FILE`
done
# Compute the canonicalized name by finding the physical path
# for the directory we're in and appending the target file.
PHYS_DIR=`pwd -P`
RESULT=$PHYS_DIR/$TARGET_FILE
echo $RESULT
}
###
#
# Takes two arguments
# arg1: version number in `x.x.x` format
# arg2: version number in `x.x.x` format
#
# example: check_version "$version1" "$version2"
#
# returns:
# 0 - Installed version is equal to required
# 1 - Installed version is greater than required
# 2 - Installed version is lesser than required
# 3 - If args have length zero
#
####
check_version() {
## validate args
[[ -z "$1" ]] && return 3
[[ -z "$2" ]] && return 3
if [[ $1 == $2 ]]; then
return 0
fi
local IFS=.
local i ver1=($1) ver2=($2)
# fill empty fields in ver1 with zeros
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)); do
ver1[i]=0
done
for ((i=0; i<${#ver1[@]}; i++)); do
if [[ -z ${ver2[i]} ]]; then
# fill empty fields in ver2 with zeros
ver2[i]=0
fi
if ((10#${ver1[i]} > 10#${ver2[i]})); then
return 1
fi
if ((10#${ver1[i]} < 10#${ver2[i]})); then
## Installed version is lesser than required - Bad condition
return 2
fi
done
return 0
}
check_golang_env() {
echo ${GOROOT:?} 2>&1 >/dev/null
if [ $? -eq 1 ]; then
echo "ERROR"
echo "GOROOT environment variable missing, please refer to Go installation document"
echo "https://github.com/minio/mc/blob/master/INSTALLGO.md#install-go-13"
exit 1
fi
echo ${GOPATH:?} 2>&1 >/dev/null
if [ $? -eq 1 ]; then
echo "ERROR"
echo "GOPATH environment variable missing, please refer to Go installation document"
echo "https://github.com/minio/mc/blob/master/INSTALLGO.md#install-go-13"
exit 1
fi
local go_binary_path=$(which go)
if [ -z "${go_binary_path}" ] ; then
echo "Cannot find go binary in your PATH configuration, please refer to Go installation document"
echo "https://github.com/minio/mc/blob/master/INSTALLGO.md#install-go-13"
exit -1
fi
local new_go_binary_path=${go_binary_path}
if [ -h "${go_binary_path}" ]; then
new_go_binary_path=$(readlink ${go_binary_path})
fi
if [[ !"$(dirname ${new_go_binary_path})" =~ *"${GOROOT%%*(/)}"* ]] ; then
echo "The go binary found in your PATH configuration does not belong to the Go installation pointed by your GOROOT environment," \
"please refer to Go installation document"
echo "https://github.com/minio/mc/blob/master/INSTALLGO.md#install-go-13"
exit -1
fi
}
is_supported_os() {
case ${UNAME%% *} in
"Linux")
os="linux"
;;
"Darwin")
osx_host_version=$(env sw_vers -productVersion)
check_version "${osx_host_version}" "${OSX_VERSION}"
[[ $? -ge 2 ]] && die "Minimum OSX version supported is ${OSX_VERSION}"
;;
"*")
echo "Exiting.. unsupported operating system found"
exit 1;
esac
}
is_supported_arch() {
local supported
case ${UNAME##* } in
"x86_64")
supported=1
;;
"arm"*)
supported=1
;;
*)
supported=0
;;
esac
if [ $supported -eq 0 ]; then
echo "Invalid arch: ${UNAME} not supported, please use x86_64/amd64"
exit 1;
fi
}
check_deps() {
check_version "$(env go version 2>/dev/null | sed 's/^.* go\([0-9.]*\).*$/\1/')" "${GO_VERSION}"
if [ $? -ge 2 ]; then
MISSING="${MISSING} golang(>=${GO_VERSION})"
fi
check_version "$(env git --version 2>/dev/null | sed -e 's/^.* \([0-9.\].*\).*$/\1/' -e 's/^\([0-9.\]*\).*/\1/g')" "${GIT_VERSION}"
if [ $? -ge 2 ]; then
MISSING="${MISSING} git(>=${GIT_VERSION})"
fi
}
main() {
echo -n "Check for supported arch.. "
is_supported_arch
echo -n "Check for supported os.. "
is_supported_os
echo -n "Checking if proper environment variables are set.. "
check_golang_env
echo "Done"
echo "Using GOPATH=${GOPATH} and GOROOT=${GOROOT}"
echo -n "Checking dependencies for Minio Client.. "
check_deps
## If dependencies are missing, warn the user and abort
if [ "x${MISSING}" != "x" ]; then
echo "ERROR"
echo
echo "The following build tools are missing:"
echo
echo "** ${MISSING} **"
echo
echo "Please install them "
echo "${MISSING}"
echo
echo "Follow https://github.com/minio/mc/blob/master/INSTALLGO.md for further instructions"
exit 1
fi
echo "Done"
}
_init && main "$@"
+70
View File
@@ -0,0 +1,70 @@
// +build ignore
/*
* Mc Client (C) 2014, 2015 Mc, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"fmt"
"os"
"os/exec"
"strings"
"time"
)
func genLDFlags(version string) string {
var ldflagsStr string
ldflagsStr = "-X main.mcVersion=" + version + " "
ldflagsStr = ldflagsStr + "-X main.mcReleaseTag=" + releaseTag(version) + " "
ldflagsStr = ldflagsStr + "-X main.mcCommitID=" + commitID() + " "
ldflagsStr = ldflagsStr + "-X main.mcShortCommitID=" + commitID()[:12]
return ldflagsStr
}
// genReleaseTag prints release tag to the console for easy git tagging.
func releaseTag(version string) string {
relPrefix := "UNOFFICIAL"
if prefix := os.Getenv("MC_RELEASE"); prefix != "" {
relPrefix = prefix
}
relTag := strings.Replace(version, " ", "-", -1)
relTag = strings.Replace(relTag, ":", "-", -1)
relTag = strings.Replace(relTag, ",", "", -1)
return relPrefix + "." + relTag
}
// commitID returns the abbreviated commit-id hash of the last commit.
func commitID() string {
// git log --format="%h" -n1
var (
commit []byte
e error
)
cmdName := "git"
cmdArgs := []string{"log", "--format=%H", "-n1"}
if commit, e = exec.Command(cmdName, cmdArgs...).Output(); e != nil {
fmt.Fprintln(os.Stderr, "Error generating git commit-id: ", e)
os.Exit(1)
}
return strings.TrimSpace(string(commit))
}
func main() {
fmt.Println(genLDFlags(time.Now().UTC().Format(time.RFC3339)))
}
+152
View File
@@ -0,0 +1,152 @@
/*
* Minio Client, (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"errors"
"fmt"
"io"
"os"
"strings"
"syscall"
"github.com/minio/cli"
"github.com/minio/minio-xl/pkg/probe"
)
var (
catFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of cat",
},
}
)
// Display contents of a file.
var catCmd = cli.Command{
Name: "cat",
Usage: "Display contents of a file.",
Action: mainCat,
Flags: append(catFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc {{.Name}} - {{.Usage}}
USAGE:
mc {{.Name}} [FLAGS] SOURCE [SOURCE...]
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Stream an object from Amazon S3 cloud storage to mplayer standard input.
$ mc {{.Name}} s3/ferenginar/klingon_opera_aktuh_maylotah.ogg | mplayer -
2. Concantenate contents of file1.txt and stdin to standard output.
$ mc {{.Name}} file1.txt - > file.txt
3. Concantenate multiple files to one.
$ mc {{.Name}} part.* > complete.img
`,
}
// checkCatSyntax performs command-line input validation for cat command.
func checkCatSyntax(ctx *cli.Context) {
args := ctx.Args()
if !args.Present() {
args = []string{"-"}
}
for _, arg := range args {
if strings.HasPrefix(arg, "-") && len(arg) > 1 {
fatalIf(probe.NewError(errors.New("")), fmt.Sprintf("Unknown flag ‘%s’ passed.", arg))
}
}
}
// catURL displays contents of a URL to stdout.
func catURL(sourceURL string) *probe.Error {
var reader io.Reader
switch sourceURL {
case "-":
reader = os.Stdin
default:
// Ignore size, since os.Stat() would not return proper size all the
// time for local filesystem for example /proc files.
var err *probe.Error
if reader, err = getSourceStream(sourceURL); err != nil {
return err.Trace(sourceURL)
}
}
return catOut(reader).Trace(sourceURL)
}
// catOut reads from reader stream and writes to stdout.
func catOut(r io.Reader) *probe.Error {
// Read till EOF.
if _, e := io.Copy(os.Stdout, r); e != nil {
switch e := e.(type) {
case *os.PathError:
if e.Err == syscall.EPIPE {
// stdout closed by the user. Gracefully exit.
return nil
}
return probe.NewError(e)
default:
return probe.NewError(e)
}
}
return nil
}
// mainCat is the main entry point for cat command.
func mainCat(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check 'cat' cli arguments.
checkCatSyntax(ctx)
// Set command flags from context.
stdinMode := false
if !ctx.Args().Present() {
stdinMode = true
}
// handle std input data.
if stdinMode {
fatalIf(catOut(os.Stdin).Trace(), "Unable to read from standard input.")
return
}
// if Args contain ‘-’, we need to preserve its order specially.
args := []string(ctx.Args())
if ctx.Args().First() == "-" {
for i, arg := range os.Args {
if arg == "cat" {
// Overwrite ctx.Args with os.Args.
args = os.Args[i+1:]
break
}
}
}
// Convert arguments to URLs: expand alias, fix format.
for _, url := range args {
fatalIf(catURL(url).Trace(url), "Unable to read from ‘"+url+"’.")
}
}
+150
View File
@@ -0,0 +1,150 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"io"
"os"
"regexp"
"runtime"
"strings"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/client/fs"
"github.com/minio/mc/pkg/client/s3"
"github.com/minio/minio-xl/pkg/probe"
)
// Check if the target URL represents folder. It may or may not exist yet.
func isTargetURLDir(targetURL string) bool {
targetURLParse := client.NewURL(targetURL)
_, targetContent, err := url2Stat(targetURL)
if err != nil {
_, aliasedTargetURL, _ := mustExpandAlias(targetURL)
if aliasedTargetURL == targetURL {
return false
}
if targetURLParse.Path == string(targetURLParse.Separator) && targetURLParse.Scheme != "" {
return false
}
if strings.HasSuffix(targetURLParse.Path, string(targetURLParse.Separator)) {
return true
}
return false
}
if !targetContent.Type.IsDir() { // Target is a dir.
return false
}
return true
}
// getSource gets a reader from URL.
func getSourceStream(urlStr string) (reader io.Reader, err *probe.Error) {
alias, urlStrFull, _, err := expandAlias(urlStr)
if err != nil {
return nil, err.Trace(urlStr)
}
return getSourceStreamFromAlias(alias, urlStrFull)
}
// getSourceStreamFromAlias gets a reader from URL.
func getSourceStreamFromAlias(alias string, urlStr string) (reader io.Reader, err *probe.Error) {
sourceClnt, err := newClientFromAlias(alias, urlStr)
if err != nil {
return nil, err.Trace(alias, urlStr)
}
reader, err = sourceClnt.Get()
if err != nil {
return nil, err.Trace(alias, urlStr)
}
return reader, nil
}
// putTargetStreamFromAlias writes to URL from Reader.
func putTargetStreamFromAlias(alias string, urlStr string, reader io.Reader, size int64, progress io.Reader) (int64, *probe.Error) {
targetClnt, err := newClientFromAlias(alias, urlStr)
if err != nil {
return 0, err.Trace(alias, urlStr)
}
contentType := guessURLContentType(urlStr)
var n int64
n, err = targetClnt.Put(reader, size, contentType, progress)
if err != nil {
return n, err.Trace(alias, urlStr)
}
return n, nil
}
// putTargetStream writes to URL from reader. If length=-1, read until EOF.
func putTargetStream(urlStr string, reader io.Reader, size int64) (int64, *probe.Error) {
alias, urlStrFull, _, err := expandAlias(urlStr)
if err != nil {
return 0, err.Trace(alias, urlStr)
}
return putTargetStreamFromAlias(alias, urlStrFull, reader, size, nil)
}
// newClientFromAlias gives a new client interface for matching
// alias entry in the mc config file. If no matching host config entry
// is found, fs client is returned.
func newClientFromAlias(alias string, urlStr string) (client.Client, *probe.Error) {
hostCfg := mustGetHostConfig(alias)
if hostCfg == nil {
// No matching host config. So we treat it like a
// filesystem.
fsClient, err := fs.New(urlStr)
if err != nil {
return nil, err.Trace(alias, urlStr)
}
return fsClient, nil
}
// We have a valid alias and hostConfig. We populate the
// credentials from the match found in the config file.
s3Config := new(client.Config)
s3Config.AccessKey = hostCfg.AccessKey
s3Config.SecretKey = hostCfg.SecretKey
s3Config.Signature = hostCfg.API
s3Config.AppName = "mc"
s3Config.AppVersion = mcVersion
s3Config.AppComments = []string{os.Args[0], runtime.GOOS, runtime.GOARCH}
s3Config.HostURL = urlStr
s3Config.Debug = globalDebug
s3Client, err := s3.New(s3Config)
if err != nil {
return nil, err.Trace(alias, urlStr)
}
return s3Client, nil
}
// urlRgx - verify if aliased url is real URL.
var urlRgx = regexp.MustCompile("^https?://")
// newClient gives a new client interface
func newClient(aliasedURL string) (client.Client, *probe.Error) {
alias, urlStrFull, hostCfg, err := expandAlias(aliasedURL)
if err != nil {
return nil, err.Trace(aliasedURL)
}
// Verify if the aliasedURL is a real URL, fail in those cases
// indicating the user to add alias.
if hostCfg == nil && urlRgx.MatchString(aliasedURL) {
return nil, errInvalidAliasedURL(aliasedURL).Trace(aliasedURL)
}
return newClientFromAlias(alias, urlStrFull)
}
+242
View File
@@ -0,0 +1,242 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"fmt"
"strings"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/quick"
)
func fixConfig() {
// Fix config V3
fixConfigV3()
// Fix config V6
fixConfigV6()
// Fix config V6 for hosts
fixConfigV6ForHosts()
/* No more fixing job. Here after we bump the version for changes always.
*/
}
/////////////////// Broken Config V3 ///////////////////
type brokenHostConfigV3 struct {
AccessKeyID string
SecretAccessKey string
}
type brokenConfigV3 struct {
Version string
ACL string
Access string
Aliases map[string]string
Hosts map[string]brokenHostConfigV3
}
// newConfigV3 - get new config broken version 3.
func newBrokenConfigV3() *brokenConfigV3 {
conf := new(brokenConfigV3)
conf.Version = "3"
conf.Aliases = make(map[string]string)
conf.Hosts = make(map[string]brokenHostConfigV3)
return conf
}
// Fix config version ‘3’. Some v3 config files are written without
// proper hostConfig JSON tags. They may also contain unused ACL and
// Access fields. Rewrite the hostConfig with proper fields using JSON
// tags and drop the unused (ACL, Access) fields.
func fixConfigV3() {
if !isMcConfigExists() {
return
}
brokenCfgV3 := newBrokenConfigV3()
brokenMcCfgV3, err := quick.Load(mustGetMcConfigPath(), brokenCfgV3)
fatalIf(err.Trace(), "Unable to load config.")
if brokenMcCfgV3.Version() != "3" {
return
}
cfgV3 := newConfigV3()
isMutated := false
for k, v := range brokenMcCfgV3.Data().(*brokenConfigV3).Aliases {
cfgV3.Aliases[k] = v
}
for host, brokenHostCfgV3 := range brokenMcCfgV3.Data().(*brokenConfigV3).Hosts {
// If any of these fields contains any real value anytime,
// it means we have already fixed the broken configuration.
// We don't have to regenerate again.
if brokenHostCfgV3.AccessKeyID != "" && brokenHostCfgV3.SecretAccessKey != "" {
isMutated = true
}
// Use the correct hostConfig with JSON tags in it.
cfgV3.Hosts[host] = hostConfigV3{
AccessKeyID: brokenHostCfgV3.AccessKeyID,
SecretAccessKey: brokenHostCfgV3.SecretAccessKey,
}
}
// We blindly drop ACL and Access fields from the broken config v3.
if isMutated {
mcNewConfigV3, err := quick.New(cfgV3)
fatalIf(err.Trace(), "Unable to initialize quick config for config version ‘3’.")
err = mcNewConfigV3.Save(mustGetMcConfigPath())
fatalIf(err.Trace(), "Unable to save config version ‘3’.")
console.Infof("Successfully fixed %s broken config for version ‘3’.\n", mustGetMcConfigPath())
}
}
// If the host key does not have http(s), fix it.
func fixConfigV6ForHosts() {
if !isMcConfigExists() {
return
}
brokenMcCfgV6, err := quick.Load(mustGetMcConfigPath(), newConfigV6())
fatalIf(err.Trace(), "Unable to load config.")
if brokenMcCfgV6.Version() != "6" {
return
}
newCfgV6 := newConfigV6()
isMutated := false
// Copy aliases.
for k, v := range brokenMcCfgV6.Data().(*configV6).Aliases {
newCfgV6.Aliases[k] = v
}
url := new(client.URL)
// Copy hosts.
for host, hostCfgV6 := range brokenMcCfgV6.Data().(*configV6).Hosts {
// Already fixed - Copy and move on.
if strings.HasPrefix(host, "https") || strings.HasPrefix(host, "http") {
newCfgV6.Hosts[host] = hostCfgV6
continue
}
// If host entry does not contain "http(s)", introduce a new entry and delete the old one.
if host == "s3.amazonaws.com" || host == "storage.googleapis.com" ||
host == "localhost:9000" || host == "127.0.0.1:9000" ||
host == "play.minio.io:9000" || host == "dl.minio.io:9000" {
console.Infoln("Found broken host entries, replacing " + host + " with https://" + host + ".")
url.Host = host
url.Scheme = "https"
url.SchemeSeparator = "://"
newCfgV6.Hosts[url.String()] = hostCfgV6
isMutated = true
continue
}
}
if isMutated {
// Save the new config back to the disk.
mcCfgV6, err := quick.New(newCfgV6)
fatalIf(err.Trace(), "Unable to initialize quick config for config version ‘v6’.")
err = mcCfgV6.Save(mustGetMcConfigPath())
fatalIf(err.Trace(), "Unable to save config version ‘v6’.")
}
}
// fixConfigV6 - fix all the unnecessary glob URLs present in existing config version 6.
func fixConfigV6() {
if !isMcConfigExists() {
return
}
config, err := quick.New(newConfigV6())
fatalIf(err.Trace(), "Unable to initialize config.")
err = config.Load(mustGetMcConfigPath())
fatalIf(err.Trace(mustGetMcConfigPath()), "Unable to load config.")
if config.Data().(*configV6).Version != "6" {
return
}
newConfig := new(configV6)
isMutated := false
newConfig.Aliases = make(map[string]string)
newConfig.Hosts = make(map[string]hostConfigV6)
newConfig.Version = "6"
newConfig.Aliases = config.Data().(*configV6).Aliases
for host, hostCfg := range config.Data().(*configV6).Hosts {
if strings.Contains(host, "*") {
fatalIf(err.Trace(),
fmt.Sprintf("Glob style ‘*’ pattern matching is no longer supported. Please fix ‘%s’ entry manually.", host))
}
if strings.Contains(host, "*s3*") || strings.Contains(host, "*.s3*") {
console.Infoln("Found glob url, replacing " + host + " with s3.amazonaws.com")
newConfig.Hosts["s3.amazonaws.com"] = hostCfg
isMutated = true
continue
}
if strings.Contains(host, "s3*") {
console.Infoln("Found glob url, replacing " + host + " with s3.amazonaws.com")
newConfig.Hosts["s3.amazonaws.com"] = hostCfg
isMutated = true
continue
}
if strings.Contains(host, "*amazonaws.com") || strings.Contains(host, "*.amazonaws.com") {
console.Infoln("Found glob url, replacing " + host + " with s3.amazonaws.com")
newConfig.Hosts["s3.amazonaws.com"] = hostCfg
isMutated = true
continue
}
if strings.Contains(host, "*storage.googleapis.com") {
console.Infoln("Found glob url, replacing " + host + " with storage.googleapis.com")
newConfig.Hosts["storage.googleapis.com"] = hostCfg
isMutated = true
continue
}
if strings.Contains(host, "localhost:*") {
console.Infoln("Found glob url, replacing " + host + " with localhost:9000")
newConfig.Hosts["localhost:9000"] = hostCfg
isMutated = true
continue
}
if strings.Contains(host, "127.0.0.1:*") {
console.Infoln("Found glob url, replacing " + host + " with 127.0.0.1:9000")
newConfig.Hosts["127.0.0.1:9000"] = hostCfg
isMutated = true
continue
}
// Other entries are hopefully OK. Copy them blindly.
newConfig.Hosts[host] = hostCfg
}
if isMutated {
newConf, err := quick.New(newConfig)
fatalIf(err.Trace(), "Unable to initialize newly fixed config.")
err = newConf.Save(mustGetMcConfigPath())
fatalIf(err.Trace(mustGetMcConfigPath()), "Unable to save newly fixed config path.")
console.Infof("Successfully fixed %s broken config for version ‘6’.\n", mustGetMcConfigPath())
}
}
+285
View File
@@ -0,0 +1,285 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"encoding/json"
"fmt"
"strings"
"github.com/fatih/color"
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
)
var (
configHostFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of config host",
},
}
)
var configHostCmd = cli.Command{
Name: "host",
Usage: "List, modify and remove hosts in configuration file.",
Flags: append(configHostFlags, globalFlags...),
Action: mainConfigHost,
CustomHelpTemplate: `NAME:
mc config {{.Name}} - {{.Usage}}
USAGE:
mc config {{.Name}} OPERATION
OPERATION:
add ALIAS URL ACCESS-KEY SECRET-KEY [API]
remove ALIAS
list
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Add Amazon S3 storage service under "myphotos" alias. For security reasons turn off bash history momentarily.
$ set +o history
$ mc config {{.Name}} add myphotos https://s3.amazonaws.com BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12
$ set -o history
2. Add Google Cloud Storage service under "goodisk" alias.
$ mc config {{.Name}} add goodisk https://storage.googleapis.com BKIKJAA5BMMU2RHO6IBB V7f1CwQqAcwo80UEIJEjc5gVQUSSx5ohQ9GSrr12 S3v2
3. List all hosts.
$ mc config {{.Name}} list
4. Remove "goodisk" config.
$ mc config {{.Name}} remove goodisk
`,
}
// hostMessage container for content message structure
type hostMessage struct {
op string
Status string `json:"status"`
Alias string `json:"alias"`
URL string `json:"URL"`
AccessKey string `json:"accessKey,omitempty"`
SecretKey string `json:"secretKey,omitempty"`
API string `json:"api,omitempty"`
}
// String colorized host message
func (h hostMessage) String() string {
switch h.op {
case "list":
message := console.Colorize("Alias", fmt.Sprintf("%s: ", h.Alias))
message += console.Colorize("URL", fmt.Sprintf("%s", h.URL))
if h.AccessKey != "" || h.SecretKey != "" {
message += " | " + console.Colorize("AccessKey", fmt.Sprintf("<- %s,", h.AccessKey))
message += " | " + console.Colorize("SecretKey", fmt.Sprintf(" %s,", h.SecretKey))
message += " | " + console.Colorize("API", fmt.Sprintf(" %s", h.API))
}
return message
case "remove":
return console.Colorize("HostMessage", "Removed ‘"+h.Alias+"’ successfully.")
case "add":
return console.Colorize("HostMessage", "Added ‘"+h.Alias+"’ successfully.")
default:
return ""
}
}
// JSON jsonified host message
func (h hostMessage) JSON() string {
h.Status = "success"
jsonMessageBytes, e := json.Marshal(h)
fatalIf(probe.NewError(e), "Unable to marshal into JSON.")
return string(jsonMessageBytes)
}
// Validate command-line input args.
func checkConfigHostSyntax(ctx *cli.Context) {
// show help if nothing is set
if !ctx.Args().Present() {
cli.ShowCommandHelpAndExit(ctx, "host", 1) // last argument is exit code
}
switch strings.TrimSpace(ctx.Args().First()) {
case "add":
checkConfigHostAddSyntax(ctx)
case "remove":
checkConfigHostRemoveSyntax(ctx)
case "list":
default:
cli.ShowCommandHelpAndExit(ctx, "host", 1) // last argument is exit code
}
}
// checkConfigHostAddSyntax - verifies input arguments to 'config host add'.
func checkConfigHostAddSyntax(ctx *cli.Context) {
tailArgs := ctx.Args().Tail()
tailsArgsNr := len(tailArgs)
if tailsArgsNr < 4 || tailsArgsNr > 5 {
fatalIf(errInvalidArgument().Trace(ctx.Args().Tail()...),
"Incorrect number of arguments for host add command.")
}
alias := tailArgs.Get(0)
url := tailArgs.Get(1)
accessKey := tailArgs.Get(2)
secretKey := tailArgs.Get(3)
api := tailArgs.Get(4)
if !isValidAlias(alias) {
fatalIf(errDummy().Trace(alias), "Invalid alias ‘"+alias+"’.")
}
if !isValidHostURL(url) {
fatalIf(errDummy().Trace(url),
"Invalid URL ‘"+url+"’.")
}
if !isValidAccessKey(accessKey) {
fatalIf(errInvalidArgument().Trace(accessKey),
"Invalid access key ‘"+accessKey+"’.")
}
if !isValidSecretKey(secretKey) {
fatalIf(errInvalidArgument().Trace(secretKey),
"Invalid secret key ‘"+secretKey+"’.")
}
switch api {
case "S3v2", "S3v4", "":
default:
fatalIf(errInvalidArgument().Trace(api),
"Unrecognized API signature. Valid options are ‘[ S3v4, S3v2 ]’.")
}
}
// checkConfigHostRemoveSyntax - verifies input arguments to 'config host remove'.
func checkConfigHostRemoveSyntax(ctx *cli.Context) {
tailArgs := ctx.Args().Tail()
if len(ctx.Args().Tail()) != 1 {
fatalIf(errInvalidArgument().Trace(tailArgs...),
"Incorrect number of arguments for remove host command.")
}
if !isValidAlias(tailArgs.Get(0)) {
fatalIf(errDummy().Trace(tailArgs.Get(0)),
"Invalid alias ‘"+tailArgs.Get(0)+"’.")
}
}
func mainConfigHost(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check 'config host' cli arguments.
checkConfigHostSyntax(ctx)
// Additional command speific theme customization.
console.SetColor("HostMessage", color.New(color.FgGreen))
console.SetColor("Alias", color.New(color.FgCyan, color.Bold))
console.SetColor("URL", color.New(color.FgCyan))
console.SetColor("AccessKey", color.New(color.FgBlue))
console.SetColor("SecretKey", color.New(color.FgBlue))
console.SetColor("API", color.New(color.FgYellow))
cmd := ctx.Args().First()
args := ctx.Args().Tail()
// Switch case through commands.
switch strings.TrimSpace(cmd) {
case "add":
alias := args.Get(0)
url := args.Get(1)
accessKey := args.Get(2)
secretKey := args.Get(3)
api := args.Get(4)
if strings.TrimSpace(api) == "" {
api = "S3v4"
}
hostCfg := hostConfigV7{
URL: url,
AccessKey: accessKey,
SecretKey: secretKey,
API: api,
}
addHost(alias, hostCfg) // Add a host with specified credentials.
case "remove":
alias := args.Get(0)
removeHost(alias) // Remove a host.
case "list":
listHosts() // List all configured hosts.
}
}
// addHost - add a host config.
func addHost(alias string, hostCfgV7 hostConfigV7) {
mcCfgV7, err := loadMcConfig()
fatalIf(err.Trace(globalMCConfigVersion), "Unable to load config ‘"+mustGetMcConfigPath()+"’.")
// Add new host.
mcCfgV7.Hosts[alias] = hostCfgV7
err = saveMcConfig(mcCfgV7)
fatalIf(err.Trace(alias), "Unable to update hosts in config version ‘"+mustGetMcConfigPath()+"’.")
printMsg(hostMessage{
op: "add",
Alias: alias,
URL: hostCfgV7.URL,
AccessKey: hostCfgV7.AccessKey,
SecretKey: hostCfgV7.SecretKey,
API: hostCfgV7.API,
})
}
// removeHost - removes a host.
func removeHost(alias string) {
conf, err := loadMcConfig()
fatalIf(err.Trace(globalMCConfigVersion), "Unable to load config version ‘"+globalMCConfigVersion+"’.")
// Remove host.
delete(conf.Hosts, alias)
err = saveMcConfig(conf)
fatalIf(err.Trace(alias), "Unable to save deleted hosts in config version ‘"+globalMCConfigVersion+"’.")
printMsg(hostMessage{op: "remove", Alias: alias})
}
// listHosts - list all host URLs.
func listHosts() {
conf, err := loadMcConfig()
fatalIf(err.Trace(globalMCConfigVersion), "Unable to load config version ‘"+globalMCConfigVersion+"’.")
for k, v := range conf.Hosts {
printMsg(hostMessage{
op: "list",
Alias: k,
URL: v.URL,
AccessKey: v.AccessKey,
SecretKey: v.SecretKey,
API: v.API,
})
}
}
+77
View File
@@ -0,0 +1,77 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import "github.com/minio/cli"
// Configure minio client
//
// ----
// NOTE: that the configure command only writes values to the config file.
// It does not use any configuration values from the environment variables.
//
// One needs to edit configuration file manually, this is purposefully done
// so to avoid taking credentials over cli arguments. It is a security precaution
// ----
//
var (
configFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of config.",
},
}
)
var configCmd = cli.Command{
Name: "config",
Usage: "Manage configuration file.",
Action: mainConfig,
Flags: append(configFlags, globalFlags...),
Subcommands: []cli.Command{
configHostCmd,
},
CustomHelpTemplate: `NAME:
{{.Name}} - {{.Usage}}
USAGE:
{{.Name}} [FLAGS] COMMAND
FLAGS:
{{range .Flags}}{{.}}
{{end}}
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}
`,
}
// mainConfig is the handle for "mc config" command. provides sub-commands which write configuration data in json format to config file.
func mainConfig(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
if ctx.Args().First() != "" { // command help.
cli.ShowCommandHelp(ctx, ctx.Args().First())
} else {
// command with Subcommands is an App.
cli.ShowAppHelp(ctx)
}
// Sub-commands like "host" and "alias" have their own main.
}
+380
View File
@@ -0,0 +1,380 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"fmt"
"strings"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/quick"
)
// migrate config files from the any older version to the latest.
func migrateConfig() {
// Migrate config V1 to V101
migrateConfigV1ToV101()
// Migrate config V101 to V2
migrateConfigV101ToV2()
// Migrate config V2 to V3
migrateConfigV2ToV3()
// Migrate config V3 to V4
migrateConfigV3ToV4()
// Migrate config V4 to V5
migrateConfigV4ToV5()
// Migrate config V5 to V6
migrateConfigV5ToV6()
// Migrate config V6 to V7
migrateConfigV6ToV7()
}
// Migrate from config version 1.0 to 1.0.1. Populate example entries and save it back.
func migrateConfigV1ToV101() {
if !isMcConfigExists() {
return
}
mcCfgV1, err := quick.Load(mustGetMcConfigPath(), newConfigV1())
fatalIf(err.Trace(), "Unable to load config version ‘1’.")
// If loaded config version does not match 1.0.0, we do nothing.
if mcCfgV1.Version() != "1.0.0" {
return
}
// 1.0.1 is compatible to 1.0.0. We are just adding new entries.
cfgV101 := newConfigV101()
// Copy aliases.
for k, v := range mcCfgV1.Data().(*configV1).Aliases {
cfgV101.Aliases[k] = v
}
// Copy hosts.
for k, hostCfgV1 := range mcCfgV1.Data().(*configV1).Hosts {
cfgV101.Hosts[k] = hostConfigV101{
AccessKeyID: hostCfgV1.AccessKeyID,
SecretAccessKey: hostCfgV1.SecretAccessKey,
}
}
// Example localhost entry.
if _, ok := cfgV101.Hosts["localhost:*"]; !ok {
cfgV101.Hosts["localhost:*"] = hostConfigV101{}
}
// Example loopback IP entry.
if _, ok := cfgV101.Hosts["127.0.0.1:*"]; !ok {
cfgV101.Hosts["127.0.0.1:*"] = hostConfigV101{}
}
// Example AWS entry.
// Look for glob string (not glob match). We used to support glob based key matching earlier.
if _, ok := cfgV101.Hosts["*.s3*.amazonaws.com"]; !ok {
cfgV101.Hosts["*.s3*.amazonaws.com"] = hostConfigV101{
AccessKeyID: "YOUR-ACCESS-KEY-ID-HERE",
SecretAccessKey: "YOUR-SECRET-ACCESS-KEY-HERE",
}
}
// Save the new config back to the disk.
mcCfgV101, err := quick.New(cfgV101)
fatalIf(err.Trace(), "Unable to initialize quick config for config version ‘1.0.1’.")
err = mcCfgV101.Save(mustGetMcConfigPath())
fatalIf(err.Trace(), "Unable to save config version ‘1.0.1’.")
console.Infof("Successfully migrated %s from version ‘1.0.0’ to version ‘1.0.1’.\n", mustGetMcConfigPath())
}
// Migrate from config ‘1.0.1’ to ‘2’. Drop semantic versioning and move to integer versioning. No other changes.
func migrateConfigV101ToV2() {
if !isMcConfigExists() {
return
}
mcCfgV101, err := quick.Load(mustGetMcConfigPath(), newConfigV101())
fatalIf(err.Trace(), "Unable to load config version ‘1.0.1’.")
// update to newer version
if mcCfgV101.Version() != "1.0.1" {
return
}
cfgV2 := newConfigV2()
// Copy aliases.
for k, v := range mcCfgV101.Data().(*configV101).Aliases {
cfgV2.Aliases[k] = v
}
// Copy hosts.
for k, hostCfgV101 := range mcCfgV101.Data().(*configV101).Hosts {
cfgV2.Hosts[k] = hostConfigV2{
AccessKeyID: hostCfgV101.AccessKeyID,
SecretAccessKey: hostCfgV101.SecretAccessKey,
}
}
mcCfgV2, err := quick.New(cfgV2)
fatalIf(err.Trace(), "Unable to initialize quick config for config version ‘2’.")
err = mcCfgV2.Save(mustGetMcConfigPath())
fatalIf(err.Trace(), "Unable to save config version ‘2’.")
console.Infof("Successfully migrated %s from version ‘1.0.1’ to version ‘2’.\n", mustGetMcConfigPath())
}
// Migrate from config ‘2’ to ‘3’. Use ‘-’ separated names for
// hostConfig using struct json tags.
func migrateConfigV2ToV3() {
if !isMcConfigExists() {
return
}
mcCfgV2, err := quick.Load(mustGetMcConfigPath(), newConfigV2())
fatalIf(err.Trace(), "Unable to load mc config V2.")
// update to newer version
if mcCfgV2.Version() != "2" {
return
}
cfgV3 := newConfigV3()
// Copy aliases.
for k, v := range mcCfgV2.Data().(*configV2).Aliases {
cfgV3.Aliases[k] = v
}
// Copy hosts.
for k, hostCfgV2 := range mcCfgV2.Data().(*configV2).Hosts {
// New hostConfV3 uses struct json tags.
cfgV3.Hosts[k] = hostConfigV3{
AccessKeyID: hostCfgV2.AccessKeyID,
SecretAccessKey: hostCfgV2.SecretAccessKey,
}
}
mcNewCfgV3, err := quick.New(cfgV3)
fatalIf(err.Trace(), "Unable to initialize quick config for config version ‘3’.")
err = mcNewCfgV3.Save(mustGetMcConfigPath())
fatalIf(err.Trace(), "Unable to save config version ‘3’.")
console.Infof("Successfully migrated %s from version ‘2’ to version ‘3’.\n", mustGetMcConfigPath())
}
// Migrate from config version ‘3’ to ‘4’. Introduce API Signature
// field in host config. Also Use JavaScript notation for field names.
func migrateConfigV3ToV4() {
if !isMcConfigExists() {
return
}
mcCfgV3, err := quick.Load(mustGetMcConfigPath(), newConfigV3())
fatalIf(err.Trace(), "Unable to load mc config V2.")
// update to newer version
if mcCfgV3.Version() != "3" {
return
}
cfgV4 := newConfigV4()
for k, v := range mcCfgV3.Data().(*configV3).Aliases {
cfgV4.Aliases[k] = v
}
// New hostConfig has API signature. All older entries were V4
// only. So it is safe to assume V4 as default for all older
// entries.
// HostConfigV4 als uses JavaScript naming notation for struct JSON tags.
for host, hostCfgV3 := range mcCfgV3.Data().(*configV3).Hosts {
cfgV4.Hosts[host] = hostConfigV4{
AccessKeyID: hostCfgV3.AccessKeyID,
SecretAccessKey: hostCfgV3.SecretAccessKey,
Signature: "v4",
}
}
mcNewCfgV4, err := quick.New(cfgV4)
fatalIf(err.Trace(), "Unable to initialize quick config for config version ‘4’.")
err = mcNewCfgV4.Save(mustGetMcConfigPath())
fatalIf(err.Trace(), "Unable to save config version ‘4’.")
console.Infof("Successfully migrated %s from version ‘3’ to version ‘4’.\n", mustGetMcConfigPath())
}
// Migrate config version ‘4’ to ‘5’. Rename hostConfigV4.Signature -> hostConfigV5.API.
func migrateConfigV4ToV5() {
if !isMcConfigExists() {
return
}
mcCfgV4, err := quick.Load(mustGetMcConfigPath(), newConfigV4())
fatalIf(err.Trace(), "Unable to load mc config V4.")
// update to newer version
if mcCfgV4.Version() != "4" {
return
}
cfgV5 := newConfigV5()
for k, v := range mcCfgV4.Data().(*configV4).Aliases {
cfgV5.Aliases[k] = v
}
for host, hostCfgV4 := range mcCfgV4.Data().(*configV4).Hosts {
cfgV5.Hosts[host] = hostConfigV5{
AccessKeyID: hostCfgV4.AccessKeyID,
SecretAccessKey: hostCfgV4.SecretAccessKey,
API: "v4", // Rename from .Signature to .API
}
}
mcNewCfgV5, err := quick.New(cfgV5)
fatalIf(err.Trace(), "Unable to initialize quick config for config version ‘5’.")
err = mcNewCfgV5.Save(mustGetMcConfigPath())
fatalIf(err.Trace(), "Unable to save config version ‘5’.")
console.Infof("Successfully migrated %s from version ‘4’ to version ‘5’.\n", mustGetMcConfigPath())
}
// Migrate config version ‘5’ to ‘6’. Add google cloud storage servers
// to host config. Also remove "." from s3 aws glob rule.
func migrateConfigV5ToV6() {
if !isMcConfigExists() {
return
}
mcCfgV5, err := quick.Load(mustGetMcConfigPath(), newConfigV5())
fatalIf(err.Trace(), "Unable to load mc config V5.")
// update to newer version
if mcCfgV5.Version() != "5" {
return
}
cfgV6 := newConfigV6()
// Add new Google Cloud Storage alias.
cfgV6.Aliases["gcs"] = "https://storage.googleapis.com"
for k, v := range mcCfgV5.Data().(*configV5).Aliases {
cfgV6.Aliases[k] = v
}
// Add defaults.
cfgV6.Hosts["*s3*amazonaws.com"] = hostConfigV6{
AccessKeyID: "YOUR-ACCESS-KEY-ID-HERE",
SecretAccessKey: "YOUR-SECRET-ACCESS-KEY-HERE",
API: "S3v4",
}
cfgV6.Hosts["*storage.googleapis.com"] = hostConfigV6{
AccessKeyID: "YOUR-ACCESS-KEY-ID-HERE",
SecretAccessKey: "YOUR-SECRET-ACCESS-KEY-HERE",
API: "S3v2",
}
for host, hostCfgV5 := range mcCfgV5.Data().(*configV5).Hosts {
// Find any matching s3 entry and copy keys from it to newer generalized glob entry.
if strings.Contains(host, "s3") {
if (hostCfgV5.AccessKeyID == "YOUR-ACCESS-KEY-ID-HERE") ||
(hostCfgV5.SecretAccessKey == "YOUR-SECRET-ACCESS-KEY-HERE") ||
hostCfgV5.AccessKeyID == "" ||
hostCfgV5.SecretAccessKey == "" {
continue // Skip defaults.
}
// Now we have real keys set by the user. Copy
// them over to newer glob rule.
// Original host entry has "." in the glob rule.
host = "*s3*amazonaws.com" // Use this glob entry.
}
cfgV6.Hosts[host] = hostConfigV6{
AccessKeyID: hostCfgV5.AccessKeyID,
SecretAccessKey: hostCfgV5.SecretAccessKey,
API: hostCfgV5.API,
}
}
mcNewCfgV6, err := quick.New(cfgV6)
fatalIf(err.Trace(), "Unable to initialize quick config for config version ‘6’.")
err = mcNewCfgV6.Save(mustGetMcConfigPath())
fatalIf(err.Trace(), "Unable to save config version ‘6’.")
console.Infof("Successfully migrated %s from version ‘5’ to version ‘6’.\n", mustGetMcConfigPath())
}
// Migrate config version ‘6’ to ‘7'. Remove alias map and introduce
// named Host config. Also no more glob match for host config entries.
func migrateConfigV6ToV7() {
if !isMcConfigExists() {
return
}
mcCfgV6, err := quick.Load(mustGetMcConfigPath(), newConfigV6())
fatalIf(err.Trace(), "Unable to load mc config V6.")
if mcCfgV6.Version() != "6" {
return
}
cfgV7 := newConfigV7()
aliasIndex := 0
// We dropped alias support in v7. We only need to migrate host configs.
for host, hostCfgV6 := range mcCfgV6.Data().(*configV6).Hosts {
if hostCfgV6.AccessKeyID == "YOUR-ACCESS-KEY-ID-HERE" ||
hostCfgV6.SecretAccessKey == "YOUR-SECRET-ACCESS-KEY-HERE" ||
hostCfgV6.AccessKeyID == "" ||
hostCfgV6.SecretAccessKey == "" {
// Ignore default entries. configV7.loadDefaults() will re-insert them back.
} else if host == "https://s3.amazonaws.com" {
// Only one entry can exist for "s3" domain.
cfgV7.Hosts["s3"] = hostConfigV7{
URL: host,
AccessKey: hostCfgV6.AccessKeyID,
SecretKey: hostCfgV6.SecretAccessKey,
API: hostCfgV6.API,
}
} else if host == "https://storage.googleapis.com" {
// Only one entry can exist for "gcs" domain.
cfgV7.Hosts["gcs"] = hostConfigV7{
URL: host,
AccessKey: hostCfgV6.AccessKeyID,
SecretKey: hostCfgV6.SecretAccessKey,
API: hostCfgV6.API,
}
} else {
// Assign a generic "cloud1", cloud2..." key
// for all other entries that has valid keys set.
alias := fmt.Sprintf("cloud%d", aliasIndex)
aliasIndex++
cfgV7.Hosts[alias] = hostConfigV7{
URL: host,
AccessKey: hostCfgV6.AccessKeyID,
SecretKey: hostCfgV6.SecretAccessKey,
API: hostCfgV6.API,
}
}
}
// Load default settings.
cfgV7.loadDefaults()
mcNewCfgV7, err := quick.New(cfgV7)
fatalIf(err.Trace(), "Unable to initialize quick config for config version ‘7’.")
err = mcNewCfgV7.Save(mustGetMcConfigPath())
fatalIf(err.Trace(), "Unable to save config version ‘7’.")
console.Infof("Successfully migrated %s from version ‘6’ to version ‘7’.\n", mustGetMcConfigPath())
}
+164
View File
@@ -0,0 +1,164 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
/////////////////// Config V1 ///////////////////
type hostConfigV1 struct {
AccessKeyID string
SecretAccessKey string
}
type configV1 struct {
Version string
Aliases map[string]string
Hosts map[string]hostConfigV1
}
// newConfigV1() - get new config version 1.0.0
func newConfigV1() *configV1 {
conf := new(configV1)
conf.Version = "1.0.0"
// make sure to allocate map's otherwise Golang
// exits silently without providing any errors
conf.Aliases = make(map[string]string)
conf.Hosts = make(map[string]hostConfigV1)
return conf
}
/////////////////// Config V101 ///////////////////
type hostConfigV101 hostConfigV1
type configV101 struct {
Version string
Aliases map[string]string
Hosts map[string]hostConfigV101
}
// newConfigV101() - get new config version 1.0.1
func newConfigV101() *configV101 {
conf := new(configV101)
conf.Version = "1.0.1"
conf.Aliases = make(map[string]string)
conf.Hosts = make(map[string]hostConfigV101)
return conf
}
/////////////////// Config V2 ///////////////////
type hostConfigV2 hostConfigV1
type configV2 struct {
Version string
Aliases map[string]string
Hosts map[string]hostConfigV2
}
// newConfigV2() - get new config version 2
func newConfigV2() *configV2 {
conf := new(configV2)
conf.Version = "2"
conf.Aliases = make(map[string]string)
conf.Hosts = make(map[string]hostConfigV2)
return conf
}
/////////////////// Config V3 ///////////////////
type hostConfigV3 struct {
AccessKeyID string `json:"access-key-id"`
SecretAccessKey string `json:"secret-access-key"`
}
type configV3 struct {
Version string `json:"version"`
Aliases map[string]string `json:"alias"`
Hosts map[string]hostConfigV3 `json:"hosts"`
}
// newConfigV3 - get new config version 3.
func newConfigV3() *configV3 {
conf := new(configV3)
conf.Version = "3"
conf.Aliases = make(map[string]string)
conf.Hosts = make(map[string]hostConfigV3)
return conf
}
/////////////////// Config V4 ///////////////////
type hostConfigV4 struct {
AccessKeyID string `json:"accessKeyId"`
SecretAccessKey string `json:"secretAccessKey"`
Signature string `json:"signature"`
}
type configV4 struct {
Version string `json:"version"`
Aliases map[string]string `json:"alias"`
Hosts map[string]hostConfigV4 `json:"hosts"`
}
func newConfigV4() *configV4 {
conf := new(configV4)
conf.Version = "4"
conf.Aliases = make(map[string]string)
conf.Hosts = make(map[string]hostConfigV4)
return conf
}
/////////////////// Config V5 ///////////////////
type hostConfigV5 struct {
AccessKeyID string `json:"accessKeyId"`
SecretAccessKey string `json:"secretAccessKey"`
API string `json:"api"`
}
type configV5 struct {
Version string `json:"version"`
Aliases map[string]string `json:"alias"`
Hosts map[string]hostConfigV5 `json:"hosts"`
}
func newConfigV5() *configV5 {
conf := new(configV5)
conf.Version = "5"
conf.Aliases = make(map[string]string)
conf.Hosts = make(map[string]hostConfigV5)
return conf
}
/////////////////// Config V6 ///////////////////
type hostConfigV6 struct {
AccessKeyID string `json:"accessKeyId"`
SecretAccessKey string `json:"secretAccessKey"`
API string `json:"api"`
}
type configV6 struct {
Version string `json:"version"`
Aliases map[string]string `json:"alias"`
Hosts map[string]hostConfigV6 `json:"hosts"`
}
// newConfigV6 - new config version '6'.
func newConfigV6() *configV6 {
conf := new(configV6)
conf.Version = "6"
conf.Aliases = make(map[string]string)
conf.Hosts = make(map[string]hostConfigV6)
return conf
}
/////////////////// Config V7 ///////////////////
// RESERVED FOR FUTURE
+41
View File
@@ -0,0 +1,41 @@
package main
import (
"regexp"
"strings"
"github.com/minio/mc/pkg/client"
)
// isValidSecretKey - validate secret key.
func isValidSecretKey(secretKey string) bool {
if secretKey == "" {
return true
}
regex := regexp.MustCompile("^.{40}$")
return regex.MatchString(secretKey)
}
// isValidAccessKey - validate access key.
func isValidAccessKey(accessKey string) bool {
if accessKey == "" {
return true
}
regex := regexp.MustCompile("^[A-Z0-9\\-\\.\\_\\~]{20}$")
return regex.MatchString(accessKey)
}
// isValidHostURL - validate input host url.
func isValidHostURL(hostURL string) bool {
if strings.TrimSpace(hostURL) == "" {
return false
}
url := client.NewURL(hostURL)
if url.Scheme != "https" && url.Scheme != "http" {
return false
}
if url.Path != "" && url.Path != "/" {
return false
}
return true
}
+157
View File
@@ -0,0 +1,157 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"sync"
"github.com/minio/minio-xl/pkg/probe"
"github.com/minio/minio-xl/pkg/quick"
)
const (
defaultAccessKey = "YOUR-ACCESS-KEY-HERE"
defaultSecretKey = "YOUR-SECRET-KEY-HERE"
)
var (
// set once during first load.
cacheCfgV7 *configV7
// All access to mc config file should be synchronized.
cfgMutex = &sync.RWMutex{}
)
// hostConfig configuration of a host.
type hostConfigV7 struct {
URL string `json:"url"`
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
API string `json:"api"`
}
// configV7 config version.
type configV7 struct {
Version string `json:"version"`
Hosts map[string]hostConfigV7 `json:"hosts"`
}
// newConfigV7 - new config version.
func newConfigV7() *configV7 {
cfg := new(configV7)
cfg.Version = globalMCConfigVersion
cfg.Hosts = make(map[string]hostConfigV7)
return cfg
}
// SetHost sets host config if not empty.
func (c *configV7) setHost(alias string, cfg hostConfigV7) {
if _, ok := c.Hosts[alias]; !ok {
c.Hosts[alias] = cfg
}
}
// load default values for missing entries.
func (c *configV7) loadDefaults() {
// Minio server running locally.
c.setHost("local", hostConfigV7{
URL: "http://localhost:9000",
AccessKey: "",
SecretKey: "",
API: "S3v4",
})
// Amazon S3 cloud storage service.
c.setHost("s3", hostConfigV7{
URL: "https://s3.amazonaws.com",
AccessKey: defaultAccessKey,
SecretKey: defaultSecretKey,
API: "S3v4",
})
// Google cloud storage service.
c.setHost("gcs", hostConfigV7{
URL: "https://storage.googleapis.com",
AccessKey: defaultAccessKey,
SecretKey: defaultSecretKey,
API: "S3v2",
})
// Minio anonymous server for demo.
c.setHost("play", hostConfigV7{
URL: "https://play.minio.io:9000",
AccessKey: "",
SecretKey: "",
API: "S3v4",
})
// Minio demo server with public secret and access keys.
c.setHost("player", hostConfigV7{
URL: "https://play.minio.io:9002",
AccessKey: "Q3AM3UQ867SPQQA43P2F",
SecretKey: "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
API: "S3v4",
})
// Minio public download service.
c.setHost("dl", hostConfigV7{
URL: "https://dl.minio.io:9000",
AccessKey: "",
SecretKey: "",
API: "S3v4",
})
}
// loadConfigV7 - loads a new config.
func loadConfigV7() (*configV7, *probe.Error) {
cfgMutex.RLock()
defer cfgMutex.RUnlock()
// Cached in private global variable.
if cacheCfgV7 != nil {
return cacheCfgV7, nil
}
if !isMcConfigExists() {
return nil, errInvalidArgument().Trace()
}
mcCfgV7, err := quick.Load(mustGetMcConfigPath(), newConfigV7())
fatalIf(err.Trace(), "Unable to load mc config file ‘"+mustGetMcConfigPath()+"’.")
cfgV7 := mcCfgV7.Data().(*configV7)
// cache it.
cacheCfgV7 = cfgV7
return cfgV7, nil
}
// saveConfigV7 - saves an updated config.
func saveConfigV7(cfgV7 *configV7) *probe.Error {
cfgMutex.Lock()
defer cfgMutex.Unlock()
qs, err := quick.New(cfgV7)
if err != nil {
return err.Trace()
}
// update the cache.
cacheCfgV7 = cfgV7
return qs.Save(mustGetMcConfigPath()).Trace(mustGetMcConfigPath())
}
+195
View File
@@ -0,0 +1,195 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"os"
"path/filepath"
"regexp"
"runtime"
"github.com/minio/minio-xl/pkg/probe"
"github.com/minio/minio/pkg/user"
)
// mcCustomConfigDir contains the whole path to config dir. Only access via get/set functions.
var mcCustomConfigDir string
// mcCustomConfigPath contains the whole path to config file. Only access via get/set functions.
var mcCustomConfigPath string
// setMcConfigDir - set a custom minio client config folder.
func setMcConfigDir(configDir string) {
mcCustomConfigDir = configDir
}
// getMcConfigDir - construct minio client config folder.
func getMcConfigDir() (string, *probe.Error) {
if mcCustomConfigDir != "" {
return mcCustomConfigDir, nil
}
homeDir, e := user.HomeDir()
if e != nil {
return "", probe.NewError(e)
}
// For windows the path is slightly different
switch runtime.GOOS {
case "windows":
return filepath.Join(homeDir, globalMCConfigWindowsDir), nil
default:
return filepath.Join(homeDir, globalMCConfigDir), nil
}
}
// mustGetMcConfigDir - construct minio client config folder or fail
func mustGetMcConfigDir() (configDir string) {
configDir, err := getMcConfigDir()
fatalIf(err.Trace(), "Unable to get mcConfigDir.")
return configDir
}
// createMcConfigDir - create minio client config folder
func createMcConfigDir() *probe.Error {
p, err := getMcConfigDir()
if err != nil {
return err.Trace()
}
if e := os.MkdirAll(p, 0700); e != nil {
return probe.NewError(e)
}
return nil
}
// getMcConfigPath - construct minio client configuration path
func getMcConfigPath() (string, *probe.Error) {
if mcCustomConfigPath != "" {
return mcCustomConfigPath, nil
}
dir, err := getMcConfigDir()
if err != nil {
return "", err.Trace()
}
return filepath.Join(dir, globalMCConfigFile), nil
}
// mustGetMcConfigPath - similar to getMcConfigPath, ignores errors
func mustGetMcConfigPath() string {
path, err := getMcConfigPath()
fatalIf(err.Trace(), "Unable to get mcConfigPath.")
return path
}
// newMcConfig - initializes a new version '6' config.
func newMcConfig() *configV7 {
cfg := newConfigV7()
cfg.loadDefaults()
return cfg
}
// loadMcConfigCached - returns loadMcConfig with a closure for config cache.
func loadMcConfigFactory() func() (*configV7, *probe.Error) {
// Load once and cache in a closure.
cfgCache, err := loadConfigV7()
// loadMcConfig - reads configuration file and returns config.
return func() (*configV7, *probe.Error) {
return cfgCache, err
}
}
var loadMcConfig = loadMcConfigFactory()
// saveMcConfig - saves configuration file and returns error if any.
func saveMcConfig(config *configV7) *probe.Error {
if config == nil {
return errInvalidArgument().Trace()
}
err := createMcConfigDir()
if err != nil {
return err.Trace(mustGetMcConfigDir())
}
// Save the config.
if err := saveConfigV7(config); err != nil {
return err.Trace(mustGetMcConfigPath())
}
// Refresh the config cache.
loadMcConfig = loadMcConfigFactory()
return nil
}
// isMcConfigExists returns err if config doesn't exist.
func isMcConfigExists() bool {
configFile, err := getMcConfigPath()
if err != nil {
return false
}
if _, e := os.Stat(configFile); e != nil {
return false
}
return true
}
// isValidAlias - Check if alias valid.
func isValidAlias(alias string) bool {
return regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-]+$").MatchString(alias)
}
// getHostConfig retrieves host specific configuration such as access keys, signature type.
func getHostConfig(alias string) (*hostConfigV7, *probe.Error) {
mcCfg, err := loadMcConfig()
if err != nil {
return nil, err.Trace(alias)
}
// if host is exact return quickly.
if _, ok := mcCfg.Hosts[alias]; ok {
hostCfg := mcCfg.Hosts[alias]
return &hostCfg, nil
}
// return error if cannot be matched.
return nil, errNoMatchingHost(alias).Trace(alias)
}
// mustGetHostConfig retrieves host specific configuration such as access keys, signature type.
func mustGetHostConfig(alias string) *hostConfigV7 {
hostCfg, _ := getHostConfig(alias)
return hostCfg
}
// expandAlias expands aliased URL if any match is found, returns as is otherwise.
func expandAlias(aliasedURL string) (alias string, urlStr string, hostCfg *hostConfigV7, err *probe.Error) {
// Extract alias from the URL.
alias, path := url2Alias(aliasedURL)
// Find the matching alias entry and expand the URL.
if hostCfg = mustGetHostConfig(alias); hostCfg != nil {
return alias, urlJoinPath(hostCfg.URL, path), hostCfg, nil
}
return "", aliasedURL, nil, nil // No matching entry found. Return original URL as is.
}
// mustExpandAlias expands aliased URL if any match is found, returns as is otherwise.
func mustExpandAlias(aliasedURL string) (alias string, urlStr string, hostCfg *hostConfigV7) {
alias, urlStr, hostCfg, _ = expandAlias(aliasedURL)
return alias, urlStr, hostCfg
}
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
set -e
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
# see also ".mailmap" for how email addresses and names are deduplicated
{
cat <<-'EOH'
## Contributors
<!-- DO NOT EDIT - CONTRIBUTORS.md is autogenerated from git commit log by contributors.sh script. -->
EOH
echo
git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf | sed 's/^/- /g'
} > CONTRIBUTORS.md
+398
View File
@@ -0,0 +1,398 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"bufio"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"sync"
"syscall"
"github.com/fatih/color"
"github.com/minio/cli"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
"github.com/minio/pb"
)
// cp command flags.
var (
cpFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of cp.",
},
cli.BoolFlag{
Name: "recursive, r",
Usage: "Copy recursively.",
},
}
)
// Copy command.
var cpCmd = cli.Command{
Name: "cp",
Usage: "Copy one or more objects to a target.",
Action: mainCopy,
Flags: append(cpFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc {{.Name}} - {{.Usage}}
USAGE:
mc {{.Name}} [FLAGS] SOURCE [SOURCE...] TARGET
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Copy a list of objects from local file system to Amazon S3 cloud storage.
$ mc {{.Name}} Music/*.ogg s3/jukebox/
2. Copy a folder recursively from Minio cloud storage to Amazon S3 cloud storage.
$ mc {{.Name}} --recursive play/mybucket/burningman2011/ s3/mybucket/
3. Copy multiple local folders recursively to Minio cloud storage.
$ mc {{.Name}} --recursive backup/2014/ backup/2015/ play/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
5. Copy an object with name containing unicode characters to Amazon S3 cloud storage.
$ mc {{.Name}} 本語 s3/andoria/
6. Copy a local folder with space separated characters to Amazon S3 cloud storage.
$ mc {{.Name}} --recursive 'workdir/documents/May 2014/' s3/miniocloud
`,
}
// copyMessage container for file copy messages
type copyMessage struct {
Status string `json:"status"`
Source string `json:"source"`
Target string `json:"target"`
}
// String colorized copy message
func (c copyMessage) String() string {
return console.Colorize("Copy", fmt.Sprintf("‘%s’ -> ‘%s’", c.Source, c.Target))
}
// JSON jsonified copy message
func (c copyMessage) JSON() string {
c.Status = "success"
copyMessageBytes, e := json.Marshal(c)
fatalIf(probe.NewError(e), "Failed to marshal copy message.")
return string(copyMessageBytes)
}
// copyStatMessage container for copy accounting message
type copyStatMessage struct {
Total int64
Transferred int64
Speed float64
}
// copyStatMessage copy accounting message
func (c copyStatMessage) String() string {
speedBox := pb.FormatBytes(int64(c.Speed))
if speedBox == "" {
speedBox = "0 MB"
} else {
speedBox = speedBox + "/s"
}
message := fmt.Sprintf("Total: %s, Transferred: %s, Speed: %s", pb.FormatBytes(c.Total),
pb.FormatBytes(c.Transferred), speedBox)
return message
}
// doCopy - Copy a singe file from source to destination
func doCopy(cpURLs copyURLs, progressReader *progressBar, accountingReader *accounter) copyURLs {
if cpURLs.Error != nil {
cpURLs.Error = cpURLs.Error.Trace()
return cpURLs
}
if !globalQuiet && !globalJSON {
progressReader = progressReader.SetCaption(cpURLs.SourceContent.URL.String() + ": ")
}
sourceAlias := cpURLs.SourceAlias
sourceURL := cpURLs.SourceContent.URL
targetAlias := cpURLs.TargetAlias
targetURL := cpURLs.TargetContent.URL
length := cpURLs.SourceContent.Size
reader, err := getSourceStreamFromAlias(sourceAlias, sourceURL.String())
if err != nil {
cpURLs.Error = err.Trace(sourceURL.String())
return cpURLs
}
var progress io.Reader
if globalQuiet || globalJSON {
sourcePath := filepath.ToSlash(filepath.Join(sourceAlias, sourceURL.Path))
targetPath := filepath.ToSlash(filepath.Join(targetAlias, targetURL.Path))
printMsg(copyMessage{
Source: sourcePath,
Target: targetPath,
})
// Proxy reader to accounting reader only during quiet mode.
if globalQuiet || globalJSON {
progress = accountingReader
}
} else {
// Set up progress reader.
progress = progressReader.ProgressBar
}
_, err = putTargetStreamFromAlias(targetAlias, targetURL.String(), reader, length, progress)
if err != nil {
cpURLs.Error = err.Trace(targetURL.String())
return cpURLs
}
cpURLs.Error = nil // just for safety
return cpURLs
}
// doCopyFake - Perform a fake copy to update the progress bar appropriately.
func doCopyFake(cpURLs copyURLs, progressReader *progressBar) copyURLs {
if !globalQuiet && !globalJSON {
progressReader.ProgressBar.Add64(cpURLs.SourceContent.Size)
}
return cpURLs
}
// doPrepareCopyURLs scans the source URL and prepares a list of objects for copying.
func doPrepareCopyURLs(session *sessionV6, trapCh <-chan bool) {
// Separate source and target. 'cp' can take only one target,
// but any number of sources.
sourceURLs := session.Header.CommandArgs[:len(session.Header.CommandArgs)-1]
targetURL := session.Header.CommandArgs[len(session.Header.CommandArgs)-1] // Last one is target
var totalBytes int64
var totalObjects int
// Access recursive flag inside the session header.
isRecursive := session.Header.CommandBoolFlags["recursive"]
// Create a session data file to store the processed URLs.
dataFP := session.NewDataWriter()
var scanBar scanBarFunc
if !globalQuiet && !globalJSON { // set up progress bar
scanBar = scanBarFactory()
}
URLsCh := prepareCopyURLs(sourceURLs, targetURL, isRecursive)
done := false
for done == false {
select {
case cpURLs, ok := <-URLsCh:
if !ok { // Done with URL preparation
done = true
break
}
if cpURLs.Error != nil {
// Print in new line and adjust to top so that we don't print over the ongoing scan bar
if !globalQuiet && !globalJSON {
console.Eraseline()
}
if strings.Contains(cpURLs.Error.ToGoError().Error(), " is a folder.") {
errorIf(cpURLs.Error.Trace(), "Folder cannot be copied. Please use ‘...’ suffix.")
} else {
errorIf(cpURLs.Error.Trace(), "Unable to prepare URL for copying.")
}
break
}
jsonData, e := json.Marshal(cpURLs)
if e != nil {
session.Delete()
fatalIf(probe.NewError(e), "Unable to prepare URL for copying. Error in JSON marshaling.")
}
fmt.Fprintln(dataFP, string(jsonData))
if !globalQuiet && !globalJSON {
scanBar(cpURLs.SourceContent.URL.String())
}
totalBytes += cpURLs.SourceContent.Size
totalObjects++
case <-trapCh:
// Print in new line and adjust to top so that we don't print over the ongoing scan bar
if !globalQuiet && !globalJSON {
console.Eraseline()
}
session.Delete() // If we are interrupted during the URL scanning, we drop the session.
os.Exit(0)
}
}
session.Header.TotalBytes = totalBytes
session.Header.TotalObjects = totalObjects
session.Save()
}
func doCopySession(session *sessionV6) {
trapCh := signalTrap(os.Interrupt, syscall.SIGTERM)
if !session.HasData() {
doPrepareCopyURLs(session, trapCh)
}
// Enable accounting reader by default.
accntReader := newAccounter(session.Header.TotalBytes)
// Prepare URL scanner from session data file.
urlScanner := bufio.NewScanner(session.NewDataReader())
// isCopied returns true if an object has been already copied
// or not. This is useful when we resume from a session.
isCopied := isCopiedFactory(session.Header.LastCopied)
// Enable progress bar reader only during default mode.
var progressReader *progressBar
if !globalQuiet && !globalJSON { // set up progress bar
progressReader = newProgressBar(session.Header.TotalBytes)
}
// Wait on status of doCopy() operation.
var statusCh = make(chan copyURLs)
// Add a wait group.
var wg = new(sync.WaitGroup)
wg.Add(1)
// Go routine to monitor signal traps if any.
go func() {
defer wg.Done()
for {
select {
case <-trapCh:
// Receive interrupt notification.
if !globalQuiet && !globalJSON {
console.Eraseline()
}
session.CloseAndDie()
case cpURLs, ok := <-statusCh:
// Status channel is closed, we should return.
if !ok {
return
}
if cpURLs.Error == nil {
session.Header.LastCopied = cpURLs.SourceContent.URL.String()
session.Save()
} else {
// Print in new line and adjust to top so that we
// don't print over the ongoing progress bar.
if !globalQuiet && !globalJSON {
console.Eraseline()
}
errorIf(cpURLs.Error.Trace(cpURLs.SourceContent.URL.String()),
fmt.Sprintf("Failed to copy ‘%s’.", cpURLs.SourceContent.URL.String()))
// For all non critical errors we can continue for the
// remaining files.
switch cpURLs.Error.ToGoError().(type) {
// Handle this specifically for filesystem related
// errors.
case client.BrokenSymlink:
continue
case client.TooManyLevelsSymlink:
continue
case client.PathNotFound:
continue
case client.PathInsufficientPermission:
continue
case client.ObjectAlreadyExists:
continue
case client.BucketDoesNotExist:
continue
}
// For critical errors we should exit. Session
// can be resumed after the user figures out
// the problem.
session.CloseAndDie()
}
}
}
}()
// Loop through all urls.
for urlScanner.Scan() {
var cpURLs copyURLs
// Unmarshal copyURLs from each line.
json.Unmarshal([]byte(urlScanner.Text()), &cpURLs)
// Verify if previously copied, notify progress bar.
if isCopied(cpURLs.SourceContent.URL.String()) {
statusCh <- doCopyFake(cpURLs, progressReader)
} else {
statusCh <- doCopy(cpURLs, progressReader, accntReader)
}
}
// Close the goroutine.
close(statusCh)
// Wait for the goroutines to finish.
wg.Wait()
if !globalQuiet && !globalJSON {
if progressReader.ProgressBar.Total > 0 {
progressReader.ProgressBar.Finish()
}
} else {
accntStat := accntReader.Stat()
cpStatMessage := copyStatMessage{
Total: accntStat.Total,
Transferred: accntStat.Transferred,
Speed: accntStat.Speed,
}
console.Println(console.Colorize("Copy", cpStatMessage.String()))
}
}
// mainCopy is the entry point for cp command.
func mainCopy(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check 'copy' cli arguments.
checkCopySyntax(ctx)
// Additional command speific theme customization.
console.SetColor("Copy", color.New(color.FgGreen, color.Bold))
session := newSessionV6()
session.Header.CommandType = "cp"
session.Header.CommandBoolFlags["recursive"] = ctx.Bool("recursive")
var e error
if session.Header.RootPath, e = os.Getwd(); e != nil {
session.Delete()
fatalIf(probe.NewError(e), "Unable to get current working folder.")
}
// extract URLs.
session.Header.CommandArgs = ctx.Args()
doCopySession(session)
session.Delete()
}
+145
View File
@@ -0,0 +1,145 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"fmt"
"github.com/minio/cli"
"github.com/minio/mc/pkg/client"
)
func checkCopySyntax(ctx *cli.Context) {
if len(ctx.Args()) < 2 {
cli.ShowCommandHelpAndExit(ctx, "cp", 1) // last argument is exit code.
}
// extract URLs.
URLs := ctx.Args()
if len(URLs) < 2 {
fatalIf(errDummy().Trace(ctx.Args()...), fmt.Sprintf("Unable to parse source and target arguments."))
}
srcURLs := URLs[:len(URLs)-1]
tgtURL := URLs[len(URLs)-1]
isRecursive := ctx.Bool("recursive")
/****** Generic Invalid Rules *******/
// Check if bucket name is passed for URL type arguments.
url := client.NewURL(tgtURL)
if url.Host != "" {
// This check is for type URL.
if !isURLVirtualHostStyle(url.Host) {
if url.Path == string(url.Separator) {
fatalIf(errInvalidArgument().Trace(), fmt.Sprintf("Target ‘%s’ does not contain bucket name.", tgtURL))
}
}
}
// Guess CopyURLsType based on source and target URLs.
copyURLsType, err := guessCopyURLType(srcURLs, tgtURL, isRecursive)
if err != nil {
fatalIf(errInvalidArgument().Trace(), "Unable to guess the type of copy operation.")
}
switch copyURLsType {
case copyURLsTypeA: // File -> File.
checkCopySyntaxTypeA(srcURLs, tgtURL)
case copyURLsTypeB: // File -> Folder.
checkCopySyntaxTypeB(srcURLs, tgtURL)
case copyURLsTypeC: // Folder... -> Folder.
checkCopySyntaxTypeC(srcURLs, tgtURL, isRecursive)
case copyURLsTypeD: // File1...FileN -> Folder.
checkCopySyntaxTypeD(srcURLs, tgtURL)
default:
fatalIf(errInvalidArgument().Trace(), "Unable to guess the type of copy operation.")
}
}
// checkCopySyntaxTypeA verifies if the source and target are valid file arguments.
func checkCopySyntaxTypeA(srcURLs []string, tgtURL string) {
// Check source.
if len(srcURLs) != 1 {
fatalIf(errInvalidArgument().Trace(), "Invalid number of source arguments.")
}
srcURL := srcURLs[0]
_, srcContent, err := url2Stat(srcURL)
fatalIf(err.Trace(srcURL), "Unable to stat source ‘"+srcURL+"’.")
if !srcContent.Type.IsRegular() {
fatalIf(errInvalidArgument().Trace(), "Source ‘"+srcURL+"’ is not a file.")
}
}
// checkCopySyntaxTypeB verifies if the source is a valid file and target is a valid folder.
func checkCopySyntaxTypeB(srcURLs []string, tgtURL string) {
// Check source.
if len(srcURLs) != 1 {
fatalIf(errInvalidArgument().Trace(), "Invalid number of source arguments.")
}
srcURL := srcURLs[0]
_, srcContent, err := url2Stat(srcURL)
fatalIf(err.Trace(srcURL), "Unable to stat source ‘"+srcURL+"’.")
if !srcContent.Type.IsRegular() {
fatalIf(errInvalidArgument().Trace(srcURL), "Source ‘"+srcURL+"’ is not a file.")
}
// Check target.
if _, tgtContent, err := url2Stat(tgtURL); err == nil {
if !tgtContent.Type.IsDir() {
fatalIf(errInvalidArgument().Trace(tgtURL), "Target ‘"+tgtURL+"’ is not a folder.")
}
}
}
// checkCopySyntaxTypeC verifies if the source is a valid recursive dir and target is a valid folder.
func checkCopySyntaxTypeC(srcURLs []string, tgtURL string, isRecursive bool) {
// Check source.
if len(srcURLs) != 1 {
fatalIf(errInvalidArgument().Trace(), "Invalid number of source arguments.")
}
srcURL := srcURLs[0]
_, srcContent, err := url2Stat(srcURL)
// incomplete uploads are not necessary for copy operation, no need to verify for them.
isIncomplete := false
if err != nil && !isURLPrefixExists(srcURL, isIncomplete) {
fatalIf(err.Trace(srcURL), "Unable to stat source ‘"+srcURL+"’.")
}
if srcContent.Type.IsDir() && !isRecursive {
fatalIf(errInvalidArgument().Trace(srcURL), "To copy a folder requires --recursive option.")
}
// Check target.
if _, tgtContent, err := url2Stat(tgtURL); err == nil {
if !tgtContent.Type.IsDir() {
fatalIf(errInvalidArgument().Trace(tgtURL), "Target ‘"+tgtURL+"’ is not a folder.")
}
}
}
// checkCopySyntaxTypeD verifies if the source is a valid list of files and target is a valid folder.
func checkCopySyntaxTypeD(srcURLs []string, tgtURL string) {
// Source can be anything: file, dir, dir...
// Check target if it is a dir
if _, tgtContent, err := url2Stat(tgtURL); err == nil {
if !tgtContent.Type.IsDir() {
fatalIf(errInvalidArgument().Trace(tgtURL), "Target ‘"+tgtURL+"’ is not a folder.")
}
}
}
+253
View File
@@ -0,0 +1,253 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"path/filepath"
"strings"
"github.com/minio/mc/pkg/client"
"github.com/minio/minio-xl/pkg/probe"
)
type copyURLs struct {
SourceAlias string
SourceContent *client.Content
TargetAlias string
TargetContent *client.Content
Error *probe.Error `json:"-"`
}
type copyURLsType uint8
// NOTE: All the parse rules should reduced to A: Copy(Source, Target).
//
// * VALID RULES
// =======================
// A: copy(f, f) -> copy(f, f)
// B: copy(f, d) -> copy(f, d/f) -> []A
// C: copy(d1..., d2) -> []copy(f, d2/d1/f) -> []A
// D: copy([]f, d) -> []B
// * INVALID RULES
// =========================
// copy(d, f)
// copy(d..., f)
// copy([](f|d)..., f)
const (
copyURLsTypeInvalid copyURLsType = iota
copyURLsTypeA
copyURLsTypeB
copyURLsTypeC
copyURLsTypeD
)
// guessCopyURLType guesses the type of URL. This approach all allows prepareURL
// functions to accurately report failure causes.
func guessCopyURLType(sourceURLs []string, targetURL string, isRecursive bool) (copyURLsType, *probe.Error) {
if len(sourceURLs) == 1 { // 1 Source, 1 Target
sourceURL := sourceURLs[0]
_, sourceContent, err := url2Stat(sourceURL)
if err != nil {
return copyURLsTypeInvalid, err
}
// If recursion is ON, it is type C.
// If source is a folder, it is Type C.
if sourceContent.Type.IsDir() || isRecursive {
return copyURLsTypeC, nil
}
// If target is a folder, it is Type B.
if isTargetURLDir(targetURL) {
return copyURLsTypeB, nil
}
// else Type A.
return copyURLsTypeA, nil
}
// Multiple source args and target is a folder. It is Type D.
if isTargetURLDir(targetURL) {
return copyURLsTypeD, nil
}
return copyURLsTypeInvalid, errInvalidArgument().Trace()
}
// SINGLE SOURCE - Type A: copy(f, f) -> copy(f, f)
// prepareCopyURLsTypeA - prepares target and source URLs for copying.
func prepareCopyURLsTypeA(sourceURL string, targetURL string) copyURLs {
// Extract alias before fiddling with the URL.
sourceAlias, _, _ := mustExpandAlias(sourceURL)
// Find alias and expanded URL.
targetAlias, targetURL, _ := mustExpandAlias(targetURL)
_, sourceContent, err := url2Stat(sourceURL)
if err != nil {
// Source does not exist or insufficient privileges.
return copyURLs{Error: err.Trace(sourceURL)}
}
if !sourceContent.Type.IsRegular() {
// Source is not a regular file
return copyURLs{Error: errInvalidSource(sourceURL).Trace(sourceURL)}
}
if sourceContent.URL.String() == targetURL {
// source and target can not be same
return copyURLs{Error: errSourceTargetSame(sourceURL).Trace(sourceURL)}
}
// All OK.. We can proceed. Type A
return makeCopyContentTypeA(sourceAlias, sourceContent, targetAlias, targetURL)
}
// prepareCopyContentTypeA - makes CopyURLs content for copying.
func makeCopyContentTypeA(sourceAlias string, sourceContent *client.Content, targetAlias string, targetURL string) copyURLs {
return copyURLs{
SourceAlias: sourceAlias,
SourceContent: sourceContent,
TargetAlias: targetAlias,
TargetContent: &client.Content{URL: *client.NewURL(targetURL)},
}
}
// SINGLE SOURCE - Type B: copy(f, d) -> copy(f, d/f) -> A
// prepareCopyURLsTypeB - prepares target and source URLs for copying.
func prepareCopyURLsTypeB(sourceURL string, targetURL string) copyURLs {
// Extract alias before fiddling with the URL.
sourceAlias, _, _ := mustExpandAlias(sourceURL)
// Find alias and expanded URL.
targetAlias, targetURL, _ := mustExpandAlias(targetURL)
_, sourceContent, err := url2Stat(sourceURL)
if err != nil {
// Source does not exist or insufficient privileges.
return copyURLs{Error: err.Trace(sourceURL)}
}
if !sourceContent.Type.IsRegular() {
if sourceContent.Type.IsDir() {
return copyURLs{Error: errSourceIsDir(sourceURL).Trace(sourceURL)}
}
// Source is not a regular file.
return copyURLs{Error: errInvalidSource(sourceURL).Trace(sourceURL)}
}
// All OK.. We can proceed. Type B: source is a file, target is a folder and exists.
return makeCopyContentTypeB(sourceAlias, sourceContent, targetAlias, targetURL)
}
// makeCopyContentTypeB - CopyURLs content for copying.
func makeCopyContentTypeB(sourceAlias string, sourceContent *client.Content, targetAlias string, targetURL string) copyURLs {
// All OK.. We can proceed. Type B: source is a file, target is a folder and exists.
targetURLParse := client.NewURL(targetURL)
targetURLParse.Path = filepath.ToSlash(filepath.Join(targetURLParse.Path, filepath.Base(sourceContent.URL.Path)))
return makeCopyContentTypeA(sourceAlias, sourceContent, targetAlias, targetURLParse.String())
}
// SINGLE SOURCE - Type C: copy(d1..., d2) -> []copy(d1/f, d1/d2/f) -> []A
// prepareCopyRecursiveURLTypeC - prepares target and source URLs for copying.
func prepareCopyURLsTypeC(sourceURL, targetURL string, isRecursive bool) <-chan copyURLs {
// Extract alias before fiddling with the URL.
sourceAlias, _, _ := mustExpandAlias(sourceURL)
// Find alias and expanded URL.
targetAlias, targetURL, _ := mustExpandAlias(targetURL)
copyURLsCh := make(chan copyURLs)
go func(sourceURL, targetURL string, copyURLsCh chan copyURLs) {
defer close(copyURLsCh)
sourceClient, err := newClient(sourceURL)
if err != nil {
// Source initialization failed.
copyURLsCh <- copyURLs{Error: err.Trace(sourceURL)}
return
}
for sourceContent := range sourceClient.List(isRecursive, false) {
if sourceContent.Err != nil {
// Listing failed.
copyURLsCh <- copyURLs{Error: sourceContent.Err.Trace(sourceClient.GetURL().String())}
continue
}
if !sourceContent.Type.IsRegular() {
// Source is not a regular file. Skip it for copy.
continue
}
// All OK.. We can proceed. Type B: source is a file, target is a folder and exists.
copyURLsCh <- makeCopyContentTypeC(sourceAlias, sourceClient.GetURL(), sourceContent, targetAlias, targetURL)
}
}(sourceURL, targetURL, copyURLsCh)
return copyURLsCh
}
// makeCopyContentTypeC - CopyURLs content for copying.
func makeCopyContentTypeC(sourceAlias string, sourceURL client.URL, sourceContent *client.Content, targetAlias string, targetURL string) copyURLs {
newSourceURL := sourceContent.URL
pathSeparatorIndex := strings.LastIndex(sourceURL.Path, string(sourceURL.Separator))
newSourceSuffix := filepath.ToSlash(newSourceURL.Path)
if pathSeparatorIndex > 1 {
sourcePrefix := filepath.ToSlash(sourceURL.Path[:pathSeparatorIndex])
newSourceSuffix = strings.TrimPrefix(newSourceSuffix, sourcePrefix)
}
newTargetURL := urlJoinPath(targetURL, newSourceSuffix)
return makeCopyContentTypeA(sourceAlias, sourceContent, targetAlias, newTargetURL)
}
// MULTI-SOURCE - Type D: copy([](f|d...), d) -> []B
// prepareCopyURLsTypeE - prepares target and source URLs for copying.
func prepareCopyURLsTypeD(sourceURLs []string, targetURL string, isRecursive bool) <-chan copyURLs {
copyURLsCh := make(chan copyURLs)
go func(sourceURLs []string, targetURL string, copyURLsCh chan copyURLs) {
defer close(copyURLsCh)
for _, sourceURL := range sourceURLs {
for cpURLs := range prepareCopyURLsTypeC(sourceURL, targetURL, isRecursive) {
copyURLsCh <- cpURLs
}
}
}(sourceURLs, targetURL, copyURLsCh)
return copyURLsCh
}
// prepareCopyURLs - prepares target and source URLs for copying.
func prepareCopyURLs(sourceURLs []string, targetURL string, isRecursive bool) <-chan copyURLs {
copyURLsCh := make(chan copyURLs)
go func(sourceURLs []string, targetURL string, copyURLsCh chan copyURLs) {
defer close(copyURLsCh)
cpType, err := guessCopyURLType(sourceURLs, targetURL, isRecursive)
fatalIf(err.Trace(), "Unable to guess the type of copy operation.")
switch cpType {
case copyURLsTypeA:
copyURLsCh <- prepareCopyURLsTypeA(sourceURLs[0], targetURL)
case copyURLsTypeB:
copyURLsCh <- prepareCopyURLsTypeB(sourceURLs[0], targetURL)
case copyURLsTypeC:
for cURLs := range prepareCopyURLsTypeC(sourceURLs[0], targetURL, isRecursive) {
copyURLsCh <- cURLs
}
case copyURLsTypeD:
for cURLs := range prepareCopyURLsTypeD(sourceURLs, targetURL, isRecursive) {
copyURLsCh <- cURLs
}
default:
copyURLsCh <- copyURLs{Error: errInvalidArgument().Trace(sourceURLs...)}
}
}(sourceURLs, targetURL, copyURLsCh)
return copyURLsCh
}
+66
View File
@@ -0,0 +1,66 @@
/*
* Minio Client (C) 2014-2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"math"
)
// Returns the minimum value of a slice of integers
func minimum(integers []int) (minVal int) {
minVal = math.MaxInt32
for _, v := range integers {
if v < minVal {
minVal = v
}
}
return
}
// DamerauLevenshteinDistance calculates distance between two strings using an algorithm
// described in https://en.wikipedia.org/wiki/Damerau-Levenshtein_distance
func DamerauLevenshteinDistance(a string, b string) int {
d := make([][]int, len(a)+1)
for i := 1; i <= len(a)+1; i++ {
d[i-1] = make([]int, len(b)+1)
}
for i := 0; i <= len(a); i++ {
d[i][0] = i
}
for j := 0; j <= len(b); j++ {
d[0][j] = j
}
for i := 1; i <= len(a); i++ {
for j := 1; j <= len(b); j++ {
cost := 0
if a[i-1] == b[j-1] {
cost = 0
} else {
cost = 1
}
d[i][j] = minimum([]int{
d[i-1][j] + 1,
d[i][j-1] + 1,
d[i-1][j-1] + cost,
})
if i > 1 && j > 1 && a[i-1] == b[j-2] && a[i-2] == b[j-1] {
d[i][j] = minimum([]int{d[i][j], d[i-2][j-2] + cost}) // transposition
}
}
}
return d[len(a)][len(b)]
}
+223
View File
@@ -0,0 +1,223 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"encoding/json"
"fmt"
"strings"
"github.com/fatih/color"
"github.com/minio/cli"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
)
// diff specific flags.
var (
diffFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of diff.",
},
}
)
// Compute differences between two files or folders.
var diffCmd = cli.Command{
Name: "diff",
Usage: "Compute differences between two folders.",
Description: "Diff only lists missing objects or objects with size differences. It *DOES NOT* compare contents. i.e. Objects of same name and size, but differ in contents are not noticed.",
Action: mainDiff,
Flags: append(diffFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc {{.Name}} - {{.Usage}}
USAGE:
mc {{.Name}} [FLAGS] FIRST SECOND
FLAGS:
{{range .Flags}}{{.}}
{{end}}
DESCRIPTION:
{{.Description}}
EXAMPLES:
1. Compare a local folder with a folder on Amazon S3 cloud storage.
$ mc {{.Name}} ~/Photos s3/MyBucket/Photos
2. Compare two different folders on a local filesystem.
$ mc {{.Name}} ~/Photos /Media/Backup/Photos
`,
}
// diffMessage json container for diff messages
type diffMessage struct {
Status string `json:"status"`
FirstURL string `json:"first"`
SecondURL string `json:"second"`
Diff string `json:"diff"`
Error *probe.Error `json:"error,omitempty"`
}
// String colorized diff message
func (d diffMessage) String() string {
msg := ""
switch d.Diff {
case "only-in-first":
msg = console.Colorize("DiffMessage",
"‘"+d.FirstURL+"’"+" and "+"‘"+d.SecondURL+"’") + console.Colorize("DiffOnlyInFirst", " - only in first.")
case "type":
msg = console.Colorize("DiffMessage",
"‘"+d.FirstURL+"’"+" and "+"‘"+d.SecondURL+"’") + console.Colorize("DiffType", " - differ in type.")
case "size":
msg = console.Colorize("DiffMessage",
"‘"+d.FirstURL+"’"+" and "+"‘"+d.SecondURL+"’") + console.Colorize("DiffSize", " - differ in size.")
default:
fatalIf(errDummy().Trace(d.FirstURL, d.SecondURL),
"Unhandled difference between ‘"+d.FirstURL+"’ and ‘"+d.SecondURL+"’.")
}
return msg
}
// JSON jsonified diff message
func (d diffMessage) JSON() string {
d.Status = "success"
diffJSONBytes, e := json.Marshal(d)
fatalIf(probe.NewError(e),
"Unable to marshal diff message ‘"+d.FirstURL+"’, ‘"+d.SecondURL+"’ and ‘"+d.Diff+"’.")
return string(diffJSONBytes)
}
func checkDiffSyntax(ctx *cli.Context) {
if len(ctx.Args()) != 2 {
cli.ShowCommandHelpAndExit(ctx, "diff", 1) // last argument is exit code
}
for _, arg := range ctx.Args() {
if strings.TrimSpace(arg) == "" {
fatalIf(errInvalidArgument().Trace(ctx.Args()...), "Unable to validate empty argument.")
}
}
URLs := ctx.Args()
firstURL := URLs[0]
secondURL := URLs[1]
// Diff only works between two directories, verify them below.
// Verify if firstURL is accessible.
_, firstContent, err := url2Stat(firstURL)
if err != nil {
fatalIf(err.Trace(firstURL), fmt.Sprintf("Unable to stat '%s'.", firstURL))
}
// Verify if its a directory.
if !firstContent.Type.IsDir() {
fatalIf(errInvalidArgument().Trace(firstURL), fmt.Sprintf("‘%s’ is not a folder.", firstURL))
}
// Verify if secondURL is accessible.
_, secondContent, err := url2Stat(secondURL)
if err != nil {
fatalIf(err.Trace(secondURL), fmt.Sprintf("Unable to stat '%s'.", secondURL))
}
// Verify if its a directory.
if !secondContent.Type.IsDir() {
fatalIf(errInvalidArgument().Trace(secondURL), fmt.Sprintf("‘%s’ is not a folder.", secondURL))
}
}
// doDiffMain runs the diff.
func doDiffMain(firstURL, secondURL string) {
// Source and targets are always directories
sourceSeparator := string(client.NewURL(firstURL).Separator)
if !strings.HasSuffix(firstURL, sourceSeparator) {
firstURL = firstURL + sourceSeparator
}
targetSeparator := string(client.NewURL(secondURL).Separator)
if !strings.HasSuffix(secondURL, targetSeparator) {
secondURL = secondURL + targetSeparator
}
// Expand aliased urls.
firstAlias, firstURL, _ := mustExpandAlias(firstURL)
secondAlias, secondURL, _ := mustExpandAlias(secondURL)
firstClient, err := newClientFromAlias(firstAlias, firstURL)
if err != nil {
fatalIf(err.Trace(firstAlias, firstURL, secondAlias, secondURL),
fmt.Sprintf("Failed to diff '%s' and '%s'", firstURL, secondURL))
}
difference, err := objectDifferenceFactory(secondAlias, secondURL)
if err != nil {
fatalIf(err.Trace(firstAlias, firstURL, secondAlias, secondURL),
fmt.Sprintf("Failed to diff '%s' and '%s'", firstURL, secondURL))
}
isRecursive := true
isIncomplete := false
for sourceContent := range firstClient.List(isRecursive, isIncomplete) {
if sourceContent.Err != nil {
switch sourceContent.Err.ToGoError().(type) {
// Handle this specifically for filesystem related errors.
case client.BrokenSymlink, client.TooManyLevelsSymlink, client.PathNotFound, client.PathInsufficientPermission:
errorIf(sourceContent.Err.Trace(firstURL, secondURL), fmt.Sprintf("Failed on '%s'", firstURL))
default:
fatalIf(sourceContent.Err.Trace(firstURL, secondURL), fmt.Sprintf("Failed on '%s'", firstURL))
}
continue
}
if sourceContent.Type.IsDir() {
continue
}
suffix := strings.TrimPrefix(sourceContent.URL.String(), firstURL)
differ, err := difference(suffix, sourceContent.Type, sourceContent.Size)
if err != nil {
errorIf(sourceContent.Err.Trace(secondURL, suffix),
fmt.Sprintf("Failed on '%s'", urlJoinPath(secondURL, suffix)))
continue
}
if differ == differNone {
continue
}
printMsg(diffMessage{
FirstURL: sourceContent.URL.String(),
SecondURL: urlJoinPath(secondURL, suffix),
Diff: differ,
})
}
}
// mainDiff main for 'diff'.
func mainDiff(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check 'diff' cli arguments.
checkDiffSyntax(ctx)
// Additional command specific theme customization.
console.SetColor("DiffMessage", color.New(color.FgGreen, color.Bold))
console.SetColor("DiffOnlyInFirst", color.New(color.FgRed, color.Bold))
console.SetColor("DiffType", color.New(color.FgYellow, color.Bold))
console.SetColor("DiffSize", color.New(color.FgMagenta, color.Bold))
URLs := ctx.Args()
firstURL := URLs[0]
secondURL := URLs[1]
doDiffMain(firstURL, secondURL)
}
+89
View File
@@ -0,0 +1,89 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"os"
"github.com/minio/mc/pkg/client"
"github.com/minio/minio-xl/pkg/probe"
)
// objectDifference function finds the difference between object on source and target
// it takes suffix string, type and size on the source
// objectDifferenceFactory returns objectDifference function
type objectDifference func(string, os.FileMode, int64) (string, *probe.Error)
const (
differSize string = "size" // differs in size
differOnlyFirst string = "only-in-first" // only on source
differType string = "type" // differs in type, ex file/directory
differNone string = "" // does not differ
)
// objectDifferenceFactory returns objectDifference function to check for difference
// between sourceURL and targetURL
// for usage reference check diff and mirror commands
func objectDifferenceFactory(targetAlias, targetURL string) (objectDifference, *probe.Error) {
clnt, err := newClientFromAlias(targetAlias, targetURL)
if err != nil {
return nil, err.Trace(targetAlias, targetURL)
}
isIncomplete := false
isRecursive := true
ch := clnt.List(isRecursive, isIncomplete)
current := targetURL
reachedEOF := false
ok := false
var content *client.Content
difference := func(suffix string, srcType os.FileMode, srcSize int64) (string, *probe.Error) {
if reachedEOF {
// would mean the suffix is not on target
return differOnlyFirst, nil
}
expected := urlJoinPath(targetURL, suffix)
for {
if expected < current {
return differOnlyFirst, nil // not available in the target
}
if expected == current {
tgtType := content.Type
tgtSize := content.Size
if srcType.IsRegular() && !tgtType.IsRegular() {
// Type differes. Source is never a directory
return differType, nil
}
if (srcType.IsRegular() && tgtType.IsRegular()) && srcSize != tgtSize {
// regular files differing in size
return differSize, nil
}
return differNone, nil // available in the target
}
content, ok = <-ch
if !ok {
reachedEOF = true
return differOnlyFirst, nil
}
if content.Err != nil {
return "", content.Err.Trace()
}
current = content.URL.String()
}
}
return difference, nil
}
+115
View File
@@ -0,0 +1,115 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"encoding/json"
"fmt"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
)
// causeMessage container for golang error messages
type causeMessage struct {
Message string `json:"message"`
Error error `json:"error"`
}
// errorMessage container for error messages
type errorMessage struct {
Message string `json:"message"`
Cause causeMessage `json:"cause"`
Type string `json:"type"`
CallTrace []probe.TracePoint `json:"trace,omitempty"`
SysInfo map[string]string `json:"sysinfo"`
}
// fatalIf wrapper function which takes error and selectively prints stack frames if available on debug
func fatalIf(err *probe.Error, msg string) {
if err == nil {
return
}
if globalJSON {
errorMsg := errorMessage{
Message: msg,
Type: "fatal",
Cause: causeMessage{
Message: err.ToGoError().Error(),
Error: err.ToGoError(),
},
SysInfo: err.SysInfo,
}
if globalDebug {
errorMsg.CallTrace = err.CallTrace
}
json, e := json.Marshal(struct {
Status string `json:"status"`
Error errorMessage `json:"error"`
}{
Status: "error",
Error: errorMsg,
})
if e != nil {
console.Fatalln(probe.NewError(e))
}
console.Println(string(json))
console.Fatalln()
}
if !globalDebug {
console.Fatalln(fmt.Sprintf("%s %s", msg, err.ToGoError()))
}
console.Fatalln(fmt.Sprintf("%s %s", msg, err))
}
// errorIf synonymous with fatalIf but doesn't exit on error != nil
func errorIf(err *probe.Error, msg string) {
if err == nil {
return
}
if globalJSON {
errorMsg := errorMessage{
Message: msg,
Type: "error",
Cause: causeMessage{
Message: err.ToGoError().Error(),
Error: err.ToGoError(),
},
SysInfo: err.SysInfo,
}
if globalDebug {
errorMsg.CallTrace = err.CallTrace
}
json, e := json.Marshal(struct {
Status string `json:"status"`
Error errorMessage `json:"error"`
}{
Status: "error",
Error: errorMsg,
})
if e != nil {
console.Fatalln(probe.NewError(e))
}
console.Println(string(json))
return
}
if !globalDebug {
console.Errorln(fmt.Sprintf("%s %s", msg, err.ToGoError()))
return
}
console.Errorln(fmt.Sprintf("%s %s", msg, err))
}
+56
View File
@@ -0,0 +1,56 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import "github.com/minio/cli"
// Collection of mc commands currently supported
var commands = []cli.Command{}
// Collection of mc commands currently supported in a trie tree
var commandsTree = newTrie()
// Collection of mc flags currently supported
var globalFlags = []cli.Flag{
cli.StringFlag{
Name: "config-folder, C",
Value: mustGetMcConfigDir(),
Usage: "Path to configuration folder.",
},
cli.BoolFlag{
Name: "quiet, q",
Usage: "Suppress chatty console output.",
},
cli.BoolFlag{
Name: "no-color",
Usage: "Disable color theme.",
},
cli.BoolFlag{
Name: "json",
Usage: "Enable json formatted output.",
},
cli.BoolFlag{
Name: "debug",
Usage: "Enable debugging output.",
},
}
// registerCmd registers a cli command
func registerCmd(cmd cli.Command) {
commands = append(commands, cmd)
commandsTree.Insert(cmd.Name)
}
+71
View File
@@ -0,0 +1,71 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This package contains all the global variables and constants. ONLY TO BE ACCESSED VIA GET/SET FUNCTIONS.
package main
import (
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
)
// mc configuration related constants.
const (
globalMCConfigVersion = "7"
globalMCConfigDir = ".mc/"
globalMCConfigWindowsDir = "mc\\"
globalMCConfigFile = "config.json"
// session config and shared urls related constants
globalSessionDir = "session"
globalSharedURLsDataDir = "share"
)
var (
globalQuiet = false // Quiet flag set via command line
globalJSON = false // Json flag set via command line
globalDebug = false // Debug flag set via command line
globalNoColor = false // Debug flag set via command line
// WHEN YOU ADD NEXT GLOBAL FLAG, MAKE SURE TO ALSO UPDATE SESSION CODE AND CODE BELOW.
)
// Set global states. NOTE: It is deliberately kept monolithic to ensure we dont miss out any flags.
func setGlobals(quiet, debug, json, noColor bool) {
globalQuiet = quiet
globalDebug = debug
globalJSON = json
globalNoColor = noColor
// Enable debug messages if requested.
if globalDebug == true {
console.DebugPrint = true
}
// Disable colorified messages if requested.
if globalNoColor == true {
console.SetColorOff()
}
}
// Set global states. NOTE: It is deliberately kept monolithic to ensure we dont miss out any flags.
func setGlobalsFromContext(ctx *cli.Context) {
quiet := ctx.Bool("quiet") || ctx.GlobalBool("quiet")
debug := ctx.Bool("debug") || ctx.GlobalBool("debug")
json := ctx.Bool("json") || ctx.GlobalBool("json")
noColor := ctx.Bool("no-color") || ctx.GlobalBool("no-color")
setGlobals(quiet, debug, json, noColor)
}
+140
View File
@@ -0,0 +1,140 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"strings"
"github.com/fatih/color"
"github.com/minio/cli"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/console"
)
// ls specific flags.
var (
lsFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of ls.",
},
cli.BoolFlag{
Name: "recursive, r",
Usage: "List recursively.",
},
cli.BoolFlag{
Name: "incomplete, I",
Usage: "Remove incomplete uploads.",
},
}
)
// list files and folders.
var lsCmd = cli.Command{
Name: "ls",
Usage: "List files and folders.",
Action: mainList,
Flags: append(lsFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc {{.Name}} - {{.Usage}}
USAGE:
mc {{.Name}} [FLAGS] TARGET [TARGET ...]
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. List buckets on Amazon S3 cloud storage.
$ mc {{.Name}} s3
2. List buckets and all its contents from Amazon S3 cloud storage recursively.
$ mc {{.Name}} --recursive s3
3. List all contents of mybucket on Amazon S3 cloud storage.
$ mc {{.Name}} s3/mybucket/
4. List all contents of mybucket on Amazon S3 cloud storage on Microsoft Windows.
$ mc {{.Name}} s3\mybucket\
5. List files recursively on a local filesystem on Microsoft Windows.
$ mc {{.Name}} --recursive C:\Users\Worf\
6. List incomplete (previously failed) uploads of objects on Amazon S3.
$ mc {{.Name}} --incomplete s3/mybucket
`,
}
// checkListSyntax - validate all the passed arguments
func checkListSyntax(ctx *cli.Context) {
args := ctx.Args()
if !ctx.Args().Present() {
args = []string{"."}
}
for _, arg := range args {
if strings.TrimSpace(arg) == "" {
fatalIf(errInvalidArgument().Trace(args...), "Unable to validate empty argument.")
}
}
// extract URLs.
URLs := ctx.Args()
isIncomplete := ctx.Bool("incomplete")
for _, url := range URLs {
_, _, err := url2Stat(url)
if err != nil && !isURLPrefixExists(url, isIncomplete) {
fatalIf(err.Trace(url), "Unable to stat ‘"+url+"’.")
}
}
}
// mainList - is a handler for mc ls command
func mainList(ctx *cli.Context) {
// Additional command speific theme customization.
console.SetColor("File", color.New(color.FgWhite))
console.SetColor("Dir", color.New(color.FgCyan, color.Bold))
console.SetColor("Size", color.New(color.FgYellow))
console.SetColor("Time", color.New(color.FgGreen))
// Set global flags from context.
setGlobalsFromContext(ctx)
// check 'ls' cli arguments.
checkListSyntax(ctx)
// Set command flags from context.
isRecursive := ctx.Bool("recursive")
isIncomplete := ctx.Bool("incomplete")
args := ctx.Args()
// mimic operating system tool behavior.
if !ctx.Args().Present() {
args = []string{"."}
}
for _, targetURL := range args {
var clnt client.Client
clnt, err := newClient(targetURL)
fatalIf(err.Trace(targetURL), "Unable to initialize target ‘"+targetURL+"’.")
err = doList(clnt, isRecursive, isIncomplete)
if err != nil {
errorIf(err.Trace(clnt.GetURL().String()), "Unable to list target ‘"+clnt.GetURL().String()+"’.")
continue
}
}
}
+146
View File
@@ -0,0 +1,146 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"encoding/json"
"fmt"
"path/filepath"
"runtime"
"strings"
"time"
"github.com/dustin/go-humanize"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
)
// printDate - human friendly formatted date.
const (
printDate = "2006-01-02 15:04:05 MST"
)
// contentMessage container for content message structure.
type contentMessage struct {
Status string `json:"status"`
Filetype string `json:"type"`
Time time.Time `json:"lastModified"`
Size int64 `json:"size"`
Key string `json:"key"`
}
// String colorized string message.
func (c contentMessage) String() string {
message := console.Colorize("Time", fmt.Sprintf("[%s] ", c.Time.Format(printDate)))
message = message + console.Colorize("Size", fmt.Sprintf("%6s ", humanize.IBytes(uint64(c.Size))))
message = func() string {
if c.Filetype == "folder" {
return message + console.Colorize("Dir", fmt.Sprintf("%s", c.Key))
}
return message + console.Colorize("File", fmt.Sprintf("%s", c.Key))
}()
return message
}
// JSON jsonified content message.
func (c contentMessage) JSON() string {
c.Status = "success"
jsonMessageBytes, e := json.Marshal(c)
fatalIf(probe.NewError(e), "Unable to marshal into JSON.")
return string(jsonMessageBytes)
}
// parseContent parse client Content container into printer struct.
func parseContent(c *client.Content) contentMessage {
content := contentMessage{}
content.Time = c.Time.Local()
// guess file type.
content.Filetype = func() string {
if c.Type.IsDir() {
return "folder"
}
return "file"
}()
content.Size = c.Size
// Convert OS Type to match console file printing style.
content.Key = func() string {
switch {
// for windows make sure to print in 'windows' specific style.
case runtime.GOOS == "windows":
c.URL.Path = strings.Replace(c.URL.Path, "/", "\\", -1)
c.URL.Path = strings.TrimSuffix(c.URL.Path, "\\")
default:
c.URL.Path = strings.TrimSuffix(c.URL.Path, "/")
}
if c.Type.IsDir() {
switch {
// for windows make sure to print in 'windows' specific style.
case runtime.GOOS == "windows":
return fmt.Sprintf("%s\\", c.URL.Path)
default:
return fmt.Sprintf("%s/", c.URL.Path)
}
}
return c.URL.Path
}()
return content
}
// doList - list all entities inside a folder.
func doList(clnt client.Client, isRecursive, isIncomplete bool) *probe.Error {
prefixPath := clnt.GetURL().Path
separator := string(clnt.GetURL().Separator)
if !strings.HasSuffix(prefixPath, separator) {
prefixPath = prefixPath[:strings.LastIndex(prefixPath, separator)+1]
}
for content := range clnt.List(isRecursive, isIncomplete) {
if content.Err != nil {
switch content.Err.ToGoError().(type) {
// handle this specifically for filesystem related errors.
case client.BrokenSymlink:
errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to list broken link.")
continue
case client.TooManyLevelsSymlink:
errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to list too many levels link.")
continue
case client.PathNotFound:
errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to list folder.")
continue
case client.PathInsufficientPermission:
errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to list folder.")
continue
}
errorIf(content.Err.Trace(clnt.GetURL().String()), "Unable to list folder.")
continue
}
// Convert any os specific delimiters to "/".
contentURL := filepath.ToSlash(content.URL.Path)
prefixPath = filepath.ToSlash(prefixPath)
// Trim prefix path from the content path.
contentURL = strings.TrimPrefix(contentURL, prefixPath)
content.URL.Path = contentURL
parsedContent := parseContent(content)
// Print colorized or jsonized content info.
printMsg(parsedContent)
}
return nil
}
+17
View File
@@ -0,0 +1,17 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
+209
View File
@@ -0,0 +1,209 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"fmt"
"os"
"runtime"
"sort"
"strconv"
"github.com/minio/cli"
"github.com/minio/minio-xl/pkg/probe"
"github.com/minio/minio/pkg/contentdb"
"github.com/minio/pb"
"github.com/olekukonko/ts"
)
var (
// global flags for mc.
mcFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Show help.",
},
}
)
// Help template for mc
var mcHelpTemplate = `NAME:
{{.Name}} - {{.Usage}}
USAGE:
{{.Name}} {{if .Flags}}[FLAGS] {{end}}COMMAND{{if .Flags}} [COMMAND FLAGS | -h]{{end}} [ARGUMENTS...]
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}{{if .Flags}}
GLOBAL FLAGS:
{{range .Flags}}{{.}}
{{end}}{{end}}
VERSION:
` + mcVersion +
`{{ "\n"}}{{range $key, $value := ExtraInfo}}
{{$key}}:
{{$value}}
{{end}}`
// Function invoked when invalid command is passed.
func commandNotFound(ctx *cli.Context, command string) {
msg := fmt.Sprintf("‘%s’ is not a mc command. See ‘mc --help’.", command)
closestCommands := findClosestCommands(command)
if len(closestCommands) > 0 {
msg += fmt.Sprintf("\n\nDid you mean one of these?\n")
if len(closestCommands) == 1 {
cmd := closestCommands[0]
msg += fmt.Sprintf(" ‘%s’", cmd)
} else {
for _, cmd := range closestCommands {
msg += fmt.Sprintf(" ‘%s’\n", cmd)
}
}
}
fatalIf(errDummy().Trace(), msg)
}
// Check for sane config environment early on and gracefully report.
func checkConfig() {
// Ensures config file is sane.
_, err := loadMcConfig()
fatalIf(err.Trace(mustGetMcConfigPath()), "Unable to access configuration file.")
}
func migrate() {
// Fix broken config files if any.
fixConfig()
// Migrate config files if any.
migrateConfig()
// Migrate session files if any.
migrateSession()
// Migrate shared urls if any.
migrateShare()
}
// Get os/arch/platform specific information.
// Returns a map of current os/arch/platform/memstats.
func getSystemData() map[string]string {
host, e := os.Hostname()
fatalIf(probe.NewError(e), "Unable to determine the hostname.")
memstats := &runtime.MemStats{}
runtime.ReadMemStats(memstats)
mem := fmt.Sprintf("Used: %s | Allocated: %s | UsedHeap: %s | AllocatedHeap: %s",
pb.FormatBytes(int64(memstats.Alloc)),
pb.FormatBytes(int64(memstats.TotalAlloc)),
pb.FormatBytes(int64(memstats.HeapAlloc)),
pb.FormatBytes(int64(memstats.HeapSys)))
platform := fmt.Sprintf("Host: %s | OS: %s | Arch: %s", host, runtime.GOOS, runtime.GOARCH)
goruntime := fmt.Sprintf("Version: %s | CPUs: %s", runtime.Version(), strconv.Itoa(runtime.NumCPU()))
return map[string]string{
"PLATFORM": platform,
"RUNTIME": goruntime,
"MEM": mem,
}
}
func registerBefore(ctx *cli.Context) error {
setMcConfigDir(ctx.GlobalString("config-folder"))
// Verify golang runtime.
verifyMCRuntime()
// Migrate any old version of config / state files to newer format.
migrate()
// Set global flags.
setGlobalsFromContext(ctx)
// Checkconfig if it can be read.
checkConfig()
return nil
}
// findClosestCommands to match a given string with commands trie tree.
func findClosestCommands(command string) []string {
var closestCommands []string
for _, value := range commandsTree.PrefixMatch(command) {
closestCommands = append(closestCommands, value.(string))
}
sort.Strings(closestCommands)
// Suggest other close commands - allow missed, wrongly added and even transposed characters
for _, value := range commandsTree.walk(commandsTree.root) {
if sort.SearchStrings(closestCommands, value.(string)) < len(closestCommands) {
continue
}
// 2 is arbitrary and represents the max allowed number of typed errors
if DamerauLevenshteinDistance(command, value.(string)) < 2 {
closestCommands = append(closestCommands, value.(string))
}
}
return closestCommands
}
func registerApp() *cli.App {
// Register all the commands (refer flags.go)
registerCmd(lsCmd) // List contents of a bucket.
registerCmd(mbCmd) // Make a bucket.
registerCmd(catCmd) // Display contents of a file.
registerCmd(pipeCmd) // Write contents of stdin to a file.
registerCmd(shareCmd) // Share documents via URL.
registerCmd(cpCmd) // Copy objects and files from multiple sources to single destination.
registerCmd(mirrorCmd) // Mirror objects and files from single source to multiple destinations.
registerCmd(diffCmd) // Computer differences between two files or folders.
registerCmd(rmCmd) // Remove a file or bucket
registerCmd(accessCmd) // Set access permissions.
registerCmd(sessionCmd) // Manage sessions for copy and mirror.
registerCmd(configCmd) // Configure minio client.
registerCmd(updateCmd) // Check for new software updates.
registerCmd(versionCmd) // Print version.
app := cli.NewApp()
app.Usage = "Minio Client for cloud storage and filesystems."
app.Commands = commands
app.Author = "Minio.io"
app.Flags = append(mcFlags, globalFlags...)
app.CustomAppHelpTemplate = mcHelpTemplate
app.CommandNotFound = commandNotFound // handler function declared above.
return app
}
func main() {
probe.Init() // Set project's root source path.
probe.SetAppInfo("Release-Tag", mcReleaseTag)
probe.SetAppInfo("Commit", mcShortCommitID)
contentdb.Init() // Load contentdb into memory.
app := registerApp()
app.Before = registerBefore
app.ExtraInfo = func() map[string]string {
if _, e := ts.GetSize(); e != nil {
globalQuiet = true
}
if globalDebug {
return getSystemData()
}
return make(map[string]string)
}
app.RunAndExitOnError()
}
+127
View File
@@ -0,0 +1,127 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"encoding/json"
"github.com/fatih/color"
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
)
var (
mbFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of mb.",
},
cli.StringFlag{
Name: "region",
Value: "us-east-1",
Usage: "Specify bucket region. Defaults to ‘us-east-1’.",
},
}
)
// make a bucket or folder.
var mbCmd = cli.Command{
Name: "mb",
Usage: "Make a bucket or folder.",
Action: mainMakeBucket,
Flags: append(mbFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc {{.Name}} - {{.Usage}}
USAGE:
mc {{.Name}} [FLAGS] TARGET [TARGET...]
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Create a bucket on Amazon S3 cloud storage.
$ mc {{.Name}} s3/mynewbucket
2. Create a new bucket on Google Cloud Storage.
$ mc {{.Name}} gcs/miniocloud
4. Create a new bucket on Amazon S3 cloud storage in region ‘us-west-2’.
$ mc {{.Name}} --region=us-west-2 s3/myregionbucket
5. Create a new directory including its missing parents (equivalent to ‘mkdir -p’).
$ mc {{.Name}} /tmp/this/new/dir1
`,
}
// makeBucketMessage is container for make bucket success and failure messages.
type makeBucketMessage struct {
Status string `json:"status"`
Bucket string `json:"bucket"`
Region string `json:"region"`
}
// String colorized make bucket message.
func (s makeBucketMessage) String() string {
return console.Colorize("MakeBucket", "Bucket created successfully ‘"+s.Bucket+"’.")
}
// JSON jsonified make bucket message.
func (s makeBucketMessage) JSON() string {
makeBucketJSONBytes, e := json.Marshal(s)
fatalIf(probe.NewError(e), "Unable to marshal into JSON.")
return string(makeBucketJSONBytes)
}
// Validate command line arguments.
func checkMakeBucketSyntax(ctx *cli.Context) {
if !ctx.Args().Present() {
cli.ShowCommandHelpAndExit(ctx, "mb", 1) // last argument is exit code
}
if len(ctx.Args()) != 1 {
fatalIf(errInvalidArgument().Trace(ctx.Args()...), "Incorrect number of arguments for mb command.")
}
}
// mainMakeBucket is entry point for mb command.
func mainMakeBucket(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check 'mb' cli arguments.
checkMakeBucketSyntax(ctx)
// Additional command speific theme customization.
console.SetColor("MakeBucket", color.New(color.FgGreen, color.Bold))
// save region.
region := ctx.String("region")
targetURL := ctx.Args().First()
// Instantiate client for URL.
clnt, err := newClient(targetURL)
fatalIf(err.Trace(targetURL), "Invalid target ‘"+targetURL+"’.")
// Make bucket.
err = clnt.MakeBucket(region)
fatalIf(err.Trace(targetURL), "Unable to make bucket ‘"+targetURL+"’.")
// Successfully created a bucket.
printMsg(makeBucketMessage{Status: "success", Bucket: targetURL})
}
+132
View File
@@ -0,0 +1,132 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"path/filepath"
"runtime"
"testing"
"time"
"net/http/httptest"
"github.com/minio/cli"
. "gopkg.in/check.v1"
)
var customConfigDir string
func Test(t *testing.T) { TestingT(t) }
type TestSuite struct{}
var _ = Suite(&TestSuite{})
var server *httptest.Server
var app *cli.App
func (s *TestSuite) SetUpSuite(c *C) {
}
func (s *TestSuite) TearDownSuite(c *C) {
}
func (s *TestSuite) TestValidPERMS(c *C) {
perms := accessPerms("private")
c.Assert(perms.isValidAccessPERM(), Equals, true)
c.Assert(perms.String(), Equals, "private")
perms = accessPerms("public")
c.Assert(perms.isValidAccessPERM(), Equals, true)
c.Assert(perms.String(), Equals, "public-read-write")
perms = accessPerms("readonly")
c.Assert(perms.isValidAccessPERM(), Equals, true)
c.Assert(perms.String(), Equals, "public-read")
perms = accessPerms("authorized")
c.Assert(perms.isValidAccessPERM(), Equals, true)
c.Assert(perms.String(), Equals, "authenticated-read")
}
func (s *TestSuite) TestInvalidPERMS(c *C) {
perms := accessPerms("invalid")
c.Assert(perms.isValidAccessPERM(), Equals, false)
}
func (s *TestSuite) TestGetMcConfigDir(c *C) {
dir, err := getMcConfigDir()
c.Assert(err, IsNil)
c.Assert(dir, Not(Equals), "")
c.Assert(mustGetMcConfigDir(), Equals, dir)
}
func (s *TestSuite) TestGetMcConfigPath(c *C) {
dir, err := getMcConfigPath()
c.Assert(err, IsNil)
switch runtime.GOOS {
case "linux":
fallthrough
case "freebsd":
fallthrough
case "darwin":
c.Assert(dir, Equals, filepath.Join(mustGetMcConfigDir(), "config.json"))
case "windows":
c.Assert(dir, Equals, filepath.Join(mustGetMcConfigDir(), "config.json"))
default:
c.Fail()
}
c.Assert(mustGetMcConfigPath(), Equals, dir)
}
func (s *TestSuite) TestIsvalidAliasName(c *C) {
c.Check(isValidAlias("helloWorld0"), Equals, true)
c.Check(isValidAlias("h0SFD2k24Fdsa"), Equals, true)
c.Check(isValidAlias("fdslka-4"), Equals, true)
c.Check(isValidAlias("fdslka-"), Equals, true)
c.Check(isValidAlias("helloWorld$"), Equals, false)
c.Check(isValidAlias("h0SFD2k2#Fdsa"), Equals, false)
c.Check(isValidAlias("0dslka-4"), Equals, false)
c.Check(isValidAlias("-fdslka"), Equals, false)
}
func (s *TestSuite) TestHumanizedTime(c *C) {
hTime := timeDurationToHumanizedTime(time.Duration(10) * time.Second)
c.Assert(hTime.Minutes, Equals, int64(0))
c.Assert(hTime.Hours, Equals, int64(0))
c.Assert(hTime.Days, Equals, int64(0))
hTime = timeDurationToHumanizedTime(time.Duration(10) * time.Minute)
c.Assert(hTime.Hours, Equals, int64(0))
c.Assert(hTime.Days, Equals, int64(0))
hTime = timeDurationToHumanizedTime(time.Duration(10) * time.Hour)
c.Assert(hTime.Days, Equals, int64(0))
hTime = timeDurationToHumanizedTime(time.Duration(24) * time.Hour)
c.Assert(hTime.Days, Not(Equals), int64(0))
}
func (s *TestSuite) TestCommonPrefix(c *C) {
c.Assert(commonPrefix("/usr", "/usr/local"), Equals, "/usr")
c.Assert(commonPrefix("/uabbf", "/ursfad/ccc"), Equals, "/u")
c.Assert(commonPrefix("/usr/local/lib", "/usr/local/test"), Equals, "/usr/local/")
}
func (s *TestSuite) TestVersions(c *C) {
v1 := newVersion("1.5.1")
v2 := newVersion("1.5.0")
c.Assert(v2.LessThan(v1), Equals, true)
c.Assert(v1.LessThan(v2), Equals, false)
}
+384
View File
@@ -0,0 +1,384 @@
/*
* Minio Client, (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"bufio"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
"sync"
"syscall"
"github.com/fatih/color"
"github.com/minio/cli"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
"github.com/minio/pb"
)
// mirror specific flags.
var (
mirrorFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of mirror.",
},
cli.BoolFlag{
Name: "force",
Usage: "Force overwrite of an existing target(s).",
},
}
)
// Mirror folders recursively from a single source to many destinations
var mirrorCmd = cli.Command{
Name: "mirror",
Usage: "Mirror folders recursively from a single source to single destination.",
Action: mainMirror,
Flags: append(mirrorFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc {{.Name}} - {{.Usage}}
USAGE:
mc {{.Name}} [FLAGS] SOURCE TARGET
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Mirror a bucket recursively from Minio cloud storage to a bucket on Amazon S3 cloud storage.
$ mc {{.Name}} play/photos/2014 s3/backup-photos
2. Mirror a local folder recursively to Amazon S3 cloud storage.
$ mc {{.Name}} backup/ s3/archive
3. Mirror a bucket from aliased Amazon S3 cloud storage to a folder on Windows.
$ mc {{.Name}} s3\documents\2014\ C:\backup\2014
`,
}
// mirrorMessage container for file mirror messages
type mirrorMessage struct {
Status string `json:"status"`
Source string `json:"source"`
Target string `json:"target"`
}
// String colorized mirror message
func (m mirrorMessage) String() string {
return console.Colorize("Mirror", fmt.Sprintf("‘%s’ -> ‘%s’", m.Source, m.Target))
}
// JSON jsonified mirror message
func (m mirrorMessage) JSON() string {
m.Status = "success"
mirrorMessageBytes, e := json.Marshal(m)
fatalIf(probe.NewError(e), "Unable to marshal into JSON.")
return string(mirrorMessageBytes)
}
// mirrorStatMessage container for mirror accounting message
type mirrorStatMessage struct {
Total int64
Transferred int64
Speed float64
}
// mirrorStatMessage mirror accounting message
func (c mirrorStatMessage) String() string {
speedBox := pb.FormatBytes(int64(c.Speed))
if speedBox == "" {
speedBox = "0 MB"
} else {
speedBox = speedBox + "/s"
}
message := fmt.Sprintf("Total: %s, Transferred: %s, Speed: %s", pb.FormatBytes(c.Total),
pb.FormatBytes(c.Transferred), speedBox)
return message
}
// doMirror - Mirror an object to multiple destination. mirrorURLs status contains a copy of sURLs and error if any.
func doMirror(sURLs mirrorURLs, progressReader *progressBar, accountingReader *accounter) mirrorURLs {
if sURLs.Error != nil { // Errorneous sURLs passed.
sURLs.Error = sURLs.Error.Trace()
return sURLs
}
sourceAlias := sURLs.SourceAlias
sourceURL := sURLs.SourceContent.URL
targetAlias := sURLs.TargetAlias
targetURL := sURLs.TargetContent.URL
length := sURLs.SourceContent.Size
if !globalQuiet && !globalJSON {
progressReader = progressReader.SetCaption(sourceURL.String() + ": ")
}
reader, err := getSourceStreamFromAlias(sourceAlias, sourceURL.String())
if err != nil {
sURLs.Error = err.Trace(sourceURL.String())
return sURLs
}
var progress io.Reader
if globalQuiet || globalJSON {
sourcePath := filepath.ToSlash(filepath.Join(sourceAlias, sourceURL.Path))
targetPath := filepath.ToSlash(filepath.Join(targetAlias, targetURL.Path))
printMsg(mirrorMessage{
Source: sourcePath,
Target: targetPath,
})
if globalQuiet || globalJSON {
progress = accountingReader
}
} else {
// Set up progress bar.
progress = progressReader.ProgressBar
}
_, err = putTargetStreamFromAlias(targetAlias, targetURL.String(), reader, length, progress)
if err != nil {
sURLs.Error = err.Trace(targetURL.String())
return sURLs
}
sURLs.Error = nil // just for safety
return sURLs
}
// doMirrorFake - Perform a fake mirror to update the progress bar appropriately.
func doMirrorFake(sURLs mirrorURLs, progressReader *progressBar) mirrorURLs {
if !globalDebug && !globalJSON {
progressReader.ProgressBar.Add64(sURLs.SourceContent.Size)
}
return sURLs
}
// doPrepareMirrorURLs scans the source URL and prepares a list of objects for mirroring.
func doPrepareMirrorURLs(session *sessionV6, isForce bool, trapCh <-chan bool) {
sourceURL := session.Header.CommandArgs[0] // first one is source.
targetURL := session.Header.CommandArgs[1]
var totalBytes int64
var totalObjects int
// Create a session data file to store the processed URLs.
dataFP := session.NewDataWriter()
var scanBar scanBarFunc
if !globalQuiet && !globalJSON { // set up progress bar
scanBar = scanBarFactory()
}
URLsCh := prepareMirrorURLs(sourceURL, targetURL, isForce)
done := false
for done == false {
select {
case sURLs, ok := <-URLsCh:
if !ok { // Done with URL prepration
done = true
break
}
if sURLs.Error != nil {
// Print in new line and adjust to top so that we don't print over the ongoing scan bar
if !globalQuiet && !globalJSON {
console.Eraseline()
}
errorIf(sURLs.Error.Trace(), "Unable to prepare URLs for mirroring.")
break
}
if sURLs.isEmpty() {
break
}
jsonData, e := json.Marshal(sURLs)
if e != nil {
session.Delete()
fatalIf(probe.NewError(e), "Unable to marshal URLs into JSON.")
}
fmt.Fprintln(dataFP, string(jsonData))
if !globalQuiet && !globalJSON {
scanBar(sURLs.SourceContent.URL.String())
}
totalBytes += sURLs.SourceContent.Size
totalObjects++
case <-trapCh:
// Print in new line and adjust to top so that we don't print over the ongoing scan bar
if !globalQuiet && !globalJSON {
console.Eraseline()
}
session.Delete() // If we are interrupted during the URL scanning, we drop the session.
os.Exit(0)
}
}
session.Header.TotalBytes = totalBytes
session.Header.TotalObjects = totalObjects
session.Save()
}
// Session'fied mirror command.
func doMirrorSession(session *sessionV6) {
isForce := session.Header.CommandBoolFlags["force"]
trapCh := signalTrap(os.Interrupt, syscall.SIGTERM)
if !session.HasData() {
doPrepareMirrorURLs(session, isForce, trapCh)
}
// Enable accounting reader by default.
accntReader := newAccounter(session.Header.TotalBytes)
// Set up progress bar.
var progressReader *progressBar
if !globalQuiet && !globalJSON {
progressReader = newProgressBar(session.Header.TotalBytes)
}
// Prepare URL scanner from session data file.
urlScanner := bufio.NewScanner(session.NewDataReader())
// isCopied returns true if an object has been already copied
// or not. This is useful when we resume from a session.
isCopied := isCopiedFactory(session.Header.LastCopied)
// Wait on status of doMirror() operation.
var statusCh = make(chan mirrorURLs)
// Add a wait group for the below go-routine.
var wg = new(sync.WaitGroup)
wg.Add(1)
// Go routine to monitor signal traps if any.
go func() {
defer wg.Done()
for {
select {
case <-trapCh:
// Receive interrupt notification.
if !globalQuiet && !globalJSON {
console.Eraseline()
}
session.CloseAndDie()
case sURLs, ok := <-statusCh:
// Status channel is closed, we should return.
if !ok {
return
}
if sURLs.Error == nil {
session.Header.LastCopied = sURLs.SourceContent.URL.String()
session.Save()
} else {
// Print in new line and adjust to top so that we
// don't print over the ongoing progress bar.
if !globalQuiet && !globalJSON {
console.Eraseline()
}
errorIf(sURLs.Error.Trace(sURLs.SourceContent.URL.String()),
fmt.Sprintf("Failed to copy ‘%s’.", sURLs.SourceContent.URL.String()))
// For all non critical errors we can continue for the
// remaining files.
switch sURLs.Error.ToGoError().(type) {
// Handle this specifically for filesystem related
// errors.
case client.BrokenSymlink:
continue
case client.TooManyLevelsSymlink:
continue
case client.PathNotFound:
continue
case client.PathInsufficientPermission:
continue
case client.ObjectAlreadyExists:
continue
case client.BucketDoesNotExist:
continue
}
// For critical errors we should exit. Session
// can be resumed after the user figures out
// the problem.
session.CloseAndDie()
}
}
}
}()
// Loop through all urls.
for urlScanner.Scan() {
var sURLs mirrorURLs
// Unmarshal copyURLs from each line.
json.Unmarshal([]byte(urlScanner.Text()), &sURLs)
// Verify if previously copied, notify progress bar.
if isCopied(sURLs.SourceContent.URL.String()) {
statusCh <- doMirrorFake(sURLs, progressReader)
} else {
statusCh <- doMirror(sURLs, progressReader, accntReader)
}
}
// Close the goroutine.
close(statusCh)
// Wait for the goroutines to finish.
wg.Wait()
if !globalQuiet && !globalJSON {
if progressReader.ProgressBar.Total > 0 {
progressReader.ProgressBar.Finish()
}
} else {
accntStat := accntReader.Stat()
mrStatMessage := mirrorStatMessage{
Total: accntStat.Total,
Transferred: accntStat.Transferred,
Speed: accntStat.Speed,
}
console.Println(console.Colorize("Mirror", mrStatMessage.String()))
}
}
// Main entry point for mirror command.
func mainMirror(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check 'mirror' cli arguments.
checkMirrorSyntax(ctx)
// Additional command speific theme customization.
console.SetColor("Mirror", color.New(color.FgGreen, color.Bold))
var e error
session := newSessionV6()
session.Header.CommandType = "mirror"
session.Header.RootPath, e = os.Getwd()
if e != nil {
session.Delete()
fatalIf(probe.NewError(e), "Unable to get current working folder.")
}
// Set command flags from context.
isForce := ctx.Bool("force")
session.Header.CommandBoolFlags["force"] = isForce
// extract URLs.
session.Header.CommandArgs = ctx.Args()
doMirrorSession(session)
session.Delete()
}
+168
View File
@@ -0,0 +1,168 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"fmt"
"strings"
"github.com/minio/cli"
"github.com/minio/mc/pkg/client"
"github.com/minio/minio-xl/pkg/probe"
)
type mirrorURLs struct {
SourceAlias string
SourceContent *client.Content
TargetAlias string
TargetContent *client.Content
Error *probe.Error `json:"-"`
}
func (m mirrorURLs) isEmpty() bool {
if m.SourceContent == nil && m.TargetContent == nil && m.Error == nil {
return true
}
if m.SourceContent.Size == 0 && m.TargetContent == nil && m.Error == nil {
return true
}
return false
}
//
// * MIRROR ARGS - VALID CASES
// =========================
// mirror(d1..., d2) -> []mirror(d1/f, d2/d1/f)
// checkMirrorSyntax(URLs []string)
func checkMirrorSyntax(ctx *cli.Context) {
if len(ctx.Args()) != 2 {
cli.ShowCommandHelpAndExit(ctx, "mirror", 1) // last argument is exit code.
}
// extract URLs.
URLs := ctx.Args()
srcURL := URLs[0]
tgtURL := URLs[1]
/****** Generic rules *******/
_, srcContent, err := url2Stat(srcURL)
// incomplete uploads are not necessary for copy operation, no need to verify for them.
isIncomplete := false
if err != nil && !isURLPrefixExists(srcURL, isIncomplete) {
fatalIf(err.Trace(srcURL), "Unable to stat source ‘"+srcURL+"’.")
}
if err == nil && !srcContent.Type.IsDir() {
fatalIf(errInvalidArgument().Trace(srcContent.URL.String(), srcContent.Type.String()), fmt.Sprintf("Source ‘%s’ is not a folder. Only folders are supported by mirror command.", srcURL))
}
if len(tgtURL) == 0 && tgtURL == "" {
fatalIf(errInvalidArgument().Trace(), "Invalid target arguments to mirror command.")
}
url := client.NewURL(tgtURL)
if url.Host != "" {
if !isURLVirtualHostStyle(url.Host) {
if url.Path == string(url.Separator) {
fatalIf(errInvalidArgument().Trace(tgtURL),
fmt.Sprintf("Target ‘%s’ does not contain bucket name.", tgtURL))
}
}
}
_, _, err = url2Stat(tgtURL)
// we die on any error other than client.PathNotFound - destination directory need not exist.
if _, ok := err.ToGoError().(client.PathNotFound); !ok {
fatalIf(err.Trace(tgtURL), fmt.Sprintf("Unable to stat %s", tgtURL))
}
}
func deltaSourceTargets(sourceURL string, targetURL string, isForce bool, mirrorURLsCh chan<- mirrorURLs) {
// source and targets are always directories
sourceSeparator := string(client.NewURL(sourceURL).Separator)
if !strings.HasSuffix(sourceURL, sourceSeparator) {
sourceURL = sourceURL + sourceSeparator
}
targetSeparator := string(client.NewURL(targetURL).Separator)
if !strings.HasSuffix(targetURL, targetSeparator) {
targetURL = targetURL + targetSeparator
}
// Extract alias and expanded URL
sourceAlias, sourceURL, _ := mustExpandAlias(sourceURL)
targetAlias, targetURL, _ := mustExpandAlias(targetURL)
defer close(mirrorURLsCh)
objectDifferenceTarget, err := objectDifferenceFactory(targetAlias, targetURL)
if err != nil {
mirrorURLsCh <- mirrorURLs{Error: err.Trace(targetAlias, targetURL)}
return
}
sourceClient, err := newClientFromAlias(sourceAlias, sourceURL)
if err != nil {
mirrorURLsCh <- mirrorURLs{Error: err.Trace(sourceAlias, sourceURL)}
return
}
for sourceContent := range sourceClient.List(true, false) {
if sourceContent.Err != nil {
mirrorURLsCh <- mirrorURLs{
Error: sourceContent.Err.Trace(sourceClient.GetURL().String()),
}
continue
}
if sourceContent.Type.IsDir() {
continue
}
suffix := strings.TrimPrefix(sourceContent.URL.String(), sourceURL)
differ, err := objectDifferenceTarget(suffix, sourceContent.Type, sourceContent.Size)
if err != nil {
mirrorURLsCh <- mirrorURLs{Error: err.Trace(sourceContent.URL.String())}
continue
}
if differ == differNone {
// no difference, continue
continue
}
if differ == differType {
mirrorURLsCh <- mirrorURLs{Error: errInvalidTarget(suffix)}
continue
}
if differ == differSize && !isForce {
// size differs and force not set
mirrorURLsCh <- mirrorURLs{Error: errOverWriteNotAllowed(sourceContent.URL.String())}
continue
}
// either available only in source or size differs and force is set
targetPath := urlJoinPath(targetURL, suffix)
targetContent := &client.Content{URL: *client.NewURL(targetPath)}
mirrorURLsCh <- mirrorURLs{
SourceAlias: sourceAlias,
SourceContent: sourceContent,
TargetAlias: targetAlias,
TargetContent: targetContent,
}
}
}
func prepareMirrorURLs(sourceURL string, targetURL string, isForce bool) <-chan mirrorURLs {
mirrorURLsCh := make(chan mirrorURLs)
go deltaSourceTargets(sourceURL, targetURL, isForce, mirrorURLsCh)
return mirrorURLsCh
}
+87
View File
@@ -0,0 +1,87 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"fmt"
"math"
"runtime"
"strings"
"github.com/fatih/color"
"github.com/minio/minio-xl/pkg/probe"
"github.com/olekukonko/ts"
)
// colorizeUpdateMessage - inspired from Yeoman project npm package https://github.com/yeoman/update-notifier.
func colorizeUpdateMessage(updateString string) (string, *probe.Error) {
// initialize coloring
cyan := color.New(color.FgCyan, color.Bold).SprintFunc()
yellow := color.New(color.FgYellow, color.Bold).SprintfFunc()
// calculate length without color coding, due to ANSI color characters padded to actual
// string the final length is wrong than the original string length.
line1Str := fmt.Sprintf(" New update available, please execute the following command to update: ")
line2Str := fmt.Sprintf(" %s ", updateString)
line1Length := len(line1Str)
line2Length := len(line2Str)
// populate lines with color coding.
line1InColor := line1Str
line2InColor := fmt.Sprintf(" %s ", cyan(updateString))
// calculate the rectangular box size.
maxContentWidth := int(math.Max(float64(line1Length), float64(line2Length)))
line1Rest := maxContentWidth - line1Length
line2Rest := maxContentWidth - line2Length
// Fetch terminal size to calculate optimal box size.
terminal, e := ts.GetSize()
if e != nil {
return "", probe.NewError(e)
}
var message string
switch {
case len(line2Str) > terminal.Col():
message = "\n" + line1InColor + "\n" + line2InColor + "\n"
default:
// on windows terminal turn off unicode characters.
var top, bottom, sideBar string
if runtime.GOOS == "windows" {
top = yellow("*" + strings.Repeat("*", maxContentWidth) + "*")
bottom = yellow("*" + strings.Repeat("*", maxContentWidth) + "*")
sideBar = yellow("|")
} else {
// color the rectangular box, use unicode characters here.
top = yellow("┏" + strings.Repeat("━", maxContentWidth) + "┓")
bottom = yellow("┗" + strings.Repeat("━", maxContentWidth) + "┛")
sideBar = yellow("┃")
}
// fill spaces to the rest of the area.
spacePaddingLine1 := strings.Repeat(" ", line1Rest)
spacePaddingLine2 := strings.Repeat(" ", line2Rest)
// construct the final message.
message = "\n" + top + "\n" +
sideBar + line1InColor + spacePaddingLine1 + sideBar + "\n" +
sideBar + line2InColor + spacePaddingLine2 + sideBar + "\n" +
bottom + "\n"
}
// return the final message
return message, nil
}
+111
View File
@@ -0,0 +1,111 @@
/*
* Minio Client, (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"os"
"syscall"
"github.com/minio/cli"
"github.com/minio/minio-xl/pkg/probe"
)
var (
pipeFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of pipe.",
},
}
)
// Display contents of a file.
var pipeCmd = cli.Command{
Name: "pipe",
Usage: "Write contents of stdin to one target. When no target is specified, it writes to stdout.",
Action: mainPipe,
Flags: append(pipeFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc {{.Name}} - {{.Usage}}
USAGE:
mc {{.Name}} [FLAGS] [TARGET]
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Write contents of stdin to a file on local filesystem.
$ mc {{.Name}} /tmp/hello-world.go
2. Write contents of stdin to an object on Amazon S3 cloud storage.
$ mc {{.Name}} s3/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}} s3/ferenginar/gnuos.iso
4. Stream MySQL database dump to Amazon S3 directly.
$ mysqldump -u root -p ******* accountsdb | mc {{.Name}} s3/ferenginar/backups/accountsdb-oct-9-2015.sql
`,
}
func pipe(targetURL string) *probe.Error {
if targetURL == "" {
// When no target is specified, pipe cat's stdin to stdout.
return catOut(os.Stdin).Trace()
}
// Stream from stdin to multiple objects until EOF.
// Ignore size, since os.Stat() would not return proper size all the time
// for local filesystem for example /proc files.
_, err := putTargetStream(targetURL, os.Stdin, -1)
// TODO: See if this check is necessary.
switch e := err.ToGoError().(type) {
case *os.PathError:
if e.Err == syscall.EPIPE {
// stdin closed by the user. Gracefully exit.
return nil
}
}
return err.Trace(targetURL)
}
// check pipe input arguments.
func checkPipeSyntax(ctx *cli.Context) {
if len(ctx.Args()) > 1 {
cli.ShowCommandHelpAndExit(ctx, "pipe", 1) // last argument is exit code.
}
}
// mainPipe is the main entry point for pipe command.
func mainPipe(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// validate pipe input arguments.
checkPipeSyntax(ctx)
if len(ctx.Args()) == 0 {
err := pipe("")
fatalIf(err.Trace("stdout"), "Unable to write to one or more targets.")
} else {
// extract URLs.
URLs := ctx.Args()
err := pipe(URLs[0])
fatalIf(err.Trace(URLs[0]), "Unable to write to one or more targets.")
}
}
+72
View File
@@ -0,0 +1,72 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package client
import (
"io"
"os"
"time"
"github.com/minio/minio-xl/pkg/probe"
)
// Client - client interface
type Client interface {
// Common operations
Stat() (content *Content, err *probe.Error)
List(recursive, incomplete bool) <-chan *Content
// Bucket operations
MakeBucket(region string) *probe.Error
GetBucketAccess() (access string, error *probe.Error)
SetBucketAccess(access string) *probe.Error
// I/O operations
Get() (reader io.Reader, err *probe.Error)
Put(reader io.Reader, size int64, contentType string, progress io.Reader) (n int64, err *probe.Error)
// I/O operations with expiration
ShareDownload(expires time.Duration) (string, *probe.Error)
ShareUpload(bool, time.Duration, string) (map[string]string, *probe.Error)
// Delete operations
Remove(incomplete bool) *probe.Error
// GetURL returns back internal url
GetURL() URL
}
// Content container for content metadata
type Content struct {
URL URL
Time time.Time
Size int64
Type os.FileMode
Err *probe.Error
}
// Config - see http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html
type Config struct {
AccessKey string
SecretKey string
Signature string
HostURL string
AppName string
AppVersion string
AppComments []string
Debug bool
}
+69
View File
@@ -0,0 +1,69 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package client
import (
"testing"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }
type MySuite struct{}
var _ = Suite(&MySuite{})
func (s *MySuite) TestURLParse(c *C) {
u := NewURL("http://s3.example.com")
c.Assert(u.Scheme, Equals, "http")
c.Assert(u.Host, Equals, "s3.example.com")
c.Assert(u.Path, Equals, "/")
c.Assert(u.SchemeSeparator, Equals, "://")
u = NewURL("http://s3.example.com/path/new")
c.Assert(u.Scheme, Equals, "http")
c.Assert(u.Host, Equals, "s3.example.com")
c.Assert(u.Path, Equals, "/path/new")
c.Assert(u.SchemeSeparator, Equals, "://")
u = NewURL(":::://s3.example.com/path/new")
c.Assert(u.Scheme, Equals, "")
c.Assert(u.Host, Equals, "")
c.Assert(u.Path, Equals, ":::://s3.example.com/path/new")
c.Assert(u.SchemeSeparator, Equals, "")
u = NewURL("localhost:9000")
c.Assert(u.Scheme, Equals, "")
c.Assert(u.Host, Equals, "")
c.Assert(u.Path, Equals, "localhost:9000")
c.Assert(u.SchemeSeparator, Equals, "")
}
func (s *MySuite) TestPathParse(c *C) {
u := NewURL("path/test")
c.Assert(u.Scheme, Equals, "")
c.Assert(u.Host, Equals, "")
c.Assert(u.Path, Equals, "path/test")
c.Assert(u.SchemeSeparator, Equals, "")
u = NewURL("/path/test")
c.Assert(u.Scheme, Equals, "")
c.Assert(u.Host, Equals, "")
c.Assert(u.Path, Equals, "/path/test")
c.Assert(u.SchemeSeparator, Equals, "")
}
+189
View File
@@ -0,0 +1,189 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package client
import (
"fmt"
"strconv"
)
/// Collection of standard errors
// APINotImplemented - api not implemented
type APINotImplemented struct {
API string
APIType string
}
func (e APINotImplemented) Error() string {
return "‘" + e.API + "’ feature " + "is not implemented for ‘" + e.APIType + "’."
}
// InvalidRange - invalid range requested
type InvalidRange struct {
Offset int64
}
func (e InvalidRange) Error() string {
return "Invalid range offset: ‘" + strconv.FormatInt(e.Offset, 10) + "’."
}
// GenericBucketError - generic bucket operations error
type GenericBucketError struct {
Bucket string
}
// BucketDoesNotExist - bucket does not exist.
type BucketDoesNotExist GenericBucketError
func (e BucketDoesNotExist) Error() string {
return "Bucket ‘" + e.Bucket + "’ does not exist."
}
// BucketExists - bucket exists.
type BucketExists GenericBucketError
func (e BucketExists) Error() string {
return "Bucket ‘" + e.Bucket + "’ exists."
}
// InvalidBucketName - bucket name invalid (http://goo.gl/wJlzDz)
type InvalidBucketName GenericBucketError
func (e InvalidBucketName) Error() string {
return "Invalid bucketname [‘" + e.Bucket + "’], please read http://goo.gl/wJlzDz."
}
// BucketNameEmpty - bucket name empty (http://goo.gl/wJlzDz)
type BucketNameEmpty struct{}
func (e BucketNameEmpty) Error() string {
return "Bucket name cannot be empty."
}
// GenericObjectError - generic object operations error
type GenericObjectError struct {
Bucket string
Object string
}
// ObjectAlreadyExists - typed return for MethodNotAllowed
type ObjectAlreadyExists struct {
Object string
}
func (e ObjectAlreadyExists) Error() string {
return "Object ‘" + e.Object + "’ already exists."
}
// InvalidObjectName - object requested is invalid
type InvalidObjectName GenericObjectError
func (e InvalidObjectName) Error() string {
return "Object ‘" + e.Object + "’ at ‘" + e.Bucket + "’ is invalid."
}
// BucketNameTopLevel - generic error
type BucketNameTopLevel struct{}
func (e BucketNameTopLevel) Error() string {
return "Buckets can only be created at the top level."
}
// GenericFileError - generic file error.
type GenericFileError struct {
Path string
}
// PathNotFound (ENOENT) - file not found.
type PathNotFound GenericFileError
func (e PathNotFound) Error() string {
return "Requested file ‘" + e.Path + "’ not found"
}
// PathIsNotRegular (ENOTREG) - file is not a regular file.
type PathIsNotRegular GenericFileError
func (e PathIsNotRegular) Error() string {
return "Requested file ‘" + e.Path + "’ is not a regular file."
}
// PathInsufficientPermission (EPERM) - permission denied.
type PathInsufficientPermission GenericFileError
func (e PathInsufficientPermission) Error() string {
return "Insufficient permissions to access this file ‘" + e.Path + "’"
}
// BrokenSymlink (ENOTENT) - file has broken symlink.
type BrokenSymlink GenericFileError
func (e BrokenSymlink) Error() string {
return "Requested file ‘" + e.Path + "’ has broken symlink"
}
// TooManyLevelsSymlink (ELOOP) - file has too many levels of symlinks.
type TooManyLevelsSymlink GenericFileError
func (e TooManyLevelsSymlink) Error() string {
return "Requested file ‘" + e.Path + "’ has too many levels of symlinks"
}
// EmptyPath (EINVAL) - invalid argument.
type EmptyPath struct{}
func (e EmptyPath) Error() string {
return "Invalid path, path cannot be empty"
}
// ObjectMissing (EINVAL) - object key missing.
type ObjectMissing struct{}
func (e ObjectMissing) Error() string {
return "Object key is missing, object key cannot be empty"
}
// UnexpectedShortWrite - write wrote less bytes than expected.
type UnexpectedShortWrite struct {
InputSize int
WriteSize int
}
func (e UnexpectedShortWrite) Error() string {
msg := fmt.Sprintf("Wrote less data than requested. Expected ‘%d’ bytes, but only wrote ‘%d’ bytes.", e.InputSize, e.WriteSize)
return msg
}
// UnexpectedEOF (EPIPE) - reader closed prematurely.
type UnexpectedEOF struct {
TotalSize int64
TotalWritten int64
}
func (e UnexpectedEOF) Error() string {
msg := fmt.Sprintf("Input reader closed pre-maturely. Expected ‘%d’ bytes, but only received ‘%d’ bytes.", e.TotalSize, e.TotalWritten)
return msg
}
// UnexpectedExcessRead - reader wrote more data than requested.
type UnexpectedExcessRead UnexpectedEOF
func (e UnexpectedExcessRead) Error() string {
msg := fmt.Sprintf("Received excess data on input reader. Expected only ‘%d’ bytes, but received ‘%d’ bytes.", e.TotalSize, e.TotalWritten)
return msg
}
+1
View File
@@ -0,0 +1 @@
*#
+86
View File
@@ -0,0 +1,86 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this fs except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fs
import (
"os"
"path/filepath"
"runtime"
"strings"
"github.com/minio/mc/pkg/client"
"github.com/minio/minio-xl/pkg/probe"
)
// toClientError error constructs a typed client error for known filesystem errors.
func (f *fsClient) toClientError(e error, fpath string) *probe.Error {
if os.IsPermission(e) {
return probe.NewError(client.PathInsufficientPermission{Path: fpath})
}
if os.IsNotExist(e) {
return probe.NewError(client.PathNotFound{Path: fpath})
}
return probe.NewError(e)
}
// handle windows symlinks - eg: junction files.
func (f *fsClient) handleWindowsSymlinks(fpath string) (os.FileInfo, *probe.Error) {
// On windows there are directory symlinks which are called junction files.
// These files carry special meaning on windows they cannot be,
// accessed with regular operations.
file, e := os.Lstat(fpath)
if e != nil {
err := f.toClientError(e, fpath)
return nil, err.Trace(fpath)
}
return file, nil
}
// fsStat - wrapper function to get file stat.
func (f *fsClient) fsStat() (os.FileInfo, *probe.Error) {
fpath := f.PathURL.Path
// Golang strips trailing / if you clean(..) or
// EvalSymlinks(..). Adding '.' prevents it from doing so.
if strings.HasSuffix(fpath, string(f.PathURL.Separator)) {
fpath = fpath + "."
}
fpath, e := filepath.EvalSymlinks(fpath)
if e != nil {
if os.IsPermission(e) {
if runtime.GOOS == "windows" {
return f.handleWindowsSymlinks(f.PathURL.Path)
}
return nil, probe.NewError(client.PathInsufficientPermission{Path: f.PathURL.Path})
}
err := f.toClientError(e, f.PathURL.Path)
return nil, err.Trace(fpath)
}
st, e := os.Stat(fpath)
if e != nil {
if os.IsPermission(e) {
if runtime.GOOS == "windows" {
return f.handleWindowsSymlinks(fpath)
}
return nil, probe.NewError(client.PathInsufficientPermission{Path: f.PathURL.Path})
}
if os.IsNotExist(e) {
return nil, probe.NewError(client.PathNotFound{Path: f.PathURL.Path})
}
return nil, probe.NewError(e)
}
return st, nil
}
+168
View File
@@ -0,0 +1,168 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this fs except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fs
import (
"errors"
"os"
"path/filepath"
"sort"
)
// byDirName implements sort.Interface.
type byDirName []os.FileInfo
func (f byDirName) Len() int { return len(f) }
func (f byDirName) Less(i, j int) bool {
// For directory add an ending separator fortrue lexical order.
if f[i].Mode().IsDir() {
return f[i].Name()+string(filepath.Separator) < f[j].Name()
}
// For directory add an ending separator for true lexical order.
if f[j].Mode().IsDir() {
return f[i].Name() < f[j].Name()+string(filepath.Separator)
}
return f[i].Name() < f[j].Name()
}
func (f byDirName) Swap(i, j int) { f[i], f[j] = f[j], f[i] }
// readDir reads the directory named by dirname and returns
// a list of sorted directory entries.
func readDir(dirname string) ([]os.FileInfo, error) {
f, e := os.Open(dirname)
if e != nil {
return nil, e
}
list, e := f.Readdir(-1)
if e != nil {
return nil, e
}
if e = f.Close(); e != nil {
return nil, e
}
sort.Sort(byDirName(list))
return list, nil
}
// readDirNames reads the directory named by dirname and returns
// a sorted list of directory entries.
func readDirNames(dirname string) ([]string, error) {
names, e := readDirUnsortedNames(dirname)
if e != nil {
return nil, e
}
sort.Strings(names)
return names, nil
}
// getRealName - gets the proper filename for sorting purposes
// Readdir() filters out directory names without separators, add
// them back for proper sorting results.
func getRealName(info os.FileInfo) string {
if info.IsDir() {
// Make sure directory has its end separator.
return info.Name() + string(filepath.Separator)
}
return info.Name()
}
// readDirUnsortedNames reads the directory named by dirname and
// return a unsorted list of directory entries.
func readDirUnsortedNames(dirname string) ([]string, error) {
f, e := os.Open(dirname)
if e != nil {
return nil, e
}
nameInfos, e := f.Readdir(-1)
if e != nil {
return nil, e
}
if e = f.Close(); e != nil {
return nil, e
}
var names []string
for _, nameInfo := range nameInfos {
names = append(names, getRealName(nameInfo))
}
return names, nil
}
// walk walks the file tree rooted at root, calling walkFn for each file or
// directory in the tree, including root.
func walk(root string, walkFn walkFunc) error {
info, e := os.Lstat(root)
if e != nil {
return walkFn(root, nil, e)
}
return walkInternal(root, info, walkFn)
}
// WalkFunc is the type of the function called for each file or directory
// visited by Walk. The path argument contains the argument to Walk as a
// prefix; that is, if Walk is called with "dir", which is a directory
// containing the file "a", the walk function will be called with argument
// "dir/a". The info argument is the os.FileInfo for the named path.
type walkFunc func(path string, info os.FileInfo, e error) error
// ErrSkipDir is used as a return value from WalkFuncs to indicate that
// the directory named in the call is to be skipped. It is not returned
// as an error by any function.
var errSkipDir = errors.New("skip this directory")
// ErrSkipFile is used as a return value from WalkFuncs to indicate that
// the file named in the call is to be skipped. It is not returned
// as an error by any function.
var errSkipFile = errors.New("skip this file")
// walkInternal recursively descends path, calling w.
func walkInternal(path string, info os.FileInfo, walkFn walkFunc) error {
e := walkFn(path, info, nil)
if e != nil {
if info.Mode().IsDir() && e == errSkipDir {
return nil
}
if info.Mode().IsRegular() && e == errSkipFile {
return nil
}
return e
}
if !info.IsDir() {
return nil
}
names, e := readDirNames(path)
if e != nil {
return walkFn(path, info, e)
}
for _, name := range names {
filename := filepath.Join(path, name)
fileInfo, e := os.Lstat(filename)
if e != nil {
if e = walkFn(filename, fileInfo, e); e != nil && e != errSkipDir && e != errSkipFile {
return e
}
} else {
e = walkInternal(filename, fileInfo, walkFn)
if e != nil {
if e == errSkipDir || e == errSkipFile {
return nil
}
return e
}
}
}
return nil
}
+745
View File
@@ -0,0 +1,745 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this fs except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fs
import (
"io"
"os"
"path/filepath"
"runtime"
"strings"
"time"
"io/ioutil"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/hookreader"
"github.com/minio/minio-xl/pkg/probe"
)
// filesystem client
type fsClient struct {
PathURL *client.URL
}
const (
partSuffix = ".part.mc"
)
// New - instantiate a new fs client.
func New(path string) (client.Client, *probe.Error) {
if strings.TrimSpace(path) == "" {
return nil, probe.NewError(client.EmptyPath{})
}
return &fsClient{
PathURL: client.NewURL(normalizePath(path)),
}, nil
}
// URL get url.
func (f *fsClient) GetURL() client.URL {
return *f.PathURL
}
/// Object operations.
// Put - create a new file.
func (f *fsClient) Put(reader io.Reader, size int64, contentType string, progress io.Reader) (int64, *probe.Error) {
// ContentType is not handled on purpose.
// For filesystem this is a redundant information.
// Extract dir name.
objectDir, _ := filepath.Split(f.PathURL.Path)
objectPath := f.PathURL.Path
// Verify if destination already exists.
st, e := os.Stat(objectPath)
if e == nil {
// If the destination exists and is not a regular file.
if !st.Mode().IsRegular() {
return 0, probe.NewError(client.PathIsNotRegular{
Path: objectPath,
})
}
}
// Proceed if file does not exist. return for all other errors.
if e != nil {
if !os.IsNotExist(e) {
return 0, probe.NewError(e)
}
}
// Write to a temporary file "object.part.mc" before committ.
objectPartPath := objectPath + partSuffix
if objectDir != "" {
// Create any missing top level directories.
if e := os.MkdirAll(objectDir, 0700); e != nil {
err := f.toClientError(e, f.PathURL.Path)
return 0, err.Trace(f.PathURL.Path)
}
}
// If exists, open in append mode. If not create it the part file.
partFile, e := os.OpenFile(objectPartPath, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
if e != nil {
err := f.toClientError(e, f.PathURL.Path)
return 0, err.Trace(f.PathURL.Path)
}
// Get stat to get the current size.
partSt, e := partFile.Stat()
if e != nil {
err := f.toClientError(e, objectPartPath)
return 0, err.Trace(objectPartPath)
}
var totalWritten int64
// Current file offset.
var currentOffset = partSt.Size()
// Reflect and verify if incoming reader implements ReaderAt.
readerAt, ok := reader.(io.ReaderAt)
if ok {
// Notify the progress bar if any till current size.
if progress != nil {
if _, e = io.CopyN(ioutil.Discard, progress, currentOffset); e != nil {
return 0, probe.NewError(e)
}
}
// Allocate buffer of 10MiB once.
readAtBuffer := make([]byte, 10*1024*1024)
// Loop through all offsets on incoming io.ReaderAt and write
// to the destination.
for {
readAtSize, re := readerAt.ReadAt(readAtBuffer, currentOffset)
if re != nil && re != io.EOF {
// For any errors other than io.EOF, we return error
// and breakout.
err := f.toClientError(re, objectPartPath)
return 0, err.Trace(objectPartPath)
}
writtenSize, we := partFile.Write(readAtBuffer[:readAtSize])
if we != nil {
err := f.toClientError(we, objectPartPath)
return 0, err.Trace(objectPartPath)
}
// read size and subsequent write differ, a possible
// corruption return here.
if readAtSize != writtenSize {
// Unexpected write (less data was written than expected).
return 0, probe.NewError(client.UnexpectedShortWrite{
InputSize: readAtSize,
WriteSize: writtenSize,
})
}
// Notify the progress bar if any for written size.
if progress != nil {
if _, e = io.CopyN(ioutil.Discard, progress, int64(writtenSize)); e != nil {
return totalWritten, probe.NewError(e)
}
}
currentOffset += int64(writtenSize)
// Once we see io.EOF we break out of the loop.
if re == io.EOF {
break
}
}
// Save currently copied total into totalWritten.
totalWritten = currentOffset
} else {
reader = hookreader.NewHook(reader, progress)
// Discard bytes until currentOffset.
if _, e = io.CopyN(ioutil.Discard, reader, currentOffset); e != nil {
return 0, probe.NewError(e)
}
var n int64
n, e = io.Copy(partFile, reader)
if e != nil {
return 0, probe.NewError(e)
}
// Save currently copied total into totalWritten.
totalWritten = n + currentOffset
}
// Close the input reader as well, if possible.
closer, ok := reader.(io.Closer)
if ok {
if e := closer.Close(); e != nil {
return totalWritten, probe.NewError(e)
}
}
// Close the file before rename.
if e := partFile.Close(); e != nil {
return totalWritten, probe.NewError(e)
}
// Following verification is needed only for input size greater than '0'.
if size > 0 {
// Unexpected EOF reached (less data was written than expected).
if totalWritten < size {
return totalWritten, probe.NewError(client.UnexpectedEOF{
TotalSize: size,
TotalWritten: totalWritten,
})
}
// Unexpected ExcessRead (more data was written than expected).
if totalWritten > size {
return totalWritten, probe.NewError(client.UnexpectedExcessRead{
TotalSize: size,
TotalWritten: totalWritten,
})
}
}
// Safely completed put. Now commit by renaming to actual filename.
if e = os.Rename(objectPartPath, objectPath); e != nil {
err := f.toClientError(e, objectPath)
return totalWritten, err.Trace(objectPartPath, objectPath)
}
return totalWritten, nil
}
// ShareDownload - share download not implemented for filesystem.
func (f *fsClient) ShareDownload(expires time.Duration) (string, *probe.Error) {
return "", probe.NewError(client.APINotImplemented{
API: "ShareDownload",
APIType: "filesystem",
})
}
// ShareUpload - share upload not implemented for filesystem.
func (f *fsClient) ShareUpload(startsWith bool, expires time.Duration, contentType string) (map[string]string, *probe.Error) {
return nil, probe.NewError(client.APINotImplemented{
API: "ShareUpload",
APIType: "filesystem",
})
}
// GetPartial download a part object from bucket.
// sets err for any errors, reader is nil for errors.
func (f *fsClient) Get() (io.Reader, *probe.Error) {
tmppath := f.PathURL.Path
// Golang strips trailing / if you clean(..) or
// EvalSymlinks(..). Adding '.' prevents it from doing so.
if strings.HasSuffix(tmppath, string(f.PathURL.Separator)) {
tmppath = tmppath + "."
}
// Resolve symlinks.
_, e := filepath.EvalSymlinks(tmppath)
if e != nil {
err := f.toClientError(e, f.PathURL.Path)
return nil, err.Trace(f.PathURL.Path)
}
fileData, e := os.Open(f.PathURL.Path)
if e != nil {
err := f.toClientError(e, f.PathURL.Path)
return nil, err.Trace(f.PathURL.Path)
}
return fileData, nil
}
// Remove - remove the path.
func (f *fsClient) Remove(incomplete bool) *probe.Error {
if incomplete {
return nil
}
e := os.Remove(f.PathURL.Path)
err := f.toClientError(e, f.PathURL.Path)
return err.Trace(f.PathURL.Path)
}
// List - list files and folders.
func (f *fsClient) List(recursive, incomplete bool) <-chan *client.Content {
contentCh := make(chan *client.Content)
switch recursive {
case true:
go f.listRecursiveInRoutine(contentCh, incomplete)
default:
go f.listInRoutine(contentCh, incomplete)
}
return contentCh
}
// listPrefixes - list all files for any given prefix.
func (f *fsClient) listPrefixes(prefix string, contentCh chan<- *client.Content, incomplete bool) {
dirName := filepath.Dir(prefix)
files, e := readDir(dirName)
if e != nil {
err := f.toClientError(e, dirName)
contentCh <- &client.Content{
Err: err.Trace(dirName),
}
return
}
pathURL := *f.PathURL
for _, fi := range files {
file := filepath.Join(dirName, fi.Name())
if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
st, e := os.Stat(file)
if e != nil {
if os.IsPermission(e) {
// On windows there are folder symlinks
// which are called junction files which
// carry special meaning on windows
// - which cannot be accessed with regular operations
if runtime.GOOS == "windows" {
newPath := filepath.Join(prefix, fi.Name())
lfi, le := f.handleWindowsSymlinks(newPath)
if le != nil {
contentCh <- &client.Content{
Err: le.Trace(newPath),
}
continue
}
if incomplete {
if !strings.HasSuffix(lfi.Name(), partSuffix) {
continue
}
} else {
if strings.HasSuffix(lfi.Name(), partSuffix) {
continue
}
}
pathURL.Path = filepath.Join(pathURL.Path, lfi.Name())
contentCh <- &client.Content{
URL: pathURL,
Time: lfi.ModTime(),
Size: lfi.Size(),
Type: lfi.Mode(),
Err: probe.NewError(client.PathInsufficientPermission{
Path: pathURL.Path,
}),
}
continue
} else {
contentCh <- &client.Content{
Err: probe.NewError(client.PathInsufficientPermission{
Path: pathURL.Path,
}),
}
continue
}
}
if os.IsNotExist(e) {
contentCh <- &client.Content{
Err: probe.NewError(client.BrokenSymlink{
Path: pathURL.Path,
}),
}
continue
}
if e != nil {
contentCh <- &client.Content{
Err: probe.NewError(e),
}
continue
}
}
if strings.HasPrefix(file, prefix) {
if incomplete {
if !strings.HasSuffix(st.Name(), partSuffix) {
continue
}
} else {
if strings.HasSuffix(st.Name(), partSuffix) {
continue
}
}
contentCh <- &client.Content{
URL: *client.NewURL(file),
Time: st.ModTime(),
Size: st.Size(),
Type: st.Mode(),
Err: nil,
}
continue
}
}
if strings.HasPrefix(file, prefix) {
if incomplete {
if !strings.HasSuffix(fi.Name(), partSuffix) {
continue
}
} else {
if strings.HasSuffix(fi.Name(), partSuffix) {
continue
}
}
contentCh <- &client.Content{
URL: *client.NewURL(file),
Time: fi.ModTime(),
Size: fi.Size(),
Type: fi.Mode(),
Err: nil,
}
}
}
return
}
func (f *fsClient) listInRoutine(contentCh chan<- *client.Content, incomplete bool) {
// close the channel when the function returns.
defer close(contentCh)
// save pathURL and file path for further usage.
pathURL := *f.PathURL
fpath := pathURL.Path
fst, err := f.fsStat()
if err != nil {
if _, ok := err.ToGoError().(client.PathNotFound); ok {
// If file does not exist treat it like a prefix and list all prefixes if any.
prefix := fpath
f.listPrefixes(prefix, contentCh, incomplete)
return
}
// For all other errors we return genuine error back to the caller.
contentCh <- &client.Content{Err: err.Trace(fpath)}
return
}
// Now if the file exists and doesn't end with a separator ('/') do not traverse it.
// If the directory doesn't end with a separator, do not traverse it.
if !strings.HasSuffix(fpath, string(pathURL.Separator)) && fst.Mode().IsDir() && fpath != "." {
f.listPrefixes(fpath, contentCh, incomplete)
return
}
// If we really see the directory.
switch fst.Mode().IsDir() {
case true:
files, e := readDir(fpath)
if err != nil {
contentCh <- &client.Content{Err: probe.NewError(e)}
return
}
for _, file := range files {
fi := file
if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
fi, e = os.Stat(filepath.Join(fpath, fi.Name()))
if os.IsPermission(e) {
// On windows there are folder symlinks
// which are called junction files which
// carry special meaning on windows
// - which cannot be accessed with regular operations
if runtime.GOOS == "windows" {
newPath := filepath.Join(fpath, fi.Name())
lfi, le := f.handleWindowsSymlinks(newPath)
if le != nil {
contentCh <- &client.Content{
Err: le.Trace(newPath),
}
continue
}
if incomplete {
if !strings.HasSuffix(lfi.Name(), partSuffix) {
continue
}
} else {
if strings.HasSuffix(lfi.Name(), partSuffix) {
continue
}
}
pathURL = *f.PathURL
pathURL.Path = filepath.Join(pathURL.Path, lfi.Name())
contentCh <- &client.Content{
URL: pathURL,
Time: lfi.ModTime(),
Size: lfi.Size(),
Type: lfi.Mode(),
Err: probe.NewError(client.PathInsufficientPermission{Path: pathURL.Path}),
}
continue
} else {
contentCh <- &client.Content{
Err: probe.NewError(client.PathInsufficientPermission{Path: pathURL.Path}),
}
continue
}
}
if os.IsNotExist(e) {
contentCh <- &client.Content{
Err: probe.NewError(client.BrokenSymlink{Path: file.Name()}),
}
continue
}
if e != nil {
contentCh <- &client.Content{
Err: probe.NewError(e),
}
continue
}
}
if fi.Mode().IsRegular() || fi.Mode().IsDir() {
if incomplete {
if !strings.HasSuffix(fi.Name(), partSuffix) {
continue
}
} else {
if strings.HasSuffix(fi.Name(), partSuffix) {
continue
}
}
pathURL = *f.PathURL
pathURL.Path = filepath.Join(pathURL.Path, fi.Name())
contentCh <- &client.Content{
URL: pathURL,
Time: fi.ModTime(),
Size: fi.Size(),
Type: fi.Mode(),
Err: nil,
}
}
}
default:
if incomplete {
if !strings.HasSuffix(fst.Name(), partSuffix) {
return
}
} else {
if strings.HasSuffix(fst.Name(), partSuffix) {
return
}
}
contentCh <- &client.Content{
URL: pathURL,
Time: fst.ModTime(),
Size: fst.Size(),
Type: fst.Mode(),
Err: nil,
}
}
}
func (f *fsClient) listRecursiveInRoutine(contentCh chan *client.Content, incomplete bool) {
// close channels upon return.
defer close(contentCh)
var dirName string
var filePrefix string
pathURL := *f.PathURL
visitFS := func(fp string, fi os.FileInfo, e error) error {
// If file path ends with filepath.Separator and equals to root path, skip it.
if strings.HasSuffix(fp, string(pathURL.Separator)) {
if fp == dirName {
return nil
}
}
// We would never need to print system root path '/'.
if fp == "/" {
return nil
}
/// In following situations we need to handle listing properly.
// - When filepath is '/usr' and prefix is '/usr/bi'
// - When filepath is '/usr/bin/subdir' and prefix is '/usr/bi'
// - Do not check filePrefix if its '.'
if filePrefix != "." {
if !strings.HasPrefix(fp, filePrefix) &&
!strings.HasPrefix(filePrefix, fp) {
if e == nil {
if fi.IsDir() {
return errSkipDir
}
return nil
}
}
// - Skip when fp is /usr and prefix is '/usr/bi'
// - Do not check filePrefix if its '.'
if filePrefix != "." {
if !strings.HasPrefix(fp, filePrefix) {
return nil
}
}
}
if e != nil {
// If operation is not permitted, we throw quickly back.
if strings.Contains(e.Error(), "operation not permitted") {
contentCh <- &client.Content{
Err: probe.NewError(e),
}
return nil
}
if os.IsPermission(e) {
if runtime.GOOS == "windows" {
lfi, le := f.handleWindowsSymlinks(fp)
if le != nil {
contentCh <- &client.Content{
Err: le.Trace(fp),
}
return nil
}
pathURL := *f.PathURL
pathURL.Path = filepath.Join(pathURL.Path, dirName)
if incomplete {
if !strings.HasSuffix(lfi.Name(), partSuffix) {
return nil
}
} else {
if strings.HasSuffix(lfi.Name(), partSuffix) {
return nil
}
}
contentCh <- &client.Content{
URL: pathURL,
Time: lfi.ModTime(),
Size: lfi.Size(),
Type: lfi.Mode(),
Err: probe.NewError(e),
}
} else {
contentCh <- &client.Content{
Err: probe.NewError(client.PathInsufficientPermission{Path: fp}),
}
}
return nil
}
return e
}
if fi.Mode()&os.ModeSymlink == os.ModeSymlink {
fi, e = os.Stat(fp)
if e != nil {
if os.IsPermission(e) {
if runtime.GOOS == "windows" {
lfi, le := f.handleWindowsSymlinks(fp)
if le != nil {
contentCh <- &client.Content{
Err: le.Trace(fp),
}
return nil
}
pathURL := *f.PathURL
pathURL.Path = filepath.Join(pathURL.Path, dirName)
if incomplete {
if !strings.HasSuffix(lfi.Name(), partSuffix) {
return nil
}
} else {
if !strings.HasSuffix(lfi.Name(), partSuffix) {
return nil
}
}
contentCh <- &client.Content{
URL: pathURL,
Time: lfi.ModTime(),
Size: lfi.Size(),
Type: lfi.Mode(),
Err: probe.NewError(e),
}
return nil
}
contentCh <- &client.Content{
Err: probe.NewError(e),
}
return nil
}
// Ignore in-accessible broken symlinks.
if os.IsNotExist(e) {
contentCh <- &client.Content{
Err: probe.NewError(client.BrokenSymlink{Path: fp}),
}
return nil
}
// Ignore symlink loops.
if strings.Contains(e.Error(), "too many levels of symbolic links") {
contentCh <- &client.Content{
Err: probe.NewError(client.TooManyLevelsSymlink{Path: fp}),
}
return nil
}
return e
}
}
if fi.Mode().IsRegular() || fi.Mode().IsDir() {
if incomplete {
if !strings.HasSuffix(fi.Name(), partSuffix) {
return nil
}
} else {
if strings.HasSuffix(fi.Name(), partSuffix) {
return nil
}
}
contentCh <- &client.Content{
URL: *client.NewURL(fp),
Time: fi.ModTime(),
Size: fi.Size(),
Type: fi.Mode(),
Err: nil,
}
}
return nil
}
// No prefix to be filtered by default.
filePrefix = ""
// if f.Path ends with filepath.Separator - assuming it to be a directory and moving on.
if strings.HasSuffix(pathURL.Path, string(pathURL.Separator)) {
dirName = pathURL.Path
} else {
// if not a directory, take base path to navigate through WalkFunc.
dirName = filepath.Dir(pathURL.Path)
if !strings.HasSuffix(dirName, string(pathURL.Separator)) {
// basepath truncates the filepath.Separator,
// add it deligently useful for trimming file path inside WalkFunc
dirName = dirName + string(pathURL.Separator)
}
// filePrefix is kept for filtering incoming contents through WalkFunc.
filePrefix = pathURL.Path
}
// walks invokes our custom function.
e := walk(dirName, visitFS)
if e != nil {
contentCh <- &client.Content{
Err: probe.NewError(e),
}
}
}
// MakeBucket - create a new bucket.
func (f *fsClient) MakeBucket(region string) *probe.Error {
e := os.MkdirAll(f.PathURL.Path, 0775)
if e != nil {
return probe.NewError(e)
}
return nil
}
// GetBucketACL - get bucket access.
func (f *fsClient) GetBucketAccess() (acl string, err *probe.Error) {
return "", probe.NewError(client.APINotImplemented{API: "GetBucketAccess", APIType: "filesystem"})
}
// SetBucketAccess - set bucket access.
func (f *fsClient) SetBucketAccess(acl string) *probe.Error {
return probe.NewError(client.APINotImplemented{API: "SetBucketAccess", APIType: "filesystem"})
}
// Stat - get metadata from path.
func (f *fsClient) Stat() (content *client.Content, err *probe.Error) {
st, err := f.fsStat()
if err != nil {
return nil, err.Trace(f.PathURL.String())
}
content = new(client.Content)
content.URL = *f.PathURL
content.Size = st.Size()
content.Time = st.ModTime()
content.Type = st.Mode()
return content, nil
}
+282
View File
@@ -0,0 +1,282 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this fs except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fs_test
import (
"bytes"
"io"
"io/ioutil"
"os"
"path/filepath"
"testing"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/client/fs"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }
type MySuite struct{}
var _ = Suite(&MySuite{})
// Test list files in a folder.
func (s *MySuite) TestList(c *C) {
root, e := ioutil.TempDir(os.TempDir(), "fs-")
c.Assert(e, IsNil)
defer os.RemoveAll(root)
// Create multiple files.
objectPath := filepath.Join(root, "object1")
fsClient, err := fs.New(objectPath)
c.Assert(err, IsNil)
data := "hello"
reader := bytes.NewReader([]byte(data))
var n int64
n, err = fsClient.Put(reader, int64(len(data)), "application/octet-stream", nil)
c.Assert(err, IsNil)
c.Assert(n, Equals, int64(len(data)))
objectPath = filepath.Join(root, "object2")
fsClient, err = fs.New(objectPath)
c.Assert(err, IsNil)
reader = bytes.NewReader([]byte(data))
n, err = fsClient.Put(reader, int64(len(data)), "application/octet-stream", nil)
c.Assert(err, IsNil)
c.Assert(n, Equals, int64(len(data)))
fsClient, err = fs.New(root)
c.Assert(err, IsNil)
// Verify previously create files and list them.
var contents []*client.Content
for content := range fsClient.List(false, false) {
if content.Err != nil {
err = content.Err
break
}
contents = append(contents, content)
}
c.Assert(err, IsNil)
c.Assert(len(contents), Equals, 1)
c.Assert(contents[0].Type.IsDir(), Equals, true)
// Create another file.
objectPath = filepath.Join(root, "test1/newObject1")
fsClient, err = fs.New(objectPath)
c.Assert(err, IsNil)
reader = bytes.NewReader([]byte(data))
n, err = fsClient.Put(reader, int64(len(data)), "application/octet-stream", nil)
c.Assert(err, IsNil)
c.Assert(n, Equals, int64(len(data)))
fsClient, err = fs.New(root)
c.Assert(err, IsNil)
contents = nil
// List non recursive to list only top level files.
for content := range fsClient.List(false, false) {
if content.Err != nil {
err = content.Err
break
}
contents = append(contents, content)
}
c.Assert(err, IsNil)
c.Assert(len(contents), Equals, 1)
c.Assert(contents[0].Type.IsDir(), Equals, true)
fsClient, err = fs.New(root)
c.Assert(err, IsNil)
contents = nil
// List recursively all files and verify.
for content := range fsClient.List(true, false) {
if content.Err != nil {
err = content.Err
break
}
contents = append(contents, content)
}
c.Assert(err, IsNil)
c.Assert(len(contents), Equals, 5)
var regularFiles int
var regularDirs int
// Test number of expected files and directories.
for _, content := range contents {
if content.Type.IsRegular() {
regularFiles++
continue
}
if content.Type.IsDir() {
regularDirs++
continue
}
}
c.Assert(regularDirs, Equals, 2)
c.Assert(regularFiles, Equals, 3)
}
// Test put bucket aka 'mkdir()' operation.
func (s *MySuite) TestPutBucket(c *C) {
root, e := ioutil.TempDir(os.TempDir(), "fs-")
c.Assert(e, IsNil)
defer os.RemoveAll(root)
bucketPath := filepath.Join(root, "bucket")
fsClient, err := fs.New(bucketPath)
c.Assert(err, IsNil)
err = fsClient.MakeBucket("us-east-1")
c.Assert(err, IsNil)
}
// Test stat bucket aka 'stat()' operation.
func (s *MySuite) TestStatBucket(c *C) {
root, e := ioutil.TempDir(os.TempDir(), "fs-")
c.Assert(e, IsNil)
defer os.RemoveAll(root)
bucketPath := filepath.Join(root, "bucket")
fsClient, err := fs.New(bucketPath)
c.Assert(err, IsNil)
err = fsClient.MakeBucket("us-east-1")
c.Assert(err, IsNil)
_, err = fsClient.Stat()
c.Assert(err, IsNil)
}
// Test bucket acl fails for directories.
func (s *MySuite) TestBucketACLFails(c *C) {
root, e := ioutil.TempDir(os.TempDir(), "fs-")
c.Assert(e, IsNil)
defer os.RemoveAll(root)
bucketPath := filepath.Join(root, "bucket")
fsClient, err := fs.New(bucketPath)
c.Assert(err, IsNil)
err = fsClient.MakeBucket("us-east-1")
c.Assert(err, IsNil)
err = fsClient.SetBucketAccess("private")
c.Assert(err, Not(IsNil))
_, err = fsClient.GetBucketAccess()
c.Assert(err, Not(IsNil))
}
// Test creating a file.
func (s *MySuite) TestPut(c *C) {
root, e := ioutil.TempDir(os.TempDir(), "fs-")
c.Assert(e, IsNil)
defer os.RemoveAll(root)
objectPath := filepath.Join(root, "object")
fsClient, err := fs.New(objectPath)
c.Assert(err, IsNil)
data := "hello"
reader := bytes.NewReader([]byte(data))
var n int64
n, err = fsClient.Put(reader, int64(len(data)), "application/octet-stream", nil)
c.Assert(err, IsNil)
c.Assert(n, Equals, int64(len(data)))
}
// Test read a file.
func (s *MySuite) TestGet(c *C) {
root, e := ioutil.TempDir(os.TempDir(), "fs-")
c.Assert(e, IsNil)
defer os.RemoveAll(root)
objectPath := filepath.Join(root, "object")
fsClient, err := fs.New(objectPath)
c.Assert(err, IsNil)
data := "hello"
var reader io.Reader
reader = bytes.NewReader([]byte(data))
n, err := fsClient.Put(reader, int64(len(data)), "application/octet-stream", nil)
c.Assert(err, IsNil)
c.Assert(n, Equals, int64(len(data)))
reader, err = fsClient.Get()
c.Assert(err, IsNil)
var results bytes.Buffer
_, e = io.Copy(&results, reader)
c.Assert(e, IsNil)
c.Assert([]byte(data), DeepEquals, results.Bytes())
}
// Test get range in a file.
func (s *MySuite) TestGetRange(c *C) {
root, e := ioutil.TempDir(os.TempDir(), "fs-")
c.Assert(e, IsNil)
defer os.RemoveAll(root)
objectPath := filepath.Join(root, "object")
fsClient, err := fs.New(objectPath)
c.Assert(err, IsNil)
data := "hello world"
var reader io.Reader
reader = bytes.NewReader([]byte(data))
n, err := fsClient.Put(reader, int64(len(data)), "application/octet-stream", nil)
c.Assert(err, IsNil)
c.Assert(n, Equals, int64(len(data)))
reader, err = fsClient.Get()
c.Assert(err, IsNil)
var results bytes.Buffer
buf := make([]byte, 5)
m, e := reader.(io.ReaderAt).ReadAt(buf, 0)
c.Assert(e, IsNil)
c.Assert(m, Equals, 5)
_, e = results.Write(buf)
c.Assert(e, IsNil)
c.Assert([]byte("hello"), DeepEquals, results.Bytes())
}
// Test stat file.
func (s *MySuite) TestStatObject(c *C) {
root, e := ioutil.TempDir(os.TempDir(), "fs-")
c.Assert(e, IsNil)
defer os.RemoveAll(root)
objectPath := filepath.Join(root, "object")
fsClient, err := fs.New(objectPath)
c.Assert(err, IsNil)
data := "hello"
dataLen := len(data)
reader := bytes.NewReader([]byte(data))
n, err := fsClient.Put(reader, int64(dataLen), "application/octet-stream", nil)
c.Assert(err, IsNil)
c.Assert(n, Equals, int64(len(data)))
content, err := fsClient.Stat()
c.Assert(err, IsNil)
c.Assert(content.Size, Equals, int64(dataLen))
}
+23
View File
@@ -0,0 +1,23 @@
// +build !windows
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this fs except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fs
func normalizePath(path string) string {
return path
}
+35
View File
@@ -0,0 +1,35 @@
// +build windows
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this fs except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package fs
import (
"path/filepath"
"syscall"
)
func normalizePath(path string) string {
if filepath.VolumeName(path) == "" && filepath.HasPrefix(path, "\\") {
var err error
path, err = syscall.FullPath(path)
if err != nil {
panic(err)
}
}
return path
}
+725
View File
@@ -0,0 +1,725 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package s3
import (
"errors"
"hash/fnv"
"io"
"net/http"
"os"
"path/filepath"
"regexp"
"strings"
"sync"
"time"
"github.com/minio/mc/pkg/client"
"github.com/minio/mc/pkg/httptracer"
"github.com/minio/minio-go"
"github.com/minio/minio-xl/pkg/probe"
)
// S3 client
type s3Client struct {
mutex *sync.Mutex
targetURL *client.URL
api minio.CloudStorageClient
virtualStyle bool
}
// newFactory encloses New function with client cache.
func newFactory() func(config *client.Config) (client.Client, *probe.Error) {
clientCache := make(map[uint32]minio.CloudStorageClient)
mutex := &sync.Mutex{}
// Return New function.
return func(config *client.Config) (client.Client, *probe.Error) {
// Creates a parsed URL.
targetURL := client.NewURL(config.HostURL)
// By default enable HTTPs.
inSecure := false
if targetURL.Scheme == "http" {
inSecure = true
}
// Instantiate s3 client.
s3Clnt := &s3Client{}
// Allocate a new mutex.
s3Clnt.mutex = new(sync.Mutex)
// Save the target URL.
s3Clnt.targetURL = targetURL
// Save if target supports virtual host style.
hostName := targetURL.Host
s3Clnt.virtualStyle = isVirtualHostStyle(hostName)
if s3Clnt.virtualStyle {
// If Amazon URL replace it with 's3.amazonaws.com'
if isAmazon(hostName) {
hostName = "s3.amazonaws.com"
}
// If Google URL replace it with 'storage.googleapis.com'
if isGoogle(hostName) {
hostName = "storage.googleapis.com"
}
}
// Generate a hash out of s3Conf.
confHash := fnv.New32a()
confHash.Write([]byte(hostName + config.AccessKey + config.SecretKey))
confSum := confHash.Sum32()
// Lookup previous cache by hash.
mutex.Lock()
defer mutex.Unlock()
var api minio.CloudStorageClient
found := false
if api, found = clientCache[confSum]; !found {
// Not found. Instantiate a new minio client.
var e error
if config.Signature == "S3v2" {
// if Signature version '2' use NewV2 directly.
api, e = minio.NewV2(hostName, config.AccessKey, config.SecretKey, inSecure)
} else {
// if Signature version '4' use NewV4 directly.
api, e = minio.NewV4(hostName, config.AccessKey, config.SecretKey, inSecure)
}
if e != nil {
return nil, probe.NewError(e)
}
// Cache the new minio client with hash of config as key.
clientCache[confSum] = api
}
// Set app info.
api.SetAppInfo(config.AppName, config.AppVersion)
if config.Debug {
transport := http.DefaultTransport
if config.Signature == "S3v4" {
transport = httptracer.GetNewTraceTransport(NewTraceV4(), http.DefaultTransport)
}
if config.Signature == "S3v2" {
transport = httptracer.GetNewTraceTransport(NewTraceV2(), http.DefaultTransport)
}
// Set custom transport.
api.SetCustomTransport(transport)
}
// Store the new api object.
s3Clnt.api = api
return s3Clnt, nil
}
}
// New returns an initialized s3Client structure. If debug is enabled,
// it also enables an internal trace transport.
var New = newFactory()
// GetURL get url.
func (c *s3Client) GetURL() client.URL {
return *c.targetURL
}
// Get - get object.
func (c *s3Client) Get() (io.Reader, *probe.Error) {
bucket, object := c.url2BucketAndObject()
reader, e := c.api.GetObject(bucket, object)
if e != nil {
errResponse := minio.ToErrorResponse(e)
if errResponse.Code == "AccessDenied" {
return nil, probe.NewError(client.PathInsufficientPermission{Path: c.targetURL.String()})
}
return nil, probe.NewError(e)
}
return reader, nil
}
// Put - put object.
func (c *s3Client) Put(reader io.Reader, size int64, contentType string, progress io.Reader) (int64, *probe.Error) {
// md5 is purposefully ignored since AmazonS3 does not return proper md5sum
// for a multipart upload and there is no need to cross verify,
// invidual parts are properly verified fully in transit and also upon completion
// of the multipart request.
bucket, object := c.url2BucketAndObject()
if contentType == "" {
contentType = "application/octet-stream"
}
n, e := c.api.PutObjectWithProgress(bucket, object, reader, contentType, progress)
if e != nil {
errResponse := minio.ToErrorResponse(e)
if errResponse.Code == "UnexpectedEOF" || e == io.EOF {
return n, probe.NewError(client.UnexpectedEOF{
TotalSize: size,
TotalWritten: n,
})
}
if errResponse.Code == "AccessDenied" {
return n, probe.NewError(client.PathInsufficientPermission{
Path: c.targetURL.String(),
})
}
if errResponse.Code == "MethodNotAllowed" {
return n, probe.NewError(client.ObjectAlreadyExists{
Object: object,
})
}
if errResponse.Code == "NoSuchBucket" {
return n, probe.NewError(client.BucketDoesNotExist{
Bucket: bucket,
})
}
if errResponse.Code == "InvalidArgument" {
return n, probe.NewError(client.ObjectMissing{})
}
return n, probe.NewError(e)
}
return n, nil
}
// Remove - remove object or bucket.
func (c *s3Client) Remove(incomplete bool) *probe.Error {
bucket, object := c.url2BucketAndObject()
// Remove only incomplete object.
if incomplete && object != "" {
e := c.api.RemoveIncompleteUpload(bucket, object)
return probe.NewError(e)
}
var e error
if object == "" {
e = c.api.RemoveBucket(bucket)
} else {
e = c.api.RemoveObject(bucket, object)
}
return probe.NewError(e)
}
// We support '.' with bucket names but we fallback to using path
// style requests instead for such buckets
var validBucketName = regexp.MustCompile(`^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$`)
// isValidBucketName - verify bucket name in accordance with
// - http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html
func isValidBucketName(bucketName string) *probe.Error {
if strings.TrimSpace(bucketName) == "" {
return probe.NewError(errors.New("Bucket name cannot be empty."))
}
if len(bucketName) < 3 || len(bucketName) > 63 {
return probe.NewError(errors.New("Bucket name should be more than 3 characters and less than 64 characters"))
}
if !validBucketName.MatchString(bucketName) {
return probe.NewError(errors.New("Bucket name can contain alphabet, '-' and numbers, but first character should be an alphabet or number"))
}
return nil
}
// MakeBucket - make a new bucket.
func (c *s3Client) MakeBucket(region string) *probe.Error {
bucket, object := c.url2BucketAndObject()
if object != "" {
return probe.NewError(client.BucketNameTopLevel{})
}
if err := isValidBucketName(bucket); err != nil {
return err.Trace(bucket)
}
e := c.api.MakeBucket(bucket, minio.BucketACL("private"), region)
if e != nil {
return probe.NewError(e)
}
return nil
}
// GetBucketAccess get acl on a bucket.
func (c *s3Client) GetBucketAccess() (acl string, err *probe.Error) {
bucket, object := c.url2BucketAndObject()
if object != "" {
return "", probe.NewError(client.InvalidBucketName{Bucket: filepath.Join(bucket, object)})
}
if bucket == "" {
return "", probe.NewError(client.BucketNameEmpty{})
}
bucketACL, e := c.api.GetBucketACL(bucket)
if e != nil {
return "", probe.NewError(e)
}
return bucketACL.String(), nil
}
// SetBucketAccess set acl on a bucket
func (c *s3Client) SetBucketAccess(acl string) *probe.Error {
bucket, object := c.url2BucketAndObject()
if object != "" {
return probe.NewError(client.InvalidBucketName{Bucket: filepath.Join(bucket, object)})
}
if bucket == "" {
return probe.NewError(client.BucketNameEmpty{})
}
e := c.api.SetBucketACL(bucket, minio.BucketACL(acl))
if e != nil {
return probe.NewError(e)
}
return nil
}
// Stat - send a 'HEAD' on a bucket or object to fetch its metadata.
func (c *s3Client) Stat() (*client.Content, *probe.Error) {
c.mutex.Lock()
objectMetadata := new(client.Content)
bucket, object := c.url2BucketAndObject()
switch {
// valid case for 'ls -r s3/'
case bucket == "" && object == "":
_, e := c.api.ListBuckets()
if e != nil {
c.mutex.Unlock()
return nil, probe.NewError(e)
}
c.mutex.Unlock()
return &client.Content{URL: *c.targetURL, Type: os.ModeDir}, nil
}
if object != "" {
metadata, e := c.api.StatObject(bucket, object)
if e != nil {
c.mutex.Unlock()
errResponse := minio.ToErrorResponse(e)
if errResponse.Code == "NoSuchKey" {
// Append "/" to the object name proactively and see if the Listing
// produces an output. If yes, then we treat it as a directory.
prefixName := object
// Trim any trailing separators and add it.
prefixName = strings.TrimSuffix(prefixName, string(c.targetURL.Separator)) + string(c.targetURL.Separator)
isRecursive := false
for objectStat := range c.api.ListObjects(bucket, prefixName, isRecursive, nil) {
if objectStat.Err != nil {
return nil, probe.NewError(objectStat.Err)
}
content := client.Content{}
content.URL = *c.targetURL
content.Type = os.ModeDir
return &content, nil
}
return nil, probe.NewError(client.PathNotFound{Path: c.targetURL.Path})
}
return nil, probe.NewError(e)
}
objectMetadata.URL = *c.targetURL
objectMetadata.Time = metadata.LastModified
objectMetadata.Size = metadata.Size
objectMetadata.Type = os.FileMode(0664)
c.mutex.Unlock()
return objectMetadata, nil
}
e := c.api.BucketExists(bucket)
if e != nil {
c.mutex.Unlock()
return nil, probe.NewError(e)
}
bucketMetadata := new(client.Content)
bucketMetadata.URL = *c.targetURL
bucketMetadata.Type = os.ModeDir
c.mutex.Unlock()
return bucketMetadata, nil
}
func isAmazon(host string) bool {
matchAmazon, _ := filepath.Match("*.s3*.amazonaws.com", host)
return matchAmazon
}
func isGoogle(host string) bool {
matchGoogle, _ := filepath.Match("*.storage.googleapis.com", host)
return matchGoogle
}
// Figure out if the URL is of 'virtual host' style.
// Currently only supported hosts with virtual style are Amazon S3 and Google Cloud Storage.
func isVirtualHostStyle(host string) bool {
return isAmazon(host) || isGoogle(host)
}
// url2BucketAndObject gives bucketName and objectName from URL path.
func (c *s3Client) url2BucketAndObject() (bucketName, objectName string) {
path := c.targetURL.Path
// Convert any virtual host styled requests.
//
// For the time being this check is introduced for S3,
// If you have custom virtual styled hosts please.
// List them below.
if c.virtualStyle {
var bucket string
hostIndex := strings.Index(c.targetURL.Host, "s3")
if hostIndex == -1 {
hostIndex = strings.Index(c.targetURL.Host, "storage.googleapis")
}
if hostIndex > 0 {
bucket = c.targetURL.Host[:hostIndex-1]
path = string(c.targetURL.Separator) + bucket + c.targetURL.Path
}
}
splits := strings.SplitN(path, string(c.targetURL.Separator), 3)
switch len(splits) {
case 0, 1:
bucketName = ""
objectName = ""
case 2:
bucketName = splits[1]
objectName = ""
case 3:
bucketName = splits[1]
objectName = splits[2]
}
return bucketName, objectName
}
/// Bucket API operations.
// List - list at delimited path, if not recursive.
func (c *s3Client) List(recursive, incomplete bool) <-chan *client.Content {
c.mutex.Lock()
defer c.mutex.Unlock()
contentCh := make(chan *client.Content)
if incomplete {
if recursive {
go c.listIncompleteRecursiveInRoutine(contentCh)
} else {
go c.listIncompleteInRoutine(contentCh)
}
} else {
if recursive {
go c.listRecursiveInRoutine(contentCh)
} else {
go c.listInRoutine(contentCh)
}
}
return contentCh
}
func (c *s3Client) listIncompleteInRoutine(contentCh chan *client.Content) {
defer close(contentCh)
// get bucket and object from URL.
b, o := c.url2BucketAndObject()
switch {
case b == "" && o == "":
buckets, err := c.api.ListBuckets()
if err != nil {
contentCh <- &client.Content{
Err: probe.NewError(err),
}
return
}
isRecursive := false
for _, bucket := range buckets {
for object := range c.api.ListIncompleteUploads(bucket.Name, o, isRecursive, nil) {
if object.Err != nil {
contentCh <- &client.Content{
Err: probe.NewError(object.Err),
}
return
}
content := new(client.Content)
url := *c.targetURL
// Join bucket with - incoming object key.
url.Path = filepath.Join(string(url.Separator), bucket.Name, object.Key)
if c.virtualStyle {
url.Path = filepath.Join(string(url.Separator), object.Key)
}
switch {
case strings.HasSuffix(object.Key, string(c.targetURL.Separator)):
// We need to keep the trailing Separator, do not use filepath.Join().
content.URL = url
content.Time = time.Now()
content.Type = os.ModeDir
default:
content.URL = url
content.Size = object.Size
content.Time = object.Initiated
content.Type = os.ModeTemporary
}
contentCh <- content
}
}
default:
isRecursive := false
for object := range c.api.ListIncompleteUploads(b, o, isRecursive, nil) {
if object.Err != nil {
contentCh <- &client.Content{
Err: probe.NewError(object.Err),
}
return
}
content := new(client.Content)
url := *c.targetURL
// Join bucket with - incoming object key.
url.Path = filepath.Join(string(url.Separator), b, object.Key)
if c.virtualStyle {
url.Path = filepath.Join(string(url.Separator), object.Key)
}
switch {
case strings.HasSuffix(object.Key, string(c.targetURL.Separator)):
// We need to keep the trailing Separator, do not use filepath.Join().
content.URL = url
content.Time = time.Now()
content.Type = os.ModeDir
default:
content.URL = url
content.Size = object.Size
content.Time = object.Initiated
content.Type = os.ModeTemporary
}
contentCh <- content
}
}
}
func (c *s3Client) listIncompleteRecursiveInRoutine(contentCh chan *client.Content) {
defer close(contentCh)
// get bucket and object from URL.
b, o := c.url2BucketAndObject()
switch {
case b == "" && o == "":
buckets, err := c.api.ListBuckets()
if err != nil {
contentCh <- &client.Content{
Err: probe.NewError(err),
}
return
}
isRecursive := true
for _, bucket := range buckets {
for object := range c.api.ListIncompleteUploads(bucket.Name, o, isRecursive, nil) {
if object.Err != nil {
contentCh <- &client.Content{
Err: probe.NewError(object.Err),
}
return
}
url := *c.targetURL
url.Path = filepath.Join(url.Path, bucket.Name, object.Key)
content := new(client.Content)
content.URL = url
content.Size = object.Size
content.Time = object.Initiated
content.Type = os.ModeTemporary
contentCh <- content
}
}
default:
isRecursive := true
for object := range c.api.ListIncompleteUploads(b, o, isRecursive, nil) {
if object.Err != nil {
contentCh <- &client.Content{
Err: probe.NewError(object.Err),
}
return
}
url := *c.targetURL
// Join bucket and incoming object key.
url.Path = filepath.Join(string(url.Separator), b, object.Key)
if c.virtualStyle {
url.Path = filepath.Join(string(url.Separator), object.Key)
}
content := new(client.Content)
content.URL = url
content.Size = object.Size
content.Time = object.Initiated
content.Type = os.ModeTemporary
contentCh <- content
}
}
}
func (c *s3Client) listInRoutine(contentCh chan *client.Content) {
defer close(contentCh)
// get bucket and object from URL.
b, o := c.url2BucketAndObject()
switch {
case b == "" && o == "":
buckets, err := c.api.ListBuckets()
if err != nil {
contentCh <- &client.Content{
Err: probe.NewError(err),
}
return
}
for _, bucket := range buckets {
url := *c.targetURL
url.Path = filepath.Join(url.Path, bucket.Name)
content := new(client.Content)
content.URL = url
content.Size = 0
content.Time = bucket.CreationDate
content.Type = os.ModeDir
contentCh <- content
}
case b != "" && !strings.HasSuffix(c.targetURL.Path, string(c.targetURL.Separator)) && o == "":
e := c.api.BucketExists(b)
if e != nil {
contentCh <- &client.Content{
Err: probe.NewError(e),
}
}
content := new(client.Content)
content.URL = *c.targetURL
content.Type = os.ModeDir
contentCh <- content
default:
metadata, e := c.api.StatObject(b, o)
switch e.(type) {
case nil:
content := new(client.Content)
content.URL = *c.targetURL
content.Time = metadata.LastModified
content.Size = metadata.Size
content.Type = os.FileMode(0664)
contentCh <- content
default:
isRecursive := false
for object := range c.api.ListObjects(b, o, isRecursive, nil) {
if object.Err != nil {
contentCh <- &client.Content{
Err: probe.NewError(object.Err),
}
return
}
content := new(client.Content)
url := *c.targetURL
// Join bucket and incoming object key.
url.Path = filepath.Join(string(url.Separator), b, object.Key)
if c.virtualStyle {
url.Path = filepath.Join(string(url.Separator), object.Key)
}
switch {
case strings.HasSuffix(object.Key, string(c.targetURL.Separator)):
// We need to keep the trailing Separator, do not use filepath.Join().
content.URL = url
content.Time = time.Now()
content.Type = os.ModeDir
default:
content.URL = url
content.Size = object.Size
content.Time = object.LastModified
content.Type = os.FileMode(0664)
}
contentCh <- content
}
}
}
}
func (c *s3Client) listRecursiveInRoutine(contentCh chan *client.Content) {
defer close(contentCh)
// get bucket and object from URL.
b, o := c.url2BucketAndObject()
switch {
case b == "" && o == "":
buckets, err := c.api.ListBuckets()
if err != nil {
contentCh <- &client.Content{
Err: probe.NewError(err),
}
return
}
for _, bucket := range buckets {
bucketURL := *c.targetURL
bucketURL.Path = filepath.Join(bucketURL.Path, bucket.Name)
contentCh <- &client.Content{
URL: bucketURL,
Type: os.ModeDir,
Time: bucket.CreationDate,
}
isRecursive := true
for object := range c.api.ListObjects(bucket.Name, o, isRecursive, nil) {
if object.Err != nil {
contentCh <- &client.Content{
Err: probe.NewError(object.Err),
}
continue
}
content := new(client.Content)
objectURL := *c.targetURL
objectURL.Path = filepath.Join(objectURL.Path, bucket.Name, object.Key)
content.URL = objectURL
content.Size = object.Size
content.Time = object.LastModified
content.Type = os.FileMode(0664)
contentCh <- content
}
}
default:
isRecursive := true
for object := range c.api.ListObjects(b, o, isRecursive, nil) {
if object.Err != nil {
contentCh <- &client.Content{
Err: probe.NewError(object.Err),
}
continue
}
content := new(client.Content)
url := *c.targetURL
// Join bucket and incoming object key.
url.Path = filepath.Join(string(url.Separator), b, object.Key)
// If virtualStyle replace the url.Path back.
if c.virtualStyle {
url.Path = filepath.Join(string(url.Separator), object.Key)
}
content.URL = url
content.Size = object.Size
content.Time = object.LastModified
content.Type = os.FileMode(0664)
contentCh <- content
}
}
}
// ShareDownload - get a usable presigned object url to share.
func (c *s3Client) ShareDownload(expires time.Duration) (string, *probe.Error) {
bucket, object := c.url2BucketAndObject()
presignedURL, e := c.api.PresignedGetObject(bucket, object, expires)
if e != nil {
return "", probe.NewError(e)
}
return presignedURL, nil
}
// ShareUpload - get data for presigned post http form upload.
func (c *s3Client) ShareUpload(isRecursive bool, expires time.Duration, contentType string) (map[string]string, *probe.Error) {
bucket, object := c.url2BucketAndObject()
p := minio.NewPostPolicy()
if e := p.SetExpires(time.Now().UTC().Add(expires)); e != nil {
return nil, probe.NewError(e)
}
if strings.TrimSpace(contentType) != "" || contentType != "" {
// No need to verify for error here, since we have stripped out spaces.
p.SetContentType(contentType)
}
if e := p.SetBucket(bucket); e != nil {
return nil, probe.NewError(e)
}
if isRecursive {
if e := p.SetKeyStartsWith(object); e != nil {
return nil, probe.NewError(e)
}
} else {
if e := p.SetKey(object); e != nil {
return nil, probe.NewError(e)
}
}
m, e := c.api.PresignedPostPolicy(p)
return m, probe.NewError(e)
}
+262
View File
@@ -0,0 +1,262 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package s3
// bucketHandler is an http.Handler that verifies bucket responses and validates incoming requests
import (
"bytes"
"io"
"net/http"
"net/http/httptest"
"strconv"
"testing"
"time"
"github.com/minio/mc/pkg/client"
. "gopkg.in/check.v1"
)
type bucketHandler struct {
resource string
}
func (h bucketHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
switch {
case r.Method == "GET":
// Handler for incoming getBucketLocation request.
if _, ok := r.URL.Query()["location"]; ok {
response := []byte("<LocationConstraint xmlns=\"http://doc.s3.amazonaws.com/2006-03-01\"></LocationConstraint>")
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
w.Write(response)
return
}
switch {
case r.URL.Path == "/":
// Handler for incoming ListBuckets request.
response := []byte("<ListAllMyBucketsResult xmlns=\"http://doc.s3.amazonaws.com/2006-03-01\"><Buckets><Bucket><Name>bucket</Name><CreationDate>2015-05-20T23:05:09.230Z</CreationDate></Bucket></Buckets><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner></ListAllMyBucketsResult>")
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
w.Write(response)
case r.URL.Path == "/bucket/":
// Handler for incoming ListObjects request.
response := []byte("<ListBucketResult xmlns=\"http://doc.s3.amazonaws.com/2006-03-01\"><Contents><ETag>259d04a13802ae09c7e41be50ccc6baa</ETag><Key>object</Key><LastModified>2015-05-21T18:24:21.097Z</LastModified><Size>22061</Size><Owner><ID>minio</ID><DisplayName>minio</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Delimiter></Delimiter><EncodingType></EncodingType><IsTruncated>false</IsTruncated><Marker></Marker><MaxKeys>1000</MaxKeys><Name>testbucket</Name><NextMarker></NextMarker><Prefix></Prefix></ListBucketResult>")
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
w.Write(response)
}
case r.Method == "PUT":
switch {
case r.URL.Path == h.resource:
// Handler for incoming SetBucketACL request.
_, ok := r.URL.Query()["acl"]
if ok {
if r.Header.Get("x-amz-acl") != "public-read-write" {
w.WriteHeader(http.StatusNotImplemented)
}
}
w.WriteHeader(http.StatusOK)
default:
w.WriteHeader(http.StatusBadRequest)
}
case r.Method == "HEAD":
switch {
case r.URL.Path == h.resource:
w.WriteHeader(http.StatusOK)
default:
w.WriteHeader(http.StatusForbidden)
}
}
}
// objectHandler is an http.Handler that verifies object responses and validates incoming requests
type objectHandler struct {
resource string
data []byte
}
func (h objectHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
switch {
case r.Method == "PUT":
// Handler for PUT object request.
length, e := strconv.Atoi(r.Header.Get("Content-Length"))
if e != nil {
w.WriteHeader(http.StatusBadRequest)
return
}
var buffer bytes.Buffer
if _, e = io.CopyN(&buffer, r.Body, int64(length)); e != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
if !bytes.Equal(h.data, buffer.Bytes()) {
w.WriteHeader(http.StatusInternalServerError)
return
}
w.Header().Set("ETag", "9af2f8218b150c351ad802c6f3d66abe")
w.WriteHeader(http.StatusOK)
case r.Method == "HEAD":
// Handler for Stat object request.
if r.URL.Path != h.resource {
w.WriteHeader(http.StatusNotFound)
return
}
w.Header().Set("Content-Length", strconv.Itoa(len(h.data)))
w.Header().Set("Last-Modified", time.Now().UTC().Format(http.TimeFormat))
w.Header().Set("ETag", "9af2f8218b150c351ad802c6f3d66abe")
w.WriteHeader(http.StatusOK)
case r.Method == "POST":
// Handler for multipart upload request.
if _, ok := r.URL.Query()["uploads"]; ok {
if r.URL.Path == h.resource {
response := []byte("<InitiateMultipartUploadResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Bucket>bucket</Bucket><Key>object</Key><UploadId>EXAMPLEJZ6e0YupT2h66iePQCc9IEbYbDUy4RTpMeoSMLPRp8Z5o1u8feSRonpvnWsKKG35tI2LB9VDPiCgTy.Gq2VxQLYjrue4Nq.NBdqI-</UploadId></InitiateMultipartUploadResult>")
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
w.Write(response)
return
}
}
if _, ok := r.URL.Query()["uploadId"]; ok {
if r.URL.Path == h.resource {
response := []byte("<CompleteMultipartUploadResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Location>http://bucket.s3.amazonaws.com/object</Location><Bucket>bucket</Bucket><Key>object</Key><ETag>\"3858f62230ac3c915f300c664312c11f-9\"</ETag></CompleteMultipartUploadResult>")
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
w.Write(response)
return
}
}
if r.URL.Path != h.resource {
w.WriteHeader(http.StatusNotFound)
return
}
case r.Method == "GET":
// Handler for get bucket location request.
if _, ok := r.URL.Query()["location"]; ok {
response := []byte("<LocationConstraint xmlns=\"http://doc.s3.amazonaws.com/2006-03-01\"></LocationConstraint>")
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
w.Write(response)
return
}
// Handler for list multipart upload request.
if _, ok := r.URL.Query()["uploads"]; ok {
if r.URL.Path == "/bucket/" {
response := []byte("<ListMultipartUploadsResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Bucket>bucket</Bucket><KeyMarker/><UploadIdMarker/><NextKeyMarker/><NextUploadIdMarker/><EncodingType/><MaxUploads>1000</MaxUploads><IsTruncated>false</IsTruncated><Prefix/><Delimiter/></ListMultipartUploadsResult>")
w.Header().Set("Content-Length", strconv.Itoa(len(response)))
w.Write(response)
return
}
}
if r.URL.Path != h.resource {
w.WriteHeader(http.StatusNotFound)
return
}
w.Header().Set("Content-Length", strconv.Itoa(len(h.data)))
w.Header().Set("Last-Modified", time.Now().UTC().Format(http.TimeFormat))
w.Header().Set("ETag", "9af2f8218b150c351ad802c6f3d66abe")
w.WriteHeader(http.StatusOK)
io.Copy(w, bytes.NewReader(h.data))
}
}
func Test(t *testing.T) { TestingT(t) }
type MySuite struct{}
var _ = Suite(&MySuite{})
// Test bucket operations.
func (s *MySuite) TestBucketOperations(c *C) {
bucket := bucketHandler(bucketHandler{
resource: "/bucket/",
})
server := httptest.NewServer(bucket)
defer server.Close()
conf := new(client.Config)
conf.HostURL = server.URL + bucket.resource
conf.AccessKey = "WLGDGYAQYIGI833EV05A"
conf.SecretKey = "BYvgJM101sHngl2uzjXS/OBF/aMxAN06JrJ3qJlF"
conf.Signature = "S3v4"
s3c, err := New(conf)
c.Assert(err, IsNil)
err = s3c.MakeBucket("us-east-1")
c.Assert(err, IsNil)
err = s3c.SetBucketAccess("public-read-write")
c.Assert(err, IsNil)
conf.HostURL = server.URL + string(s3c.GetURL().Separator)
s3c, err = New(conf)
c.Assert(err, IsNil)
for content := range s3c.List(false, false) {
c.Assert(content.Err, IsNil)
c.Assert(content.Type.IsDir(), Equals, true)
}
conf.HostURL = server.URL + "/bucket"
s3c, err = New(conf)
c.Assert(err, IsNil)
for content := range s3c.List(false, false) {
c.Assert(content.Err, IsNil)
c.Assert(content.Type.IsDir(), Equals, true)
}
conf.HostURL = server.URL + "/bucket/"
s3c, err = New(conf)
c.Assert(err, IsNil)
for content := range s3c.List(false, false) {
c.Assert(content.Err, IsNil)
c.Assert(content.Type.IsRegular(), Equals, true)
}
}
// Test all object operations.
func (s *MySuite) TestObjectOperations(c *C) {
object := objectHandler(objectHandler{
resource: "/bucket/object",
data: []byte("Hello, World"),
})
server := httptest.NewServer(object)
defer server.Close()
conf := new(client.Config)
conf.HostURL = server.URL + object.resource
conf.AccessKey = "WLGDGYAQYIGI833EV05A"
conf.SecretKey = "BYvgJM101sHngl2uzjXS/OBF/aMxAN06JrJ3qJlF"
conf.Signature = "S3v4"
s3c, err := New(conf)
c.Assert(err, IsNil)
var reader io.Reader
reader = bytes.NewReader(object.data)
n, err := s3c.Put(reader, int64(len(object.data)), "application/octet-stream", nil)
c.Assert(err, IsNil)
c.Assert(n, Equals, int64(len(object.data)))
content, err := s3c.Stat()
c.Assert(err, IsNil)
c.Assert(content.Size, Equals, int64(len(object.data)))
c.Assert(content.Type.IsRegular(), Equals, true)
reader, err = s3c.Get()
var buffer bytes.Buffer
{
_, err := io.Copy(&buffer, reader)
c.Assert(err, IsNil)
c.Assert(buffer.Bytes(), DeepEquals, object.data)
}
}
+75
View File
@@ -0,0 +1,75 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package s3
import (
"net/http"
"net/http/httputil"
"strings"
"github.com/minio/mc/pkg/console"
"github.com/minio/mc/pkg/httptracer"
)
// TraceV2 - tracing structure
type TraceV2 struct{}
// NewTraceV2 - initialize Trace structure
func NewTraceV2() httptracer.HTTPTracer {
return TraceV2{}
}
// Request - Trace HTTP Request
func (t TraceV2) Request(req *http.Request) (err error) {
origAuth := req.Header.Get("Authorization")
if strings.TrimSpace(origAuth) != "" {
// Authorization (S3 v2 signature) Format:
// Authorization: AWS AKIAJVA5BMMU2RHO6IO1:Y10YHUZ0DTUterAUI6w3XKX7Iqk=
// Set a temporary redacted auth
req.Header.Set("Authorization", "AWS **REDACTED**:**REDACTED**")
var reqTrace []byte
reqTrace, err = httputil.DumpRequestOut(req, false) // Only display header
if err == nil {
console.Debug(string(reqTrace))
}
// Undo
req.Header.Set("Authorization", origAuth)
}
return err
}
// Response - Trace HTTP Response
func (t TraceV2) Response(res *http.Response) (err error) {
var resTrace []byte
// For errors we make sure to dump response body as well.
if res.StatusCode != http.StatusOK &&
res.StatusCode != http.StatusPartialContent &&
res.StatusCode != http.StatusNoContent {
resTrace, err = httputil.DumpResponse(res, true)
} else {
// Only display header
resTrace, err = httputil.DumpResponse(res, false)
}
if err == nil {
console.Debug(string(resTrace))
}
return err
}
+84
View File
@@ -0,0 +1,84 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package s3
import (
"net/http"
"net/http/httputil"
"regexp"
"strings"
"github.com/minio/mc/pkg/console"
"github.com/minio/mc/pkg/httptracer"
)
// TraceV4 - tracing structure
type TraceV4 struct{}
// NewTraceV4 - initialize Trace structure
func NewTraceV4() httptracer.HTTPTracer {
return TraceV4{}
}
// Request - Trace HTTP Request
func (t TraceV4) Request(req *http.Request) (err error) {
origAuth := req.Header.Get("Authorization")
if strings.TrimSpace(origAuth) != "" {
// Authorization (S3 v4 signature) Format:
// Authorization: AWS4-HMAC-SHA256 Credential=AKIAJNACEGBGMXBHLEZA/20150524/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=bbfaa693c626021bcb5f911cd898a1a30206c1fad6bad1e0eb89e282173bd24c
// Strip out accessKeyID from: Credential=<access-key-id>/<date>/<aws-region>/<aws-service>/aws4_request
regCred := regexp.MustCompile("Credential=([A-Z0-9]+)/")
newAuth := regCred.ReplaceAllString(origAuth, "Credential=**REDACTED**/")
// Strip out 256-bit signature from: Signature=<256-bit signature>
regSign := regexp.MustCompile("Signature=([[0-9a-f]+)")
newAuth = regSign.ReplaceAllString(newAuth, "Signature=**REDACTED**")
// Set a temporary redacted auth
req.Header.Set("Authorization", newAuth)
var reqTrace []byte
reqTrace, err = httputil.DumpRequestOut(req, false) // Only display header
if err == nil {
console.Debug(string(reqTrace))
}
// Undo
req.Header.Set("Authorization", origAuth)
}
return err
}
// Response - Trace HTTP Response
func (t TraceV4) Response(res *http.Response) (err error) {
var resTrace []byte
// For errors we make sure to dump response body as well.
if res.StatusCode != http.StatusOK &&
res.StatusCode != http.StatusPartialContent &&
res.StatusCode != http.StatusNoContent {
resTrace, err = httputil.DumpResponse(res, true)
} else {
// Only display header
resTrace, err = httputil.DumpResponse(res, false)
}
if err == nil {
console.Debug(string(resTrace))
}
return err
}
+162
View File
@@ -0,0 +1,162 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package client
import (
"bytes"
"path/filepath"
"regexp"
"runtime"
"strings"
)
// URL client url structure
type URL struct {
Type URLType
Scheme string
Host string
Path string
SchemeSeparator string
Separator rune
}
// URLType - enum of different url types
type URLType int
// enum types
const (
Object = iota // Minio and S3 compatible cloud storage
Filesystem // POSIX compatible file systems
)
// Maybe rawurl is of the form scheme:path. (Scheme must be [a-zA-Z][a-zA-Z0-9+-.]*)
// If so, return scheme, path; else return "", rawurl.
func getScheme(rawurl string) (scheme, path string) {
urlSplits := strings.Split(rawurl, "://")
if len(urlSplits) == 2 {
scheme, uri := urlSplits[0], "//"+urlSplits[1]
// ignore numbers in scheme
validScheme := regexp.MustCompile("^[a-zA-Z]+$")
if uri != "" {
if validScheme.MatchString(scheme) {
return scheme, uri
}
}
}
return "", rawurl
}
// Assuming s is of the form [s delimiter s].
// If so, return s, [delimiter]s or return s, s if cutdelimiter == true
// If no delimiter found return s, "".
func splitSpecial(s string, delimiter string, cutdelimiter bool) (string, string) {
i := strings.Index(s, delimiter)
if i < 0 {
// if delimiter not found return as is.
return s, ""
}
// if delimiter should be removed, remove it.
if cutdelimiter {
return s[0:i], s[i+len(delimiter):]
}
// return split strings with delimiter
return s[0:i], s[i:]
}
// getHost - extract host from authority string, we do not support ftp style username@ yet.
func getHost(authority string) (host string) {
i := strings.LastIndex(authority, "@")
if i >= 0 {
// TODO support, username@password style userinfo, useful for ftp support.
return
}
return authority
}
// NewURL returns an abstracted URL for filesystems and object storage.
func NewURL(urlStr string) *URL {
scheme, rest := getScheme(urlStr)
rest, _ = splitSpecial(rest, "?", true)
if strings.HasPrefix(rest, "//") {
// if rest has '//' prefix, skip them
var authority string
authority, rest = splitSpecial(rest[2:], "/", false)
if rest == "" {
rest = "/"
}
host := getHost(authority)
if host != "" && (scheme == "http" || scheme == "https") {
return &URL{
Scheme: scheme,
Type: Object,
Host: host,
Path: rest,
SchemeSeparator: "://",
Separator: '/',
}
}
}
return &URL{
Type: Filesystem,
Path: rest,
Separator: filepath.Separator,
}
}
// JoinURLs join two input urls and returns a url
func JoinURLs(url1, url2 *URL) *URL {
var url1Path, url2Path string
url1Path = filepath.ToSlash(url1.Path)
url2Path = filepath.ToSlash(url2.Path)
if strings.HasSuffix(url1Path, "/") {
url1.Path = url1Path + strings.TrimPrefix(url2Path, "/")
} else {
url1.Path = url1Path + "/" + strings.TrimPrefix(url2Path, "/")
}
return url1
}
// String convert URL into its canonical form.
func (u URL) String() string {
var buf bytes.Buffer
// if fileystem no translation needed, return as is.
if u.Type == Filesystem {
return u.Path
}
// if Object convert from any non standard paths to a supported URL path style.
if u.Type == Object {
buf.WriteString(u.Scheme)
buf.WriteByte(':')
buf.WriteString("//")
if h := u.Host; h != "" {
buf.WriteString(h)
}
switch runtime.GOOS {
case "windows":
if u.Path != "" && u.Path[0] != '\\' && u.Host != "" && u.Path[0] != '/' {
buf.WriteByte('/')
}
buf.WriteString(strings.Replace(u.Path, "\\", "/", -1))
default:
if u.Path != "" && u.Path[0] != '/' && u.Host != "" {
buf.WriteByte('/')
}
buf.WriteString(u.Path)
}
}
return buf.String()
}
+355
View File
@@ -0,0 +1,355 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package console
import (
"fmt"
"os"
"sync"
"path/filepath"
"github.com/fatih/color"
"github.com/mattn/go-isatty"
"github.com/shiena/ansicolor"
)
var (
// DebugPrint enables/disables console debug printing.
DebugPrint = false
// Used by the caller to print multiple lines atomically. Exposed by Lock/Unlock methods.
publicMutex = &sync.Mutex{}
// Used internally by console.
privateMutex = &sync.Mutex{}
stderrColoredOutput = ansicolor.NewAnsiColorWriter(os.Stderr)
// Print prints a message.
Print = func(data ...interface{}) {
consolePrint("Print", Theme["Print"], data...)
return
}
// PrintC prints a message with color.
PrintC = func(data ...interface{}) {
consolePrint("PrintC", Theme["PrintC"], data...)
return
}
// Printf prints a formatted message.
Printf = func(format string, data ...interface{}) {
consolePrintf("Print", Theme["Print"], format, data...)
return
}
// Println prints a message with a newline.
Println = func(data ...interface{}) {
consolePrintln("Print", Theme["Print"], data...)
return
}
// Fatal print a error message and exit.
Fatal = func(data ...interface{}) {
consolePrint("Fatal", Theme["Fatal"], data...)
os.Exit(1)
return
}
// Fatalf print a error message with a format specified and exit.
Fatalf = func(format string, data ...interface{}) {
consolePrintf("Fatal", Theme["Fatal"], format, data...)
os.Exit(1)
return
}
// Fatalln print a error message with a new line and exit.
Fatalln = func(data ...interface{}) {
consolePrintln("Fatal", Theme["Fatal"], data...)
os.Exit(1)
return
}
// Error prints a error message.
Error = func(data ...interface{}) {
consolePrint("Error", Theme["Error"], data...)
return
}
// Errorf print a error message with a format specified.
Errorf = func(format string, data ...interface{}) {
consolePrintf("Error", Theme["Error"], format, data...)
return
}
// Errorln prints a error message with a new line.
Errorln = func(data ...interface{}) {
consolePrintln("Error", Theme["Error"], data...)
return
}
// Info prints a informational message.
Info = func(data ...interface{}) {
consolePrint("Info", Theme["Info"], data...)
return
}
// Infof prints a informational message in custom format.
Infof = func(format string, data ...interface{}) {
consolePrintf("Info", Theme["Info"], format, data...)
return
}
// Infoln prints a informational message with a new line.
Infoln = func(data ...interface{}) {
consolePrintln("Info", Theme["Info"], data...)
return
}
// Debug prints a debug message without a new line
// Debug prints a debug message.
Debug = func(data ...interface{}) {
if DebugPrint {
consolePrint("Debug", Theme["Debug"], data...)
}
}
// Debugf prints a debug message with a new line.
Debugf = func(format string, data ...interface{}) {
if DebugPrint {
consolePrintf("Debug", Theme["Debug"], format, data...)
}
}
// Debugln prints a debug message with a new line.
Debugln = func(data ...interface{}) {
if DebugPrint {
consolePrintln("Debug", Theme["Debug"], data...)
}
}
// Colorize prints message in a colorized form, dictated by the corresponding tag argument.
Colorize = func(tag string, data interface{}) string {
if isatty.IsTerminal(os.Stdout.Fd()) {
colorized, ok := Theme[tag]
if ok {
return colorized.SprintFunc()(data)
} // else: No theme found. Return as string.
}
return fmt.Sprint(data)
}
// Eraseline Print in new line and adjust to top so that we don't print over the ongoing progress bar.
Eraseline = func() {
consolePrintf("Print", Theme["Print"], "%c[2K\n", 27)
consolePrintf("Print", Theme["Print"], "%c[A", 27)
}
)
// wrap around standard fmt functions.
// consolePrint prints a message prefixed with message type and program name.
func consolePrint(tag string, c *color.Color, a ...interface{}) {
privateMutex.Lock()
defer privateMutex.Unlock()
switch tag {
case "Debug":
// if no arguments are given do not invoke debug printer.
if len(a) == 0 {
return
}
output := color.Output
color.Output = stderrColoredOutput
if isatty.IsTerminal(os.Stderr.Fd()) {
c.Print(ProgramName() + ": <DEBUG> ")
c.Print(a...)
} else {
fmt.Fprint(color.Output, ProgramName()+": <DEBUG> ")
fmt.Fprint(color.Output, a...)
}
color.Output = output
case "Fatal":
fallthrough
case "Error":
// if no arguments are given do not invoke fatal and error printer.
if len(a) == 0 {
return
}
output := color.Output
color.Output = stderrColoredOutput
if isatty.IsTerminal(os.Stderr.Fd()) {
c.Print(ProgramName() + ": <ERROR> ")
c.Print(a...)
} else {
fmt.Fprint(color.Output, ProgramName()+": <ERROR> ")
fmt.Fprint(color.Output, a...)
}
color.Output = output
case "Info":
// if no arguments are given do not invoke info printer.
if len(a) == 0 {
return
}
if isatty.IsTerminal(os.Stdout.Fd()) {
c.Print(ProgramName() + ": ")
c.Print(a...)
} else {
fmt.Fprint(color.Output, ProgramName()+": ")
fmt.Fprint(color.Output, a...)
}
default:
if isatty.IsTerminal(os.Stdout.Fd()) {
c.Print(a...)
} else {
fmt.Fprint(color.Output, a...)
}
}
}
// consolePrintf - same as print with a new line.
func consolePrintf(tag string, c *color.Color, format string, a ...interface{}) {
privateMutex.Lock()
defer privateMutex.Unlock()
switch tag {
case "Debug":
// if no arguments are given do not invoke debug printer.
if len(a) == 0 {
return
}
output := color.Output
color.Output = stderrColoredOutput
if isatty.IsTerminal(os.Stderr.Fd()) {
c.Print(ProgramName() + ": <DEBUG> ")
c.Printf(format, a...)
} else {
fmt.Fprint(color.Output, ProgramName()+": <DEBUG> ")
fmt.Fprintf(color.Output, format, a...)
}
color.Output = output
case "Fatal":
fallthrough
case "Error":
// if no arguments are given do not invoke fatal and error printer.
if len(a) == 0 {
return
}
output := color.Output
color.Output = stderrColoredOutput
if isatty.IsTerminal(os.Stderr.Fd()) {
c.Print(ProgramName() + ": <ERROR> ")
c.Printf(format, a...)
} else {
fmt.Fprint(color.Output, ProgramName()+": <ERROR> ")
fmt.Fprintf(color.Output, format, a...)
}
color.Output = output
case "Info":
// if no arguments are given do not invoke info printer.
if len(a) == 0 {
return
}
if isatty.IsTerminal(os.Stdout.Fd()) {
c.Print(ProgramName() + ": ")
c.Printf(format, a...)
} else {
fmt.Fprint(color.Output, ProgramName()+": ")
fmt.Fprintf(color.Output, format, a...)
}
default:
if isatty.IsTerminal(os.Stdout.Fd()) {
c.Printf(format, a...)
} else {
fmt.Fprintf(color.Output, format, a...)
}
}
}
// consolePrintln - same as print with a new line.
func consolePrintln(tag string, c *color.Color, a ...interface{}) {
privateMutex.Lock()
defer privateMutex.Unlock()
switch tag {
case "Debug":
// if no arguments are given do not invoke debug printer.
if len(a) == 0 {
return
}
output := color.Output
color.Output = stderrColoredOutput
if isatty.IsTerminal(os.Stderr.Fd()) {
c.Print(ProgramName() + ": <DEBUG> ")
c.Println(a...)
} else {
fmt.Fprint(color.Output, ProgramName()+": <DEBUG> ")
fmt.Fprintln(color.Output, a...)
}
color.Output = output
case "Fatal":
fallthrough
case "Error":
// if no arguments are given do not invoke fatal and error printer.
if len(a) == 0 {
return
}
output := color.Output
color.Output = stderrColoredOutput
if isatty.IsTerminal(os.Stderr.Fd()) {
c.Print(ProgramName() + ": <ERROR> ")
c.Println(a...)
} else {
fmt.Fprint(color.Output, ProgramName()+": <ERROR> ")
fmt.Fprintln(color.Output, a...)
}
color.Output = output
case "Info":
// if no arguments are given do not invoke info printer.
if len(a) == 0 {
return
}
if isatty.IsTerminal(os.Stdout.Fd()) {
c.Print(ProgramName() + ": ")
c.Println(a...)
} else {
fmt.Fprint(color.Output, ProgramName()+": ")
fmt.Fprintln(color.Output, a...)
}
default:
if isatty.IsTerminal(os.Stdout.Fd()) {
c.Println(a...)
} else {
fmt.Fprintln(color.Output, a...)
}
}
}
// Lock console.
func Lock() {
publicMutex.Lock()
}
// Unlock locked console.
func Unlock() {
publicMutex.Unlock()
}
// ProgramName - return the name of the executable program.
func ProgramName() string {
_, progName := filepath.Split(os.Args[0])
return progName
}
+42
View File
@@ -0,0 +1,42 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package console
import (
"testing"
"github.com/fatih/color"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }
type MySuite struct{}
var _ = Suite(&MySuite{})
func (s *MySuite) TestSetColor(c *C) {
SetColor("unknown", color.New(color.FgWhite))
_, ok := Theme["unknown"]
c.Assert(ok, Equals, true)
}
func (s *MySuite) TestLock(c *C) {
Lock()
Print("") // Test for deadlocks.
Unlock()
}
+53
View File
@@ -0,0 +1,53 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package console
import "github.com/fatih/color"
var (
// Theme contains default color mapping.
Theme = map[string]*color.Color{
"Debug": color.New(color.FgWhite, color.Faint, color.Italic),
"Fatal": color.New(color.FgRed, color.Italic, color.Bold),
"Error": color.New(color.FgYellow, color.Italic),
"Info": color.New(color.FgGreen, color.Bold),
"Print": color.New(),
"PrintC": color.New(color.FgGreen, color.Bold),
}
)
// SetColorOff disables coloring for the entire session.
func SetColorOff() {
privateMutex.Lock()
defer privateMutex.Unlock()
color.NoColor = true
}
// SetColorOn enables coloring for the entire session.
func SetColorOn() {
privateMutex.Lock()
defer privateMutex.Unlock()
color.NoColor = false
}
// SetColor sets a color for a particular tag.
func SetColor(tag string, cl *color.Color) {
privateMutex.Lock()
defer privateMutex.Unlock()
// add new theme
Theme[tag] = cl
}
+54
View File
@@ -0,0 +1,54 @@
/*
* Minio Client (C) 2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Package hookreader hooks additional reader in the source
// stream. It is useful for making progress bars. Second reader is
// appropriately notified about the exact number of bytes read from
// the primary source on each Read operation.
package hookreader
import "io"
type hookReader struct {
source io.Reader
hook io.Reader
}
// Read implements io.Reader. Always reads from the source, the return
// value 'n' number of bytes are reported through the hook. Returns
// error for all non io.EOF conditions.
func (hr *hookReader) Read(b []byte) (n int, err error) {
n, err = hr.source.Read(b)
if err != nil && err != io.EOF {
return n, err
}
// Progress the hook with the total read bytes from the source.
if _, herr := hr.hook.Read(b[:n]); herr != nil {
if herr != io.EOF {
return n, herr
}
}
return n, err
}
// NewHook returns a io.Reader which implements hookReader that
// reports the data read from the source to the hook.
func NewHook(source, hook io.Reader) io.Reader {
if hook == nil {
return source
}
return &hookReader{source, hook}
}
+55
View File
@@ -0,0 +1,55 @@
/*
* Minio Client (C) 2016 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package hookreader
import (
"bytes"
"testing"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }
type MySuite struct{}
var _ = Suite(&MySuite{})
// customReader - implements custom progress reader.
type customReader struct {
readBytes int
}
func (c *customReader) Read(b []byte) (n int, err error) {
c.readBytes += len(b)
return len(b), nil
}
// Tests hook reader implementation.
func (s *MySuite) TestHookReader(c *C) {
var buffer bytes.Buffer
writer := &buffer
_, err := writer.Write([]byte("Hello"))
c.Assert(err, IsNil)
progress := &customReader{}
reader := NewHook(&buffer, progress)
b := make([]byte, 3)
n, err := reader.Read(b)
c.Assert(err, IsNil)
c.Assert(n, Equals, 3)
c.Assert(progress.readBytes, Equals, 3)
}
+74
View File
@@ -0,0 +1,74 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package httptracer
import (
"errors"
"net/http"
"time"
"github.com/minio/mc/pkg/console"
)
// HTTPTracer provides callback hook mechanism for HTTP transport.
type HTTPTracer interface {
Request(req *http.Request) error
Response(res *http.Response) error
}
// RoundTripTrace interposes HTTP transport requests and respsonses using HTTPTracer hooks
type RoundTripTrace struct {
Trace HTTPTracer // User provides callback methods
Transport http.RoundTripper // HTTP transport that needs to be intercepted
}
// RoundTrip executes user provided request and response hooks for each HTTP call.
func (t RoundTripTrace) RoundTrip(req *http.Request) (res *http.Response, err error) {
timeStamp := time.Now()
if t.Transport == nil {
return nil, errors.New("Invalid Argument")
}
res, err = t.Transport.RoundTrip(req)
if err != nil {
return res, err
}
if t.Trace != nil {
err = t.Trace.Request(req)
if err != nil {
return nil, err
}
err = t.Trace.Response(res)
if err != nil {
return nil, err
}
console.Debugln("Response Time: ", time.Since(timeStamp).String()+"\n")
}
return res, err
}
// GetNewTraceTransport returns a traceable transport
//
// Takes first argument a custom tracer which implements Response, Request() conforming to HTTPTracer interface.
// Another argument can be a default transport or a custom http.RoundTripper implementation
func GetNewTraceTransport(trace HTTPTracer, transport http.RoundTripper) RoundTripTrace {
return RoundTripTrace{Trace: trace,
Transport: transport}
}
+33
View File
@@ -0,0 +1,33 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package httptracer
import (
"testing"
. "gopkg.in/check.v1"
)
func Test(t *testing.T) { TestingT(t) }
type MySuite struct{}
var _ = Suite(&MySuite{})
func (s *MySuite) TestHTTPTracer(c *C) {
//
}
+34
View File
@@ -0,0 +1,34 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import "github.com/minio/mc/pkg/console"
// message interface for all structured messages implementing JSON(), String() methods.
type message interface {
JSON() string
String() string
}
// printMsg prints message string or JSON structure depending on the type of output console.
func printMsg(msg message) {
if !globalJSON {
console.Println(msg.String())
} else {
console.Println(msg.JSON())
}
}
+151
View File
@@ -0,0 +1,151 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"io"
"runtime"
"strings"
"time"
"github.com/fatih/color"
"github.com/minio/pb"
"github.com/minio/mc/pkg/console"
)
// progress extender.
type progressBar struct {
ProgressBar *pb.ProgressBar
reader io.Reader
readerLength int64
bytesRead int64
isResume bool
}
// newProgressBar - instantiate a progress bar.
func newProgressBar(total int64) *progressBar {
// Progress bar speific theme customization.
console.SetColor("Bar", color.New(color.FgGreen, color.Bold))
pgbar := progressBar{}
// get the new original progress bar.
bar := pb.New64(total)
// Set new human friendly print units.
bar.SetUnits(pb.U_BYTES)
// Refresh rate for progress bar is set to 125 milliseconds.
bar.SetRefreshRate(time.Millisecond * 125)
// Do not print a newline by default handled, it is handled manually.
bar.NotPrint = true
// Show current speed is true.
bar.ShowSpeed = true
// Custom callback with colorized bar.
bar.Callback = func(s string) {
console.Print(console.Colorize("Bar", "\r"+s))
}
// Use different unicodes for Linux, OS X and Windows.
switch runtime.GOOS {
case "linux":
// Need to add '\x00' as delimiter for unicode characters.
bar.Format("┃\x00▓\x00█\x00░\x00┃")
case "darwin":
// Need to add '\x00' as delimiter for unicode characters.
bar.Format(" \x00▓\x00 \x00░\x00 ")
default:
// Default to non unicode characters.
bar.Format("[=> ]")
}
// Start the progress bar.
if bar.Total > 0 {
bar.Start()
}
// Copy for future
pgbar.ProgressBar = bar
// Return new progress bar here.
return &pgbar
}
// Set caption.
func (p *progressBar) SetCaption(caption string) *progressBar {
caption = fixateBarCaption(caption, getFixedWidth(p.ProgressBar.GetWidth(), 18))
p.ProgressBar.Prefix(caption)
return p
}
func (p *progressBar) Set64(length int64) *progressBar {
p.ProgressBar = p.ProgressBar.Set64(length)
return p
}
// cursorAnimate - returns a animated rune through read channel for every read.
func cursorAnimate() <-chan rune {
cursorCh := make(chan rune)
var cursors string
switch runtime.GOOS {
case "linux":
// cursors = "➩➪➫➬➭➮➯➱"
// cursors = "▁▃▄▅▆▇█▇▆▅▄▃"
cursors = "◐◓◑◒"
// cursors = "←↖↑↗→↘↓↙"
// cursors = "◴◷◶◵"
// cursors = "◰◳◲◱"
//cursors = "⣾⣽⣻⢿⡿⣟⣯⣷"
case "darwin":
cursors = "◐◓◑◒"
default:
cursors = "|/-\\"
}
go func() {
for {
for _, cursor := range cursors {
cursorCh <- cursor
}
}
}()
return cursorCh
}
// fixateBarCaption - fancify bar caption based on the terminal width.
func fixateBarCaption(caption string, width int) string {
switch {
case len(caption) > width:
// Trim caption to fit within the screen
trimSize := len(caption) - width + 3
if trimSize < len(caption) {
caption = "..." + caption[trimSize:]
}
case len(caption) < width:
caption += strings.Repeat(" ", width-len(caption))
}
return caption
}
// getFixedWidth - get a fixed width based for a given percentage.
func getFixedWidth(width, percent int) int {
return width * percent / 100
}
+5
View File
@@ -0,0 +1,5 @@
SET MC_RELEASE=OFFICIAL
SET GO15VENDOREXPERIMENT=1
go run buildscripts/gen-ldflags.go > temp.txt
SET /p LDFLAGS=<temp.txt
go build -ldflags="%LDFLAGS%" -o %GOPATH%\bin\mc.exe
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
echo -n "Making official release binaries.. "
export MC_RELEASE=OFFICIAL
make 1>/dev/null
echo "Binaries built at ${GOPATH}/bin/mc"
+215
View File
@@ -0,0 +1,215 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"encoding/json"
"fmt"
"path/filepath"
"strings"
"github.com/fatih/color"
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
)
// rm specific flags.
var (
rmFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of rm.",
},
cli.BoolFlag{
Name: "recursive, r",
Usage: "Remove recursively.",
},
cli.BoolFlag{
Name: "force",
Usage: "Force a dangerous remove operation.",
},
cli.BoolFlag{
Name: "incomplete, I",
Usage: "Remove an incomplete upload(s).",
},
cli.BoolFlag{
Name: "fake",
Usage: "Perform a fake remove operation.",
},
}
)
// remove a file or folder.
var rmCmd = cli.Command{
Name: "rm",
Usage: "Remove file or bucket [WARNING: Use with care].",
Action: mainRm,
Flags: append(rmFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc {{.Name}} - {{.Usage}}
USAGE:
mc {{.Name}} [FLAGS] TARGET [TARGET ...]
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Remove a file.
$ mc {{.Name}} 1999/old-backup.tgz
2. Remove contents of a folder, excluding its sub-folders.
$ mc {{.Name}} --force s3/jazz-songs/louis/
3. Remove contents of a folder recursively.
$ mc {{.Name}} --force --recursive s3/jazz-songs/louis/
4. Remove all matching objects with this prefix.
$ mc {{.Name}} --force s3/ogg/gunmetal
5. Drop an incomplete upload of an object.
$ mc {{.Name}} --incomplete s3/jazz-songs/louis/file01.mp3
6. Drop all incomplete uploads recursively matching this prefix.
$ mc {{.Name}} --incomplete --force --recursive s3/jazz-songs/louis/
`,
}
// Structured message depending on the type of console.
type rmMessage struct {
Status string `json:"status"`
URL string `json:"url"`
}
// Colorized message for console printing.
func (r rmMessage) String() string {
return console.Colorize("Remove", fmt.Sprintf("Removed ‘%s’.", r.URL))
}
// JSON'ified message for scripting.
func (r rmMessage) JSON() string {
msgBytes, e := json.Marshal(r)
fatalIf(probe.NewError(e), "Unable to marshal into JSON.")
return string(msgBytes)
}
// Validate command line arguments.
func checkRmSyntax(ctx *cli.Context) {
// Set command flags from context.
isForce := ctx.Bool("force")
isRecursive := ctx.Bool("recursive")
if !ctx.Args().Present() {
exitCode := 1
cli.ShowCommandHelpAndExit(ctx, "rm", exitCode)
}
// For all recursive operations make sure to check for 'force' flag.
if isRecursive && !isForce {
fatalIf(errDummy().Trace(),
"Recursive removal requires --force option. Please review carefully before performing this *DANGEROUS* operation.")
}
}
// Remove a single object.
func rm(targetAlias, targetURL string, isIncomplete, isFake bool) *probe.Error {
clnt, err := newClientFromAlias(targetAlias, targetURL)
if err != nil {
return err.Trace(targetURL)
}
if isFake { // It is a fake remove. Return success.
return nil
}
if err = clnt.Remove(isIncomplete); err != nil {
return err.Trace(targetURL)
}
return nil
}
// Remove all objects recursively.
func rmAll(targetAlias, targetURL string, isRecursive, isIncomplete, isFake bool) {
// Initialize new client.
clnt, err := newClientFromAlias(targetAlias, targetURL)
if err != nil {
errorIf(err.Trace(targetURL), "Invalid URL ‘"+targetURL+"’.")
return // End of journey.
}
/* Disable recursion and only list this folder's contents. We
perform manual depth-first recursion ourself here. */
nonRecursive := false
for entry := range clnt.List(nonRecursive, isIncomplete) {
if entry.Err != nil {
errorIf(entry.Err.Trace(targetURL), "Unable to list ‘"+targetURL+"’.")
return // End of journey.
}
if entry.Type.IsDir() && isRecursive {
// Add separator at the end to remove all its contents.
url := entry.URL
url.Path = strings.TrimSuffix(entry.URL.Path, string(entry.URL.Separator)) + string(entry.URL.Separator)
// Recursively remove contents of this directory.
rmAll(targetAlias, url.String(), isRecursive, isIncomplete, isFake)
}
// Regular type.
if err = rm(targetAlias, entry.URL.String(), isIncomplete, isFake); err != nil {
errorIf(err.Trace(entry.URL.String()), "Unable to remove ‘"+entry.URL.String()+"’.")
continue
}
// Construct user facing message and path.
entryPath := filepath.ToSlash(filepath.Join(targetAlias, entry.URL.Path))
printMsg(rmMessage{Status: "success", URL: entryPath})
}
}
// main for rm command.
func mainRm(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check 'rm' cli arguments.
checkRmSyntax(ctx)
// rm specific flags.
isForce := ctx.Bool("force")
isIncomplete := ctx.Bool("incomplete")
isRecursive := ctx.Bool("recursive")
isFake := ctx.Bool("fake")
// Set color.
console.SetColor("Remove", color.New(color.FgGreen, color.Bold))
// Support multiple targets.
for _, url := range ctx.Args() {
targetAlias, targetURL, _ := mustExpandAlias(url)
if isRecursive && isForce {
rmAll(targetAlias, targetURL, isRecursive, isIncomplete, isFake)
} else {
if err := rm(targetAlias, targetURL, isIncomplete, isFake); err != nil {
errorIf(err.Trace(url), "Unable to remove ‘"+url+"’.")
continue
}
printMsg(rmMessage{Status: "success", URL: url})
}
}
}
+75
View File
@@ -0,0 +1,75 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"fmt"
"strings"
"github.com/dustin/go-humanize"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
"github.com/olekukonko/ts"
)
/******************************** Scan Bar ************************************/
// fixateScanBar truncates long text to fit within the terminal size.
func fixateScanBar(text string, width int) string {
if len([]rune(text)) > width {
// Trim text to fit within the screen
trimSize := len([]rune(text)) - width + 3 //"..."
if trimSize < len([]rune(text)) {
text = "..." + text[trimSize:]
}
}
return text
}
// Progress bar function report objects being scaned.
type scanBarFunc func(string)
// scanBarFactory returns a progress bar function to report URL scanning.
func scanBarFactory() scanBarFunc {
prevLineSize := 0
prevSource := ""
fileCount := 0
termSize, e := ts.GetSize()
if e != nil {
fatalIf(probe.NewError(e), "Unable to get terminal size. Please use --quiet option.")
}
termWidth := termSize.Col()
cursorCh := cursorAnimate()
return func(source string) {
scanPrefix := fmt.Sprintf("[%s] %s ", humanize.Comma(int64(fileCount)), string(<-cursorCh))
cmnPrefix := commonPrefix(source, prevSource)
eraseLen := prevLineSize - len([]rune(scanPrefix+cmnPrefix))
if eraseLen < 1 {
eraseLen = 0
}
if prevLineSize != 0 { // erase previous line
console.PrintC("\r" + scanPrefix + cmnPrefix + strings.Repeat(" ", eraseLen))
}
source = fixateScanBar(source, termWidth-len([]rune(scanPrefix))-1)
barText := scanPrefix + source
console.PrintC("\r" + barText)
prevSource = source
prevLineSize = len([]rune(barText))
fileCount++
}
}
+261
View File
@@ -0,0 +1,261 @@
/*
* Minio Client, (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"encoding/json"
"fmt"
"os"
"sort"
"strings"
"github.com/fatih/color"
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
)
var (
sessionFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of session.",
},
}
)
// Manage sessions for cp and mirror.
var sessionCmd = cli.Command{
Name: "session",
Usage: "Manage saved sessions of cp and mirror operations.",
Action: mainSession,
Flags: append(sessionFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc {{.Name}} - {{.Usage}}
USAGE:
mc {{.Name}} [FLAGS] OPERATION [ARG]
OPERATION:
resume Resume a previously saved session.
clear Clear a previously saved session.
list List all previously saved sessions.
SESSION-ID:
SESSION - Session can either be $SESSION-ID or "all".
FLAGS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. List sessions.
$ mc {{.Name}} list
2. Resume session.
$ mc {{.Name}} resume ygVIpSJs
3. Clear session.
$ mc {{.Name}} clear ygVIpSJs
4. Clear session.
$ mc {{.Name}} clear all
`,
}
// bySessionWhen is a type for sorting session metadata by time.
type bySessionWhen []*sessionV6
func (b bySessionWhen) Len() int { return len(b) }
func (b bySessionWhen) Swap(i, j int) { b[i], b[j] = b[j], b[i] }
func (b bySessionWhen) Less(i, j int) bool { return b[i].Header.When.Before(b[j].Header.When) }
// listSessions list all current sessions.
func listSessions() *probe.Error {
var bySessions []*sessionV6
for _, sid := range getSessionIDs() {
s, err := loadSessionV6(sid)
if err != nil {
return err.Trace(sid)
}
bySessions = append(bySessions, s)
}
// sort sessions based on time.
sort.Sort(bySessionWhen(bySessions))
for _, session := range bySessions {
printMsg(session)
session.Close()
}
return nil
}
// clearSessionMessage container for clearing session messages.
type clearSessionMessage struct {
Status string `json:"success"`
SessionID string `json:"sessionId"`
}
// String colorized clear session message.
func (c clearSessionMessage) String() string {
return console.Colorize("ClearSession", "Session ‘"+c.SessionID+"’ cleared successfully.")
}
// JSON jsonified clear session message.
func (c clearSessionMessage) JSON() string {
clearSessionJSONBytes, e := json.Marshal(c)
fatalIf(probe.NewError(e), "Unable to marshal into JSON.")
return string(clearSessionJSONBytes)
}
// clearSession clear sessions.
func clearSession(sid string) {
if sid == "all" {
for _, sid := range getSessionIDs() {
session, err := loadSessionV6(sid)
fatalIf(err.Trace(sid), "Unable to load session ‘"+sid+"’.")
fatalIf(session.Delete().Trace(sid), "Unable to load session ‘"+sid+"’.")
printMsg(clearSessionMessage{Status: "success", SessionID: sid})
}
return
}
if !isSessionExists(sid) {
fatalIf(errDummy().Trace(sid), "Session ‘"+sid+"’ not found.")
}
session, err := loadSessionV6(sid)
fatalIf(err.Trace(sid), "Unable to load session ‘"+sid+"’.")
if session != nil {
fatalIf(session.Delete().Trace(sid), "Unable to load session ‘"+sid+"’.")
printMsg(clearSessionMessage{Status: "success", SessionID: sid})
}
}
func sessionExecute(s *sessionV6) {
switch s.Header.CommandType {
case "cp":
doCopySession(s)
case "mirror":
doMirrorSession(s)
}
}
func checkSessionSyntax(ctx *cli.Context) {
if len(ctx.Args()) < 1 {
cli.ShowCommandHelpAndExit(ctx, "session", 1) // last argument is exit code
}
if strings.TrimSpace(ctx.Args().First()) == "" {
cli.ShowCommandHelpAndExit(ctx, "session", 1) // last argument is exit code
}
switch strings.TrimSpace(ctx.Args().First()) {
case "list":
case "resume":
if strings.TrimSpace(ctx.Args().Tail().First()) == "" {
fatalIf(errInvalidArgument().Trace(ctx.Args()...), "Unable to validate empty argument.")
}
case "clear":
if strings.TrimSpace(ctx.Args().Tail().First()) == "" {
fatalIf(errInvalidArgument().Trace(ctx.Args()...), "Unable to validate empty argument.")
}
default:
cli.ShowCommandHelpAndExit(ctx, "session", 1) // last argument is exit code
}
}
// findClosestSessions to match a given string with sessions trie tree.
func findClosestSessions(session string) []string {
sessionsTree := newTrie() // Allocate a new trie for sessions strings.
for _, sid := range getSessionIDs() {
sessionsTree.Insert(sid)
}
var closestSessions []string
for _, value := range sessionsTree.PrefixMatch(session) {
closestSessions = append(closestSessions, value.(string))
}
sort.Strings(closestSessions)
return closestSessions
}
func mainSession(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check 'session' cli arguments.
checkSessionSyntax(ctx)
// Additional command speific theme customization.
console.SetColor("Command", color.New(color.FgWhite, color.Bold))
console.SetColor("SessionID", color.New(color.FgYellow, color.Bold))
console.SetColor("SessionTime", color.New(color.FgGreen))
console.SetColor("ClearSession", color.New(color.FgGreen, color.Bold))
if !isSessionDirExists() {
fatalIf(createSessionDir().Trace(), "Unable to create session folder.")
}
switch strings.TrimSpace(ctx.Args().First()) {
// list all resumable sessions.
case "list":
fatalIf(listSessions().Trace(ctx.Args()...), "Unable to list sessions.")
case "resume":
sid := strings.TrimSpace(ctx.Args().Tail().First())
if !isSessionExists(sid) {
closestSessions := findClosestSessions(sid)
errorMsg := "Session ‘" + sid + "’ not found."
if len(closestSessions) > 0 {
errorMsg += fmt.Sprintf("\n\nDid you mean?\n")
for _, session := range closestSessions {
errorMsg += fmt.Sprintf(" ‘mc resume session %s’", session)
// break on the first one, it is good enough.
break
}
}
fatalIf(errDummy().Trace(sid), errorMsg)
}
s, err := loadSessionV6(sid)
fatalIf(err.Trace(sid), "Unable to load session.")
// Restore the state of global variables from this previous session.
s.restoreGlobals()
savedCwd, e := os.Getwd()
fatalIf(probe.NewError(e), "Unable to determine current working folder.")
if s.Header.RootPath != "" {
// change folder to RootPath.
e = os.Chdir(s.Header.RootPath)
fatalIf(probe.NewError(e), "Unable to change working folder to root path while resuming session.")
}
sessionExecute(s)
err = s.Close()
fatalIf(err.Trace(), "Unable to close session file properly.")
err = s.Delete()
fatalIf(err.Trace(), "Unable to clear session files properly.")
// change folder back to saved path.
e = os.Chdir(savedCwd)
fatalIf(probe.NewError(e), "Unable to change working folder to saved path ‘"+savedCwd+"’.")
// purge a requested pending session, if "all" purge everything.
case "clear":
clearSession(strings.TrimSpace(ctx.Args().Tail().First()))
}
}
+347
View File
@@ -0,0 +1,347 @@
/*
* Minio Client, (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Session V2 - Version 2 stores session header and session data in
// two separate files. Session data contains fully prepared URL list.
package main
import (
"encoding/json"
"fmt"
"io"
"os"
"strings"
"sync"
"time"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
"github.com/minio/minio-xl/pkg/quick"
)
func migrateSessionV5ToV6() {
for _, sid := range getSessionIDs() {
sessionV6, err := loadSessionV6(sid)
fatalIf(err.Trace(sid), "Unable to load version ‘6’. Migration failed please report this issue at https://github.com/minio/mc/issues.")
if sessionV6.Header.Version == "6" { // It is new format.
return
}
/*** Remove all session files older than v6 ***/
sessionFile, err := getSessionFile(sid)
fatalIf(err.Trace(sid), "Unable to get session file.")
sessionDataFile, err := getSessionDataFile(sid)
fatalIf(err.Trace(sid), "Unable to get session data file.")
console.Println("Removing unsupported session file ‘" + sessionFile + "’ version ‘" + sessionV6.Header.Version + "’.")
if e := os.Remove(sessionFile); e != nil {
fatalIf(probe.NewError(e), "Unable to remove version ‘"+sessionV6.Header.Version+"’ session file ‘"+sessionFile+"’.")
}
if e := os.Remove(sessionDataFile); e != nil {
fatalIf(probe.NewError(e), "Unable to remove version ‘"+sessionV6.Header.Version+"’ session data file ‘"+sessionDataFile+"’.")
}
}
}
// sessionV6Header for resumable sessions.
type sessionV6Header struct {
Version string `json:"version"`
When time.Time `json:"time"`
RootPath string `json:"workingFolder"`
GlobalBoolFlags map[string]bool `json:"globalBoolFlags"`
GlobalIntFlags map[string]int `json:"globalIntFlags"`
GlobalStringFlags map[string]string `json:"globalStringFlags"`
CommandType string `json:"commandType"`
CommandArgs []string `json:"cmdArgs"`
CommandBoolFlags map[string]bool `json:"cmdBoolFlags"`
CommandIntFlags map[string]int `json:"cmdIntFlags"`
CommandStringFlags map[string]string `json:"cmdStringFlags"`
LastCopied string `json:"lastCopied"`
TotalBytes int64 `json:"totalBytes"`
TotalObjects int `json:"totalObjects"`
}
// sessionMessage container for session messages
type sessionMessage struct {
Status string `json:"status"`
SessionID string `json:"sessionId"`
Time time.Time `json:"time"`
CommandType string `json:"commandType"`
CommandArgs []string `json:"commandArgs"`
}
// sessionV6 resumable session container.
type sessionV6 struct {
Header *sessionV6Header
SessionID string
mutex *sync.Mutex
DataFP *sessionDataFP
sigCh bool
}
// sessionDataFP data file pointer.
type sessionDataFP struct {
dirty bool
*os.File
}
func (file *sessionDataFP) Write(p []byte) (int, error) {
file.dirty = true
return file.File.Write(p)
}
// String colorized session message.
func (s sessionV6) String() string {
message := console.Colorize("SessionID", fmt.Sprintf("%s -> ", s.SessionID))
message = message + console.Colorize("SessionTime", fmt.Sprintf("[%s]", s.Header.When.Local().Format(printDate)))
message = message + console.Colorize("Command", fmt.Sprintf(" %s %s", s.Header.CommandType, strings.Join(s.Header.CommandArgs, " ")))
return message
}
// JSON jsonified session message.
func (s sessionV6) JSON() string {
sessionMsg := sessionMessage{
SessionID: s.SessionID,
Time: s.Header.When.Local(),
CommandType: s.Header.CommandType,
CommandArgs: s.Header.CommandArgs,
}
sessionMsg.Status = "success"
sessionBytes, e := json.Marshal(sessionMsg)
fatalIf(probe.NewError(e), "Unable to marshal into JSON.")
return string(sessionBytes)
}
// loadSessionV6 - reads session file if exists and re-initiates internal variables
func loadSessionV6(sid string) (*sessionV6, *probe.Error) {
if !isSessionDirExists() {
return nil, errInvalidArgument().Trace()
}
sessionFile, err := getSessionFile(sid)
if err != nil {
return nil, err.Trace(sid)
}
if _, e := os.Stat(sessionFile); e != nil {
return nil, probe.NewError(e)
}
s := &sessionV6{}
s.Header = &sessionV6Header{}
s.SessionID = sid
s.Header.Version = "5"
qs, err := quick.New(s.Header)
if err != nil {
return nil, err.Trace(sid, s.Header.Version)
}
err = qs.Load(sessionFile)
if err != nil {
return nil, err.Trace(sid, s.Header.Version)
}
s.mutex = new(sync.Mutex)
s.Header = qs.Data().(*sessionV6Header)
sessionDataFile, err := getSessionDataFile(s.SessionID)
if err != nil {
return nil, err.Trace(sid, s.Header.Version)
}
var e error
dataFile, e := os.Open(sessionDataFile)
fatalIf(probe.NewError(e), "Unable to open session data file \""+sessionDataFile+"\".")
s.DataFP = &sessionDataFP{false, dataFile}
return s, nil
}
// newSessionV6 provides a new session.
func newSessionV6() *sessionV6 {
s := &sessionV6{}
s.Header = &sessionV6Header{}
s.Header.Version = "6"
// map of command and files copied.
s.Header.GlobalBoolFlags = make(map[string]bool)
s.Header.GlobalIntFlags = make(map[string]int)
s.Header.GlobalStringFlags = make(map[string]string)
s.Header.CommandArgs = nil
s.Header.CommandBoolFlags = make(map[string]bool)
s.Header.CommandIntFlags = make(map[string]int)
s.Header.CommandStringFlags = make(map[string]string)
s.Header.When = time.Now().UTC()
s.mutex = new(sync.Mutex)
s.SessionID = newRandomID(8)
sessionDataFile, err := getSessionDataFile(s.SessionID)
fatalIf(err.Trace(s.SessionID), "Unable to create session data file \""+sessionDataFile+"\".")
dataFile, e := os.Create(sessionDataFile)
fatalIf(probe.NewError(e), "Unable to create session data file \""+sessionDataFile+"\".")
s.DataFP = &sessionDataFP{false, dataFile}
// Capture state of global flags.
s.setGlobals()
return s
}
// HasData provides true if this is a session resume, false otherwise.
func (s sessionV6) HasData() bool {
if s.Header.LastCopied == "" {
return false
}
return true
}
// NewDataReader provides reader interface to session data file.
func (s *sessionV6) NewDataReader() io.Reader {
// DataFP is always intitialized, either via new or load functions.
s.DataFP.Seek(0, os.SEEK_SET)
return io.Reader(s.DataFP)
}
// NewDataReader provides writer interface to session data file.
func (s *sessionV6) NewDataWriter() io.Writer {
// DataFP is always intitialized, either via new or load functions.
s.DataFP.Seek(0, os.SEEK_SET)
return io.Writer(s.DataFP)
}
// Save this session.
func (s *sessionV6) Save() *probe.Error {
s.mutex.Lock()
defer s.mutex.Unlock()
if s.DataFP.dirty {
if err := s.DataFP.Sync(); err != nil {
return probe.NewError(err)
}
s.DataFP.dirty = false
}
qs, err := quick.New(s.Header)
if err != nil {
return err.Trace(s.SessionID)
}
sessionFile, err := getSessionFile(s.SessionID)
if err != nil {
return err.Trace(s.SessionID)
}
return qs.Save(sessionFile).Trace(sessionFile)
}
// setGlobals captures the state of global variables into session header.
// Used by newSession.
func (s *sessionV6) setGlobals() {
s.Header.GlobalBoolFlags["quiet"] = globalQuiet
s.Header.GlobalBoolFlags["debug"] = globalDebug
s.Header.GlobalBoolFlags["json"] = globalJSON
s.Header.GlobalBoolFlags["noColor"] = globalNoColor
}
// RestoreGlobals restores the state of global variables.
// Used by resumeSession.
func (s sessionV6) restoreGlobals() {
quiet := s.Header.GlobalBoolFlags["quiet"]
debug := s.Header.GlobalBoolFlags["debug"]
json := s.Header.GlobalBoolFlags["json"]
noColor := s.Header.GlobalBoolFlags["noColor"]
setGlobals(quiet, debug, json, noColor)
}
// Close ends this session and removes all associated session files.
func (s *sessionV6) Close() *probe.Error {
s.mutex.Lock()
defer s.mutex.Unlock()
if err := s.DataFP.Close(); err != nil {
return probe.NewError(err)
}
qs, err := quick.New(s.Header)
if err != nil {
return err.Trace()
}
sessionFile, err := getSessionFile(s.SessionID)
if err != nil {
return err.Trace(s.SessionID)
}
return qs.Save(sessionFile).Trace(sessionFile)
}
// Delete removes all the session files.
func (s *sessionV6) Delete() *probe.Error {
s.mutex.Lock()
defer s.mutex.Unlock()
if s.DataFP != nil {
name := s.DataFP.Name()
// close file pro-actively before deleting
// ignore any error, it could be possibly that
// the file is closed already
s.DataFP.Close()
if e := os.Remove(name); e != nil {
return probe.NewError(e)
}
}
sessionFile, err := getSessionFile(s.SessionID)
if err != nil {
return err.Trace(s.SessionID)
}
if e := os.Remove(sessionFile); e != nil {
return probe.NewError(e)
}
return nil
}
// Close a session and exit.
func (s sessionV6) CloseAndDie() {
s.Close()
console.Fatalln("Session safely terminated. To resume session ‘mc session resume " + s.SessionID + "’")
}
// Create a factory function to simplify checking if an
// object has been copied or not.
// isCopied(URL) -> true or false
func isCopiedFactory(lastCopied string) func(string) bool {
copied := true // closure
return func(sourceURL string) bool {
if sourceURL == "" {
fatalIf(errInvalidArgument().Trace(), "Empty source argument passed.")
}
if lastCopied == "" {
return false
}
if copied {
if lastCopied == sourceURL {
copied = false // from next call onwards we say false.
}
return true
}
return false
}
}
+114
View File
@@ -0,0 +1,114 @@
/*
* Minio Client, (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"os"
"path/filepath"
"strings"
"github.com/minio/minio-xl/pkg/probe"
)
// migrateSession migrates all previous migration to latest.
func migrateSession() {
// We no longer support sessions older than v5. They will be removed.
migrateSessionV5ToV6()
}
// createSessionDir - create session directory.
func createSessionDir() *probe.Error {
sessionDir, err := getSessionDir()
if err != nil {
return err.Trace()
}
if e := os.MkdirAll(sessionDir, 0700); e != nil {
return probe.NewError(e)
}
return nil
}
// getSessionDir - get session directory.
func getSessionDir() (string, *probe.Error) {
configDir, err := getMcConfigDir()
if err != nil {
return "", err.Trace()
}
sessionDir := filepath.Join(configDir, globalSessionDir)
return sessionDir, nil
}
// isSessionDirExists - verify if session directory exists.
func isSessionDirExists() bool {
sessionDir, err := getSessionDir()
fatalIf(err.Trace(), "Unable to determine session folder.")
if _, e := os.Stat(sessionDir); e != nil {
return false
}
return true
}
// getSessionFile - get current session file.
func getSessionFile(sid string) (string, *probe.Error) {
sessionDir, err := getSessionDir()
if err != nil {
return "", err.Trace()
}
sessionFile := filepath.Join(sessionDir, sid+".json")
return sessionFile, nil
}
// isSessionExists verifies if given session exists.
func isSessionExists(sid string) bool {
sessionFile, err := getSessionFile(sid)
fatalIf(err.Trace(sid), "Unable to determine session filename for ‘"+sid+"’.")
if _, e := os.Stat(sessionFile); e != nil {
return false
}
return true // Session exists.
}
// getSessionDataFile - get session data file for a given session.
func getSessionDataFile(sid string) (string, *probe.Error) {
sessionDir, err := getSessionDir()
if err != nil {
return "", err.Trace()
}
sessionDataFile := filepath.Join(sessionDir, sid+".data")
return sessionDataFile, nil
}
// getSessionIDs - get all active sessions.
func getSessionIDs() (sids []string) {
sessionDir, err := getSessionDir()
fatalIf(err.Trace(), "Unable to access session folder.")
sessionList, e := filepath.Glob(sessionDir + "/*.json")
fatalIf(probe.NewError(e), "Unable to access session folder ‘"+sessionDir+"’.")
for _, path := range sessionList {
sids = append(sids, strings.TrimSuffix(filepath.Base(path), ".json"))
}
return sids
}
+53
View File
@@ -0,0 +1,53 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"regexp"
. "gopkg.in/check.v1"
)
func (s *TestSuite) TestValidSessionID(c *C) {
validSid := regexp.MustCompile("^[a-zA-Z]+$")
sid := newRandomID(8)
c.Assert(len(sid), Equals, 8)
c.Assert(validSid.MatchString(sid), Equals, true)
}
func (s *TestSuite) TestSession(c *C) {
err := createSessionDir()
c.Assert(err, IsNil)
c.Assert(isSessionDirExists(), Equals, true)
session := newSessionV6()
c.Assert(session.Header.CommandArgs, IsNil)
c.Assert(len(session.SessionID), Equals, 8)
err = session.Close()
c.Assert(err, IsNil)
savedSession, err := loadSessionV6(session.SessionID)
c.Assert(err, IsNil)
c.Assert(session.SessionID, Equals, savedSession.SessionID)
err = savedSession.Close()
c.Assert(err, IsNil)
err = savedSession.Delete()
c.Assert(err, IsNil)
}
+134
View File
@@ -0,0 +1,134 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"os"
"sync"
"time"
"github.com/minio/minio-xl/pkg/probe"
"github.com/minio/minio-xl/pkg/quick"
)
// shareEntryV1 - container for each download/upload entries.
type shareEntryV1 struct {
URL string `json:"share"` // Object URL.
Date time.Time `json:"date"`
Expiry time.Duration `json:"expiry"`
ContentType string `json:"contentType,omitempty"` // Only used by upload cmd.
}
// JSON file to persist previously shared uploads.
type shareDBV1 struct {
Version string `json:"version"`
mutex *sync.Mutex
// key is unique share URL.
Shares map[string]shareEntryV1 `json:"shares"`
}
// Instantiate a new uploads structure for persistence.
func newShareDBV1() *shareDBV1 {
s := &shareDBV1{
Version: "1",
}
s.Shares = make(map[string]shareEntryV1)
s.mutex = &sync.Mutex{}
return s
}
// Set upload info for each share.
func (s *shareDBV1) Set(objectURL string, shareURL string, expiry time.Duration, contentType string) {
s.mutex.Lock()
defer s.mutex.Unlock()
s.Shares[shareURL] = shareEntryV1{
URL: objectURL,
Date: time.Now().UTC(),
Expiry: expiry,
ContentType: contentType,
}
}
// Delete upload info if it exists.
func (s *shareDBV1) Delete(objectURL string) {
s.mutex.Lock()
defer s.mutex.Unlock()
delete(s.Shares, objectURL)
}
// Delete all expired uploads.
func (s *shareDBV1) deleteAllExpired() {
for shareURL, share := range s.Shares {
if (share.Expiry - time.Since(share.Date)) <= 0 {
// Expired entry. Safe to drop.
delete(s.Shares, shareURL)
}
}
}
// Load shareDB entries from disk. Any entries held in memory are reset.
func (s *shareDBV1) Load(filename string) *probe.Error {
s.mutex.Lock()
defer s.mutex.Unlock()
// Check if the db file exist.
if _, e := os.Stat(filename); e != nil {
return probe.NewError(e)
}
// Initialize and load using quick package.
qs, err := quick.New(newShareDBV1())
if err != nil {
return err.Trace(filename)
}
err = qs.Load(filename)
if err != nil {
return err.Trace(filename)
}
// Copy map over.
for k, v := range qs.Data().(*shareDBV1).Shares {
s.Shares[k] = v
}
// Filter out expired entries and save changes back to disk.
s.deleteAllExpired()
s.save(filename)
return nil
}
// Persist share uploads to disk.
func (s shareDBV1) save(filename string) *probe.Error {
// Initialize a new quick file.
qs, err := quick.New(s)
if err != nil {
return err.Trace(filename)
}
return qs.Save(filename).Trace(filename)
}
// Persist share uploads to disk.
func (s shareDBV1) Save(filename string) *probe.Error {
s.mutex.Lock()
defer s.mutex.Unlock()
return s.save(filename)
}
+184
View File
@@ -0,0 +1,184 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"time"
"github.com/minio/cli"
"github.com/minio/minio-xl/pkg/probe"
)
var (
shareDownloadFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of share download",
},
cli.BoolFlag{
Name: "recursive, r",
Usage: "Share all objects recursively.",
},
shareFlagExpire,
}
)
// Share documents via URL.
var shareDownload = cli.Command{
Name: "download",
Usage: "Generate URLs for download access.",
Action: mainShareDownload,
Flags: append(shareDownloadFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc share {{.Name}} - {{.Usage}}
USAGE:
mc share {{.Name}} [OPTIONS] TARGET [TARGET...]
OPTIONS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Share this object with 7 days default expiry.
$ mc share {{.Name}} s3/backup/2006-Mar-1/backup.tar.gz
2. Share this object with 10 minutes expiry.
$ mc share {{.Name}} --expire=10m s3/backup/2006-Mar-1/backup.tar.gz
3. Share all objects under this folder with 5 days expiry.
$ mc share {{.Name}} --expire=120h s3/backup/
4. Share all objects under this folder and all its sub-folders with 5 days expiry.
$ mc share {{.Name}} --recursive --expire=120h s3/backup/
`,
}
// checkShareDownloadSyntax - validate command-line args.
func checkShareDownloadSyntax(ctx *cli.Context) {
args := ctx.Args()
if !args.Present() {
cli.ShowCommandHelpAndExit(ctx, "download", 1) // last argument is exit code.
}
// Parse expiry.
expiry := shareDefaultExpiry
expireArg := ctx.String("expire")
if expireArg != "" {
var e error
expiry, e = time.ParseDuration(expireArg)
fatalIf(probe.NewError(e), "Unable to parse expire=‘"+expireArg+"’.")
}
// Validate expiry.
if expiry.Seconds() < 1 {
fatalIf(errDummy().Trace(expiry.String()), "Expiry cannot be lesser than 1 second.")
}
if expiry.Seconds() > 604800 {
fatalIf(errDummy().Trace(expiry.String()), "Expiry cannot be larger than 7 days.")
}
for _, url := range ctx.Args() {
_, _, err := url2Stat(url)
fatalIf(err.Trace(url), "Unable to stat ‘"+url+"’.")
}
}
// doShareURL share files from target.
func doShareDownloadURL(targetURL string, isRecursive bool, expiry time.Duration) *probe.Error {
targetAlias, targetURLFull, _, err := expandAlias(targetURL)
if err != nil {
return err.Trace(targetURL)
}
clnt, err := newClientFromAlias(targetAlias, targetURLFull)
if err != nil {
return err.Trace(targetURL)
}
// Load previously saved upload-shares. Add new entries and write it back.
shareDB := newShareDBV1()
shareDownloadsFile := getShareDownloadsFile()
err = shareDB.Load(shareDownloadsFile)
if err != nil {
return err.Trace(shareDownloadsFile)
}
// Generate share URL for each target.
incomplete := false
for content := range clnt.List(isRecursive, incomplete) {
if content.Err != nil {
return content.Err.Trace(clnt.GetURL().String())
}
// if any incoming directories, we don't need to calculate.
if content.Type.IsDir() {
continue
}
objectURL := content.URL.String()
newClnt, err := newClientFromAlias(targetAlias, objectURL)
if err != nil {
return err.Trace(objectURL)
}
// Generate share URL.
shareURL, err := newClnt.ShareDownload(expiry)
if err != nil {
// add objectURL and expiry as part of the trace arguments.
return err.Trace(objectURL, "expiry="+expiry.String())
}
// Make new entries to shareDB.
contentType := "" // Not useful for download shares.
shareDB.Set(objectURL, shareURL, expiry, contentType)
printMsg(shareMesssage{
ObjectURL: objectURL,
ShareURL: shareURL,
TimeLeft: expiry,
ContentType: contentType,
})
}
// Save downloads and return.
return shareDB.Save(shareDownloadsFile)
}
// main for share download.
func mainShareDownload(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check input arguments.
checkShareDownloadSyntax(ctx)
// Initialize share config folder.
initShareConfig()
// Additional command speific theme customization.
shareSetColor()
// Set command flags from context.
isRecursive := ctx.Bool("recursive")
expiry := shareDefaultExpiry
if ctx.String("expire") != "" {
var e error
expiry, e = time.ParseDuration(ctx.String("expire"))
fatalIf(probe.NewError(e), "Unable to parse expire=‘"+ctx.String("expire")+"’.")
}
for _, targetURL := range ctx.Args() {
err := doShareDownloadURL(targetURL, isRecursive, expiry)
fatalIf(err.Trace(targetURL), "Unable to share target ‘"+targetURL+"’.")
}
}
+123
View File
@@ -0,0 +1,123 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"fmt"
"time"
"github.com/minio/cli"
"github.com/minio/minio-xl/pkg/probe"
)
var (
shareListFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of share list.",
},
}
)
// Share documents via URL.
var shareList = cli.Command{
Name: "list",
Usage: "List previously shared objects and folders.",
Action: mainShareList,
Flags: append(shareListFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc share {{.Name}} COMMAND - {{.Usage}}
COMMAND:
upload: list previously shared access to uploads.
download: list previously shared access to downloads.
USAGE:
mc share {{.Name}}
EXAMPLES:
1. List previously shared downloads, that haven't expired yet.
$ mc share {{.Name}} download
2. List previously shared uploads, that haven't expired yet.
$ mc share {{.Name}} upload
`,
}
// validate command-line args.
func checkShareListSyntax(ctx *cli.Context) {
args := ctx.Args()
if !args.Present() || (args.First() != "upload" && args.First() != "download") {
cli.ShowCommandHelpAndExit(ctx, "list", 1) // last argument is exit code.
}
}
// doShareList list shared url's.
func doShareList(cmd string) *probe.Error {
if cmd != "upload" && cmd != "download" {
return probe.NewError(fmt.Errorf("Unknown argument ‘%s’ passed.", cmd))
}
// Fetch defaults.
uploadsFile := getShareUploadsFile()
downloadsFile := getShareDownloadsFile()
// Load previously saved upload-shares.
shareDB := newShareDBV1()
// if upload - read uploads file.
if cmd == "upload" {
if err := shareDB.Load(uploadsFile); err != nil {
return err.Trace(uploadsFile)
}
}
// if download - read downloads file.
if cmd == "download" {
if err := shareDB.Load(downloadsFile); err != nil {
return err.Trace(downloadsFile)
}
}
// Print previously shared entries.
for shareURL, share := range shareDB.Shares {
printMsg(shareMesssage{
ObjectURL: share.URL,
ShareURL: shareURL,
TimeLeft: share.Expiry - time.Since(share.Date),
ContentType: share.ContentType,
})
}
return nil
}
// main entry point for share list.
func mainShareList(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// validate command-line args.
checkShareListSyntax(ctx)
// Additional command speific theme customization.
shareSetColor()
// Initialize share config folder.
initShareConfig()
// List shares.
fatalIf(doShareList(ctx.Args().First()).Trace(), "Unable to list previously shared URLs.")
}
+91
View File
@@ -0,0 +1,91 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"os"
"path/filepath"
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
)
var (
shareFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of share.",
},
}
)
// Share documents via URL.
var shareCmd = cli.Command{
Name: "share",
Usage: "Generate URL for sharing.",
Action: mainShare,
Flags: append(shareFlags, globalFlags...),
Subcommands: []cli.Command{
shareDownload,
shareUpload,
shareList,
},
CustomHelpTemplate: `NAME:
{{.Name}} - {{.Usage}}
USAGE:
{{.Name}} [FLAGS] COMMAND
FLAGS:
{{range .Flags}}{{.}}
{{end}}
COMMANDS:
{{range .Commands}}{{join .Names ", "}}{{ "\t" }}{{.Usage}}
{{end}}
`,
}
// migrateShare migrate to newest version sequentially.
func migrateShare() {
if !isShareDirExists() {
return
}
// Shared URLs are now managed by sub-commands. So delete any old URLs file if found.
oldShareFile := filepath.Join(mustGetShareDir(), "urls.json")
if _, e := os.Stat(oldShareFile); e == nil {
// Old file exits.
e := os.Remove(oldShareFile)
fatalIf(probe.NewError(e), "Unable to delete old ‘"+oldShareFile+"’.")
console.Infof("Removed older version of share ‘%s’ file.\n", oldShareFile)
}
}
// mainShare - main handler for mc share command.
func mainShare(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
if ctx.Args().First() != "" { // command help.
cli.ShowCommandHelp(ctx, ctx.Args().First())
} else { // mc help.
cli.ShowAppHelp(ctx)
}
// Sub-commands like "upload" and "download" have their own main.
}
+212
View File
@@ -0,0 +1,212 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"fmt"
"strings"
"time"
"github.com/minio/cli"
"github.com/minio/mc/pkg/client"
"github.com/minio/minio-xl/pkg/probe"
)
var (
shareUploadFlags = []cli.Flag{
cli.BoolFlag{
Name: "help, h",
Usage: "Help of share download.",
},
cli.BoolFlag{
Name: "recursive, r",
Usage: "Recursively upload any object matching the prefix.",
},
shareFlagExpire,
shareFlagContentType,
}
)
// Share documents via URL.
var shareUpload = cli.Command{
Name: "upload",
Usage: "Generate ‘curl’ command to upload objects without requiring access/secret keys.",
Action: mainShareUpload,
Flags: append(shareUploadFlags, globalFlags...),
CustomHelpTemplate: `NAME:
mc share {{.Name}} - {{.Usage}}
USAGE:
mc share {{.Name}} [OPTIONS] TARGET [TARGET...]
OPTIONS:
{{range .Flags}}{{.}}
{{end}}
EXAMPLES:
1. Generate a curl command to allow upload access for a single object. Command expires in 7 days (default).
$ mc share {{.Name}} s3/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 s3/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 s3/backup/2007-Mar-2/
4. Generate a curl command to allow upload access to any objects matching the key prefix 'backup/'. Command expires in 2 hours.
$ mc share {{.Name}} --recursive --expire=2h s3/backup/2007-Mar-2/backup/
`,
}
// checkShareUploadSyntax - validate command-line args.
func checkShareUploadSyntax(ctx *cli.Context) {
args := ctx.Args()
if !args.Present() {
cli.ShowCommandHelpAndExit(ctx, "upload", 1) // last argument is exit code.
}
// Set command flags from context.
isRecursive := ctx.Bool("recursive")
expireArg := ctx.String("expire")
// Parse expiry.
expiry := shareDefaultExpiry
if expireArg != "" {
var e error
expiry, e = time.ParseDuration(expireArg)
fatalIf(probe.NewError(e), "Unable to parse expire=‘"+expireArg+"’.")
}
// Validate expiry.
if expiry.Seconds() < 1 {
fatalIf(errDummy().Trace(expiry.String()),
"Expiry cannot be lesser than 1 second.")
}
if expiry.Seconds() > 604800 {
fatalIf(errDummy().Trace(expiry.String()),
"Expiry cannot be larger than 7 days.")
}
for _, targetURL := range ctx.Args() {
url := client.NewURL(targetURL)
if strings.HasSuffix(targetURL, string(url.Separator)) && !isRecursive {
fatalIf(errInvalidArgument().Trace(targetURL),
"Use --recursive option to generate curl command for prefixes.")
}
}
}
// makeCurlCmd constructs curl command-line.
func makeCurlCmd(key string, isRecursive bool, uploadInfo map[string]string) string {
URL := client.NewURL(key)
postURL := URL.Scheme + URL.SchemeSeparator + URL.Host + string(URL.Separator)
if !isBucketVirtualStyle(URL.Host) {
postURL = postURL + uploadInfo["bucket"]
}
postURL += " "
curlCommand := "curl " + postURL
for k, v := range uploadInfo {
if k == "key" {
key = v
continue
}
curlCommand += fmt.Sprintf("-F %s=%s ", k, v)
}
// If key starts with is enabled prefix it with the output.
if isRecursive {
curlCommand += fmt.Sprintf("-F key=%s<NAME> ", key) // Object name.
} else {
curlCommand += fmt.Sprintf("-F key=%s ", key) // Object name.
}
curlCommand += "-F file=@<FILE>" // File to upload.
return curlCommand
}
// save shared URL to disk.
func saveSharedURL(objectURL string, shareURL string, expiry time.Duration, contentType string) *probe.Error {
// Load previously saved upload-shares.
shareDB := newShareDBV1()
if err := shareDB.Load(getShareUploadsFile()); err != nil {
return err.Trace(getShareUploadsFile())
}
// Make new entries to uploadsDB.
shareDB.Set(objectURL, shareURL, expiry, contentType)
shareDB.Save(getShareUploadsFile())
return nil
}
// doShareUploadURL uploads files to the target.
func doShareUploadURL(objectURL string, isRecursive bool, expiry time.Duration, contentType string) *probe.Error {
clnt, err := newClient(objectURL)
if err != nil {
return err.Trace(objectURL)
}
// Generate pre-signed access info.
uploadInfo, err := clnt.ShareUpload(isRecursive, expiry, contentType)
if err != nil {
return err.Trace(objectURL, "expiry="+expiry.String(), "contentType="+contentType)
}
// Get the new expanded url.
objectURL = clnt.GetURL().String()
// Generate curl command.
curlCmd := makeCurlCmd(objectURL, isRecursive, uploadInfo)
printMsg(shareMesssage{
ObjectURL: objectURL,
ShareURL: curlCmd,
TimeLeft: expiry,
ContentType: contentType,
})
// save shared URL to disk.
return saveSharedURL(objectURL, curlCmd, expiry, contentType)
}
// main for share upload command.
func mainShareUpload(ctx *cli.Context) {
// Set global flags from context.
setGlobalsFromContext(ctx)
// check input arguments.
checkShareUploadSyntax(ctx)
// Initialize share config folder.
initShareConfig()
// Additional command speific theme customization.
shareSetColor()
// Set command flags from context.
isRecursive := ctx.Bool("recursive")
expireArg := ctx.String("expire")
expiry := shareDefaultExpiry
contentType := ctx.String("content-type")
if expireArg != "" {
var e error
expiry, e = time.ParseDuration(expireArg)
fatalIf(probe.NewError(e), "Unable to parse expire=‘"+expireArg+"’.")
}
for _, targetURL := range ctx.Args() {
err := doShareUploadURL(targetURL, isRecursive, expiry, contentType)
fatalIf(err.Trace(targetURL), "Unable to generate curl command for upload ‘"+targetURL+"’.")
}
}
+197
View File
@@ -0,0 +1,197 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"bytes"
"encoding/json"
"fmt"
"os"
"path/filepath"
"strings"
"time"
"github.com/fatih/color"
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio-xl/pkg/probe"
)
const (
// Default expiry is 7 days (168h).
shareDefaultExpiry = time.Duration(604800) * time.Second
)
// Upload specific flags.
var (
shareFlagContentType = cli.StringFlag{
Name: "content-type, T",
Usage: "Speific content-type to allow.",
}
shareFlagExpire = cli.StringFlag{
Name: "expire, E",
Value: "168h",
Usage: "Set expiry in NN[h|m|s].",
}
)
// Structured share command message.
type shareMesssage struct {
Status string `json:"status"`
ObjectURL string `json:"url"`
ShareURL string `json:"share"`
TimeLeft time.Duration `json:"timeLeft"`
ContentType string `json:"contentType,omitempty"` // Only used by upload cmd.
}
// String - Themefied string message for console printing.
func (s shareMesssage) String() string {
msg := console.Colorize("URL", fmt.Sprintf("URL: %s\n", s.ObjectURL))
msg += console.Colorize("Expire", fmt.Sprintf("Expire: %s\n", timeDurationToHumanizedTime(s.TimeLeft)))
if s.ContentType != "" {
msg += console.Colorize("Content-type", fmt.Sprintf("Content-Type: %s\n", s.ContentType))
}
// Highlight <FILE> specifically. "share upload" sub-commands use this identifier.
shareURL := strings.Replace(s.ShareURL, "<FILE>", console.Colorize("File", "<FILE>"), 1)
// Highlight <KEY> specifically for recursive operation.
shareURL = strings.Replace(shareURL, "<NAME>", console.Colorize("File", "<NAME>"), 1)
msg += console.Colorize("Share", fmt.Sprintf("Share: %s\n", shareURL))
return msg
}
// JSON - JSONified message for scripting.
func (s shareMesssage) JSON() string {
s.Status = "success"
shareMessageBytes, e := json.Marshal(s)
fatalIf(probe.NewError(e), "Failed to marshal into JSON.")
// JSON encoding escapes ampersand into its unicode character
// which is not usable directly for share and fails with cloud
// storage. convert them back so that they are usable.
shareMessageBytes = bytes.Replace(shareMessageBytes, []byte("\\u0026"), []byte("&"), -1)
shareMessageBytes = bytes.Replace(shareMessageBytes, []byte("\\u003c"), []byte("<"), -1)
shareMessageBytes = bytes.Replace(shareMessageBytes, []byte("\\u003e"), []byte(">"), -1)
return string(shareMessageBytes)
}
// shareSetColor sets colors share sub-commands.
func shareSetColor() {
// Additional command speific theme customization.
console.SetColor("URL", color.New(color.FgWhite, color.Bold))
console.SetColor("Expire", color.New(color.FgCyan))
console.SetColor("Content-type", color.New(color.FgBlue))
console.SetColor("Share", color.New(color.FgGreen))
console.SetColor("File", color.New(color.FgRed, color.Bold))
}
// Get share dir name.
func getShareDir() (string, *probe.Error) {
configDir, err := getMcConfigDir()
if err != nil {
return "", err.Trace()
}
sharedURLsDataDir := filepath.Join(configDir, globalSharedURLsDataDir)
return sharedURLsDataDir, nil
}
// Get share dir name or die. (NOTE: This ‘Die’ approach is only OK for mc like tools.).
func mustGetShareDir() string {
shareDir, err := getShareDir()
fatalIf(err.Trace(), "Unable to determine share folder.")
return shareDir
}
// Check if the share dir exists.
func isShareDirExists() bool {
if _, e := os.Stat(mustGetShareDir()); e != nil {
return false
}
return true
}
// Create config share dir.
func createShareDir() *probe.Error {
if e := os.MkdirAll(mustGetShareDir(), 0700); e != nil {
return probe.NewError(e)
}
return nil
}
// Get share uploads file.
func getShareUploadsFile() string {
return filepath.Join(mustGetShareDir(), "uploads.json")
}
// Get share downloads file.
func getShareDownloadsFile() string {
return filepath.Join(mustGetShareDir(), "downloads.json")
}
// Check if share uploads file exists?.
func isShareUploadsExists() bool {
if _, e := os.Stat(getShareUploadsFile()); e != nil {
return false
}
return true
}
// Check if share downloads file exists?.
func isShareDownloadsExists() bool {
if _, e := os.Stat(getShareDownloadsFile()); e != nil {
return false
}
return true
}
// Initialize share uploads file.
func initShareUploadsFile() *probe.Error {
return newShareDBV1().Save(getShareUploadsFile())
}
// Initialize share downloads file.
func initShareDownloadsFile() *probe.Error {
return newShareDBV1().Save(getShareDownloadsFile())
}
// Initialize share directory, if not done already.
func initShareConfig() {
// Share directory.
if !isShareDirExists() {
fatalIf(createShareDir().Trace(mustGetShareDir()),
"Failed to create share ‘"+mustGetShareDir()+"’ folder.")
console.Infof("Successfully created ‘%s’.\n", mustGetShareDir())
}
// Uploads share file.
if !isShareUploadsExists() {
fatalIf(initShareUploadsFile().Trace(getShareUploadsFile()),
"Failed to initialize share uploads ‘"+getShareUploadsFile()+"’ file.")
console.Infof("Initialized share uploads ‘%s’ file.\n", getShareUploadsFile())
}
// Downloads share file.
if !isShareDownloadsExists() {
fatalIf(initShareDownloadsFile().Trace(getShareDownloadsFile()),
"Failed to initialize share downloads ‘"+getShareDownloadsFile()+"’ file.")
console.Infof("Initialized share downloads ‘%s’ file.\n", getShareDownloadsFile())
}
}
+46
View File
@@ -0,0 +1,46 @@
/*
* Minio Client, (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
import (
"os"
"os/signal"
)
// signalTrap traps the registered signals and notifies the caller.
func signalTrap(sig ...os.Signal) <-chan bool {
// channel to notify the caller.
trapCh := make(chan bool, 1)
go func(chan<- bool) {
// channel to receive signals.
sigCh := make(chan os.Signal, 1)
defer close(sigCh)
// `signal.Notify` registers the given channel to
// receive notifications of the specified signals.
signal.Notify(sigCh, sig...)
// Wait for the signal.
<-sigCh
// Notify the caller.
trapCh <- true
}(trapCh)
return trapCh
}
+34
View File
@@ -0,0 +1,34 @@
/*
* Minio Client (C) 2015 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package main
// commonPrefix returns the longest common prefix between two strings.
func commonPrefix(first, second string) string {
if first == "" || second == "" {
return ""
}
if first > second {
// Pick the shorter one for looping.
first, second = second, first
}
for i := range first {
if first[i] != second[i] {
return first[:i]
}
}
return first
}
+24
View File
@@ -0,0 +1,24 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof
+202
View File
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+2
View File
@@ -0,0 +1,2 @@
## mc-tests
Scripts written for daily automated testing.
+69
View File
@@ -0,0 +1,69 @@
#!/bin/bash
ME=$(basename "$0")
BASE_DIR=$(dirname "$0")
MINIO_WORK_DIR="$PWD/automated-tests"
TEST_CASE_DIR="$BASE_DIR/tests"
function fatal()
{
ec=$1
shift
if [ "$@" ]; then
echo "Fatal: $@" >&2
fi
exit $ec
}
function error()
{
echo "Error: $@" >&2
}
function msg()
{
echo "Info: $@" >&1
}
function go_get()
{
go get -d -u "$@" && make -C "$GOPATH/src/$@"
rv=$?
if [ $rv -ne 0 ]; then
error "failed to get $@."
return $rv
fi
}
function run_minio()
{
go_get github.com/minio/minio || fatal 1
[ ! -d "$MINIO_WORK_DIR" ] && mkdir -p "$MINIO_WORK_DIR"
minio --anonymous server "$MINIO_WORK_DIR" || fatal 1 "failed to run minio server."
}
function install_mc()
{
go_get github.com/minio/mc || fatal 2
}
function main()
{
which go >/dev/null || fatal 1 "go executable not found."
[ "$GOPATH" ] || fatal 1 "GOPATH env not found."
if [ "$1" == "minio" ]; then
msg "Running minio server."
run_minio
fi
msg "Running all mc tests."
for test_script in $TEST_CASE_DIR/*; do
if [ -x "$test_script" ]; then
"$test_script" "$@" || error "test $test_script failed."
fi
done
}
main "$@"
+5
View File
@@ -0,0 +1,5 @@
# Test case HOWTO
* Test case is usually a bash shell script, but technically any executable
* Test case is run with two arguments now ie server-name and source-dir-name.
* Test case should check/validate mc command output and return exit code accordingly.
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
server="$1"
mc --json access set readonly "$server/testbucket"
# TODO: validate output
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
server="$1"
dir="$2"
mc --json cp "$dir..." "$server/testbucket"
# TODO: validate output
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
server="$1"
mc --json ls "$server"
# TODO: validate output
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
server="$1"
mc --json rm --force "$server/testbucket..."
# TODO: validate output

Some files were not shown because too many files have changed in this diff Show More