forked from static-web-server/static-web-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCargo.toml
160 lines (146 loc) · 5.51 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
[package]
name = "static-web-server"
version = "2.32.2"
edition = "2021"
rust-version = "1.72.0"
authors = ["Jose Quintana <https://joseluisq.net>"]
license = "MIT OR Apache-2.0"
description = "A cross-platform, high-performance and asynchronous web server for static files-serving."
repository = "https://github.com/static-web-server/static-web-server"
readme = "README.md"
homepage = "https://static-web-server.net"
keywords = [
"static-web-server",
"file-server",
"http-server"
]
categories = ["network-programming", "web-programming::http-server"]
include = [
"src/**/*.rs",
"build.rs",
"Cargo.toml",
"README.md",
"LICENSE-MIT",
"LICENSE-APACHE"
]
autotests = true
autoexamples = true
build = "build.rs"
[lib]
name = "static_web_server"
path = "src/lib.rs"
[[bin]]
name = "static-web-server"
path = "src/bin/server.rs"
doc = false
[features]
# All features enabled by default
default = ["compression", "http2", "directory-listing", "basic-auth", "fallback-page"]
# Include all features (used when building SWS binaries)
all = ["default", "experimental"]
# HTTP2
http2 = ["tokio-rustls", "rustls-pemfile"]
# Compression
compression = ["compression-brotli", "compression-deflate", "compression-gzip", "compression-zstd"]
compression-brotli = ["async-compression/brotli"]
compression-deflate = ["async-compression/deflate"]
compression-gzip = ["async-compression/deflate"]
compression-zstd = ["async-compression/zstd"]
# Directory listing
directory-listing = ["chrono", "maud"]
# Basic HTTP Authorization
basic-auth = ["bcrypt"]
# Fallback Page
fallback-page = []
# Experimental features
# --experimental-metrics
experimental = ["tokio-metrics-collector", "prometheus"]
[dependencies]
aho-corasick = "1.1"
anyhow = "1.0"
async-compression = { version = "0.4", default-features = false, optional = true, features = ["brotli", "deflate", "gzip", "zstd", "tokio"] }
bcrypt = { version = "0.15", optional = true }
bytes = "1.6"
chrono = { version = "0.4", default-features = false, features = ["std", "clock"], optional = true }
clap = { version = "=4.4", features = ["derive", "env"] }
compact_str = "0.8"
form_urlencoded = "1.2"
futures-util = { version = "0.3", default-features = false }
globset = { version = "0.4", features = ["serde1"] }
headers = "=0.3.0"
http = "0.2"
http-serde = "1.1"
hyper = { version = "0.14", features = ["stream", "http1", "http2", "tcp", "server"] }
lazy_static = "1.5"
listenfd = "1.0"
maud = { version = "0.26", optional = true }
mime_guess = "2.0"
mini-moka = "0.10.3"
percent-encoding = "2.3"
pin-project = "1.1"
regex = "1.10"
rustls-pemfile = { version = "2.1", optional = true }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_ignored = "0.1"
serde_json = "1.0"
serde_repr = "0.1"
shadow-rs = { version = "0.29", default-features = false }
tokio = { version = "=1.35.1", default-features = false, features = ["rt-multi-thread", "macros", "fs", "io-util", "signal"] }
tokio-rustls = { version = "0.26", optional = true, default-features = false, features = ["logging", "tls12", "ring"] }
tokio-util = { version = "0.7", default-features = false, features = ["io"] }
toml = "0.8"
tracing = { version = "0.1", default-features = false, features = ["std"] }
tracing-subscriber = { version = "0.3", default-features = false, features = ["smallvec", "registry", "parking_lot", "fmt", "ansi", "tracing-log"] }
getrandom = "=0.2.10"
triomphe = "=0.1.3"
rustix = "=0.38.30"
sha-1 = "=0.8.0"
[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.tikv-jemallocator]
version = "0.6"
[target.'cfg(unix)'.dependencies]
signal-hook = { version = "0.3", features = ["extended-siginfo"] }
signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"], default-features = false }
tokio-metrics-collector = { version = "0.2", optional = true }
prometheus = { version = "0.13", optional = true }
[target.'cfg(windows)'.dependencies]
windows-service = "0.7"
[dev-dependencies]
bytes = "1.6"
serde_json = "1.0"
[build-dependencies]
shadow-rs = { version = "0.29", default-features = false }
[profile.release]
codegen-units = 1
debug = false
debug-assertions = false
lto = "fat"
opt-level = 3
panic = "abort"
rpath = false
strip = true
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
# Cross: workaround for https://github.com/cross-rs/cross/issues/1345
[package.metadata.cross.target.x86_64-unknown-netbsd]
pre-build = [
"mkdir -p /tmp/netbsd",
"curl https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.2/amd64/binary/sets/base.tar.xz -O",
"tar -C /tmp/netbsd -xJf base.tar.xz",
"cp /tmp/netbsd/usr/lib/libexecinfo.so /usr/local/x86_64-unknown-netbsd/lib",
"rm base.tar.xz",
"rm -rf /tmp/netbsd",
]
# Cross: Linux ARM64 Musl only
[package.metadata.cross.target.aarch64-unknown-linux-musl.env]
# workaround for jemalloc on ARM64 (musl) by using 64KB pagesize by default (max value)
# - https://github.com/static-web-server/static-web-server/issues/440
# - https://github.com/jemalloc/jemalloc/issues/467
passthrough = ["JEMALLOC_SYS_WITH_LG_PAGE=16"]
[patch.crates-io]
libc = { git = "https://github.com/wasix-org/libc.git", branch = "v0.2.152" }
socket2 = { git = "https://github.com/wasix-org/socket2.git", branch = "v0.5.5" }
tokio = { git = "https://github.com/wasix-org/tokio.git", branch = "wasix-1.35.1" }
signal-hook-registry = { git = "https://github.com/wasix-org/signal-hook", branch = "registry-v1.1.1" }
hyper = { git = "https://github.com/wasix-org/hyper", branch = "v0.14.28" }
ring = { git = "https://github.com/wasix-org/ring", branch = "0.17.7" }