Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ if [ "$(id -u)" = "0" ]; then
chown -R "$puid:$pgid" "$data_dir"
chown "$puid:$pgid" "$media_dir"

# setpriv keeps root's HOME (/root), which the runtime user cannot write: Chromium's crash
# reporter then aborts at startup ("chrome_crashpad_handler: --database is required") and
# tools lose their caches. Give the runtime user a home of its own.
runtime_home="/tmp/easyx-home"
install -d -m 0700 -o "$puid" -g "$pgid" "$runtime_home"
export HOME="$runtime_home"

umask 002
exec setpriv --reuid="$puid" --regid="$pgid" --clear-groups /usr/bin/tini -- "$@"
fi
Expand Down
8 changes: 8 additions & 0 deletions scripts/easyx-browser-fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
from websockets.asyncio.client import connect


# Chromium's crash reporter needs a writable home: without one it exits at once
# ("chrome_crashpad_handler: --database is required"), for example when the container
# drops root privileges but keeps HOME=/root.
if not os.access(os.environ.get("HOME") or "/nonexistent", os.W_OK):
os.environ["HOME"] = os.path.join(tempfile.gettempdir(), f"easyx-home-{os.getuid()}")
os.makedirs(os.environ["HOME"], mode=0o700, exist_ok=True)


MEDIA_URL_RE = re.compile(
r"https?://[^\s'\"<>\\]+?(?:\.m3u8|\.mpd)(?:\?[^\s'\"<>\\]*)?",
re.IGNORECASE,
Expand Down