-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: add build checksum to version endpoint #2016
Conversation
Generate unique build checksum using SHA-256 based on: - Build timestamp - Package version - Target architecture - Build profile - Enabled features This helps with build traceability and verification.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to generate the checksum as an additional artifact (.txt file or something) when building the binary. When an user downloads Stratus, then the user can see the checksum of that build in this file and run the checksum if wants to on the binary to validate.
Example: https://github.com/goreleaser/goreleaser/releases/tag/v2.7.0
@@ -76,6 +80,29 @@ fn generate_build_info() { | |||
println!("cargo:rustc-env=BUILD_OPENSSL_VERSION={}", openssl_version.trim()); | |||
println!("cargo:rustc-env=BUILD_GLIBC_VERSION={}", glibc_version.trim()); | |||
|
|||
// Coletar informações disponíveis durante o build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep all comments in english
User description
Generate unique build checksum using SHA-256 based on:
This helps with build traceability and verification.
PR Type
Enhancement
Description
Add build checksum to version endpoint
Generate SHA-256 checksum based on build info
Include checksum in build info JSON output
Update dependencies to include sha2 crate
Changes walkthrough 📝
build.rs
Generate and export build checksum
build.rs
and features
build_info.rs
Add binary checksum to build info
src/infra/build_info.rs
Cargo.toml
Add sha2 crate dependency
Cargo.toml