Files
CodeNomad/packages/ui/src/lib/i18n/messages/es/remoteAccess.ts
VooDisss f3c54df283 fix(server): show sane remote URLs for 0.0.0.0 binds (#262)
Closes #261

## Summary

- improve startup remote URL selection when the server binds to
`0.0.0.0`
- print additional reachable remote URLs instead of advertising only the
first external address
- add targeted tests for address ordering and advertisability behavior

## Problem

When CodeNomad was started with `--host 0.0.0.0`, the CLI chose the
first external IPv4 address it discovered and displayed only that one as
the remote URL.

On Windows machines with WSL, Hyper-V, Docker, or other virtual
adapters, that often surfaced a virtual `172.x.x.x` address even though
a more useful LAN address such as `192.168.x.x` was also reachable and
usable from other devices.

That made remote access look broken or confusing even though the server
itself was accessible.

## What changed

- reuse the resolved network-address list for both:
  - primary remote URL selection
  - startup logging of additional reachable URLs
- choose the primary remote URL from the **advertisable** external
addresses instead of any external address
- print `Other Accessible URLs` when multiple useful remote URLs are
available
- avoid hard-coding a preference like `192.168 > 10 > 172`
- suppress link-local `169.254.*` addresses from user-facing advertised
URLs
- add tests covering:
  - stable ordering across RFC1918 address ranges
  - link-local addresses being non-advertisable
  - link-local-first discovery not stealing the primary LAN URL

## Why this approach

This keeps address derivation in the network-address resolver layer and
limits `index.ts` to startup wiring and presentation.

It also fixes the misleading terminal output without redesigning binding
behavior, TLS behavior, or the server API contract.

## Validation

- `npm run typecheck --workspace @neuralnomads/codenomad`
- `npx tsx --test
'.\\src\\server\\__tests__\\network-addresses.test.ts'`

## Notes

- this change is intentionally focused on selection and presentation of
reachable addresses
- it does not attempt a broader virtual-adapter classification policy
beyond suppressing clearly low-value link-local addresses in user-facing
output

---------

Co-authored-by: Shantur Rathore <i@shantur.com>
2026-04-01 22:12:28 +01:00

54 lines
3.7 KiB
TypeScript

export const remoteAccessMessages = {
"remoteAccess.eyebrow": "Transferencia remota",
"remoteAccess.title": "Conectar a CodeNomad de forma remota",
"remoteAccess.subtitle": "Usa las direcciones de abajo para abrir CodeNomad desde otro dispositivo.",
"remoteAccess.close": "Cerrar acceso remoto",
"remoteAccess.refresh": "Actualizar",
"remoteAccess.sections.listeningMode.label": "Modo de escucha",
"remoteAccess.sections.listeningMode.help": "Permite o limita las transferencias remotas vinculando a todas las interfaces o solo a localhost.",
"remoteAccess.toggle.on": "Activado",
"remoteAccess.toggle.off": "Desactivado",
"remoteAccess.toggle.title": "Permitir conexiones desde otras IP",
"remoteAccess.toggle.caption.all": "Vinculado a 0.0.0.0",
"remoteAccess.toggle.caption.local": "Vinculado a 127.0.0.1",
"remoteAccess.toggle.note": "Cambiar esto requiere reiniciar y detiene temporalmente todas las instancias activas. Comparte las direcciones de abajo una vez que el servidor se reinicie.",
"remoteAccess.listeningMode.restartConfirm.message": "¿Reiniciar para aplicar el modo de escucha? Esto detendrá todas las instancias en ejecución.",
"remoteAccess.listeningMode.restartConfirm.title.all": "Abrir a otros dispositivos",
"remoteAccess.listeningMode.restartConfirm.title.local": "Limitar a este dispositivo",
"remoteAccess.listeningMode.restartConfirm.confirmLabel": "Reiniciar ahora",
"remoteAccess.listeningMode.restartConfirm.cancelLabel": "Cancelar",
"remoteAccess.restart.errorManual": "No se pudo reiniciar automáticamente. Reinicia la app para aplicar el cambio.",
"remoteAccess.sections.serverPassword.label": "Contraseña del servidor",
"remoteAccess.sections.serverPassword.help": "Las transferencias remotas requieren una contraseña. Define una fácil de recordar para habilitar inicios de sesión desde otros dispositivos.",
"remoteAccess.authStatus.unavailable": "Estado de autenticación no disponible.",
"remoteAccess.username": "Usuario: {username}",
"remoteAccess.password.status.set": "Hay una contraseña configurada para el acceso remoto.",
"remoteAccess.password.status.unset": "Aún no hay una contraseña fácil de recordar. Configura una para permitir inicios de sesión por transferencia remota.",
"remoteAccess.password.actions.cancel": "Cancelar",
"remoteAccess.password.actions.change": "Cambiar contraseña",
"remoteAccess.password.actions.set": "Configurar contraseña",
"remoteAccess.password.form.newPassword": "Nueva contraseña",
"remoteAccess.password.form.confirmPassword": "Confirmar contraseña",
"remoteAccess.password.form.placeholder": "Al menos 8 caracteres",
"remoteAccess.password.error.tooShort": "La contraseña debe tener al menos 8 caracteres.",
"remoteAccess.password.error.mismatch": "Las contraseñas no coinciden.",
"remoteAccess.password.save.saving": "Guardando…",
"remoteAccess.password.save.label": "Guardar contraseña",
"remoteAccess.sections.addresses.label": "Direcciones accesibles",
"remoteAccess.sections.addresses.help": "Abre o escanea desde otra máquina para transferir el control.",
"remoteAccess.addresses.loading": "Cargando direcciones…",
"remoteAccess.addresses.none": "Aún no hay direcciones disponibles.",
"remoteAccess.addresses.actions.showOther": "Mostrar {count} direcciones más",
"remoteAccess.addresses.actions.hideOther": "Ocultar otras direcciones",
"remoteAccess.address.scope.network": "Red",
"remoteAccess.address.scope.loopback": "Loopback",
"remoteAccess.address.scope.internal": "Interna",
"remoteAccess.address.open": "Abrir",
"remoteAccess.address.showQr": "Mostrar QR",
"remoteAccess.address.hideQr": "Ocultar QR",
"remoteAccess.address.qrAlt": "QR para {url}",
} as const