-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCargo.toml
More file actions
261 lines (224 loc) · 5.9 KB
/
Copy pathCargo.toml
File metadata and controls
261 lines (224 loc) · 5.9 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
[workspace]
members = [".", "lazydns-macros"]
[package]
name = "lazydns"
version = "0.3.14"
edition = "2024"
authors = ["lazywalker <lazywalkerz@gmail.com>"]
description = "A light and fast DNS server/forwarder implementation in Rust"
repository = "https://github.com/lazywalker/lazydns"
license = "GPL-3.0-or-later"
readme = "README.md"
keywords = ["dns", "smartdns", "doh", "dot", "doq"]
categories = ["network-programming"]
[dependencies]
tokio = { version = "1.49", default-features = false, features = [
"rt",
"signal",
"macros",
"process",
] }
# DNS protocol
hickory-proto = "0.24"
# Serialization
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_yaml = "0.9"
serde_json = "1.0"
# Error handling
anyhow = "1.0"
thiserror = "2.0"
# Logging
tracing = "0.1"
lazylog = { git = "https://github.com/lazywalker/lazylog", version = "0.1.6", optional = true, default-features = false }
# Time crate for cron plugin
time = { version = "0.3", default-features = false, optional = true }
# cron expression parsing for cron plugin
cronexpr = { version = "1.4", optional = true }
# Async utilities
async-trait = "0.1"
# Concurrent data structures
dashmap = "6.1"
parking_lot = "0.12"
# LRU cache
lru = "0.16"
# Networking
axum = { version = "0.8", default-features = false, features = [
"json",
"query",
"tokio",
"macros",
# FIXME: connection will reset when test curl with admin features with http2
"http1",
], optional = true }
rustls = { version = "0.23", default-features = false, features = [
"ring",
], optional = true }
tokio-rustls = { version = "0.26", optional = true }
rustls-pemfile = { version = "2.0", optional = true }
reqwest = { version = "0.12", default-features = false, features = [
"json",
"rustls-tls",
] }
# QUIC / DoQ support (optional)
quinn = { version = "0.11", optional = true }
# Base64 encoding
base64 = "0.22"
# Procedural macros for plugin registration (workspace member)
lazydns-macros = { path = "lazydns-macros", version = "0.2.62" }
# Metrics
prometheus = { version = "0.14", optional = true }
# File watching for hot reload
notify = "8.2"
# CLI
pico-args = "0.5"
# Utilities
once_cell = "1.19"
linkme = "0.3"
regex = "1.10"
ipnet = "2.9"
rand = "0.9"
libc = "0.2"
# WebUI dependencies (optional)
tower = { version = "0.5", optional = true }
tower-http = { version = "0.6", features = [
"fs",
"cors",
"trace",
], optional = true }
futures-util = { version = "0.3", features = ["sink"], optional = true }
uuid = { version = "1.11", features = ["v4"], optional = true }
async-stream = { version = "0.3", optional = true }
# Embedded WebUI assets (optional)
rust-embed = { version = "8", optional = true, features = ["mime-guess"] }
# Optional TLS-enabled HTTP server for DoH production deployments.
axum-server = { version = "0.8", optional = true, package = "axum-server", default-features = false, features = [
"tls-rustls-no-provider",
] }
[dev-dependencies]
tempfile = "3.24"
rcgen = "0.14"
criterion = "0.8"
[[bench]]
name = "forward_clone"
harness = false
[[bench]]
name = "forward_concurrent"
harness = false
[[bench]]
name = "arc_str_bench"
harness = false
[features]
default = ["log-ansi"]
audit = ["time/formatting", "time/local-offset", "time/macros"]
full = [
"audit",
"cron",
"log-ansi",
"log-file",
"dot",
"doh",
"doq",
"admin",
"metrics",
"web-embed",
]
# Enable cron expression parsing for cron plugin
cron = ["cronexpr", "time/local-offset", "time/parsing", "time/formatting"]
# Enable structured logging with lazylog
log = ["lazylog/time"]
# Enable ANSI-colored logging output to terminal
log-ansi = ["log", "lazylog/ansi"]
# Enable logging to file
log-file = ["log", "lazylog/file"]
# Enable TLS-backed (DoT using tokio-rustls) server implementation
dot = ["rustls", "rustls-pemfile", "tokio-rustls"]
# Enable TLS-backed (DoH using axum-server + rustls) server implementation
doh = ["rustls", "rustls-pemfile", "tokio-rustls", "axum-server", "axum"]
# Enable DoQ (QUIC) server implementation
doq = ["rustls", "rustls-pemfile", "quinn"]
# Enable admin HTTP server
admin = ["axum"]
# Enable metrics endpoint
metrics = ["axum", "prometheus"]
# Enable WebUI server with real-time streaming
web = [
"axum",
"axum/ws",
"audit",
"tokio/sync",
"tower",
"tower-http",
"futures-util",
"uuid",
"async-stream",
]
# Enable embedded WebUI assets (compile webui/dist into binary)
web-embed = ["web", "rust-embed"]
[profile.release]
opt-level = 3
lto = true
debug = false
codegen-units = 1
split-debuginfo = "off"
strip = true
[profile.dev]
opt-level = 0
[profile.test]
opt-level = 1
[profile.minimal]
inherits = "release"
panic = "abort"
opt-level = "z"
[profile.full]
inherits = "minimal"
[[bin]]
name = "lazydns"
path = "src/main.rs"
[lib]
name = "lazydns"
path = "src/lib.rs"
[[example]]
name = "metrics_collector_demo"
path = "examples/metrics/metrics_collector_demo.rs"
[[example]]
name = "prometheus_metrics_collector_demo"
path = "examples/metrics/prometheus_metrics_collector_demo.rs"
[package.metadata.deb]
maintainer = "lazywalker <lazywalkerz@gmail.com>"
copyright = "2025, lazywalker <lazywalkerz@gmail.com>"
license-file = ["LICENSE"]
extended-description = """\
A light and fast DNS server/forwarder implementation in Rust.
"""
section = "net"
priority = "optional"
assets = [
# `target/release` path is special and will be replaced by cargo-deb at build time
[
"target/release/lazydns",
"usr/bin/",
"755",
],
[
"etc/lazydns/config.yaml",
"etc/lazydns/",
"644",
],
[
"docs/man/lazydns.1.gz",
"usr/share/man/man1/",
"644",
],
[
"docs/man/lazydns.5.gz",
"usr/share/man/man5/",
"644",
],
[
"docs/man/lazydns.8.gz",
"usr/share/man/man8/",
"644",
],
]
maintainer-scripts = "etc/systemd/"
systemd-units = { enable = true }