-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
ic_tee_logtail
to debug TEE service
- Loading branch information
Showing
8 changed files
with
133 additions
and
14 deletions.
There are no files selected for viewing
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
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,27 @@ | ||
[package] | ||
name = "ic_tee_logtail" | ||
description = "A simple log tailing service for the TEE environment." | ||
publish = false | ||
repository = "https://github.com/ldclabs/ic-tee/tree/main/src/ic_tee_logtail" | ||
version.workspace = true | ||
edition.workspace = true | ||
keywords.workspace = true | ||
categories.workspace = true | ||
license.workspace = true | ||
|
||
[dependencies] | ||
candid = { workspace = true, features = ["value", "printer"] } | ||
serde_bytes = { workspace = true } | ||
tokio = { workspace = true } | ||
const-hex = { workspace = true } | ||
ic-agent = { workspace = true } | ||
ed25519-consensus = { workspace = true } | ||
ic_cose_types = { workspace = true } | ||
rand = { workspace = true } | ||
anyhow = "1" | ||
clap = { version = "=4.5", features = ["derive"] } | ||
pkcs8 = { version = "0.10", features = ["pem"] } | ||
ed25519 = { version = "2.2", features = ["pem", "pkcs8"] } | ||
ic_tee_cdk = { path = "../ic_tee_cdk", version = "0.1" } | ||
ic_tee_agent = { path = "../ic_tee_agent", version = "0.1" } | ||
ic_tee_nitro_attestation = { path = "../ic_tee_nitro_attestation", version = "0.1" } |
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,21 @@ | ||
# `ic_tee_logtail` | ||
![License](https://img.shields.io/crates/l/ic_tee_logtail.svg) | ||
[![Crates.io](https://img.shields.io/crates/d/ic_tee_logtail.svg)](https://crates.io/crates/ic_tee_logtail) | ||
[![Test](https://github.com/ldclabs/ic-tee/actions/workflows/test.yml/badge.svg)](https://github.com/ldclabs/ic-tee/actions/workflows/test.yml) | ||
[![Latest Version](https://img.shields.io/crates/v/ic_tee_logtail.svg)](https://crates.io/crates/ic_tee_logtail) | ||
|
||
`ic_tee_logtail` is a simple log tailing service for the TEE environment.. | ||
|
||
## Usage | ||
|
||
Install: | ||
```sh | ||
cargo install ic_tee_logtail | ||
# get help info | ||
ic_tee_logtail --help | ||
``` | ||
|
||
## License | ||
Copyright © 2024 [LDC Labs](https://github.com/ldclabs). | ||
|
||
`ldclabs/ic-tee` is licensed under the MIT License. See [LICENSE](../../LICENSE-MIT) for the full license text. |
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,28 @@ | ||
use anyhow::Result; | ||
use clap::Parser; | ||
use tokio::{io, net::TcpListener}; | ||
|
||
#[derive(Parser)] | ||
#[command(author, version, about, long_about = None)] | ||
pub struct Cli { | ||
#[arg(long, default_value = "127.0.0.1:9999")] | ||
ip_addr: String, | ||
} | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
let cli = Cli::parse(); | ||
let listener = TcpListener::bind(&cli.ip_addr).await?; | ||
println!("listening on {:?}", listener.local_addr()?); | ||
|
||
loop { | ||
match listener.accept().await { | ||
Err(err) => println!("couldn't get client: {:?}", err), | ||
Ok((mut stream, addr)) => { | ||
println!("accept a client: {:?}", addr); | ||
stream.readable().await?; | ||
io::copy(&mut stream, &mut io::stdout()).await?; | ||
} | ||
} | ||
} | ||
} |
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