18 Commits

Author SHA1 Message Date
UNITRONIX 26038176eb feat(desktop): add native BetterDesk Desktop core and release path
Introduce the independent Rust + Flutter desktop client with CDAP/RustDesk
session support, packaging via build.py, and tag-triggered Windows/Linux
release artifacts. Align server CDAP desktop interop (view_only, desktop_end,
capabilities), protocol docs, pre-release checklist, version bump rules, and
WAN allowlist for /api/health and /api/server/pubkey.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow)
2026-08-20 11:08:29 +02:00
UNITRONIX 34ef01e17d fix(security): harden TLS defaults, device auth, and update privileges
Require stricter client/server TLS options, centralize device auth on agent APIs, constrain Linux privileged update helpers, and harden filebrowser path checks with supporting audit notes.

Thanks: INSOLVE (Honorary); Marco Jakobs (@jacotec); MyNameisStitch (@MyNameisStitch); Redspin (@playerumpknow)
2026-08-15 23:28:03 +02:00
UNITRONIX f7b587eb42 feat(auth): enhance device authentication and relay handling
- Added tests to ensure disabled devices cannot authenticate using device tokens.
- Updated authentication logic to reject disabled devices, banned devices, and soft-deleted devices during relay requests.
- Implemented server public key pinning for enhanced security in API HTTP client.
- Introduced normalization for server certificate pins to ensure valid formats.
- Enhanced branding profile validation to check for valid certificate pins.
2026-08-06 00:54:47 +02:00
UNITRONIX ed96e94806 refactor(agent): enhance session management and input handling
- Updated session control mechanisms to ensure proper handling of remote input and clipboard operations.
- Introduced session authorization checks to validate operator permissions before starting desktop sessions.
- Improved input injection logic to prevent unauthorized access during active sessions.
- Added new capabilities for managing session flags and controls, ensuring a more robust and secure desktop experience.
- Enhanced error handling and logging for better traceability of session-related actions.
2026-08-06 00:50:02 +02:00
UNITRONIX 1b240543bd feat(auth): implement SQLite auth consolidation and admin password validation
- Added functionality for safely consolidating legacy auth.db into the selected SQLite database, with options for dry runs and rollbacks.
- Introduced command-line flags for SQLite auth consolidation, including backup directory and rollback options.
- Enhanced admin interface security by requiring a password when the admin port is enabled, preventing unauthorized access.
- Updated related tests to ensure proper handling of admin password requirements and relay authorization logic.
2026-08-05 23:49:42 +02:00
UNITRONIX 992ba235f7 feat: enhance Support Agent capabilities and documentation
- Added support for various remote control features in the Support Agent, including file transfer, in-session chat, remote audio, and control actions (lock/restart).
- Introduced capability flags for incoming session features, allowing for more granular control over permissions.
- Updated documentation to reflect the new Support Agent functionalities and connection resilience improvements, including fallback mechanisms for API endpoints.
- Enhanced the build process with optional branding sealing and improved error handling for Docker configurations.
2026-08-03 06:47:22 +02:00
UNITRONIX 52248b81bb Improve Go server stability without changing RustDesk wire protocol.
Batch peer status writes, skip heartbeat rate limits for known peers, CDAP session cleanup on disconnect, relay WS conn limits, Postgres query timeouts, org login throttling, and CI with go test -race.
2026-06-14 11:38:36 +02:00
UNITRONIX 045dadd0b4 feat: add email notification system and SMTP configuration
- Introduced email notifications for help requests, allowing operators assigned to device folders or groups to receive alerts.
- Moved SMTP configuration to **Settings → Email**, including options for host, credentials, and alert email.
- Updated console layout for better usability and removed legacy SMTP automation tab.
- Added `nodemailer` as a dependency for email handling.
2026-06-14 09:04:04 +02:00
UNITRONIX 09d20c3444 feat(consent): streamline remote consent handling for terminal and desktop sessions
Refactored the consent handling logic for both terminal and desktop sessions to utilize a unified requestRemoteConsent method. This change simplifies the consent process, ensuring consistent behavior across different session types. Additionally, introduced default session ID handling and improved logging for consent status. Updated related payload structures to include operator names for better tracking.
2026-06-07 12:03:49 +02:00
UNITRONIX 1320457e56 feat(build): enhance agent build process and add server library support
Updated the build scripts to include the server library in the agent build process. Introduced new environment variables for Go module and build caches to improve build efficiency. Enhanced the generator route to support multiple languages and added locale labels for better user experience. Updated the generator view to dynamically populate language options based on supported languages.
2026-06-07 10:38:24 +02:00
UNITRONIX dc6b6c088e feat(centralization): move help/chat to Go server and harden agent TLS
Phases 1-4 of the Go-server centralization plan plus optional-TLS transport.

Go server:
- db: HelpRequest model + SQLite/PostgreSQL stores (help_requests_*.go), GetDeviceOrgID.
- cdap: handleHelpRequest/handleChatMessage handlers, SendChatToDevice delivery.
- api: REST help endpoints (help_handlers.go), publish help_request/chat_message events.

Node.js panel:
- bd-api.routes.js: drop local in-memory Maps, proxy all help/chat/notification
  endpoints to the Go server (read-proxy) with status/id/timestamp normalization.

Agent (native Go + Tauri sidecar):
- config.go/agent.go: optional EnforceTLS, ServerCertPin (SPKI pin), TLSInsecureSkipVerify
  with env overlays and dialOptions() cert pinning via VerifyPeerCertificate.
