feat: remote-control feature for browser-based CLI interaction#48
Open
BingqingLyu wants to merge 1 commit into
Open
feat: remote-control feature for browser-based CLI interaction#48BingqingLyu wants to merge 1 commit into
BingqingLyu wants to merge 1 commit into
Conversation
Addresses PR QwenLM#2330 security review comments: - Remove auth token from HTML page source - Remove token from QR code URL (sent via WS message instead) - Fix rate limit IP bypass (store clientIp at connection time) - Add proxy-aware IP detection (X-Forwarded-For, X-Real-IP) - Validate Host header before URL construction - Fix /remote-control stop unreachable - Fix ESM require.main usage - Remove misleading secure flag (always ws:// until TLS) - Remove token from /api/connect and /api/qr-data endpoints - Add missing ws dependency - Remove unused '/' from htmlEscapes mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features Implemented
Core Functionality
Security Features
User Interface
CLI Integration
/remote-controlqwen remote-controlFiles Added
docs/remote-control.md- User documentationpackages/cli/src/remote-control/types.ts- Protocol type definitionspackages/cli/src/remote-control/server/RemoteControlServer.ts- Server implementationpackages/cli/src/remote-control/server/RemoteControlServer.test.ts- Unit testspackages/cli/src/remote-control/utils/htmlSanitizer.ts- Security utilitiespackages/cli/src/remote-control/index.ts- Module exportspackages/cli/src/commands/remote-control/index.ts- CLI subcommandpackages/cli/src/ui/commands/remoteControlCommand.ts- Slash commandFiles Modified
packages/cli/package.json- Added ws, @types/ws dependenciespackages/cli/src/config/config.ts- Registered remote-control subcommandpackages/cli/src/services/BuiltinCommandLoader.ts- Registered slash commandKnown Limitations
Current Limitations (Intentional)
Future Enhancements (Not Implemented)
Security Considerations
Production Deployment Requirements
Before deploying to production or internet-facing environments:
secure: truein configRecommended Use Cases
✅ Safe to use:
❌ Not recommended without additional security:
Testing
All tests pass:
Related Issues
Fixes: QwenLM#1946 (Request remote-control Feature)