Skip to content
This repository was archived by the owner on May 18, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,199 changes: 548 additions & 651 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/src/commands/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl ComtryaCommand for Apply {
let (local_dependency_prefix, _) = name.rsplit_once('.').unwrap_or((name, ""));

let resolved_dependency_name =
dependency.replace("./", format!("{}.", local_dependency_prefix).as_str());
dependency.replace("./", format!("{local_dependency_prefix}.").as_str());

let m1 = match manifests.get(&resolved_dependency_name) {
Some(manifest) => manifest,
Expand Down
2 changes: 1 addition & 1 deletion app/tests/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub(crate) fn run(cli: &'static str) -> Assert {

pub(crate) fn cd(path: PathBuf) -> Dir {
if !path.exists() {
panic!("could not 'cd' into non-existing file: {:?}", path);
panic!("could not 'cd' into non-existing file: {path:?}");
}

Dir {
Expand Down
2 changes: 1 addition & 1 deletion jsonschemagen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ fn main() {
let schema = schema_for!(Manifest);

if let Ok(output) = serde_json::to_string_pretty(&schema) {
println!("{}", output);
println!("{output}");
}
}
2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tokio = "1.49"
toml = "1.0"
tera = "1.20"
tracing = "0.1"
trust-dns-resolver = "0.23.2"
hickory-resolver = "0.25.2"
walkdir = "2.5"
which = "8.0"
whoami = "2.1"
Expand Down
2 changes: 1 addition & 1 deletion lib/src/actions/file/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl Action for FileCopy {
Err(err) => {
return Err(anyhow!(
"Failed to get contents for FileCopy action: {}",
err.to_string()
err
));
}
};
Expand Down
6 changes: 3 additions & 3 deletions lib/src/actions/file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ pub trait FileAction: Action {
.map_err(|e| {
anyhow!(
"Resolution of {} failed in manifest {} because {}",
path.to_string(),
path,
manifest
.name
.as_ref()
.unwrap_or(&"cannot extract manifest name".to_string()),
e.to_string()
e
)
})?
.as_path()
Expand All @@ -50,7 +50,7 @@ pub trait FileAction: Action {
"Failed because {} was not found",
file_path.to_string_lossy()
),
_ => anyhow!("Failed because {}", e.to_string()),
_ => anyhow!("Failed because {}", e),
})
}
}
Expand Down
16 changes: 11 additions & 5 deletions lib/src/contexts/variable_include/dns.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
use std::collections::HashMap;

use anyhow::Result;
use hickory_resolver::config::ResolverConfig;
use hickory_resolver::name_server::TokioConnectionProvider;
use hickory_resolver::Resolver;
use reqwest::Url;
use trust_dns_resolver::config::ResolverConfig;
use trust_dns_resolver::config::ResolverOpts;
use trust_dns_resolver::Resolver;
use tokio::runtime::Runtime;

pub fn txt_record_values(url: &Url, contexts: &mut HashMap<String, String>) -> Result<()> {
let resolver = Resolver::new(ResolverConfig::default(), ResolverOpts::default())?;
let resolver = Resolver::builder_with_config(
ResolverConfig::default(),
TokioConnectionProvider::default(),
)
.build();

let host = url
.host_str()
.ok_or_else(|| anyhow::anyhow!("Failed to parse host"))?;

let records = resolver.txt_lookup(host)?;
let rt = Runtime::new()?;
let records = rt.block_on(resolver.txt_lookup(host))?;

for record in records {
if let Some((key, value)) = record.to_string().split_once('=') {
Expand Down