diff --git a/ecstore/src/utils/os/windows.rs b/ecstore/src/utils/os/windows.rs index 4eac43cd..432e90e6 100644 --- a/ecstore/src/utils/os/windows.rs +++ b/ecstore/src/utils/os/windows.rs @@ -2,7 +2,7 @@ use super::IOStats; use crate::{disk::Info, error::Result}; -use std::io::{Error, ErrorKind, Result as IoResult}; +use std::io::{Error, ErrorKind}; use std::mem; use std::os::windows::ffi::OsStrExt; use std::path::Path; @@ -135,10 +135,10 @@ fn get_fs_type(p: &[WCHAR]) -> Result { Ok(utf16_to_string(&lp_file_system_name_buffer)) } -pub fn same_disk(disk1: &str, disk2: &str) -> Result { +pub fn same_disk(_add_extensiondisk1: &str, _disk2: &str) -> Result { Ok(false) } -pub fn get_drive_stats(major: u32, minor: u32) -> Result { +pub fn get_drive_stats(_major: u32, _minor: u32) -> Result { Ok(IOStats::default()) } diff --git a/rustfs/src/admin/handlers.rs b/rustfs/src/admin/handlers.rs index 4c3f88a2..c975d2a0 100644 --- a/rustfs/src/admin/handlers.rs +++ b/rustfs/src/admin/handlers.rs @@ -105,7 +105,7 @@ pub async fn check_key_valid(security_token: Option, ak: &str) -> S3Resu let (u, ok) = iam_store .check_key(ak) .await - .map_err(|e| S3Error::with_message(S3ErrorCode::InternalError, format!("check claims failed {}", e)))?; + .map_err(|e| S3Error::with_message(S3ErrorCode::InternalError, format!("check claims failed1 {}", e)))?; if !ok { if let Some(u) = u { @@ -159,7 +159,7 @@ pub fn check_claims_from_token(token: &str, cred: &auth::Credentials) -> S3Resul } if cred.is_temp() || cred.is_expired() { - return Err(s3_error!(InvalidRequest, "invalid access key")); + return Err(s3_error!(InvalidRequest, "invalid access key is temp or expired")); } let Some(sys_cred) = get_global_action_cred() else { diff --git a/rustfs/src/config/mod.rs b/rustfs/src/config/mod.rs index f14f303e..dd622620 100644 --- a/rustfs/src/config/mod.rs +++ b/rustfs/src/config/mod.rs @@ -54,6 +54,9 @@ pub struct Opt { #[arg(long)] pub domain_name: Option, + #[arg(long, default_value_t = false)] + pub console_enable: bool, + #[arg(long, default_value_t = format!("0.0.0.0:{}", 0))] pub console_address: String, } diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index e57efa0b..f259805e 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -240,9 +240,12 @@ async fn run(opt: config::Opt) -> Result<()> { info!("server was started"); - tokio::spawn(async move { - console::start_static_file_server(&opt.console_address).await; - }); + if opt.console_enable { + info!("console is enabled"); + tokio::spawn(async move { + console::start_static_file_server(&opt.console_address).await; + }); + } tokio::select! { _ = tokio::signal::ctrl_c() => {