diff --git a/bin/quickstart.sh b/bin/quickstart.sh --- a/bin/quickstart.sh +++ b/bin/quickstart.sh @@ -38,11 +38,14 @@ docker pull docker.io/kolab/centos7:latest -docker-compose down +docker-compose down --remove-orphans docker-compose build pushd ${base_dir}/src/ -cp .env.example .env + +if [ ! -f ".env" ]; then + cp .env.example .env +fi if [ -f ".env.local" ]; then # Ensure there's a line ending @@ -54,7 +57,7 @@ bin/regen-certs -docker-compose up -d coturn kolab mariadb openvidu proxy redis +docker-compose up -d coturn kolab mariadb openvidu kurento-media-server proxy redis pushd ${base_dir}/src/ diff --git a/docker-compose.openvidu.yml b/docker-compose.openvidu.yml new file mode 100644 --- /dev/null +++ b/docker-compose.openvidu.yml @@ -0,0 +1,22 @@ +version: '3' +services: + kurento-media-server2: + build: + context: ./docker/kurento-media-server/ + container_name: kolab-kurento-media-server2 + environment: + - GST_DEBUG=3,Kurento*:4,kms*:4,sdp*:4,webrtc*:4,*rtpendpoint:4,rtp*handler:4,rtpsynchronizer:4,agnosticbin:4 + - KMS_PORT=8889 + hostname: kurento-media-server.hosted.com + image: apheleia/kurento-media-server:6.15.0 + network_mode: host + openvidu: + build: + context: ./docker/openvidu-dev/ + depends_on: + - kurento-media-server + - kurento-media-server2 + volumes: + - /etc/letsencrypt/:/etc/letsencrypt/:ro + - ~/src/openvidu:/src/openvidu/ + - ./docker/openvidu-dev/build/.m2:/root/.m2/ diff --git a/docker-compose.yml b/docker-compose.yml --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,6 +46,15 @@ - ./docker/kolab/utils:/root/utils:ro - ./src/.env:/.dockerenv:ro - /sys/fs/cgroup:/sys/fs/cgroup:ro + kurento-media-server: + build: + context: ./docker/kurento-media-server/ + container_name: kolab-kurento-media-server + environment: + - GST_DEBUG=3,Kurento*:4,kms*:4,sdp*:4,webrtc*:4,*rtpendpoint:4,rtp*handler:4,rtpsynchronizer:4,agnosticbin:4 + hostname: kurento-media-server.hosted.com + image: apheleia/kurento-media-server:6.15.0 + network_mode: host mariadb: container_name: kolab-mariadb environment: @@ -58,7 +67,11 @@ image: mariadb network_mode: host openvidu: + build: + context: ./docker/openvidu/ container_name: kolab-openvidu + depends_on: + - kurento-media-server environment: - APP_DOMAIN=${APP_DOMAIN} - CERTIFICATE_TYPE=letsencrypt @@ -67,17 +80,16 @@ - COTURN_REDIS_PASSWORD=${OPENVIDU_COTURN_REDIS_PASSWORD} - COTURN_REDIS_IP=${OPENVIDU_COTURN_REDIS_IP} - DOMAIN_OR_PUBLIC_IP=${OPENVIDU_PUBLIC_IP} - - HTTP_PORT=8080 - - HTTPS_PORT=443 + - SERVER_PORT=${OPENVIDU_SERVER_PORT} - KMS_STUN_IP=${OPENVIDU_COTURN_IP} - KMS_STUN_PORT=3478 - - KMS_URIS=["ws://localhost:8888/kurento"] + - KMS_URIS=["ws://localhost:8888/kurento", "ws://localhost:8889/kurento"] - OPENVIDU_SECRET=${OPENVIDU_API_PASSWORD} - OPENVIDU_WEBHOOK=${OPENVIDU_WEBHOOK} - OPENVIDU_WEBHOOK_ENDPOINT=${OPENVIDU_WEBHOOK_ENDPOINT} - - SERVER_PORT=8443 + - SERVER_SSL_ENABLED=false hostname: openvidu.hosted.com - image: openvidu/openvidu-server-kms:2.15.0 + image: apheleia/openvidu:2.16.0 network_mode: host tmpfs: - /run diff --git a/docker/coturn/Dockerfile b/docker/coturn/Dockerfile --- a/docker/coturn/Dockerfile +++ b/docker/coturn/Dockerfile @@ -23,6 +23,7 @@ openssh-clients \ openssh-server \ procps-ng \ + redis \ strace \ systemd-udev \ tcpdump \ diff --git a/docker/kurento-media-server/Dockerfile b/docker/kurento-media-server/Dockerfile --- a/docker/kurento-media-server/Dockerfile +++ b/docker/kurento-media-server/Dockerfile @@ -2,77 +2,254 @@ MAINTAINER Jeroen van Meeuwen -# From https://github.com/Kurento/kurento-media-server/blob/master/debian/control -# -# build-essential, -# cmake, -# gstreamer1.5-plugins-good, -# kms-cmake-utils (>= 6.7.0), -# kms-core-dev (>= 6.7.0), -# kms-elements-dev (>= 6.7.0), -# kms-filters-dev (>= 6.7.0), -# kurento-module-creator (>= 6.7.0), -# libboost-dev, -# libboost-filesystem-dev, -# libboost-log-dev, -# libboost-program-options-dev, -# libboost-system-dev, -# libboost-test-dev, -# libboost-thread-dev, -# libevent-dev, -# libglibmm-2.4-dev, -# libgstreamer-plugins-base1.5-dev, -# libsigc++-2.0-dev, -# libwebsocketpp-dev - ENV CFLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -fasynchronous-unwind-tables -fstack-clash-protection -flto" -ENV CXXFLAGS=${CFLAGS} -ENV LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto -fuse-linker-plugin' -ENV CC=gcc -ENV CXX=g++ -ENV AR=/bin/gcc-ar -ENV RANLIB=/bin/gcc-ranlib -ENV NM=/bin/gcc-nm +ENV CXXFLAGS="${CFLAGS}" +ENV LDFLAGS="-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -flto -fuse-linker-plugin" +ENV CC="gcc" +ENV CXX="g++" +ENV AR="/bin/gcc-ar" +ENV RANLIB="/bin/gcc-ranlib" +ENV NM="/bin/gcc-nm" ENV CMAKE_CXX_ARCHIVE_CREATE=" qcs " +ENV OPENSSL_CONF='' +ENV GST_DEBUG="*:3,Kurento*:5,kms*:5,sdp*:4,webrtc*:5,*rtpendpoint:5,rtp*handler:5,rtpsynchronizer:5,agnosticbin:4,GST_ELEMENT_FACTORY:7" + +ARG CLEAN=1 ARG CMAKEOPTS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/ -DCMAKE_INSTALL_SYSCONFDIR=/etc/ -DCMAKE_MODULES_INSTALL_DIR=/usr/share/cmake/Modules/ -DBUILD_SHARED_LIBS=ON -DCMAKE_AR=${AR} -DCMAKE_CXX_ARCHIVE_FINISH=true -DCMAKE_MODULES_INSTALL_DIR=/usr/share/cmake/Modules/ -DGENERATE_TESTS=FALSE -DDISABLE_TESTS=TRUE" -ARG KURENTO_VERSION="6.14.0" +ARG GST_BASE_VERSION="1.8.1-1kurento2" +ARG GST_VERSION="1.8.1" +ARG KURENTO_MEDIA_SERVER_VERSION="6.15.0" +ARG KURENTO_CMAKE_VERSION="6.15.0" +ARG KURENTO_CORE_VERSION="6.15.0" +ARG KURENTO_ELEMENTS_VERSION="6.15.0" +ARG KURENTO_FILTERS_VERSION="6.15.0" +ARG KURENTO_MODULE_CREATOR_VERSION="6.15.0" ARG KURENTO_JSONCPP_VERSION="1.6.4" +ARG KURENTO_JSONRPC_VERSION="6.15.0" +ARG OPENCV_VERSION="3.4.10" RUN rpm -Uvh https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-31.noarch.rpm && \ rpm -Uvh https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-31.noarch.rpm && \ dnf -y install \ + autoconf \ + automake \ + bison \ boost-devel \ cmake \ coreutils \ + dnf-plugins-core \ ffmpeg \ + ffmpeg-devel \ + flac-devel \ + flex \ gcc-c++ \ + gettext-devel \ git \ glibmm24-devel \ - gstreamer1-devel \ - gstreamer1-plugins-base-devel \ - gstreamer1-plugins-bad-free-devel \ - gstreamer1-plugins-bad-freeworld \ - gstreamer1-plugins-good \ - gstreamer1-plugins-ugly \ + gsl-devel \ + gtk-doc \ libevent-devel \ - libnice-devel \ + libjpeg-devel \ + libmicrodns-devel \ + libpng-devel \ libsigc++20-devel \ libsoup-devel \ + libsrtp-devel \ + libtool \ + libunwind-devel \ libuuid-devel \ + libvisual-devel \ libvpx-devel \ make \ maven \ + meson \ net-tools \ + opencl-headers \ opencv-devel \ + # not available on ppc64le? \ + #openni-devel \ openssl-devel \ + opus-devel \ + patch \ redhat-rpm-config \ + spandsp-devel \ + usrsctp-devel \ vim-enhanced \ - websocketpp-devel && \ + webrtc-audio-processing-devel \ + websocketpp-devel \ + x264-devel \ + x265-devel && \ + # meson in module older than meson in updates \ + dnf module -y disable meson && \ + dnf -y update meson && \ + rpm -e --nodeps gstreamer1 gstreamer1-plugins-base && \ + dnf -y clean all && \ mkdir -p /src/ && \ - git clone https://github.com/Kurento/kms-cmake-utils.git /src/kms-cmake-utils.git && \ + if [ "${GST_BASE_VERSION}" == "1.8.1-1kurento2" ]; then \ + git clone https://github.com/Kurento/gstreamer.git /src/gstreamer.git && \ + cd /src/gstreamer.git/ && \ + sed -i \ + -e 's|git://anongit.freedesktop.org/gstreamer/common.*$|https://anongit.freedesktop.org/git/gstreamer/common.git/|g' \ + .gitmodules && \ + git submodule init && \ + git submodule update && \ + #sed -r -i \ + # -e 's/^GST_API_VERSION=.*$/GST_API_VERSION=1.0/g' \ + # configure.ac && \ + autopoint --force && \ + autoreconf -vi && \ + ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --disable-failing-tests --disable-static --disable-static-plugins --enable-shared && \ + make -j $(nproc) VERBOSE=1 && \ + make install VERBOSE=1 ; \ + else \ + git clone -b ${GST_BASE_VERSION} https://gitlab.freedesktop.org/gstreamer/gstreamer.git /src/gstreamer.git && \ + cd /src/gstreamer.git/ && \ + if [ -f 'meson.build' ]; then \ + meson build --prefix=/usr && \ + ninja -C build install ; \ + else \ + sed -i \ + -e 's|git://anongit.freedesktop.org/gstreamer/common.*$|https://anongit.freedesktop.org/git/gstreamer/common.git/|g' \ + .gitmodules && \ + git submodule init && \ + git submodule update && \ + autopoint --force && \ + autoreconf -vi && \ + ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --disable-failing-tests --disable-static --disable-static-plugins --enable-shared && \ + make -j $(nproc) VERBOSE=1 && \ + make install VERBOSE=1 ; \ + fi ; \ + fi && \ + git clone https://gitlab.freedesktop.org/libnice/libnice.git /src/libnice.git && \ + cd /src/libnice.git && \ + sed -r -i \ + -e 's/-(base|check)-1\.0/-\1-1.5/g' \ + -e 's/gstreamer-1\.0/gstreamer-1.5/g' \ + meson.build \ + gst/meson.build \ + tests/meson.build && \ + meson build --prefix=/usr && \ + ninja -C build install && \ + git clone -b ${GST_VERSION} https://gitlab.freedesktop.org/gstreamer/gst-plugins-base.git /src/gst-plugins-base.git && \ + cd /src/gst-plugins-base.git/ && \ + if [ -f 'meson.build' ]; then \ + meson build --prefix=/usr && \ + ninja -C build install ; \ + else \ + sed -i \ + -e 's|git://anongit.freedesktop.org/gstreamer/common.*$|https://anongit.freedesktop.org/git/gstreamer/common.git/|g' \ + .gitmodules && \ + git submodule init && \ + git submodule update && \ + sed -r -i \ + -e 's/^GST_API_VERSION.*$/GST_API_VERSION=1.5/g' \ + configure.ac && \ + sed -r -i \ + -e 's/^DOMAIN.*$/DOMAIN = gst-plugins-base-1.5/g' \ + po/Makevars && \ + autopoint --force && \ + autoreconf -vi && \ + sed -r -i \ + -e 's/@GST_API_VERSION@\.1/@GST_API_VERSION@/g' \ + tools/Makefile.in && \ + ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --disable-failing-tests --disable-static --disable-static-plugins --enable-shared && \ + make -j $(nproc) VERBOSE=1 && \ + make install VERBOSE=1 ; \ + fi && \ + git clone -b ${GST_VERSION} https://gitlab.freedesktop.org/gstreamer/gst-plugins-good.git /src/gst-plugins-good.git && \ + cd /src/gst-plugins-good.git/ && \ + if [ -f 'meson.build' ]; then \ + meson build --prefix=/usr && \ + ninja -C build install ; \ + else \ + sed -i \ + -e 's|git://anongit.freedesktop.org/gstreamer/common.*$|https://anongit.freedesktop.org/git/gstreamer/common.git/|g' \ + .gitmodules && \ + git submodule init && \ + git submodule update && \ + sed -r -i \ + -e 's/^GST_API_VERSION.*$/GST_API_VERSION=1.5/g' \ + configure.ac && \ + sed -r -i \ + -e 's/^DOMAIN.*$/DOMAIN = gst-plugins-good-1.5/g' \ + po/Makevars && \ + autopoint --force && \ + autoreconf -vi && \ + sed -i \ + -e '/^#define .* gint64/d' \ + -e '/^#define .* guint64/d' \ + sys/v4l2/ext/types-compat.h && \ + sed -i \ + -e 's/__s64/gint64/g' \ + -e 's/__u64/guint64/g' \ + sys/v4l2/ext/videodev2.h && \ + ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --disable-failing-tests --disable-static --disable-static-plugins --enable-shared && \ + make -j $(nproc) VERBOSE=1 && \ + make install VERBOSE=1 ; \ + fi && \ + git clone https://github.com/kanarip/gst-plugins-bad.git /src/gst-plugins-bad.git && \ + cd /src/gst-plugins-bad.git/ && \ + if [ -f 'meson.build' ]; then \ + meson build --prefix=/usr && \ + ninja -C build install ; \ + else \ + sed -i \ + -e 's|git://anongit.freedesktop.org/gstreamer/common.*$|https://anongit.freedesktop.org/git/gstreamer/common.git/|g' \ + .gitmodules && \ + git submodule init && \ + git submodule update && \ + sed -r -i \ + -e 's/^GST_API_VERSION.*$/GST_API_VERSION=1.5/g' \ + -e 's/gstreamer-allocators-1.0/gstreamer-allocators-1.5/g' \ + configure.ac && \ + sed -r -i \ + -e 's/gstaudio-1.0/gstaudio-1.5/g' \ + -e 's/gstvideo-1.0/gstvideo-1.5/g' \ + gst/festival/Makefile.am \ + gst/ivtc/Makefile.am \ + gst/yadif/Makefile.am && \ + sed -r -i \ + -e 's/^DOMAIN.*$/DOMAIN = gst-plugins-bad-1.5/g' \ + po/Makevars && \ + autopoint --force && \ + autoreconf -vi && \ + #./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --disable-failing-tests --disable-dtls && \ + ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --disable-failing-tests --disable-static --disable-static-plugins --enable-shared && \ + make -j $(nproc) VERBOSE=1 && \ + make install VERBOSE=1 ; \ + fi && \ + git clone -b ${GST_VERSION} https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly.git /src/gst-plugins-ugly.git && \ + cd /src/gst-plugins-ugly.git/ && \ + if [ -f 'meson.build' ]; then \ + meson build --prefix=/usr && \ + ninja -C build install ; \ + else \ + sed -i \ + -e 's|git://anongit.freedesktop.org/gstreamer/common.*$|https://anongit.freedesktop.org/git/gstreamer/common.git/|g' \ + .gitmodules && \ + git submodule init && \ + git submodule update && \ + sed -r -i \ + -e 's/^GST_API_VERSION.*$/GST_API_VERSION=1.5/g' \ + configure.ac && \ + sed -r -i \ + -e 's/^DOMAIN.*$/DOMAIN = gst-plugins-ugly-1.5/g' \ + po/Makevars && \ + autopoint --force && \ + autoreconf -vi && \ + ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --disable-failing-tests --disable-x264 --disable-static --disable-static-plugins --enable-shared && \ + make -j $(nproc) VERBOSE=1 && \ + make install VERBOSE=1 ; \ + fi && \ + git clone https://github.com/Kurento/openwebrtc-gst-plugins.git /src/openwebrtc-gst-plugins.git && \ + cd /src/openwebrtc-gst-plugins.git/ && \ + autoreconf -vi && \ + ./configure --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 --disable-static --disable-static-plugins --enable-shared && \ + make VERBOSE=1 && \ + make install VERBOSE=1 && \ + git clone -b ${KURENTO_CMAKE_VERSION} https://github.com/Kurento/kms-cmake-utils.git /src/kms-cmake-utils.git && \ cd /src/kms-cmake-utils.git/ && \ - git checkout ${KURENTO_VERSION} && \ mkdir build && \ cd build && \ cmake \ @@ -80,16 +257,14 @@ .. && \ make -j $(nproc) VERBOSE=1 && \ make install -s && \ - git clone https://github.com/Kurento/kurento-module-creator.git /src/kurento-module-creator.git && \ + git clone -b ${KURENTO_MODULE_CREATOR_VERSION} https://github.com/Kurento/kurento-module-creator.git /src/kurento-module-creator.git && \ cd /src/kurento-module-creator.git/ && \ - git checkout ${KURENTO_VERSION} && \ mvn clean install -DskipTests && \ cp target/kurento-module-creator-jar-with-dependencies.jar /usr/bin/. && \ cp scripts/kurento-module-creator /usr/bin/. && \ cp target/classes/*.cmake /usr/share/cmake/Modules/. && \ - git clone https://github.com/Kurento/jsoncpp.git /src/jsoncpp.git && \ + git clone -b ${KURENTO_JSONCPP_VERSION} https://github.com/Kurento/jsoncpp.git /src/jsoncpp.git && \ cd /src/jsoncpp.git/ && \ - git checkout ${KURENTO_JSONCPP_VERSION} && \ mkdir build && \ cd build && \ cmake \ @@ -106,9 +281,8 @@ mv -v /usr/include/json/features.h /usr/include/json/json-features.h && \ sed -i -e 's/features\.h/json-features\.h/g' /usr/include/json/*.h && \ cp -av /usr/include/json /usr/include/kmsjsoncpp && \ - git clone https://github.com/Kurento/kms-jsonrpc.git /src/kms-jsonrpc.git && \ + git clone -b ${KURENTO_JSONRPC_VERSION} https://github.com/Kurento/kms-jsonrpc.git /src/kms-jsonrpc.git && \ cd /src/kms-jsonrpc.git/ && \ - git checkout ${KURENTO_VERSION} && \ mkdir build && \ cd build && \ cmake \ @@ -116,40 +290,55 @@ .. && \ make -j $(nproc) VERBOSE=1 && \ make install -s && \ - git clone https://github.com/Kurento/kms-core.git /src/kms-core.git && \ + git clone -b ${KURENTO_CORE_VERSION} https://github.com/Kurento/kms-core.git /src/kms-core.git && \ cd /src/kms-core.git/ && \ - git checkout ${KURENTO_VERSION} && \ - sed -r -i \ - -e 's/gstreamer-(.*)1.5/gstreamer-\11.0/g' \ - $(find -type f -name CMakeLists.txt) && \ mkdir build && \ cd build && \ - cmake \ - ${CMAKEOPTS} \ - -DCMAKE_INSTALL_GST_PLUGINS_DIR=/usr/lib64/gstreamer-1.0/ \ - .. && \ + if [ "${GST_BASE_VERSION}" != "1.8.1-1kurento2" ]; then \ + sed -r -i \ + -e 's/gstreamer-(.*)1.5/gstreamer-\11.0/g' \ + $(find -type f -name CMakeLists.txt) && \ + cmake \ + ${CMAKEOPTS} \ + -DCMAKE_INSTALL_GST_PLUGINS_DIR=/usr/lib64/gstreamer-1.0/ \ + .. ; \ + else \ + cmake \ + ${CMAKEOPTS} \ + -DCMAKE_INSTALL_GST_PLUGINS_DIR=/usr/lib64/gstreamer-1.5/ \ + .. ; \ + fi && \ make -j $(nproc) VERBOSE=1 && \ make install -s && \ - git clone https://github.com/Kurento/kms-elements.git /src/kms-elements.git && \ + git clone -b ${KURENTO_ELEMENTS_VERSION} https://github.com/Kurento/kms-elements.git /src/kms-elements.git && \ cd /src/kms-elements.git/ && \ - git checkout ${KURENTO_VERSION} && \ - sed -r -i \ - -e 's/gstreamer-(.*)1.5/gstreamer-\11.0/g' \ - $(find -type f -name CMakeLists.txt) && \ + if [ "${GST_BASE_VERSION}" != "1.8.1-1kurento2" ]; then \ + sed -r -i \ + -e 's/gstreamer-(.*)1.5/gstreamer-\11.0/g' \ + $(find -type f -name CMakeLists.txt) ; \ + fi && \ mkdir build && \ cd build && \ cmake \ ${CMAKEOPTS} \ .. && \ + sed -i \ + -e 's/-lkmsgstcommons/-lkmsgstcommons -lkmscoreinterface/g' \ + -e 's/-lkmscoreinterface/-lkmscoreinterface -lkmsutils/g' \ + $(find . -type f -name link.txt) && \ make -j $(nproc) VERBOSE=1 && \ + make -j $(nproc) check VERBOSE=1 && \ make install -s && \ - cp -av src/server/implementation/HttpServer/libkmshttpep.so /usr/lib64/ && \ - git clone https://github.com/Kurento/kms-filters.git /src/kms-filters.git && \ + cp -av src/server/implementation/HttpServer/libkmshttpep.so /usr/lib64/. && \ + cp -av /usr/lib64/libkmswebrtcendpointlib.so* /usr/lib64/kurento/modules/. && \ + cp -av /usr/lib64/libkmshttpep.so* /usr/lib64/kurento/modules/. && \ + git clone -b ${KURENTO_FILTERS_VERSION} https://github.com/Kurento/kms-filters.git /src/kms-filters.git && \ cd /src/kms-filters.git/ && \ - git checkout ${KURENTO_VERSION} && \ - sed -r -i \ - -e 's/gstreamer-(.*)1.5/gstreamer-\11.0/g' \ - $(find -type f -name CMakeLists.txt) && \ + if [ "${GST_BASE_VERSION}" != "1.8.1-1kurento2" ]; then \ + sed -r -i \ + -e 's/gstreamer-(.*)1.5/gstreamer-\11.0/g' \ + $(find -type f -name CMakeLists.txt) ; \ + fi && \ mkdir build && \ cd build && \ cmake \ @@ -157,12 +346,14 @@ .. && \ make -j $(nproc) VERBOSE=1 && \ make install -s && \ - git clone https://github.com/Kurento/kurento-media-server.git /src/kurento-media-server.git && \ + git clone -b ${KURENTO_MEDIA_SERVER_VERSION} https://github.com/Kurento/kurento-media-server.git /src/kurento-media-server.git && \ cd /src/kurento-media-server.git/ && \ - git checkout ${KURENTO_VERSION} && \ - sed -r -i \ - -e 's/gstreamer-(.*)1.5/gstreamer-\11.0/g' \ - $(find -type f -name CMakeLists.txt) && \ + if [ "${GST_BASE_VERSION}" != "1.8.1-1kurento2" ]; then \ + sed -r -i \ + -e 's/gstreamer-(.*)1.5/gstreamer-\11.0/g' \ + $(find -type f -name CMakeLists.txt) ; \ + fi && \ + # work around for kurento not building on pcc64le \ sed -i \ -e '603,618d' \ server/death_handler.cpp && \ @@ -171,55 +362,66 @@ cmake \ ${CMAKEOPTS} \ .. && \ + # a linking error / oversight may occur \ sed -i \ -e 's/-lkmsgstcommons/-lkmsgstcommons -lkmscoreinterface/g' \ - server/CMakeFiles/kurento-media-server.dir/link.txt && \ + $(find . -type f -name link.txt) && \ make -j $(nproc) VERBOSE=1 && \ make install VERBOSE=1 -s && \ cp -av $(find . -type f -name 'libtransport.so*') /usr/lib64/ && \ cp -av $(find . -type f -name 'libwebsocketTransport.so*') /usr/lib64/ && \ - strip -s /usr/lib64/libkms*.so* /usr/lib64/kurento/modules/*.so* && \ - dnf -y remove \ - -x boost-filesystem \ - -x boost-program-options \ - -x boost-log \ - -x boost-thread \ - -x file \ - -x gstreamer1-plugins-base \ - -x gstreamer1-plugins-bad-free \ - -x glibmm24 \ - -x java-1.8.0-openjdk \ - -x libnice \ - -x libsigc \ - -x libvpx \ - -x opencv \ - boost-devel \ - cmake \ - gcc-c++ \ - git \ - glibmm24-devel \ - gstreamer1-devel \ - gstreamer1-plugins-base-devel \ - gstreamer1-plugins-bad-free-devel \ - libevent-devel \ - libnice-devel \ - libsigc++20-devel \ - libsoup-devel \ - libuuid-devel \ - libvpx-devel \ - make \ - maven \ - opencv-devel \ - openssl-devel \ - redhat-rpm-config \ - vim-enhanced \ - websocketpp-devel && \ - dnf -y clean all && \ - rm -rvf \ - /src/ \ - /root/.m2/ \ - /usr/include/* + if [ "${CLEAN}" -eq 1 ]; then \ + strip -s \ + /usr/lib64/gstreamer-*/*.so \ + /usr/lib64/kurento/modules/*.so* \ + /usr/lib64/libkms*.so* && \ + dnf -y remove \ + -x boost-filesystem \ + -x boost-program-options \ + -x boost-log \ + -x boost-thread \ + -x file \ + -x gstreamer1-plugins-base \ + -x gstreamer1-plugins-bad-free \ + -x glibmm24 \ + -x java-1.8.0-openjdk \ + -x libsigc \ + -x libsoup \ + -x libvpx \ + -x opencv \ + boost-devel \ + cmake \ + gcc-c++ \ + git \ + glibmm24-devel \ + gstreamer1-devel \ + gstreamer1-plugins-base-devel \ + gstreamer1-plugins-bad-free-devel \ + libevent-devel \ + libsigc++20-devel \ + libsoup-devel \ + libuuid-devel \ + libvpx-devel \ + make \ + maven \ + opencv-devel \ + openssl-devel \ + redhat-rpm-config \ + vim-enhanced \ + websocketpp-devel && \ + dnf -y clean all && \ + rm -rvf \ + /src/ \ + /root/.m2/ \ + /usr/include/* \ + /usr/lib64/*.la \ + /usr/lib64/gstreamer-*/*.la && \ + ldconfig ; \ + fi COPY rootfs/ / -CMD ["/bin/kurento-media-server"] +RUN chmod 777 /etc/kurento/modules/kurento/ +RUN chmod 666 /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini + +CMD ["/usr/local/bin/kurento-media-server.sh"] diff --git a/docker/kurento-media-server/rootfs/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini b/docker/kurento-media-server/rootfs/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini new file mode 100644 --- /dev/null +++ b/docker/kurento-media-server/rootfs/etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini @@ -0,0 +1,130 @@ +;; Local network interfaces used for ICE gathering. +;; +;; If you know which network interfaces should be used to perform ICE (for +;; WebRTC connectivity), you can define them here. Doing so has several +;; advantages: +;; +;; * The WebRTC ICE gathering process will be much quicker. Normally, it needs +;; to gather local candidates for all of the network interfaces, but this step +;; can be made faster if you limit it to only the interface that you know will +;; work. +;; +;; * It will ensure that the media server always decides to use the correct +;; network interface. With WebRTC ICE gathering it's possible that, under some +;; circumstances (in systems with virtual network interfaces such as +;; "docker0") the ICE process ends up choosing the wrong local IP. +;; +;; is a comma-separated list of network interface names. +;; +;; Examples: +;; networkInterfaces=eth0 +;; networkInterfaces=eth0,enp0s25 +;; +;networkInterfaces=eth0 + +;; STUN server IP address. +;; +;; The ICE process uses STUN to punch holes through NAT firewalls. +;; +;; You don't need to configure both STUN and TURN, because TURN already includes +;; STUN functionality. +;; +;; MUST be an IP address; domain names are NOT supported. +;; +;; You need to use a well-working STUN server. Use this to check if it works: +;; https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ +;; From that check, you should get at least one Server-Reflexive Candidate +;; (type "srflx"). +;; +stunServerAddress=212.103.80.153 +stunServerPort=3478 + +;; TURN server URL. +;; +;; When STUN is not enough to open connections through some NAT firewalls, +;; using TURN is the remaining alternative. +;; +;; You don't need to configure both STUN and TURN, because TURN already includes +;; STUN functionality. +;; +;; The provided URL should follow one of these formats: +;; +;; * user:password@ipaddress:port +;; * user:password@ipaddress:port?transport=[udp|tcp|tls] +;; +;; MUST be an IP address; domain names are NOT supported. +;; is OPTIONAL. Possible values: udp, tcp, tls. Default: udp. +;; +;; You need to use a well-working TURN server. Use this to check if it works: +;; https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ +;; +;; From that check, you should get at least one Server-Reflexive Candidate +;; (type "srflx") AND one Relay Candidate (type "relay"). +;; +;turnURL=user:password@198.51.100.1:3478?transport=udp + +;; Certificate used for DTLS authentication. +;; +;; If you want KMS to use a specific certificate for DTLS, then provide it here. +;; You can provide both RSA or ECDSA files; the choice between them is done when +;; calling the WebRtcEndpoint constructor. +;; +;; If this setting isn't specified, a different set of self-signed certificates +;; is generated automatically for each WebRtcEndpoint instance. +;; +;; This setting can be helpful, for example, for situations where you have to +;; manage multiple media servers and want to make sure that all of them use the +;; same certificate. Some browsers, such as Firefox, require this in order to +;; allow multiple WebRTC connections from the same tab to different KMS. +;; +;; Absolute path to the concatenated certificate (chain) file(s) + private key, +;; in PEM format. +;; +;pemCertificateRSA=/path/to/cert+key.pem +;pemCertificateECDSA=/path/to/cert+key.pem + +;; External IPv4 and IPv6 addresses of the media server. +;; +;; Forces all local IPv4 and/or IPv6 ICE candidates to have the given address. +;; This is really nothing more than a hack, but it's very effective to force a +;; public IP address when one is known in advance for the media server. In doing +;; so, KMS will not need a STUN or TURN server, but remote peers will still be +;; able to contact it. +;; +;; You can try using these settings if KMS is deployed on a publicly accessible +;; server, without NAT, and with a static public IP address. But if it doesn't +;; work for you, just go back to configuring a STUN or TURN server for ICE. +;; +;; Only set this parameter if you know what you're doing, and you understand +;; 100% WHY you need it. For the majority of cases, you should just prefer to +;; configure a STUN or TURN server. +;; +;; is a single IPv4 address. +;; is a single IPv6 address. +;; +;externalIPv4=198.51.100.1 +;externalIPv6=2001:0db8:85a3:0000:0000:8a2e:0370:7334 + +;; External IP address of the media server. +;; +;; DEPRECATED: Use "externalIPv4" and/or "externalIPv6" instead. +;; +;; Forces all local IPv4 and IPv6 ICE candidates to have the given address. This +;; is really nothing more than a hack, but it's very effective to force a public +;; IP address when one is known in advance for the media server. In doing so, +;; KMS will not need a STUN or TURN server, but remote peers will still be able +;; to contact it. +;; +;; You can try using this setting if KMS is deployed on a publicly accessible +;; server, without NAT, and with a static public IP address. But if it doesn't +;; work for you, just go back to configuring a STUN or TURN server for ICE. +;; +;; Only set this parameter if you know what you're doing, and you understand +;; 100% WHY you need it. For the majority of cases, you should just prefer to +;; configure a STUN or TURN server. +;; +;; is a single IPv4 or IPv6 address. +;; +;externalAddress=198.51.100.1 +;externalAddress=2001:0db8:85a3:0000:0000:8a2e:0370:7334 + diff --git a/docker/kurento-media-server/rootfs/usr/local/bin/kurento-media-server.sh b/docker/kurento-media-server/rootfs/usr/local/bin/kurento-media-server.sh new file mode 100755 --- /dev/null +++ b/docker/kurento-media-server/rootfs/usr/local/bin/kurento-media-server.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ ! -z "${OPENVIDU_COTURN_IP}" ]; then + sed -i \ + -e "s/;externalIPv4.*$/externalIPv4=${OPENVIDU_COTURN_IP}/g" \ + /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini +fi + +if [ ! -z "${KMS_PORT}" ]; then + sed -i \ + -e "s/\"port\": 8888,/\"port\": ${KMS_PORT},/g" \ + /etc/kurento/kurento.conf.json +fi + +/usr/bin/kurento-media-server diff --git a/docker/openvidu-dev/.gitignore b/docker/openvidu-dev/.gitignore new file mode 100644 --- /dev/null +++ b/docker/openvidu-dev/.gitignore @@ -0,0 +1 @@ +build diff --git a/docker/coturn/Dockerfile b/docker/openvidu-dev/Dockerfile copy from docker/coturn/Dockerfile copy to docker/openvidu-dev/Dockerfile --- a/docker/coturn/Dockerfile +++ b/docker/openvidu-dev/Dockerfile @@ -2,6 +2,10 @@ MAINTAINER Jeroen van Meeuwen +ENV CERTIFICATE_TYPE=selfsigned +ENV DOMAIN_OR_PUBLIC_IP=localhost.localdomain +ENV OPENVIDU_SECRET=MY_SECRET + RUN dnf -y install \ --setopt 'tsflags=nodocs' \ bash-completion \ @@ -9,11 +13,14 @@ coturn \ curl \ dhcp-client \ + git \ iproute \ iptraf-ng \ iputils \ + java-1.8.0-openjdk \ less \ lsof \ + maven \ mtr \ net-tools \ NetworkManager \ @@ -23,6 +30,7 @@ openssh-clients \ openssh-server \ procps-ng \ + redis \ strace \ systemd-udev \ tcpdump \ @@ -32,6 +40,5 @@ wget && \ dnf clean all -COPY rootfs/ / - -CMD ["/usr/local/bin/coturn.sh"] +COPY init.sh /init.sh +CMD [ "/init.sh" ] diff --git a/docker/openvidu-dev/build/.m2/.gitkeep b/docker/openvidu-dev/build/.m2/.gitkeep new file mode 100644 diff --git a/docker/openvidu-dev/init.sh b/docker/openvidu-dev/init.sh new file mode 100755 --- /dev/null +++ b/docker/openvidu-dev/init.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd /src/openvidu/ +mvn -DskipTests=true clean install +/usr/bin/java -jar /src/openvidu/openvidu-server/target/openvidu-server-2.16.0.jar diff --git a/docker/openvidu/Dockerfile b/docker/openvidu/Dockerfile --- a/docker/openvidu/Dockerfile +++ b/docker/openvidu/Dockerfile @@ -30,6 +30,7 @@ openssh-clients \ openssh-server \ procps-ng \ + redis \ strace \ systemd-udev \ tcpdump \ @@ -39,7 +40,7 @@ wget && \ dnf clean all && \ mkdir -p /src/ && \ - git clone --branch v2.16.0 https://github.com/OpenVidu/openvidu.git /src/openvidu.git && \ + git clone --branch stable/kolab-2.16.0 https://git.kolab.org/source/openvidu.git /src/openvidu.git && \ cd /src/openvidu.git/ && \ mvn clean install -DskipTests && \ mkdir -p /usr/share/openvidu/ && \ @@ -50,8 +51,6 @@ CMD [ \ "/usr/bin/java", \ - "-Dserver.port=8080", \ - "-Dserver.ssl.enabled=false", \ "-jar", \ "/usr/share/openvidu/openvidu-server.jar" \ ] diff --git a/src/.env.example b/src/.env.example --- a/src/.env.example +++ b/src/.env.example @@ -124,7 +124,7 @@ PUSHER_APP_SECRET= PUSHER_APP_CLUSTER=mt1 -MIX_ASSET_PATH= +MIX_ASSET_PATH='/' MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" diff --git a/src/database/seeds/local/UserSeeder.php b/src/database/seeds/local/UserSeeder.php --- a/src/database/seeds/local/UserSeeder.php +++ b/src/database/seeds/local/UserSeeder.php @@ -129,6 +129,9 @@ $john->assignPackage($package_lite, $joe); + $john->assignSku(Sku::firstOrCreate(['title' => 'beta'])); + $john->assignSku(Sku::firstOrCreate(['title' => 'meet'])); + $joe->setAliases(['joe.monster@kolab.org']); // factory(User::class, 10)->create();