diff --git a/README b/README index 4588aa5..cfa552e 100644 --- a/README +++ b/README @@ -15,7 +15,7 @@ Set the server administrator's username and password (optional): Configure the list of STUN and TURN servers (optional): - vi static/ice-servers.json + vi data/ice-servers.json Set up a group diff --git a/static/ice-servers.json b/data/ice-servers.json similarity index 100% rename from static/ice-servers.json rename to data/ice-servers.json diff --git a/sfu.go b/sfu.go index 71d45e1..8f817d7 100644 --- a/sfu.go +++ b/sfu.go @@ -81,7 +81,7 @@ func main() { }() } - iceFilename = filepath.Join(staticRoot, "ice-servers.json") + iceFilename = filepath.Join(dataDir, "ice-servers.json") go readPublicGroups() webserver() diff --git a/webserver.go b/webserver.go index f59ee44..c281db9 100644 --- a/webserver.go +++ b/webserver.go @@ -24,7 +24,8 @@ func webserver() { http.HandleFunc("/group/", func(w http.ResponseWriter, r *http.Request) { mungeHeader(w) - http.ServeFile(w, r, staticRoot+"/sfu.html") + http.ServeFile(w, r, + filepath.Join(staticRoot, "sfu.html")) }) http.HandleFunc("/recordings", func(w http.ResponseWriter, r *http.Request) { @@ -33,6 +34,12 @@ func webserver() { }) http.HandleFunc("/recordings/", recordingsHandler) http.HandleFunc("/ws", wsHandler) + http.HandleFunc("/ice-servers.json", + func(w http.ResponseWriter, r *http.Request) { + mungeHeader(w) + http.ServeFile(w, r, + filepath.Join(dataDir, "ice-servers.json")) + }) http.HandleFunc("/public-groups.json", publicHandler) http.HandleFunc("/stats", statsHandler)