README.turnadmin 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. GENERAL INFORMATION
  2. turnadmin is a TURN administration tool. This tool can be used to manage
  3. the user accounts (add/remove users, generate
  4. TURN keys for the users). For security reasons, we do not recommend
  5. storing passwords openly. The better option is to use pre-processed "keys"
  6. which are then used for authentication. These keys are generated by turnadmin.
  7. Turnadmin is a link to turnserver binary, but turnadmin performs different
  8. functions.
  9. Options note: turnadmin has long and short option names, for most options.
  10. Some options have only long form, some options have only short form. Their syntax
  11. somewhat different, if an argument is required:
  12. The short form must be used as this (for example):
  13. $ turnadmin -u <username> ...
  14. The long form equivalent must use the "=" character:
  15. $ turnadmin --user=<username> ...
  16. If this is a flag option (no argument required) then their usage are the same, for example:
  17. $ turnadmin -k ...
  18. is equivalent to:
  19. $ turnadmin --key ...
  20. You have always the use the -r <realm> option with commands for long term credentials -
  21. because data for multiple realms can be stored in the same database.
  22. =====================================
  23. NAME
  24. turnadmin - a TURN relay administration tool.
  25. SYNOPSIS
  26. $ turnadmin [command] [options]
  27. $ turnadmin [ -h | --help]
  28. DESCRIPTION
  29. Commands:
  30. -k, --key Generate key for a long-term credentials mechanism user.
  31. -a, --add Add or update a long-term user.
  32. -A, --add-st Add or update a short-term credentials mechanism user.
  33. -d, --delete Delete a long-term user.
  34. -D, --delete-st Delete a short-term user.
  35. -l, --list List long-term users in the database.
  36. -L, --list-st List short-term users in the database.
  37. -s, --set-secret=<value> Add shared secret for TURN RESP API
  38. -S, --show-secret Show stored shared secrets for TURN REST API
  39. -X, --delete-secret=<value> Delete a shared secret.
  40. --delete-all_secrets Delete all shared secrets for REST API.
  41. -O, --add-origin Add origin-to-realm relation.
  42. -R, --del-origin Delete origin-to-realm relation.
  43. -I, --list-origins List origin-to-realm relations.
  44. -g, --set-realm-option Set realm params: max-bps, total-quota, user-quota.
  45. -G, --list-realm-options List realm params.
  46. NOTE: if you are using the flat file for the user database, then you will have
  47. to use a text editor to set or show the shared secrets.
  48. NOTE: the origin functionality is not supported with flat user db file,
  49. a "real" database must be used.
  50. Options with required values:
  51. -b, --userdb File-based user database file name (default - turnuserdb.conf).
  52. See the --userdb option in the turnserver section.
  53. -e, --psql-userdb PostgreSQL user database connection string.
  54. See the --psql-userdb option in the turnserver section.
  55. -M, --mysql-userdb MySQL user database connection string.
  56. See the --mysql-userdb option in the turnserver section.
  57. -J, --mongo-userdb MongoDB user database connection string.
  58. See the --mysql-mongo option in the turnserver section.
  59. -N, --redis-userdb Redis user database connection string.
  60. See the --redis-userdb option in the turnserver section.
  61. -u, --user User name.
  62. -r, --realm Realm, for long-term credentials mechanism only.
  63. -p, --password Password.
  64. -o, --origin Origin
  65. -H, --sha256 Use SHA256 as the keys hash function (a non-standard feature).
  66. By default, MD5 is used for the key storage encryption
  67. (as required by the current STUN/TURNstandards).
  68. --max-bps Set value of realm's max-bps parameter.
  69. --total-quota Set value of realm's total-quota parameter.
  70. --user-quota Set value of realm's user-quota parameter.
  71. -h, --help Help.
  72. Generate a key:
  73. $ turnadmin -k -u <username> -r <realm> -p <password>
  74. Add/update a user in the userdb file or in the database:
  75. $ turnadmin -a [-b <userdb-file> | -e <db-connection-string> | -M <db-connection-string> | -N <db-connection-string> ] -u <username> -r <realm> -p <password>
  76. Delete a user from the userdb file or from the database:
  77. $ turnadmin -d [-b <userdb-file> | -e <db-connection-string> | -M <db-connection-string> | -N <db-connection-string> ] -u <username> -r <realm>
  78. List all long-term users in MySQL database:
  79. $ turnadmin -l --mysql-userdb="<db-connection-string>" -r <realm>
  80. List all short-term users in Redis database:
  81. $ turnadmin -L --redis-userdb="<db-connection-string>"
  82. Set secret in MySQL database:
  83. $ turnadmin -s <secret> --mysql-userdb="<db-connection-string>" -r <realm>
  84. Show secret stored in PostgreSQL database:
  85. $ turnadmin -S --psql-userdb="<db-connection-string>" -r <realm>
  86. Set origin-to-realm relation in MySQL database:
  87. $ turnadmin --mysql-userdb="<db-connection-string>" -r <realm> -o <origin>
  88. Delete origin-to-realm relation from Redis DB:
  89. $ turnadmin --redis-userdb="<db-connection-string>" -o <origin>
  90. List all origin-to-realm relations in Redis DB:
  91. $ turnadmin --redis-userdb="<db-connection-string>" -I
  92. List the origin-to-realm relations in PostgreSQL DB for a single realm:
  93. $ turnadmin --psql-userdb="<db-connection-string>" -I -r <realm>
  94. Help:
  95. $ turnadmin -h
  96. =======================================
  97. DOCS
  98. After installation, run the command:
  99. $ man turnadmin
  100. or in the project root directory:
  101. $ man -M man turnadmin
  102. to see the man page.
  103. =====================================
  104. FILES
  105. /etc/turnserver.conf
  106. /etc/turnuserdb.conf
  107. /usr/local/etc/turnserver.conf
  108. /usr/local/etc/turnuserdb.conf
  109. =====================================
  110. DIRECTORIES
  111. /usr/local/share/turnserver
  112. /usr/local/share/doc/turnserver
  113. /usr/local/share/examples/turnserver
  114. ======================================
  115. SEE ALSO
  116. turnserver, turnutils
  117. ======================================
  118. WEB RESOURCES
  119. project page:
  120. http://code.google.com/p/coturn/
  121. Wiki page:
  122. http://code.google.com/p/coturn/wiki/Readme
  123. forum:
  124. https://groups.google.com/forum/?fromgroups=#!forum/turn-server-project-rfc5766-turn-server/
  125. ======================================
  126. AUTHORS
  127. Oleg Moskalenko <[email protected]>
  128. Gabor Kovesdan http://kovesdan.org/
  129. Daniel Pocock http://danielpocock.com/
  130. John Selbie ([email protected])
  131. Lee Sylvester <[email protected]>
  132. Erik Johnston <[email protected]>
  133. Roman Lisagor <[email protected]>
  134. Vladimir Tsanev <[email protected]>
  135. Po-sheng Lin <[email protected]>
  136. Peter Dunkley <[email protected]>
  137. Mutsutoshi Yoshimoto <[email protected]>
  138. Federico Pinna <[email protected]>
  139. Bradley T. Hughes <[email protected]>