Include DNS version and domain in status
This commit is contained in:
1 parent
9cf7da7277
commit
50f6402774
2 files changed
+4
-3
No files matched your search
+3
-2
@@ -17,12 +17,13 @@ func httpErrorAndLog(level *log.Logger, w http.ResponseWriter, msg string,
|
|||||||
level.Printf("[http] "+logmsg, logargs...)
|
level.Printf("[http] "+logmsg, logargs...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func ListenHttp(domain string, db Zone, port int) {
|
func ListenHttp(version string, domain string, db Zone, port int) {
|
||||||
|
|
||||||
router := mux.NewRouter()
|
router := mux.NewRouter()
|
||||||
|
|
||||||
router.Methods("GET").Path("/status").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
router.Methods("GET").Path("/status").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
io.WriteString(w, "ok")
|
io.WriteString(w, fmt.Sprintln("weave DNS", version))
|
||||||
|
io.WriteString(w, fmt.Sprintln("Serving domain", domain))
|
||||||
})
|
})
|
||||||
|
|
||||||
router.Methods("PUT").Path("/name/{identifier:.+}/{ip:.+}").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
router.Methods("PUT").Path("/name/{identifier:.+}/{ip:.+}").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|||||||
+1
-1
@@ -83,7 +83,7 @@ func main() {
|
|||||||
Debug.Printf("DNS fallback at %s:%s", fallbackHost, fallbackPort)
|
Debug.Printf("DNS fallback at %s:%s", fallbackHost, fallbackPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
go weavedns.ListenHttp(localDomain, zone, httpPort)
|
go weavedns.ListenHttp(version, localDomain, zone, httpPort)
|
||||||
srv, err := weavedns.NewDNSServer(srvConfig, zone, iface)
|
srv, err := weavedns.NewDNSServer(srvConfig, zone, iface)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Error.Fatal("Failed to initialize the WeaveDNS server", err)
|
Error.Fatal("Failed to initialize the WeaveDNS server", err)
|
||||||
|
|||||||
Reference in new issue
Block a user