at protocol indexer with flexible filtering, xrpc queries, and a cursor-backed event stream, built on fjall
at-protocol atproto indexer rust fjall

[config] remove LOG_LEVEL, use RUST_LOG instead

ptr.pet 8990a2ff 88cb2848

verified
+9 -15
+2 -2
README.md
··· 22 23 ## configuration 24 25 - `hydrant` is configured via environment variables. all variables are prefixed with `HYDRANT_`. 26 27 | variable | default | description | 28 | :--- | :--- | :--- | 29 | `DATABASE_PATH` | `./hydrant.db` | path to the database folder. | 30 - | `LOG_LEVEL` | `info` | log level (e.g., `debug`, `info`, `warn`, `error`). | 31 | `RELAY_HOST` | `wss://relay.fire.hose.cam` | websocket URL of the upstream firehose relay. | 32 | `PLC_URL` | `https://plc.wtf` | base URL(s) of the PLC directory (comma-separated for multiple). | 33 | `FULL_NETWORK` | `false` | if `true`, discovers and indexes all repositories in the network. |
··· 22 23 ## configuration 24 25 + `hydrant` is configured via environment variables. all variables are prefixed with `HYDRANT_` (except `RUST_LOG`). 26 27 | variable | default | description | 28 | :--- | :--- | :--- | 29 | `DATABASE_PATH` | `./hydrant.db` | path to the database folder. | 30 + | `RUST_LOG` | `info` | log filter directives (e.g., `debug`, `hydrant=trace`). standard [`tracing` env-filter syntax](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html). | 31 | `RELAY_HOST` | `wss://relay.fire.hose.cam` | websocket URL of the upstream firehose relay. | 32 | `PLC_URL` | `https://plc.wtf` | base URL(s) of the PLC directory (comma-separated for multiple). | 33 | `FULL_NETWORK` | `false` | if `true`, discovers and indexes all repositories in the network. |
+4 -6
src/backfill/mod.rs
··· 749 // signal mode: no signal-matching records found — clean up the optimistically-added repo 750 let did_key = keys::repo_key(did); 751 let backfill_pending_key = keys::pending_key(previous_state.index_id); 752 - let repos_ks = app_state.db.repos.clone(); 753 - let pending_ks = app_state.db.pending.clone(); 754 - let db_inner = app_state.db.inner.clone(); 755 tokio::task::spawn_blocking(move || { 756 - let mut batch = db_inner.batch(); 757 - batch.remove(&repos_ks, &did_key); 758 - batch.remove(&pending_ks, backfill_pending_key); 759 batch.commit().into_diagnostic() 760 }) 761 .await
··· 749 // signal mode: no signal-matching records found — clean up the optimistically-added repo 750 let did_key = keys::repo_key(did); 751 let backfill_pending_key = keys::pending_key(previous_state.index_id); 752 + let app_state = app_state.clone(); 753 tokio::task::spawn_blocking(move || { 754 + let mut batch = app_state.db.inner.batch(); 755 + batch.remove(&app_state.db.repos, &did_key); 756 + batch.remove(&app_state.db.pending, backfill_pending_key); 757 batch.commit().into_diagnostic() 758 }) 759 .await
-6
src/config.rs
··· 1 use miette::Result; 2 - use smol_str::SmolStr; 3 use std::fmt; 4 use std::path::PathBuf; 5 use std::str::FromStr; ··· 44 pub ephemeral: bool, 45 pub cursor_save_interval: Duration, 46 pub repo_fetch_timeout: Duration, 47 - pub log_level: SmolStr, 48 pub api_port: u16, 49 pub cache_size: u64, 50 pub backfill_concurrency_limit: usize, ··· 92 }; 93 } 94 95 - let log_level = cfg!("LOG_LEVEL", "info"); 96 - 97 let relay_host = cfg!( 98 "RELAY_HOST", 99 Url::parse("wss://relay.fire.hose.cam").unwrap() ··· 190 full_network, 191 cursor_save_interval, 192 repo_fetch_timeout, 193 - log_level, 194 api_port, 195 cache_size, 196 backfill_concurrency_limit, ··· 230 const LABEL_WIDTH: usize = 27; 231 232 writeln!(f, "hydrant configuration:")?; 233 - config_line!(f, "log level", self.log_level)?; 234 config_line!(f, "relay host", self.relay_host)?; 235 config_line!(f, "plc urls", format_args!("{:?}", self.plc_urls))?; 236 config_line!(f, "full network indexing", self.full_network)?;
··· 1 use miette::Result; 2 use std::fmt; 3 use std::path::PathBuf; 4 use std::str::FromStr; ··· 43 pub ephemeral: bool, 44 pub cursor_save_interval: Duration, 45 pub repo_fetch_timeout: Duration, 46 pub api_port: u16, 47 pub cache_size: u64, 48 pub backfill_concurrency_limit: usize, ··· 90 }; 91 } 92 93 let relay_host = cfg!( 94 "RELAY_HOST", 95 Url::parse("wss://relay.fire.hose.cam").unwrap() ··· 186 full_network, 187 cursor_save_interval, 188 repo_fetch_timeout, 189 api_port, 190 cache_size, 191 backfill_concurrency_limit, ··· 225 const LABEL_WIDTH: usize = 27; 226 227 writeln!(f, "hydrant configuration:")?; 228 config_line!(f, "relay host", self.relay_host)?; 229 config_line!(f, "plc urls", format_args!("{:?}", self.plc_urls))?; 230 config_line!(f, "full network indexing", self.full_network)?;
+3 -1
src/main.rs
··· 22 23 let cfg = Config::from_env()?; 24 25 - let env_filter = tracing_subscriber::EnvFilter::new(&cfg.log_level); 26 tracing_subscriber::fmt().with_env_filter(env_filter).init(); 27 28 info!("{cfg}");
··· 22 23 let cfg = Config::from_env()?; 24 25 + let env_filter = tracing_subscriber::EnvFilter::builder() 26 + .with_default_directive(tracing::Level::INFO.into()) 27 + .from_env_lossy(); 28 tracing_subscriber::fmt().with_env_filter(env_filter).init(); 29 30 info!("{cfg}");