From b180bb46e3034d0ce75c9961a8ccea3eefbc855c Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 15 Sep 2016 09:35:44 -0300 Subject: PLT-3412 WebRTC Server side & System Console (#3706) * WebRTC Server side * WebRTC System Console * Consistency on variable names * Add turn and stun uri validation --- webapp/components/admin_console/admin_sidebar.jsx | 16 ++ .../components/admin_console/webrtc_settings.jsx | 220 +++++++++++++++++++++ webapp/i18n/en.json | 24 +++ webapp/routes/route_admin_console.jsx | 5 + 4 files changed, 265 insertions(+) create mode 100644 webapp/components/admin_console/webrtc_settings.jsx (limited to 'webapp') diff --git a/webapp/components/admin_console/admin_sidebar.jsx b/webapp/components/admin_console/admin_sidebar.jsx index 77d2fa2ae..1e74df05f 100644 --- a/webapp/components/admin_console/admin_sidebar.jsx +++ b/webapp/components/admin_console/admin_sidebar.jsx @@ -180,6 +180,7 @@ export default class AdminSidebar extends React.Component { let samlSettings = null; let clusterSettings = null; let complianceSettings = null; + let webrtcSettings = null; let license = null; let audits = null; @@ -256,6 +257,20 @@ export default class AdminSidebar extends React.Component { ); } + if (global.window.mm_license.Webrtc === 'true') { + webrtcSettings = ( + + } + /> + ); + } + oauthSettings = ( } /> + {webrtcSettings} + + + ); + } + + renderSettings() { + return ( + + + } + helpText={ + + } + value={this.state.enableWebrtc} + onChange={this.handleChange} + /> + + } + placeholder={Utils.localizeMessage('admin.webrtc.gatewayWebsocketUrlExample', 'Ex "wss://webrtc.mattermost.com:8189"')} + helpText={ + + } + value={this.state.gatewayWebsocketUrl} + onChange={this.handleChange} + disabled={!this.state.enableWebrtc} + /> + + } + placeholder={Utils.localizeMessage('admin.webrtc.gatewayAdminUrlExample', 'Ex "https://webrtc.mattermost.com:7089/admin"')} + helpText={ + + } + value={this.state.gatewayAdminUrl} + onChange={this.handleChange} + disabled={!this.state.enableWebrtc} + /> + + } + placeholder={Utils.localizeMessage('admin.webrtc.gatewayAdminSecretExample', 'Ex "PVRzWNN1Tg6szn7IQWvhpAvLByScWxdy"')} + helpText={ + + } + value={this.state.gatewayAdminSecret} + onChange={this.handleChange} + disabled={!this.state.enableWebrtc} + /> + + } + placeholder={Utils.localizeMessage('admin.webrtc.stunUriExample', 'Ex "stun:webrtc.mattermost.com:5349"')} + helpText={ + + } + value={this.state.stunURI} + onChange={this.handleChange} + disabled={!this.state.enableWebrtc} + /> + + } + placeholder={Utils.localizeMessage('admin.webrtc.turnUriExample', 'Ex "turn:webrtc.mattermost.com:5349"')} + helpText={ + + } + value={this.state.turnURI} + onChange={this.handleChange} + disabled={!this.state.enableWebrtc} + /> + + } + placeholder={Utils.localizeMessage('admin.webrtc.turnUsernameExample', 'Ex "myusername"')} + helpText={ + + } + value={this.state.turnUsername} + onChange={this.handleChange} + disabled={!this.state.enableWebrtc || !this.state.turnURI} + /> + + } + placeholder={Utils.localizeMessage('admin.webrtc.turnSharedKeyExample', 'Ex "bXdkOWQxc3d0Ynk3emY5ZmsxZ3NtazRjaWg="')} + helpText={ + + } + value={this.state.turnSharedKey} + onChange={this.handleChange} + disabled={!this.state.enableWebrtc || !this.state.turnURI} + /> + + ); + } +} diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 66e994893..4a6293b2d 100644 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -392,6 +392,7 @@ "admin.image.thumbWidthTitle": "Attachment Thumbnail Width:", "admin.integrations.custom": "Custom Integrations", "admin.integrations.external": "External Services", + "admin.integrations.webrtc": "Mattermost WebRTC", "admin.ldap.baseDesc": "The Base DN is the Distinguished Name of the location where Mattermost should start its search for users in the AD/LDAP tree.", "admin.ldap.baseEx": "Ex \"ou=Unit Name,dc=corp,dc=example,dc=com\"", "admin.ldap.baseTitle": "BaseDN:", @@ -823,6 +824,29 @@ "admin.user_item.switchToEmail": "Switch to Email/Password", "admin.user_item.sysAdmin": "System Admin", "admin.user_item.teamAdmin": "Team Admin", + "admin.webrtc.enableDescription": "When true, Mattermost allows making one on one video calls.", + "admin.webrtc.enableTitle": "Enable Mattermost WebRTC: ", + "admin.webrtc.gatewayAdminSecretDescription": "Enter your admin secret password to access the Gateway Admin URL.", + "admin.webrtc.gatewayAdminSecretExample": "Ex \"PVRzWNN1Tg6szn7IQWvhpAvLByScWxdy\"", + "admin.webrtc.gatewayAdminSecretTitle": "Gateway Admin Secret:", + "admin.webrtc.gatewayAdminUrlDescription": "Enter https://:. Make sure you use HTTP or HTTPS in your URL depending on your server configuration. Mattermost WebRTC uses this URL to obtain valid tokens for each peer to establish the connection.", + "admin.webrtc.gatewayAdminUrlExample": "Ex \"https://webrtc.mattermost.com:7089/admin\"", + "admin.webrtc.gatewayAdminUrlTitle": "Gateway Admin URL:", + "admin.webrtc.gatewayWebsocketUrlDescription": "Enter wss://:. Make sure you use WS or WSS in your URL depending on your server configuration. This is the websocket used to signal and establish communication between the peers.", + "admin.webrtc.gatewayWebsocketUrlExample": "Ex \"wss://webrtc.mattermost.com:8189\"", + "admin.webrtc.gatewayWebsocketUrlTitle": "Gateway Websocket URL:", + "admin.webrtc.stunUriDescription": "Enter your STUN URI as stun::. STUN is a standardized network protocol to allow an end host to assist devices to access its public IP address if it is located behind a NAT.", + "admin.webrtc.stunUriExample": "Ex \"stun:webrtc.mattermost.com:5349\"", + "admin.webrtc.stunUriTitle": "STUN URI", + "admin.webrtc.turnSharedKeyDescription": "Enter your TURN Server Shared Key. This is used to created dynamic passwords to establish the connection. Each password is valid for a short period of time.", + "admin.webrtc.turnSharedKeyExample": "Ex \"bXdkOWQxc3d0Ynk3emY5ZmsxZ3NtazRjaWg=\"", + "admin.webrtc.turnSharedKeyTitle": "TURN Shared Key:", + "admin.webrtc.turnUriDescription": "Enter your TURN URI as turn::. TURN is a standardized network protocol to allow an end host to assist devices to establish a connection by using a relay public IP address if it is located behind a symmetric NAT.", + "admin.webrtc.turnUriExample": "Ex \"turn:webrtc.mattermost.com:5349\"", + "admin.webrtc.turnUriTitle": "TURN URI", + "admin.webrtc.turnUsernameDescription": "Enter your TURN Server Username.", + "admin.webrtc.turnUsernameExample": "Ex \"myusername\"", + "admin.webrtc.turnUsernameTitle": "TURN Username:", "admin.webserverModeDisabled": "Disabled", "admin.webserverModeDisabledDescription": "The Mattermost server will not serve static files.", "admin.webserverModeGzip": "gzip", diff --git a/webapp/routes/route_admin_console.jsx b/webapp/routes/route_admin_console.jsx index f20c5c379..e3e22ed68 100644 --- a/webapp/routes/route_admin_console.jsx +++ b/webapp/routes/route_admin_console.jsx @@ -27,6 +27,7 @@ import EmailSettings from 'components/admin_console/email_settings.jsx'; import PushSettings from 'components/admin_console/push_settings.jsx'; import CustomIntegrationsSettings from 'components/admin_console/custom_integrations_settings.jsx'; import ExternalServiceSettings from 'components/admin_console/external_service_settings.jsx'; +import WebrtcSettings from 'components/admin_console/webrtc_settings.jsx'; import DatabaseSettings from 'components/admin_console/database_settings.jsx'; import StorageSettings from 'components/admin_console/storage_settings.jsx'; import ImageSettings from 'components/admin_console/image_settings.jsx'; @@ -147,6 +148,10 @@ export default ( path='external' component={ExternalServiceSettings} /> + -- cgit v1.2.3-1-g7c22