Skip to content

Commit bfa4e06

Browse files
committed
Added -no-static argument to disable static file serving
1 parent ba29f3d commit bfa4e06

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

galene.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func main() {
5151
"require use of TURN relays for all media traffic")
5252
flag.StringVar(&turnserver.Address, "turn", "auto",
5353
"built-in TURN server `address` (\"\" to disable)")
54+
flag.BoolVar(&webserver.NoStatic, "no-static", false, "run without serving the frontend")
5455
flag.Parse()
5556

5657
if udpRange != "" {

webserver/webserver.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ var StaticRoot string
3333

3434
var Insecure bool
3535

36+
var NoStatic bool
37+
3638
func Serve(address string, dataDir string) error {
37-
http.Handle("/", &fileHandler{http.Dir(StaticRoot)})
38-
http.HandleFunc("/group/", groupHandler)
39+
if !NoStatic {
40+
http.Handle("/", &fileHandler{http.Dir(StaticRoot)})
41+
http.HandleFunc("/group/", groupHandler)
42+
}
3943
http.HandleFunc("/recordings",
4044
func(w http.ResponseWriter, r *http.Request) {
4145
http.Redirect(w, r,

0 commit comments

Comments
 (0)