Skip to content

Commit

Permalink
tappd: Show compose file in tcb info
Browse files Browse the repository at this point in the history
  • Loading branch information
kvinwang committed Dec 20, 2024
1 parent 5d07dd9 commit 5f529a6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions tappd/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ pub struct Config {
pub key_file: String,
pub public_logs: bool,
pub public_sysinfo: bool,
pub compose_file: String,
}
3 changes: 3 additions & 0 deletions tappd/src/rpc_service.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::sync::Arc;

use anyhow::{bail, Context, Result};
use fs_err as fs;
use ra_rpc::{CallContext, RpcCall};
use ra_tls::{
attestation::QuoteContentType,
Expand Down Expand Up @@ -140,6 +141,7 @@ impl WorkerRpc for ExternalRpcHandler {
let rtmr1 = hex::encode(report.rt_mr1);
let rtmr2 = hex::encode(report.rt_mr2);
let rtmr3 = hex::encode(report.rt_mr3);
let app_compose = fs::read_to_string(&self.state.config().compose_file).unwrap_or_default();
let tcb_info = serde_json::to_string_pretty(&json!({
"rootfs_hash": rootfs_hash,
"mrtd": mrtd,
Expand All @@ -148,6 +150,7 @@ impl WorkerRpc for ExternalRpcHandler {
"rtmr2": rtmr2,
"rtmr3": rtmr3,
"event_log": event_log,
"app_compose": app_compose,
}))
.unwrap_or_default();
Ok(WorkerInfo {
Expand Down
1 change: 1 addition & 0 deletions tappd/tappd.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cert_file = "/etc/tappd/app-ca.cert"
key_file = "/etc/tappd/app-ca.key"
public_logs = false
public_sysinfo = false
compose_file = "/tapp/app-compose.json"

[internal]
address = "unix:/var/run/tappd.sock"
Expand Down

0 comments on commit 5f529a6

Please sign in to comment.