From 4c8e18b682dfc99f25848334322ec901cb84529e Mon Sep 17 00:00:00 2001 From: ztimson Date: Tue, 15 Sep 2026 00:36:20 -0400 Subject: [PATCH] VNC setup --- client/package-lock.json | 18 +- client/package.json | 1 + client/public/desktop.html | 443 ++++++++++++++++++++++++++++++++++-- client/src/services/vnc.mjs | 9 +- 4 files changed, 439 insertions(+), 32 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index a77e10e..efe7c4a 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -9,14 +9,20 @@ "version": "1.0.0", "license": "MIT", "dependencies": { + "@novnc/novnc": "^1.7.0", "dotenv": "^17.4.1", - "express": "^5.2.1", - "node-gpsd": "^0.3.4" + "express": "^5.2.1" }, "devDependencies": { "nodemon": "^3.1.10" } }, + "node_modules/@novnc/novnc": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@novnc/novnc/-/novnc-1.7.0.tgz", + "integrity": "sha512-ucEJOx4T2avIRCleodk7YobZj5O2Ga2AeLfQ69A/yjG9HHba2+PDgwSkN3FttrmG+70ZGx21sElNFouK13RzyA==", + "license": "MPL-2.0" + }, "node_modules/accepts": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", @@ -723,14 +729,6 @@ "node": ">= 0.6" } }, - "node_modules/node-gpsd": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/node-gpsd/-/node-gpsd-0.3.4.tgz", - "integrity": "sha512-sI9hPfHiaWDmhjE1oJZnhMo7UF2vQVGl3qk0K4HbN1L8BkS0I+rd6V687eHOj/6ervXiHrhwXzYYsWdXxGy0Qg==", - "engines": { - "node": ">=v0.8.0" - } - }, "node_modules/nodemon": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.1.10.tgz", diff --git a/client/package.json b/client/package.json index c9d118b..8afae2e 100644 --- a/client/package.json +++ b/client/package.json @@ -11,6 +11,7 @@ "license": "MIT", "description": "Dashboard", "dependencies": { + "@novnc/novnc": "^1.7.0", "dotenv": "^17.4.1", "express": "^5.2.1" }, diff --git a/client/public/desktop.html b/client/public/desktop.html index 5456373..7e10c5d 100644 --- a/client/public/desktop.html +++ b/client/public/desktop.html @@ -1,30 +1,433 @@ - + - - - Remote Desktop - - - -
+ + + noVNC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
noVNC encountered an error:
+
+
+
+
+ + +
+
+
+ +
+ + + +
+ + + + + + + + + +
+
+ + + + + + +
+
+ + + +
+
+
+ Power +
+ + + +
+
+ + + +
+
+
+ Clipboard +
+

+ Edit clipboard content in the textbox below. +

+ +
+
+ + + + + + +
+
+
+ Settings +
+
    +
  • + +
  • +
  • + +
  • +

  • +
  • + +
  • +
  • + + +
  • +

  • +
  • +
    Advanced
    +
      +
    • + + +
    • +
    • + + +
    • +

    • +
    • + + +
    • +
    • +
      WebSocket
      +
        +
      • + +
      • +
      • + + +
      • +
      • + + +
      • +
      • + + +
      • +
      +
    • +

    • +
    • + +
    • +
    • + + +
    • +

    • +
    • + +
    • +
    • + +
    • +

    • + +
    • + +
    • +
    +
  • +

  • +
  • + Version: + +
  • +
+
+
+ + + + +
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + +
+ + +
+
+ +
+ +
+
+
+ + +
+
+
+ Server identity +
+
+ The server has provided the following identifying information: +
+
+ Fingerprint: + +
+
+ Please verify that the information is correct and press + "Approve". Otherwise press "Reject". +
+
+ + +
+
+
+ + +
+
+
+ Credentials +
+
+ + +
+
+ + +
+
+ +
+
+
+ + +
+
+
+ +
+
+
+ + +
+ + +
+ + diff --git a/client/src/services/vnc.mjs b/client/src/services/vnc.mjs index 041dd87..9bd8d3d 100644 --- a/client/src/services/vnc.mjs +++ b/client/src/services/vnc.mjs @@ -5,13 +5,18 @@ import { fileURLToPath } from 'node:url'; import { registerSocket } from './websocket.mjs'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const NOVNC = path.join(__dirname, '../node_modules/@novnc/novnc'); +const NOVNC = path.join(__dirname, '../../node_modules/@novnc/novnc'); const VNC_HOST = process.env.VNC_HOST || '127.0.0.1'; const VNC_PORT = process.env.VNC_PORT || 5900; export const vncRouter = express.Router(); +vncRouter.get('/novnc/desktop.html', (req, res) => + res.sendFile(path.join(__dirname, '../../public/desktop.html')) +); vncRouter.use('/novnc', express.static(NOVNC)); -vncRouter.get('/', (req, res) => res.sendFile(path.join(__dirname, '../public/vnc.html'))); +vncRouter.get('/', (req, res) => + res.redirect('/vnc/novnc/vnc.html?path=ws/vnc&autoconnect=true&resize=scale') +); // Namespaced so other websocket features can register alongside this one const wss = registerSocket('/ws/vnc', {