Files
BetterDesk/docs/development/CHANGELOG.md
T
UNITRONIX 1118fc2ba6 Anonymize operator infrastructure fingerprints from public repo.
Remove internal LAN IP, SSH user, and developer paths from docs and examples; move deploy runbook to gitignored docs/private with a public template; drop Cursor debug logging leftovers; add CI checks to prevent regression.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 19:07:42 +02:00

37 KiB
Raw Blame History

BetterDesk Console - Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[2.4.3] - 2026-03-21

🖥️ Web Remote Client — Mouse, Quality & FPS Fix (Phase 32)

Critical fixes for the embedded web remote client (/remote/:deviceId) — mouse clicks, image quality, and frame rate.

Mouse Click Fix (Critical)

  • Root cause: RustDesk parses mouse mask as button = mask >> 3; type = mask & 7. Web client sent flat values (e.g., mask=1 for left click), so server computed button = 0 (no button). Hover worked because mask=0 is correct for both formats.
  • input.js: Replaced flat mask values with correct TYPE | (BUTTON << 3) encoding. Left click now sends mask=9 (1 | (1<<3)), right click mask=17 (1 | (2<<3)), etc. Added static constants for mouse types and buttons.

Image Quality Fix

  • Root cause: buildLoginRequest in protocol.js hardcoded imageQuality: Balanced, ignoring any quality setting.
  • protocol.js: Login request now uses configurable quality (default Best instead of Balanced).
  • remote.js: Constructor passes imageQuality: 'Best' to RDClient.

FPS Fix

  • Root cause: Login request used customFps: opts.fps || 30 despite remote.js wanting 60fps. Session start only sent FPS option, not quality.
  • protocol.js: Default FPS changed from 30 to 60.
  • client.js: _startSession() now sends both customFps and imageQuality options. authenticate() passes fps: 60 and imageQuality: 'Best' to login builder.

UI Polish

  • remote.ejs: Replaced large orange "Work in Progress" banner with slim blue "Beta" banner with dismiss button.

Files Changed

  • public/js/rdclient/input.js — Mouse mask encoding + static constants
  • public/js/rdclient/protocol.js — Configurable quality + FPS defaults
  • public/js/rdclient/client.js — Session start sends quality + FPS
  • public/js/remote.js — imageQuality: 'Best' in constructor
  • views/remote.ejs — Dismissible beta banner

[2.4.2] - 2026-03-20

🔒 Security & Installer Fixes (Phase 31)

Critical fixes for issues #68, #70, #71 — API TLS breaking client communication, password $ escaping in systemd, and port diagnostic false positives.

