Skip to content

Commit

Permalink
chore(deps): Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
alcroito committed Dec 11, 2024
1 parent e08f710 commit 76571f9
Show file tree
Hide file tree
Showing 12 changed files with 1,203 additions and 714 deletions.
1,819 changes: 1,156 additions & 663 deletions Cargo.lock

Large diffs are not rendered by default.

28 changes: 13 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ clap = { version = "4", features = ["cargo", "derive"] }
color-eyre = "0.6"
figment = { version = "0.10", features = ["env", "toml", "test"] }
figment_file_provider_adapter = "0.1"
hickory-resolver = "0.24"
humantime = "2"
humantime-serde = "1"
itertools = "0.12"
itertools = "0.13"
native-tls = { version = "0.2", features = ["vendored"] }
once_cell = "1"
reqwest = { version = "0.12", features = ["blocking", "json"] }
secrecy = { version = "0.8", features = ["serde"] }
secrecy = { version = "0.10", features = ["serde"] }
serde = { version = "1", features = ["derive", "rc"] }
serde_json = "1"
serde_with = "3"
Expand All @@ -32,14 +33,13 @@ tailsome = "1"
tracing = "0.1"
tracing-log = "0.2"
tracing-subscriber = "0.3"
trust-dns-resolver = "0.23"

# Stats feature dependencies
cfg-if = "1"
diesel = { version = "2", features = ["sqlite", "chrono"]}
diesel_migrations = { version = "2", features = ["sqlite"]}
directories = "5"
libsqlite3-sys = { version = "0.28", features = ["bundled"]}
libsqlite3-sys = { version = "0.30", features = ["bundled"]}

