Commit 8a4d315c authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Move ice-servers.json under dataDir.

This makes it easier to deploy by putting all user-serviceable files
under data/.
parent 4e594465
...@@ -15,7 +15,7 @@ Set the server administrator's username and password (optional): ...@@ -15,7 +15,7 @@ Set the server administrator's username and password (optional):
Configure the list of STUN and TURN servers (optional): Configure the list of STUN and TURN servers (optional):
vi static/ice-servers.json vi data/ice-servers.json
Set up a group Set up a group
......
...@@ -81,7 +81,7 @@ func main() { ...@@ -81,7 +81,7 @@ func main() {
}() }()
} }
iceFilename = filepath.Join(staticRoot, "ice-servers.json") iceFilename = filepath.Join(dataDir, "ice-servers.json")
go readPublicGroups() go readPublicGroups()
webserver() webserver()
......
...@@ -24,7 +24,8 @@ func webserver() { ...@@ -24,7 +24,8 @@ func webserver() {
http.HandleFunc("/group/", http.HandleFunc("/group/",
func(w http.ResponseWriter, r *http.Request) { func(w http.ResponseWriter, r *http.Request) {
mungeHeader(w) mungeHeader(w)
http.ServeFile(w, r, staticRoot+"/sfu.html") http.ServeFile(w, r,
filepath.Join(staticRoot, "sfu.html"))
}) })
http.HandleFunc("/recordings", http.HandleFunc("/recordings",
func(w http.ResponseWriter, r *http.Request) { func(w http.ResponseWriter, r *http.Request) {
...@@ -33,6 +34,12 @@ func webserver() { ...@@ -33,6 +34,12 @@ func webserver() {
}) })
http.HandleFunc("/recordings/", recordingsHandler) http.HandleFunc("/recordings/", recordingsHandler)
http.HandleFunc("/ws", wsHandler) 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("/public-groups.json", publicHandler)
http.HandleFunc("/stats", statsHandler) http.HandleFunc("/stats", statsHandler)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment