mirror of
https://github.com/DNSCrypt/doh-server.git
synced 2025-04-03 04:57:37 +03:00
Compute a preliminary stamp
This commit is contained in:
parent
00cc43e2bb
commit
0403de66f1
3 changed files with 33 additions and 2 deletions
|
@ -18,6 +18,7 @@ tls = ["libdoh/tls"]
|
|||
[dependencies]
|
||||
libdoh = { path = "src/libdoh", version = "0.3.8", default-features = false }
|
||||
clap = "2.33.3"
|
||||
dnsstamps = "0.1.5"
|
||||
jemallocator = "0.3.2"
|
||||
|
||||
[package.metadata.deb]
|
||||
|
|
|
@ -21,6 +21,20 @@ pub fn parse_opts(globals: &mut Globals) {
|
|||
|
||||
let _ = include_str!("../Cargo.toml");
|
||||
let options = app_from_crate!()
|
||||
.arg(
|
||||
Arg::with_name("hostname")
|
||||
.short("H")
|
||||
.long("hostname")
|
||||
.takes_value(true)
|
||||
.help("Host name (not IP address) DoH clients will use to connect"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("public_address")
|
||||
.short("g")
|
||||
.long("public-address")
|
||||
.takes_value(true)
|
||||
.help("External IP address DoH clients will connect to"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("listen_address")
|
||||
.short("l")
|
||||
|
@ -123,7 +137,9 @@ pub fn parse_opts(globals: &mut Globals) {
|
|||
.short("i")
|
||||
.long("tls-cert-path")
|
||||
.takes_value(true)
|
||||
.help("Path to the PEM-encoded certificates (only required for built-in TLS)"),
|
||||
.help(
|
||||
"Path to the PEM/PKCS#8-encoded certificates (only required for built-in TLS)",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("tls_cert_key_path")
|
||||
|
@ -176,4 +192,18 @@ pub fn parse_opts(globals: &mut Globals) {
|
|||
.map(PathBuf::from)
|
||||
.or_else(|| globals.tls_cert_path.clone());
|
||||
}
|
||||
|
||||
if let Some(hostname) = matches.value_of("hostname") {
|
||||
let mut builder =
|
||||
dnsstamps::DoHBuilder::new(hostname.to_string(), globals.path.to_string());
|
||||
if let Some(public_address) = matches.value_of("public_address") {
|
||||
builder = builder.with_address(public_address.to_string());
|
||||
}
|
||||
println!(
|
||||
"Test DNS stamp to reach [{}]: [{}]",
|
||||
hostname,
|
||||
builder.serialize().unwrap()
|
||||
);
|
||||
println!("Check out https://dnscrypt.info/stamps/ to compute the actual stamp.\n")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ tls = ["tokio-rustls"]
|
|||
anyhow = "1.0.38"
|
||||
byteorder = "1.4.2"
|
||||
base64 = "0.13.0"
|
||||
futures = "0.3.12"
|
||||
futures = "0.3.13"
|
||||
hyper = { version = "0.14.4", default-features = false, features = ["server", "http1", "http2", "stream"] }
|
||||
tokio = { version = "1.2.0", features = ["net", "rt-multi-thread", "parking_lot", "time", "sync"] }
|
||||
tokio-rustls = { version = "0.22.0", features = ["early-data"], optional = true }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue