Skip to content

Conversation

@SimonFair
Copy link
Contributor

@SimonFair SimonFair commented Jan 5, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • VMRC display now includes port information in connection strings for clearer remote connectivity details
    • GPU WebSocket port default and validation ranges updated
    • Port validation messages refined to reflect current specifications

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 5, 2026

Walkthrough

The changes update VM manager port configuration and display formatting. The VMRC connection string now includes the port in its output, while GPU WebSocket port defaults shift from 5901 to 5700 with corresponding validation range updates.

Changes

Cohort / File(s) Summary
VMRC Display Formatting
emhttp/plugins/dynamix.vm.manager/include/VMMachines.php
Modified graphics string generation for VMRC VM display to insert VMRC port between protocol and driver (e.g., "PROTOCOL:PORTDRIVER\n") instead of concatenating them directly.
GPU WebSocket Port Configuration
emhttp/plugins/dynamix.vm.manager/templates/Custom.form.php
Updated default GPU WS port from 5901 to 5700; adjusted HTML input validation constraints and JavaScript validation logic to enforce wsport range of 5700–5899; updated user-facing validation message to reflect new range.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A port by any other number would connect the same,
From 5901 down to 5700, we've tuned the GPU's flame,
The VMRC string now wears its port with pride,
Configuration hops along—we're along for the ride! 🎮

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions 'VNC ports' but the changes involve both VNC port ranges and VMRC port display formatting, making it partially descriptive but incomplete.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.01.05.1246
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-2505/webgui-pr-2505.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates

📝 Modified Files:

Click to expand file list
emhttp/plugins/dynamix.vm.manager/include/VMMachines.php
emhttp/plugins/dynamix.vm.manager/templates/Custom.form.php

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-2505, or run:

plugin remove webgui-pr-2505

🤖 This comment is automatically generated and will be updated with each new push to this PR.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
emhttp/plugins/dynamix.vm.manager/templates/Custom.form.php (1)

2131-2142: Validation logic is correct; consider improving error message clarity.

The JavaScript validation function correctly enforces the port range constraints and prevents port conflicts. The logic at line 2134 properly validates:

  • VNC/SPICE port: 5900–65535
  • WS port: 5700–5899
  • Ports must not be equal

However, the combined error message at line 2137 addresses multiple failure conditions at once. Consider providing more specific feedback based on which validation rule failed (e.g., separate messages for range violations vs. duplicate ports).

🔎 Optional refactor for clearer error messages
 function checkVNCPorts() {
 	const port = $("#port").val();
 	const wsport = $("#wsport").val();
-	if (port < 5900 || port > 65535 || wsport < 5700 || wsport > 5899 || port == wsport) {
+	let errorMsg = "";
+	if (port < 5900 || port > 65535) {
+		errorMsg = "_(VNC/SPICE port must be between 5900 and 65535)_";
+	} else if (wsport < 5700 || wsport > 5899) {
+		errorMsg = "_(WS port must be between 5700 and 5899)_";
+	} else if (port == wsport) {
+		errorMsg = "_(VNC/SPICE port and WS port cannot be equal)_";
+	}
+	
+	if (errorMsg) {
 		swal({
 			title: "_(Invalid Port)_",
-			text: "_(VNC/SPICE ports must be between 5900 and 65535, and cannot be equal to each other. WS port should be between 5700 and 5899)_",
+			text: errorMsg,
 			type: "error",
 			confirmButtonText: "_(Ok)_"
 		});
 	}
 }
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 987fa42 and 35f6692.

📒 Files selected for processing (2)
  • emhttp/plugins/dynamix.vm.manager/include/VMMachines.php
  • emhttp/plugins/dynamix.vm.manager/templates/Custom.form.php
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Squidly271
Repo: unraid/webgui PR: 2333
File: emhttp/plugins/dynamix/include/publish.php:28-36
Timestamp: 2025-08-13T03:13:53.283Z
Learning: In the unraid/webgui codebase, PR #2333 by Squidly271 supersedes earlier work that already addressed all legacy publish() calls using the old overloaded syntax. There are no remaining legacy calls that need backward compatibility handling in the publish() function.
Learnt from: ljm42
Repo: unraid/webgui PR: 2414
File: etc/rc.d/rc.nginx:374-376
Timestamp: 2025-10-03T02:57:29.994Z
Learning: Repo unraid/webgui: In etc/rc.d/rc.nginx, maintainers prefer not to add explicit mv-failure checks or EXIT trap clearing around atomic writes in build_servers(), build_locations(), and build_ini(); treat mv failures (e.g., disk full/permissions) as non-recoverable and keep the implementation simple.
📚 Learning: 2025-12-28T15:54:58.673Z
Learnt from: mgutt
Repo: unraid/webgui PR: 2496
File: emhttp/plugins/dynamix/Browse.page:901-906
Timestamp: 2025-12-28T15:54:58.673Z
Learning: In the unraid/webgui codebase, CSRF validation is centralized in the global auto_prepend_file (local_prepend.php) which runs before every PHP request. Do not add per-script CSRF checks in individual files like Browse.page or Control.php. If a script relies on global validation, ensure it does not duplicate CSRF logic; otherwise extend the central preface to cover the needed checks.

Applied to files:

  • emhttp/plugins/dynamix.vm.manager/templates/Custom.form.php
  • emhttp/plugins/dynamix.vm.manager/include/VMMachines.php
🔇 Additional comments (3)
emhttp/plugins/dynamix.vm.manager/include/VMMachines.php (1)

98-98: LGTM! Port number now visible in display string.

The addition of the port number to the graphics display string improves visibility for users. The format change from PROTOCOLDRIVER to PROTOCOL:PORTDRIVER is clear and consistent with standard port notation.

emhttp/plugins/dynamix.vm.manager/templates/Custom.form.php (2)

108-108: Verify the rationale for the default WS port change.

The default wsport has been changed from 5901 to 5700. This represents a significant shift in the default port allocation strategy. Please confirm:

  • Is this change intentional and documented?
  • What is the rationale for choosing 5700 as the new default (previously it was 5901, just above the VNC port range)?
  • Are there any compatibility considerations for existing deployments?

1334-1334: Clarify the distinction between port and wsport—these are separate port types with different purposes.

The port (VNC/SPICE) and wsport (WebSocket) are two independent port ranges: port ranges from 5900–65535 for VNC/SPICE protocol connections, while wsport is limited to 5700–5899 for WebSocket proxy connections. The 5700–5899 range for wsport is the original design (default wsport=5700), not a recent restriction. No breaking change has occurred—these are separate port allocations by design.

Likely an incorrect or invalid review comment.

@SimonFair SimonFair marked this pull request as ready for review January 5, 2026 13:07
@ljm42 ljm42 added the 7.3 label Jan 6, 2026
@limetech limetech merged commit 96224f1 into unraid:master Jan 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants