|
|
@ -22,7 +22,6 @@ import ( |
|
|
|
"net/url" |
|
|
|
"net/url" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"os/signal" |
|
|
|
"os/signal" |
|
|
|
"runtime" |
|
|
|
|
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"syscall" |
|
|
|
"syscall" |
|
|
|
|
|
|
|
|
|
|
@ -83,17 +82,6 @@ func ValidateGatewayArguments(serverAddr, endpointAddr string) error { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if runtime.GOOS == "darwin" { |
|
|
|
|
|
|
|
_, port := mustSplitHostPort(serverAddr) |
|
|
|
|
|
|
|
// On macOS, if a process already listens on LOCALIPADDR:PORT, net.Listen() falls back
|
|
|
|
|
|
|
|
// to IPv6 address i.e minio will start listening on IPv6 address whereas another
|
|
|
|
|
|
|
|
// (non-)minio process is listening on IPv4 of given port.
|
|
|
|
|
|
|
|
// To avoid this error situation we check for port availability only for macOS.
|
|
|
|
|
|
|
|
if err := checkPortAvailability(port); err != nil { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if endpointAddr != "" { |
|
|
|
if endpointAddr != "" { |
|
|
|
// Reject the endpoint if it points to the gateway handler itself.
|
|
|
|
// Reject the endpoint if it points to the gateway handler itself.
|
|
|
|
sameTarget, err := sameLocalAddrs(endpointAddr, serverAddr) |
|
|
|
sameTarget, err := sameLocalAddrs(endpointAddr, serverAddr) |
|
|
@ -148,6 +136,12 @@ func StartGateway(ctx *cli.Context, gw Gateway) { |
|
|
|
// Handle common env vars.
|
|
|
|
// Handle common env vars.
|
|
|
|
handleCommonEnvVars() |
|
|
|
handleCommonEnvVars() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// On macOS, if a process already listens on LOCALIPADDR:PORT, net.Listen() falls back
|
|
|
|
|
|
|
|
// to IPv6 address ie minio will start listening on IPv6 address whereas another
|
|
|
|
|
|
|
|
// (non-)minio process is listening on IPv4 of given port.
|
|
|
|
|
|
|
|
// To avoid this error situation we check for port availability.
|
|
|
|
|
|
|
|
logger.FatalIf(checkPortAvailability(globalMinioPort), "Unable to start the server") |
|
|
|
|
|
|
|
|
|
|
|
// Validate if we have access, secret set through environment.
|
|
|
|
// Validate if we have access, secret set through environment.
|
|
|
|
if !globalIsEnvCreds { |
|
|
|
if !globalIsEnvCreds { |
|
|
|
logger.Fatal(uiErrEnvCredentialsMissingGateway(nil), "Unable to start gateway") |
|
|
|
logger.Fatal(uiErrEnvCredentialsMissingGateway(nil), "Unable to start gateway") |
|
|
|