# Web server dependencies
aide = { version = "0.13", features = [
Expand All @@ -60,24 +60,22 @@ hyper-util = { version = "0" }
mime_guess = { version = "2" }
rust-embed = { version = "8", features = ["debug-embed"]}
schemars = { version = "0.8", features = ["chrono"] }
tower = { version = "0.4", features = ["full"] }
tower-http = { version = "0.5", features = ["full"] }
tower = { version = "0.5", features = ["full"] }
tower-http = { version = "0.6", features = ["full"] }
tokio = { version = "1", features = ["full"] }

# workspace.build-dependencies (not actually a valid key, so needs to be part of
# workspace.build-dependencies (not actually a valid key, so needs to be part of
# regular dependencies)
# Keep anyhow, because vergen depends on it.
anyhow = "1"
vergen = { version = "8", features = [
vergen-gitcl = { version = "1", features = [
"build",
"cargo",
"git",
"gitcl",
"rustc",
"si",
] }

# workspace.dev-dependencies (not actually a valid key, so needs to be part of
# workspace.dev-dependencies (not actually a valid key, so needs to be part of
# regular dependencies)
tempfile = "3"

Expand All @@ -89,9 +87,10 @@ tempfile = "3"

[workspace.lints.rust]
unsafe_code = "deny"
future_incompatible = "warn"
nonstandard_style = "warn"
rust_2018_idioms = "warn"
future_incompatible = { level = "warn", priority = -1 }
nonstandard_style = { level = "warn", priority = -1 }
rust_2018_idioms = { level = "warn", priority = -1 }
unexpected_cfgs = "warn"

[workspace.lints.clippy]
all = "warn"
Expand Down Expand Up @@ -134,7 +133,6 @@ match_same_arms = "warn"
match_wild_err_arm = "warn"
match_wildcard_for_single_variants = "warn"
mem_forget = "warn"
mismatched_target_os = "warn"
missing_enforced_import_renames = "warn"
mut_mut = "warn"
mutex_integer = "warn"
Expand Down
6 changes: 2 additions & 4 deletions crates/dyndns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ clap = { workspace = true, features = ["cargo", "derive"] }
color-eyre.workspace = true
figment = { workspace = true, features = ["env", "toml", "test"] }
figment_file_provider_adapter.workspace = true
hickory-resolver.workspace = true
humantime.workspace = true
humantime-serde.workspace = true
itertools.workspace = true
Expand All @@ -66,7 +67,6 @@ tailsome.workspace = true
tracing.workspace = true
tracing-log.workspace = true
tracing-subscriber.workspace = true
trust-dns-resolver.workspace = true

# Stats feature dependencies
cfg-if.workspace = true
Expand Down Expand Up @@ -101,11 +101,9 @@ tokio = { workspace = true, features = ["full"], optional = true }
[build-dependencies]
# Keep anyhow, because vergen depends on it.
anyhow.workspace = true
vergen = { workspace = true, features = [
vergen-gitcl = { workspace = true, features = [
"build",
"cargo",
"git",
"gitcl",
"rustc",
"si",
] }
Expand Down
17 changes: 9 additions & 8 deletions crates/dyndns/build.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
use anyhow::Result;
use vergen::EmitBuilder;
use vergen_gitcl::{
BuildBuilder, CargoBuilder, Emitter, GitclBuilder, RustcBuilder, SysinfoBuilder,
};

fn main() -> Result<()> {
EmitBuilder::builder()
.all_build()
.all_cargo()
.all_git()
.git_describe(true, true, None)
.all_rustc()
.all_sysinfo()
Emitter::default()
.add_instructions(&BuildBuilder::all_build()?)?
.add_instructions(&CargoBuilder::all_cargo()?)?
.add_instructions(&GitclBuilder::all_git()?)?
.add_instructions(&RustcBuilder::all_rustc()?)?
.add_instructions(&SysinfoBuilder::all_sysinfo()?)?
.emit()?;
Ok(())
}
2 changes: 1 addition & 1 deletion crates/dyndns/src/config/app_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ where
use serde::de::{self, Visitor};

struct LogLevelVisitor;
impl<'de> Visitor<'de> for LogLevelVisitor {
impl Visitor<'_> for LogLevelVisitor {
type Value = tracing::Level;

fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Expand Down
13 changes: 6 additions & 7 deletions crates/dyndns/src/config/app_config_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ fn get_config_path_from_candidates(candidates: &[String]) -> Option<String> {
})
.map(|path| path.to_owned());

match &config_file {
Some(path) => trace!("Final config file chosen: {}", path),
None => trace!("No valid config file found. Make sure required options are set via command line options or environment variables."),
if let Some(path) = &config_file {
trace!("Final config file chosen: {}", path);
} else {
trace!("No valid config file found. Make sure required options are set via command line options or environment variables.");
};
config_file
}
Expand All @@ -86,18 +87,16 @@ pub fn config_with_args(early_config: &EarlyConfig) -> Result<AppConfig> {
let config_file_path = get_config_path(clap_matches);
let config_builder = AppConfigBuilder::new(Some(clap_matches), config_file_path);
let config = config_builder
.map_err(|e| {
.inspect_err(|_e| {
tracing::error!(
"Failed to initialize configuration system. Will exit shortly with error details."
);
e
})?
.build()
.map_err(|e| {
.inspect_err(|_e| {
tracing::error!(
"Failed to configure the application. Will exit shortly with error details."
);
e
})
.wrap_err(eyre!("Failed to configure the application"))?;
Ok(config)
Expand Down
2 changes: 1 addition & 1 deletion crates/dyndns/src/db/crud/domain_ip_fetches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn get_domain_ip_fetches(conn: &mut SqliteConnection) -> Result<Vec<DomainIp
Ok(results)
}

sql_function! {
define_sql_function! {
/// Represents the SQL last_insert_row() function
fn last_insert_rowid() -> diesel::sql_types::BigInt;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/dyndns/src/db/crud/domain_record_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn get_domain_record_updates(conn: &mut SqliteConnection) -> Result<Vec<Doma
Ok(results)
}

sql_function! {
define_sql_function! {
/// Represents the SQL last_insert_row() function
fn last_insert_rowid() -> diesel::sql_types::BigInt;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/dyndns/src/db/crud/updater_attempts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub fn get_updater_attempts(conn: &mut SqliteConnection) -> Result<Vec<UpdaterAt
Ok(results)
}

sql_function! {
define_sql_function! {
/// Represents the SQL last_insert_row() function
fn last_insert_rowid() -> diesel::sql_types::BigInt;
}
Expand Down
8 changes: 4 additions & 4 deletions crates/dyndns/src/ip_fetcher.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use color_eyre::eyre::{bail, Result, WrapErr};
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use tracing::info;
use trust_dns_resolver::config::{
use hickory_resolver::config::{
LookupIpStrategy, NameServerConfigGroup, ResolverConfig, ResolverOpts,
};
use trust_dns_resolver::Resolver;
use hickory_resolver::Resolver;
use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
use tracing::info;

use crate::types::{DisplayIpAddrV4AndV6Pretty, IpAddrV4AndV6};

Expand Down
16 changes: 8 additions & 8 deletions crates/dyndns/src/token.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
use crate::types::ValueFromStr;
use color_eyre::eyre::Error;
use secrecy::Secret;
use secrecy::zeroize::Zeroize;
use secrecy::SecretBox;
use serde::{Deserialize, Serialize};

#[derive(Clone, Serialize, Deserialize)]
pub struct DigitalOceanToken(String);

pub type SecretDigitalOceanToken = Secret<DigitalOceanToken>;
pub type SecretDigitalOceanToken = SecretBox<DigitalOceanToken>;

impl DigitalOceanToken {
pub fn as_str(&self) -> &str {
self.0.as_str()
}
}

impl secrecy::Zeroize for DigitalOceanToken {
impl Zeroize for DigitalOceanToken {
fn zeroize(&mut self) {
self.0.zeroize();
}
}

impl secrecy::CloneableSecret for DigitalOceanToken {}
impl secrecy::DebugSecret for DigitalOceanToken {}
impl secrecy::SerializableSecret for DigitalOceanToken {}

impl std::str::FromStr for DigitalOceanToken {
Expand All @@ -32,14 +32,14 @@ impl std::str::FromStr for DigitalOceanToken {
}
}

impl ValueFromStr for Secret<DigitalOceanToken> {
impl ValueFromStr for SecretBox<DigitalOceanToken> {
type Err = Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Secret::new(s.parse::<DigitalOceanToken>()?))
Ok(SecretBox::new(Box::new(s.parse::<DigitalOceanToken>()?)))
}
}

pub fn parse_secret_token(s: &str) -> Result<Secret<DigitalOceanToken>, Error> {
Ok(Secret::new(s.parse::<DigitalOceanToken>()?))
pub fn parse_secret_token(s: &str) -> Result<SecretBox<DigitalOceanToken>, Error> {
Ok(SecretBox::new(Box::new(s.parse::<DigitalOceanToken>()?)))
}
2 changes: 1 addition & 1 deletion crates/dyndns/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl Display for IpAddrV4AndV6 {

pub struct DisplayIpAddrV4AndV6Pretty<'a>(pub &'a IpAddrV4AndV6);

impl<'a> Display for DisplayIpAddrV4AndV6Pretty<'a> {
impl Display for DisplayIpAddrV4AndV6Pretty<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if self.0.has_both() {
writeln!(f, "Public IPs are:")?;
Expand Down

0 comments on commit 76571f9

Please sign in to comment.