Merge remote-tracking branch 'upstream/master' into if_param
Conflicts: weave weaver/Dockerfile
This commit is contained in:
commit
f5afe3b203
6 files changed
+57
-21
No files matched your search
+1
-2
@@ -1,6 +1,5 @@
|
||||
FROM scratch
|
||||
MAINTAINER Zettio weave@zett.io
|
||||
MAINTAINER Weaveworks Inc <help@weave.works>
|
||||
WORKDIR /home/weave
|
||||
ADD ./weaver /home/weave/
|
||||
CMD []
|
||||
ENTRYPOINT ["/home/weave/weaver", "-wait", "5"]
|
||||
+20
-1
@@ -22,7 +22,6 @@ func main() {
|
||||
|
||||
log.SetPrefix(weave.Protocol + " ")
|
||||
log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds)
|
||||
log.Println(os.Args)
|
||||
|
||||
procs := runtime.NumCPU()
|
||||
// packet sniffing can block an OS thread, so we need one thread
|
||||
@@ -55,6 +54,17 @@ func main() {
|
||||
flag.Parse()
|
||||
peers = flag.Args()
|
||||
|
||||
options := make(map[string]string)
|
||||
flag.Visit(func (f *flag.Flag) {
|
||||
value := f.Value.String()
|
||||
if f.Name == "password" {
|
||||
value = "<elided>"
|
||||
}
|
||||
options[f.Name] = value
|
||||
})
|
||||
log.Println("Command line options:", options)
|
||||
log.Println("Command line peers:", peers)
|
||||
|
||||
if ifaceName == "" {
|
||||
fmt.Println("Missing required parameter 'iface'")
|
||||
os.Exit(1)
|
||||
@@ -73,6 +83,15 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if password == "" {
|
||||
password = os.Getenv("WEAVE_PASSWORD")
|
||||
}
|
||||
if password == "" {
|
||||
log.Println("Communication between peers is unencrypted.")
|
||||
} else {
|
||||
log.Println("Communication between peers is encrypted.")
|
||||
}
|
||||
|
||||
var logFrame func(string, []byte, *layers.Ethernet)
|
||||
if debug {
|
||||
logFrame = func(prefix string, frame []byte, eth *layers.Ethernet) {
|
||||
|
||||
Reference in new issue
Block a user