feat(config): add more default crawlers/relays

This commit is contained in:
nelind
2026-07-14 20:51:04 +02:00
committed by Tangled
parent e41f34746a
commit 4416f50c87
2 changed files with 22 additions and 13 deletions
+20 -11
View File
@@ -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<Vec<String>>,
}
#[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<String> {
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<String>,
}
#[derive(Debug, Config)]
+2 -2
View File
@@ -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 {