Skip to content

Commit 2bdbdc0

Browse files
committed
Merge branch 'release-0.23'
Conflicts: .jshint
2 parents b03ccff + e4daa5a commit 2bdbdc0

File tree

192 files changed

+38155
-3574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+38155
-3574
lines changed

.jshint

+22-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
{
2-
"smarttabs": true,
3-
"onecase": true,
2+
"asi": true,
3+
"bitwise": false,
4+
"browser": true,
5+
"camelcase": false, // Disabled for now.
46
"curly": true,
57
"forin": true,
6-
"trailing": true,
7-
"asi": true,
8+
"immed": true,
9+
"latedef": true,
810
"maxlen": 1000,
9-
"quotmark": false
11+
"newcap": true,
12+
"noarg": true,
13+
"noempty": false, // Disabled for now.
14+
"nonew": true,
15+
"onecase": true,
16+
"predef": [
17+
"define",
18+
"require",
19+
"console"
20+
],
21+
"quotmark": false,
22+
"smarttabs": true,
23+
"trailing": true,
24+
"undef": true,
25+
"unused": false, // Disabled for now
26+
"globalstrict": true
1027
}

debian/changelog

+28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
spreed-webrtc-server (0.23.0) precise; urgency=low
2+
3+
* Added support for renegotation in web client (disabled).
4+
* Rooms were refactored to be able to confirm joins.
5+
* Added support to PIN lock rooms (server side).
6+
* Updated javascript to follow now jshin rules.
7+
* Updated plugin API to make the main App object available.
8+
* Refactored server side configuration loading.
9+
* Improved usability of image upload positioning and scaling.
10+
* Stream lined third party javascript to reduce size.
11+
* Javascript is now using 'strict' mode everywhere.
12+
* Added suppport for Content Security Policy (CSP).
13+
* Added Javascript source mappings where missing.
14+
* Fixed bye handling in conferences to avoid endless dial tones.
15+
* Added support for audio and/or video only connections when
16+
the corresponding device is not there.
17+
* Several icons were changed for usability reasons.
18+
* Improved dialogs and texts for usability reasons.
19+
* Room bar is now automatically visible when not in a call.
20+
* Updated auto focus behavior of room select forms.
21+
* Implemented a room history on welcome screen.
22+
* Added a sign in button to the top bar.
23+
* Changed order of settings form for usability reasons.
24+
* Missed call toast now always is shown.
25+
* Improved toast notification styles.
26+
27+
-- Simon Eisenmann <[email protected]> Tue, 09 Dec 2014 15:45:52 +0100
28+
129
spreed-webrtc-server (0.22.8) precise; urgency=low
230

331
* Removed opacity transition from chat pane to avoid compositing issues.

doc/CHANNELING-API.txt

+113-6
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ Sending vs receiving document data encapsulation
8787
A : Session attestation token. Only available for incoming data
8888
created by other sessions (optional).
8989

90+
Error returns
91+
92+
Calls providing an Iid which fail will receive an Error document with the
93+
following format:
94+
95+
{
96+
"Type": "Error",
97+
"Code": "value_identifying_error",
98+
"Message": "A description of the error condition"
99+
}
90100

91101
Special purpose documents for channling
92102

@@ -147,18 +157,115 @@ Special purpose documents for channling
147157
Hello: {
148158
Version: "1.0.0",
149159
Ua: "Test client 1.0",
150-
Id: ""
160+
Id: "",
161+
"Credentials": {...}
151162
}
152163
}
153164

154-
Hello document is to be send by the client after connection was
155-
established.
165+
Hello document is to be send by the client after connection was established.
166+
If an Iid is provided, a Welcome document will be returned if joining the
167+
room with the given Id succeeds. Otherwise an Error document with one of the
168+
error codes listed below will be returned. Note that any previous room will
169+
have been left regardless of whether the response is successful.
156170

157171
Keys under Hello:
158172

