mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6393] [MERGED] feat(release): publish SHA-256 sums and verify them in install.sh/update.sh #6248
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6248
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6393
Author: @rokokol
Created: 9/2/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @MHSanaei
Base:
main← Head:feat/release-checksums📝 Commits (4)
5430309feat(release): publish SHA-256 sums and verify them in install.sh/update.sh0d568b0fix(install): fail closed when the checksum sidecar cannot be fetchedb849deaMerge branch 'main' into feat/release-checksumsec1f4c4fix(install): restore the closing brace lost in the main merge📊 Changes
3 files changed (+68 additions, -8 deletions)
View changed files
📝
.github/workflows/release.yml(+16 -8)📝
install.sh(+30 -0)📝
update.sh(+22 -0)📄 Description
Summary
Publish
<asset>.sha256next to every release archive (Linux tarballs and the Windows zip, including the rollingdev-latestrelease) and verify it ininstall.shandupdate.shbefore extracting.Why
The installer and updater fetched the release archive and extracted it after checking only that the file is not empty (
[[ -s ... ]]), and the release workflow published no checksums. A truncated download, a corrupted or swapped asset or a bad mirror was extracted and installed as root. #5396 added the same verification for the Xray-core archive the panel downloads; the panel's own archive was the remaining unverified download.Scope of the guarantee, stated plainly: the sidecar comes from the same host over the same channel as the archive, so this catches corruption, truncation and a bad mirror; it does not defend against a party that controls the release or the TLS channel, which needs an out-of-band trust anchor (signed releases) and is out of scope here.
Scope
release.yml: the LinuxPackagestep writessha256sumoutput tox-ui-linux-<platform>.tar.gz.sha256; the Windows step writes the same format viaGet-FileHash. Both files go to the artifacts and to the release (file_glob: true), and thepublish-devjob uploadsdev-artifacts/*.sha256too.install.sh:verify_release_checksum()downloads${url}.sha256, compares it withsha256sumof the archive, deletes the archive and exits on mismatch. Only an HTTP 404 for the sidecar (every release before this change, includinglegacy_versioninstalls) is tolerated with a warning; any other failure to fetch it (5xx, connection reset, DNS) aborts and removes the archive, so a party that can swap the asset cannot skip the check by dropping the sidecar request. (Maintainer note: happy to fail closed on 404 as well for tags newer than the first release that ships a sidecar, if you prefer.)update.sh: same logic inline, using_failon mismatch or fetch failure.Type of change
Areas affected
How was this tested?
verify_release_checksum()exercised against a local HTTP server with a random archive: matching sidecar passes ("Checksum verified"), 404 sidecar warns and continues, unreachable sidecar host aborts (HTTP 000) and removes the download, tampered archive fails with the expected/actual hashes and removes the download.bash -non both scripts;shellcheck -S warningwarning counts unchanged againstmain(38 / 39);release.ymlparses as YAML.sha256sum/Get-FileHashlines and thefile_globoption ofsvenstaro/upload-release-actionare the documented forms.Screenshots / recordings
N/A
Breaking changes
None. Releases without a
.sha256sidecar install as before, with a warning.Checklist
go build ./...and the test suite pass locally. (no Go changes)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.