From d1805733feb8c48a7286eb1affc1f98ed1a044a8 Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Thu, 18 Oct 2018 13:49:10 -0400 Subject: MM-12505: remove all things WebRTC (#9700) --- api4/api.go | 5 --- api4/webrtc.go | 23 ----------- api4/webrtc_test.go | 33 ---------------- app/diagnostics.go | 7 ---- app/diagnostics_test.go | 1 - app/session.go | 3 -- app/webrtc.go | 97 ---------------------------------------------- config/default.json | 10 ----- i18n/en.json | 36 ----------------- model/client4.go | 13 ------- model/config.go | 79 ------------------------------------- model/license.go | 2 +- model/webrtc.go | 39 ------------------- model/webrtc_test.go | 48 ----------------------- model/websocket_message.go | 1 - tests/test-config.json | 10 ----- utils/config.go | 2 - wsapi/api.go | 1 - wsapi/webrtc.go | 26 ------------- 19 files changed, 1 insertion(+), 435 deletions(-) delete mode 100644 api4/webrtc.go delete mode 100644 api4/webrtc_test.go delete mode 100644 app/webrtc.go delete mode 100644 model/webrtc.go delete mode 100644 model/webrtc_test.go delete mode 100644 wsapi/webrtc.go diff --git a/api4/api.go b/api4/api.go index b324959e9..f824c5cc0 100644 --- a/api4/api.go +++ b/api4/api.go @@ -106,8 +106,6 @@ type Routes struct { ReactionByNameForPostForUser *mux.Router // 'api/v4/users/{user_id:[A-Za-z0-9]+}/posts/{post_id:[A-Za-z0-9]+}/reactions/{emoji_name:[A-Za-z0-9_-+]+}' - Webrtc *mux.Router // 'api/v4/webrtc' - TermsOfService *mux.Router // 'api/v4/terms_of_service } @@ -196,8 +194,6 @@ func Init(a *app.App, root *mux.Router) *API { api.BaseRoutes.ReactionByNameForPostForUser = api.BaseRoutes.PostForUser.PathPrefix("/reactions/{emoji_name:[A-Za-z0-9\\_\\-\\+]+}").Subrouter() - api.BaseRoutes.Webrtc = api.BaseRoutes.ApiRoot.PathPrefix("/webrtc").Subrouter() - api.BaseRoutes.OpenGraph = api.BaseRoutes.ApiRoot.PathPrefix("/opengraph").Subrouter() api.BaseRoutes.Roles = api.BaseRoutes.ApiRoot.PathPrefix("/roles").Subrouter() @@ -229,7 +225,6 @@ func Init(a *app.App, root *mux.Router) *API { api.InitEmoji() api.InitOAuth() api.InitReaction() - api.InitWebrtc() api.InitOpenGraph() api.InitPlugin() api.InitRole() diff --git a/api4/webrtc.go b/api4/webrtc.go deleted file mode 100644 index 978342393..000000000 --- a/api4/webrtc.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package api4 - -import ( - "net/http" -) - -func (api *API) InitWebrtc() { - api.BaseRoutes.Webrtc.Handle("/token", api.ApiSessionRequired(webrtcToken)).Methods("GET") -} - -func webrtcToken(c *Context, w http.ResponseWriter, r *http.Request) { - result, err := c.App.GetWebrtcInfoForSession(c.Session.Id) - - if err != nil { - c.Err = err - return - } - - w.Write([]byte(result.ToJson())) -} diff --git a/api4/webrtc_test.go b/api4/webrtc_test.go deleted file mode 100644 index 4ad20175e..000000000 --- a/api4/webrtc_test.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package api4 - -import ( - "testing" - - "github.com/mattermost/mattermost-server/model" -) - -func TestGetWebrtcToken(t *testing.T) { - if testing.Short() { - t.SkipNow() - } - - th := Setup().InitBasic().InitSystemAdmin() - defer th.TearDown() - Client := th.Client - - enableWebrtc := *th.App.Config().WebrtcSettings.Enable - defer func() { - th.App.UpdateConfig(func(cfg *model.Config) { *cfg.WebrtcSettings.Enable = enableWebrtc }) - }() - th.App.UpdateConfig(func(cfg *model.Config) { *cfg.WebrtcSettings.Enable = false }) - - _, resp := Client.GetWebrtcToken() - CheckNotImplementedStatus(t, resp) - - Client.Logout() - _, resp = Client.GetWebrtcToken() - CheckUnauthorizedStatus(t, resp) -} diff --git a/app/diagnostics.go b/app/diagnostics.go index 9f4d0d200..f04e6cd78 100644 --- a/app/diagnostics.go +++ b/app/diagnostics.go @@ -36,7 +36,6 @@ const ( TRACK_CONFIG_PASSWORD = "config_password" TRACK_CONFIG_CLUSTER = "config_cluster" TRACK_CONFIG_METRICS = "config_metrics" - TRACK_CONFIG_WEBRTC = "config_webrtc" TRACK_CONFIG_SUPPORT = "config_support" TRACK_CONFIG_NATIVEAPP = "config_nativeapp" TRACK_CONFIG_EXPERIMENTAL = "config_experimental" @@ -493,12 +492,6 @@ func (a *App) trackConfig() { "isdefault_iosapp_download_link": isDefault(*cfg.NativeAppSettings.IosAppDownloadLink, model.NATIVEAPP_SETTINGS_DEFAULT_IOS_APP_DOWNLOAD_LINK), }) - a.SendDiagnostic(TRACK_CONFIG_WEBRTC, map[string]interface{}{ - "enable": *cfg.WebrtcSettings.Enable, - "isdefault_stun_uri": isDefault(*cfg.WebrtcSettings.StunURI, model.WEBRTC_SETTINGS_DEFAULT_STUN_URI), - "isdefault_turn_uri": isDefault(*cfg.WebrtcSettings.TurnURI, model.WEBRTC_SETTINGS_DEFAULT_TURN_URI), - }) - a.SendDiagnostic(TRACK_CONFIG_EXPERIMENTAL, map[string]interface{}{ "client_side_cert_enable": *cfg.ExperimentalSettings.ClientSideCertEnable, "isdefault_client_side_cert_check": isDefault(*cfg.ExperimentalSettings.ClientSideCertCheck, model.CLIENT_SIDE_CERT_CHECK_PRIMARY_AUTH), diff --git a/app/diagnostics_test.go b/app/diagnostics_test.go index 8e8c03935..d4b1e9db6 100644 --- a/app/diagnostics_test.go +++ b/app/diagnostics_test.go @@ -132,7 +132,6 @@ func TestDiagnostics(t *testing.T) { TRACK_CONFIG_PASSWORD, TRACK_CONFIG_CLUSTER, TRACK_CONFIG_METRICS, - TRACK_CONFIG_WEBRTC, TRACK_CONFIG_SUPPORT, TRACK_CONFIG_NATIVEAPP, TRACK_CONFIG_ANALYTICS, diff --git a/app/session.go b/app/session.go index afbc4c7df..6d46f3d3a 100644 --- a/app/session.go +++ b/app/session.go @@ -116,8 +116,6 @@ func (a *App) RevokeAllSessions(userId string) *model.AppError { return result.Err } } - - a.RevokeWebrtcToken(session.Id) } a.ClearSessionCacheForUser(userId) @@ -213,7 +211,6 @@ func (a *App) RevokeSession(session *model.Session) *model.AppError { } } - a.RevokeWebrtcToken(session.Id) a.ClearSessionCacheForUser(session.UserId) return nil diff --git a/app/webrtc.go b/app/webrtc.go deleted file mode 100644 index 08601a98c..000000000 --- a/app/webrtc.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package app - -import ( - "crypto/hmac" - "crypto/sha1" - "encoding/base64" - "net/http" - "strconv" - "strings" - "time" - - "github.com/mattermost/mattermost-server/model" - "github.com/mattermost/mattermost-server/utils" -) - -func (a *App) GetWebrtcInfoForSession(sessionId string) (*model.WebrtcInfoResponse, *model.AppError) { - token, err := a.GetWebrtcToken(sessionId) - if err != nil { - return nil, err - } - - result := &model.WebrtcInfoResponse{ - Token: token, - GatewayUrl: *a.Config().WebrtcSettings.GatewayWebsocketUrl, - } - - if len(*a.Config().WebrtcSettings.StunURI) > 0 { - result.StunUri = *a.Config().WebrtcSettings.StunURI - } - - if len(*a.Config().WebrtcSettings.TurnURI) > 0 { - timestamp := strconv.FormatInt(utils.EndOfDay(time.Now().AddDate(0, 0, 1)).Unix(), 10) - username := timestamp + ":" + *a.Config().WebrtcSettings.TurnUsername - - result.TurnUri = *a.Config().WebrtcSettings.TurnURI - result.TurnPassword = GenerateTurnPassword(username, *a.Config().WebrtcSettings.TurnSharedKey) - result.TurnUsername = username - } - - return result, nil -} - -func (a *App) GetWebrtcToken(sessionId string) (string, *model.AppError) { - if !*a.Config().WebrtcSettings.Enable { - return "", model.NewAppError("WebRTC.getWebrtcToken", "api.webrtc.disabled.app_error", nil, "", http.StatusNotImplemented) - } - - token := base64.StdEncoding.EncodeToString([]byte(sessionId)) - - data := make(map[string]string) - data["janus"] = "add_token" - data["token"] = token - data["transaction"] = model.NewId() - data["admin_secret"] = *a.Config().WebrtcSettings.GatewayAdminSecret - - rq, _ := http.NewRequest("POST", *a.Config().WebrtcSettings.GatewayAdminUrl, strings.NewReader(model.MapToJson(data))) - rq.Header.Set("Content-Type", "application/json") - - if rp, err := a.HTTPService.MakeClient(true).Do(rq); err != nil { - return "", model.NewAppError("WebRTC.Token", "model.client.connecting.app_error", nil, err.Error(), http.StatusInternalServerError) - } else if rp.StatusCode >= 300 { - defer consumeAndClose(rp) - return "", model.AppErrorFromJson(rp.Body) - } else { - janusResponse := model.GatewayResponseFromJson(rp.Body) - if janusResponse.Status != "success" { - return "", model.NewAppError("getWebrtcToken", "api.webrtc.register_token.app_error", nil, "", http.StatusInternalServerError) - } - } - - return token, nil -} - -func GenerateTurnPassword(username string, secret string) string { - key := []byte(secret) - h := hmac.New(sha1.New, key) - h.Write([]byte(username)) - return base64.StdEncoding.EncodeToString(h.Sum(nil)) -} - -func (a *App) RevokeWebrtcToken(sessionId string) { - token := base64.StdEncoding.EncodeToString([]byte(sessionId)) - data := make(map[string]string) - data["janus"] = "remove_token" - data["token"] = token - data["transaction"] = model.NewId() - data["admin_secret"] = *a.Config().WebrtcSettings.GatewayAdminSecret - - rq, _ := http.NewRequest("POST", *a.Config().WebrtcSettings.GatewayAdminUrl, strings.NewReader(model.MapToJson(data))) - rq.Header.Set("Content-Type", "application/json") - - // we do not care about the response - a.HTTPService.MakeClient(true).Do(rq) -} diff --git a/config/default.json b/config/default.json index 14f8248ff..cbbb3fe40 100644 --- a/config/default.json +++ b/config/default.json @@ -367,16 +367,6 @@ "AnalyticsSettings": { "MaxUsersForStatistics": 2500 }, - "WebrtcSettings": { - "Enable": false, - "GatewayWebsocketUrl": "", - "GatewayAdminUrl": "", - "GatewayAdminSecret": "", - "StunURI": "", - "TurnURI": "", - "TurnUsername": "", - "TurnSharedKey": "" - }, "ElasticsearchSettings": { "ConnectionUrl": "http://dockerhost:9200", "Username": "elastic", diff --git a/i18n/en.json b/i18n/en.json index b4771306e..70b36a173 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2422,14 +2422,6 @@ "id": "api.webhook.update_outgoing.intersect.app_error", "translation": "Outgoing webhooks from the same channel cannot have the same trigger words/callback URLs." }, - { - "id": "api.webrtc.disabled.app_error", - "translation": "WebRTC is not enabled in this server." - }, - { - "id": "api.webrtc.register_token.app_error", - "translation": "We encountered an error trying to register the WebRTC Token" - }, { "id": "api.websocket_handler.invalid_param.app_error", "translation": "Invalid {{.Name}} parameter" @@ -4278,34 +4270,6 @@ "id": "model.config.is_valid.time_between_user_typing.app_error", "translation": "Time between user typing updates should not be set to less than 1000 milliseconds." }, - { - "id": "model.config.is_valid.webrtc_gateway_admin_secret.app_error", - "translation": "WebRTC Gateway Admin Secret must be set." - }, - { - "id": "model.config.is_valid.webrtc_gateway_admin_url.app_error", - "translation": "WebRTC Gateway Admin URL must be a valid URL starting with http:// or https://." - }, - { - "id": "model.config.is_valid.webrtc_gateway_ws_url.app_error", - "translation": "WebRTC Gateway Websocket URL must be a valid URL starting with ws:// or wss://." - }, - { - "id": "model.config.is_valid.webrtc_stun_uri.app_error", - "translation": "WebRTC STUN URI must be a valid URL starting with stun:" - }, - { - "id": "model.config.is_valid.webrtc_turn_shared_key.app_error", - "translation": "WebRTC TURN Shared Key cannot be empty if the TURN URI has been set." - }, - { - "id": "model.config.is_valid.webrtc_turn_uri.app_error", - "translation": "WebRTC TURN URI must be a valid URI and start with turn:" - }, - { - "id": "model.config.is_valid.webrtc_turn_username.app_error", - "translation": "WebRTC TURN Username cannot be empty if the TURN URI has been set." - }, { "id": "model.config.is_valid.webserver_security.app_error", "translation": "Invalid value for webserver connection security." diff --git a/model/client4.go b/model/client4.go index c5001c048..a9b4d3826 100644 --- a/model/client4.go +++ b/model/client4.go @@ -3370,19 +3370,6 @@ func (c *Client4) UpdateUserStatus(userId string, userStatus *Status) (*Status, } } -// Webrtc Section - -// GetWebrtcToken returns a valid token, stun server and turn server with credentials to -// use with the Mattermost WebRTC service. -func (c *Client4) GetWebrtcToken() (*WebrtcInfoResponse, *Response) { - if r, err := c.DoApiGet("/webrtc/token", ""); err != nil { - return nil, BuildErrorResponse(r, err) - } else { - defer closeBody(r) - return WebrtcInfoResponseFromJson(r.Body), BuildResponse(r) - } -} - // Emoji Section // CreateEmoji will save an emoji to the server if the current user has permission diff --git a/model/config.go b/model/config.go index dcf3adff5..0774ff9a6 100644 --- a/model/config.go +++ b/model/config.go @@ -135,9 +135,6 @@ const ( NATIVEAPP_SETTINGS_DEFAULT_ANDROID_APP_DOWNLOAD_LINK = "https://about.mattermost.com/mattermost-android-app/" NATIVEAPP_SETTINGS_DEFAULT_IOS_APP_DOWNLOAD_LINK = "https://about.mattermost.com/mattermost-ios-app/" - WEBRTC_SETTINGS_DEFAULT_STUN_URI = "" - WEBRTC_SETTINGS_DEFAULT_TURN_URI = "" - ANALYTICS_SETTINGS_DEFAULT_MAX_USERS_FOR_STATISTICS = 2500 ANNOUNCEMENT_SETTINGS_DEFAULT_BANNER_COLOR = "#f2a93b" @@ -1671,51 +1668,6 @@ func (s *NativeAppSettings) SetDefaults() { } } -type WebrtcSettings struct { - Enable *bool - GatewayWebsocketUrl *string - GatewayAdminUrl *string - GatewayAdminSecret *string - StunURI *string - TurnURI *string - TurnUsername *string - TurnSharedKey *string -} - -func (s *WebrtcSettings) SetDefaults() { - if s.Enable == nil { - s.Enable = NewBool(false) - } - - if s.GatewayWebsocketUrl == nil { - s.GatewayWebsocketUrl = NewString("") - } - - if s.GatewayAdminUrl == nil { - s.GatewayAdminUrl = NewString("") - } - - if s.GatewayAdminSecret == nil { - s.GatewayAdminSecret = NewString("") - } - - if s.StunURI == nil { - s.StunURI = NewString(WEBRTC_SETTINGS_DEFAULT_STUN_URI) - } - - if s.TurnURI == nil { - s.TurnURI = NewString(WEBRTC_SETTINGS_DEFAULT_TURN_URI) - } - - if s.TurnUsername == nil { - s.TurnUsername = NewString("") - } - - if s.TurnSharedKey == nil { - s.TurnSharedKey = NewString("") - } -} - type ElasticsearchSettings struct { ConnectionUrl *string Username *string @@ -2006,7 +1958,6 @@ type Config struct { MetricsSettings MetricsSettings ExperimentalSettings ExperimentalSettings AnalyticsSettings AnalyticsSettings - WebrtcSettings WebrtcSettings ElasticsearchSettings ElasticsearchSettings DataRetentionSettings DataRetentionSettings MessageExportSettings MessageExportSettings @@ -2082,7 +2033,6 @@ func (o *Config) SetDefaults() { o.RateLimitSettings.SetDefaults() o.LogSettings.SetDefaults() o.JobSettings.SetDefaults() - o.WebrtcSettings.SetDefaults() o.MessageExportSettings.SetDefaults() o.TimezoneSettings.SetDefaults() o.DisplaySettings.SetDefaults() @@ -2134,10 +2084,6 @@ func (o *Config) IsValid() *AppError { return err } - if err := o.WebrtcSettings.isValid(); err != nil { - return err - } - if err := o.ServiceSettings.isValid(); err != nil { return err } @@ -2369,31 +2315,6 @@ func (ss *SamlSettings) isValid() *AppError { return nil } -func (ws *WebrtcSettings) isValid() *AppError { - if *ws.Enable { - if len(*ws.GatewayWebsocketUrl) == 0 || !IsValidWebsocketUrl(*ws.GatewayWebsocketUrl) { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_gateway_ws_url.app_error", nil, "", http.StatusBadRequest) - } else if len(*ws.GatewayAdminUrl) == 0 || !IsValidHttpUrl(*ws.GatewayAdminUrl) { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_gateway_admin_url.app_error", nil, "", http.StatusBadRequest) - } else if len(*ws.GatewayAdminSecret) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_gateway_admin_secret.app_error", nil, "", http.StatusBadRequest) - } else if len(*ws.StunURI) != 0 && !IsValidTurnOrStunServer(*ws.StunURI) { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_stun_uri.app_error", nil, "", http.StatusBadRequest) - } else if len(*ws.TurnURI) != 0 { - if !IsValidTurnOrStunServer(*ws.TurnURI) { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_turn_uri.app_error", nil, "", http.StatusBadRequest) - } - if len(*ws.TurnUsername) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_turn_username.app_error", nil, "", http.StatusBadRequest) - } else if len(*ws.TurnSharedKey) == 0 { - return NewAppError("Config.IsValid", "model.config.is_valid.webrtc_turn_shared_key.app_error", nil, "", http.StatusBadRequest) - } - } - } - - return nil -} - func (ss *ServiceSettings) isValid() *AppError { if !(*ss.ConnectionSecurity == CONN_SECURITY_NONE || *ss.ConnectionSecurity == CONN_SECURITY_TLS) { return NewAppError("Config.IsValid", "model.config.is_valid.webserver_security.app_error", nil, "", http.StatusBadRequest) diff --git a/model/license.go b/model/license.go index c30fecf71..fdf18285f 100644 --- a/model/license.go +++ b/model/license.go @@ -57,7 +57,7 @@ type Features struct { CustomPermissionsSchemes *bool `json:"custom_permissions_schemes"` CustomTermsOfService *bool `json:"custom_terms_of_service"` - // after we enabled more features for webrtc we'll need to control them with this + // after we enabled more features we'll need to control them with this FutureFeatures *bool `json:"future_features"` } diff --git a/model/webrtc.go b/model/webrtc.go deleted file mode 100644 index 59797a5ba..000000000 --- a/model/webrtc.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "encoding/json" - "io" -) - -type WebrtcInfoResponse struct { - Token string `json:"token"` - GatewayUrl string `json:"gateway_url"` - StunUri string `json:"stun_uri,omitempty"` - TurnUri string `json:"turn_uri,omitempty"` - TurnPassword string `json:"turn_password,omitempty"` - TurnUsername string `json:"turn_username,omitempty"` -} - -type GatewayResponse struct { - Status string `json:"janus"` -} - -func GatewayResponseFromJson(data io.Reader) *GatewayResponse { - var o *GatewayResponse - json.NewDecoder(data).Decode(&o) - return o -} - -func (o *WebrtcInfoResponse) ToJson() string { - b, _ := json.Marshal(o) - return string(b) -} - -func WebrtcInfoResponseFromJson(data io.Reader) *WebrtcInfoResponse { - var o *WebrtcInfoResponse - json.NewDecoder(data).Decode(&o) - return o -} diff --git a/model/webrtc_test.go b/model/webrtc_test.go deleted file mode 100644 index 4b8b26dc1..000000000 --- a/model/webrtc_test.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package model - -import ( - "strings" - "testing" -) - -func TestWebrtcInfoResponseToFromJson(t *testing.T) { - if testing.Short() { - t.SkipNow() - } - - o := WebrtcInfoResponse{Token: NewId(), GatewayUrl: NewId()} - json := o.ToJson() - ro := WebrtcInfoResponseFromJson(strings.NewReader(json)) - - CheckString(t, ro.Token, o.Token) - CheckString(t, ro.GatewayUrl, o.GatewayUrl) - - invalidJson := `{"wat"` - r := WebrtcInfoResponseFromJson(strings.NewReader(invalidJson)) - if r != nil { - t.Fatalf("Should have failed") - } -} - -func TestGatewayResponseFromJson(t *testing.T) { - if testing.Short() { - t.SkipNow() - } - - // Valid Gateway Response - s1 := `{"janus": "something"}` - g1 := GatewayResponseFromJson(strings.NewReader(s1)) - - CheckString(t, g1.Status, "something") - - // Malformed JSON - s2 := `{"wat"` - g2 := GatewayResponseFromJson(strings.NewReader(s2)) - - if g2 != nil { - t.Fatal("expected nil") - } -} diff --git a/model/websocket_message.go b/model/websocket_message.go index ea8872d76..683f271ec 100644 --- a/model/websocket_message.go +++ b/model/websocket_message.go @@ -37,7 +37,6 @@ const ( WEBSOCKET_EVENT_EPHEMERAL_MESSAGE = "ephemeral_message" WEBSOCKET_EVENT_STATUS_CHANGE = "status_change" WEBSOCKET_EVENT_HELLO = "hello" - WEBSOCKET_EVENT_WEBRTC = "webrtc" WEBSOCKET_AUTHENTICATION_CHALLENGE = "authentication_challenge" WEBSOCKET_EVENT_REACTION_ADDED = "reaction_added" WEBSOCKET_EVENT_REACTION_REMOVED = "reaction_removed" diff --git a/tests/test-config.json b/tests/test-config.json index 8b6181fd2..9c2d48c1e 100644 --- a/tests/test-config.json +++ b/tests/test-config.json @@ -337,16 +337,6 @@ "AnalyticsSettings": { "MaxUsersForStatistics": 2500 }, - "WebrtcSettings": { - "Enable": false, - "GatewayWebsocketUrl": "", - "GatewayAdminUrl": "", - "GatewayAdminSecret": "", - "StunURI": "", - "TurnURI": "", - "TurnUsername": "", - "TurnSharedKey": "" - }, "ElasticsearchSettings": { "ConnectionUrl": "http://dockerhost:9200", "Username": "elastic", diff --git a/utils/config.go b/utils/config.go index a779eef65..b7bd15e61 100644 --- a/utils/config.go +++ b/utils/config.go @@ -586,8 +586,6 @@ func GenerateClientConfig(c *model.Config, diagnosticId string, license *model.L props["RestrictCustomEmojiCreation"] = *c.ServiceSettings.RestrictCustomEmojiCreation props["MaxFileSize"] = strconv.FormatInt(*c.FileSettings.MaxFileSize, 10) - props["EnableWebrtc"] = strconv.FormatBool(*c.WebrtcSettings.Enable) - props["MaxNotificationsPerChannel"] = strconv.FormatInt(*c.TeamSettings.MaxNotificationsPerChannel, 10) props["EnableConfirmNotificationsToChannel"] = strconv.FormatBool(*c.TeamSettings.EnableConfirmNotificationsToChannel) props["TimeBetweenUserTypingUpdatesMilliseconds"] = strconv.FormatInt(*c.ServiceSettings.TimeBetweenUserTypingUpdatesMilliseconds, 10) diff --git a/wsapi/api.go b/wsapi/api.go index f318cba6f..988229737 100644 --- a/wsapi/api.go +++ b/wsapi/api.go @@ -21,7 +21,6 @@ func Init(a *app.App, router *app.WebSocketRouter) { api.InitUser() api.InitSystem() api.InitStatus() - api.InitWebrtc() a.HubStart() } diff --git a/wsapi/webrtc.go b/wsapi/webrtc.go deleted file mode 100644 index de50fa06b..000000000 --- a/wsapi/webrtc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package wsapi - -import ( - "github.com/mattermost/mattermost-server/model" -) - -func (api *API) InitWebrtc() { - api.Router.Handle("webrtc", api.ApiWebSocketHandler(api.webrtcMessage)) -} - -func (api *API) webrtcMessage(req *model.WebSocketRequest) (map[string]interface{}, *model.AppError) { - var ok bool - var toUserId string - if toUserId, ok = req.Data["to_user_id"].(string); !ok || len(toUserId) != 26 { - return nil, NewInvalidWebSocketParamError(req.Action, "to_user_id") - } - - event := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_WEBRTC, "", "", toUserId, nil) - event.Data = req.Data - api.App.Publish(event) - - return nil, nil -} -- cgit v1.2.3-1-g7c22