From 963d076065b73ba4327a2259303c4e12741babc4 Mon Sep 17 00:00:00 2001 From: Rob Ballantyne Date: Thu, 7 Mar 2024 15:11:56 +0000 Subject: [PATCH] Prevent setting VIDEO_PORT - Users are breaking host machines with imcompatible settings --- .../COPY_ROOT/opt/ai-dock/bin/supervisor-x-server.sh | 12 +++++++++--- build/Dockerfile | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/build/COPY_ROOT/opt/ai-dock/bin/supervisor-x-server.sh b/build/COPY_ROOT/opt/ai-dock/bin/supervisor-x-server.sh index d40546d..8370304 100755 --- a/build/COPY_ROOT/opt/ai-dock/bin/supervisor-x-server.sh +++ b/build/COPY_ROOT/opt/ai-dock/bin/supervisor-x-server.sh @@ -14,6 +14,10 @@ function cleanup() { function start() { source /opt/ai-dock/etc/environment.sh + + # Hardcode VIDEO_PORT: Users are breaking host machines!! + export VIDEO_PORT=DFP + env-store VIDEO_PORT if [[ ${SERVERLESS,,} = "true" ]]; then printf "Refusing to start $SERVICE_NAME in serverless mode\n" @@ -28,8 +32,7 @@ function start() { done cleanup - # This symbolic link enables running Xorg inside a container with `-sharevts` - sudo ln -snf /dev/ptmx /dev/tty7 + sudo mkdir -pm700 /tmp/runtime-user sudo chown $(id -u):$(id -u) /tmp/runtime-user @@ -40,7 +43,7 @@ function start() { start_nvidia else printf "Starting proxy X server...\n" - export X_PROXY=true + export X_PROXY=forced env-store X_PROXY start_proxy fi @@ -49,6 +52,9 @@ function start() { function start_nvidia() { # Mostly copied from https://github.com/selkies-project/docker-nvidia-glx-desktop + # This symbolic link enables running Xorg inside a container with `-sharevts` + sudo ln -snf /dev/ptmx /dev/tty7 + # Check if nvidia display drivers are present - Download if not if ! which nvidia-xconfig /dev/null 2>&1; then # Driver version is provided by the kernel through the container toolkit diff --git a/build/Dockerfile b/build/Dockerfile index aa8c6f4..a16568e 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -38,7 +38,8 @@ ENV SIZEH 1080 ENV REFRESH 60 ENV DPI 96 ENV CDEPTH 24 -ENV VIDEO_PORT DFP +# Hardcoded in x-server init. Users are breaking host machines. Do not use the on vast/runpod!! +#ENV VIDEO_PORT DFP ENV WEBRTC_ENCODER nvh264enc ENV WEBRTC_ENABLE_RESIZE false