README.turnadmin 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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. -P, --generate-encrypted-password Generate and print to the standard
  31. output an encrypted form of a password (for web admin user or CLI).
  32. The value then can be used as a safe key for the password
  33. storage on disk or in the database. Every invocation for the same password
  34. produces a different result. The for mat of the encrypted password is:
  35. $5$<...salt...>$<...sha256(salt+password)...>. Salt is 16 characters,
  36. the sha256 output is 64 characters. Character 5 is the algorithm id (sha256).
  37. Only sha256 is supported as the hash function.
  38. -k, --key Generate key for a long-term credentials mechanism user.
  39. -a, --add Add or update a long-term user.
  40. -A, --add-admin Add or update an admin user.
  41. -d, --delete Delete a long-term user.
  42. -D, --delete-admin Delete an admin user.
  43. -l, --list List long-term users in the database.
  44. -L, --list-admin List admin users in the database.
  45. -s, --set-secret=<value> Add shared secret for TURN RESP API
  46. -S, --show-secret Show stored shared secrets for TURN REST API
  47. -X, --delete-secret=<value> Delete a shared secret.
  48. --delete-all_secrets Delete all shared secrets for REST API.
  49. -O, --add-origin Add origin-to-realm relation.
  50. -R, --del-origin Delete origin-to-realm relation.
  51. -I, --list-origins List origin-to-realm relations.
  52. -g, --set-realm-option Set realm params: max-bps, total-quota, user-quota.
  53. -G, --list-realm-options List realm params.
  54. Options with required values:
  55. -b, --db, --userdb SQLite user database file name (default - /var/db/turndb or
  56. /usr/local/var/db/turndb or /var/lib/turn/turndb).
  57. See the same option in the turnserver section.
  58. -e, --psql-userdb PostgreSQL user database connection string.
  59. See the --psql-userdb option in the turnserver section.
  60. -M, --mysql-userdb MySQL user database connection string.
  61. See the --mysql-userdb option in the turnserver section.
  62. -J, --mongo-userdb MongoDB user database connection string.
  63. See the --mysql-mongo option in the turnserver section.
  64. -N, --redis-userdb Redis user database connection string.
  65. See the --redis-userdb option in the turnserver section.
  66. -u, --user User name.
  67. -r, --realm Realm.
  68. -p, --password Password.
  69. -o, --origin Origin
  70. --max-bps Set value of realm's max-bps parameter.
  71. --total-quota Set value of realm's total-quota parameter.
  72. --user-quota Set value of realm's user-quota parameter.
  73. -h, --help Help.
  74. Command examples:
  75. Generate an encrypted form of a password:
  76. $ turnadmin -P -p <password>
  77. Generate a key:
  78. $ turnadmin -k -u <username> -r <realm> -p <password>
  79. Add/update a user in the in the database:
  80. $ turnadmin -a [-b <userdb-file> | -e <db-connection-string> | -M <db-connection-string> | -N <db-connection-string> ] -u <username> -r <realm> -p <password>
  81. Delete a user from the database:
  82. $ turnadmin -d [-b <userdb-file> | -e <db-connection-string> | -M <db-connection-string> | -N <db-connection-string> ] -u <username> -r <realm>
  83. List all long-term users in MySQL database:
  84. $ turnadmin -l --mysql-userdb="<db-connection-string>" -r <realm>
  85. List all admin users in Redis database:
  86. $ turnadmin -L --redis-userdb="<db-connection-string>"
  87. Set secret in MySQL database:
  88. $ turnadmin -s <secret> --mysql-userdb="<db-connection-string>" -r <realm>
  89. Show secret stored in PostgreSQL database:
  90. $ turnadmin -S --psql-userdb="<db-connection-string>" -r <realm>
  91. Set origin-to-realm relation in MySQL database:
  92. $ turnadmin --mysql-userdb="<db-connection-string>" -r <realm> -o <origin>
  93. Delete origin-to-realm relation from Redis DB:
  94. $ turnadmin --redis-userdb="<db-connection-string>" -o <origin>
  95. List all origin-to-realm relations in Redis DB:
  96. $ turnadmin --redis-userdb="<db-connection-string>" -I
  97. List the origin-to-realm relations in PostgreSQL DB for a single realm:
  98. $ turnadmin --psql-userdb="<db-connection-string>" -I -r <realm>
  99. Help:
  100. $ turnadmin -h
  101. =======================================
  102. DOCS
  103. After installation, run the command:
  104. $ man turnadmin
  105. or in the project root directory:
  106. $ man -M man turnadmin
  107. to see the man page.
  108. =====================================
  109. FILES
  110. /etc/turnserver.conf
  111. /var/db/turndb
  112. /usr/local/var/db/turndb
  113. /var/lib/turn/turndb
  114. /usr/local/etc/turnserver.conf
  115. =====================================
  116. DIRECTORIES
  117. /usr/local/share/turnserver
  118. /usr/local/share/doc/turnserver
  119. /usr/local/share/examples/turnserver
  120. ======================================
  121. SEE ALSO
  122. turnserver, turnutils
  123. ======================================
  124. WEB RESOURCES
  125. project page:
  126. https://github.com/coturn/coturn/
  127. Wiki page:
  128. https://github.com/coturn/coturn/wiki
  129. forum:
  130. https://groups.google.com/forum/?fromgroups=#!forum/turn-server-project-rfc5766-turn-server/
  131. ======================================
  132. AUTHORS
  133. Oleg Moskalenko <[email protected]>
  134. Gabor Kovesdan http://kovesdan.org/
  135. Daniel Pocock http://danielpocock.com/
  136. John Selbie ([email protected])
  137. Lee Sylvester <[email protected]>
  138. Erik Johnston <[email protected]>
  139. Roman Lisagor <[email protected]>
  140. Vladimir Tsanev <[email protected]>
  141. Po-sheng Lin <[email protected]>
  142. Peter Dunkley <[email protected]>
  143. Mutsutoshi Yoshimoto <[email protected]>
  144. Federico Pinna <[email protected]>
  145. Bradley T. Hughes <[email protected]>