Initial commit: F7cloud Talk Recording Server
- Переименовано Nextcloud на F7cloud - Добавлены зависимости Firefox ESR и Geckodriver - Создан скрипт установки с поддержкой параметров HPB - Добавлена документация и инструкции по установке Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get --assume-yes update
|
||||
RUN apt-get --assume-yes upgrade
|
||||
|
||||
# Common dependencies
|
||||
RUN apt-get --assume-yes install software-properties-common
|
||||
|
||||
# nextcloud-talk-recording dependencies
|
||||
RUN apt-get --assume-yes install ffmpeg pulseaudio python3-pip xvfb
|
||||
RUN pip3 install --upgrade requests
|
||||
|
||||
# firefox
|
||||
RUN apt-get --assume-yes install firefox firefox-geckodriver
|
||||
|
||||
# chromium
|
||||
# The phd/chromium repository for Ubuntu is used because since Ubuntu 20.04
|
||||
# Chromium is provided as a snap package, and the equivalent PPA has been
|
||||
# discontinued.
|
||||
RUN echo "deb https://freeshell.de/phd/chromium/focal /" > /etc/apt/sources.list.d/phd-chromium.list
|
||||
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 869689FE09306074
|
||||
RUN apt-get update
|
||||
RUN apt-get --assume-yes install chromium
|
||||
|
||||
COPY ./docker-compose/wrap_chromium_binary /opt/bin/wrap_chromium_binary
|
||||
RUN /opt/bin/wrap_chromium_binary
|
||||
|
||||
# nextcloud-talk-recording config
|
||||
RUN useradd --create-home recording
|
||||
COPY server.conf.in /etc/nextcloud-talk-recording/server.conf
|
||||
RUN sed --in-place 's/#listen =.*/listen = 0.0.0.0:8000/' /etc/nextcloud-talk-recording/server.conf
|
||||
|
||||
# Deploy recording server
|
||||
RUN mkdir --parents /tmp/recording
|
||||
COPY src /tmp/recording/
|
||||
COPY pyproject.toml /tmp/recording/
|
||||
RUN python3 -m pip install file:///tmp/recording/
|
||||
|
||||
# Cleanup
|
||||
RUN apt-get clean && rm --recursive --force /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
RUN rm --recursive --force /tmp/recording
|
||||
|
||||
# Switch user and start the recording server
|
||||
WORKDIR "/home/recording/"
|
||||
USER "recording"
|
||||
CMD ["python3", "-m", "nextcloud.talk.recording", "--config", "/etc/nextcloud-talk-recording/server.conf"]
|
||||
@@ -0,0 +1,23 @@
|
||||
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
|
||||
nextcloud-talk-recording:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: ./docker-compose/Dockerfile
|
||||
init: true
|
||||
shm_size: '2gb'
|
||||
restart: on-failure
|
||||
# By default the recording server is reachable through the network "nextcloud-talk-recording"
|
||||
# Depending on your setup (if you need to reach the recording server externally for example) you might need
|
||||
# to expose the used ports to the host machine, e.g.:
|
||||
#ports:
|
||||
# - "8000:8000"
|
||||
networks:
|
||||
- nextcloud-talk-recording
|
||||
|
||||
networks:
|
||||
nextcloud-talk-recording:
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
# SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-FileCopyrightText: 2023 SeleniumHQ and contributors
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Originally adjusted from https://github.com/SeleniumHQ/docker-selenium/blob/c6df1ab8dc6a5aca05c163c429a062ada1d79c51/NodeChrome/wrap_chrome_binary
|
||||
# which is licensed under the Apache license 2.0 (https://github.com/SeleniumHQ/docker-selenium/blob/c6df1ab8dc6a5aca05c163c429a062ada1d79c51/LICENSE.md)
|
||||
|
||||
WRAPPER_PATH=$(readlink -f /usr/bin/chromium)
|
||||
BASE_PATH="$WRAPPER_PATH-base"
|
||||
mv "$WRAPPER_PATH" "$BASE_PATH"
|
||||
|
||||
cat > "$WRAPPER_PATH" <<_EOF
|
||||
#!/bin/bash
|
||||
|
||||
# umask 002 ensures default permissions of files are 664 (rw-rw-r--) and directories are 775 (rwxrwxr-x).
|
||||
umask 002
|
||||
|
||||
# Debian/Ubuntu seems to not respect --lang, it instead needs to be a LANGUAGE environment var
|
||||
# See: https://stackoverflow.com/a/41893197/359999
|
||||
for var in "\$@"; do
|
||||
if [[ \$var == --lang=* ]]; then
|
||||
LANGUAGE=\${var//--lang=}
|
||||
fi
|
||||
done
|
||||
|
||||
# Set language environment variable
|
||||
export LANGUAGE="\$LANGUAGE"
|
||||
|
||||
# Note: exec -a below is a bashism.
|
||||
exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@"
|
||||
_EOF
|
||||
chmod +x "$WRAPPER_PATH"
|
||||
|
||||
# Also add the executable name expected by Selenium Manager
|
||||
ln --symbolic "$WRAPPER_PATH" /usr/bin/chrome
|
||||
Reference in New Issue
Block a user