Open Lynxhide opened 4 months ago
@Lynxhide , I think you have to connect database and create user with username, password, for example, I could use sqlite and here is the table:
To create user, you could refer to this: https://github.com/coturn/coturn/wiki/turnadmin
The version used is docker/4.6.2-r9
Using commands "$ turnadmin -d [-b
Output returned by executing command: 0: (806284): INFO: MySQL DB connection success: 0: (806284): INFO: log file opened: /var/log/turn_806284_2024-06-21.log 0: (806284): INFO: Connection is not secure. 0: (806284): INFO: MySQL connection was closed.
hello @Lynxhide ,
Could you test with this command, here I'm using redis, if you use mysql, connection string option will be -M
.
./bin/turnadmin -P -p <password>
./bin/turnadmin -a -u <username> -r <realm> -p <result_of_above_command> -N "ip=127.0.0.1 dbname=0 password=turnserver port=6379 connect_timeout=60"
Log:
0: (18446744073709551615): INFO: System cpu num is 10
0: (18446744073709551615): INFO: log file opened: /var/tmp/turn_56107_2024-06-21.log
0: (18446744073709551615): INFO: System enable num is 10
0: (18446744073709551615): INFO: Redis DB sync connection success: ip=127.0.0.1 dbname=0 password=turnserver port=6379 connect_timeout=60
0: (18446744073709551615): INFO: Redis connection was closed.
hello@dangngoctam00 I have configured Redis and MySQL in my configuration file. Is there a conflict? Can only choose between the two?
@Lynxhide , I think you could only use one database type at once although I've not tested it.
But the tool turnadmin
seems use the connection passed to it when running.
Executed the above command
./bin/turnadmin -P -p
Message output 0: (808362): INFO: MySQL DB connection success: 0: (808362): INFO: log file opened: /var/log/turn_808362_2024-06-21.log 0: (808362): INFO: Connection is not secure. 0: (808362): INFO: MySQL connection was closed.
conclusion:I still couldn't find any record information when searching in mariadb
Could you check connection string: 0: (808362): INFO: Connection is not secure.
, I didn't see successful log.
From this docs: https://github.com/coturn/coturn/blob/master/docs/MySQL.md
If you have to use a secure MySQL connection (SSL) then you have to use also the optional connection string parameters for the secure communications: ca, capath, cert, key, cipher (see http://dev.mysql.com/doc/refman/5.1/en/ssl-options.html for the command options description).
Using a database account and password may allow normal connection to mariadb
Using Redis, the turnadmin command can create admin account information and query key values in db 0, but web admin still cannot be used
/usr/local/coturn/bin/turnadmin -P -p xxx $5$80bf07085535f6a4$94b6a0d2f52a87e0118e8af38542d3ca226f087c6595bba99add534c70747f51
/usr/local/coturn/bin/turnadmin -a -u admin -r xx -p xx--redis-userdb="ip=xxxx dbname=0 password=xxx port=6379 connect_timeout=30"
Message output: 0: (808778): INFO: Redis DB sync connection success: ip=x.x.x.x dbname=0 password=xxxx port=6379 connect_timeout=30 0: (808778): INFO: log file opened: /var/log/turn_808778_2024-06-21.log 0: (808778): INFO: Redis connection was closed.
Connect Redis to query the keys value as follows: xxxx:6379> keys * 1) "turn/realm/realmtest/user/admin/key" xxxx:6379> GET "turn/realm/realmtest/user/admin/key" "9efdfc069114229163e01a6030271cf8"
Web error information: To use the HTTPS admin connection, you have to set the database table admin_user with the admin user accounts.
@Lynxhide sorry, but it seems like we have to use both mysql and redis, so my previous thought is not correct. I've tested web admin with sqlite several months ago, could you test it? config of coTURN:
userdb=/Users/ngtam/Projects/coturn/turndb
redis-userdb="ip=127.0.0.1 dbname=0 password=turnserver port=6379 connect_timeout=60"
If you cannot insert admin account by turnadmin
tool, I suggest you should do it manually after generating encrypted password.
@dangngoctam00 Currently, I have tried using commands from MySQL and Redis to add an admin account for HTTPS access, but the browser still reported the same error. Can you access web admin using sqlite? My operation is also based on the document.
Redis is necessary for us to use and is also used to store verification information.
@Lynxhide I've just tested, I cannot use userdb
and redis-userdb
at once, sorry for my confusion. What verification information do you need to store?
@dangngoctam00 Is it convenient to post your configuration file? We have only connected to Redis, but it has not been put into use yet. I want to use the web admin function now.
May I ask if the information viewed by the web admin is similar to the information output by the prometheus client-c monitoring tool?
Here is my example configuration:
listening-port=3478
tls-listening-port=5349
listening-ip=0.0.0.0
listening-ip=127.0.0.1
relay-ip=127.0.0.1
min-port=1000
max-port=30200
verbose
fingerprint
prometheus
use-auth-secret
static-auth-secret=authkey
userdb=/Users/ngtam/Projects/coturn/coturn/turndb/turndb
redis-statsdb="ip=127.0.0.1 dbname=1 password=turnserver port=6379 connect_timeout=5"
realm=127.0.0.1
max-bps=0
bps-capacity=0
log-file=/Users/ngtam/Projects/coturn/coturn/logs/
allow-loopback-peers
no-multicast-peers
mobility
no-cli
cli-password=qwerty
web-admin
web-admin-port=8999
The information provided by web admin seems instantly compared to prometheus, the traffic in prometheus is only updated at the end of session,... But when I used web admin, I see the coTURN service crash without reason, IMHO, I think it's not necessary to use web-admin. If you want to collect traffic instantly, you could use redis pub-sub to analyze data.
@dangngoctam00 May I ask you how Redis pub sub can analyze real-time traffic? Do you need to use other tools?
What is the difference between the parameters use-auth-secre, static-auth-secret=authkey and lt-cred-mech?
use auth secret
is used when you need dynamic user and time-based token, it uses static auth secret
to verify username, password by verifying signature, you could search for keyword 'turn api service', reference: https://stackoverflow.com/questions/35766382/coturn-how-to-use-turn-rest-api@dangngoctam00 Do you have any suggestions for monitoring COTURN? I am currently using Prometheus. Do you have a document explaining the indicator information?
At present, we have not found the reason why web admin cannot be accessed. There may still be some areas that have not been properly configured. What is the available version of coturn for your testing?
@Lynxhide
@dangngoctam00 For COTURN monitoring, currently Prometheus only supports session count related indicator information, and there is no documentation or other reference. The explanation of the indicators is not clear enough. Does Prometheus currently support obtaining data information through API interfaces? Because no similar documents were found on GitHub.
The version I am currently using is: https://github.com/coturn/coturn/releases/tag/docker%2F4.6.2 -r9
@Lynxhide 我刚刚测试过,我不能使用
userdb
和redis-userdb
立刻,为我的困惑感到抱歉。您需要存储哪些验证信息?
How do I open this web page?
configuration information: web-admin web-admin-ip=x.x.x.x web-admin-port=8080 web-admin-listen-on-workers
url:https://x.x.x.x:8080 Google Chrome Access Error Message: TURN Server https admin connection
To use the HTTPS admin connection, you have to set the database table admin_user with the admin user accounts.