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 {