mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-06-14 03:32:00 +08:00
277 lines
7.6 KiB
TOML
277 lines
7.6 KiB
TOML
[package]
|
|
name = "one-kvm"
|
|
version = "0.2.1"
|
|
edition = "2021"
|
|
authors = ["SilentWind"]
|
|
description = "A open and lightweight IP-KVM solution written in Rust"
|
|
license = "GPL-2.0"
|
|
repository = "https://github.com/mofeng-git/One-KVM"
|
|
keywords = ["kvm", "ipkvm", "remote-management", "embedded"]
|
|
categories = ["embedded", "network-programming"]
|
|
|
|
[features]
|
|
default = ["desktop"]
|
|
desktop = [
|
|
"dep:tokio",
|
|
"dep:tokio-util",
|
|
"dep:axum",
|
|
"dep:axum-extra",
|
|
"dep:tower-http",
|
|
"dep:sqlx",
|
|
"dep:serde",
|
|
"dep:serde_json",
|
|
"dep:tracing",
|
|
"dep:tracing-subscriber",
|
|
"dep:thiserror",
|
|
"dep:anyhow",
|
|
"dep:argon2",
|
|
"dep:rand",
|
|
"dep:uuid",
|
|
"dep:base64",
|
|
"dep:nix",
|
|
"dep:reqwest",
|
|
"dep:urlencoding",
|
|
"dep:rust-embed",
|
|
"dep:mime_guess",
|
|
"dep:rustls",
|
|
"dep:rcgen",
|
|
"dep:axum-server",
|
|
"dep:clap",
|
|
"dep:time",
|
|
"dep:bytes",
|
|
"dep:bytemuck",
|
|
"dep:xxhash-rust",
|
|
"dep:async-stream",
|
|
"dep:futures",
|
|
"dep:tokio-tungstenite",
|
|
"dep:parking_lot",
|
|
"dep:arc-swap",
|
|
"dep:webrtc",
|
|
"dep:rtp",
|
|
"dep:rtsp-types",
|
|
"dep:sdp-types",
|
|
"dep:serialport",
|
|
"dep:async-trait",
|
|
"dep:libc",
|
|
"dep:ventoy-img",
|
|
"dep:protobuf",
|
|
"dep:sodiumoxide",
|
|
"dep:sha2",
|
|
"dep:typeshare",
|
|
"dep:hwcodec",
|
|
"dep:libyuv",
|
|
"dep:turbojpeg",
|
|
"dep:audiopus",
|
|
"dep:v4l2r",
|
|
"dep:alsa",
|
|
"dep:gpio-cdev",
|
|
"dep:cpal",
|
|
"dep:windows-sys",
|
|
]
|
|
android = [
|
|
"dep:anyhow",
|
|
"dep:argon2",
|
|
"dep:arc-swap",
|
|
"dep:async-stream",
|
|
"dep:async-trait",
|
|
"dep:axum",
|
|
"dep:axum-extra",
|
|
"dep:base64",
|
|
"dep:bytemuck",
|
|
"dep:bytes",
|
|
"dep:futures",
|
|
"dep:gpio-cdev",
|
|
"dep:hwcodec",
|
|
"dep:libc",
|
|
"dep:libyuv",
|
|
"dep:mime_guess",
|
|
"dep:nix",
|
|
"dep:parking_lot",
|
|
"dep:protobuf",
|
|
"dep:rand",
|
|
"dep:rcgen",
|
|
"dep:reqwest",
|
|
"dep:rtp",
|
|
"dep:rtsp-types",
|
|
"dep:rust-embed",
|
|
"dep:rustls",
|
|
"dep:sdp-types",
|
|
"dep:serde",
|
|
"dep:serde_json",
|
|
"dep:serialport",
|
|
"dep:sha2",
|
|
"dep:sodiumoxide",
|
|
"dep:sqlx",
|
|
"dep:alsa",
|
|
"dep:audiopus",
|
|
"dep:thiserror",
|
|
"dep:time",
|
|
"dep:tokio",
|
|
"dep:tokio-tungstenite",
|
|
"dep:tokio-util",
|
|
"dep:axum-server",
|
|
"dep:tower-http",
|
|
"dep:tracing",
|
|
"dep:tracing-log",
|
|
"dep:tracing-subscriber",
|
|
"dep:turbojpeg",
|
|
"dep:typeshare",
|
|
"dep:urlencoding",
|
|
"dep:uuid",
|
|
"dep:ventoy-img",
|
|
"dep:v4l2r",
|
|
"dep:webrtc",
|
|
"dep:xxhash-rust",
|
|
]
|
|
android-mediacodec = [
|
|
"android",
|
|
]
|
|
|
|
[dependencies]
|
|
# Async runtime
|
|
tokio = { version = "1", features = ["full"], optional = true }
|
|
tokio-util = { version = "0.7", features = ["rt"], optional = true }
|
|
|
|
# Web framework
|
|
axum = { version = "0.8", features = ["ws", "multipart", "tokio"], optional = true }
|
|
axum-extra = { version = "0.12", features = ["cookie"], optional = true }
|
|
tower-http = { version = "0.6", features = ["cors", "trace", "set-header"], optional = true }
|
|
|
|
# Database - Use bundled SQLite for static linking
|
|
sqlx = { version = "0.8", features = ["runtime-tokio", "sqlite"], optional = true }
|
|
|
|
# Serialization
|
|
serde = { version = "1", features = ["derive"], optional = true }
|
|
serde_json = { version = "1", optional = true }
|
|
|
|
# Logging
|
|
tracing = { version = "0.1", optional = true }
|
|
tracing-log = { version = "0.2", optional = true }
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "tracing-log"], optional = true }
|
|
|
|
# Error handling
|
|
thiserror = { version = "2", optional = true }
|
|
anyhow = { version = "1", optional = true }
|
|
|
|
# Authentication
|
|
argon2 = { version = "0.5", optional = true }
|
|
rand = { version = "0.9", optional = true }
|
|
|
|
# Utilities
|
|
uuid = { version = "1", features = ["v4", "serde"], optional = true }
|
|
base64 = { version = "0.22", optional = true }
|
|
|
|
# HTTP client (for URL downloads)
|
|
# Use rustls by default, but allow native-tls for systems with older GLIBC
|
|
reqwest = { version = "0.13", features = ["stream", "rustls", "json"], default-features = false, optional = true }
|
|
urlencoding = { version = "2", optional = true }
|
|
|
|
# Static file embedding
|
|
rust-embed = { version = "8", features = ["compression", "debug-embed"], optional = true }
|
|
mime_guess = { version = "2", optional = true }
|
|
|
|
# TLS/HTTPS
|
|
rustls = { version = "0.23", features = ["ring"], optional = true }
|
|
rcgen = { version = "0.14", optional = true }
|
|
axum-server = { version = "0.8", features = ["tls-rustls"], optional = true }
|
|
|
|
# CLI argument parsing
|
|
clap = { version = "4", features = ["derive"], optional = true }
|
|
|
|
# Time (cookie max_age + RFC3339 timestamps)
|
|
time = { version = "0.3", features = ["serde", "formatting", "parsing"], optional = true }
|
|
|
|
# Bytes handling
|
|
bytes = { version = "1", optional = true }
|
|
bytemuck = { version = "1.24", features = ["derive"], optional = true }
|
|
|
|
# Frame deduplication (hash-based comparison)
|
|
xxhash-rust = { version = "0.8", features = ["xxh64"], optional = true }
|
|
|
|
# Async channels
|
|
async-stream = { version = "0.3", optional = true }
|
|
futures = { version = "0.3", optional = true }
|
|
|
|
# WebSocket client (for ttyd proxy)
|
|
tokio-tungstenite = { version = "0.28", optional = true }
|
|
|
|
# High-performance synchronization
|
|
parking_lot = { version = "0.12", optional = true }
|
|
arc-swap = { version = "1.8", optional = true }
|
|
|
|
# WebRTC
|
|
webrtc = { version = "0.14", optional = true }
|
|
rtp = { version = "0.14", optional = true }
|
|
rtsp-types = { version = "0.1", optional = true }
|
|
sdp-types = { version = "0.1", optional = true }
|
|
|
|
# HID (serial port for CH9329)
|
|
serialport = { version = "4", optional = true }
|
|
async-trait = { version = "0.1", optional = true }
|
|
libc = { version = "0.2", optional = true }
|
|
|
|
# Ventoy bootable image support
|
|
ventoy-img = { path = "libs/ventoy-img-rs", optional = true }
|
|
|
|
# RustDesk protocol support
|
|
protobuf = { version = "3.7", features = ["with-bytes"], optional = true }
|
|
sodiumoxide = { version = "0.2", optional = true }
|
|
sha2 = { version = "0.10", optional = true }
|
|
# TypeScript type generation
|
|
typeshare = { version = "1.0", optional = true }
|
|
|
|
[target.'cfg(any(unix, windows))'.dependencies]
|
|
# Video encoding/decoding (FFmpeg/libjpeg-turbo/libyuv; available on Windows and Linux)
|
|
hwcodec = { path = "libs/hwcodec", features = ["bytes"], optional = true }
|
|
libyuv = { path = "res/vcpkg/libyuv", optional = true }
|
|
turbojpeg = { version = "1.3", optional = true }
|
|
# Note: audiopus links to libopus.so (unavoidable for audio support)
|
|
audiopus = { version = "0.2", optional = true }
|
|
|
|
[target.'cfg(all(unix, not(target_os = "android")))'.dependencies]
|
|
# Utilities
|
|
nix = { version = "0.30", default-features = false, features = ["fs", "socket", "net", "hostname", "poll"], optional = true }
|
|
|
|
[target.'cfg(target_os = "android")'.dependencies]
|
|
# Utilities
|
|
nix = { version = "0.30", default-features = false, features = ["fs", "socket", "hostname", "poll"], optional = true }
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
# Video capture (V4L2)
|
|
v4l2r = { path = "libs/v4l2r", optional = true }
|
|
|
|
# Audio (ALSA capture)
|
|
alsa = { version = "0.11", optional = true }
|
|
|
|
# ATX (GPIO control)
|
|
gpio-cdev = { version = "0.6", optional = true }
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
cpal = { version = "0.17", default-features = false, optional = true }
|
|
windows-sys = { version = "0.61", features = [
|
|
"Win32_Foundation",
|
|
"Win32_NetworkManagement_IpHelper",
|
|
"Win32_NetworkManagement_Ndis",
|
|
"Win32_Networking_WinSock",
|
|
"Win32_System_SystemInformation",
|
|
"Win32_System_Threading",
|
|
], optional = true }
|
|
|
|
[dev-dependencies]
|
|
tempfile = "3"
|
|
|
|
[build-dependencies]
|
|
protobuf-codegen = "3.7"
|
|
|
|
[profile.release]
|
|
opt-level = 3
|
|
lto = true
|
|
codegen-units = 1
|
|
strip = true
|
|
panic = "abort"
|
|
|
|
# Static linking profile for musl targets
|
|
[profile.release-static]
|
|
inherits = "release"
|
|
opt-level = "z" # Optimize for size
|