From 9594324e752e27d9a90da30b76f3dfac43e4dade Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 1 Jul 2020 12:32:10 +0200 Subject: coturn: add sample script to generate time-limited user credentials --- .../apps/coturn/contrib/turn-create-time-limited-user.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 roles/apps/coturn/contrib/turn-create-time-limited-user.sh (limited to 'roles') diff --git a/roles/apps/coturn/contrib/turn-create-time-limited-user.sh b/roles/apps/coturn/contrib/turn-create-time-limited-user.sh new file mode 100755 index 00000000..0d4947fc --- /dev/null +++ b/roles/apps/coturn/contrib/turn-create-time-limited-user.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + + +secret="{{ coturn_auth_secret }}" + +time=$(date +%s) +username=$(( $time + $1 )) + +echo username: "$username" +echo password: $(echo -n "$username" | openssl dgst -binary -sha1 -hmac "$secret" | openssl base64) -- cgit v1.2.3