F7_recording/docker-compose/wrap_chromium_binary
F7cloud 0b94d1826e Initial commit: F7cloud Talk Recording Server
- Переименовано Nextcloud на F7cloud
- Добавлены зависимости Firefox ESR и Geckodriver
- Создан скрипт установки с поддержкой параметров HPB
- Добавлена документация и инструкции по установке

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 12:18:51 +00:00

38 lines
1.3 KiB
Bash
Executable File

#!/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