Skip to content

Commit

Permalink
disable currently not working features
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-jq-b authored and zh-jq committed Apr 5, 2024
1 parent 41e4901 commit f131352
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux-musl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
env:
CARGO_TERM_COLOR: always
MUSL_TARGET: x86_64-unknown-linux-musl
MUSL_FEATURES: --no-default-features --features vendored-openssl,quic,vendored-c-ares,hickory,geoip
MUSL_FEATURES: --no-default-features --features vendored-openssl,vendored-c-ares,hickory,geoip

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion demo/test-resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@ slog = { workspace = true, features = ["max_level_trace", "release_max_level_inf
slog-scope = "4"
slog-stdlog = "4"
g3-types = { workspace = true, features = ["async-log"] }
g3-resolver = { workspace = true, features = ["hickory"] }
g3-resolver.workspace = true
g3-stdlog.workspace = true

[features]
default = []
hickory = [ "g3-resolver/hickory" ]

[[bin]]
name = "test-resolver"
required-features = ["g3-resolver/hickory"]
2 changes: 1 addition & 1 deletion g3bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ g3-hickory-client.workspace = true
rustc_version.workspace = true

[features]
default = ["quic"]
default = []
quic = ["g3-types/quic", "g3-socks/quic", "g3-io-ext/quic", "g3-hickory-client/quic", "dep:quinn", "dep:h3", "dep:h3-quinn"]
vendored-openssl = ["openssl/vendored", "openssl-probe"]
vendored-tongsuo = ["openssl/tongsuo", "openssl-probe", "g3-types/tongsuo"]
Expand Down
2 changes: 1 addition & 1 deletion g3proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ tokio-util = { workspace = true, features = ["io"] }
rustc_version.workspace = true

[features]
default = ["lua54", "python", "c-ares", "hickory", "geoip", "quic"]
default = ["lua54", "python", "c-ares", "hickory", "geoip"]
lua = ["mlua"]
luajit = ["lua", "mlua/luajit"]
lua51 = ["lua", "mlua/lua51"]
Expand Down
4 changes: 4 additions & 0 deletions g3proxy/src/config/resolver/hickory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ impl HickoryResolverConfig {
self.driver.get_server_port()
}

pub(crate) fn get_encryption_summary(&self) -> Option<String> {
self.driver.get_encryption().map(|c| c.summary())
}

pub(crate) fn parse(
map: &yaml::Hash,
position: Option<YamlDocPosition>,
Expand Down
2 changes: 1 addition & 1 deletion g3tiles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ g3tiles-proto = { path = "proto" }
rustc_version.workspace = true

[features]
default = ["quic"]
default = []
quic = ["g3-daemon/quic", "dep:quinn"]
vendored-openssl = ["openssl/vendored", "openssl-probe"]
vendored-tongsuo = ["openssl/tongsuo", "openssl-probe", "g3-yaml/tongsuo", "g3-types/tongsuo"]
Expand Down
3 changes: 2 additions & 1 deletion lib/g3-resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ c-ares-resolver = { workspace = true, optional = true }
c-ares-sys = { workspace = true, optional = true } # for DEP_ version check
hickory-client = { workspace = true, optional = true }
hickory-proto = { workspace = true, optional = true, features = ["tokio-runtime"] }
rustls = { workspace = true, optional = true }
rustls-pki-types = { workspace = true, optional = true }
flume = { workspace = true, optional = true, features = ["async"] }
async-recursion = { workspace = true, optional = true }
Expand All @@ -30,5 +31,5 @@ g3-hickory-client = { workspace = true, optional = true }
default = []
c-ares = ["dep:c-ares", "dep:c-ares-resolver", "dep:c-ares-sys"]
vendored-c-ares = ["c-ares", "c-ares-resolver/vendored", "c-ares/vendored"]
hickory = ["dep:hickory-client", "dep:hickory-proto", "dep:flume", "dep:rustls-pki-types", "dep:async-recursion", "dep:g3-hickory-client", "g3-types/rustls"]
hickory = ["dep:hickory-client", "dep:hickory-proto", "dep:flume", "dep:rustls", "dep:rustls-pki-types", "dep:async-recursion", "dep:g3-hickory-client", "g3-types/rustls"]
quic = ["g3-types?/quic", "g3-hickory-client?/quic"]
11 changes: 6 additions & 5 deletions lib/g3-resolver/src/driver/hickory/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ use async_recursion::async_recursion;
use hickory_client::client::{AsyncClient, ClientHandle};
use hickory_proto::iocompat::AsyncIoTokioAsStd;
use hickory_proto::rr::{DNSClass, Name, RData, RecordType};
use rustls::{ClientConfig, ServerName};
use rustls::ClientConfig;
use rustls_pki_types::ServerName;
use tokio::net::{TcpStream, UdpSocket};
use tokio::sync::mpsc;

Expand Down Expand Up @@ -307,7 +308,7 @@ impl HickoryClientConfig {
async fn new_dns_over_tls_client(
&self,
tls_client: ClientConfig,
tls_name: ServerName,
tls_name: ServerName<'static>,
) -> anyhow::Result<AsyncClient> {
use hickory_proto::BufDnsStreamHandle;

Expand Down Expand Up @@ -337,7 +338,7 @@ impl HickoryClientConfig {
async fn new_dns_over_h2_client(
&self,
tls_client: ClientConfig,
tls_name: ServerName,
tls_name: ServerName<'static>,
) -> anyhow::Result<AsyncClient> {
let client_connect = g3_hickory_client::io::h2::connect(
self.target,
Expand All @@ -359,7 +360,7 @@ impl HickoryClientConfig {
async fn new_dns_over_quic_client(
&self,
tls_client: ClientConfig,
tls_name: &ServerName,
tls_name: &ServerName<'static>,
) -> anyhow::Result<AsyncClient> {
let tls_name = match tls_name {
ServerName::DnsName(domain) => domain.as_ref().to_string(),
Expand Down Expand Up @@ -387,7 +388,7 @@ impl HickoryClientConfig {
async fn new_dns_over_h3_client(
&self,
tls_client: ClientConfig,
tls_name: &ServerName,
tls_name: &ServerName<'static>,
) -> anyhow::Result<AsyncClient> {
let tls_name = match tls_name {
ServerName::DnsName(domain) => domain.as_ref().to_string(),
Expand Down
14 changes: 14 additions & 0 deletions lib/g3-types/src/net/dns/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,20 @@ impl DnsEncryptionConfigBuilder {
self.tls_config = config_builder;
}

pub fn summary(&self) -> String {
match &self.tls_name {
ServerName::DnsName(n) => format!("{}({})", self.protocol.as_str(), n.as_ref()),
ServerName::IpAddress(ip) => {
format!(
"{}({})",
self.protocol.as_str(),
std::net::IpAddr::from(*ip)
)
}
_ => format!("{}(other)", self.protocol.as_str()), // FIXME support other server name variants
}
}

pub fn build_tls_client_config(&self) -> anyhow::Result<RustlsClientConfig> {
self.tls_config.build()
}
Expand Down

0 comments on commit f131352

Please sign in to comment.