|
@@ -2,6 +2,7 @@ package daemon // import "github.com/docker/docker/daemon"
|
|
|
|
|
|
import (
|
|
import (
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "net/url"
|
|
"os"
|
|
"os"
|
|
"runtime"
|
|
"runtime"
|
|
"strings"
|
|
"strings"
|
|
@@ -61,8 +62,8 @@ func (daemon *Daemon) SystemInfo() (*types.Info, error) {
|
|
ServerVersion: dockerversion.Version,
|
|
ServerVersion: dockerversion.Version,
|
|
ClusterStore: daemon.configStore.ClusterStore,
|
|
ClusterStore: daemon.configStore.ClusterStore,
|
|
ClusterAdvertise: daemon.configStore.ClusterAdvertise,
|
|
ClusterAdvertise: daemon.configStore.ClusterAdvertise,
|
|
- HTTPProxy: sockets.GetProxyEnv("http_proxy"),
|
|
|
|
- HTTPSProxy: sockets.GetProxyEnv("https_proxy"),
|
|
|
|
|
|
+ HTTPProxy: maskCredentials(sockets.GetProxyEnv("http_proxy")),
|
|
|
|
+ HTTPSProxy: maskCredentials(sockets.GetProxyEnv("https_proxy")),
|
|
NoProxy: sockets.GetProxyEnv("no_proxy"),
|
|
NoProxy: sockets.GetProxyEnv("no_proxy"),
|
|
LiveRestoreEnabled: daemon.configStore.LiveRestoreEnabled,
|
|
LiveRestoreEnabled: daemon.configStore.LiveRestoreEnabled,
|
|
Isolation: daemon.defaultIsolation,
|
|
Isolation: daemon.defaultIsolation,
|
|
@@ -245,3 +246,13 @@ func operatingSystem() string {
|
|
}
|
|
}
|
|
return operatingSystem
|
|
return operatingSystem
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func maskCredentials(rawURL string) string {
|
|
|
|
+ parsedURL, err := url.Parse(rawURL)
|
|
|
|
+ if err != nil || parsedURL.User == nil {
|
|
|
|
+ return rawURL
|
|
|
|
+ }
|
|
|
|
+ parsedURL.User = url.UserPassword("xxxxx", "xxxxx")
|
|
|
|
+ maskedURL := parsedURL.String()
|
|
|
|
+ return maskedURL
|
|
|
|
+}
|