diff --git a/Cargo.lock b/Cargo.lock index 9c086a05..70715fbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7179,7 +7179,6 @@ dependencies = [ "common", "const-str", "crypto", - "csv", "datafusion", "ecstore", "flatbuffers", @@ -7190,7 +7189,6 @@ dependencies = [ "hyper", "hyper-util", "iam", - "jsonwebtoken", "lazy_static", "libsystemd", "local-ip-address", @@ -7200,13 +7198,9 @@ dependencies = [ "mime", "mime_guess", "netif", - "once_cell", "pin-project-lite", "policy", - "prost", "prost-build", - "prost-types", - "protobuf 3.7.2", "protos", "query", "rmp-serde", @@ -7227,15 +7221,10 @@ dependencies = [ "tokio-util", "tonic 0.13.0", "tonic-build", - "tonic-reflection", "tower 0.5.2", "tower-http", "tracing", - "tracing-core", - "tracing-error", - "tracing-subscriber", "transform-stream", - "url", "uuid", ] @@ -8594,19 +8583,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "tonic-reflection" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88fa815be858816dad226a49439ee90b7bcf81ab55bee72fdb217f1e6778c3ca" -dependencies = [ - "prost", - "prost-types", - "tokio", - "tokio-stream", - "tonic 0.13.0", -] - [[package]] name = "tower" version = "0.4.13" diff --git a/Cargo.toml b/Cargo.toml index b48e74ca..62215766 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,6 @@ matchit = "0.8.4" md-5 = "0.10.6" mime = "0.3.17" netif = "0.1.6" -once_cell = "1.21.1" opentelemetry = { version = "0.29.1" } opentelemetry-appender-tracing = { version = "0.29.1", features = ["experimental_use_tracing_span_context", "experimental_metadata_attributes"] } opentelemetry_sdk = { version = "0.29" } @@ -123,7 +122,6 @@ time = { version = "0.3.41", features = [ tokio = { version = "1.44.2", features = ["fs", "rt-multi-thread"] } tonic = { version = "0.13.0", features = ["gzip"] } tonic-build = "0.13.0" -tonic-reflection = "0.13.0" tokio-rustls = { version = "0.26", default-features = false } tokio-stream = "0.1.17" tokio-util = { version = "0.7.13", features = ["io", "compat"] } diff --git a/crates/obs/src/config.rs b/crates/obs/src/config.rs index c7d3ff7d..a9e62016 100644 --- a/crates/obs/src/config.rs +++ b/crates/obs/src/config.rs @@ -117,7 +117,7 @@ impl Default for FileSinkConfig { path: env::var("RUSTFS_SINKS_FILE_PATH") .ok() .filter(|s| !s.trim().is_empty()) - .unwrap_or_else(|| Self::get_default_log_path()), + .unwrap_or_else(Self::get_default_log_path), buffer_size: Some(8192), flush_interval_ms: Some(1000), flush_threshold: Some(100), @@ -244,7 +244,7 @@ pub fn load_config(config_dir: Option) -> AppConfig { // Log using proper logging instead of println when possible println!("Using config file base: {}", config_dir); - let config = Config::builder() + let app_config = Config::builder() .add_source(File::with_name(config_dir.as_str()).format(FileFormat::Toml).required(false)) .add_source(File::with_name(config_dir.as_str()).format(FileFormat::Yaml).required(false)) .add_source( @@ -258,7 +258,7 @@ pub fn load_config(config_dir: Option) -> AppConfig { .build() .unwrap_or_default(); - match config.try_deserialize::() { + match app_config.try_deserialize::() { Ok(app_config) => { println!("Parsed AppConfig: {:?}", app_config); app_config diff --git a/rustfs/Cargo.toml b/rustfs/Cargo.toml index 63e8b7a4..127798d4 100644 --- a/rustfs/Cargo.toml +++ b/rustfs/Cargo.toml @@ -27,7 +27,6 @@ async-trait.workspace = true bytes.workspace = true chrono = { workspace = true } clap.workspace = true -csv = "1.3.1" crypto = { path = "../crypto" } datafusion = { workspace = true } common.workspace = true @@ -37,26 +36,18 @@ policy.workspace = true flatbuffers.workspace = true futures.workspace = true futures-util.workspace = true -#h2 = "0.4.7" hyper.workspace = true hyper-util.workspace = true http.workspace = true http-body.workspace = true iam = { path = "../iam" } -jsonwebtoken = "9.3.0" - lock.workspace = true local-ip-address = { workspace = true } matchit = { workspace = true } mime.workspace = true mime_guess = "2.0.5" -netif.workspace = true -once_cell.workspace = true pin-project-lite.workspace = true -prost.workspace = true -prost-types.workspace = true protos.workspace = true -protobuf.workspace = true query = { path = "../s3select/query" } rmp-serde.workspace = true rustfs-obs = { workspace = true } @@ -82,14 +73,9 @@ tokio-rustls.workspace = true lazy_static.workspace = true tokio-stream.workspace = true tonic = { workspace = true } -tonic-reflection.workspace = true tower.workspace = true -tracing-core = { workspace = true } -tracing-error.workspace = true -tracing-subscriber.workspace = true transform-stream.workspace = true tower-http.workspace = true -url.workspace = true uuid = "1.15.1" [target.'cfg(target_os = "linux")'.dependencies] @@ -106,7 +92,6 @@ futures-util.workspace = true ecstore = { path = "../ecstore" } s3s.workspace = true clap = { workspace = true } -tracing-subscriber = { workspace = true, features = ["env-filter", "time"] } hyper-util = { workspace = true, features = [ "tokio", "server-auto", diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index 94380990..c0ca3499 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -45,37 +45,14 @@ use rustfs_obs::{init_obs, load_config, set_global_guard, InitLogStatus}; use rustls::ServerConfig; use s3s::{host::MultiDomain, service::S3ServiceBuilder}; use service::hybrid; +use std::net::SocketAddr; use std::sync::Arc; -use std::time::Duration; -use std::{io::IsTerminal, net::SocketAddr}; use tokio::net::TcpListener; use tokio::signal::unix::{signal, SignalKind}; use tokio_rustls::TlsAcceptor; use tonic::{metadata::MetadataValue, Request, Status}; use tower_http::cors::CorsLayer; -use tracing::log::warn; -use tracing::{debug, error, info, info_span}; -use tracing_error::ErrorLayer; -use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; - -#[allow(dead_code)] -fn setup_tracing() { - use tracing_subscriber::EnvFilter; - - let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")); - let enable_color = std::io::stdout().is_terminal(); - - let subscriber = tracing_subscriber::fmt::fmt() - .pretty() - .with_env_filter(env_filter) - .with_ansi(enable_color) - .with_file(true) - .with_line_number(true) - .finish() - .with(ErrorLayer::default()); - - subscriber.try_init().expect("failed to set global default subscriber"); -} +use tracing::{debug, error, info, info_span, warn}; fn check_auth(req: Request<()>) -> Result, Status> { let token: MetadataValue<_> = "rustfs rpc".parse().unwrap();