mirror of
https://github.com/halfwaystudent/douyin-sparkflow.git
synced 2026-07-10 23:11:24 +08:00
Import sanitized project structure and GitHub docs
This commit is contained in:
31
DouYinSparkFlow/scripts/start_login_desktop.sh
Normal file
31
DouYinSparkFlow/scripts/start_login_desktop.sh
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
export DISPLAY="${DISPLAY:-:99}"
|
||||
export PLAYWRIGHT_BROWSERS_PATH="${PLAYWRIGHT_BROWSERS_PATH:-/ms-playwright}"
|
||||
export LOGIN_DESKTOP_API_PORT="${LOGIN_DESKTOP_API_PORT:-18090}"
|
||||
export LOGIN_DESKTOP_VNC_PORT="${LOGIN_DESKTOP_VNC_PORT:-5901}"
|
||||
export LOGIN_DESKTOP_WEB_PORT="${LOGIN_DESKTOP_WEB_PORT:-8788}"
|
||||
|
||||
mkdir -p /data/login-profile
|
||||
mkdir -p /app/logs/login_desktop
|
||||
|
||||
pkill -f "Xvfb ${DISPLAY}" >/dev/null 2>&1 || true
|
||||
pkill -f "x11vnc .*${LOGIN_DESKTOP_VNC_PORT}" >/dev/null 2>&1 || true
|
||||
pkill -f "websockify --web=/usr/share/novnc ${LOGIN_DESKTOP_WEB_PORT}" >/dev/null 2>&1 || true
|
||||
rm -f "/tmp/.X99-lock"
|
||||
rm -f "/tmp/.X11-unix/X99"
|
||||
|
||||
Xvfb "${DISPLAY}" -screen 0 1600x1000x24 -ac +extension RANDR > /app/logs/login_desktop/xvfb.log 2>&1 &
|
||||
for _ in $(seq 1 30); do
|
||||
if [ -S /tmp/.X11-unix/X99 ]; then
|
||||
break
|
||||
fi
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
fluxbox > /app/logs/login_desktop/fluxbox.log 2>&1 &
|
||||
x11vnc -display "${DISPLAY}" -forever -shared -rfbport "${LOGIN_DESKTOP_VNC_PORT}" -nopw > /app/logs/login_desktop/x11vnc.log 2>&1 &
|
||||
websockify --web=/usr/share/novnc "${LOGIN_DESKTOP_WEB_PORT}" "localhost:${LOGIN_DESKTOP_VNC_PORT}" > /app/logs/login_desktop/novnc.log 2>&1 &
|
||||
|
||||
exec python /app/login_desktop_server.py
|
||||
Reference in New Issue
Block a user