grpc: directory replication API for websites to mirror accounts/channels

Snapshot (full read) + Subscribe (live stream) over the same committed-entry
channel gossip uses. Identity and metadata only — password hashes, SCRAM
verifiers, cert fingerprints, and the finer channel-ops-list events never
cross this API. Bearer-token authenticated, optional server TLS. Verified
end-to-end against a live test-net registration, not just unit tests.
This commit is contained in:
Jean Chevronnet 2026-07-12 23:10:21 +00:00
parent bdcce01f11
commit e5a0d2acdf
No known key found for this signature in database
11 changed files with 1188 additions and 8 deletions

View file

@ -3,6 +3,7 @@ mod config;
mod email;
mod engine;
mod gossip;
mod grpc;
mod link;
#[path = "../modules/protocol/mod.rs"]
mod proto;
@ -70,7 +71,14 @@ async fn main() -> Result<()> {
if let Some(gossip) = cfg.gossip.clone() {
tracing::info!(peers = cfg.peer.len(), "starting gossip");
tokio::spawn(gossip::run(engine.clone(), gossip, cfg.peer.clone(), cfg.server.sid.clone(), gossip_tx));
tokio::spawn(gossip::run(engine.clone(), gossip, cfg.peer.clone(), cfg.server.sid.clone(), gossip_tx.clone()));
}
// Directory replication for websites (Django, etc.) — subscribes to the same
// committed-entry stream gossip does, so a website sees the account/channel
// directory update in real time without touching IRC at all.
if let Some(grpc_cfg) = cfg.grpc.clone() {
tokio::spawn(grpc::run(engine.clone(), grpc_cfg, gossip_tx));
}
// Periodically fold log churn into a snapshot when it grows past the accounts.