feat: Support custom network endpoints for desktop pairing #2086
main fromrefs/pull/2086/head·opened View on GitHubWhat Changed#
Adds a small, scoped fix for multi-NIC setups in Settings → Manage local backend → Network access:
- Added an optional Custom hostname or URL input when network access is enabled.
- The input overrides the endpoint used for:
- the “Reachable at …” text
- generated/copyable pairing links
- Kept behavior unchanged when no override is provided.
- Added focused parsing/validation logic in a shared helper:
apps/web/src/components/settings/networkEndpointOverride.ts
- Added unit tests for override behavior and validation:
apps/web/src/components/settings/networkEndpointOverride.test.ts
- Added browser test coverage for the new UI flow:
apps/web/src/components/settings/SettingsPanels.browser.tsx
Why#
On hosts with multiple interfaces/IPs (for example VPN/WireGuard + LAN), the auto-selected reachable address can be wrong for the user’s target device. That makes the displayed “Reachable at” value and copied pairing URL require manual edits.
This change provides a minimal, user-controlled override without changing backend exposure behavior or introducing persistent settings complexity.
UI Changes#
Before:
- “Reachable at …” always used the auto-detected endpoint.
- Copying a pairing link used that same endpoint, even when it was not the desired NIC/IP.
After:
- A new optional Custom hostname or URL field appears under Network access (when enabled).
Screenshot:
- Entering a value updates the displayed “Reachable at …” and copied pairing links for that app session.
Screenshot:
- Invalid values show an inline validation error.
Screenshot:
Checklist#
- This PR is small and focused
- I explained what changed and why
- I included before/after screenshots for any UI changes
- [n/a ] I included a video for animation/interaction changes
Fixes issue #2031
Note
Low Risk Low risk: scoped UI-only change that rewrites the displayed/copy pairing endpoint via small parsing logic, with fallback + validation and added tests.
Overview
Adds an optional Custom hostname or URL override in ConnectionsSettings (shown only when desktop network access is enabled) to replace the auto-detected endpoint used in the “Reachable at …” label and in generated/copied pairing links.
Introduces resolveDesktopNetworkEndpointUrl to parse/validate host or full-URL overrides (with inline error + fallback to the default endpoint), and adds unit + browser tests to cover the override and copy-to-clipboard behavior.
Note
Add custom network endpoint override for desktop pairing links#
- Adds a "Custom hostname or URL" input in ConnectionsSettings (visible when the desktop server is network-accessible) that overrides the displayed reachable URL and the endpoint used in copied pairing links.
- Introduces
resolveDesktopNetworkEndpointUrlto parse and validate the user-provided hostname or URL, returning an effective endpoint, a normalization flag, and an inline validation error when the input is invalid. - Invalid overrides surface an error in the settings row and fall back to the default endpoint URL.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
Approvability#
Verdict: Needs human review
This PR introduces a new user-facing feature allowing custom hostname/URL override for desktop pairing endpoints. While the implementation is well-tested and self-contained to the settings UI, new feature capabilities warrant human review to verify the intended behavior and UX are appropriate.
You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).3rd commit is me merging main into this because this branch was a bit behind. no merge conflicts.
@juliusmarminge Not to spam but I think this fix is good, let me know
The connection catalog and current pairing endpoint-selection design supersede this custom-endpoint implementation, and its linked issue is closed.
This was closed as part of a large repo-wide maintenance sweep. If you think it's still relevant, please reopen.
juliusmarminge closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
9c241be7-570f-464e-a2f1-57261cf7e41bYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share