Fix the server startup messages and help text. (#3211)

master
Harshavardhana 8 years ago committed by GitHub
parent 5741a53d46
commit 2f373684f5
  1. 2
      MAINTAINERS.md
  2. 2
      cmd/bucket-policy-handlers_test.go
  3. 8
      cmd/config-migrate_test.go
  4. 2
      cmd/config-v9_test.go
  5. 8
      cmd/event-notifier_test.go
  6. 2
      cmd/fs-v1.go
  7. 6
      cmd/main.go
  8. 2
      cmd/posix_test.go
  9. 2
      cmd/post-policy_test.go
  10. 30
      cmd/server-main.go
  11. 2
      cmd/server-startup-msg.go
  12. 38
      cmd/web-handlers_test.go
  13. 18
      docs/FreeBSD.md
  14. 3
      docs/setup-replication-between-two-sites-running-minio.md
  15. 66
      pkg/quick/quick_test.go

@ -18,7 +18,7 @@ $
- Run `go get foo/bar`
- Edit your code to import foo/bar
- Run `govendor add foo/bar` from top-level folder
- Run `govendor add foo/bar` from top-level directory
#### Remove dependencies

@ -61,7 +61,7 @@ func TestBucketPolicyResourceMatch(t *testing.T) {
// Policy with resource ending with bucket/oo* should allow access to bucket/ootput.txt.
{generateResource("minio-bucket", "ootput.txt"), generateStatement(fmt.Sprintf("%s%s", AWSResourcePrefix, "minio-bucket"+"/oo*")), true},
// Test case - 7.
// Policy with resource ending with bucket/oo* allows access to all subfolders starting with "oo" inside given bucket.
// Policy with resource ending with bucket/oo* allows access to all sub-dirs starting with "oo" inside given bucket.
{generateResource("minio-bucket", "oop-bucket/my-file"), generateStatement(fmt.Sprintf("%s%s", AWSResourcePrefix, "minio-bucket"+"/oo*")), true},
// Test case - 8.
{generateResource("minio-bucket", "Asia/India/1.pjg"), generateStatement(fmt.Sprintf("%s%s", AWSResourcePrefix, "minio-bucket"+"/Asia/Japan/*")), false},

@ -31,7 +31,7 @@ func TestServerConfigMigrateV1(t *testing.T) {
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
setGlobalConfigPath(rootPath)
@ -65,7 +65,7 @@ func TestServerConfigMigrateInexistentConfig(t *testing.T) {
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
setGlobalConfigPath(rootPath)
@ -105,7 +105,7 @@ func TestServerConfigMigrateV2toV9(t *testing.T) {
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
setGlobalConfigPath(rootPath)
@ -164,7 +164,7 @@ func TestServerConfigMigrateFaultyConfig(t *testing.T) {
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
setGlobalConfigPath(rootPath)

@ -26,7 +26,7 @@ func TestServerConfig(t *testing.T) {
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
if serverConfig.GetRegion() != "us-east-1" {

@ -31,7 +31,7 @@ func TestInitEventNotifierFaultyDisks(t *testing.T) {
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
disks, err := getRandomDisks(1)
@ -85,7 +85,7 @@ func TestInitEventNotifierWithAMQP(t *testing.T) {
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
disks, err := getRandomDisks(1)
@ -116,7 +116,7 @@ func TestInitEventNotifierWithElasticSearch(t *testing.T) {
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
disks, err := getRandomDisks(1)
@ -147,7 +147,7 @@ func TestInitEventNotifierWithRedis(t *testing.T) {
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
disks, err := getRandomDisks(1)

@ -164,7 +164,7 @@ func (fs fsObjects) ListBuckets() ([]BucketInfo, error) {
Created: vol.Created,
})
}
// Print a user friendly message if we indeed skipped certain folders which are
// Print a user friendly message if we indeed skipped certain directories which are
// incompatible with S3's bucket name restrictions.
if len(invalidBucketNames) > 0 {
errorIf(errors.New("One or more invalid bucket names found"), "Skipping %s", invalidBucketNames)

@ -38,7 +38,7 @@ var (
cli.StringFlag{
Name: "config-dir, C",
Value: mustGetConfigPath(),
Usage: "Path to configuration folder.",
Usage: "Path to configuration directory.",
},
cli.BoolFlag{
Name: "quiet",
@ -146,7 +146,7 @@ func checkMainSyntax(c *cli.Context) {
console.Fatalf("Unable to obtain user's home directory. \nError: %s\n", err)
}
if configPath == "" {
console.Fatalln("Config folder cannot be empty, please specify --config-dir <foldername>.")
console.Fatalln("Config directory cannot be empty, please specify --config-dir <directoryname>.")
}
}
@ -158,7 +158,7 @@ func Main() {
if configDir == "" {
fatalIf(errors.New("Config directory is empty"), "Unable to get config file.")
}
// Sets new config folder.
// Sets new config directory.
setGlobalConfigPath(configDir)
// Valid input arguments to main.

@ -1341,7 +1341,7 @@ func TestRenameFile(t *testing.T) {
expectedErr: errFaultyDisk,
},
// Test case - 10.
// Test case with source being a file and destination being a folder.
// Test case with source being a file and destination being a directory.
// Either both have to be files or directories.
// Expecting to fail with `errFileAccessDenied`.
{

@ -109,7 +109,7 @@ func testPostPolicyHandler(obj ObjectLayer, instanceType string, t TestErrHandle
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()

@ -36,11 +36,11 @@ var serverFlags = []cli.Flag{
cli.StringFlag{
Name: "address",
Value: ":9000",
Usage: "Specify custom server \"ADDRESS:PORT\", defaults to \":9000\".",
Usage: `Bind to a specific IP:PORT. Defaults to ":9000".`,
},
cli.StringFlag{
Name: "ignore-disks",
Usage: "Specify comma separated list of disks that are offline.",
Usage: `Comma separated list of faulty drives to ignore at startup.`,
},
}
@ -60,37 +60,29 @@ FLAGS:
{{end}}
ENVIRONMENT VARIABLES:
ACCESS:
MINIO_ACCESS_KEY: Access key string of 5 to 20 characters in length.
MINIO_SECRET_KEY: Secret key string of 8 to 40 characters in length.
MINIO_ACCESS_KEY: Username or access key of 5 to 20 characters in length.
MINIO_SECRET_KEY: Password or secret key of 8 to 40 characters in length.
CACHING:
MINIO_CACHE_SIZE: Set total cache size in NN[GB|MB|KB]. Defaults to 8GB.
MINIO_CACHE_EXPIRY: Set cache expiration duration in NN[h|m|s]. Defaults to 72 hours.
MINIO_CACHE_SIZE: Limit maximum cache size. Allowed units are [GB|MB|KB]. Defaults to 8GB.
MINIO_CACHE_EXPIRY: Automatically expire cached objects. Allowed units are [h|m|s]. Defaults to 72h.
SECURITY:
MINIO_SECURE_CONSOLE: Set secure console to '0' to disable printing secret key. Defaults to '1'.
MINIO_SECURE_CONSOLE: Set secure console to 'no' to disable printing secret key. Defaults to 'yes'.
EXAMPLES:
1. Start minio server.
1. Start minio server on "/home/shared" directory.
$ minio {{.Name}} /home/shared
2. Start minio server bound to a specific IP:PORT, when you have multiple network interfaces.
2. Start minio server bound to a specific IP:PORT.
$ minio {{.Name}} --address 192.168.1.101:9000 /home/shared
3. Start minio server on Windows.
$ minio {{.Name}} C:\MyShare
4. Start minio server on 12 disks to enable erasure coded layer with 6 data and 6 parity.
3. Start erasure coded minio server on a 12 disks server.
$ minio {{.Name}} /mnt/export1/ /mnt/export2/ /mnt/export3/ /mnt/export4/ \
/mnt/export5/ /mnt/export6/ /mnt/export7/ /mnt/export8/ /mnt/export9/ \
/mnt/export10/ /mnt/export11/ /mnt/export12/
5. Start minio server on 12 disks while ignoring two disks for initialization.
$ minio {{.Name}} --ignore-disks=/mnt/export1/ /mnt/export1/ /mnt/export2/ \
/mnt/export3/ /mnt/export4/ /mnt/export5/ /mnt/export6/ /mnt/export7/ \
/mnt/export8/ /mnt/export9/ /mnt/export10/ /mnt/export11/ /mnt/export12/
6. Start minio server for a 4 node distributed setup. Type the following command on all the 4 nodes exactly.
4. Start erasure coded distributed minio server on a 4 node setup with 1 drive each. Run following commands on all the 4 nodes.
$ export MINIO_ACCESS_KEY=minio
$ export MINIO_SECRET_KEY=miniostorage
$ minio {{.Name}} http://192.168.1.11/mnt/export/ http://192.168.1.12/mnt/export/ \

@ -74,7 +74,7 @@ func printServerCommonMsg(endPoints []string) {
console.Println(colorBlue("\nEndpoint: ") + colorBold(fmt.Sprintf(getFormatStr(len(endPointStr), 1), endPointStr)))
console.Println(colorBlue("AccessKey: ") + colorBold(fmt.Sprintf("%s ", cred.AccessKeyID)))
secretKey := cred.SecretAccessKey
if os.Getenv("MINIO_SECURE_CONSOLE") == "0" {
if strings.EqualFold(os.Getenv("MINIO_SECURE_CONSOLE"), "no") {
secretKey = "*REDACTED*"
}
console.Println(colorBlue("SecretKey: ") + colorBold(fmt.Sprintf("%s ", secretKey)))

@ -132,7 +132,7 @@ func testLoginWebHandler(obj ObjectLayer, instanceType string, t TestErrHandler)
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -180,7 +180,7 @@ func testStorageInfoWebHandler(obj ObjectLayer, instanceType string, t TestErrHa
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -226,7 +226,7 @@ func testServerInfoWebHandler(obj ObjectLayer, instanceType string, t TestErrHan
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -272,7 +272,7 @@ func testMakeBucketWebHandler(obj ObjectLayer, instanceType string, t TestErrHan
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -332,7 +332,7 @@ func testListBucketsWebHandler(obj ObjectLayer, instanceType string, t TestErrHa
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -389,7 +389,7 @@ func testListObjectsWebHandler(obj ObjectLayer, instanceType string, t TestErrHa
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -461,7 +461,7 @@ func testRemoveObjectWebHandler(obj ObjectLayer, instanceType string, t TestErrH
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -522,7 +522,7 @@ func testGenerateAuthWebHandler(obj ObjectLayer, instanceType string, t TestErrH
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -568,7 +568,7 @@ func testSetAuthWebHandler(obj ObjectLayer, instanceType string, t TestErrHandle
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -628,7 +628,7 @@ func testGetAuthWebHandler(obj ObjectLayer, instanceType string, t TestErrHandle
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -673,7 +673,7 @@ func testUploadWebHandler(obj ObjectLayer, instanceType string, t TestErrHandler
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -737,7 +737,7 @@ func testDownloadWebHandler(obj ObjectLayer, instanceType string, t TestErrHandl
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -793,7 +793,7 @@ func testWebPresignedGetHandler(obj ObjectLayer, instanceType string, t TestErrH
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -905,7 +905,7 @@ func testWebGetBucketPolicyHandler(obj ObjectLayer, instanceType string, t TestE
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -988,7 +988,7 @@ func testWebListAllBucketPoliciesHandler(obj ObjectLayer, instanceType string, t
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -1094,7 +1094,7 @@ func testWebSetBucketPolicyHandler(obj ObjectLayer, instanceType string, t TestE
if err != nil {
t.Fatalf("Init Test config failed")
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
credentials := serverConfig.GetCredential()
@ -1174,7 +1174,7 @@ func TestWebCheckAuthorization(t *testing.T) {
if err != nil {
t.Fatal("Init Test config failed", err)
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
rec := httptest.NewRecorder()
@ -1256,7 +1256,7 @@ func TestWebObjectLayerNotReady(t *testing.T) {
if err != nil {
t.Fatal("Init Test config failed", err)
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
rec := httptest.NewRecorder()
@ -1354,7 +1354,7 @@ func TestWebObjectLayerFaultyDisks(t *testing.T) {
if err != nil {
t.Fatal("Init Test config failed", err)
}
// remove the root folder after the test ends.
// remove the root directory after the test ends.
defer removeAll(rootPath)
rec := httptest.NewRecorder()

@ -110,24 +110,6 @@ $ curl https://dl.minio.io/server/minio/release/freebsd-amd64/minio > minio
$ chmod 755 minio
$ ./minio server /minio-example/compressed-objects
Endpoint: http://10.0.0.10:9000 http://127.0.0.1:9000 http://172.17.0.1:9000
AccessKey: USWUXHGYZQYFYFFIT3RE
SecretKey: MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
Region: us-east-1
Browser Access:
http://10.0.0.10:9000 http://127.0.0.1:9000 http://172.17.0.1:9000
Command-line Access: https://docs.minio.io/docs/minio-client-quickstart-guide
$ mc config host add myminio http://localhost:9000 USWUXHGYZQYFYFFIT3RE MOJRH0mkL1IPauahWITSVvyDrQbEEIwljvmxdq03
Object API (Amazon S3 compatible):
Go: https://docs.minio.io/docs/golang-client-quickstart-guide
Java: https://docs.minio.io/docs/java-client-quickstart-guide
Python: https://docs.minio.io/docs/python-client-quickstart-guide
JavaScript: https://docs.minio.io/docs/javascript-client-quickstart-guide
```
Point your browser to http://localhost:9000 and login with the credentials displayed on the command line.

@ -3,7 +3,6 @@
![minio_MIRROR](https://github.com/minio/minio/blob/master/docs/screenshots/miniomirror.jpeg?raw=true)
In this document we will illustrate how to set up replication between two Minio servers, `minio1` and `minio2` running on ``192.168.1.11`` and ``192.168.1.12`` respectively. We will mirror the data directory on `minio1` to the bucket on `minio2`.
@ -24,6 +23,7 @@ Endpoint: http://127.0.0.1:9000 http://192.168.1.11:9000
AccessKey: MURIVYBYNPTYE7O8I779
SecretKey: lVbZmz4CvGkBl7JKw5icuL7RCcSvpBJTkAJTFQwz
Region: us-east-1
...
```
**mc alias**
@ -55,6 +55,7 @@ Endpoint: http://127.0.0.1:9000 http://192.168.1.12:9000
AccessKey: YRDRWWQLEWS9OBJ31GZ2
SecretKey: y2sSWzx5ytwvkELcxOuSaQ8n3doNqoIilRpb5Kjj
Region: us-east-1
...
```
```sh

@ -53,9 +53,9 @@ func (s *MySuite) TestCheckData(c *C) {
c.Assert(err, Not(IsNil))
type myStructBadNoVersion struct {
User string
Password string
Folders []string
User string
Password string
Directories []string
}
saveMeBadNoVersion := myStructBadNoVersion{"guest", "nopassword", []string{"Work", "Documents", "Music"}}
err = quick.CheckData(&saveMeBadNoVersion)
@ -71,10 +71,10 @@ func (s *MySuite) TestCheckData(c *C) {
c.Assert(err, Not(IsNil))
type myStructGood struct {
Version string
User string
Password string
Folders []string
Version string
User string
Password string
Directories []string
}
saveMeGood := myStructGood{"1", "guest", "nopassword", []string{"Work", "Documents", "Music"}}
@ -84,10 +84,10 @@ func (s *MySuite) TestCheckData(c *C) {
func (s *MySuite) TestLoadFile(c *C) {
type myStruct struct {
Version string
User string
Password string
Folders []string
Version string
User string
Password string
Directories []string
}
saveMe := myStruct{}
_, err := quick.Load("test.json", &saveMe)
@ -125,10 +125,10 @@ func (s *MySuite) TestLoadFile(c *C) {
func (s *MySuite) TestVersion(c *C) {
defer os.RemoveAll("test.json")
type myStruct struct {
Version string
User string
Password string
Folders []string
Version string
User string
Password string
Directories []string
}
saveMe := myStruct{"1", "guest", "nopassword", []string{"Work", "Documents", "Music"}}
config, err := quick.New(&saveMe)
@ -158,10 +158,10 @@ func (s *MySuite) TestVersion(c *C) {
func (s *MySuite) TestSaveLoad(c *C) {
defer os.RemoveAll("test.json")
type myStruct struct {
Version string
User string
Password string
Folders []string
Version string
User string
Password string
Directories []string
}
saveMe := myStruct{"1", "guest", "nopassword", []string{"Work", "Documents", "Music"}}
config, err := quick.New(&saveMe)
@ -188,10 +188,10 @@ func (s *MySuite) TestSaveBackup(c *C) {
defer os.RemoveAll("test.json")
defer os.RemoveAll("test.json.old")
type myStruct struct {
Version string
User string
Password string
Folders []string
Version string
User string
Password string
Directories []string
}
saveMe := myStruct{"1", "guest", "nopassword", []string{"Work", "Documents", "Music"}}
config, err := quick.New(&saveMe)
@ -221,10 +221,10 @@ func (s *MySuite) TestSaveBackup(c *C) {
func (s *MySuite) TestDiff(c *C) {
type myStruct struct {
Version string
User string
Password string
Folders []string
Version string
User string
Password string
Directories []string
}
saveMe := myStruct{"1", "guest", "nopassword", []string{"Work", "Documents", "Music"}}
config, err := quick.New(&saveMe)
@ -234,8 +234,8 @@ func (s *MySuite) TestDiff(c *C) {
type myNewStruct struct {
Version string
// User string
Password string
Folders []string
Password string
Directories []string
}
mismatch := myNewStruct{"1", "nopassword", []string{"Work", "documents", "Music"}}
@ -255,10 +255,10 @@ func (s *MySuite) TestDiff(c *C) {
func (s *MySuite) TestDeepDiff(c *C) {
type myStruct struct {
Version string
User string
Password string
Folders []string
Version string
User string
Password string
Directories []string
}
saveMe := myStruct{"1", "guest", "nopassword", []string{"Work", "Documents", "Music"}}
config, err := quick.New(&saveMe)

Loading…
Cancel
Save