This commit is contained in:
parent
260bd543ad
commit
d1b0733493
23
conf/wide.go
23
conf/wide.go
|
@ -18,7 +18,6 @@ package conf
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net"
|
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -294,6 +293,11 @@ func Load(confPath, confIP, confPort, confServer, confChannel string, confDocker
|
||||||
|
|
||||||
glog.V(5).Infof("${ip} [%s]", ip)
|
glog.V(5).Infof("${ip} [%s]", ip)
|
||||||
|
|
||||||
|
// Docker
|
||||||
|
if confDocker {
|
||||||
|
confChannel = os.Getenv("channel") // overwrite channel specified
|
||||||
|
}
|
||||||
|
|
||||||
if "" != confIP {
|
if "" != confIP {
|
||||||
ip = confIP
|
ip = confIP
|
||||||
}
|
}
|
||||||
|
@ -331,23 +335,6 @@ func Load(confPath, confIP, confPort, confServer, confChannel string, confDocker
|
||||||
Wide.SessionChannel = confChannel
|
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.Server = strings.Replace(Wide.Server, "{Port}", Wide.Port, 1)
|
||||||
Wide.StaticServer = strings.Replace(Wide.StaticServer, "{Port}", Wide.Port, 1)
|
Wide.StaticServer = strings.Replace(Wide.StaticServer, "{Port}", Wide.Port, 1)
|
||||||
Wide.EditorChannel = strings.Replace(Wide.EditorChannel, "{Port}", Wide.Port, 1)
|
Wide.EditorChannel = strings.Replace(Wide.EditorChannel, "{Port}", Wide.Port, 1)
|
||||||
|
|
Loading…
Reference in New Issue