ip whitelist

This commit is contained in:
2026-08-11 02:02:39 +08:00
parent 6e0b0c92d1
commit b62c74b883
10 changed files with 270 additions and 13 deletions
+11 -1
View File
@@ -62,7 +62,17 @@ async fn main() -> anyhow::Result<()> {
let listener = tokio::net::TcpListener::bind(config.listen_addr)
.await
.context("HTTP bind failed")?;
tracing::info!(event="application_startup",listen_addr=%config.listen_addr);
let ip_whitelist_file = config
.ip_whitelist_file
.as_deref()
.map(|path| path.display().to_string())
.unwrap_or_else(|| "disabled".into());
tracing::info!(
event = "application_startup",
listen_addr = %config.listen_addr,
trust_proxy = config.trust_proxy,
ip_whitelist_file
);
axum::serve(
listener,
http::router(state).into_make_service_with_connect_info::<std::net::SocketAddr>(),