Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
0

Configure Feed

Select the types of activity you want to include in your feed.

make slingshot's plc directory configurable at runtime

Allows configuration of the PLC directory to use, falling back on the default plc.directory used before.

+9 -2
+3 -2
slingshot/src/identity.rs
··· 22 22 }; 23 23 use atrium_common::resolver::Resolver; 24 24 use atrium_identity::{ 25 - did::{CommonDidResolver, CommonDidResolverConfig, DEFAULT_PLC_DIRECTORY_URL}, 25 + did::{CommonDidResolver, CommonDidResolverConfig}, 26 26 handle::{AtprotoHandleResolver, AtprotoHandleResolverConfig, DnsTxtResolver}, 27 27 }; 28 28 use atrium_oauth::DefaultHttpClient; // it's probably not worth bringing all of atrium_oauth for this but ··· 194 194 cache_dir: impl AsRef<Path>, 195 195 memory_mb: usize, 196 196 disk_gb: usize, 197 + plc_directory_url: String, 197 198 ) -> Result<Self, IdentityError> { 198 199 let http_client = Arc::new(DefaultHttpClient::default()); 199 200 let handle_resolver = AtprotoHandleResolver::new(AtprotoHandleResolverConfig { ··· 201 202 http_client: http_client.clone(), 202 203 }); 203 204 let did_resolver = CommonDidResolver::new(CommonDidResolverConfig { 204 - plc_directory_url: DEFAULT_PLC_DIRECTORY_URL.to_string(), 205 + plc_directory_url, 205 206 http_client: http_client.clone(), 206 207 }); 207 208
+6
slingshot/src/main.rs
··· 7 7 use std::net::SocketAddr; 8 8 use std::path::PathBuf; 9 9 10 + use atrium_identity::did::DEFAULT_PLC_DIRECTORY_URL; 10 11 use clap::Parser; 11 12 use tokio_util::sync::CancellationToken; 12 13 ··· 48 49 #[arg(long, env = "SLINGSHOT_IDENTITY_CACHE_DISK_DB")] 49 50 #[clap(default_value_t = 1)] 50 51 identity_cache_disk_gb: usize, 52 + /// the plc directory used to resolve did:plc identities 53 + #[arg(long, env = "SLINGSHOT_PLC_DIRECTORY")] 54 + #[clap(default_value = DEFAULT_PLC_DIRECTORY_URL)] 55 + plc_directory: String, 51 56 /// the domain pointing to this server 52 57 /// 53 58 /// if present: ··· 140 145 cache_dir.join("./identity"), 141 146 args.identity_cache_memory_mb, 142 147 args.identity_cache_disk_gb, 148 + args.plc_directory, 143 149 ) 144 150 .await 145 151 .map_err(|e| format!("identity setup failed: {e:?}"))?;