diff --git a/AUTHORS b/AUTHORS index 6b8ea91..4e984ee 100644 --- a/AUTHORS +++ b/AUTHORS @@ -44,3 +44,6 @@ Mutsutoshi Yoshimoto TCP routing: testing and bug fixes (since v3.2.2.7) +Federico Pinna + MongoDB support + (since v4.1.0.1) diff --git a/ChangeLog b/ChangeLog index b47135f..eda878d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,11 @@ 06/25/2014 Oleg Moskalenko -Version 4.0.1.4 'Severard': +Version 4.1.0.1 'Vitari': + - SSODA support (TODO). + - MongoDB support (in progress) (Federico Pinna). - multiple origins supported per request. - - working on compilation warnings. - "allocation mismatch" condition fixed (merged from rfc5766-turn-server). - STUN BINDING response fixed in the case of -X (external address) option. + - working on compilation warnings. 06/13/2014 Oleg Moskalenko Version 4.0.1.3 'Severard': diff --git a/INSTALL b/INSTALL index 21d41c0..ec69027 100644 --- a/INSTALL +++ b/INSTALL @@ -902,6 +902,12 @@ XVI. MongoDB setup The MongoDB setup is well documented on their site http://docs.mongodb.org/manual/. +Note: if your system has a "standard" plain vanilla UNIX "make" utility +(that is not a GNU make) then you will have to use the GNU make to compile +the Mongo driver, because the Mongo compilation process was written with +the "proprietary" GNU extentions. For example, in FreeBSD in will have to use +"gmake" command. + If the TURN server was compiled with MongoDB support (mongo-c-driver is the C client library for MongoDB), then we can use the TURN server database parameter --mongo-userdb. The value of this parameter is a connection string diff --git a/README.turnadmin b/README.turnadmin index ab0233f..121c606 100644 --- a/README.turnadmin +++ b/README.turnadmin @@ -239,3 +239,5 @@ to see the man page. Peter Dunkley Mutsutoshi Yoshimoto + + Federico Pinna diff --git a/README.turnserver b/README.turnserver index 555a72f..1db6f03 100644 --- a/README.turnserver +++ b/README.turnserver @@ -905,3 +905,5 @@ SEE ALSO Peter Dunkley Mutsutoshi Yoshimoto + + Federico Pinna diff --git a/README.turnutils b/README.turnutils index 1c2f599..a9462d5 100644 --- a/README.turnutils +++ b/README.turnutils @@ -333,3 +333,5 @@ SEE ALSO Peter Dunkley Mutsutoshi Yoshimoto + + Federico Pinna diff --git a/STATUS b/STATUS index 8febb47..21f4900 100644 --- a/STATUS +++ b/STATUS @@ -93,9 +93,13 @@ compatibility. 39) Congestion avoidance implemented, for all protocols. -40) Multi-tenant server implemented. +40) Coturn project forked from rfc5766-turn-server. -41) Coturn project forked from rfc5766-turn-server. +41) Multi-tenant server implemented (ORIGIN support). + +42) Bandwidth draft support added. + +43) MongoDB support added. Things to be implemented in future (the development roadmap) are described in the TODO file. diff --git a/man/man1/turnadmin.1 b/man/man1/turnadmin.1 index 70b1365..127c3eb 100644 --- a/man/man1/turnadmin.1 +++ b/man/man1/turnadmin.1 @@ -1,5 +1,5 @@ .\" Text automatically generated by txt2man -.TH TURN 1 "25 June 2014" "" "" +.TH TURN 1 "11 July 2014" "" "" .SH GENERAL INFORMATION \fIturnadmin\fP is a TURN administration tool. This tool can be used to manage @@ -152,6 +152,11 @@ MySQL user database connection string. See the \fB\-\-mysql\-userdb\fP option in the \fIturnserver\fP section. .TP .B +\fB\-J\fP, \fB\-\-mongo\-userdb\fP +MongoDB user database connection string. +See the \fB\-\-mysql\-mongo\fP option in the \fIturnserver\fP section. +.TP +.B \fB\-N\fP, \fB\-\-redis\-userdb\fP Redis user database connection string. See the \fB\-\-redis\-userdb\fP option in the \fIturnserver\fP section. @@ -323,3 +328,5 @@ Po\-sheng Lin Peter Dunkley .PP Mutsutoshi Yoshimoto +.PP +Federico Pinna diff --git a/man/man1/turnserver.1 b/man/man1/turnserver.1 index a4546fa..47af6d2 100644 --- a/man/man1/turnserver.1 +++ b/man/man1/turnserver.1 @@ -1,5 +1,5 @@ .\" Text automatically generated by txt2man -.TH TURN 1 "25 June 2014" "" "" +.TH TURN 1 "11 July 2014" "" "" .SH GENERAL INFORMATION The \fBTURN Server\fP project contains the source code of a TURN server and TURN client @@ -87,7 +87,7 @@ is equivalent to: .nf .fam C -$ \fIturnserver\fP [\fB\-n\fP | \fB\-c\fP ] [\fIflags\fP] [ \fB\-\-userdb\fP= | \fB\-\-psql\-userdb\fP= | \fB\-\-mysql\-userdb\fP= | \fB\-\-redis\-userdb\fP= ] [\fB\-z\fP | \fB\-\-no\-auth\fP | \fB\-a\fP | \fB\-\-lt\-cred\-mech\fP ] [\fIoptions\fP] +$ \fIturnserver\fP [\fB\-n\fP | \fB\-c\fP ] [\fIflags\fP] [ \fB\-\-userdb\fP= | \fB\-\-psql\-userdb\fP= | \fB\-\-mysql\-userdb\fP= | \fB\-\-mongo\-userdb\fP= | \fB\-\-redis\-userdb\fP= ] [\fB\-z\fP | \fB\-\-no\-auth\fP | \fB\-a\fP | \fB\-\-lt\-cred\-mech\fP ] [\fIoptions\fP] $ \fIturnserver\fP \fB\-h\fP .fam T @@ -173,6 +173,21 @@ for full MySQL documentation. .RE .TP .B +\fB\-J\fP, \fB\-\-mongo\-userdb\fP +User database connection string for MongoDB. +This database can be used for long\-term and short\-term credentials mechanisms, +and it can store the secret value for secret\-based timed authentication in TURN RESP API. +The connection string format is like that: +.RS +.PP +"mongodb://[username:password@]host1[:port1][,host2[:port2],\.\.\.[,hostN[:portN]]][/[database][?\fIoptions\fP]]" +See the INSTALL file for more explanations and examples. +.PP +Also, see http://docs.mongodb.org/manual/ +for full MongoDB documentation. +.RE +.TP +.B \fB\-N\fP, \fB\-\-redis\-userdb\fP User database connection string for Redis. This database can be used for long\-term and short\-term credentials mechanisms, @@ -212,12 +227,12 @@ per\-server setting. \fB\-a\fP, \fB\-\-lt\-cred\-mech\fP Use long\-term credentials mechanism (this one you need for WebRTC usage). This option can be used with either flat file user database or -PostgreSQL DB or MySQL DB or Redis for user keys storage. +PostgreSQL DB or MySQL DB or MongoDB or Redis for user keys storage. .TP .B \fB\-A\fP, \fB\-\-st\-cred\-mech\fP Use the short\-term credentials mechanism. This option requires -a PostgreSQL or MySQL or Redis DB for short term passwords storage. +a PostgreSQL or MySQL or MongoDB or Redis DB for short term passwords storage. .TP .B \fB\-z\fP, \fB\-\-no\-auth\fP @@ -667,7 +682,7 @@ Redis status and statistics database connection string, if used (default \- empt no Redis stats DB used). This database keeps allocations status information, and it can be also used for publishing and delivering traffic and allocation event notifications. This database option can be used independently of \fB\-\-redis\-userdb\fP option, -and actually Redis can be used for status/statistics and MySQL or PostgreSQL can +and actually Redis can be used for status/statistics and MySQL or MongoDB or PostgreSQL can be used for the user database. The connection string has the same parameters as redis\-userdb connection string. .TP @@ -762,7 +777,7 @@ for that you have a number of \fIoptions\fP: b) userdb config file. - c) a database table (PostgreSQL or MySQL). You will have to set keys with + c) a database table (PostgreSQL or MySQL or MongoDB). You will have to set keys with turnadmin utility (see docs and wiki for turnadmin). You cannot use open passwords in the database. @@ -963,6 +978,8 @@ If a database is used, then users can be divided into multiple independent realm can be administered separately, and each realm can have its own set of users and its own performance \fIoptions\fP (max\-bps, user\-quota, total\-quota). .IP 7) 4 +If you use MongoDB, the database will be setup for you automatically. +.IP 8) 4 Of course, the \fIturnserver\fP can be used in non\-secure mode, when users are allowed to establish sessions anonymously. But in most cases (like WebRTC) that will not work. .PP @@ -1135,3 +1152,5 @@ Po\-sheng Lin Peter Dunkley .PP Mutsutoshi Yoshimoto +.PP +Federico Pinna diff --git a/man/man1/turnutils.1 b/man/man1/turnutils.1 index facf3c5..d507b92 100644 --- a/man/man1/turnutils.1 +++ b/man/man1/turnutils.1 @@ -1,5 +1,5 @@ .\" Text automatically generated by txt2man -.TH TURN 1 "25 June 2014" "" "" +.TH TURN 1 "11 July 2014" "" "" .SH GENERAL INFORMATION A set of turnutils_* programs provides some utility functionality to be used @@ -449,3 +449,5 @@ Po\-sheng Lin Peter Dunkley .PP Mutsutoshi Yoshimoto +.PP +Federico Pinna diff --git a/rpm/build.settings.sh b/rpm/build.settings.sh index 85abba6..c9f5bd9 100755 --- a/rpm/build.settings.sh +++ b/rpm/build.settings.sh @@ -2,7 +2,7 @@ # Common settings script. -TURNVERSION=4.0.1.4 +TURNVERSION=4.1.0.1 BUILDDIR=~/rpmbuild ARCH=`uname -p` TURNSERVER_SVN_URL=http://coturn.googlecode.com/svn diff --git a/rpm/turnserver.spec b/rpm/turnserver.spec index abb3681..6f7063e 100644 --- a/rpm/turnserver.spec +++ b/rpm/turnserver.spec @@ -1,5 +1,5 @@ Name: turnserver -Version: 4.0.1.4 +Version: 4.1.0.1 Release: 0%{dist} Summary: Coturn TURN Server @@ -289,6 +289,8 @@ fi %{_includedir}/turn/client/TurnMsgLib.h %changelog +* Fri Jul 11 2014 Oleg Moskalenko + - Sync to 4.1.0.1 * Wed Jun 25 2014 Oleg Moskalenko - Sync to 4.0.1.4 * Fri Jun 13 2014 Oleg Moskalenko diff --git a/src/apps/relay/dbdrivers/dbd_mongo.c b/src/apps/relay/dbdrivers/dbd_mongo.c index 57a1afd..73debc3 100644 --- a/src/apps/relay/dbdrivers/dbd_mongo.c +++ b/src/apps/relay/dbdrivers/dbd_mongo.c @@ -462,7 +462,7 @@ static int mongo_del_secret(u08bits *secret, u08bits *realm) { BSON_APPEND_UTF8(&query, "value", (const char *)secret); } - mongoc_collection_delete(collection, 0, &query, NULL, NULL); + mongoc_collection_delete(collection, MONGOC_DELETE_NONE, &query, NULL, NULL); mongoc_collection_destroy(collection); bson_destroy(&query); return 0; @@ -844,7 +844,7 @@ static void mongo_reread_realms(secrets_list_t * realms_list) { if (bson_iter_init(&options_iter, &options)) { while(bson_iter_next(&options_iter)) { const char * _k = bson_iter_key(&options_iter); - int32_t _v; + int32_t _v = 0; if (BSON_ITER_HOLDS_DOUBLE(&options_iter)) { _v = (int32_t)bson_iter_double(&options_iter); } else if (BSON_ITER_HOLDS_INT32(&options_iter)) {