fix(smarts3): replace TypeScript server with Rust-powered core and IPC bridge

This commit is contained in:
2026-02-13 13:59:44 +00:00
parent 54a0c2fb65
commit 65eb266983
32 changed files with 4083 additions and 3182 deletions

43
rust/src/main.rs Normal file
View File

@@ -0,0 +1,43 @@
mod config;
mod management;
mod s3_error;
mod server;
mod storage;
mod xml_response;
use clap::Parser;
#[derive(Parser)]
#[command(name = "rusts3", about = "High-performance S3-compatible server")]
struct Cli {
/// Run in management mode (IPC via stdin/stdout)
#[arg(long)]
management: bool,
/// Log level
#[arg(long, default_value = "info")]
log_level: String,
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let cli = Cli::parse();
if cli.management {
// Init tracing to stderr only (stdout reserved for IPC)
tracing_subscriber::fmt()
.with_writer(std::io::stderr)
.with_env_filter(
tracing_subscriber::EnvFilter::try_new(&cli.log_level)
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
)
.init();
management::management_loop().await?;
} else {
eprintln!("rusts3: use --management flag for IPC mode");
std::process::exit(1);
}
Ok(())
}