Skip to content

Commit

Permalink
fix: fix ic_tee_daemon log; fix ic_tee_nitro_gateway http proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Feb 2, 2025
1 parent 5391135 commit fe9e3d0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ strip = true
opt-level = 's'

[workspace.package]
version = "0.2.13"
version = "0.2.14"
edition = "2021"
repository = "https://github.com/ldclabs/ic-tee"
keywords = ["tee", "canister", "icp", "nitro"]
Expand Down
2 changes: 1 addition & 1 deletion src/ic_tee_daemon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
## Usage

```bash
ic_tee_daemon --outbound-vsock-addr 3:448 --outbound_listen_addr 127.0.0.1:448 --inbound-vsock-addr 8:443 --inbound-listen-addr 127.0.0.1:8443 --logtail-addr 127.0.0.1:9999
ic_tee_daemon --outbound-vsock-addr 3:448 --outbound_listen_addr 127.0.0.1:448 --inbound-vsock-addr 8:443 --inbound-listen-addr 127.0.0.1:8443
```

## License
Expand Down
12 changes: 1 addition & 11 deletions src/ic_tee_daemon/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use anyhow::Result;
use clap::Parser;
use structured_logger::{async_json::new_writer, get_env_level, Builder};
use tokio::net::TcpStream;

mod helper;
mod ip_to_vsock_transparent;
Expand All @@ -25,23 +24,14 @@ pub struct Cli {
/// IP address of listener in enclave (e.g. 127.0.0.1:8443)
#[clap(long, default_value = "127.0.0.1:8443")]
inbound_listen_addr: String,

/// where the logtail server is running on host (e.g. 127.0.0.1:9999)
#[arg(long, default_value = "127.0.0.1:9999")]
logtail_addr: String,
}

#[tokio::main]
async fn main() -> Result<()> {
let cli = Cli::parse();
let writer = {
let stream = TcpStream::connect(&cli.logtail_addr).await?;
stream.writable().await?;
new_writer(stream)
};

Builder::with_level(&get_env_level().to_string())
.with_target_writer("*", writer)
.with_target_writer("*", new_writer(tokio::io::stdout()))
.init();

let serve_vsock_to_ip = async {
Expand Down
3 changes: 2 additions & 1 deletion src/ic_tee_nitro_gateway/src/handler.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use axum::{
body::Body,
extract::{Request, State},
http::{header, uri::Uri, HeaderMap, StatusCode},
http::{header, uri::Uri, HeaderMap, StatusCode, Version},
response::IntoResponse,
};
use candid::decode_args;
Expand Down Expand Up @@ -453,6 +453,7 @@ pub async fn proxy(

*req.uri_mut() = Uri::try_from(uri)
.map_err(|err| Content::Text(err.to_string(), Some(StatusCode::BAD_REQUEST)))?;
*req.version_mut() = Version::HTTP_11;

match app.http_client.request(req).await {
Ok(res) => Ok(res.into_response()),
Expand Down

0 comments on commit fe9e3d0

Please sign in to comment.