fork/static-web-server

git clone https://git.julia.blue/fork/static-web-server

Jose Quintanav2.42.0dd383af

allow-symlink
5.0 KiB145 linesraw
1[package]
2name = "static-web-server"
3version = "2.42.0"
4edition = "2024"
5rust-version = "1.88.0"
6authors = ["Jose Quintana <https://joseluisq.net>"]
7license = "MIT OR Apache-2.0"
8description = "A cross-platform, high-performance and asynchronous web server for static files-serving."
9repository = "https://github.com/static-web-server/static-web-server"
10readme = "README.md"
11homepage = "https://static-web-server.net"
12keywords = [
13    "static-web-server",
14    "file-server",
15    "http-server"
16]
17categories = ["network-programming", "web-programming::http-server"]
18include = [
19    "src/**/*.rs",
20    "build.rs",
21    "Cargo.toml",
22    "README.md",
23    "LICENSE-MIT",
24    "LICENSE-APACHE"
25]
26autotests = true
27autoexamples = true
28build = "build.rs"
29
30[lib]
31name = "static_web_server"
32path = "src/lib.rs"
33
34[[bin]]
35name = "static-web-server"
36path = "src/bin/server.rs"
37doc = false
38
39[features]
40# All features enabled by default
41default = ["compression", "http2", "directory-listing", "directory-listing-download", "basic-auth", "fallback-page", "metrics"]
42# Include all features (used when building SWS binaries)
43all = ["default", "experimental"]
44# HTTP2
45http2 = ["tokio-rustls", "rustls-pki-types"]
46# Compression
47compression = ["compression-brotli", "compression-deflate", "compression-gzip", "compression-zstd"]
48compression-brotli = ["async-compression/brotli"]
49compression-deflate = ["async-compression/deflate"]
50compression-gzip = ["async-compression/deflate"]
51compression-zstd = ["async-compression/zstd"]
52# Directory listing
53directory-listing = ["chrono"]
54# Directory listing download
55directory-listing-download = ["async-tar",  "compression-gzip", "directory-listing"]
56# Basic HTTP Authorization
57basic-auth = ["bcrypt"]
58# Fallback Page
59fallback-page = []
60# Metrics endpoint with Prometheus integration
61metrics = ["prometheus"]
62# Experimental features (requires: `RUSTFLAGS="--cfg tokio_unstable"`)
63experimental = ["metrics", "tokio-metrics-collector", "compact_str", "mini-moka"]
64
65[dependencies]
66aho-corasick = "1.1.4"
67anyhow = "1.0"
68async-compression = { version = "0.4", default-features = false, optional = true, features = ["brotli", "deflate", "gzip", "zstd", "tokio"] }
69async-tar = { version = "0.5.1", optional = true }
70bcrypt = { version = "0.18.0", optional = true }
71bytes = "1.11.1"
72chrono = { version = "0.4", default-features = false, features = ["std", "clock"], optional = true }
73clap = { version = "4.5", features = ["derive", "env"] }
74clap_allgen = "0.2.1"
75compact_str = { version = "0.9.0", optional = true }
76form_urlencoded = "1.2"
77futures-util = { version = "0.3", default-features = false }
78globset = { version = "0.4.18", features = ["serde1"] }
79headers = "0.3"
80http = "0.2"
81http-serde = "1.1"
82hyper = { version = "0.14", features = ["stream", "http1", "http2", "tcp", "server"] }
83listenfd = "1.0"
84maud = { version = "0.27" }
85mime_guess = "2.0"
86mini-moka = { version = "0.10.3", optional = true }
87percent-encoding = "2.3"
88pin-project = "1.1"
89prometheus = { version = "0.14.0", default-features = false, optional = true }
90regex-lite = "0.1.8"
91rustls-pki-types = { version = "1.13.2", optional = true }
92serde = { version = "1.0", default-features = false, features = ["derive"] }
93serde_ignored = "0.1"
94serde_json = "1.0"
95serde_repr = "0.1"
96shadow-rs = "1.4.0"
97tokio = { version = "1", default-features = false, features = ["rt-multi-thread", "macros", "fs", "io-util", "signal"] }
98tokio-rustls = { version = "0.26", optional = true, default-features = false, features = ["logging", "tls12", "ring"] }
99tokio-util = { version = "0.7", default-features = false, features = ["compat", "io"] }
100toml = "0.9"
101tracing = { version = "0.1", default-features = false, features = ["std"] }
102tracing-subscriber = { version = "0.3", default-features = false, features = ["smallvec", "registry", "parking_lot", "fmt", "ansi", "tracing-log", "local-time"] }
103
104[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies]
105mimalloc = { version = "0.1.48", features = ["v3"] }
106
107[target.'cfg(unix)'.dependencies]
108signal-hook = { version = "0.4.1", features = ["extended-siginfo"] }
109signal-hook-tokio = { version = "0.4.0", features = ["futures-v0_3"], default-features = false }
110tokio-metrics-collector = { version = "0.3.1", optional = true }
111
112[target.'cfg(windows)'.dependencies]
113windows-service = "0.8"
114
115[dev-dependencies]
116bytes = "1.11.1"
117serde_json = "1.0"
118
119[build-dependencies]
120shadow-rs = "1.4.0"
121
122[profile.release]
123codegen-units = 1
124debug = false
125debug-assertions = false
126lto = "fat"
127opt-level = 3
128panic = "abort"
129rpath = false
130strip = true
131
132[package.metadata.docs.rs]
133all-features = true
134rustdoc-args = ["--cfg", "docsrs", "--cfg", "tokio_unstable"]
135rustc-args = ["--cfg", "tokio_unstable"]
136
137# Cross: workaround for https://github.com/cross-rs/cross/issues/1345
138[package.metadata.cross.target.x86_64-unknown-netbsd]
139pre-build = [
140    "mkdir -p /tmp/netbsd",
141    "curl -fO https://ftp.uni-erlangen.de/netbsd/NetBSD-9.4/amd64/binary/sets/base.tar.xz",
142    "tar -C /tmp/netbsd -xJf base.tar.xz",
143    "cp /tmp/netbsd/usr/lib/libexecinfo.so /usr/local/x86_64-unknown-netbsd/lib",
144    "rm -rf base.tar.xz /tmp/netbsd",
145]