selkies-gstreamer-entrypoint.sh 1017 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash -e
  2. # This Source Code Form is subject to the terms of the Mozilla Public
  3. # License, v. 2.0. If a copy of the MPL was not distributed with this
  4. # file, You can obtain one at https://mozilla.org/MPL/2.0/.
  5. # Source environment for GStreamer
  6. . /opt/gstreamer/gst-env
  7. # Set default display
  8. export DISPLAY="${DISPLAY:-:0}"
  9. # Configure joystick interposer
  10. sudo mkdir -pm755 /dev/input
  11. sudo touch /dev/input/{js0,js1,js2,js3}
  12. # Show debug logs for GStreamer
  13. export GST_DEBUG="${GST_DEBUG:-*:2}"
  14. # Set password for basic authentication
  15. if [ "${ENABLE_BASIC_AUTH,,}" = "true" ] && [ -z "${BASIC_AUTH_PASSWORD}" ]; then export BASIC_AUTH_PASSWORD="${PASSWD}"; fi
  16. # Wait for X11 to start
  17. echo "Waiting for X socket"
  18. until [ -S "/tmp/.X11-unix/X${DISPLAY/:/}" ]; do sleep 1; done
  19. echo "X socket is ready"
  20. # Clear the cache registry
  21. rm -rf "${HOME}/.cache/gstreamer-1.0"
  22. # Start the selkies-gstreamer WebRTC HTML5 remote desktop application
  23. selkies-gstreamer \
  24. --addr="0.0.0.0" \
  25. --port="8080" \
  26. $@