2021-04-18 15:41:13 -04:00
|
|
|
|
// Copyright (c) 2015-2021 MinIO, Inc.
|
|
|
|
|
//
|
|
|
|
|
// This file is part of MinIO Object Storage stack
|
|
|
|
|
//
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2015-12-07 17:12:47 -05:00
|
|
|
|
|
2016-08-18 19:23:42 -04:00
|
|
|
|
package cmd
|
2015-12-07 17:12:47 -05:00
|
|
|
|
|
2016-07-08 23:34:27 -04:00
|
|
|
|
import (
|
2016-11-11 10:18:44 -05:00
|
|
|
|
"crypto/x509"
|
2021-03-31 12:11:37 -04:00
|
|
|
|
"errors"
|
2020-11-02 10:43:11 -05:00
|
|
|
|
"net/http"
|
2017-07-12 19:33:21 -04:00
|
|
|
|
"os"
|
2020-12-04 12:32:35 -05:00
|
|
|
|
"sync"
|
2016-09-09 18:33:35 -04:00
|
|
|
|
"time"
|
|
|
|
|
|
2020-07-14 12:38:05 -04:00
|
|
|
|
"github.com/minio/minio-go/v7/pkg/set"
|
2020-10-09 23:36:00 -04:00
|
|
|
|
"github.com/minio/minio/pkg/bucket/bandwidth"
|
2021-01-22 18:37:41 -05:00
|
|
|
|
"github.com/minio/minio/pkg/handlers"
|
2021-04-15 11:47:33 -04:00
|
|
|
|
"github.com/minio/minio/pkg/kms"
|
2018-05-11 15:02:30 -04:00
|
|
|
|
|
2021-04-19 11:44:18 -04:00
|
|
|
|
"github.com/dustin/go-humanize"
|
2019-10-23 01:59:13 -04:00
|
|
|
|
"github.com/minio/minio/cmd/config/cache"
|
|
|
|
|
"github.com/minio/minio/cmd/config/compress"
|
2020-09-10 17:19:32 -04:00
|
|
|
|
"github.com/minio/minio/cmd/config/dns"
|
2019-10-23 01:59:13 -04:00
|
|
|
|
xldap "github.com/minio/minio/cmd/config/identity/ldap"
|
|
|
|
|
"github.com/minio/minio/cmd/config/identity/openid"
|
|
|
|
|
"github.com/minio/minio/cmd/config/policy/opa"
|
|
|
|
|
"github.com/minio/minio/cmd/config/storageclass"
|
2018-04-21 22:23:54 -04:00
|
|
|
|
xhttp "github.com/minio/minio/cmd/http"
|
2017-10-31 14:54:32 -04:00
|
|
|
|
"github.com/minio/minio/pkg/auth"
|
2021-05-28 13:31:42 -04:00
|
|
|
|
etcd "go.etcd.io/etcd/client/v3"
|
2020-04-30 18:55:54 -04:00
|
|
|
|
|
2019-12-22 01:35:50 -05:00
|
|
|
|
"github.com/minio/minio/pkg/event"
|
2019-06-27 01:41:12 -04:00
|
|
|
|
"github.com/minio/minio/pkg/pubsub"
|
2021-05-28 18:17:01 -04:00
|
|
|
|
"github.com/minio/pkg/certs"
|
2016-07-08 23:34:27 -04:00
|
|
|
|
)
|
config/main: Re-write config files - add to new config v3
- New config format.
```
{
"version": "3",
"address": ":9000",
"backend": {
"type": "fs",
"disk": "/path"
},
"credential": {
"accessKey": "WLGDGYAQYIGI833EV05A",
"secretKey": "BYvgJM101sHngl2uzjXS/OBF/aMxAN06JrJ3qJlF"
},
"region": "us-east-1",
"logger": {
"file": {
"enable": false,
"fileName": "",
"level": "error"
},
"syslog": {
"enable": false,
"address": "",
"level": "debug"
},
"console": {
"enable": true,
"level": "fatal"
}
}
}
```
New command lines in lieu of supporting XL.
Minio initialize filesystem backend.
~~~
$ minio init fs <path>
~~~
Minio initialize XL backend.
~~~
$ minio init xl <url1>...<url16>
~~~
For 'fs' backend it starts the server.
~~~
$ minio server
~~~
For 'xl' backend it waits for servers to join.
~~~
$ minio server
... [PROGRESS BAR] of servers connecting
~~~
Now on other servers execute 'join' and they connect.
~~~
....
minio join <url1> -- from <url2> && minio server
minio join <url1> -- from <url3> && minio server
...
...
minio join <url1> -- from <url16> && minio server
~~~
2016-02-12 18:27:10 -05:00
|
|
|
|
|
|
|
|
|
// minio configuration related constants.
|
|
|
|
|
const (
|
2020-05-17 11:46:23 -04:00
|
|
|
|
GlobalMinioDefaultPort = "9000"
|
2018-12-18 19:08:11 -05:00
|
|
|
|
|
2017-06-20 18:01:13 -04:00
|
|
|
|
globalMinioDefaultRegion = ""
|
|
|
|
|
// This is a sha256 output of ``arn:aws:iam::minio:user/admin``,
|
|
|
|
|
// this is kept in present form to be compatible with S3 owner ID
|
|
|
|
|
// requirements -
|
|
|
|
|
//
|
|
|
|
|
// ```
|
|
|
|
|
// The canonical user ID is the Amazon S3–only concept.
|
|
|
|
|
// It is 64-character obfuscated version of the account ID.
|
|
|
|
|
// ```
|
|
|
|
|
// http://docs.aws.amazon.com/AmazonS3/latest/dev/example-walkthroughs-managing-access-example4.html
|
|
|
|
|
globalMinioDefaultOwnerID = "02d6176db174dc93cb1b899f7c6078f08654445fe8cf1b6ce98d8855f66bdbf4"
|
2017-01-18 15:24:34 -05:00
|
|
|
|
globalMinioDefaultStorageClass = "STANDARD"
|
|
|
|
|
globalWindowsOSName = "windows"
|
2019-10-01 13:42:18 -04:00
|
|
|
|
globalMacOSName = "darwin"
|
2017-03-16 15:21:58 -04:00
|
|
|
|
globalMinioModeFS = "mode-server-fs"
|
2020-06-12 23:04:01 -04:00
|
|
|
|
globalMinioModeErasure = "mode-server-xl"
|
|
|
|
|
globalMinioModeDistErasure = "mode-server-distributed-xl"
|
2017-10-27 18:07:46 -04:00
|
|
|
|
globalMinioModeGatewayPrefix = "mode-gateway-"
|
2020-09-19 11:39:41 -04:00
|
|
|
|
globalDirSuffix = "__XLDIR__"
|
|
|
|
|
globalDirSuffixWithSlash = globalDirSuffix + slashSeparator
|
2017-09-19 19:08:08 -04:00
|
|
|
|
|
2016-05-09 19:18:56 -04:00
|
|
|
|
// Add new global values here.
|
config/main: Re-write config files - add to new config v3
- New config format.
```
{
"version": "3",
"address": ":9000",
"backend": {
"type": "fs",
"disk": "/path"
},
"credential": {
"accessKey": "WLGDGYAQYIGI833EV05A",
"secretKey": "BYvgJM101sHngl2uzjXS/OBF/aMxAN06JrJ3qJlF"
},
"region": "us-east-1",
"logger": {
"file": {
"enable": false,
"fileName": "",
"level": "error"
},
"syslog": {
"enable": false,
"address": "",
"level": "debug"
},
"console": {
"enable": true,
"level": "fatal"
}
}
}
```
New command lines in lieu of supporting XL.
Minio initialize filesystem backend.
~~~
$ minio init fs <path>
~~~
Minio initialize XL backend.
~~~
$ minio init xl <url1>...<url16>
~~~
For 'fs' backend it starts the server.
~~~
$ minio server
~~~
For 'xl' backend it waits for servers to join.
~~~
$ minio server
... [PROGRESS BAR] of servers connecting
~~~
Now on other servers execute 'join' and they connect.
~~~
....
minio join <url1> -- from <url2> && minio server
minio join <url1> -- from <url3> && minio server
...
...
minio join <url1> -- from <url16> && minio server
~~~
2016-02-12 18:27:10 -05:00
|
|
|
|
)
|
|
|
|
|
|
2016-11-22 23:13:20 -05:00
|
|
|
|
const (
|
|
|
|
|
// Limit fields size (except file) to 1Mib since Policy document
|
|
|
|
|
// can reach that size according to https://aws.amazon.com/articles/1434
|
|
|
|
|
maxFormFieldSize = int64(1 * humanize.MiByte)
|
|
|
|
|
|
2017-02-02 13:45:00 -05:00
|
|
|
|
// Limit memory allocation to store multipart data
|
|
|
|
|
maxFormMemory = int64(5 * humanize.MiByte)
|
|
|
|
|
|
2017-09-07 14:16:45 -04:00
|
|
|
|
// The maximum allowed time difference between the incoming request
|
|
|
|
|
// date and server date during signature verification.
|
|
|
|
|
globalMaxSkewTime = 15 * time.Minute // 15 minutes skew allowed.
|
|
|
|
|
|
2020-09-08 18:55:40 -04:00
|
|
|
|
// GlobalStaleUploadsExpiry - Expiry duration after which the uploads in multipart, tmp directory are deemed stale.
|
|
|
|
|
GlobalStaleUploadsExpiry = time.Hour * 24 // 24 hrs.
|
2021-02-26 12:52:27 -05:00
|
|
|
|
|
2020-09-08 18:55:40 -04:00
|
|
|
|
// GlobalStaleUploadsCleanupInterval - Cleanup interval when the stale uploads cleanup is initiated.
|
2021-02-26 12:52:27 -05:00
|
|
|
|
GlobalStaleUploadsCleanupInterval = time.Hour * 12 // 12 hrs.
|
2019-01-05 17:16:43 -05:00
|
|
|
|
|
2019-07-19 16:20:33 -04:00
|
|
|
|
// GlobalServiceExecutionInterval - Executes the Lifecycle events.
|
|
|
|
|
GlobalServiceExecutionInterval = time.Hour * 24 // 24 hrs.
|
|
|
|
|
|
2018-10-09 17:00:01 -04:00
|
|
|
|
// Refresh interval to update in-memory iam config cache.
|
|
|
|
|
globalRefreshIAMInterval = 5 * time.Minute
|
2018-05-04 14:16:14 -04:00
|
|
|
|
|
2021-02-26 12:52:27 -05:00
|
|
|
|
// Limit of location constraint XML for unauthenticated PUT bucket operations.
|
2018-05-04 14:16:14 -04:00
|
|
|
|
maxLocationConstraintSize = 3 * humanize.MiByte
|
2020-02-05 04:42:34 -05:00
|
|
|
|
|
|
|
|
|
// Maximum size of default bucket encryption configuration allowed
|
|
|
|
|
maxBucketSSEConfigSize = 1 * humanize.MiByte
|
2020-06-20 09:36:44 -04:00
|
|
|
|
|
|
|
|
|
// diskFillFraction is the fraction of a disk we allow to be filled.
|
|
|
|
|
diskFillFraction = 0.95
|
2016-11-22 23:13:20 -05:00
|
|
|
|
)
|
|
|
|
|
|
2018-12-18 19:08:11 -05:00
|
|
|
|
var globalCLIContext = struct {
|
2019-05-08 21:35:40 -04:00
|
|
|
|
JSON, Quiet bool
|
|
|
|
|
Anonymous bool
|
|
|
|
|
Addr string
|
|
|
|
|
StrictS3Compat bool
|
2018-12-18 19:08:11 -05:00
|
|
|
|
}{}
|
|
|
|
|
|
2016-03-24 20:20:49 -04:00
|
|
|
|
var (
|
2017-01-16 20:05:00 -05:00
|
|
|
|
// Indicates if the running minio server is distributed setup.
|
2020-06-12 23:04:01 -04:00
|
|
|
|
globalIsDistErasure = false
|
2016-11-28 15:15:36 -05:00
|
|
|
|
|
2017-01-23 03:32:55 -05:00
|
|
|
|
// Indicates if the running minio server is an erasure-code backend.
|
2020-06-12 23:04:01 -04:00
|
|
|
|
globalIsErasure = false
|
2017-01-23 03:32:55 -05:00
|
|
|
|
|
2019-06-03 14:06:13 -04:00
|
|
|
|
// Indicates if the running minio is in gateway mode.
|
|
|
|
|
globalIsGateway = false
|
|
|
|
|
|
2019-08-14 14:43:43 -04:00
|
|
|
|
// Name of gateway server, e.g S3, GCS, Azure, etc
|
|
|
|
|
globalGatewayName = ""
|
|
|
|
|
|
2021-04-29 22:01:43 -04:00
|
|
|
|
// This flag is set to 'true' by default
|
|
|
|
|
globalBrowserEnabled = true
|
|
|
|
|
|
2017-12-15 15:33:42 -05:00
|
|
|
|
// This flag is set to 'true' when MINIO_UPDATE env is set to 'off'. Default is false.
|
|
|
|
|
globalInplaceUpdateDisabled = false
|
|
|
|
|
|
2017-04-09 13:44:10 -04:00
|
|
|
|
// This flag is set to 'us-east-1' by default
|
|
|
|
|
globalServerRegion = globalMinioDefaultRegion
|
|
|
|
|
|
2019-04-09 14:39:42 -04:00
|
|
|
|
// MinIO local server address (in `host:port` format)
|
2016-10-12 04:03:50 -04:00
|
|
|
|
globalMinioAddr = ""
|
2019-04-09 14:39:42 -04:00
|
|
|
|
// MinIO default port, can be changed through command line.
|
2020-05-17 11:46:23 -04:00
|
|
|
|
globalMinioPort = GlobalMinioDefaultPort
|
2016-10-18 15:49:24 -04:00
|
|
|
|
// Holds the host that was passed using --address
|
|
|
|
|
globalMinioHost = ""
|
2020-04-27 09:25:05 -04:00
|
|
|
|
// Holds the possible host endpoint.
|
|
|
|
|
globalMinioEndpoint = ""
|
2016-12-29 06:13:51 -05:00
|
|
|
|
|
2018-08-15 00:41:47 -04:00
|
|
|
|
// globalConfigSys server config system.
|
|
|
|
|
globalConfigSys *ConfigSys
|
|
|
|
|
|
2019-12-22 01:35:50 -05:00
|
|
|
|
globalNotificationSys *NotificationSys
|
|
|
|
|
globalConfigTargetList *event.TargetList
|
2020-03-14 03:01:15 -04:00
|
|
|
|
// globalEnvTargetList has list of targets configured via env.
|
|
|
|
|
globalEnvTargetList *event.TargetList
|
|
|
|
|
|
2020-05-19 16:53:54 -04:00
|
|
|
|
globalBucketMetadataSys *BucketMetadataSys
|
2020-10-09 23:36:00 -04:00
|
|
|
|
globalBucketMonitor *bandwidth.Monitor
|
2020-05-19 16:53:54 -04:00
|
|
|
|
globalPolicySys *PolicySys
|
|
|
|
|
globalIAMSys *IAMSys
|
2016-10-12 04:03:50 -04:00
|
|
|
|
|
2020-07-30 22:55:22 -04:00
|
|
|
|
globalLifecycleSys *LifecycleSys
|
|
|
|
|
globalBucketSSEConfigSys *BucketSSEConfigSys
|
|
|
|
|
globalBucketTargetSys *BucketTargetSys
|
2020-06-04 17:58:34 -04:00
|
|
|
|
// globalAPIConfig controls S3 API requests throttling,
|
|
|
|
|
// healthcheck readiness deadlines and cors settings.
|
2020-11-02 20:21:56 -05:00
|
|
|
|
globalAPIConfig = apiConfig{listQuorum: 3}
|
2020-04-14 15:46:37 -04:00
|
|
|
|
|
2019-10-23 01:59:13 -04:00
|
|
|
|
globalStorageClass storageclass.Config
|
|
|
|
|
globalLDAPConfig xldap.Config
|
|
|
|
|
globalOpenIDConfig openid.Config
|
|
|
|
|
|
2016-11-11 10:18:44 -05:00
|
|
|
|
// CA root certificates, a nil value means system certs pool will be used
|
|
|
|
|
globalRootCAs *x509.CertPool
|
|
|
|
|
|
2017-01-11 16:59:51 -05:00
|
|
|
|
// IsSSL indicates if the server is configured with SSL.
|
2020-12-22 00:42:38 -05:00
|
|
|
|
globalIsTLS bool
|
2017-01-11 16:59:51 -05:00
|
|
|
|
|
certs: refactor cert manager to support multiple certificates (#10207)
This commit refactors the certificate management implementation
in the `certs` package such that multiple certificates can be
specified at the same time. Therefore, the following layout of
the `certs/` directory is expected:
```
certs/
│
├─ public.crt
├─ private.key
├─ CAs/ // CAs directory is ignored
│ │
│ ...
│
├─ example.com/
│ │
│ ├─ public.crt
│ └─ private.key
└─ foobar.org/
│
├─ public.crt
└─ private.key
...
```
However, directory names like `example.com` are just for human
readability/organization and don't have any meaning w.r.t whether
a particular certificate is served or not. This decision is made based
on the SNI sent by the client and the SAN of the certificate.
***
The `Manager` will pick a certificate based on the client trying
to establish a TLS connection. In particular, it looks at the client
hello (i.e. SNI) to determine which host the client tries to access.
If the manager can find a certificate that matches the SNI it
returns this certificate to the client.
However, the client may choose to not send an SNI or tries to access
a server directly via IP (`https://<ip>:<port>`). In this case, we
cannot use the SNI to determine which certificate to serve. However,
we also should not pick "the first" certificate that would be accepted
by the client (based on crypto. parameters - like a signature algorithm)
because it may be an internal certificate that contains internal hostnames.
We would disclose internal infrastructure details doing so.
Therefore, the `Manager` returns the "default" certificate when the
client does not specify an SNI. The default certificate the top-level
`public.crt` - i.e. `certs/public.crt`.
This approach has some consequences:
- It's the operator's responsibility to ensure that the top-level
`public.crt` does not disclose any information (i.e. hostnames)
that are not publicly visible. However, this was the case in the
past already.
- Any other `public.crt` - except for the top-level one - must not
contain any IP SAN. The reason for this restriction is that the
Manager cannot match a SNI to an IP b/c the SNI is the server host
name. The entire purpose of SNI is to indicate which host the client
tries to connect to when multiple hosts run on the same IP. So, a
client will not set the SNI to an IP.
If we would allow IP SANs in a lower-level `public.crt` a user would
expect that it is possible to connect to MinIO directly via IP address
and that the MinIO server would pick "the right" certificate. However,
the MinIO server cannot determine which certificate to serve, and
therefore always picks the "default" one. This may lead to all sorts
of confusing errors like:
"It works if I use `https:instance.minio.local` but not when I use
`https://10.0.2.1`.
These consequences/limitations should be pointed out / explained in our
docs in an appropriate way. However, the support for multiple
certificates should not have any impact on how deployment with a single
certificate function today.
Co-authored-by: Harshavardhana <harsha@minio.io>
2020-09-04 02:33:37 -04:00
|
|
|
|
globalTLSCerts *certs.Manager
|
2017-07-12 19:33:21 -04:00
|
|
|
|
|
2018-04-21 22:23:54 -04:00
|
|
|
|
globalHTTPServer *xhttp.Server
|
2017-07-12 19:33:21 -04:00
|
|
|
|
globalHTTPServerErrorCh = make(chan error)
|
|
|
|
|
globalOSSignalCh = make(chan os.Signal, 1)
|
|
|
|
|
|
2021-03-27 02:24:07 -04:00
|
|
|
|
// global Trace system to send HTTP request/response
|
|
|
|
|
// and Storage/OS calls info to registered listeners.
|
|
|
|
|
globalTrace = pubsub.New()
|
2017-10-24 22:04:51 -04:00
|
|
|
|
|
2019-12-12 13:01:23 -05:00
|
|
|
|
// global Listen system to send S3 API events to registered listeners
|
|
|
|
|
globalHTTPListen = pubsub.New()
|
|
|
|
|
|
2019-09-03 14:10:48 -04:00
|
|
|
|
// global console system to send console logs to
|
|
|
|
|
// registered listeners
|
|
|
|
|
globalConsoleSys *HTTPConsoleLoggerSys
|
|
|
|
|
|
2020-12-01 16:50:33 -05:00
|
|
|
|
globalEndpoints EndpointServerPools
|
2017-01-23 03:32:55 -05:00
|
|
|
|
|
2021-03-26 14:37:58 -04:00
|
|
|
|
// The name of this local node, fetched from arguments
|
|
|
|
|
globalLocalNodeName string
|
|
|
|
|
|
2021-01-07 22:16:18 -05:00
|
|
|
|
globalRemoteEndpoints map[string]Endpoint
|
|
|
|
|
|
2017-02-06 12:29:53 -05:00
|
|
|
|
// Global server's network statistics
|
|
|
|
|
globalConnStats = newConnStats()
|
2017-02-08 03:13:02 -05:00
|
|
|
|
|
2017-02-06 12:29:53 -05:00
|
|
|
|
// Global HTTP request statisitics
|
|
|
|
|
globalHTTPStats = newHTTPStats()
|
|
|
|
|
|
2020-03-17 19:37:28 -04:00
|
|
|
|
// Time when the server is started
|
|
|
|
|
globalBootTime = UTCNow()
|
2017-02-08 03:13:02 -05:00
|
|
|
|
|
2019-10-30 03:04:39 -04:00
|
|
|
|
globalActiveCred auth.Credentials
|
|
|
|
|
|
2020-03-17 13:36:13 -04:00
|
|
|
|
// Hold the old server credentials passed by the environment
|
|
|
|
|
globalOldCred auth.Credentials
|
|
|
|
|
|
2018-02-02 13:17:13 -05:00
|
|
|
|
globalPublicCerts []*x509.Certificate
|
2017-11-14 19:56:24 -05:00
|
|
|
|
|
2019-02-22 22:18:01 -05:00
|
|
|
|
globalDomainNames []string // Root domains for virtual host style requests
|
2019-04-09 14:39:42 -04:00
|
|
|
|
globalDomainIPs set.StringSet // Root domain IP address(s) for a distributed MinIO deployment
|
2017-08-31 14:29:22 -04:00
|
|
|
|
|
2020-10-08 15:32:32 -04:00
|
|
|
|
globalOperationTimeout = newDynamicTimeout(10*time.Minute, 5*time.Minute) // default timeout for general ops
|
|
|
|
|
globalDeleteOperationTimeout = newDynamicTimeout(5*time.Minute, 1*time.Minute) // default time for delete ops
|
2016-03-24 20:20:49 -04:00
|
|
|
|
|
2020-05-08 16:44:44 -04:00
|
|
|
|
globalBucketObjectLockSys *BucketObjectLockSys
|
|
|
|
|
globalBucketQuotaSys *BucketQuotaSys
|
2020-06-12 23:04:01 -04:00
|
|
|
|
globalBucketVersioningSys *BucketVersioningSys
|
2020-04-30 18:55:54 -04:00
|
|
|
|
|
2018-03-28 17:14:06 -04:00
|
|
|
|
// Disk cache drives
|
2019-10-23 01:59:13 -04:00
|
|
|
|
globalCacheConfig cache.Config
|
2018-02-02 21:18:52 -05:00
|
|
|
|
|
2019-08-23 13:13:22 -04:00
|
|
|
|
// Initialized KMS configuration for disk cache
|
2021-04-15 11:47:33 -04:00
|
|
|
|
globalCacheKMS kms.KMS
|
2019-10-23 01:59:13 -04:00
|
|
|
|
|
2018-02-02 21:18:52 -05:00
|
|
|
|
// Allocated etcd endpoint for config and bucket DNS.
|
2018-07-12 17:12:40 -04:00
|
|
|
|
globalEtcdClient *etcd.Client
|
2018-02-02 21:18:52 -05:00
|
|
|
|
|
2019-12-29 11:56:45 -05:00
|
|
|
|
// Is set to true when Bucket federation is requested
|
|
|
|
|
// and is 'true' when etcdConfig.PathPrefix is empty
|
|
|
|
|
globalBucketFederation bool
|
|
|
|
|
|
2018-02-02 21:18:52 -05:00
|
|
|
|
// Allocated DNS config wrapper over etcd client.
|
2020-07-20 15:28:48 -04:00
|
|
|
|
globalDNSConfig dns.Store
|
2018-03-28 17:14:06 -04:00
|
|
|
|
|
2019-01-05 17:16:43 -05:00
|
|
|
|
// GlobalKMS initialized KMS configuration
|
2021-04-15 11:47:33 -04:00
|
|
|
|
GlobalKMS kms.KMS
|
2018-09-27 23:36:17 -04:00
|
|
|
|
|
2018-12-14 16:35:48 -05:00
|
|
|
|
// Auto-Encryption, if enabled, turns any non-SSE-C request
|
|
|
|
|
// into an SSE-S3 request. If enabled a valid, non-empty KMS
|
|
|
|
|
// configuration must be present.
|
|
|
|
|
globalAutoEncryption bool
|
|
|
|
|
|
2019-09-26 02:08:24 -04:00
|
|
|
|
// Is compression enabled?
|
2020-12-04 12:32:35 -05:00
|
|
|
|
globalCompressConfigMu sync.Mutex
|
|
|
|
|
globalCompressConfig compress.Config
|
2018-09-27 23:36:17 -04:00
|
|
|
|
|
|
|
|
|
// Some standard object extensions which we strictly dis-allow for compression.
|
2021-04-19 11:44:18 -04:00
|
|
|
|
standardExcludeCompressExtensions = []string{".gz", ".bz2", ".rar", ".zip", ".7z", ".xz", ".mp4", ".mkv", ".mov", ".jpg", ".png", ".gif"}
|
2018-09-27 23:36:17 -04:00
|
|
|
|
|
|
|
|
|
// Some standard content-types which we strictly dis-allow for compression.
|
|
|
|
|
standardExcludeCompressContentTypes = []string{"video/*", "audio/*", "application/zip", "application/x-gzip", "application/x-zip-compressed", " application/x-compress", "application/x-spoon"}
|
|
|
|
|
|
2018-10-09 17:00:01 -04:00
|
|
|
|
// Authorization validators list.
|
2019-10-04 13:35:33 -04:00
|
|
|
|
globalOpenIDValidators *openid.Validators
|
2018-10-09 17:00:01 -04:00
|
|
|
|
|
|
|
|
|
// OPA policy system.
|
2019-10-23 01:59:13 -04:00
|
|
|
|
globalPolicyOPA *opa.Opa
|
2018-10-09 17:00:01 -04:00
|
|
|
|
|
2018-11-19 17:47:03 -05:00
|
|
|
|
// Deployment ID - unique per deployment
|
|
|
|
|
globalDeploymentID string
|
|
|
|
|
|
2019-01-05 17:16:43 -05:00
|
|
|
|
// GlobalGatewaySSE sse options
|
|
|
|
|
GlobalGatewaySSE gatewaySSE
|
|
|
|
|
|
2019-10-28 13:27:49 -04:00
|
|
|
|
globalAllHealState *allHealState
|
|
|
|
|
|
2019-06-09 01:14:07 -04:00
|
|
|
|
// The always present healing routine ready to heal objects
|
2019-10-28 13:27:49 -04:00
|
|
|
|
globalBackgroundHealRoutine *healRoutine
|
|
|
|
|
globalBackgroundHealState *allHealState
|
2019-06-09 01:14:07 -04:00
|
|
|
|
|
2020-05-12 22:24:59 -04:00
|
|
|
|
// If writes to FS backend should be O_SYNC.
|
|
|
|
|
globalFSOSync bool
|
2020-05-23 20:38:39 -04:00
|
|
|
|
|
2020-07-03 14:53:03 -04:00
|
|
|
|
globalProxyEndpoints []ProxyEndpoint
|
2020-10-16 17:49:05 -04:00
|
|
|
|
|
2020-11-02 10:43:11 -05:00
|
|
|
|
globalInternodeTransport http.RoundTripper
|
|
|
|
|
|
2020-12-22 00:42:38 -05:00
|
|
|
|
globalProxyTransport http.RoundTripper
|
|
|
|
|
|
2020-10-16 17:49:05 -04:00
|
|
|
|
globalDNSCache *xhttp.DNSCache
|
2021-01-22 18:37:41 -05:00
|
|
|
|
|
|
|
|
|
globalForwarder *handlers.Forwarder
|
2021-04-19 13:30:42 -04:00
|
|
|
|
|
|
|
|
|
globalTierConfigMgr *TierConfigMgr
|
|
|
|
|
|
|
|
|
|
globalTierJournal *tierJournal
|
|
|
|
|
|
|
|
|
|
globalDebugRemoteTiersImmediately []string
|
2018-02-02 21:18:52 -05:00
|
|
|
|
// Add new variable global values here.
|
2016-09-09 18:33:35 -04:00
|
|
|
|
)
|
|
|
|
|
|
2021-03-31 12:11:37 -04:00
|
|
|
|
var errSelfTestFailure = errors.New("self test failed. unsafe to start server")
|
2021-04-29 22:01:43 -04:00
|
|
|
|
|
|
|
|
|
// Returns minio global information, as a key value map.
|
|
|
|
|
// returned list of global values is not an exhaustive
|
|
|
|
|
// list. Feel free to add new relevant fields.
|
|
|
|
|
func getGlobalInfo() (globalInfo map[string]interface{}) {
|
|
|
|
|
globalInfo = map[string]interface{}{
|
|
|
|
|
"serverRegion": globalServerRegion,
|
|
|
|
|
"domains": globalDomainNames,
|
|
|
|
|
// Add more relevant global settings here.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return globalInfo
|
|
|
|
|
}
|