Commit Graph

48 Commits

Author SHA1 Message Date
UNITRONIX fc1ded710e feat(remote): add Guest Access Links for RdClient allowlist shares (Refs #274)
Temporary opaque links give guests a minimal Web Remote UI for selected devices only, without Console inventory or add-any-ID paths. Also fix mesh_share desktop tunnel auth for unauthenticated guests.
2026-07-18 12:27:46 +02:00
UNITRONIX 655e20f512 chore: update dependencies and enhance security measures
- Bumped `vitest` and `vite` versions in both root and agent-client lockfiles.
- Added `web-nodejs` overrides for `@babel/core` and `js-yaml` to address Dependabot alerts.
- Implemented `NewConnLimiterFromInt` for relay per-IP limits in the Go server, removing the deprecated `deepSet` function from the patch-role-scope-i18n script.
- Extended CodeQL coverage to include new query filters and improved npm audit configurations.
2026-07-12 21:36:53 +02:00
UNITRONIX c2aedb10fe Enhance security and input validation across CDAP and organization routes
- Implemented input validation for `orgId` and `deviceId` in CDAP and organization detail routes using `assertSafeApiId`, returning a 400 error for invalid inputs.
- Added HTML escaping for `deviceId` and `orgId` in views to prevent XSS vulnerabilities.
- Hardened `patch-role-scope-i18n.js` against prototype pollution with a guard for unsafe nested keys.
- Updated CodeQL configuration to include new exclusions and ensure documented exclusions are applied.
2026-07-09 21:16:55 +02:00
UNITRONIX 12fcf21203 Fix Linux HTTP/HTTPS toggle reliability (#219).
Stop repair warnings from corrupting systemd User=, unify HTTPS/TLS repair on update/toggle, and patch Go signal ports during panel updates.
2026-07-07 17:25:58 +02:00
UNITRONIX d671c86859 feat: user scope UX, role labels, and device visibility defaults (#227)
Add folder/direct-device/strategy assignment from User Management, clearer Pro vs Remote Operator labeling, optional restricted device scope mode, and Go/Node scope parity.
2026-07-05 19:44:18 +02:00
UNITRONIX 082082779e Fix Linux HTTP/HTTPS toggle stuck state (Fixes #219)
Isolate Go signal on :21116 from panel PORT=5000 in .env, fix LE same-file cp redeploy for console user, add Repair HTTPS/TLS path, and harden post-toggle health checks.
2026-07-03 19:12:49 +02:00
UNITRONIX d0b67352db Fix linux-ensure-console-user.js syntax regression that blocked console startup.
A bash fragment was accidentally left in the LE live-dir resolver, crashing ExecStartPre on every boot. Also infer certbot live path from certificate SAN when env metadata is missing.

Refs #219

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 06:42:02 +02:00
UNITRONIX d05d881df8 Complete Linux HTTP/HTTPS toggle repair for unreadable LE certs.
Auto-redeploy TLS material on update/repair, unify SSL menu C with protocol toggle T, and retry post-toggle health checks so the console user can always read keys under $RUSTDESK_PATH/ssl/.

Refs #219

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 17:52:25 +02:00
UNITRONIX 8579e88be4 Fix split-domain RustDesk client config for dashboard and QR (Fixes #222).
Add PUBLIC_SERVER_ID, PUBLIC_RELAY_SERVER, and PUBLIC_API_URL with Settings UI,
unified endpoint resolution across Dashboard/Keys, and fallbacks via PANEL_PUBLIC_HOST.
2026-06-27 20:45:00 +02:00
UNITRONIX bb2ff08f65 Fix NTP server config not reaching betterdesk-server (Fixes #223).
Wire billing/NTP env from console .env into Go on Linux, Windows, and Docker; add OS NTP fallback and Commercialization settings UI to configure and restart the server.
2026-06-27 20:33:56 +02:00
UNITRONIX fecb680d6d fix(linux): self-bootstrap panel update sudoers during deploy
Whitelist linux-ensure-console-user.js in sudoers, invoke it via passwordless
sudo from the update module, refresh sudoers after privileged server deploy,
and align betterdesk.sh repair paths so systemd unit helpers apply without a
manual root step.
2026-06-26 23:53:06 +02:00
UNITRONIX b787ad9996 fix: rdclient file transfer JS getters and Linux systemd unit updates
Replace invalid prototype getter syntax in local-files.js and mesh-files.js
so the file transfer modal loads in browsers. Panel updates patch
betterdesk-server.service via a passwordless-sudo helper instead of
interactive sudo tee.

Refs #217
2026-06-24 20:19:02 +02:00
UNITRONIX 8c1e73ac0b feat(i18n): enhance localization with new mobile navigation and input modes
Added new localization entries for multiple languages, including mobile navigation labels and input modes (touch, touchpad, keyboard, special keys). This update improves user experience by providing comprehensive support for mobile users and ensuring consistent messaging across various languages.
2026-06-21 00:21:36 +02:00
UNITRONIX cff7176ac1 feat(i18n): add UI and confirmation messages for multiple languages
Enhanced localization files for various languages (ar, cs, da, de, en, es, fi, hi, hu, id, it, ja, ko, nb, nl, pl, pt) by adding new UI elements and confirmation prompts. This update improves user experience by providing consistent messaging across different languages for settings search, connection strategies, and user authentication options.
2026-06-20 23:56:00 +02:00
UNITRONIX 253a126888 chore: remove outdated build workflow and update CI configurations
Deleted the obsolete build workflow for BetterDesk and made adjustments to the CI configurations across multiple workflows. This includes changing permissions from write to read in the release-client and secret-scan workflows, updating the Node.js setup in the web-nodejs CI, and enhancing the rate limiting for RdClient pages. Additionally, improved the handling of return URLs in the auth middleware and added new utility functions for better security and logging.
2026-06-20 18:08:54 +02:00
UNITRONIX f832f6a57b fix(console): bare-metal SQLITE_READONLY_DIRECTORY on Go data dir (#206)
Apply setgid group-write on $RUSTDESK_PATH for the betterdesk console user,
re-sync permissions after the Go server starts, and verify both console data/
and Go data directories.

Fixes #206
2026-06-17 06:52:53 +02:00
UNITRONIX 2e01955f6c feat(rdclient): enhance desktop client with server validation, LAN discovery, and settings management
- Introduced server URL validation via `GET /api/bd/server-info` and `probe_server_url`.
- Added LAN discovery capabilities using UDP and optional mDNS for local network panel detection.
- Implemented a local settings window for managing URL, TLS settings, and user preferences.
- Enhanced dashboard with a unified sidebar and improved scrolling behavior.
- Updated documentation and pre-release checklist to reflect new features and requirements.
2026-06-14 21:12:41 +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 bca4740373 Prepare stable 3.3.0 release: i18n, changelog, VERSION deploy.
Translate Organizations device-groups UI across all locales, consolidate [Unreleased] notes for 3.3.0, and copy VERSION into native console paths (#192).
2026-06-12 06:07:22 +02:00
UNITRONIX aea7b30b29 fix(security): enhance path validation and rate limiting for file access
Updated CodeQL configuration to exclude additional paths for security checks. Introduced a new file access rate limiter to prevent abuse of file download endpoints. Improved path resolution functions to ensure confined access and added validation in body scalar functions to reject non-scalar types. Enhanced error handling in API endpoint validation to prevent invalid inputs.
2026-06-11 18:33:14 +02:00
UNITRONIX c2e0e2e784 fix(security): harden CodeQL findings across console and Go server
Address GitHub code scanning alerts with OIDC SSRF guards, confined path
helpers, safer client routing, branding sanitization, upload rate limits,
and CodeQL config exclusions for dev-only and protocol-intentional hashes.
2026-06-11 06:57:58 +02:00
UNITRONIX 96b8330ee6 fix(i18n): complete update-channel and Docker UI translations for release
Add patch-updates-docker-i18n.js, fix commercialization fallbacks, and consolidate CHANGELOG [Unreleased] so i18n:check passes across all 26 locales before dev→main.
2026-06-09 06:12:13 +02:00
UNITRONIX 65c4e75185 chore(i18n): restore bulk translation toolkit under scripts/dev-i18n
Keep apply-i18n-audit and regional patch data for low-cost locale
maintenance without shipping dev scripts to production consoles.
Add collect-gap-keys to regenerate gap-fill input from i18n-check.
2026-06-09 02:24:29 +02:00
UNITRONIX 7b938d8c7b fix(security): harden path confinement, SSRF, and shell exec
Add shared safePath helper for file browser, i18n, and backup paths;
use validated OIDC discovery URLs; restrict terminal shells and
network monitor HTTP requests. Remove obsolete one-time i18n migration
scripts already merged into lang/*.json.
2026-06-09 02:21:43 +02:00
UNITRONIX 87b0b21b0b fix(update): privileged Go server binary deploy from Linux panel
Hardened installs could not replace betterdesk-server in /opt/rustdesk
from Settings → Updates. Add a validated sudo deploy helper, extend
console update sudoers, and sync privileges before server deploy.

Fixes #183
2026-06-09 01:09:11 +02:00
UNITRONIX f8139432a2 fix(console): update channel UX and Modal.confirm (main hotfix)
Apply channel on select with confirmation, active channel badge,
Modal.confirm instead of nonexistent Modal.open.
2026-06-07 17:07:20 +02:00
UNITRONIX 317365c766 Add dev/main branching, automated versioning, and update channel switcher.
Introduce bump-version.js with CI workflows for patch bumps on dev and
stable releases on main, plus panel and installer UI to choose stable vs
development GitHub update branches.
2026-06-07 16:48:31 +02:00
UNITRONIX edfd493be1 fix(console): avoid EACCES crash when binding HTTPS on port 443 (#173)
Security update H-7 runs the console as User=betterdesk, which cannot bind
ports below 1024 without CAP_NET_BIND_SERVICE. Fall back to high ports at
startup, add the capability to systemd when .env uses :443/:80, and handle
EACCES on listen without an unhandled process crash.
2026-06-07 16:29:49 +02:00
UNITRONIX a6ec256f57 feat(update): implement last update result reporting in settings
Added a new API endpoint to retrieve the last update result, enhancing the user interface by displaying detailed error messages for failed updates. Improved the update completion modal to reflect the status of services and console restarts, ensuring users are informed of any issues. Updated the settings JavaScript to load and display the last update result dynamically, improving overall user experience during updates.
2026-06-07 15:06:48 +02:00
UNITRONIX c8d7b6afd0 feat(update): enhance error reporting and sudoers management during updates
Improved the update process by adding detailed error reporting for failed updates, including specific file and service errors. Implemented a function to manage passwordless sudoers for console service restarts, ensuring smoother updates on Linux systems. Enhanced npm installation error handling to capture and log detailed failure messages.
2026-06-07 14:57:59 +02:00
UNITRONIX 05fb2916ff fix(update): improve console restart handling and permission checks
Enhanced the update process to better manage console restarts by checking for blocked permissions before attempting a restart. Added logic to handle cases where console service user permissions are not verified, ensuring that appropriate messages are logged and the update phase is accurately reflected. Updated the console restart scheduling to occur after the response is sent, improving overall reliability. Additionally, modified the comment handling in the dependency scanning process to ignore requires within comments.
2026-06-07 14:41:27 +02:00
UNITRONIX 01fcdc4aea feat(billing): implement billing and time synchronization module
Added a new billing service and time synchronization functionality to the server. This includes the creation of billing packages, contracts, and sessions, along with necessary database migrations. Updated API endpoints for billing management and integrated billing checks into signal handling. Enhanced configuration options for billing parameters and added localization support for billing-related messages.
2026-06-07 14:35:22 +02:00
UNITRONIX 73e3ae19eb fix(update): use writable Go module cache under console data dir
Point GOMODCACHE and GOCACHE at data/go-cache when auto-rebuilding the
server binary. The betterdesk service user often has HOME=/var/lib/betterdesk
which may not be writable, causing "could not create module cache" on update.
2026-06-07 00:35:02 +02:00
UNITRONIX 900de8f36a fix(console): recover web panel after update user switch (#171)
Sync console file ownership before the dedicated service user starts, add
ExecStartPre permission repair on systemd, and skip in-app restart when
permissions are not verified so the panel does not die with Bad Gateway.
2026-06-06 23:33:57 +02:00
UNITRONIX 9c6490f6ab fix(ci,update): unblock Web Console CI and non-root in-app updates.
Use npm install without a lockfile in CI, treat root-owned installer scripts as non-critical update failures, and skip privileged H-7 hooks when betterdesk already exists without sudo.
2026-06-06 14:46:41 +02:00
UNITRONIX 647a3221f9 Harden console security and wire fixes into the update flow.
Hash RustDesk access tokens at rest (phase 1), add SSRF guards for admin network tools with LAN monitoring support, run dedicated console service user on Linux, and hook post-update verification plus service patching into both betterdesk.sh and the in-app updater.
2026-06-06 14:40:51 +02:00
UNITRONIX e7215f2f9d feat(i18n): add short link functionality and validation messages across multiple languages
- Introduced new localization strings for short download links and their hints in various languages.
- Added validation messages for short link requirements, including character restrictions and length constraints.
- Updated existing download link hints to inform users that old hex links will continue to function after changes to short links.
- Ensured consistency across all language files to enhance user experience and clarity in the interface.
2026-06-06 09:18:48 +02:00
UNITRONIX 8b916488b9 Complete web console i18n audit and refine server attestation.
Sync all 26 locale files to the EN+PL baseline (3432 keys), add OBSIDIAN tier strings, and ship i18n apply/audit tooling. Improve server attestation UX and convert orphaned node:test scripts to Jest so the full test suite passes.
2026-06-06 02:36:57 +02:00
UNITRONIX 207a7467d0 fix(update): preserve operator config and passwords on upgrade (#158)
Merge .env keys instead of replacing files, patch systemd/NSSM in place,
block panel updates when the server cannot be rebuilt, and stop routine
updates from syncing admin passwords from .env into auth.db/PostgreSQL.
2026-06-04 00:13:12 +02:00
UNITRONIX 27c082205f fix(i18n): complete web console translations
Complete the web console locale set so all 26 language files share the EN/PL baseline with no missing keys, extra keys, empty values, or English fallback values.

Keep strict i18n audit behavior and disabled auto-fix flow so incomplete translations are surfaced for manual review instead of being filled with English fallback text.

Validated with the strict web-nodejs i18n audit, JSON parsing for all locale files, placeholder preservation checks, and VS Code diagnostics.

This commit was made possible thanks to Insolve.
2026-05-31 18:46:27 +02:00
UNITRONIX 83f3617f98 fix(update): fix infinite update loop and add GitHub-pull update to ALL-IN-ONE scripts (#154)
updateService.js: distinguish critical vs non-critical failures in SHA tracking. Server binary compile/download failures are non-critical — SHA is saved so the same update is not shown again on restart. update-cli.js: match same logic, non-critical failures don't set exit code 1. betterdesk.sh: new update_from_github() with git clone + tarball fallback, 3-method menu. betterdesk.ps1: new Update-FromGitHub with git clone + ZIP fallback, 3-method menu. betterdesk-docker.sh: new update_docker_from_github() with 2-method menu.

This commit was made possible thanks to Insolve.
2026-05-29 02:28:57 +02:00
UNITRONIX 415b6cf967 feat: add terminal updater and keep Go API HTTP 2026-05-23 00:49:49 +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 95f2beb744 feat: organizations, desktop mode, i18n (ja/ko/ru), security docs, client i18n integration 2026-03-25 20:27:04 +01:00
UNITRONIX d717331041 Save credentials, handle paths, track folders
Multiple updates to improve cross-platform path handling, credential persistence, and folder assignment tracking.

- betterdesk.ps1: Check both console and RustDesk credential locations when backing up; save reset admin password to both console and RustDesk locations, create console data dir if missing, and print info messages.
- web-nodejs/reset-password.js & scripts/reset-password.js: Use platform-aware default DB/data paths (Windows/Linux), consider extra env vars, and default to a data subdirectory when not found.
- web-nodejs/routes/rustdesk-api.routes.js: Await async generateAccessToken calls to ensure tokens are generated before continuing.
- web-nodejs/services/dbAdapter.js: Update assignDeviceToFolder for SQLite and Postgres to maintain a device_folder_assignments table (insert/update or delete as appropriate) and remove assignments when folders are deleted; also fix a Postgres JSONB cast.

These changes unify credential storage, improve Windows support, fix an async bug, and add explicit folder assignment tracking used by getAllFolderAssignments.
2026-03-09 23:30:33 +01:00
UNITRONIX edba7c5da6 Improve password reset, auth logging, and i18n
Rework password reset flow and diagnostics: change reset-password.js argument order (password first, optional username) and update Docker/CLI scripts to call it accordingly; persist DEFAULT_ADMIN_PASSWORD to .env and restart betterdesk-console after resets to avoid overwrites. Add translations for an "invalid_credentials" message across supported locales. Harden reset-password.js with a bcrypt self-test, log hash info, and add additional data directory candidates. Enhance authService with detailed auth/logging (hash type, failures/success), safer admin-hash migration logic (avoid overwriting if admin has logged in), and self-tests when creating/updating admin password hashes to detect/retry corrupted hashes.

Co-Authored-By: MrBrodacz - Design <215021251+MrBrodacz2025@users.noreply.github.com>
Co-Authored-By: boruto79 <176351662+boruto79@users.noreply.github.com>
2026-03-05 00:55:58 +01:00
UNITRONIX aa9424845a Support Postgres, API key sync, and auth migration
Add PostgreSQL support for the web console password reset and install scripts, and improve cross-language auth handling.

Key changes:
- Introduce a unified reset-password.js that supports SQLite and PostgreSQL (reads DB_TYPE / DATABASE_URL) and make shell/PowerShell/Docker helpers prefer it with fallbacks.
- Update betterdesk-server to load an API key from API_KEY or .api_key (key/db dirs) and sync it into the database so Go server and Node console share the same key.
- Adjust docker-compose default command to run the all-in-one mode and point at the bundled DB/key paths.
- Improve dashboard health checks to avoid raw TCP probes in single-binary BetterDesk mode and derive signal/relay status from the API health; allow /api/currentUser to accept POST as well as GET.
- Enhance authService to recognize Go-style PBKDF2 hashes, verify them, auto-migrate verified PBKDF2 hashes to bcrypt, and migrate default admin if needed.

These changes improve interoperability between the Go server and Node console (shared API key and DB modes), add Postgres support for admin tooling, and provide a smooth auth migration path from the Go server's hashing scheme to bcrypt.

Co-Authored-By: MrBrodacz - Design <215021251+MrBrodacz2025@users.noreply.github.com>
2026-03-05 00:21:56 +01:00
UNITRONIX 8d952e4ba1 Add password auth helpers; remove legacy dev scripts
Add a new auth package implementing password hashing/verification (PBKDF2-HMAC-SHA256), a random-string generator, and unit tests. Update .gitignore to catch additional sensitive filenames and to ignore legacy dev scripts, migrations, templates and build artifacts. Remove many legacy/dev helper scripts (dev_modules/, scripts/legacy/, build_windows.sh, migrations/, templates/) and add web-nodejs reset-password scripts and a session secret placeholder. Changes consolidate authentication utilities and clean up old/unused development tooling and noise in the repo.
2026-03-02 07:59:24 +01:00