- HTTP (ws://) stays a fully supported transport: TLS enforcement is an explicit
  operator opt-in (never auto-derived from the URL scheme). The agent logs a warning
  recommending wss:// for untrusted networks instead of blocking the connection.
- config.rs/sidecar.rs: propagate enforce_tls + server_cert_pin from AgentConfig
  through SidecarConfig to the Go agent config; warn on plaintext ws:// to remote hosts.

This commit was made possible thanks to Insolve.
2026-06-01 00:51:29 +02:00
UNITRONIX 15bca36787 feat(codec): GPU multi-codec video for CDAP rdclient incl. plain HTTP
Enables hardware-accelerated video for the CDAP/OS-agent rdclient path instead of being stuck on 1-2fps MJPEG, including over plain HTTP (no HTTPS/domain/cert required).

Browser viewers (web-nodejs): cdap-adapter.js and cdap-desktop.js now decode video via the shared RDVideo pipeline. WebCodecs (AV1/VP9/H264, hardware-accelerated) is used in secure contexts (HTTPS/localhost); over plain HTTP, H.264 is decoded through JMuxer/MSE using the browser's native (usually GPU) decoder. Viewers advertise decodableCodecs() in the desktop_start init payload so the agent sends a real GPU stream; MJPEG/WebP remain safe fallbacks. cdap-device.ejs preloads jmuxer + RDVideo.

Go agent (betterdesk-agent): codec.go + codec_framing.go add multi-codec engine with GPU encoder probing and selection order AV1 -> VP9 -> H264 -> WebP; desktop.go intersects the operator-advertised codec list with local encoder ability and emits honest desktop_meta (format + codec_string); config.go adds codec config fields.

Go server (betterdesk-server): cdap_handlers.go + cdap/desktop.go thread the codecs[] / video_codec fields through desktop_start so operator codec advertisement reaches the agent.

Tauri agent-client: config.rs/sidecar.rs/commands.rs codec plumbing, SettingsPanel codec dropdown + en/pl/zh i18n, refreshed agent sidecar binary.

Note: AV1/VP9 still require WebCodecs (HTTPS/localhost); H.264-over-MSE covers the plain-HTTP case. Self-signed HTTPS (installer SSL menu option C) unlocks all codecs. Fully backward compatible.

This commit was made possible thanks to Insolve.
2026-05-31 02:29:53 +02:00
UNITRONIX 8d7e809316 Fix device re-add after normal delete
Normal device deletion should hide the peer from the console, but it should not behave like a revoke. Allow soft-deleted peers to restore themselves on registration while keeping revoked devices blocked through the existing ban/blocklist path.

Refs: #137

Reported-by: @boruto79
2026-05-10 03:41:45 +02:00
UNITRONIX a8d3259d43 feat(server-management): add server management service and terminal proxy
- Implemented server management service providing resource snapshots, file browser, service control, and audit logging.
- Added terminal proxy for WebSocket-backed PTY, allowing browser-based shell access with user authentication and role-based access control.
- Created server management view with tabs for overview, terminal, file management, and services, including UI elements for displaying system metrics and managing files/services.

Co-authored-by: Copilot <copilot@github.com>
2026-05-07 03:09:03 +02:00
UNITRONIX 4eed88673c fix(updates): atomic binary replace + accurate modal status
- deployServerBinary: use rename(2) for atomic replace, fixes ETXTBSY
  when target Go binary is busy (Linux kernel handles inode swap).
  Falls back to copyFileSync on cross-device rename or non-Linux.
  Windows: rename target out of the way first, then move new in.
- settings.js: mark 'server' phase as error when build succeeded but
  deploy failed (was incorrectly marking 'done' from build alone).
- settings.js: completion modal now shows error title, error message
  and pre-formatted stderr when serverDeploy.success === false.
- i18n: added complete_with_errors, modal_done_with_errors_title in
  en/pl.
2026-04-26 01:23:18 +02:00
UNITRONIX 1e2047c033 BetterDesk 3.0.0 Alpha 2026-03-24 00:26:25 +01:00
UNITRONIX 9c3631c1e8 Disable API TLS, escape $ in systemd, fix ports
Prevent breaking RustDesk clients by keeping the API port HTTP-only and removing automatic API TLS: update APITLSEnabled logic (config.go) and remove/add-removal of -tls-api / -force-https from install scripts and service updates (betterdesk.sh, betterdesk.ps1). Fix systemd escaping for admin password and PostgreSQL URL by converting $ → $$ before writing ExecStart/Environment so credentials with $ are preserved. Add MainThread to port diagnostic patterns to avoid false positives for Node.js on newer Linux (betterdesk.sh). Also include minor struct/tag formatting and response key alignment in CDAP Go code and update changelog and copilot instructions. These changes restore client compatibility, harden installer/service writes, and improve diagnostics.
2026-03-21 00:20:53 +01:00
UNITRONIX a957f3fe2a Add CDAP gateway & redesign devices UI
Introduce full CDAP subsystem and devices UI overhaul. Adds a new CDAP WebSocket gateway (cdap/gateway.go) with auth, connection lifecycle, message loop, heartbeat monitor and APIs (cdap/api.go, cdap/auth.go, cdap/handler.go, cdap/manifest.go, cdap/messages.go). Wire CDAP into the server (api/server.go + handlers in api/cdap_handlers.go) exposing REST endpoints for status, device list, info, manifest, state and sending commands. Enhance peer handling: CDAP-connected overlay in peer list/get, device revocation/cascade support in handleDeletePeer (blocklist, connection teardown, events + audit), and new audit action ActionPeerRevoked. Frontend updates include CDAP device page, widgets, commands, styles and services; major devices page UI redesign (responsive folder chips, toolbar, slim table, kebab menu) plus related CSS/JS/views, translations, docs and assets. Overall adds CDAP features, revocation workflow, and a responsive devices UI.
2026-03-20 02:01:48 +01:00