fix: rdp-proxy heartbeat now uses sid from URL instead of static SESSION_ID

Static SESSION_ID=rdpslot-N did not match the actual session UUID in DB,
so touch requests returned 404, last_access_at was never updated, and sessions
expired immediately after 5 minutes without user activity tracking.
This commit is contained in:
2026-07-22 08:16:52 +00:00
parent c58ed04821
commit 5e884a39ad
+3 -2
View File
@@ -179,8 +179,9 @@ cat > /opt/portal/index.html <<HTML
} }
const enableHeartbeat = "${ENABLE_HEARTBEAT}" === "1"; const enableHeartbeat = "${ENABLE_HEARTBEAT}" === "1";
const TOUCH_PATH = '${TOUCH_PATH}'; const sid = new URLSearchParams(location.search).get('sid');
const CLOSE_PATH = TOUCH_PATH.replace(/\/touch$/, '/close'); const TOUCH_PATH = sid ? `/api/sessions/${sid}/touch` : '${TOUCH_PATH}';
const CLOSE_PATH = sid ? `/api/sessions/${sid}/close` : TOUCH_PATH.replace(/\/touch$/, '/close');
const SESSION_CLOSED_URL = '/?session_closed=idle'; const SESSION_CLOSED_URL = '/?session_closed=idle';
function goSessionClosed(reason) { function goSessionClosed(reason) {