-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: P-888 added ws api to return the worker version
- Loading branch information
higherordertech
committed
Jan 10, 2025
1 parent
2139358
commit 24973e2
Showing
15 changed files
with
479 additions
and
166 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
57 changes: 0 additions & 57 deletions
57
tee-worker/bitacross/cli/src/base_cli/commands/worker_version.rs
This file was deleted.
Oops, something went wrong.
This file contains 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,20 @@ | ||
[package] | ||
name = "itc-system-version" | ||
version = "0.1.0" | ||
authors = ['Trust Computing GmbH <[email protected]>', 'Integritee AG <[email protected]>'] | ||
build = 'build.rs' | ||
edition = "2021" | ||
|
||
[dependencies] | ||
# sgx dependencies | ||
sgx_tstd = { workspace = true, optional = true } | ||
|
||
[build-dependencies] | ||
built = { workspace = true, features = ["chrono", "semver"] } | ||
|
||
[features] | ||
default = ["std"] | ||
std = [] | ||
sgx = [ | ||
"sgx_tstd", | ||
] |
This file contains 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 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,65 @@ | ||
// Copyright 2020-2024 Trust Computing GmbH. | ||
// This file is part of Litentry. | ||
// | ||
// Litentry is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Litentry is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Litentry. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
#[cfg(all(feature = "std", feature = "sgx"))] | ||
compile_error!("feature \"std\" and feature \"sgx\" cannot be enabled at the same time"); | ||
|
||
#[cfg(all(not(feature = "std"), feature = "sgx"))] | ||
extern crate sgx_tstd as std; | ||
|
||
use std::{format, println, string::String}; | ||
|
||
mod built_info { | ||
include!(concat!(env!("OUT_DIR"), "/built.rs")); | ||
} | ||
|
||
const DEFAULT_VALUE: &str = "unknown"; | ||
|
||
pub fn print_system_version() { | ||
println!( | ||
r#"Version Information: | ||
------------------ | ||
Target: {} | ||
Rustc version: {} | ||
Git Information: | ||
-------------- | ||
Version: {} | ||
Commit Hash: {} | ||
Build Time: | ||
--------- | ||
{}"#, | ||
built_info::TARGET, | ||
built_info::RUSTC_VERSION, | ||
option_env!("GIT_VERSION").unwrap_or(DEFAULT_VALUE), | ||
option_env!("GIT_COMMIT_HASH").unwrap_or(DEFAULT_VALUE), | ||
built_info::BUILT_TIME_UTC, | ||
) | ||
} | ||
|
||
pub fn get_system_version() -> String { | ||
format!( | ||
r#"{{"target":"{}","rustc_version":"{}","git_version":"{}","git_commit_hash":"{}","build_time":"{}"}}"#, | ||
built_info::TARGET, | ||
built_info::RUSTC_VERSION, | ||
option_env!("GIT_VERSION").unwrap_or(DEFAULT_VALUE), | ||
option_env!("GIT_COMMIT_HASH").unwrap_or(DEFAULT_VALUE), | ||
built_info::BUILT_TIME_UTC | ||
) | ||
} |
This file contains 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 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 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.