From 479ad3acd4181a0c5429e35248e32f4c039be754 Mon Sep 17 00:00:00 2001 From: zhushenwudi <55681140@163.com> Date: Tue, 14 Jan 2025 20:50:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=97=A5=E5=BF=97=E8=BE=93=E5=87=BAIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 ++-- src/main.rs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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))