You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.9 KiB
50 lines
1.9 KiB
#!/usr/bin/with-contenv bash
|
|
|
|
if [[ -z $JIGASI_XMPP_PASSWORD ]]; then
|
|
echo 'FATAL ERROR: Jigasi auth password must be set'
|
|
exit 1
|
|
fi
|
|
|
|
OLD_JIGASI_XMPP_PASSWORD=passw0rd
|
|
if [[ "$JIGASI_XMPP_PASSWORD" == "$OLD_JIGASI_XMPP_PASSWORD" ]]; then
|
|
echo 'FATAL ERROR: Jigasi auth password must be changed, check the README'
|
|
exit 1
|
|
fi
|
|
|
|
tpl /defaults/sip-communicator.properties > /config/sip-communicator.properties
|
|
if [[ -f /config/custom-sip-communicator.properties ]]; then
|
|
cat /config/custom-sip-communicator.properties >> /config/sip-communicator.properties
|
|
fi
|
|
|
|
if [[ ! -f /config/logging.properties ]]; then
|
|
cp /defaults/logging.properties /config
|
|
fi
|
|
|
|
# Create Google Cloud Credentials
|
|
if [[ $ENABLE_TRANSCRIPTIONS -eq 1 || $ENABLE_TRANSCRIPTIONS == "true" ]]; then
|
|
if [[ -z $GC_PROJECT_ID || -z $GC_PRIVATE_KEY_ID || -z $GC_PRIVATE_KEY || -z $GC_CLIENT_EMAIL || -z $GC_CLIENT_ID || -z $GC_CLIENT_CERT_URL ]]; then
|
|
echo 'Transcriptions: One or more environment variables are undefined'
|
|
exit 1
|
|
fi
|
|
|
|
jq -n \
|
|
--arg GC_PROJECT_ID "$GC_PROJECT_ID" \
|
|
--arg GC_PRIVATE_KEY_ID "$GC_PRIVATE_KEY_ID" \
|
|
--arg GC_PRIVATE_KEY "$GC_PRIVATE_KEY" \
|
|
--arg GC_CLIENT_EMAIL "$GC_CLIENT_EMAIL" \
|
|
--arg GC_CLIENT_ID "$GC_CLIENT_ID" \
|
|
--arg GC_CLIENT_CERT_URL "$GC_CLIENT_CERT_URL" \
|
|
'{
|
|
type: "service_account",
|
|
project_id: $GC_PROJECT_ID,
|
|
private_key_id: $GC_PRIVATE_KEY_ID,
|
|
private_key: $GC_PRIVATE_KEY,
|
|
client_email: $GC_CLIENT_EMAIL,
|
|
client_id: $GC_CLIENT_ID,
|
|
auth_uri: "https://accounts.google.com/o/oauth2/auth",
|
|
token_uri: "https://oauth2.googleapis.com/token",
|
|
auth_provider_x509_cert_url: "https://www.googleapis.com/oauth2/v1/certs",
|
|
client_x509_cert_url: $GC_CLIENT_CERT_URL
|
|
}' \
|
|
> /config/key.json
|
|
fi
|
|
|