|
|
|
@ -22,7 +22,6 @@ import ( |
|
|
|
|
"net/url" |
|
|
|
|
"os" |
|
|
|
|
"os/signal" |
|
|
|
|
"runtime" |
|
|
|
|
"strings" |
|
|
|
|
"syscall" |
|
|
|
|
|
|
|
|
@ -83,17 +82,6 @@ func ValidateGatewayArguments(serverAddr, endpointAddr string) error { |
|
|
|
|
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 != "" { |
|
|
|
|
// Reject the endpoint if it points to the gateway handler itself.
|
|
|
|
|
sameTarget, err := sameLocalAddrs(endpointAddr, serverAddr) |
|
|
|
@ -148,6 +136,12 @@ func StartGateway(ctx *cli.Context, gw Gateway) { |
|
|
|
|
// Handle common env vars.
|
|
|
|
|
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.
|
|
|
|
|
if !globalIsEnvCreds { |
|
|
|
|
logger.Fatal(uiErrEnvCredentialsMissingGateway(nil), "Unable to start gateway") |
|
|
|
|