7eb528d35f
- Add VfsFile: Send supertrait for Mutex compatibility - Fix SmbServerCommand: struct → Subcommand enum with Start variant - Fix tracing_subscriber::init() → try_init() to avoid panic when logger already initialized - Fix CLI subcommand name: smb-server → smb-start (flatten naming) - Add #[command(name = "smb-start")] for CLI disambiguation - Fix unused variable warnings (smb_fs.rs, smb_server_backend.rs) - Remove unused VfsFile imports (webdav.rs, scp_handler.rs) - Integration test: Docker smbclient verified (list, upload, read)
53 lines
1.3 KiB
Rust
53 lines
1.3 KiB
Rust
//! SMB2/3 file-sharing server with pluggable storage backends.
|
|
//!
|
|
//! See `docs/superpowers/specs/2026-04-27-rust-smb-server-design.md` for the
|
|
//! v1 design. The public API is small on purpose:
|
|
//!
|
|
//! ```no_run
|
|
//! use smb_server::{SmbServer, Share, Access, ShareBackend};
|
|
//! # async fn run<B: ShareBackend>(backend: B) -> Result<(), Box<dyn std::error::Error>> {
|
|
//! SmbServer::builder()
|
|
//! .listen("0.0.0.0:4445".parse()?)
|
|
//! .user("alice", "password")
|
|
//! .share(Share::new("home", backend).user("alice", Access::ReadWrite))
|
|
//! .build()?
|
|
//! .serve()
|
|
//! .await?;
|
|
//! # Ok(()) }
|
|
//! ```
|
|
|
|
mod backend;
|
|
mod builder;
|
|
pub(crate) mod conn;
|
|
mod dispatch;
|
|
mod error;
|
|
#[cfg(feature = "localfs")]
|
|
mod fs;
|
|
mod handlers;
|
|
pub(crate) mod info_class;
|
|
pub mod ntstatus;
|
|
mod path;
|
|
mod proto;
|
|
mod server;
|
|
mod utils;
|
|
|
|
pub use backend::{BackendCapabilities, DirEntry, FileInfo, FileTimes, Handle, OpenIntent, OpenOptions, ShareBackend};
|
|
pub use error::SmbError;
|
|
pub use path::SmbPath;
|
|
pub use builder::{Access, Share};
|
|
#[cfg(feature = "localfs")]
|
|
pub use fs::LocalFsBackend;
|
|
pub use proto::auth::ntlm::Identity;
|
|
pub use server::{ConfigHandle, ShareMode, ShutdownHandle, SmbServer};
|
|
|
|
pub mod wire {
|
|
pub use crate::proto::header;
|
|
pub use crate::proto::messages;
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
mod dynamic_config;
|
|
mod memfs;
|
|
}
|