working on MongoDB.

This commit is contained in:
mom040267 2014-07-12 01:00:36 +00:00
parent 063fb1982f
commit 552aca7082
13 changed files with 67 additions and 16 deletions

View File

@ -44,3 +44,6 @@ Mutsutoshi Yoshimoto <mutsutoshi.yoshimoto@mixi.co.jp>
TCP routing: testing and bug fixes
(since v3.2.2.7)
Federico Pinna <fpinna@vivocha.com>
MongoDB support
(since v4.1.0.1)

View File

@ -1,9 +1,11 @@
06/25/2014 Oleg Moskalenko <mom040267@gmail.com>
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 <mom040267@gmail.com>
Version 4.0.1.3 'Severard':

View File

@ -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

View File

@ -239,3 +239,5 @@ to see the man page.
Peter Dunkley <peter.dunkley@crocodilertc.net>
Mutsutoshi Yoshimoto <mutsutoshi.yoshimoto@mixi.co.jp>
Federico Pinna <fpinna@vivocha.com>

View File

@ -905,3 +905,5 @@ SEE ALSO
Peter Dunkley <peter.dunkley@crocodilertc.net>
Mutsutoshi Yoshimoto <mutsutoshi.yoshimoto@mixi.co.jp>
Federico Pinna <fpinna@vivocha.com>

View File

@ -333,3 +333,5 @@ SEE ALSO
Peter Dunkley <peter.dunkley@crocodilertc.net>
Mutsutoshi Yoshimoto <mutsutoshi.yoshimoto@mixi.co.jp>
Federico Pinna <fpinna@vivocha.com>

8
STATUS
View File

@ -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.

View File

@ -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 <personlin118@gmail.com>
Peter Dunkley <peter.dunkley@crocodilertc.net>
.PP
Mutsutoshi Yoshimoto <mutsutoshi.yoshimoto@mixi.co.jp>
.PP
Federico Pinna <fpinna@vivocha.com>

View File

@ -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 <config\-file> ] [\fIflags\fP] [ \fB\-\-userdb\fP=<userdb\-file> | \fB\-\-psql\-userdb\fP=<db\-conn\-string> | \fB\-\-mysql\-userdb\fP=<db\-conn\-string> | \fB\-\-redis\-userdb\fP=<db\-conn\-string> ] [\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 <config\-file> ] [\fIflags\fP] [ \fB\-\-userdb\fP=<userdb\-file> | \fB\-\-psql\-userdb\fP=<db\-conn\-string> | \fB\-\-mysql\-userdb\fP=<db\-conn\-string> | \fB\-\-mongo\-userdb\fP=<db\-conn\-string> | \fB\-\-redis\-userdb\fP=<db\-conn\-string> ] [\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 <personlin118@gmail.com>
Peter Dunkley <peter.dunkley@crocodilertc.net>
.PP
Mutsutoshi Yoshimoto <mutsutoshi.yoshimoto@mixi.co.jp>
.PP
Federico Pinna <fpinna@vivocha.com>

View File

@ -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 <personlin118@gmail.com>
Peter Dunkley <peter.dunkley@crocodilertc.net>
.PP
Mutsutoshi Yoshimoto <mutsutoshi.yoshimoto@mixi.co.jp>
.PP
Federico Pinna <fpinna@vivocha.com>

View File

@ -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

View File

@ -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 <mom040267@gmail.com>
- Sync to 4.1.0.1
* Wed Jun 25 2014 Oleg Moskalenko <mom040267@gmail.com>
- Sync to 4.0.1.4
* Fri Jun 13 2014 Oleg Moskalenko <mom040267@gmail.com>

View File

@ -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)) {