From fcee078c0b2c38a52957b707a75a1d081fb81d36 Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Thu, 30 Jul 2015 15:54:46 +0100 Subject: [PATCH] Fixing build issues --- Makefile | 1 + web.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 36b484b..565b52e 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ install: mkdir -p ~/.mumbledj/web if [ -a ~/.mumbledj/config/mumbledj.gcfg ]; then mv ~/.mumbledj/config/mumbledj.gcfg ~/.mumbledj/config/mumbledj_backup.gcfg; fi; cp -u config.gcfg ~/.mumbledj/config/mumbledj.gcfg + cp -u index.html ~/.mumbledj/web/index.html if [ -d ~/bin ]; then cp -f mumbledj* ~/bin/mumbledj; else sudo cp -f mumbledj* /usr/local/bin/mumbledj; fi; build: diff --git a/web.go b/web.go index 805b71e..8dd02f2 100644 --- a/web.go +++ b/web.go @@ -49,12 +49,12 @@ func (web *WebServer) homepage(w http.ResponseWriter, r *http.Request) { if uname == nil { fmt.Fprintf(w, "Invalid Token") } else { - t, err := template.ParseFiles("index.html") + t, err := template.ParseFiles("~/.mumbledj/web/index.html") if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } - + err = t.Execute(w, &Page{"http://" + getIP() + ":" + strconv.Itoa(web.port) + "/", r.URL.Path[1:]}) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError)