Added coturn to convertdomain
This commit is contained in:
parent
317eee9297
commit
3d271bc3db
@ -495,6 +495,7 @@ convert_matrix() {
|
||||
|
||||
# Delete matrix database so we can start from scratch
|
||||
MATRIX_SECRET=$(create_password);
|
||||
COTURN_MATRIX_SECRET=$(create_password);
|
||||
docker exec postgresql psql -U postgres -c "drop database matrix" &> /dev/null
|
||||
docker exec postgresql psql -U postgres -c "drop user matrix" &> /dev/null
|
||||
docker exec postgresql psql -U postgres -c "CREATE USER matrix WITH PASSWORD '$MATRIX_SECRET'"
|
||||
@ -521,7 +522,11 @@ convert_matrix() {
|
||||
|
||||
# Insert our Postgres and LDAP config
|
||||
cat >> /federated/apps/matrix/data/matrix/homeserver.yaml <<EOF
|
||||
|
||||
serve_server_wellknown: true
|
||||
turn_uris: [ "turn:turn.$DOMAIN_NEW?transport=udp", "turn:turn.$DOMAIN_NEW?transport=tcp" ]
|
||||
turn_shared_secret: "$COTURN_MATRIX_SECRET"
|
||||
turn_user_lifetime: 86400000
|
||||
database:
|
||||
name: psycopg2
|
||||
args:
|
||||
@ -826,6 +831,23 @@ convert_wordpress() {
|
||||
|
||||
echo -ne "done."
|
||||
}
|
||||
convert_coturn() {
|
||||
#### Convert Coturn
|
||||
echo -ne "\n* Converting coturn.."
|
||||
|
||||
sed -i "s#$DOMAIN#$DOMAIN_NEW#g" /federated/apps/coturn/docker-compose.yml
|
||||
sed -i "s#$DOMAIN#$DOMAIN_NEW#g" /federated/apps/coturn/.env
|
||||
sed -i "s#$DOMAIN#$DOMAIN_NEW#g" /federated/apps/coturn/data/etc/turnserver.conf
|
||||
sed -i "s#static-auth-secret=.*#static-auth-secret=$COTURN_MATRIX_SECRET#g" /federated/apps/coturn/data/etc/turnserver.conf
|
||||
|
||||
# Grab the container IP from docker-compose
|
||||
SERVICE_IP=`grep ipv4_address /federated/apps/coturn/docker-compose.yml | awk '{ print $2 }'`
|
||||
|
||||
# Start service with command to make sure it's up before proceeding
|
||||
start_service_convert "coturn" "nc -z $SERVICE_IP 3478 &> /dev/null"
|
||||
|
||||
echo -ne "done."
|
||||
}
|
||||
usage() {
|
||||
echo "$0: <domain.com> <organization name>"
|
||||
exit 2
|
||||
@ -882,3 +904,4 @@ convert_caddy
|
||||
convert_castopod
|
||||
convert_autodiscover
|
||||
convert_wordpress
|
||||
convert_coturn
|
||||
|
Loading…
x
Reference in New Issue
Block a user