From 11b87f879a6205d4e5ad226e63a88bfd1fbf2849 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Fri, 9 Jan 2015 12:56:26 +0000 Subject: [PATCH] make `weave status` show whether encryption is on/off Closes #323. --- site/troubleshooting.md | 1 + weaver/main.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/site/troubleshooting.md b/site/troubleshooting.md index af455f70..6289a67a 100644 --- a/site/troubleshooting.md +++ b/site/troubleshooting.md @@ -57,6 +57,7 @@ This produces output like: ```` weave router 0.7.0 +Encryption off Our name is 7a:f4:56:87:76:3b Sniffing traffic on &{39 65535 ethwe ae:e3:07:9c:8c:d4 up|broadcast|multicast} MACs: diff --git a/weaver/main.go b/weaver/main.go index ac24973d..5d52fbec 100644 --- a/weaver/main.go +++ b/weaver/main.go @@ -135,8 +135,13 @@ func main() { } func handleHttp(router *weave.Router) { + encryption := "off" + if router.Password != nil && len(*router.Password) > 0 { + encryption = "on" + } http.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) { io.WriteString(w, fmt.Sprintln("weave router", version)) + io.WriteString(w, fmt.Sprintln("Encryption", encryption)) io.WriteString(w, router.Status()) }) http.HandleFunc("/connect", func(w http.ResponseWriter, r *http.Request) {