Restore invoke env and desktop wrapper#133
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR restores a reduced Invoke.env surface for the Xray-core runtime environment keys that libXray callers rely on, reintroduces a Linux/Windows “desktop wrapper” executable into build outputs/artifacts, and updates the invoke APIs around geo counting and ping error responses to better preserve intended data.
Changes:
- Narrow
Invoke.envsupport to the runtime keysxray.location.asset,xray.location.cert, andxray.tun.fd, and update documentation/tests accordingly. - Add a
desktop_binwrapper (bin/xray/bin/xray.exe) and include it in Linux/Windows build outputs and GitHub Actions artifacts. - Make
countGeoDatatakedatDirvia payload and preserve ping delay sentinel values on ping failures.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| readme/README.zh_CN.md | Updates Chinese docs for restored Invoke.env scope and desktop wrapper usage. |
| README.md | Updates English docs for restored Invoke.env scope and desktop wrapper usage. |
| invoke.go | Limits applied env keys, switches countGeoData to payload datDir, and preserves ping sentinel delay on error. |
| invoke_test.go | Updates tests for new env model, adds coverage for ping sentinel preservation and datDir payload behavior. |
| invoke_model.go | Shrinks LibXrayEnvJson to runtime keys and adds datDir to CountGeoDataRequest. |
| download_geo/main.go | Updates countGeoData invocation to pass datDir in payload (no env dependency). |
| desktop_bin/run.go | Implements wrapper logic to run runXray via LibXrayInvokeRequest. |
| desktop_bin/main.go | Adds CLI entrypoint for wrapper with signal handling and stop-on-exit behavior. |
| build/app/windows.py | Builds and outputs the Windows wrapper executable alongside the DLL. |
| build/app/linux.py | Builds and outputs the Linux wrapper executable alongside the SO. |
| build/app/build.py | Adds build_desktop_bin() helper to compile the wrapper into bin/. |
| .github/workflows/build.yml | Packages bin/xray / bin/xray.exe into Linux/Windows artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Invoke.envfor the Xray-core process env keys used by libXray callers: asset location, cert location, and TUN fd.LibXrayInvokeRequestfile withmethod=runXray.Validation
go test ./... -count=1python3 build/main.py apple go localpython3 build/main.py android localpython3 build/main.py linux localgit diff --check