From 4416f50c8784db53a1fafb60c0c6e6b018109397 Mon Sep 17 00:00:00 2001 From: nelind Date: Tue, 14 Jul 2026 20:51:04 +0200 Subject: [PATCH] feat(config): add more default crawlers/relays --- crates/tranquil-config/src/lib.rs | 31 +++++++++++++++++++---------- crates/tranquil-pds/src/crawlers.rs | 4 ++-- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/crates/tranquil-config/src/lib.rs b/crates/tranquil-config/src/lib.rs index b948934..e1a5ce3 100644 --- a/crates/tranquil-config/src/lib.rs +++ b/crates/tranquil-config/src/lib.rs @@ -853,18 +853,27 @@ pub struct FirehoseConfig { pub max_concurrent_repo_exports: usize, /// List of relay / crawler notification URLs. - #[config(env = "CRAWLERS", parse_env = split_comma_list)] - pub crawlers: Option>, -} + #[config(env = "CRAWLERS", parse_env = split_comma_list, default = [ + // If you know of more relays it makes sense to have here by all means make a PR! + // All we request is that you only add "major" relays. + // What exactly "major" means is up to interpretation and we will make the final call, + // but a good rule of thumb is "most people are likely to add the relay if they know about it" -impl FirehoseConfig { - /// Returns the list of crawler URLs, falling back to `["https://bsky.network"]` - /// when none are configured. - pub fn crawler_list(&self) -> Vec { - self.crawlers - .clone() - .unwrap_or_else(|| vec!["https://bsky.network".to_string()]) - } + // Microcosm relays + "https://relay.fire.hose.cam", + "https://relay3.fr.hose.cam", + // PBC relay + "https://bsky.network", + // firehose.network relays + "https://northamerica.firehose.network", + "https://europe.firehose.network", + "https://asia.firehose.network", + // Blacksky relay + "https://atproto.africa", + // UpCloud relay + "https://relay.upcloud.world", + ])] + pub crawlers: Vec, } #[derive(Debug, Config)] diff --git a/crates/tranquil-pds/src/crawlers.rs b/crates/tranquil-pds/src/crawlers.rs index a9ed6c2..7284d3a 100644 --- a/crates/tranquil-pds/src/crawlers.rs +++ b/crates/tranquil-pds/src/crawlers.rs @@ -47,13 +47,13 @@ impl Crawlers { return None; } - let crawler_urls = cfg.firehose.crawler_list(); + let crawler_urls = &cfg.firehose.crawlers; if crawler_urls.is_empty() { return None; } - Some(Self::new(hostname.to_string(), crawler_urls)) + Some(Self::new(hostname.to_string(), crawler_urls.clone())) } fn should_notify(&self) -> bool {