You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.6 KiB

  1. /*
  2. * Minio Cloud Storage, (C) 2015, 2016 Minio, Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package cmd
  17. import (
  18. "time"
  19. "github.com/fatih/color"
  20. "github.com/minio/minio/pkg/objcache"
  21. )
  22. // Global constants for Minio.
  23. const (
  24. minGoVersion = ">= 1.7" // Minio requires at least Go v1.7
  25. )
  26. // minio configuration related constants.
  27. const (
  28. globalMinioConfigVersion = "9"
  29. globalMinioConfigDir = ".minio"
  30. globalMinioCertsDir = "certs"
  31. globalMinioCertFile = "public.crt"
  32. globalMinioKeyFile = "private.key"
  33. globalMinioConfigFile = "config.json"
  34. globalMinioCertExpireWarnDays = time.Hour * 24 * 30 // 30 days.
  35. // Add new global values here.
  36. )
  37. var (
  38. globalQuiet = false // Quiet flag set via command line
  39. globalIsDistXL = false // "Is Distributed?" flag.
  40. // Add new global flags here.
  41. // Maximum connections handled per
  42. // server, defaults to 0 (unlimited).
  43. globalMaxConn = 0
  44. // Maximum cache size.
  45. globalMaxCacheSize = uint64(maxCacheSize)
  46. // Cache expiry.
  47. globalCacheExpiry = objcache.DefaultExpiry
  48. // Minio local server address (in `host:port` format)
  49. globalMinioAddr = ""
  50. // Minio default port, can be changed through command line.
  51. globalMinioPort = "9000"
  52. // Holds the host that was passed using --address
  53. globalMinioHost = ""
  54. // Peer communication struct
  55. globalS3Peers = s3Peers{}
  56. // Add new variable global values here.
  57. )
  58. var (
  59. // Limit fields size (except file) to 1Mib since Policy document
  60. // can reach that size according to https://aws.amazon.com/articles/1434
  61. maxFormFieldSize = int64(1024 * 1024)
  62. )
  63. var (
  64. // The maximum allowed difference between the request generation time and the server processing time
  65. globalMaxSkewTime = 15 * time.Minute
  66. // Keeps the connection active by waiting for following amount of time.
  67. // Primarily used in ListenBucketNotification.
  68. globalSNSConnAlive = 5 * time.Second
  69. )
  70. // global colors.
  71. var (
  72. colorRed = color.New(color.FgRed).SprintFunc()
  73. colorBold = color.New(color.Bold).SprintFunc()
  74. colorBlue = color.New(color.FgBlue).SprintfFunc()
  75. colorGreen = color.New(color.FgGreen).SprintfFunc()
  76. )