[package]
name = "secafs"
version = "0.6.0"
edition = "2021"

[lib]
name = "secafs"
path = "src/lib.rs"

[[bin]]
name = "secafs"
path = "src/main.rs"

[features]
default = ["sandbox"]
strict = []
sandbox = [
    "dep:secafs-sandbox",
    "dep:reverie",
    "dep:reverie-ptrace",
    "dep:reverie-process",
]

[dependencies]
secafs-sdk = { path = "../sdk/rust", package = "secafs-sdk" }
tokio = { version = "1", features = ["full"] }
clap = { version = "4", features = ["derive", "env"] }
anyhow = "1.0"
tokio-postgres = "0.7"
serde = { version = "1.0", features = ["derive"] }
parking_lot = "0.12.5"
clap_complete = { version = "=4.5.61", features = ["unstable-dynamic"] }
dirs = "6"
serde_json = "1.0.147"
tracing = "0.1.44"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
chrono = { version = "0.4.42", features = ["serde"] }

# MCP Server support
base64 = "0.22"

# NFS server for userspace filesystem (used by `secafs run` and `secafs nfs`)
uuid = { version = "1", features = ["v4"] }
tokio-util = "0.7"
async-trait = "0.1"
# Vendored nfsserve dependencies
byteorder = "1.5"
num-derive = "0.4"
num-traits = "0.2"
filetime = "0.2"

# Unix dependencies
[target.'cfg(unix)'.dependencies]
libc = "0.2"

# Linux-only dependencies for FUSE and sandbox functionality
[target.'cfg(target_os = "linux")'.dependencies]
# Sandbox dependencies - (requires libunwind-dev on ARM)
secafs-sandbox = { path = "../sandbox", optional = true }
reverie = { git = "https://github.com/facebookexperimental/reverie", optional = true }
reverie-ptrace = { git = "https://github.com/facebookexperimental/reverie", optional = true }
reverie-process = { git = "https://github.com/facebookexperimental/reverie", optional = true }
# Vendored fuser dependencies (pure-Rust FUSE implementation)
log = "0.4"
memchr = "2.7"
page_size = "0.6"
smallvec = "1.6"
zerocopy = { version = "0.8", features = ["derive"] }
nix = { version = "0.29", features = ["fs", "user"] }

# The profile that 'dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"

[dev-dependencies]
tempfile = "3"
tokio-postgres = "0.7"