openvidu-insecure-js Docker image update

This commit is contained in:
pabloFuente 2018-05-14 12:08:02 +02:00
parent ff2c3b7465
commit 504968d087
4 changed files with 37 additions and 29 deletions

View File

@ -2,12 +2,13 @@ FROM ubuntu:16.04
MAINTAINER openvidu@gmail.com
# Install Kurento Media Server (KMS)
RUN echo "deb http://ubuntu.kurento.org xenial kms6" | tee /etc/apt/sources.list.d/kurento.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv 2F819BC0 \
&& apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get -y install kurento-media-server-6.0 \
&& rm -rf /var/lib/apt/lists/*
RUN echo "deb http://ubuntu.openvidu.io/6.7.0 xenial kms6" | tee /etc/apt/sources.list.d/kurento.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5AFA7A83 \
&& apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get -y install kurento-media-server \
&& apt-get -y install openh264-gst-plugins-bad-1.5 \
&& rm -rf /var/lib/apt/lists/*
COPY kms.sh /kms.sh
COPY ngrok.sh /ngrok.sh
@ -19,11 +20,11 @@ RUN apt-get update && apt-get install -y openjdk-8-jdk && rm -rf /var/lib/apt/li
# ngrok
RUN apt-get update && apt-get install unzip
RUN set -x \
&& apt-get update \
&& apt-get install wget \
&& wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip \
&& unzip ngrok-stable-linux-amd64.zip -d /home/ngrok \
&& rm -f ngrok-stable-linux-amd64.zip ngrok
&& apt-get update \
&& apt-get install wget \
&& wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip \
&& unzip ngrok-stable-linux-amd64.zip -d /home/ngrok \
&& rm -f ngrok-stable-linux-amd64.zip ngrok
COPY ngrok.yml /home/ngrok/ngrok.yml
@ -36,11 +37,11 @@ RUN apt-get update && apt-get install -y supervisor && rm -rf /var/lib/apt/lists
COPY openvidu-server.jar openvidu-server.jar
RUN set -x \
&& echo 'ngrok:x:6737:6737:Ngrok user:/home/ngrok:/bin/false' >> /etc/passwd \
&& echo 'ngrok:x:6737:' >> /etc/group \
&& chown ngrok:ngrok /home/ngrok \
&& chmod -R go=u,go-w /home/ngrok \
&& chmod go= /home/ngrok
&& echo 'ngrok:x:6737:6737:Ngrok user:/home/ngrok:/bin/false' >> /etc/passwd \
&& echo 'ngrok:x:6737:' >> /etc/group \
&& chown ngrok:ngrok /home/ngrok \
&& chmod -R go=u,go-w /home/ngrok \
&& chmod go= /home/ngrok
EXPOSE 4040
EXPOSE 4443

View File

@ -4,8 +4,8 @@ cp ../../../openvidu/openvidu-server/target/openvidu-server-"$1".jar ./openvidu-
# Copy openvidu-insecure-js web files
cp -a ../web/. ./web/
# Modify WebSocket protocol in app.js for allowing both ngrok and localhost connections
sed -i 's/OV\.initSession("wss:\/\/"/OV\.initSession("ws:\/\/"/g' ./web/app.js
# Modify OpenVidu Server URL
sed -i 's/url: "https:\/\/" + location\.hostname + ":4443/url: "https:\/\/" + location\.hostname + "/g' ./web/app.js
# Build docker image
docker build -t openvidu/basic-videoconference-demo .

View File

@ -1,14 +1,19 @@
#!/bin/bash -x
set -e
if [ -n "$KMS_TURN_URL" ]; then
echo "turnURL=$KMS_TURN_URL" > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
fi
KMS_STUN_IP_AUX="stun.l.google.com"
KMS_STUN_PORT_AUX="19302"
if [ -n "$KMS_STUN_IP" -a -n "$KMS_STUN_PORT" ]; then
# Generate WebRtcEndpoint configuration
echo "stunServerAddress=$KMS_STUN_IP" > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
echo "stunServerPort=$KMS_STUN_PORT" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
KMS_STUN_IP_AUX="${KMS_STUN_IP}"
KMS_STUN_PORT_AUX="${KMS_STUN_PORT}"
fi
# Generate WebRtcEndpoint configuration
echo "stunServerAddress=$KMS_STUN_IP_AUX" > /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
echo "stunServerPort=$KMS_STUN_PORT_AUX" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
if [ -n "$KMS_TURN_URL" ]; then
echo "turnURL=$KMS_TURN_URL" >> /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini
fi
# Remove ipv6 local loop until ipv6 is supported
@ -16,4 +21,4 @@ cat /etc/hosts | sed '/::1/d' | tee /etc/hosts > /dev/null
export GST_DEBUG=Kurento*:5
exec /usr/bin/kurento-media-server "$@"
exec /usr/bin/kurento-media-server "$@"

View File

@ -155,11 +155,13 @@ function removeAllUserData() {
function addClickListener(videoElement, userData) {
videoElement.addEventListener('click', function () {
var mainVideo = document.querySelector('#main-video video');
var mainUserData = document.querySelector('#main-video p');
var mainVideo = $('#main-video video').get(0);
if (mainVideo.srcObject !== videoElement.srcObject) {
mainUserData.innerHTML = userData;
mainVideo.srcObject = videoElement.srcObject;
$('#main-video').fadeOut("fast", () => {
$('#main-video p').html(userData);
mainVideo.srcObject = videoElement.srcObject;
$('#main-video').fadeIn("fast");
});
}
});
}