API TLS Fix (Issues #70, #71)

  • Root cause: Fresh install with proper SSL certificates added -tls-api -force-https to Go server, making API port 21114 HTTPS-only. RustDesk clients always send plain HTTP → HTTP 400 on every request → 0 devices.
  • betterdesk.sh / betterdesk.ps1: Removed -tls-api -force-https from Go server args for ALL certificate types. Signal/relay TLS unchanged.
  • config.go: --force-https no longer implies API TLS. Only explicit --tls-api enables HTTPS on API port.
  • SSL config menu: Never adds -tls-api. Always removes -tls-api and -force-https from existing service.
  • API URLs: Always http://localhost:21114/api in .env and systemd — regardless of certificate type.

Password $ Escaping (Issue #68)

  • Root cause: systemd interprets $ as variable substitution in ExecStart= and Environment= directives. Passwords or PostgreSQL URLs containing $ get silently corrupted.
  • betterdesk.sh: Added $$$ escaping for admin password and PostgreSQL URL before writing to .service files.
  • Note: Auto-generated passwords (alphanumeric only) were never affected. Fix targets user-set passwords.

Port Diagnostic False Positive

  • Root cause: On some Linux systems (Ubuntu 24.04+), ss -tlnp reports Node.js as MainThread instead of node.
  • betterdesk.sh: Added MainThread to expected process patterns for ports 5000 and 21121.

[2.4.1] - 2026-03-20

🎨 Devices Page UI Redesign

Complete UI overhaul of the Devices page — fully responsive, space-efficient, and optimized for phone, tablet, and desktop.

Layout Changes

  • Sidebar removed — 280px folder sidebar replaced with horizontal scrollable folder chips (pill buttons)
  • Unified toolbar — Search, segmented filter buttons (All/Online/Offline/Banned), and column visibility toggle in a single row
  • Slim table — Reduced cell padding for higher information density
  • Kebab menu (⋮) — Replaced 5 inline action buttons per row with a compact dropdown menu (connect, connect-desktop, details, ban/unban, delete)
  • Status dot — Colored dot (green/gray/red) inline with device ID for at-a-glance status
  • Mobile bottom sheet — On phones, kebab menu appears as a full-width bottom sheet with backdrop overlay

Responsive Breakpoints

  • ≤1024px — Hides device_type column
  • ≤768px — Hides platform + last_online columns; search goes full-width; button labels hidden (icons only)
  • ≤600px — Card-style rows (CSS grid 2-column); <thead> hidden; kebab becomes fixed bottom sheet with overlay backdrop
  • ≤400px — Folder chip labels hidden (icons only); smaller filter buttons

Files Changed

  • views/devices.ejs — Complete template rewrite
  • public/css/devices.css — Complete stylesheet rewrite (~780 lines)
  • public/js/devices.js — Updated rendering (kebab menu, folder chips, status dots, global close handler)

[2.4.0] - 2026-03-01

PostgreSQL Support, Migration Tool, CDAP, TLS Everywhere & More

See .github/copilot-instructions.md for full details on Phases 429.

Highlights

  • PostgreSQL database backend (pgx/v5, connection pooling, LISTEN/NOTIFY)
  • SQLite ↔ PostgreSQL migration tool (tools/migrate/)
  • TLS for TCP signal, relay, and WebSocket (auto-detect plain/TLS on same port)
  • E2E encryption fixes (relay UUID, SignIdPk NaCl format, PunchHoleResponse)
  • CDAP protocol v0.3.0 (device widgets, commands, panel rendering)
  • Sysinfo/heartbeat endpoints for hostname/platform display
  • Address book sync in Go server
  • Docker single-container + GHCR publishing
  • 30+ bug fixes across Go server, Node.js console, and installer scripts

[2.3.0] - 2026-02-22

🔒 Security Audit & Fixes

Full security audit performed — 3 Critical, 5 High, 8 Medium, 6 Low findings. All Critical and High issues resolved.

Critical Fixes

  • CSRF Protection — Double-submit cookie pattern using csrf-csrf package (new middleware/csrf.js)
  • Cookie Name Fix — Logout now correctly clears betterdesk.sid (was connect.sid)
  • TOTP Dependency — Added otplib to package.json for TOTP 2FA support

High Fixes

  • WebSocket Authentication — Session cookie required for WebSocket upgrade (401 on unauthenticated connections)
  • Session Fixation Preventionreq.session.regenerate() after successful login
  • Configurable Trust ProxyTRUST_PROXY environment variable (prevents IP spoofing)
  • Body Size Limit — Enforced in WAN middleware stack for Client API
  • Timing-Safe Auth — Pre-computed dummy bcrypt hash for non-existent users

Medium/Low Fixes

  • Password minimum length increased from 6 to 8 characters
  • Input length validation (username/password max 128 chars)
  • Strict JSON-only content type in WAN middleware (text/plain removed)
  • X-XSS-Protection set to 0 (modern recommendation)
  • Invalid empty CORS header removed

New Features

RustDesk Client API (WAN-facing)

  • Dedicated port 21121 for RustDesk desktop/mobile client authentication
  • 7-layer security: rate limiting, API key, IP whitelist, JWT auth, JSON-only, body size limit, audit logging
  • Full login flow: /api/login, /api/logout, /api/currentUser, /api/login-options
  • Heartbeat & sysinfo endpoints for client keep-alive
  • Address book sync (/api/ab, /api/ab/personal)

TOTP Two-Factor Authentication

  • Time-based One-Time Password support via otplib
  • QR code generation for authenticator apps
  • TFA verification during login flow

Operator Role

  • Separate admin/operator roles with different permissions
  • Operators can view devices but cannot modify system settings

Desktop Connect Button

  • Connect to devices directly from browser using RustDesk URI handler (rustdesk://)

SSL Certificate Configuration

  • New menu option C in both betterdesk.sh and betterdesk.ps1
  • Let's Encrypt (certbot) integration on Linux
  • Custom certificate support (PEM cert + key)
  • Self-signed certificate generation
  • Disable SSL option

🗑️ Removed

  • Flask console removed — Node.js is now the only supported web console
  • --flask / -Flask flags show deprecation warning and install Node.js instead
  • Install-FlaskConsole function removed from betterdesk.ps1
  • Flask pip packages removed from dependency installation
  • Flask NSSM/systemd service blocks removed

🖥️ Web Remote Desktop Client Fixes

Major overhaul of the browser-based remote desktop client — fixes critical issues that caused 0-3 FPS, black screen, and broken keyboard input.

Critical Fixes

  • Missing video_received ack — Server was throttling to 1-5 FPS because the web client never acknowledged received video frames (client.js)
  • Autoplay blocked silentlyplay().catch(() => {}) swallowed browser autoplay errors causing a permanent black screen; added proper detection and "Click to Start" overlay (video.js, remote.js, remote.css)
  • Wrong modifier key values — Shift/Ctrl/Alt/Meta sent incorrect ControlKey enum values (1,2,4,8 instead of 29,4,1,23 from message.proto); every keyboard shortcut was broken (input.js)
  • Audio Opus decoding — Audio was treated as raw PCM instead of Opus; added AudioDecoder (WebCodecs) for proper Opus decoding with raw PCM fallback (audio.js)
  • WebCodecs timestamp overflow — Timestamps used pts * 1000 (1ms intervals) overflowing the decoder queue; changed to monotonic frameCount * 33333µs at ~30fps (video.js)

High Fixes

  • O(n²) buffer concatenation — Stream decoder created a new Uint8Array on every incoming chunk; replaced with pre-allocated growing buffer using copyWithin() (protocol.js)
  • Aggressive video seeking — Health check every 500ms hard-seeking at 0.5s latency caused visible jitter; changed to 2000ms interval with gentle playbackRate = 1.05 catch-up (video.js)

Low Fixes

  • Mouse throttle — Increased from 30Hz (33ms) to 60Hz (16ms) for smoother cursor movement (input.js)
  • Cursor data field mismatch — Renderer looked for .data but protobuf sends .colors; now supports both (renderer.js)
  • Autoplay i18n — Added click_to_start, autoplay_blocked, start_playback keys to EN and PL translations

📝 Updated

  • README.md — Comprehensive overhaul for v2.3.0 (new architecture diagram, Client API docs, security section)
  • betterdesk.sh — v2.3.0 with Flask removal and SSL wizard
  • betterdesk.ps1 — v2.3.0 with Flask removal and SSL configuration
  • VERSION — 2.3.0
  • package.json — Version 2.3.0, added otplib and csrf-csrf dependencies
  • .github/copilot-instructions.md — Updated project state documentation

[1.5.4] - 2026-02-02

🚀 Pre-Compiled v2.0.0 Binaries

Major Update: Added pre-compiled v2 binaries with significant performance improvements.

Added

Pre-Compiled Linux Binaries (hbbs-patch-v2/)

  • hbbs-linux-x86_64: Signal server with HTTP API (9.4 MB)
  • hbbr-linux-x86_64: Relay server (2.9 MB)
  • Compiled from RustDesk Server 1.1.14 with BetterDesk enhancements

Performance Improvements (v2 binaries)

  • Port 21120: Non-conflicting API port (changed from 21114)
  • 15s offline detection: 2x faster than v1 (was 30s)
  • Connection pooling: 5 DB connections (was 1)
  • Auto-retry logic: Exponential backoff for database operations
  • Better stability: 99.8% uptime

Automatic Service Creation

  • Installer now creates rustdesksignal.service and rustdeskrelay.service from templates if they don't exist
  • Templates in templates/ directory

Changed

Install Script (v1.5.4)

  • Priority order for binaries:
    1. hbbs-patch-v2/hbbs-linux-x86_64 (pre-compiled, recommended)
    2. hbbs-patch-v2/target/release/hbbs (locally compiled)
    3. hbbs-patch/bin-with-api/hbbs-v8-api (old v1, deprecated with warning)

Documentation Updates

  • Updated README with v2 binary information
  • Added CHECKSUMS.md for v2 binaries
  • Updated firewall instructions (port 21120)

[1.5.3] - 2026-02-02

🔧 Critical: Automatic Systemd Service Update

Critical Fix: Installation script now automatically updates systemd service files to use the modified API-enabled binaries (hbbs-v8-api, hbbr-v8-api).

Fixed

Systemd Service Auto-Update

  • Automatic service detection: Scans for all common RustDesk service names:
    • HBBS: rustdesksignal.service, hbbs.service, rustdesk-hbbs.service
    • HBBR: rustdeskrelay.service, hbbr.service, rustdesk-hbbr.service
  • ExecStart auto-update: Modifies service files to use hbbs-v8-api and hbbr-v8-api instead of original binaries
  • Backup before modification: Service files are backed up before any changes
  • Daemon reload: Automatically reloads systemd after service file updates

Service Restart Improvements

  • Now correctly finds and restarts services with different naming conventions
  • Shows status summary of all services after restart
  • Better error handling and logging for failed service starts
  • Now creates symlinks for both hbbs and hbbr (previously only hbbs)

Added

Diagnostic Tools (dev_modules/)

  • fix_systemd_services.sh: Standalone tool to fix systemd services manually
    • Scans for all RustDesk services
    • Shows current ExecStart configuration
    • Updates services to use API-enabled binaries
    • Creates backups of original service files
    • Optional automatic restart

[1.5.2] - 2026-02-02

🔧 Database Schema Fix & File Naming Cleanup

Critical Fix: Resolved multiple database schema issues that caused login failures and 500 errors.

Fixed

Database Schema Issues

  • Sessions table: Fixed missing last_activity column causing "Login failed: table sessions has no column named last_activity"
  • Audit log table: Fixed target_id/created_at vs device_id/timestamp mismatch causing login failures
  • Peer table: Added missing updated_at and deleted_at columns causing 500 errors when editing devices
  • Installation script: Now properly checks and fixes existing table structures during updates

File Naming Cleanup

  • Removed version numbers from file names for consistency:
    • app_v14.pyapp.py
    • script_v15.jsscript.js
    • index_v15.htmlindex.html
  • Updated all references in documentation and scripts
  • Service file now correctly points to app.py

Python Package Installation

  • Improved install_python_dependencies() function with multiple fallback methods:
    • --break-system-packages for Debian 12+/Ubuntu 23.04+
    • Virtual environment creation with automatic service update
    • --user flag fallback
    • System packages via apt fallback
    • Verification of installed packages

Added

Diagnostic Tools (dev_modules/)

  • check_and_fix_database.sh: Comprehensive database schema checker and fixer

    • Automatically detects database location
    • Validates all required tables and columns
    • Fixes missing or incorrect schema
    • Creates backup before making changes
  • fix_peer_columns.sh: Quick fix for peer table columns

    • Adds all missing columns (updated_at, deleted_at, etc.)
    • Simple one-command fix for device editing errors

Changed

  • Installation script now performs thorough database migration on every run
  • Sessions table migration detects old structure (id as PRIMARY KEY) and recreates with correct structure
  • Audit log table migration validates column names match code expectations

[1.4.0] - 2026-01-11

🔐 Security & Authentication Update

Major Security Enhancement: Added comprehensive authentication system for both web console and HBBS HTTP API, plus LAN access capabilities.

Added

Authentication System

  • User Login System:

    • bcrypt password hashing (cost 12)
    • 24-hour session tokens stored in database
    • Login page with secure password handling
    • Session validation on all protected routes
  • Role-Based Access Control (RBAC):

    • Three roles: admin, operator, viewer
    • Role-specific permissions for device management
    • Admin-only access to user management
    • Audit logging for all actions
  • User Management Panel:

    • Create/edit/delete users
    • Activate/deactivate accounts
    • Role assignment
    • Password reset functionality
    • User list with status indicators

API Security

  • X-API-Key Authentication:

    • 64-character random API keys generated during installation
    • Middleware verification on all HBBS API endpoints
    • Stored securely in /opt/rustdesk/.api_key with 600 permissions
    • Automatic key injection by web console
    • 401 Unauthorized for missing/invalid keys
  • LAN Access:

    • HBBS API now binds to 0.0.0.0:21120 (accessible on LAN)
    • Web console binds to 0.0.0.0:5000 (accessible on LAN)
    • Protected by authentication (API key + user login)
    • External tools can use API with X-API-Key header

Web Console Features

  • Sidebar Navigation: Modern sidebar menu with icon-based navigation
  • Password-Protected Key Access: Public key requires password verification
  • Password Change: Users can change their passwords in Settings
  • Removed Devices Tab: Simplified interface, devices managed on Dashboard
  • Expanded About Page: Credits, GitHub links, open source information
  • Enhanced Settings: Password change, session management, preferences

Installation & Updates

  • API Key Generation: Automatic during installation via openssl rand
  • Environment Variables: HBBS_API_KEY, FLASK_HOST, FLASK_PORT, FLASK_DEBUG
  • Service Configuration: Updated systemd services with new environment vars
  • Update Script: update-to-v1.4.0.sh for existing installations
  • Backward Compatibility: Preserves existing configurations during update

Changed

  • API Binding: Changed from 127.0.0.1 (localhost-only) to 0.0.0.0 (LAN-accessible)
  • Authentication Required: All API endpoints now require X-API-Key header
  • Web Console Access: Requires user login instead of open access
  • Session Management: 24-hour sessions instead of permanent access
  • Database Schema: Added users, sessions, audit_log tables

Security

  • Authentication: All services protected by authentication
  • Encrypted Passwords: bcrypt hashing for user passwords
  • API Key Auth: X-API-Key header prevents unauthorized API access
  • Session Tokens: Time-limited tokens with automatic expiration
  • Audit Trail: All administrative actions logged
  • Secure Storage: API keys with 600 permissions
  • XSS Protection: Input sanitization throughout
  • SQL Injection Prevention: Parameterized queries only
  • CSRF Protection: Session-based validation

Technical Details

  • Files Modified:

    • hbbs-patch/src/http_api.rs - Added X-API-Key middleware
    • web/app_v14.py - Added authentication, user management, API key loading
    • web/auth.py - Password hashing, session management, user CRUD
    • web/templates/login.html - New login page
    • web/templates/index_v14.html - Sidebar navigation, user management UI
    • web/static/script_v14.js - User management, password change, key verification
    • install-improved.sh - API key generation and service configuration
    • update-to-v1.4.0.sh - Update script for existing installations
  • Database Migration: migrations/v1.4.0_auth_system.py

    • Creates users table with roles
    • Creates sessions table for session management
    • Creates audit_log table for action tracking
    • Generates default admin user
  • API Endpoints (all require X-API-Key):

    • GET /api/health - Health check
    • GET /api/peers - List all peers with online status
  • Web Endpoints (all require login except /login):

    • GET /login - Login page
    • POST /login - Authenticate user
    • GET /logout - End session
    • GET / - Dashboard
    • GET /api/users - List users (admin only)
    • POST /api/users - Create user (admin only)
    • PUT /api/users/<id> - Update user (admin only)
    • DELETE /api/users/<id> - Delete user (admin only)
    • POST /api/change-password - Change password
    • POST /api/verify-password - Verify password for key access

Migration Path

For new installations:

sudo ./install-improved.sh
  • Automatically generates API key
  • Configures services for LAN access
  • Creates default admin user

For existing installations:

sudo ./update-to-v1.4.0.sh
  • Creates automatic backup
  • Runs database migration
  • Generates API key if not exists
  • Updates systemd services
  • Preserves existing configuration
  • Rollback capability on failure

Documentation

  • Updated README.md with authentication instructions
  • Updated hbbs-patch/README.md with API security documentation
  • Updated hbbs-patch/SECURITY_AUDIT.md with v1.4.0 security review
  • Updated docs/PORT_SECURITY.md with LAN access notes
  • Added API key retrieval instructions

Known Issues

  • 26 Pylance type warnings in app_v14.py for log_audit() parameters (non-critical)
  • API key must be manually distributed to external tools

Upgrade Notes

Breaking Changes:

  • Existing API clients must add X-API-Key header
  • Web console now requires user login
  • Sessions expire after 24 hours

Recommended Actions After Upgrade:

  1. Login with default admin credentials (shown after migration)
  2. Change admin password immediately
  3. Delete /opt/BetterDeskConsole/admin_credentials.txt
  4. Create additional users with appropriate roles
  5. Update external tools with API key from /opt/rustdesk/.api_key
  6. Configure firewall for LAN access if needed

[1.3.0-secure] - 2026-01-10

🔒 Security Update: Localhost-Only API Binding

Critical Security Enhancement: HTTP API now binds exclusively to localhost (127.0.0.1), eliminating network exposure.

Changed

  • API Port: Changed from 21114 to 21120

    • Avoids conflict with RustDesk Pro (which uses 21114 for public API)
    • Clearly distinguishes this as a localhost-only service
    • Updated all documentation and configuration examples
  • API Binding: Localhost-only (127.0.0.1)

    • Previous: Bound to 0.0.0.0 (all interfaces, potential security risk)
    • Current: Bound to 127.0.0.1 (localhost only, secure by design)
    • API accessible only from same machine
    • Cannot be accessed from network/internet
    • No firewall configuration needed for port 21120
  • Server Configuration: Added --api-port parameter

    • Command-line parameter support for flexible deployment
    • Systemd service updated: ExecStart=/opt/rustdesk/hbbs --api-port 21120
    • Windows service compatible with new parameter
  • Web Console: Updated to use new API endpoint

    • Flask app now connects to http://localhost:21120/api
    • Automatic backup of old configuration during update
    • Verified working with new API port

Added

  • Documentation:

    • PORT_SECURITY.md - Complete port security analysis
    • SSH tunnel instructions for remote API access
    • Security audit documentation
    • Updated README with security notes (6 instances of port references)
  • Binaries: Updated Linux binaries with security features

    • hbbs-v8-api (9.59 MB) - Built 10.01.2026 10:25 UTC
    • hbbr-v8-api (4.73 MB) - Built 10.01.2026 10:25 UTC
    • Contains: "HTTP API server listening on (localhost only)" string
    • Verified: --api-port parameter support
    • Windows binaries retained (compatible with new system)
  • Installation Scripts:

    • install-improved.sh configured for v8-api binaries
    • Automatic backup creation before installation
    • File validation and verification
    • Service configuration with new port

Security

  • Zero Network Exposure: API cannot be accessed from external networks
  • Connection Refused: External access attempts properly blocked
  • SSH Tunnel Support: Remote access via secure tunnel only
  • No Private Data: Documentation uses placeholder IPs and example credentials; operator runbooks live in gitignored docs/private/
  • Verified Installation: Complete end-to-end security validation

Fixed

  • Port Conflict: No longer conflicts with RustDesk Pro API (port 21114)
  • Network Security: Eliminated accidental API exposure to internet
  • Service Startup: systemd service properly configured with --api-port parameter

Technical Details

  • API Endpoints: /api/health, /api/peers (unchanged)
  • Response Format: JSON (unchanged)
  • Performance: Same as v1.2.0-v8 (~1ms per request)
  • Compatibility: Fully compatible with existing RustDesk clients
  • RustDesk Ports: TCP 21115-21117, UDP 21116 (unchanged, public access required)

Remote Access

For remote API access (e.g., from Windows workstation to Linux server):

# Create SSH tunnel
ssh -L 21120:localhost:21120 user@server

# Then access API locally
curl http://localhost:21120/api/health

Migration from v1.2.0-v8

Automatic upgrade:

cd Rustdesk-FreeConsole
git pull
sudo ./install-improved.sh

Manual steps if needed:

  1. Update systemd service: Add --api-port 21120 to ExecStart
  2. Update web console: Change API URL to http://localhost:21120/api
  3. Reload services: systemctl daemon-reload && systemctl restart rustdesksignal betterdesk

Verification

# 1. Check API binding (should show 127.0.0.1:21120 only)
ss -tlnp | grep 21120

# 2. Test local access (should succeed)
curl http://localhost:21120/api/health

# 3. Test external access (should fail - connection refused)
curl http://SERVER_IP:21120/api/health

# 4. Verify RustDesk ports still public
ss -tlnp | grep -E '21115|21116|21117'

Expected results:

  • Port 21120 on 127.0.0.1 (localhost only)
  • Local API access works
  • External API access blocked
  • RustDesk client ports public (21115-21117)

[1.2.0-v8] - 2026-01-06

🚀 Major Update: Precompiled Binaries + Bidirectional Ban Enforcement

Game Changer: Installation time reduced from ~20 minutes to ~2 minutes!

Added

  • Precompiled Binaries: No more compilation required!

    • hbbs-patch/bin/hbbs-v8 (9.5 MB) - Signal server with bidirectional bans
    • hbbs-patch/bin/hbbr-v8 (5.0 MB) - Relay server with bidirectional bans
    • Ready-to-deploy binaries compiled from RustDesk Server v1.1.14
    • Installation now takes ~2-3 minutes (vs ~20 min with compilation)
    • Reduced dependencies: No longer requires git, cargo, or Rust toolchain
  • Bidirectional Ban Enforcement: Complete ban system overhaul

    • Source Ban Check: Prevents banned devices from initiating ANY connections
      • Checks device ID at punch hole request (P2P connections)
      • Checks device ID at relay request (relay connections)
      • Added find_by_addr() method in peer.rs to identify source device by IP
    • Target Ban Check: Prevents connections TO banned devices (legacy feature)
    • Works for both P2P and relay connection types
    • Real-time database sync - no restart required after ban/unban
    • Comprehensive logging for audit trail
  • Enhanced Build System:

    • Updated build.sh with v8 patches (8 automated patches)
    • New deployment script: deploy-v8.sh
    • Binary verification and checksum tools
    • Rebuild instructions for custom architectures
  • Documentation:

    • hbbs-patch/bin/README.md - Binary documentation and verification
    • docs/INSTALLATION_V8.md - Complete v8 installation guide
    • hbbs-patch/BAN_ENFORCEMENT.md - Technical documentation for bidirectional bans
    • hbbs-patch/SECURITY_AUDIT.md - Security audit report
    • Updated all guides with v8 information

Changed

  • Installer Redesign (install.sh):

    • Now uses precompiled binaries from hbbs-patch/bin/
    • Removed compilation steps (no more cargo build)
    • Reduced dependencies: Only requires python3, pip3, curl, systemctl
    • Automatic backup of existing binaries (timestamped)
    • Installs both HBBS and HBBR
    • Restarts services after installation
    • ~500MB disk space saved (no Rust toolchain needed)
  • Version Numbering: Changed from 1.2.0 to 1.2.0-v8 to indicate binary version

Fixed

  • Ban Enforcement Bug: Banned devices could still initiate connections
    • Root cause: Only target device was checked, not source device
    • Solution: Added dual ban check (source + target) in punch hole and relay handlers
    • Added find_by_addr() to map socket address to device ID
    • Now blocks in BOTH directions

Removed

  • Old binary versions (hbbs-v2-patched through hbbs-v5-patched) - no longer needed
  • Compilation requirements from documentation
  • References to git/cargo in installation guides

Technical Details

  • Architecture: Linux x86_64 (tested on Ubuntu 20.04+, Debian 11+)
  • Performance: Same as before (~1ms per ban check)
  • Reliability: 100% ban enforcement in both directions
  • Compatibility: Works with all RustDesk clients compatible with v1.1.14 server
  • Build Time: N/A for end users (using precompiled), ~15-20 min if rebuilding from source

Migration Notes

Users upgrading from v1.2.0 or earlier:

cd Rustdesk-FreeConsole
git pull
sudo ./install.sh  # Will automatically backup and upgrade

Benefits of v8:

  • 10x faster installation
  • No compilation errors
  • Fixed ban enforcement bug (bidirectional)
  • Smaller dependency footprint
  • Easier deployment

[1.2.0] - 2026-01-05

🔥 Major Update: Native HBBS Ban Check

Breaking Change: Ban enforcement moved from Python daemon to native HBBS binary

Added

  • Native Ban Check in HBBS: Device bans now enforced at registration level in HBBS server

    • Modified src/database.rs: Added is_device_banned() method for real-time ban checking
    • Modified src/peer.rs: Registration logic now checks ban status before accepting devices
    • Banned devices receive UUID_MISMATCH error code (standard RustDesk rejection)
    • 100% effective - no race conditions or timing windows
    • Fail-open policy: continues operation if database unavailable
    • Single SQL query per registration: SELECT is_banned FROM peer WHERE id = ?
  • HBBS Build System: Complete automated build and installation tooling

    • hbbs-patch/build.sh: Automated patch application and compilation script
    • hbbs-patch/install.sh: One-command installation on server
    • hbbs-patch/QUICKSTART.md: 3-step setup guide
    • hbbs-patch/BAN_CHECK_PATCH.md: Technical documentation
    • Supports RustDesk Server v1.1.14
  • Documentation:

    • Complete HBBS patch documentation in hbbs-patch/ directory
    • Build system guides for local and server-side compilation
    • Migration guide from Ban Enforcer to native ban check

Changed

  • Ban Enforcer Deprecated: The Python ban_enforcer.py daemon is now obsolete
    • Native HBBS implementation replaces daemon functionality
    • No external processes needed
    • Better performance and reliability
    • Kept in repository for reference/rollback purposes

Technical Details

  • Performance: Minimal overhead (~1ms per registration)
  • Reliability: 100% ban enforcement (vs ~95% with daemon)
  • Architecture: Ban check integrated into device registration flow
  • Compatibility: Works with existing BetterDesk Console database schema
  • Build: Rust 1.90+ required for compilation

Migration Notes

Users upgrading from v1.1.0:

  1. Compile patched HBBS binary (see hbbs-patch/QUICKSTART.md)
  2. Install patched binary on server
  3. Stop and disable rustdesk-ban-enforcer service
  4. Verify ban functionality through console

[1.1.0] - 2026-01-05

Added

  • Device Banning System: Complete implementation of device ban management
    • Added is_banned, banned_at, banned_by, and ban_reason columns to database
    • Database migration script (migrations/v1.1.0_device_bans.py)
    • Ban/Unban API endpoints: POST /api/device/<id>/ban and POST /api/device/<id>/unban
    • Visual ban indicators in device list (red background, BANNED badge)
    • Ban/Unban buttons in device table (context-sensitive)
    • Detailed ban information in device details modal
    • "Banned" statistics card in dashboard
    • Confirmation dialogs for ban operations with reason input
    • Disabled connect button for banned devices
    • Ban reason validation (max 500 characters)

Changed

  • Device table now visually highlights banned devices with red tint
  • Statistics endpoint now includes banned count
  • Device details modal shows comprehensive ban information when applicable
  • Connect functionality disabled for banned devices

Security

  • Ban operations require explicit confirmation
  • Ban reason required for accountability
  • All ban actions tracked with timestamp and administrator info

[1.0.1] - 2026-01-05

Added

  • Soft Delete System: Devices are now marked as deleted instead of being permanently removed
    • Added is_deleted, deleted_at, and updated_at columns to database
    • Devices can potentially be restored in future versions
    • Database migration script (migrations/v1.0.1_soft_delete.py)
  • Input Validation: Comprehensive validation for all user inputs
    • Device ID format validation (alphanumeric, underscores, hyphens only)
    • Maximum lengths enforced (50 chars for IDs, 500 chars for notes)
    • XSS protection with input sanitization
  • Enhanced User Feedback:
    • Explicit confirmation dialogs for delete operations
    • Warning dialogs when changing device IDs
    • Detailed error messages for validation failures
    • Better error handling with specific HTTP status codes
  • Security Improvements:
    • SQL injection protection through parameterized queries
    • Check for duplicate device IDs before updates
    • Database constraint violation handling

Changed

  • Delete operations now perform soft delete (UPDATE) instead of hard delete (DELETE)
  • All SELECT queries now filter out deleted devices (is_deleted = 0)
  • UPDATE queries now include updated_at timestamp
  • Error messages are more informative and user-friendly

Fixed

  • Unstable device deletion: Now uses safe soft delete mechanism
  • Device ID change issues: Added explicit warnings and validation
  • Missing error feedback: Users now see detailed error messages
  • Potential data loss: Deleted devices preserved in database

1.0.0 - 2026-01-05

Added

  • Enhanced RustDesk HBBS server with HTTP REST API
  • Real-time device status monitoring using authentic RustDesk algorithm
  • Modern web management console with glassmorphism UI
  • Material Icons integration (fully offline)
  • Device management features (CRUD operations)
  • Dashboard with real-time statistics
  • Search and filter functionality
  • Device notes and labeling system
  • Public key display and quick copy
  • Automatic installation script with backup support
  • Systemd service integration for auto-restart
  • CORS support for web console integration
  • Thread-safe PeerMap sharing (Arc)
  • RESTful API with JSON responses
  • Comprehensive documentation
  • Demo mode with mock data for screenshots

Changed

  • Modified HBBS to use Arc for thread safety
  • Replaced FontAwesome with Google Material Icons
  • Improved status detection (memory-based, not database)
  • Enhanced UI with animations and modern design
  • Updated peer.rs for immutable reference compatibility

Technical Details

  • HBBS API Port: 21114 (default)
  • Web Console Port: 5000 (default)
  • Status Timeout: 30 seconds (matches RustDesk client)
  • Status Detection: In-memory PeerMap lookup
  • Architecture: Shared state between HBBS and API server

Security

  • Automatic backup creation during installation
  • Service isolation with systemd
  • Graceful degradation if API unavailable
  • No external dependencies (offline-ready)

Performance

  • Zero database queries for status checks
  • In-memory lookups (microsecond response time)
  • Async/await throughout for maximum efficiency
  • Minimal resource overhead

Compatibility

  • RustDesk HBBS 1.1.9+
  • Ubuntu 20.04+, Debian 11+, CentOS 8+
  • Python 3.8+
  • Rust 1.70+

Known Limitations

  • Device ID modification may cause access issues (use Note field for naming)
  • Device deletion functionality is unstable
  • No authentication system (internal networks only)

[Unreleased]

Planned for 1.0.1 (Bug Fixes)

  • Fix device deletion functionality
  • Improve device ID change handling
  • Add confirmation dialogs for destructive operations
  • Better error messages

Planned for 1.1.0

  • Multi-language support (i18n)
  • User authentication system
  • Role-based access control
  • Connection history logs
  • Performance metrics dashboard

Planned for 1.2.0

  • WebSocket for real-time updates
  • Device grouping and tagging
  • Email/Slack notifications
  • REST API authentication (JWT)
  • Mobile responsive improvements

Planned for 2.0.0

  • Multi-server support
  • High availability setup
  • Advanced analytics
  • Custom themes
  • Plugin system