159-
Version : Channel protocol version (string).
160-
Ua : User agent description (string).
161-
Id : Room id. The default Room has the empty string Id ("") (string).
173+
Version : Channel protocol version (string).
174+
Ua : User agent description (string).
175+
Id : Room id. The default Room has the empty string Id ("") (string).
176+
Credentials : An optional RoomCredentials document containing room
177+
authentication information. See the Room document for
178+
information on how such credentials should be handled after
179+
a Welcome is received for the requested room. Note that
180+
providing credentials while joining an existing room which
181+
does not require them is an error, such requests should be
182+
retried without credentials. In contrast, joining a
183+
non-existent room with credentials will create the room
184+
using the given credentials. Note that an error with a code
185+
of authorization_not_required or invalid_credentials shall
186+
cause the client to discard any cached room credentials.
187+
188+
Error codes:
189+
190+
default_room_disabled : Joining the room "" is not allowed by this
191+
server.
192+
authorization_required : Joining the given room requires credentials.
193+
authorization_not_required : No credentials should be provided for this
194+
room.
195+
invalid_credentials : The provided credentials are incorrect.
196+
room_join_requires_account : Server configuration requires an
197+
authenticated user account to join this room.
198+
199+
Welcome
200+
201+
{
202+
"Type": "Welcome",
203+
"Welcome": {
204+
"Room": {...},
205+
"Users": []
206+
}
207+
}
208+
209+
Welcome is sent in reply to a successful Hello, and contains all data
210+
needed to set up the initial room connection.
211+
212+
Keys under Welcome:
213+
214+
Room: Contains the current state of the room, see the description of
215+
the Room document for more details.
216+
Users: Contains the user list for the room, see the description of
217+
the Users document for more details.
218+
219+
RoomCredentials
220+
221+
{
222+
"PIN": "my-super-sekrit-code"
223+
}
224+
225+
RoomCredentials contains room authentication information, and is used as a
226+
child document when joining or updating a room.
227+
228+
Keys under RoomCredentials:
229+
230+
PIN : A password string which may be used by clients to authenticate
231+
themselves. Note that acceptable characters for this field may be
232+
constrained by the server based upon its configuration.
233+
234+
Room
235+
236+
{
237+
"Type": "Room",
238+
"Name": "room-name-here"
239+
"Credentials": {...}
240+
}
241+
242+
Clients may send a Room document in order to update all room properties
243+
to the values given in the document. The room name must be given and match
244+
the currently joined room. Successful updates will receive an updated Room
245+
document as a reply, or an Error document if the update fails.
246+
247+
Addtionally, the Room document is included in responses to initial joins
248+
and broadcast when room properties are updated.
249+
250+
Keys under Room:
251+
252+
Name : The human readable ID of the room, currently must be globally
253+
unique.
254+
Credentials : Optional authentication information for the room, see the
255+
documentation of the RoomCredentials document for more
256+
details. This field shall only be present when sending or
257+
receiving an update which alters room authentication data.
258+
It should only be inferred that authentication is not
259+
required if joining a room succeeds without credentials and
260+
no updates containing credentials has been received.
261+
Authentication may be disabled by sending a Room document
262+
containing a RoomCredentials document with only empty
263+
fields. Clients shall discard any cached authentication
264+
information upon receiving such an update.
265+
266+
Error codes:
267+
268+
not_in_room : Clients may only update rooms which they have joined.
162269

163270
Peer connection documents
164271

doc/plugin-example.js

