Files
UnrealEngineUWP/Samples/PixelStreaming/WebServers/SignallingWebServer/platform_scripts/bash/docker-start-turn.sh
Luke Bermingham a7599949b7 Update Samples/PixelStreaming with early work from 5.1. (Multiple authors)
*************
Features
*************
- Added stat in stats panel to show currently used audio/video codec.
- Added audio bitrate in the stats panel.
- Added toggle in the settings panel to force mono audio.
- Added new info in stats panel to indicate input controlling mode.
- Added Linux platform scripts for the Matchmaker/SFU.
- Added npm commands for signalling server. `npm run $config -- $args` which will work across platforms (`$config` might be `start-signalling-server` and args might be `--debug`)

*************
Bugfixes
*************
- Fix matchmaker taking up to 45 seconds to display a valid server for use.
- Fix regression where all browser audio was mono (default now stereo).
- Fix Linux SFU and Signalling Server scripts not grabbing the public IP correctly.
- Fix linux setup scripts not working when being run from a location that has a space in the path.
- Fix SFU run_cloud.bat tries to call non-existent run.bat.
- Fix being unable to type in console of a streamed application.
- Fix docker scripts running only TURN when we needed both TURN and cirrus.
- Fix docker scripts not starting correctly.

*************
Refactors
*************
- Bash scripts have been refactored for readability.

#rb self
#fyi Mattias.Jansson, Aidan.Possemiers
#preflight https://horde.devtools.epicgames.com/job/628c894f5665463c21effaa9

[CL 20345056 by Luke Bermingham in ue5-main branch]
2022-05-24 03:43:51 -04:00

43 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Copyright Epic Games, Inc. All Rights Reserved.
# Get stun server data for passing to the container
source common_utils.sh
set_start_default_values "n" "y" # Only STUN server defaults
use_args "$@"
localip=$(hostname -I | awk '{print $1}')
echo "Private IP: $localip"
turnport="${turnserver##*:}"
if [ -z "${turnport}" ]; then
turnport=3478
fi
echo "TURN port: ${turnport}"
echo ""
turnusername="PixelStreamingUser"
turnpassword="AnotherTURNintheroad"
realm="PixelStreaming"
process="turnserver"
arguments="-p ${turnport} -r $realm -X $publicip -E $localip -L $localip --no-cli --no-tls --no-dtls --pidfile /var/run/turnserver.pid -f -a -v -n -u ${turnusername}:${turnpassword}"
# Add arguments passed to script to arguments for executable
arguments+=" ${cirruscmd}"
# Start docker container by name using host networking
echo "Running: ${process} ${arguments}"
# Get the docker image
docker pull coturn/coturn
# Start the TURN server
#docker run --name coturn_latest --network host -it --entrypoint /bin/bash coturn/coturn
#docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "sudo mkdir -p /var/run" coturn/coturn ""
#docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "/bin/ls" coturn/coturn "/var/"
docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "${process}" coturn/coturn "${arguments}"
#docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "/bin/bash" coturn/coturn "ls -latr /var/run/"
#docker run --name coturn_latest --network host --rm -a stdin -a stdout -a stderr --entrypoint "sudo chown ubuntu:ubuntu /var/run/turnserver.pid | sudo chmod +x /var/run/turnserver.pid | ${process}" coturn/coturn "${arguments}"