diff --git a/ostp-client/src/tunnel/outbounds/direct.rs b/ostp-client/src/tunnel/outbounds/direct.rs index d1068d1..f439b31 100644 --- a/ostp-client/src/tunnel/outbounds/direct.rs +++ b/ostp-client/src/tunnel/outbounds/direct.rs @@ -66,7 +66,7 @@ pub fn bind_socket_to_interface(socket: &tokio::net::TcpSocket, _is_ipv6: bool, Ok(()) } -pub async fn dial_tcp(target_host: &str, target_port: u16, phys_if_idx: Option) -> Result { +pub async fn dial_tcp(target_host: &str, target_port: u16, _phys_if_idx: Option) -> Result { let addrs = tokio::net::lookup_host((target_host, target_port)).await?.collect::>(); if addrs.is_empty() { return Err(anyhow!("Could not resolve target host: {}", target_host)); @@ -79,7 +79,7 @@ pub async fn dial_tcp(target_host: &str, target_port: u16, phys_if_idx: Option, phys_if_index: Option, - phys_if_name: Option, + _phys_if_name: Option, } impl OutboundManager { @@ -23,7 +23,7 @@ impl OutboundManager { Self { balancer, phys_if_index, - phys_if_name, + _phys_if_name: phys_if_name, } } diff --git a/ostp-client/src/tunnel/process_lookup.rs b/ostp-client/src/tunnel/process_lookup.rs index ed2e1ee..4234e2f 100644 --- a/ostp-client/src/tunnel/process_lookup.rs +++ b/ostp-client/src/tunnel/process_lookup.rs @@ -126,7 +126,6 @@ pub fn get_process_name_from_port(port: u16) -> Option { use std::fs; use std::io::{BufRead, BufReader}; - let mut target_inode = None; let hex_port = format!("{:04X}", port); let check_net_file = |path: &str| -> Option { @@ -146,12 +145,11 @@ pub fn get_process_name_from_port(port: u16) -> Option { None }; - target_inode = check_net_file("/proc/net/tcp") + let target_inode = check_net_file("/proc/net/tcp") .or_else(|| check_net_file("/proc/net/tcp6")) .or_else(|| check_net_file("/proc/net/udp")) - .or_else(|| check_net_file("/proc/net/udp6")); + .or_else(|| check_net_file("/proc/net/udp6"))?; - let target_inode = target_inode?; let socket_str = format!("socket:[{}]", target_inode); for entry in fs::read_dir("/proc").ok()?.filter_map(Result::ok) { diff --git a/ostp-core/src/dns.rs b/ostp-core/src/dns.rs index 1841e61..6463a87 100644 --- a/ostp-core/src/dns.rs +++ b/ostp-core/src/dns.rs @@ -1,5 +1,5 @@ use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; -use std::io::{Cursor, Read, Write}; +use std::io::{Cursor, Read}; const BASE32_ALPHABET: &[u8] = b"abcdefghijklmnopqrstuvwxyz234567"; diff --git a/ostp-flutter/pubspec.yaml b/ostp-flutter/pubspec.yaml index b5d3d5a..1cfee18 100644 --- a/ostp-flutter/pubspec.yaml +++ b/ostp-flutter/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 0.3.10+23 +version: 0.3.11+24 environment: sdk: ^3.11.4 diff --git a/ostp-gui/src-tauri/tauri.conf.json b/ostp-gui/src-tauri/tauri.conf.json index e21950f..7e66dde 100644 --- a/ostp-gui/src-tauri/tauri.conf.json +++ b/ostp-gui/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "ostp-gui", - "version": "0.3.10", + "version": "0.3.11", "identifier": "com.ospab.ostp", "build": { "frontendDist": "../src" diff --git a/ostp-server/src/config.rs b/ostp-server/src/config.rs index def883c..99ba016 100644 --- a/ostp-server/src/config.rs +++ b/ostp-server/src/config.rs @@ -1,5 +1,5 @@ use serde::{Deserialize, Serialize}; -use crate::{api::ApiConfig, fallback::FallbackConfig, outbound::OutboundConfig, dns::DnsConfig}; +use crate::{fallback::FallbackConfig, dns::DnsConfig}; #[derive(Debug, Deserialize, Serialize, Clone)] #[serde(tag = "protocol", rename_all = "snake_case")] diff --git a/ostp-server/src/transport/dns.rs b/ostp-server/src/transport/dns.rs index f667acc..2fced0c 100644 --- a/ostp-server/src/transport/dns.rs +++ b/ostp-server/src/transport/dns.rs @@ -6,7 +6,7 @@ use std::net::SocketAddr; use bytes::Bytes; use tokio::time::Duration; -use ostp_core::dns::{DnsPacket, DnsRecordType, decode_domain_to_payload, encode_payload_to_domain}; +use ostp_core::dns::{DnsPacket, DnsRecordType, decode_domain_to_payload}; use crate::config::DnsTransportConfig; use crate::UiEvent; diff --git a/ostp-tun/src/linux.rs b/ostp-tun/src/linux.rs index fb97bb5..d6ae807 100644 --- a/ostp-tun/src/linux.rs +++ b/ostp-tun/src/linux.rs @@ -38,10 +38,6 @@ pub async fn create(opts: OstpTunOptions) -> Result { .mtu(opts.mtu) .up(); - tun_cfg.platform_config(|cfg| { - cfg.packet_information(false); - }); - let dev = tun::create(&tun_cfg).map_err(|e| anyhow!("Failed to create TUN device: {}", e))?; let dev = tun::AsyncDevice::new(dev).map_err(|e| anyhow!("TUN device async failed: {}", e))?; tracing::info!("TUN device 'ostp_tun' created."); diff --git a/ostp/src/dns_prober.rs b/ostp/src/dns_prober.rs index 1e25571..ab1db33 100644 --- a/ostp/src/dns_prober.rs +++ b/ostp/src/dns_prober.rs @@ -158,7 +158,7 @@ pub async fn run_prober(config_path: &std::path::Path) { // Send a real OSTP ping packet encoded as a domain let payload = b"PING"; - let encoded_domain = ostp_core::dns::encode_payload_to_domain(payload, target_domain); + let encoded_domain = ostp_core::dns::encode_payload_to_domain(payload, &target_domain); let mut rng = rand::thread_rng(); diff --git a/ostp/src/main.rs b/ostp/src/main.rs index 1cd2e33..e28dbc3 100644 --- a/ostp/src/main.rs +++ b/ostp/src/main.rs @@ -286,6 +286,7 @@ impl UserConfig { } } +#[allow(dead_code)] #[derive(Debug, Deserialize, Serialize)] struct OutboundConfig { enabled: bool, @@ -297,6 +298,7 @@ struct OutboundConfig { default_action: Option, } +#[allow(dead_code)] #[derive(Debug, Deserialize, Serialize)] struct OutboundRule { domain_suffix: Option>, @@ -305,6 +307,7 @@ struct OutboundRule { action: Option, } +#[allow(dead_code)] #[derive(Debug, Deserialize, Serialize, Clone)] struct TransportConfigRaw { mode: Option, @@ -360,6 +363,7 @@ impl ListenConfig { } } +#[allow(dead_code)] #[derive(Debug, Deserialize, Serialize)] struct ApiConfig { enabled: Option, @@ -370,6 +374,7 @@ struct ApiConfig { password_hash: Option, } +#[allow(dead_code)] #[derive(Debug, Deserialize, Serialize)] struct FallbackCfg { enabled: Option, @@ -922,7 +927,7 @@ fn run_setup_wizard(config_path: &std::path::Path) -> Result<()> { }; wizard_step(4, TOTAL, "Saving configuration"); - let panel_bind = format!("0.0.0.0:{}", panel_port); + let _panel_bind = format!("0.0.0.0:{}", panel_port); let server_json = serde_json::json!({ "mode": "server", "version": "{}", @@ -1324,7 +1329,7 @@ async fn run_app() -> Result<()> { AppMode::Server(s) => { println!("{} Config OK: server mode", "[ostp]".green().bold()); let mut keys_count = 0; - let mut has_outbound = false; + let mut _has_outbound = false; for inbound in &s.inbounds { match inbound { ostp_server::config::ServerInbound::Ostp { listen, port, users, fallback, .. } => { @@ -1348,7 +1353,7 @@ async fn run_app() -> Result<()> { for ob in &s.outbounds { if let ostp_server::config::ServerOutbound::Socks { server, port, .. } = ob { println!(" Outbound Proxy: SOCKS5 {}:{}", server.cyan(), port.to_string().cyan()); - has_outbound = true; + _has_outbound = true; } } if let Some(dns) = &s.dns { @@ -2021,7 +2026,7 @@ fn cmd_migrate(config_path: &std::path::Path) -> Result<()> { if let Some(ob) = raw_json.get("outbound") { if ob.get("enabled").and_then(|e| e.as_bool()).unwrap_or(false) { let tag = "socks5-legacy"; - let mut socks = serde_json::json!({ + let socks = serde_json::json!({ "protocol": "socks5", "tag": tag, "server": ob.get("address").and_then(|a| a.as_str()).unwrap_or("127.0.0.1"),