Skip to content

Commit 75d7fe9

Browse files
authored
Merge pull request #143 from dfinity/igor/diff-custom-domain
Add diff custom domain provider
2 parents 5c1281d + b0dc5b4 commit 75d7fe9

4 files changed

Lines changed: 27 additions & 12 deletions

File tree

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ http = "1.3.1"
4848
http-body = "1.0.1"
4949
http-body-util = "0.1.2"
5050
humantime = "2.2.0"
51-
ic-bn-lib = { git = "https://github.com/dfinity/ic-bn-lib", rev = "7f15e91888f76a6bfff9a59d478fdd11d76a5ff6", features = [
51+
ic-bn-lib = { git = "https://github.com/dfinity/ic-bn-lib", rev = "e23f4a8cf3bd7c06b8ef329d3c1e6117ea71b832", features = [
5252
"vector",
5353
"cert-providers",
5454
"clients-hyper",

src/cli.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ pub struct Domain {
262262
#[clap(env, long, value_delimiter = ',')]
263263
pub domain_custom_provider_timestamped: Vec<Url>,
264264

265+
/// List of generic differential custom domain provider URLs.
266+
/// It first downloads the full seed and then only applies incremental updates to it using a timestamp.
267+
#[clap(env, long, value_delimiter = ',')]
268+
pub domain_custom_provider_diff: Vec<Url>,
269+
265270
/// How frequently to poll custom domain providers for updates
266271
#[clap(env, long, default_value = "30s", value_parser = parse_duration)]
267272
pub domain_custom_provider_poll_interval: Duration,

src/core.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,16 @@ pub async fn main(
216216
}),
217217
);
218218

219+
custom_domain_providers.extend(cli.domain.domain_custom_provider_diff.iter().map(|x| {
220+
warn!("Adding diff custom domain provider: {x}");
221+
222+
Arc::new(custom_domains::GenericProviderDiff::new(
223+
http_client.clone(),
224+
x.clone(),
225+
cli.domain.domain_custom_provider_timeout,
226+
)) as Arc<dyn ProvidesCustomDomains>
227+
}));
228+
219229
// Setup WAF
220230
let waf_layer = if cli.waf.waf_enable {
221231
let v = WafLayer::new_from_cli(&cli.waf, Some(http_client.clone()))

0 commit comments

Comments
 (0)