diff --git a/Dockerfile b/Dockerfile index e26d954..3a7af38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # 打包命令 -# docker buildx build -t zhushenwudi/lovelive-sif2:1.0.1 --platform=linux/amd64 . +# docker buildx build -t zhushenwudi/lovelive-sif2:1.0.2 -t zhushenwudi/lovelive-sif2:latest --platform=linux/amd64 . # 使用适用于 Linux x86 的基础映像 # 保存镜像 -# docker save -o lovelive-sif2.tar zhushenwudi/lovelive-sif2:1.0.1 +# docker save -o lovelive-sif2.tar zhushenwudi/lovelive-sif2:1.0.2 FROM docker.io/library/debian:latest AS builder diff --git a/src/main.rs b/src/main.rs index 6357ad3..a7c2f50 100644 --- a/src/main.rs +++ b/src/main.rs @@ -119,7 +119,8 @@ async fn run_server(in_thread: bool) -> std::io::Result<()> { let webui_server = HttpServer::new(|| { App::new() .wrap_fn(|req, srv| { - logger::info(&format!("WebUI Request: {}", req.path())); // 使用日志记录 + let ip = req.peer_addr().map(|addr| addr.ip().to_string()).unwrap_or_else(|| "Unknown IP".to_string()); + logger::info(&format!("from {}, WebUI Request: {}", ip, req.path())); srv.call(req) }) .app_data(web::PayloadConfig::default().limit(1024 * 1024 * 25)) @@ -137,7 +138,8 @@ async fn run_server(in_thread: bool) -> std::io::Result<()> { asset_server = Some(HttpServer::new(|| { App::new() .wrap_fn(|req, srv| { - logger::info(&format!("Assets Request: {}", req.path())); + let ip = req.peer_addr().map(|addr| addr.ip().to_string()).unwrap_or_else(|| "Unknown IP".to_string()); + logger::info(&format!("from {}, Assets Request: {}", ip, req.path())); srv.call(req) }) .app_data(web::PayloadConfig::default().limit(1024 * 1024 * 1024))