deployment: Don't use /dev/random to generate coturn secret which produces a pipe error. Use shuf instead

pull/715/head
cruizba 2022-04-21 18:36:33 +02:00
parent 4ab7286978
commit 8edd8827ca
2 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@ if [[ -z "${COTURN_SHARED_SECRET_KEY}" ]]; then
mkdir -p /run/secrets/coturn
# Generate random coturn secret
RANDOM_COTURN_SECRET="$(tr -dc '[:alnum:]' </dev/urandom | head -c 35)"
RANDOM_COTURN_SECRET="$(shuf --echo --repeat --zero-terminated --head-count=35 {A..Z} {a..z} {0..9})"
# Replace value and generate shared-secret-key file
sed "s|{{COTURN_SHARED_SECRET_KEY}}|${RANDOM_COTURN_SECRET}|g" \
@ -38,9 +38,9 @@ if [ -n "${WAIT_KIBANA_URL}" ]; then
printf "\n ======================================="
printf "\n"
until "$(curl --insecure --output /dev/null --silent --head --fail --max-time 10 --connect-timeout 10 "${WAIT_KIBANA_URL}")"
until curl --insecure --output /dev/null --silent --head --fail --max-time 10 --connect-timeout 10 "${WAIT_KIBANA_URL}" &> /dev/null
do
printf "\n Waiting for kibana in '%s' 'URL'. This may take some minutes, please be patient" "${WAIT_KIBANA_URL}"
printf "\n Waiting for kibana in '%s' 'URL'. This may take some minutes, please be patient..." "${WAIT_KIBANA_URL}"
sleep 1
done
printf "\n ==== Kibana is Ready ===="

View File

@ -21,7 +21,7 @@ if [[ -z "${COTURN_SHARED_SECRET_KEY}" ]]; then
mkdir -p /run/secrets/coturn
# Generate random coturn secret
RANDOM_COTURN_SECRET="$(tr -dc '[:alnum:]' </dev/urandom | head -c 35)"
RANDOM_COTURN_SECRET="$(shuf --echo --repeat --zero-terminated --head-count=35 {A..Z} {a..z} {0..9})"
# Replace value and generate shared-secret-key file
sed "s|{{COTURN_SHARED_SECRET_KEY}}|${RANDOM_COTURN_SECRET}|g" \