Revert "feat: add optional VNC password authentication" - #1142
Revert "feat: add optional VNC password authentication"#1142r33drichards wants to merge 1 commit into
Conversation
This reverts commit fd9cded.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Publishable packages changed
Add |
📝 WalkthroughWalkthroughTwo files are modified: one adds message filtering to the CopilotKit API route handler for more efficient processing, and the other disables VNC authentication in the XFCE startup script by enforcing no-security mode. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@libs/xfce/src/scripts/start-vnc.sh`:
- Around line 7-20: The start-vnc.sh currently forces unauthenticated,
network-exposed VNC by using -localhost no and -SecurityTypes None and ignores
caller-provided VNC_PW; change it to honor caller credentials and secure
defaults: remove or avoid unconditionally applying -localhost no and
-SecurityTypes None in start-vnc.sh, check for an environment VNC_PW (or a
provided password file) and if present set SecurityTypes to VncAuth and ensure
the VNC password is written/loaded accordingly, otherwise restrict access (e.g.,
keep -localhost yes or bind to localhost only) and/or require explicit opt-in
via a clear env flag (e.g., INSECURE_VNC=true) before enabling insecure options;
update use of ${VNC_PORT:-5901}, ${VNC_RESOLUTION:-...}, and
${VNC_COL_DEPTH:-...} to remain unchanged but ensure authentication logic
precedes vncserver invocation so credentials are not silently bypassed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 08e8c39d-bc74-43f8-b84b-b47868af63f6
📒 Files selected for processing (2)
docs/src/app/api/copilotkit/route.tslibs/xfce/src/scripts/start-vnc.sh
| # Start VNC server without password authentication | ||
| vncserver :1 \ | ||
| -geometry ${VNC_RESOLUTION:-1920x1080} \ | ||
| -depth ${VNC_COL_DEPTH:-24} \ | ||
| -rfbport ${VNC_PORT:-5901} \ | ||
| -localhost no \ | ||
| $SECURITY_ARGS \ | ||
| -SecurityTypes None \ | ||
| -AlwaysShared \ | ||
| -AcceptPointerEvents \ | ||
| -AcceptKeyEvents \ | ||
| -AcceptCutText \ | ||
| -SendCutText \ | ||
| -xstartup /usr/local/bin/xstartup.sh | ||
| -xstartup /usr/local/bin/xstartup.sh \ | ||
| --I-KNOW-THIS-IS-INSECURE |
There was a problem hiding this comment.
Reintroduces unauthenticated remote VNC access and bypasses caller-provided credentials.
With -localhost no + -SecurityTypes None, this starts a network-exposed VNC server without auth. It also ignores VNC_PW values still set by callers (for example libs/python/computer/computer/providers/docker/provider.py:374-379), so expected auth is silently disabled.
Proposed fix
-# Start VNC server without password authentication
-vncserver :1 \
+SECURITY_ARGS=(-SecurityTypes None --I-KNOW-THIS-IS-INSECURE)
+if [[ -n "${VNC_PW:-}" ]]; then
+ mkdir -p "$HOME/.vnc"
+ echo "$VNC_PW" | vncpasswd -f > "$HOME/.vnc/passwd"
+ chmod 600 "$HOME/.vnc/passwd"
+ unset VNC_PW
+ SECURITY_ARGS=(-SecurityTypes VncAuth)
+fi
+
+vncserver :1 \
-geometry ${VNC_RESOLUTION:-1920x1080} \
-depth ${VNC_COL_DEPTH:-24} \
-rfbport ${VNC_PORT:-5901} \
-localhost no \
- -SecurityTypes None \
+ "${SECURITY_ARGS[@]}" \
-AlwaysShared \
-AcceptPointerEvents \
-AcceptKeyEvents \
-AcceptCutText \
-SendCutText \
- -xstartup /usr/local/bin/xstartup.sh \
- --I-KNOW-THIS-IS-INSECURE
+ -xstartup /usr/local/bin/xstartup.sh🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@libs/xfce/src/scripts/start-vnc.sh` around lines 7 - 20, The start-vnc.sh
currently forces unauthenticated, network-exposed VNC by using -localhost no and
-SecurityTypes None and ignores caller-provided VNC_PW; change it to honor
caller credentials and secure defaults: remove or avoid unconditionally applying
-localhost no and -SecurityTypes None in start-vnc.sh, check for an environment
VNC_PW (or a provided password file) and if present set SecurityTypes to VncAuth
and ensure the VNC password is written/loaded accordingly, otherwise restrict
access (e.g., keep -localhost yes or bind to localhost only) and/or require
explicit opt-in via a clear env flag (e.g., INSECURE_VNC=true) before enabling
insecure options; update use of ${VNC_PORT:-5901}, ${VNC_RESOLUTION:-...}, and
${VNC_COL_DEPTH:-...} to remain unchanged but ensure authentication logic
precedes vncserver invocation so credentials are not silently bypassed.
Reverts #1072
Summary by CodeRabbit
Bug Fixes
Chores