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)