Add screenshare tutorial, update and fixes demos infrastructure

- Added new tutorial for screenshare
- Update FROM of all demos docker images
- Don't use upstream in nginx. This will make nginx stop when a domain is not reachable on startup.
This commit is contained in:
cruizba 2021-10-15 16:51:55 +02:00
parent fc2a2cdf08
commit 1ddfa8e4b9
16 changed files with 118 additions and 61 deletions

View File

@ -0,0 +1,26 @@
FROM nginx:1.21.3-alpine
ARG OPENVIDU_TUTORIALS_VERSION
RUN apk update && \
apk add wget && \
rm -rf /var/cache/apk/*
# Install basic-videoconference
RUN mkdir -p /var/www/openvidu-basic-screenshare && \
wget -L -O /tmp/openvidu-tutorials.tar.gz \
"https://github.com/OpenVidu/openvidu-tutorials/archive/v${OPENVIDU_TUTORIALS_VERSION}.tar.gz" && \
tar zxf /tmp/openvidu-tutorials.tar.gz -C /tmp && \
rm /tmp/openvidu-tutorials.tar.gz && \
cp -r /tmp/openvidu-tutorials*/openvidu-insecure-js-screen-share/web/* /var/www/openvidu-basic-screenshare && \
rm -r /tmp/openvidu-tutorials* && \
chown -R nginx:nginx /var/www/openvidu-basic-screenshare
# Nginx conf
COPY ./openvidu-basic-screenshare.conf /etc/nginx/conf.d/default.conf
# Entrypoint
COPY ./entrypoint.sh /usr/local/bin
RUN chmod +x /usr/local/bin/entrypoint.sh
CMD /usr/local/bin/entrypoint.sh

View File

@ -0,0 +1,4 @@
#!/bin/bash
docker build --pull --no-cache --rm=true --build-arg OPENVIDU_TUTORIALS_VERSION="$1" -t openvidu/openvidu-basic-screenshare .
docker tag openvidu/openvidu-basic-screenshare:latest openvidu/openvidu-basic-screenshare:$1

View File

@ -0,0 +1,18 @@
#!/bin/sh
[ ! -z "${OPENVIDU_URL}" ] && echo "OPENVIDU_URL: ${OPENVIDU_URL}" || echo "OPENVIDU_URL: default"
[ ! -z "${OPENVIDU_SECRET}" ] && echo "OPENVIDU_SECRET: ${OPENVIDU_SECRET}" || echo "OPENVIDU_SECRET: default"
if [ ! -z "${OPENVIDU_URL}" ]; then
sed -i "s/^var OPENVIDU_SERVER_URL =.*$/var OPENVIDU_SERVER_URL = \"$(echo "${OPENVIDU_URL}" | sed 's#/#\\/#g')\";/" /var/www/openvidu-basic-screenshare/app.js
fi
if [ ! -z "${OPENVIDU_SECRET}" ]; then
sed -i "s/^var OPENVIDU_SERVER_SECRET =.*$/var OPENVIDU_SERVER_SECRET = \"${OPENVIDU_SECRET}\";/" /var/www/openvidu-basic-screenshare/app.js
fi
# Run nginx
nginx -g "daemon on;"
# Show logs
tail -f /var/log/nginx/*.log

View File

@ -0,0 +1,6 @@
server {
listen 80;
server_name localhost;
root /var/www/openvidu-basic-screenshare;
}

View File

@ -1,4 +1,4 @@
FROM nginx:1.18.0-alpine
FROM nginx:1.21.3-alpine
ARG OPENVIDU_TUTORIALS_VERSION

View File

@ -3,4 +3,4 @@ server {
server_name localhost;
root /var/www/openvidu-basic-videoconference;
}
}

View File

@ -1,4 +1,4 @@
FROM alpine:3.11
FROM alpine:3.13
ARG OPENVIDU_TUTORIALS_VERSION

View File

@ -1,4 +1,4 @@
FROM alpine:3.11
FROM alpine:3.13
ARG OPENVIDU_TUTORIALS_VERSION

View File

@ -1,4 +1,4 @@
FROM nginx:1.18.0-alpine
FROM nginx:1.21.3-alpine
# Nginx conf
COPY ./conf/html /var/www/html

View File

@ -2,26 +2,6 @@ add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
upstream openvidu-basic-videoconference {
server url_ov_basic_videoconference;
}
upstream openvidu-basic-webinar {
server url_ov_basic_webinar;
}
upstream openvidu-classroom {
server url_ov_classroom;
}
upstream openvidu-getaroom {
server url_ov_getaroom;
}
upstream openvidu-call {
server url_ov_call;
}
server {
listen 80;
server_name _;
@ -40,29 +20,34 @@ server {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
location /basic-videoconference {
rewrite /basic-videoconference(.*) /$1 break;
proxy_pass http://openvidu-basic-videoconference;
proxy_pass url_ov_basic_videoconference;
}
location /basic-screenshare {
rewrite /basic-screenshare(.*) /$1 break;
proxy_pass url_ov_basic_screenshare;
}
location /basic-webinar {
rewrite /basic-webinar(.*) /$1 break;
proxy_pass https://openvidu-basic-webinar;
proxy_pass url_ov_basic_webinar;
}
location /getaroom {
rewrite /getaroom(.*) /$1 break;
proxy_pass http://openvidu-getaroom;
proxy_pass url_ov_getaroom;
}
location /classroom {
rewrite /classroom(.*) $1 break;
proxy_pass https://openvidu-classroom;
proxy_pass url_ov_classroom;
}
location /openvidu-call {
rewrite /openvidu-call(.*) $1 break;
proxy_pass http://openvidu-call;
proxy_pass url_ov_call;
}
}

View File

@ -44,7 +44,15 @@
<a class="thumbnail" href="/basic-videoconference/">
<img class="img-responsive" src="resources/images/basic_videoconference.png" alt="">
<div class="caption">
<p>Basic Videoconference</p>
<p>Basic </br> Videoconference</p>
</div>
</a>
</div>
<div class="col-lg-3 col-md-6 col-xs-12 thumb">
<a class="thumbnail" href="/basic-screenshare/">
<img class="img-responsive" src="resources/images/basic_screenshare.png" alt="">
<div class="caption">
<p>Basic Videoconference with Screen Share</p>
</div>
</a>
</div>
@ -52,7 +60,15 @@
<a class="thumbnail" href="/basic-webinar/">
<img class="img-responsive" src="resources/images/basic_webinar.png" alt="">
<div class="caption">
<p>Basic Webinar</p>
<p>Basic </br> Webinar</p>
</div>
</a>
</div>
<div class="col-lg-3 col-md-6 col-xs-12 thumb">
<a class="thumbnail" href="/openvidu-call/">
<img class="img-responsive" src="resources/images/openvidu_call.png" alt="">
<div class="caption">
<p>OpenVidu Call</p>
</div>
</a>
</div>
@ -72,14 +88,6 @@
</div>
</a>
</div>
<div class="col-lg-3 col-md-6 col-xs-12 thumb">
<a class="thumbnail" href="/openvidu-call/">
<img class="img-responsive" src="resources/images/openvidu_call.png" alt="">
<div class="caption">
<p>OpenVidu Call</p>
</div>
</a>
</div>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -2,17 +2,19 @@
# Show input enviroment variables
echo "openvidu-basic-videoconference: ${URL_OV_BASIC_VIDEOCONFERENCE}"
echo "openvidu-basic-screenshare: ${URL_OV_BASIC_SCREENSHARE}"
echo "openvidu-basic-webinar: ${URL_OV_BASIC_WEBINAR}"
echo "openvidu-classroom: ${URL_OV_CLASSROOM}"
echo "openvidu-getaroom: ${URL_OV_GETAROOM}"
echo "openvidu-call: ${URL_OV_CALL}"
# Load nginx conf files
sed -i "s/url_ov_basic_videoconference/${URL_OV_BASIC_VIDEOCONFERENCE}/" /etc/nginx/conf.d/default.conf
sed -i "s/url_ov_basic_webinar/${URL_OV_BASIC_WEBINAR}/" /etc/nginx/conf.d/default.conf
sed -i "s/url_ov_classroom/${URL_OV_CLASSROOM}/" /etc/nginx/conf.d/default.conf
sed -i "s/url_ov_getaroom/${URL_OV_GETAROOM}/" /etc/nginx/conf.d/default.conf
sed -i "s/url_ov_call/${URL_OV_CALL}/" /etc/nginx/conf.d/default.conf
sed -i "s|url_ov_basic_videoconference|${URL_OV_BASIC_VIDEOCONFERENCE}|" /etc/nginx/conf.d/default.conf
sed -i "s|url_ov_basic_screenshare|${URL_OV_BASIC_SCREENSHARE}|" /etc/nginx/conf.d/default.conf
sed -i "s|url_ov_basic_webinar|${URL_OV_BASIC_WEBINAR}|" /etc/nginx/conf.d/default.conf
sed -i "s|url_ov_classroom|${URL_OV_CLASSROOM}|" /etc/nginx/conf.d/default.conf
sed -i "s|url_ov_getaroom|${URL_OV_GETAROOM}|" /etc/nginx/conf.d/default.conf
sed -i "s|url_ov_call|${URL_OV_CALL}|" /etc/nginx/conf.d/default.conf
# Run nginx
nginx -g "daemon off;"

View File

@ -5,47 +5,55 @@ services:
openvidu-basic-videoconference:
image: openvidu/openvidu-basic-videoconference:2.20.0
restart: on-failure
environment:
environment:
- OPENVIDU_URL=https://${DOMAIN_OR_PUBLIC_IP:-}:${HTTPS_PORT:-443}
- OPENVIDU_SECRET=${OPENVIDU_SECRET:-}
openvidu-basic-screenshare:
image: openvidu/openvidu-basic-screenshare:2.20.0
restart: on-failure
environment:
- OPENVIDU_URL=https://${DOMAIN_OR_PUBLIC_IP:-}:${HTTPS_PORT:-443}
- OPENVIDU_SECRET=${OPENVIDU_SECRET:-}
openvidu-basic-webinar:
image: openvidu/openvidu-basic-webinar:2.20.0
restart: on-failure
environment:
environment:
- OPENVIDU_URL=https://${DOMAIN_OR_PUBLIC_IP:-}:${HTTPS_PORT:-443}
- OPENVIDU_SECRET=${OPENVIDU_SECRET:-}
openvidu-classroom:
image: openvidu/openvidu-classroom:2.20.0
restart: on-failure
environment:
environment:
- OPENVIDU_URL=https://${DOMAIN_OR_PUBLIC_IP:-}:${HTTPS_PORT:-443}
- OPENVIDU_SECRET=${OPENVIDU_SECRET:-}
openvidu-getaroom:
image: openvidu/openvidu-getaroom:2.20.0
restart: on-failure
environment:
environment:
- OPENVIDU_URL=https://${DOMAIN_OR_PUBLIC_IP:-}:${HTTPS_PORT:-443}
- OPENVIDU_SECRET=${OPENVIDU_SECRET:-}
openvidu-call:
image: openvidu/openvidu-call:2.20.0-demos
restart: on-failure
environment:
environment:
- OPENVIDU_URL=https://${DOMAIN_OR_PUBLIC_IP:-}:${HTTPS_PORT:-443}
- OPENVIDU_SECRET=${OPENVIDU_SECRET:-}
- CALL_OPENVIDU_CERTTYPE=${CERTIFICATE_TYPE}
demos-page:
image: openvidu/openvidu-demo-proxy:1.0.0
image: openvidu/openvidu-demo-proxy:1.1.0
restart: on-failure
ports:
- "5442:80"
environment:
- URL_OV_BASIC_VIDEOCONFERENCE=openvidu-basic-videoconference:80
- URL_OV_BASIC_WEBINAR=openvidu-basic-webinar:5000
- URL_OV_CLASSROOM=openvidu-classroom:5000
- URL_OV_GETAROOM=openvidu-getaroom:80
- URL_OV_CALL=openvidu-call:5000
- URL_OV_BASIC_VIDEOCONFERENCE=http://openvidu-basic-videoconference:80
- URL_OV_BASIC_SCREENSHARE=http://openvidu-basic-screenshare:80
- URL_OV_BASIC_WEBINAR=http://openvidu-basic-webinar:5000
- URL_OV_CLASSROOM=https://openvidu-classroom:5000
- URL_OV_GETAROOM=http://openvidu-getaroom:80
- URL_OV_CALL=http://openvidu-call:5000

View File

@ -1,4 +1,4 @@
FROM nginx:1.18.0-alpine
FROM nginx:1.21.3-alpine
ARG OPENVIDU_TUTORIALS_VERSION

View File

@ -190,7 +190,7 @@ window.onbeforeunload = function () {
};
function generateParticipantInfo() {
document.getElementById("sessionId").value = "SessionA";
document.getElementById("sessionId").value = "SessionScreenA";
document.getElementById("userName").value = "Participant" + Math.floor(Math.random() * 100);
}