-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextensions.go
60 lines (45 loc) · 1.19 KB
/
extensions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
import (
"log"
"net/http"
"os"
"github.com/gorilla/mux"
)
var (
// URL of the sidecar
sidecarUrl string
// Password for NoVNC
noVNCPassword string
// BBB credentials
bbbSharedSecret string
bbbUrl string
// Jitsi credentials
jitsiUrl string
// Whether to replace BBB by Jitsi
jitsiReplacesBBB bool
// subdirectory for extensions service, must start with '/'
extensionsSubdir string
)
func main() {
log.SetFlags(0)
sidecarUrl = os.Getenv("SIDECAR_URL")
noVNCPassword = os.Getenv("NOVNC_PASSWORD")
extensionsSubdir = os.Getenv("EXTENSIONS_SUBDIR")
bbbSharedSecret = os.Getenv("BBB_SECRET")
bbbUrl = os.Getenv("BBB_URL")
jitsiUrl = os.Getenv("JITSI_URL")
jitsiReplacesBBBValue := os.Getenv("JITSI_REPLACES_BBB")
if jitsiReplacesBBBValue == "true" {
log.Println("Jitsi replaces BigBlueButton")
jitsiReplacesBBB = true
}
r := mux.NewRouter()
r.HandleFunc("/getNoVNCPassword/", noVNCPasswordHandler)
r.HandleFunc("/bigbluebutton/", getBBBUrl)
r.HandleFunc("/jitsi/", createJitsiInstance)
log.Println("Extensions service is listening on port 8080")
err := http.ListenAndServe(":8080", r)
if err != nil {
log.Fatalln("Extensions failed:", err)
}
}