2.6 KiB
2.6 KiB
Owncast–IRC Bridge: Full Implementation
Task Description
Executed the full 15-task implementation plan at docs/plans/2026-03-10-owncast-irc-bridge-impl.md using the executing-plans skill. Built a complete bidirectional Rust chat bridge between Owncast and IRC.
Changes Made (15 commits)
- Project scaffolding —
cargo init, Cargo.toml with all deps,.gitignore,config.example.toml, placeholder binaries - Config module (
src/config.rs) — TOML parsing with serde defaults, env var support for access token, 3 tests - Events module (
src/events.rs) —BridgeEvent,Source,OwncastState,ControlCommand,BridgeStatustypes - HTML stripping (
src/html.rs) — Strips HTML tags, extracts emoji<img>alt text, decodes entities, 6 tests - Owncast API client (
src/owncast_api.rs) —send_chat_messagewith retry,get_statusfor health checks - Health poller (
src/health.rs) — Periodic Owncast status polling with state change detection - Webhook server (
src/webhook.rs) — Axum HTTP server parsing CHAT/STREAM_STARTED/STREAM_STOPPED events, 5 tests - IRC task (
src/irc_task.rs) —irccrate client with exponential backoff reconnect - WebSocket task (
src/websocket.rs) — tokio-tungstenite client with reconnect, 5 tests - Control socket (
src/control.rs) — Unix socket listener with command parsing, 5 tests - Router (
src/router.rs) — Central orchestration with dedup tracker, echo suppressor, state handling, 4 tests - Main entry point (
src/main.rs) — Wires all tasks together with signal handling (SIGINT/SIGTERM/SIGHUP) - bridge-ctl CLI (
src/bin/bridge_ctl.rs) — Clap-based CLI for runtime control via Unix socket - Dockerfile — Multi-stage build (rust:1.85-slim-bookworm builder, debian:bookworm-slim runtime)
- Final fixes — Added missing
Clonederive onIrcConfig, cleaned up unused imports
Verification
- Both binaries (
owncast-irc-bridge,bridge-ctl) compile - All 28 tests pass across all modules
- Only benign warnings remain (unused struct fields for future API data)
Bugs Found in Plan
- Raw string delimiters
r#"..."#conflicted with TOML"#channel"values — fixed withr##"..."## strip_htmlhad peek/consume bug (didn't advance past<and&before collecting) — fixedreqwest::Response::text()consumesself, so status must be captured first — fixed
Follow-up Items
- Integration testing with actual Owncast and IRC instances
- Wire remaining control commands (connect/disconnect/reconnect) through to tasks
- Add
message_buffer_sizebuffering logic - SIGHUP config reload support