diff --git a/html/main.html b/html/main.html index 22f9f789..f485bc1d 100644 --- a/html/main.html +++ b/html/main.html @@ -22,14 +22,7 @@
diff --git a/server.conf.in b/server.conf.in index 896d6715..da391922 100644 --- a/server.conf.in +++ b/server.conf.in @@ -115,6 +115,12 @@ serverRealm = local ; to test your CSP before putting it into production. ;contentSecurityPolicyReportOnly = +[modules] +; Modules provide optional functionality. Modules are enabled by default and can be disabled by setting false to their corresponding configuration. +;screensharing = true +;youtube = true +;presentation = true + [log] ;logfile = /var/log/spreed-webrtc-server.log diff --git a/src/app/spreed-webrtc-server/config.go b/src/app/spreed-webrtc-server/config.go index 466461b8..2ed458be 100644 --- a/src/app/spreed-webrtc-server/config.go +++ b/src/app/spreed-webrtc-server/config.go @@ -23,11 +23,11 @@ package main import ( "fmt" + "github.com/strukturag/phoenix" + "log" "net/http" "strings" "time" - - "github.com/strukturag/phoenix" ) type Config struct { @@ -46,6 +46,7 @@ type Config struct { DefaultRoomEnabled bool // Flag if default room ("") is enabled Plugin string // Plugin to load AuthorizeRoomCreation bool // Whether a user account is required to create rooms + Modules []string // List of enabled modules globalRoomID string // Id of the global room (not exported to Javascript) contentSecurityPolicy string // HTML content security policy contentSecurityPolicyReportOnly string // HTML content security policy in report only mode @@ -85,6 +86,16 @@ func NewConfig(container phoenix.Container, tokens bool) *Config { turnURIs := strings.Split(turnURIsString, " ") trimAndRemoveDuplicates(&turnURIs) + // Get enabled modules. + allModules := []string{"screensharing", "youtube", "presentation"} + modules := allModules[:0] + for _, module := range allModules { + if container.GetBoolDefault("modules", module, true) { + modules = append(modules, module) + } + } + log.Println("Enabled modules:", modules) + return &Config{ Title: container.GetStringDefault("app", "title", "Spreed WebRTC"), ver: ver, @@ -101,6 +112,7 @@ func NewConfig(container phoenix.Container, tokens bool) *Config { DefaultRoomEnabled: container.GetBoolDefault("app", "defaultRoomEnabled", true), Plugin: container.GetStringDefault("app", "plugin", ""), AuthorizeRoomCreation: container.GetBoolDefault("app", "authorizeRoomCreation", false), + Modules: modules, globalRoomID: container.GetStringDefault("app", "globalRoom", ""), contentSecurityPolicy: container.GetStringDefault("app", "contentSecurityPolicy", ""), contentSecurityPolicyReportOnly: container.GetStringDefault("app", "contentSecurityPolicyReportOnly", ""), diff --git a/static/js/directives/directives.js b/static/js/directives/directives.js index e12f192d..b0a110ec 100644 --- a/static/js/directives/directives.js +++ b/static/js/directives/directives.js @@ -47,7 +47,8 @@ define([ 'directives/youtubevideo', 'directives/bfi', 'directives/title', - 'directives/welcome'], function(_, onEnter, onEscape, statusMessage, buddyList, buddyPictureCapture, buddyPictureUpload, settings, chat, audioVideo, usability, audioLevel, fileInfo, screenshare, roomBar, socialShare, page, contactRequest, defaultDialog, pdfcanvas, odfcanvas, presentation, youtubevideo, bfi, title, welcome) { + 'directives/welcome', + 'directives/menu'], function(_, onEnter, onEscape, statusMessage, buddyList, buddyPictureCapture, buddyPictureUpload, settings, chat, audioVideo, usability, audioLevel, fileInfo, screenshare, roomBar, socialShare, page, contactRequest, defaultDialog, pdfcanvas, odfcanvas, presentation, youtubevideo, bfi, title, welcome, menu) { var directives = { onEnter: onEnter, @@ -74,7 +75,8 @@ define([ youtubevideo: youtubevideo, bfi: bfi, title: title, - welcome: welcome + welcome: welcome, + menu: menu }; var initialize = function(angModule) { diff --git a/static/js/directives/menu.js b/static/js/directives/menu.js new file mode 100644 index 00000000..e3b76133 --- /dev/null +++ b/static/js/directives/menu.js @@ -0,0 +1,47 @@ +/* + * Spreed WebRTC. + * Copyright (C) 2013-2015 struktur AG + * + * This file is part of Spreed WebRTC. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see