Something went wrong. Try again.
Identities for entities did.bot
agent llm did
Something went wrong. Try again.
2.8 kB · 58 lines
Rust
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859//! Which services exist on this machine, and which one a directory talks to.//!//! A development machine used to run one of everything on fixed ports, and//! that is still the default: with no configuration at all, every reader here//! answers exactly as the five `scripts/dev-*.sh` do. This crate exists for//! the moment that stops being enough — two personal data servers to test an//! account moving between them, or two record hosts over one server so a//! rebuild of one does not interrupt the other.//!//! # The three tables//!//! A [`Service`] is one process: what kind it is, where it listens, and what//! it points at. A [`Profile`] names one service for each role. A binding maps//! a directory to a profile. Nothing here starts, stops or contacts anything —//! it only says what is supposed to exist, so that a hook, a script and a//! doctor command answer the same question the same way.//!//! # Why a profile rather than a stack//!//! Because the interesting compositions are not whole stacks. Two record//! hosts sharing one personal data server is the case a "stack" cannot//! express, and it is the one that comes up first: a profile names services//! per role, so sharing is what happens when two profiles name the same one.//!//! # Why the directory is the key//!//! It is the only identifier every consumer already has. A hook payload//! carries the working directory, a shell script has one, and the harness//! keys its own per-project configuration on the same absolute path. Anything//! else would have to be threaded through three processes that do not//! otherwise talk to each other.
#![forbid(unsafe_code)]
mod config;mod defaults;mod validate;
pub use config::{Binding, Config, ConfigError, Profile, Service, ServiceKind};
/// The filter every component runs under when nothing is turned up.////// Duplicated from `didbot_serve::DEFAULT_LOG_FILTER` rather than/// imported, because this crate is read by the hook — a process that makes two/// HTTP calls and exits — and depending on the server crate to learn a string/// would pull axum into it. The two are checked against each other in the/// facade crate's tests.pub const QUIET_LOG_FILTER: &str = "info,hyper=warn,hyper_util=warn,h2=warn,mio=warn";
/// The filter every component runs under when debugging is on.////// This project's crates turned up and the HTTP stack left down: `hyper` and/// `h2` narrate every frame at DEBUG, and turning those on buries whatever/// somebody switched this on to look at.pub const DEBUG_LOG_FILTER: &str = "debug,hyper=warn,hyper_util=warn,h2=warn,mio=warn,rustls=warn,tower=info";pub use defaults::{default_config_path, default_data_dir, DEFAULT_PROFILE};pub use validate::{Problem, Problems};