<commit_before>#!/bin/bash
cd ~

rm -f ./external_ip
rm -f ./etcd_ip

if [ -z "$ETCD_ADDRESS" ]; then
    curl http://169.254.169.254/latest/meta-data/local-ipv4 2>/dev/null > ./etcd_ip
    echo ":2379" >> ./etcd_ip
else
    echo $ETCD_ADDRESS > ./etcd_ip
fi

if [ -z "$EXTERNAL_IP" ]; then
    curl  http://169.254.169.254/latest/meta-data/public-ipv4 2>/dev/null > ./external_ip
else
    echo $EXTERNAL_IP > ./external_ip
fi

export EXTERNAL_IP=`cat ./external_ip`
export ETCD_ADDRESS=`cat ./etcd_ip`

# service syslog-ng start

/usr/local/bin/turnserver -c /opt/coturn/etc/turnserver.conf


<commit_msg>read SECRET_KEY from ETCD<commit_after>#!/bin/bash
cd ~

rm -f ./external_ip
rm -f ./etcd_ip

if [ -z "$ETCD_ADDRESS" ]; then
    curl http://169.254.169.254/latest/meta-data/local-ipv4 2>/dev/null > ./etcd_ip
    echo ":2379" >> ./etcd_ip
else
    echo $ETCD_ADDRESS > ./etcd_ip
fi

if [ -z "$EXTERNAL_IP" ]; then
    curl  http://169.254.169.254/latest/meta-data/public-ipv4 2>/dev/null > ./external_ip
else
    echo $EXTERNAL_IP > ./external_ip
fi

export EXTERNAL_IP=`cat ./external_ip`
export ETCD_ADDRESS=`cat ./etcd_ip`

echo external ip $EXTERNAL_IP
echo etcd url $ETCD_ADDRESS

curl -L "http://$ETCD_ADDRESS/v2/keys/config/bws/server/call_secret" | grep -Po '"value":.*?[^\\]",' > etcd_val
export ETCD_VAL=`cat ./etcd_val`
echo ${ETCD_VAL:9:-2} > etcd_key
export SECRET_KEY=`cat ./etcd_key`

echo key $SECRET_KEY

# service syslog-ng start

/usr/local/bin/turnserver -c /opt/coturn/etc/turnserver.conf


{'fraction_non_alphanumeric': 0.16403162055335968, 'fraction_numerical': 0.04413702239789196, 'mean_word_length': 3.34, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1280039', 'n_tokens_mistral': 675, 'n_tokens_neox': 627, 'n_words': 128}