-
-
Notifications
You must be signed in to change notification settings - Fork 175
feat(remote-connect): add bounded QR pairing #1014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
qiin2333
wants to merge
16
commits into
master
Choose a base branch
from
feat/vplus-easytier-pairing
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1fd2777
feat(remote): add EasyTier QR pairing flow
qiin2333 c63e036
refactor(remote): isolate connection services
qiin2333 d86042f
fix(remote-connect): bound EasyTier network access
qiin2333 07f93c9
fix(remote-connect): rollback failed credential rotation
qiin2333 2f456e0
refactor(remote-connect): split HTTP and pairing layers
qiin2333 7e468d7
fix(remote-connect): snapshot pairing state atomically
qiin2333 dc9ae22
fix(tests): include Boost format dependency
qiin2333 b78469a
fix(tests): isolate remote connect stubs
qiin2333 76647a0
fix(remote-connect): avoid redistributing EasyTier runtime
qiin2333 73992f7
fix(remote-connect): stop only owned process tree
qiin2333 1eea977
fix(packaging): scope process cleanup by install path
qiin2333 4b54621
fix(remote-connect): link official install guide
qiin2333 f3aa162
refactor(remote-connect): separate integration concerns
qiin2333 84f343a
fix(remote-connect): serialize UI transitions
qiin2333 cdadaed
fix(packaging): preserve updater during process cleanup
qiin2333 a943225
fix(webui): serialize remote pairing controls
qiin2333 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| # FetchEasyTier.cmake — download the pinned EasyTier host runtime. | ||
| # | ||
| # The archive is fetched from the official EasyTier release, verified before | ||
| # extraction, and installed as a private Sunshine runtime under tools/easytier. | ||
|
|
||
| include_guard(GLOBAL) | ||
|
|
||
| if(NOT WIN32) | ||
| return() | ||
| endif() | ||
|
|
||
| option(FETCH_EASYTIER "Download the EasyTier runtime used by Remote Connect" ON) | ||
| option(EASYTIER_REQUIRED "Treat a missing EasyTier runtime as a configuration error" ON) | ||
| set(EASYTIER_VERSION "v2.6.4") | ||
| set(EASYTIER_CACHE_DIR "${CMAKE_BINARY_DIR}/_easytier" CACHE PATH "EasyTier runtime cache") | ||
|
|
||
| if(CMAKE_GENERATOR_PLATFORM MATCHES "^[Aa][Rr][Mm]64$" OR | ||
| CMAKE_SYSTEM_PROCESSOR MATCHES "^(ARM64|arm64|aarch64)$") | ||
| set(_EASYTIER_ARCH "arm64") | ||
| set(_EASYTIER_SHA256 "37023f8a3451c9234b17ee2089a03dc344ce90d803b5b359cb6c46682b0549b4") | ||
| elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) | ||
| set(_EASYTIER_ARCH "i686") | ||
| set(_EASYTIER_SHA256 "bf557daeccc5525d95b8a230c339d75554fb52d82d1e050e9a5202c92c02e09e") | ||
| else() | ||
| set(_EASYTIER_ARCH "x86_64") | ||
| set(_EASYTIER_SHA256 "27af91e270e554709b048bd32327fefd2dfce5062ae1e8701af7550c6f525f84") | ||
| endif() | ||
|
|
||
| set(_EASYTIER_BASENAME "easytier-windows-${_EASYTIER_ARCH}-${EASYTIER_VERSION}") | ||
| set(_EASYTIER_ARCHIVE "${EASYTIER_CACHE_DIR}/${_EASYTIER_BASENAME}.zip") | ||
| set(EASYTIER_RUNTIME_DIR "${EASYTIER_CACHE_DIR}/easytier-windows-${_EASYTIER_ARCH}" | ||
| CACHE PATH "Extracted EasyTier runtime directory" FORCE) | ||
| set(EASYTIER_LICENSE "${EASYTIER_CACHE_DIR}/LICENSE-EasyTier.txt" | ||
| CACHE FILEPATH "EasyTier license file" FORCE) | ||
|
|
||
| function(_easytier_download url output expected_sha256) | ||
| if(EXISTS "${output}") | ||
| file(SHA256 "${output}" _cached_sha256) | ||
| if(_cached_sha256 STREQUAL expected_sha256) | ||
| return() | ||
| endif() | ||
| message(WARNING "Cached EasyTier artifact failed verification; downloading it again") | ||
| file(REMOVE "${output}") | ||
| endif() | ||
|
|
||
| get_filename_component(_output_dir "${output}" DIRECTORY) | ||
| file(MAKE_DIRECTORY "${_output_dir}") | ||
| message(STATUS "Downloading pinned EasyTier artifact: ${url}") | ||
| find_program(_EASYTIER_CURL curl) | ||
| if(_EASYTIER_CURL) | ||
| execute_process( | ||
| COMMAND "${_EASYTIER_CURL}" -fsSL --retry 3 -o "${output}" "${url}" | ||
| RESULT_VARIABLE _code | ||
| ERROR_VARIABLE _message) | ||
| else() | ||
| file(DOWNLOAD "${url}" "${output}" STATUS _status TLS_VERIFY ON) | ||
| list(GET _status 0 _code) | ||
| list(GET _status 1 _message) | ||
| endif() | ||
| if(NOT _code EQUAL 0) | ||
| file(REMOVE "${output}") | ||
| message(WARNING "EasyTier download failed (${_code}): ${_message}") | ||
| return() | ||
| endif() | ||
|
|
||
| file(SHA256 "${output}" _actual_sha256) | ||
| if(NOT _actual_sha256 STREQUAL expected_sha256) | ||
| file(REMOVE "${output}") | ||
| message(WARNING | ||
| "EasyTier artifact SHA-256 mismatch\n" | ||
| "expected: ${expected_sha256}\n" | ||
| "actual: ${_actual_sha256}") | ||
| endif() | ||
| endfunction() | ||
|
|
||
| set(_EASYTIER_REQUIRED_FILES | ||
| easytier-core.exe | ||
| Packet.dll | ||
| WinDivert64.sys | ||
| wintun.dll) | ||
|
|
||
| if(FETCH_EASYTIER) | ||
| _easytier_download( | ||
| "https://github.com/EasyTier/EasyTier/releases/download/${EASYTIER_VERSION}/${_EASYTIER_BASENAME}.zip" | ||
| "${_EASYTIER_ARCHIVE}" | ||
| "${_EASYTIER_SHA256}") | ||
| _easytier_download( | ||
| "https://raw.githubusercontent.com/EasyTier/EasyTier/${EASYTIER_VERSION}/LICENSE" | ||
| "${EASYTIER_LICENSE}" | ||
| "e3a994d82e644b03a792a930f574002658412f62407f5fee083f2555c5f23118") | ||
|
|
||
| if(EXISTS "${_EASYTIER_ARCHIVE}") | ||
| # Always derive the packaged runtime from the verified archive. Otherwise a | ||
| # tampered stale extraction could have its digest compiled into Sunshine. | ||
| file(REMOVE_RECURSE "${EASYTIER_RUNTIME_DIR}") | ||
| file(ARCHIVE_EXTRACT INPUT "${_EASYTIER_ARCHIVE}" DESTINATION "${EASYTIER_CACHE_DIR}") | ||
| endif() | ||
| endif() | ||
|
|
||
| set(EASYTIER_AVAILABLE TRUE) | ||
| foreach(_file IN LISTS _EASYTIER_REQUIRED_FILES) | ||
| if(NOT EXISTS "${EASYTIER_RUNTIME_DIR}/${_file}") | ||
| set(EASYTIER_AVAILABLE FALSE) | ||
| endif() | ||
| endforeach() | ||
| if(NOT EXISTS "${EASYTIER_LICENSE}") | ||
| set(EASYTIER_AVAILABLE FALSE) | ||
| endif() | ||
|
|
||
| if(NOT EASYTIER_AVAILABLE) | ||
| if(EASYTIER_REQUIRED) | ||
| message(FATAL_ERROR | ||
| "The pinned EasyTier ${EASYTIER_VERSION} runtime is unavailable. " | ||
| "Set FETCH_EASYTIER=ON with network access, or provide the verified runtime in ${EASYTIER_RUNTIME_DIR}.") | ||
| endif() | ||
| message(WARNING "EasyTier is unavailable; Remote Connect will not be included in this package") | ||
| endif() | ||
|
|
||
| set(EASYTIER_AVAILABLE "${EASYTIER_AVAILABLE}" CACHE INTERNAL | ||
| "Whether the verified EasyTier runtime is available" FORCE) | ||
|
|
||
| if(EASYTIER_AVAILABLE AND TARGET sunshine) | ||
| foreach(_component IN ITEMS easytier-core.exe Packet.dll WinDivert64.sys wintun.dll) | ||
| file(SHA256 "${EASYTIER_RUNTIME_DIR}/${_component}" _component_sha256) | ||
| string(MAKE_C_IDENTIFIER "${_component}" _component_id) | ||
| string(TOUPPER "${_component_id}" _component_id) | ||
| target_compile_definitions(sunshine PRIVATE | ||
| "EASYTIER_${_component_id}_SHA256=\"${_component_sha256}\"") | ||
| endforeach() | ||
| endif() |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.