secure_relay_secret_with_db_sqlite.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. #
  3. # This is an example how to start a TURN Server in
  4. # secure 'dynamic' 'secret' mode (see https://github.com/coturn/coturn/blob/master/README.turnserver)
  5. # with SQLite database for users information
  6. # with the long-term credentials mechanism.
  7. #
  8. # We start here a TURN Server listening on IPv4 address
  9. # 127.0.0.1 and on IPv6 address ::1. We use 127.0.0.1 as
  10. # IPv4 relay address, and we use ::1 as IPv6 relay address.
  11. #
  12. # Other options:
  13. #
  14. # 1) set bandwidth limit on client session 3000000 bytes per second (--max-bps).
  15. # 2) use fingerprints (-f)
  16. # 3) use 3 relay threads (-m 3)
  17. # 4) use min UDP relay port 32355 and max UDP relay port 65535
  18. # 5) --use-auth-secret means that we are using 'secret' authentication mode.
  19. # Absense of --static-auth-secret value means that we will be taking the secret value
  20. # from the database ('dynamic' mode).
  21. # 6) --realm=north.gov sets realm value as "north.gov".
  22. # 7) --db=<file-name>
  23. # means that local SQLite database <file-name> will be used.
  24. # 8) "--cert=example_turn_server_cert.pem" sets the OpenSSL certificate file name.
  25. # 9) "--pkey=example_turn_server_pkey.pem" sets the OpenSSL private key name.
  26. # 10) "--log-file=stdout" means that all log output will go to the stdout.
  27. # 11) --cipher-list=ALL means that we support all OpenSSL ciphers
  28. # 12) --cli-password=secret means that cli password set to "secret"
  29. # Other parameters (config file name, etc) are default.
  30. if [ -d examples ] ; then
  31. cd examples
  32. fi
  33. export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
  34. export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/usr/local/lib/:/usr/local/mysql/lib/
  35. PATH="./bin/:../bin/:../../bin/:${PATH}" turnserver -v --syslog -a -L 127.0.0.1 -L ::1 -E 127.0.0.1 -E ::1 --allow-loopback-peers --max-bps=3000000 -f -m 3 --min-port=32355 --max-port=65535 --use-auth-secret --realm=north.gov --db="var/db/turndb" --cert=turn_server_cert.pem --pkey=turn_server_pkey.pem --log-file=stdout --cipher-list=ALL --cli-password=secret $@