Migrate to TigerVNC and enable Remote Resizing

This commit is contained in:
Khoa.vo 2025-12-19 18:18:38 +07:00
parent a89b261fa2
commit 1f9f34fe5c
4 changed files with 13 additions and 15 deletions

View file

@ -17,8 +17,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \ ca-certificates \
ffmpeg \ ffmpeg \
# VNC & Display dependencies # VNC & Display dependencies
xvfb \ tigervnc-standalone-server \
x11vnc \ tigervnc-common \
openbox \ openbox \
# Playwright dependencies # Playwright dependencies
libnss3 \ libnss3 \

View file

@ -12,7 +12,13 @@ import json
import os import os
from typing import List, Dict, Optional from typing import List, Dict, Optional
from playwright.async_api import async_playwright, Response, Browser, BrowserContext from playwright.async_api import async_playwright, Response, Browser, BrowserContext
from playwright_stealth import stealth_async
try:
from playwright_stealth import stealth_async
except ImportError:
print("WARNING: playwright_stealth not found, disabling stealth mode.")
async def stealth_async(page):
pass
COOKIES_FILE = "cookies.json" COOKIES_FILE = "cookies.json"

View file

@ -35,8 +35,8 @@ export const Login: React.FC = () => {
const getVncUrl = () => { const getVncUrl = () => {
const host = window.location.hostname; const host = window.location.hostname;
// autoconnect=true, resize=scale to fit, quality=9 for clear text // autoconnect=true, resize=remote (server resizing) for full screen mobile
return `http://${host}:6080/vnc.html?autoconnect=true&resize=scale&quality=9`; return `http://${host}:6080/vnc.html?autoconnect=true&resize=remote&quality=9`;
}; };
const handleVncLogin = async () => { const handleVncLogin = async () => {

View file

@ -4,8 +4,8 @@ logfile=/dev/stdout
logfile_maxbytes=0 logfile_maxbytes=0
loglevel=info loglevel=info
[program:xvfb] [program:xvnc]
command=/usr/bin/Xvfb :99 -screen 0 1920x1080x24 command=/usr/bin/Xvnc :99 -geometry 1920x1080 -depth 24 -rfbport 5900 -SecurityTypes None -AlwaysShared
autorestart=true autorestart=true
priority=100 priority=100
stdout_logfile=/dev/stdout stdout_logfile=/dev/stdout
@ -23,14 +23,6 @@ stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0 stderr_logfile_maxbytes=0
[program:x11vnc]
command=x11vnc -display :99 -forever -shared -nopw -listen 0.0.0.0 -xkb
autorestart=true
priority=200
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:novnc] [program:novnc]
command=/opt/novnc/utils/novnc_proxy --vnc localhost:5900 --listen 6080 command=/opt/novnc/utils/novnc_proxy --vnc localhost:5900 --listen 6080