Skip to content

Commit

Permalink
Merge pull request #19 from nrdxp/no-validation
Browse files Browse the repository at this point in the history
No DNS validation
  • Loading branch information
nrdxp authored Sep 20, 2023
2 parents 4bd4253 + 3e27ec3 commit a85a20e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 46 deletions.
26 changes: 0 additions & 26 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ tokio = { version = "^1", features = ["rt-multi-thread", "macros"] }
cloudflare = "^0.10"
anyhow = "^1"
clap-verbosity-flag = "^2.0"
addr = "^0.15"

[dependencies.clap]
version = "^4.2"
Expand Down
21 changes: 2 additions & 19 deletions src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use cloudflare::{
},
framework::async_api::{ApiClient, Client},
};
use std::collections::HashSet;
use std::net::IpAddr;
use std::sync::Arc;

Expand Down Expand Up @@ -186,24 +185,8 @@ pub async fn get_records(
records.extend(handle.await??.result)
}

let mut start: HashSet<String> = cli.records.clone().into_iter().collect();
let mut invalid = vec![];
start.retain(|name| {
let mut res = false;
if let Ok(n) = addr::parse_domain_name(name) {
res = n.has_known_suffix();
}
if !res {
invalid.push(name.clone());
}
res
});

for name in invalid {
log::warn!("{} is an invalid domain name; skipping...", name);
}

let locals = start
let locals = cli
.records
.iter()
.map(|r| {
(
Expand Down

0 comments on commit a85a20e

Please sign in to comment.