+26-13
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,24 @@
1818
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
*
2020
*/
21+
22+
"use strict";
2123
define(['angular'], function(angular) {
2224

2325
return {
2426

25-
// Angular modules - either overwrite existing modules or add new
26-
// ones. All app dependencies are already loaded so modules defined
27-
// here will be used instead of the default ones.
28-
// To load add a new module to the angular app, append the name of
29-
// the module to the modules array.
30-
// Defining a module in a plugin is optional.
31-
module: function(modules) {
27+
/**
28+
* Modules function for this plugin. Use it to add Angular modules.
29+
* either overwrite existing modules or add new ones. All app dependencies
30+
* are already loaded so modules defined here will be used instead of
31+
* the default ones. Defining the module function on a plugin is optional.
32+
*
33+
* @param {array} modules - To add a new module to the angular app, append
34+
* the name of the module to the modules array.
35+
* @param {Object} launcher - The launcher object containg $q and $http.
36+
*
37+
*/
38+
module: function(modules, launcher) {
3239

3340
// Create and add a new module.
3441
// See http://docs.angularjs.org/guide/module for details on Angular.
@@ -61,12 +68,18 @@ define(['angular'], function(angular) {
6168

6269
},
6370

64-
// Initialize function for this module.
65-
// Add your angular stuff here. The app is the base Angular module for
66-
// the web application. The plugin initialize function is called after
67-
// the app initialize function.
68-
// Defining the initialize function is optional.
69-
initialize: function(app) {
71+
/**
72+
* Initialize function for this plugin. Use this function to add your
73+
* your Angular stuff to the app. The plugin initializse function is
74+
* called after the app initialize function.
75+
*
76+
* @param {App} app - The base Angular module for the web application.
77+
* @param {Object} launcher - The launcher object containg $q and $http.
78+
* @returns {($q.promise|null)} - Return a $q.promise when you need the
79+
* launcher to wait.
80+
*
81+
*/
82+
initialize: function(app, launcher) {
7083

7184
console.log("Initializing plugin-example ...");
7285

doc/plugin-test-authorize.js

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
*
2020
*/
21+
22+
"use strict";
2123
define(['angular', 'sjcl'], function(angular, sjcl) {
2224

2325
return {

html/head.html

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<meta name="mobile-web-app-capable" content="yes">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
77
<base href="<%.Cfg.B%>">
8+
<%if.Csp%><link rel="stylesheet" type="text/css" href="<%.Cfg.S%>/css/csp.min.css"><%end%>
89
<link rel="stylesheet" type="text/css" href="<%.Cfg.S%>/css/bootstrap.min.css">
910
<link rel="stylesheet" type="text/css" href="<%.Cfg.S%>/css/font-awesome.min.css">
1011
<link rel="stylesheet" type="text/css" href="<%.Cfg.S%>/css/main.min.css">

html/main.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<%define "mainPage"%><!doctype html>
2-
<html class="no-js">
2+
<html class="no-js"<%if.Csp%> ng-csp<%end%>>
33
<head>
44
<%template "head" .%>
55
</head>
@@ -26,7 +26,7 @@
2626
<button title="{{_('Share a file as presentation')}}" class="btn aenablebtn btn-presentation" ng-show="status=='connected' || status=='conference' || layout.presentation" ng-model="layout.presentation" btn-checkbox><i class="fa fa-folder-open-o"></i></button>
2727
<button title="{{_('Share your screen')}}" class="btn aenablebtn btn-screenshare" ng-disabled="!supported.screensharing" ng-show="status=='connected' || status=='conference' || layout.screenshare" ng-model="layout.screenshare" btn-checkbox><i class="fa fa-desktop"></i></button>
2828
<button title="{{_('Chat')}}" class="btn btn-chat" ng-class="{messagesunseen: chatMessagesUnseen>0}" ng-model="layout.chat" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa fa-comments-o"></i><span class="badge" ng-show="chatMessagesUnseen" ng-bind="chatMessagesUnseen"></span></button>
29-
<button ng-show="myid && myuserid" title="{{_('Contacts')}}" class="btn btn-contacts" ng-click="openContactsManager()"><i class="fa fa-bookmark-o"></i></button>
29+
<button ng-show="myid && myuserid" title="{{_('Contacts')}}" class="btn btn-contacts" ng-click="openContactsManager()"><i class="fa fa-sitemap"></i></button>
3030
<button title="{{_('Mute microphone')}}" class="btn btn-mutemicrophone amutebtn" ng-model="microphoneMute" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa"></i></button>
3131
<button title="{{_('Turn camera off')}}" class="btn btn-mutecamera amutebtn" ng-model="cameraMute" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa"></i></button>
3232
<button title="{{_('Settings')}}" class="btn btn-settings" ng-model="layout.settings" btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false"><i class="fa fa-cog"></i></button>

server.conf.in

+15
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ encryptionSecret = tne-default-encryption-block-key
7878
; all users will join this room if enabled. If it is disabled then a room join
7979
; form will be shown instead.
8080
;defaultRoomEnabled = true
81+
; Whether a user account is required to create a room. This only has an effect
82+
; if user accounts are enabled. Optional, defaults to false.
83+
;authorizeRoomCreation = false
8184
; Server token is a public random string which is used to enhance security of
8285
; server generated security tokens. When the serverToken is changed all existing
8386
; nonces become invalid. Use 32 or 64 characters (eg. 16 or 32 byte hex).
@@ -98,6 +101,18 @@ serverRealm = local
98101
; a front end webserver. Check the doc folder for more info about plugins and
99102
; examples.
100103
;plugin = extra/static/myplugin.js
104+
; Content-Security-Policy HTTP response header value.
105+
; Spreed WebRTC requires inline styles, WebSocket connection to itself and
106+
; data: URL for images.
107+
; The currently recommended CSP is:
108+
; default-src 'self';
109+
; style-src 'self' 'unsafe-inline';
110+
; img-src 'self' data:;
111+
; connect-src 'self' wss://server:port/ws;
112+
;contentSecurityPolicy =
113+
; Content-Security-Policy-Report-Only HTTP response header value. Use this
114+
; to test your CSP before putting it into production.
115+
;contentSecurityPolicyReportOnly =
101116

102117
[log]
103118
;logfile = /var/log/spreed-webrtc-server.log

src/app/spreed-webrtc-server/buffercache.go

+18
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,21 @@ func (cache *bufferCache) New() Buffer {
160160
func (cache *bufferCache) Wrap(data []byte) Buffer {
161161
return &directBuffer{refcnt: 1, cache: cache, buf: bytes.NewBuffer(data)}
162162
}
163+
164+
func readAll(dest Buffer, r io.Reader) error {
165+
var err error
166+
defer func() {
167+
e := recover()
168+
if e == nil {
169+
return
170+
}
171+
if panicErr, ok := e.(error); ok && panicErr == bytes.ErrTooLarge {
172+
err = panicErr
173+
} else {
174+
panic(e)
175+
}
176+
}()
177+
178+
_, err = dest.ReadFrom(r)
179+
return err
180+
}

src/app/spreed-webrtc-server/channeling.go

+35-3
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,41 @@
2121

2222
package main
2323

24+
type DataError struct {
25+
Type string
26+
Code string
27+
Message string
28+
}
29+
30+
func NewDataError(code, message string) error {
31+
return &DataError{"Error", code, message}
32+
}
33+
34+
func (err *DataError) Error() string {
35+
return err.Message
36+
}
37+
38+
type DataRoomCredentials struct {
39+
PIN string
40+
}
41+
2442
type DataHello struct {
25-
Version string
26-
Ua string
27-
Id string
43+
Version string
44+
Ua string
45+
Id string
46+
Credentials *DataRoomCredentials
47+
}
48+
49+
type DataWelcome struct {
50+
Type string
51+
Room *DataRoom
52+
Users []*DataSession
53+
}
54+
55+
type DataRoom struct {
56+
Type string
57+
Name string
58+
Credentials *DataRoomCredentials
2859
}
2960

3061
type DataOffer struct {
@@ -159,6 +190,7 @@ type DataIncoming struct {
159190
Alive *DataAlive
160191
Authentication *DataAuthentication
161192
Sessions *DataSessions
193+
Room *DataRoom
162194
Iid string `json:",omitempty"`
163195
}
164196

0 commit comments

Comments
 (0)