Commit Graph
8 Commits
Author SHA1 Message Date
Codex f315618bfc fix(autostart): wait for the VNC server before starting web-vnc
autostart-run.bat checked 5900 once at startup; at boot the UltraVNC service may
not be up yet, so web-vnc either spawned a 2nd VNC server (conflict) or started
serving on :8080 before the VNC server was ready, breaking browser connections.

Now autostart-run.bat polls 127.0.0.1:5900 for up to ~30s (one PowerShell loop:
TcpClient + Start-Sleep 1, exits on first accepted connection) and only then
launches web-vnc.exe -- without --spawn when 5900 already listens, or spawning a
local server (portable vnc\winvnc.exe / tvnserver.exe, else auto-detect) if it
never came up. Docs (AGENTS.md, README.md) updated.
2026-08-05 16:14:39 +03:00
Codex 9b8ee94dd5 refactor: move user-facing scripts to repo root; fix set-password ordering
- install-autostart.bat, uninstall-autostart.bat, restart-autostart.bat,
  open-firewall.bat moved from scripts/ to the repo root (next to run.bat and
  set-password.bat). Internal helpers (autostart-run.bat, ensure-vnc-password.ps1,
  get-novnc.*, get-vnc.ps1, list-ips.ps1) stay in scripts/. autostart-run.bat is
  kept in scripts/ because the scheduled task /TR points at it; moving it would
  break already-installed tasks.
- Updated all references (set-password.bat, run.bat, install/restart-autostart.bat,
  AGENTS.md, README.md).
- set-password.bat: write webvnc.conf BEFORE the UltraVNC sync so the web password
  is configured even if ensure-vnc-password.ps1 fails / its UAC is dismissed
  (previously 'Password is not configured' from install-autostart.bat when the
  sync blocked before conf was written).
- AGENTS.md / README.md structure + autostart sections updated for the new layout.
2026-08-05 15:38:39 +03:00
Codex 754f77a8d0 feat: autostart as a service + separate password setup (set-password.bat)
- set-password.bat: one-time password setup -> writes webvnc.conf (HASH + VNC_PASSWORD), syncs UltraVNC via ensure-vnc-password.ps1; if the 'web-vnc' task is installed, restarts it (elevated) to reload the new password, skipping restart when the password is unchanged.
- run.bat: no longer prompts for the password; reads it from webvnc.conf (asks to run set-password.bat first if absent). Also clears --spawn-command (not just --spawn) when 5900 is already listening, to avoid spawning a 2nd VNC server.
- scripts/autostart-run.bat: non-interactive launcher for the scheduled task (reads webvnc.conf, finds only a LOCAL VNC server, never downloads at boot).
- scripts/install-autostart.bat / uninstall-autostart.bat: register/remove a 'web-vnc' scheduled task (ONSTART, SYSTEM, HIGHEST) via schtasks.
- scripts/restart-autostart.bat: restart the task to apply a new password; checks whether web-vnc.exe is running (stop+start, or just start).
- .gitignore: ignore webvnc.conf (secret).
- AGENTS.md / README.md: document the autostart flow, set-password.bat, the new scripts, and that the running gateway must be restarted to apply a password change.
2026-08-05 15:23:58 +03:00
Codex 0779b4327c Translate run.bat and open-firewall.bat to English ASCII
Convert the .bat scripts from Russian (UTF-8 with BOM + chcp 65001) to plain
English ASCII without BOM/chcp, so they render correctly under any OEM console
codepage without relying on BOM handling.
2026-07-31 21:44:42 +03:00
Codex 71e2fef4d9 fix: use UTF-8 BOM for .bat so cmd shows Cyrillic correctly
UTF-8 without BOM + chcp 65001 showed '????' because cmd reads .bat under the
OEM codepage, not chcp. A UTF-8 BOM makes cmd read the file as UTF-8 regardless
of the console codepage; verified Cyrillic in echo/set/for displays correctly
even when cmd starts at cp866. AGENTS.md updated accordingly.
2026-07-30 22:50:23 +03:00
Codex db4f33f725 polish: UTF-8 batch scripts, drop redundant set-vnc-password, robust vnc password probe
- run.bat / open-firewall.bat: UTF-8 (no BOM) + chcp 65001 instead of cp866/chcp 866.
- scripts/set-vnc-password.bat: removed (run.bat syncs the UltraVNC password via ensure-vnc-password.ps1).
- scripts/ensure-vnc-password.ps1: use a real RFB VNC-Auth probe to 127.0.0.1:5900
  to decide if the password already matches (no UAC when it does); set via
  createpassword/setpasswd + service restart only when it differs. Works for
  any password length (no stored-password encoding assumptions).
- AGENTS.md: .bat encoding convention updated to UTF-8/chcp 65001; drop set-vnc-password refs.
2026-07-30 20:03:43 +03:00
Codex 6a1ee64b14 feat(run): sync UltraVNC password from run.bat + clearer noVNC errors
- run.bat: call scripts/ensure-vnc-password.ps1 so the password typed once
  also sets the UltraVNC service VNC password (UAC only when it differs);
  skip --spawn when 5900 is already taken (don't launch a 2nd winvnc).
- scripts/ensure-vnc-password.ps1: new - compares the password against
  %ProgramData%\UltraVNC\ultravnc.ini (reverse-engineered UltraVNC DES
  obfuscation) and only writes+restarts the service when it differs.
- scripts/set-vnc-password.bat: set UltraVNC service VNC password as admin
  (createpassword/setpasswd + verify, GUI fallback). Manual fallback.
- internal/server/static/vnc.html: don't let the generic 'disconnect'
  banner overwrite the specific 'securityfailure' reason (noVNC's
  disconnect event has no reason field, so it always said 'unknown').
- AGENTS.md: document the above (scripts, run.bat, UltraVNC service note).
2026-07-30 19:15:09 +03:00
Codex b89477fb87 feat: web-vnc single-binary browser VNC gateway with password access
- Go stdlib-only gateway: serves noVNC client, password auth, WS<->TCP relay
- auth: PBKDF2-HMAC-SHA256 password hash, HMAC session cookies, login rate limit
- relay: hand-written RFC 6455 WebSocket + transparent RFB bridge
- vncspawner: cross-OS VNC server detection/launch (Windows/Linux/macOS)
- server: /login /logout /vnc /api/status routes, session middleware, embed.FS
- scripts: get-novnc, get-vnc (zip-verified), list-ips, open-firewall
- run.bat: one-click launcher (asks only password), lists access IPs
- README/AGENTS.md (Russian), .gitignore (root-anchored binaries)
2026-07-30 17:40:31 +03:00