Repository navigation
feat: relay encrypted mobile sessions with bounded memory - #2014
Merged
Merged
Conversation
yansfil
marked this pull request as ready for review
November 2, 2026 08:21
yansfil
added a commit
that referenced
this pull request
Nov 2, 2026
Related: #2011 ## Summary 폰이 기본으로 Hide 중계를 통해 연결되고, 설정의 한 연결 줄에서 연결 상태와 다시 시도·업데이트·상한 거부를 확인합니다. QR은 app.withhide.dev를 열며 5분 뒤 만료됩니다. Tailscale 직접 연결은 고급에서 고릅니다. 방법마다 페어링한 폰을 따로 유지하고, 끄기·해제 시 연결을 닫습니다. 폰 내용은 기기와 폰 사이에서 암호화합니다. 기존 Tailscale 설정은 그대로 이어 쓰고 새 설정은 중계로 시작합니다.  실제 Settings 컴포넌트의 격리 갤러리입니다. 연결 줄, QR 만료 안내, 접힌 고급 영역을 확인해 주세요.  이전 Tailscale 연결을 정리할 CLI가 없어도 중계는 연결되고, 같은 한 줄에 정리 실패가 남습니다. ## Review - **판단해 주세요**: 연결 상태와 암호화 설명의 길이, 고급 Tailscale의 발견성. - **조심해서 볼 파일**: `hided/src/mobile/relay.rs`, `phone.rs` - 암호화 경계, 종료 순서, 취소와 큐 상한. - **조심해서 볼 파일**: `mobile/mod.rs`, `phones.rs`, `store.rs` - 키 저장, 방식 전환과 기존 폰 보존, 재연결 후 요청 기록. - **비용 검토**: 연결 1개, 폰 작업 8개, 폰당 수신 8프레임·공유 송신 32프레임; 상태 전환만 발행하며 core 잠금 안에서 네트워크 작업을 하지 않습니다. ## Evidence - **확인한 것**: 실제 hided 중계 통합 6개가 macOS·Linux·Windows에서 암호화·재연결·방법별 폰 보존·해제·끄기·미인증 제한 시간을 확인합니다. - **확인한 것**: 입력 중단 테스트가 연결을 끊고 같은 요청을 재시도할 때 영구 대기에 남지 않음을 확인합니다. - **확인한 것**: Mobile UI 24개, 직접 연결 브라우저 5개와 격리 갤러리의 한글·영문·큰 글씨·dark/light·QR·고급 상태를 확인했습니다. - **확인한 것**: 최신 커밋에서 로컬 lint·Rust 7,357개·web 2,471개·desktop 307개·빌드·디자인 계약과 GitHub CI가 통과했습니다. - **재시도 이력**: 기존 기기 테스트 #430·#439는 최초 실패 후 로컬 단독 1회와 CI 작업 1회 재실행에서 통과했습니다. CI에는 기존 세션 복원 #419의 자동 재시도도 있습니다. - **확인하지 못한 것**: 실제 폰·native 앱·운영 TLS와 실제 PTY 답장 재전송은 통합·배포 검증에 남아 있습니다. <details><summary>Verification record</summary> Head: `d75b9db7d9ef0287392452ad5fc77bfce605f26c`. Base: `b1b25cde4`, including protocol #2011, Memory correction #2020, relay server #2014 and hosted phone #2019. Scope: mobile-relay B1-B10, hided B24, B28; hided transport, Settings Mobile, owning architecture/UI guides. The architecture merge preserves both the hosted phone WASM initiator and the device responder/admission/authentication contract. Cargo.lock and workspace-hack did not change in that merge; their shared feature union was generated at `92620a992` and passes CI. Caller tests use shared admission/routing types and real Noise sessions without implementing a second relay service. The interrupted-input test uses the real phone/Noise path and node permission boundary; it does not claim an actual PTY write. The original socket handler already detached its input task on disconnect, so the original cancellation premise was not reproduced. The follow-up additionally settles from the blocking operation with an Uncertain drop guard; the caller test verifies disconnect/retry lifetime rather than isolating that guard. Independent re-review passed at `5eeb73668`; the additional live-peer and unreaped-task bound at `744506a3e` was reviewed and accepted. The QR screenshot was captured at `e8fa80774`; the cleanup screenshot was captured at `5eeb73668`; the Settings product changes are unchanged since that follow-up. The five direct-mobile browser journeys passed at `6c2a6e338` without weaker assertions or timeouts. The Cursor fixture now explicitly selects Advanced > Use Tailscale before enabling Mobile. Current-head local verification ran on macOS under the shared mission lock: - `bash scripts/verify-cargo.sh lint`: PASS, 1m 10s. - `bash scripts/verify-cargo.sh test-scoped`: core 3,929 passed, 1 failed, 20 ignored; stopped at the existing own_devices assertion in `herdr-core/src/runtime/tests/own_devices.rs:158`. - The only exact-test rerun on the same SHA passed in 0.27s; the initial Kit/GuardrailPolicy assertion failure remains recorded, matching [#430](with-hide/hide-private#430) and [#439](with-hide/hide-private#439). - `bash scripts/verify-cargo.sh test-scoped --workspace --exclude herdr-core` then ran the crates the initial command had not reached: 3,427 passed, 149 ignored. - Combined Rust coverage: 7,357 passed, 169 ignored, including the one separately rerun test; this is a split completion after an initial failure, not an uninterrupted green run. - `bash scripts/verify-web.sh`: PASS; web 2,471 passed / 3 skipped, desktop 307 passed / 4 skipped; type checks, lint and builds passed. - `node scripts/check-design-contract.mjs`: PASS. [GitHub CI run 41456834038](https://github.com/with-hide/hide/actions/runs/41456834038) passed on attempt 2 after exactly one failed-job rerun: - Attempt 1: Rust 7,338 passed / 1 failed / 166 skipped; own_devices #430/#439 failed both automatic attempts. - Attempt 2: Rust 7,339 passed / 166 skipped; own_devices passed on its first attempt in 0.027s. - Attempt 2 also includes one automatic retry of the existing session-restore test [#419](with-hide/hide-private#419); the first failure remains in its job log. - Linux and Windows each passed all six mobile_relay caller tests on attempt 1; Windows job `125315707247` completed successfully. - Linux browser shards and Windows E2E passed on attempt 1 without flaky results. - Cursor phone passed in shard 6 (`125317575438`, 6.6s); the reopened-tab test tracked by #418 passed in shard 4 (`125317575230`, 3.3s), both on their first attempt. - macOS desktop, protocol and packaging lanes passed; macOS hided mobile evidence is the local run above. Real phone/native-app interaction, production TLS and actual PTY replay remain outside this PR's verified evidence. </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #2011
Summary
hide-relay서버를 추가합니다.Review
hide-relay/src/state.rs,server.rs- 수신자 상한, 연결 소유권, 종료 사유 전달과 정리 경로.X-Real-IP를 덮어써야 합니다. IPv6는 /64 단위로 제한합니다.Evidence
Verification record
ecd7a43825e152b9a9da8f7147cbba95e9805ccdmain; protocol feat: share encrypted mobile relay messages across native and web #2011 merged, then main merged into this branch without rewriting history.d58982d7d: Linux/Windows/macOS relay CI passed; opt-in capacity test passed with 512 connections, 128 rooms, 384 encrypted sessions and 72 MiB exchanged in 95.36 seconds. This is functional capacity evidence, not a throughput guarantee for the current head.shversuscat).