Vendor Update

This commit is contained in:
galal-hussein 2019-03-31 11:41:42 +02:00
parent d255574150
commit 4591faf859
4 changed files with 24 additions and 15 deletions

View File

@ -11,7 +11,7 @@ package=github.com/opencontainers/runc/contrib/cmd/recvtty
k8s.io/kubernetes v1.13.5-k3s.1 https://github.com/rancher/k3s.git transitive=true,staging=true
github.com/rancher/norman f75e3607e96e1a5d3cbaf4ee7cea1459cc727f61 https://github.com/ibuildthecloud/norman.git
github.com/rancher/norman efb72b594a2a34f2573b9565c6cd9926a1f6ae08 https://github.com/ibuildthecloud/norman.git
github.com/coreos/flannel 823afe66b2266bf71f5bec24e6e28b26d70cfc7c https://github.com/ibuildthecloud/flannel.git
github.com/natefinch/lumberjack aee4629129445bbdfb69aa565537dcfa16544311
github.com/gorilla/mux v1.6.2

View File

@ -196,7 +196,10 @@ func (s *server) userConfigure() error {
s.ips.Add(ip, netIP)
}
}
bindAddress := net.ParseIP(s.userConfig.BindAddress)
if bindAddress != nil {
s.ips.Add(s.userConfig.BindAddress, bindAddress)
}
return nil
}
@ -445,7 +448,7 @@ func (s *server) serveHTTPS() error {
PreferServerCipherSuites: true,
}
listener, err := s.newListener(s.userConfig.HTTPSPort, conf)
listener, err := s.newListener(s.userConfig.BindAddress, s.userConfig.HTTPSPort, conf)
if err != nil {
return err
}
@ -460,7 +463,7 @@ func (s *server) serveHTTPS() error {
s.startServer(listener, server)
if s.userConfig.HTTPPort > 0 {
httpListener, err := s.newListener(s.userConfig.HTTPPort, nil)
httpListener, err := s.newListener(s.userConfig.BindAddress, s.userConfig.HTTPPort, nil)
if err != nil {
return err
}
@ -524,8 +527,8 @@ func (s *server) Handler() http.Handler {
return s.userConfig.Handler
}
func (s *server) newListener(port int, config *tls.Config) (net.Listener, error) {
addr := fmt.Sprintf(":%d", port)
func (s *server) newListener(ip string, port int, config *tls.Config) (net.Listener, error) {
addr := fmt.Sprintf("%s:%d", ip, port)
l, err := net.Listen("tcp", addr)
if err != nil {
return nil, err
@ -561,7 +564,7 @@ func (s *server) serveACME() error {
}
if s.userConfig.HTTPPort > 0 {
httpListener, err := s.newListener(s.userConfig.HTTPPort, nil)
httpListener, err := s.newListener(s.userConfig.BindAddress, s.userConfig.HTTPPort, nil)
if err != nil {
return err
}
@ -579,7 +582,7 @@ func (s *server) serveACME() error {
}
httpsListener, err := s.newListener(s.userConfig.HTTPSPort, conf)
httpsListener, err := s.newListener(s.userConfig.BindAddress, s.userConfig.HTTPSPort, conf)
if err != nil {
return err
}

View File

@ -26,13 +26,14 @@ type UserConfig struct {
// Optional fields
KnownIPs []string
Domains []string
Mode string
NoCACerts bool
CACerts string
Cert string
Key string
KnownIPs []string
Domains []string
Mode string
NoCACerts bool
CACerts string
Cert string
Key string
BindAddress string
}
type ListenerStatus struct {

View File

@ -27,6 +27,11 @@ func Resolve(s string) (string, error) {
}
func getHomeDir() (string, error) {
home := os.Getenv("HOME")
if home != "" {
return home, nil
}
if os.Getuid() == 0 {
return "/root", nil
}