This commit is contained in:
Liang Ding 2014-11-18 15:42:11 +08:00
parent 260bd543ad
commit d1b0733493
1 changed files with 5 additions and 18 deletions

View File

@ -18,7 +18,6 @@ package conf
import (
"encoding/json"
"io/ioutil"
"net"
"os"
"os/exec"
"path/filepath"
@ -294,6 +293,11 @@ func Load(confPath, confIP, confPort, confServer, confChannel string, confDocker
glog.V(5).Infof("${ip} [%s]", ip)
// Docker
if confDocker {
confChannel = os.Getenv("channel") // overwrite channel specified
}
if "" != confIP {
ip = confIP
}
@ -331,23 +335,6 @@ func Load(confPath, confIP, confPort, confServer, confChannel string, confDocker
Wide.SessionChannel = confChannel
}
// Docker
if confDocker {
h, err := net.LookupHost("wide")
if nil != err {
glog.Error(err)
os.Exit(-1)
}
// XXX: secure protocol wss enchance
channel := "ws://" + h[0] + ":" + Wide.Port
Wide.EditorChannel = channel
Wide.OutputChannel = channel
Wide.ShellChannel = channel
Wide.SessionChannel = channel
}
Wide.Server = strings.Replace(Wide.Server, "{Port}", Wide.Port, 1)
Wide.StaticServer = strings.Replace(Wide.StaticServer, "{Port}", Wide.Port, 1)
Wide.EditorChannel = strings.Replace(Wide.EditorChannel, "{Port}", Wide.Port, 1)