Fix RustDesk deep link to include self-hosted server

- 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 <noreply@anthropic.com>
This commit is contained in:
rever-tecnologia 2025-12-05 16:10:30 -03:00
parent 90d2221240
commit bfcec46328

View file

@ -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 {