rename to sshcd

This commit is contained in:
2023-07-09 19:12:27 +02:00
parent f47c57c1c0
commit e7c3a9f116
6 changed files with 21 additions and 8 deletions

View File

@@ -5,7 +5,7 @@ authors = ["shimun <shimun@shimun.net>"]
edition = "2021"
[[bin]]
name = "ssh-cert-dist"
name = "sshcd"
path = "src/main.rs"
[dependencies]
@@ -17,7 +17,7 @@ clap = { version = "4.0.29", features = ["env", "derive"] }
rand = "0.8.5"
reqwest = { version = "0.11.13" }
serde = { version = "1.0.148", features = ["derive"] }
ssh-key = { version = "0.6.0-pre.0", features = ["ed25519", "p256", "p384", "rsa"] }
ssh-key = { version = "0.6.0-pre.0", features = ["ed25519", "p256", "p384", "rsa", "serde"] }
thiserror = "1.0.37"
tokio = { version = "1.22.0", features = ["io-std", "test-util", "tracing", "macros", "fs"] }
tracing = { version = "0.1.37", features = ["release_max_level_debug"] }

View File

@@ -117,12 +117,12 @@ async fn fetch(
}: FetchArgs,
) -> anyhow::Result<()> {
let certs = read_certs_dir(&cert_dir).await?;
let publics_keys = read_pubkey_dir(&cert_dir).await?;
// let publics_keys = read_pubkey_dir(&cert_dir).await?;
let client = reqwest::Client::new();
let threshold_exp = min_delta.and_then(|min_delta| {
SystemTime::now().checked_add(Duration::from_secs(60 * 60 * 24 * min_delta as u64))
});
let standalone_certs = publics_keys.into_iter().map(|(name, key)| )
// let standalone_certs = publics_keys.into_iter().map(|(name, key)| )
let updates = certs
.into_iter()
.filter(|cert| {