From bfcec46328012e86cb3afe3ab7ed18594061d68c Mon Sep 17 00:00:00 2001 From: rever-tecnologia Date: Fri, 5 Dec 2025 16:10:30 -0300 Subject: [PATCH] Fix RustDesk deep link to include self-hosted server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add RUSTDESK_SERVER and RUSTDESK_SERVER_KEY constants - Update buildRustDeskUri to use ID@SERVER format - Include server key in URI for proper server identification - This allows 1-click connection without client pre-configuration đŸ¤– Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../admin/devices/admin-devices-overview.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/admin/devices/admin-devices-overview.tsx b/src/components/admin/devices/admin-devices-overview.tsx index 58dcbff..294ca03 100644 --- a/src/components/admin/devices/admin-devices-overview.tsx +++ b/src/components/admin/devices/admin-devices-overview.tsx @@ -491,17 +491,23 @@ export function isRustDeskAccess(entry: DeviceRemoteAccessEntry | null | undefin return url.includes("rustdesk") } +// Configuracao do servidor RustDesk self-hosted +const RUSTDESK_SERVER = "rust.rever.com.br" +const RUSTDESK_SERVER_KEY = "0mxocQKmK6GvTZQYKgjrG9tlNkKOqf81gKgqwAmnZuI=" + export function buildRustDeskUri(entry: DeviceRemoteAccessEntry) { const identifier = (entry.identifier ?? "").replace(/\s+/g, "") if (!identifier) return null const params = new URLSearchParams() + // key = chave publica do servidor RustDesk (para identificar o servidor) + params.set("key", RUSTDESK_SERVER_KEY) if (entry.password) { - // RustDesk aceita "key=" como parĂ¢metro oficial; mantemos "password" por compatibilidade. - params.set("key", entry.password) + // password = senha permanente do dispositivo params.set("password", entry.password) } const query = params.toString() - return `rustdesk://${encodeURIComponent(identifier)}${query ? `?${query}` : ""}` + // Formato: rustdesk://ID@SERVER?key=SERVER_KEY&password=DEVICE_PASSWORD + return `rustdesk://${encodeURIComponent(identifier)}@${RUSTDESK_SERVER}${query ? `?${query}` : ""}` } function parseWindowsInstallDate(value: unknown): Date | null {