23 Commits

Author SHA1 Message Date
cottongin
78fec2946c feat: add webhook auth guard and IRC password/username support
Add WEBHOOK_SECRET env var for authenticating incoming Owncast webhooks
via a ?secret= query parameter. Requests with a missing or incorrect
secret are rejected with 401. If unset, all requests are accepted
(with a startup warning).

Also includes previously uncommitted work:
- IRC server password support (IRC_PASSWORD env var, PASS command)
- IRC username/ident field in config
- IRC_PASSWORD and SELinux volume flag in docker-compose.yml

Made-with: Cursor
2026-03-13 00:53:59 -04:00
cottongin
1af9bd1def feat: relay OwnCast /me messages as IRC CTCP ACTION with bold attribution
When an OwnCast user sends "/me claps", the bridge now relays it as a
proper CTCP ACTION so IRC clients render it natively. The username is
bolded with mIRC \x02 for visual attribution.

Made-with: Cursor
2026-03-12 17:14:17 -04:00
cottongin
e2fbd52009 fix: format IRC ACTION messages as * nick action * and strip CTCP delimiters
CTCP ACTION messages (/me) were relayed with raw \x01 bytes, rendering
as boxed-X characters in OwnCast. Detect the ACTION pattern, extract the
body, and format it like traditional IRC clients. Also strip \x01 in
irc_format as a safety net for other CTCP leakage.

Made-with: Cursor
2026-03-12 16:37:46 -04:00
cottongin
b0236ee52b chore: include MIT license 2026-03-12 14:24:12 -04:00
cottongin
dcafdf1b20 chore: include AI disclaimer in README.md 2026-03-12 14:21:44 -04:00
cottongin
65471fb9fc feat: strip IRC formatting codes from messages sent to Owncast
Add irc_format module that removes mIRC control codes (bold, color,
italic, underline, reverse, strikethrough, monospace, reset) before
forwarding to Owncast. Color codes with fg/bg digit params are
consumed correctly. Multi-byte UTF-8 (emoji, accented chars, CJK)
is preserved.

Made-with: Cursor
2026-03-12 14:07:01 -04:00
cottongin
196997f728 fix: HTML-escape IRC username in Owncast chat, fix WebSocket auth, fix echo suppression
- Escape angle brackets around IRC username so Owncast doesn't swallow
  them as HTML tags (&lt;nick&gt; instead of <nick>)
- Register a chat user via POST /api/chat/register to obtain an
  accessToken, then pass it as a query param when connecting to /ws
  (Owncast closes the WebSocket immediately without one)
- Cache the access token across reconnections; re-register only on
  rejection
- Add ws_display_name config option (default "IRC Bridge")
- Fix echo suppression: record_sent and is_echo now both compare
  raw body instead of mismatched formatted/raw values

Made-with: Cursor
2026-03-12 14:06:41 -04:00
cottongin
c24cef9d6d docs: add README with setup instructions and docker-compose.yml
Made-with: Cursor
2026-03-10 22:36:07 -04:00
cottongin
ec93de9780 fix: add missing Clone derive and clean up unused imports
Made-with: Cursor
2026-03-10 22:02:58 -04:00
cottongin
1e2b6d427f feat: add multi-stage Dockerfile
Made-with: Cursor
2026-03-10 22:01:52 -04:00
cottongin
f82cbfea79 feat: add bridge-ctl CLI for runtime control
Made-with: Cursor
2026-03-10 22:01:27 -04:00
cottongin
f4717832f0 feat: wire all tasks together in main with signal handling
Made-with: Cursor
2026-03-10 22:00:54 -04:00
cottongin
a7b80264d0 feat: add router with dedup, echo suppression, and state handling
Made-with: Cursor
2026-03-10 21:59:54 -04:00
cottongin
cc806c55e7 feat: add Unix socket control interface with command parsing
Made-with: Cursor
2026-03-10 21:58:38 -04:00
cottongin
a2314ba50f feat: add WebSocket task for Owncast chat with reconnect
Made-with: Cursor
2026-03-10 21:57:35 -04:00
cottongin
6a9bbf0d82 feat: add IRC task with auto-reconnect and backoff
Made-with: Cursor
2026-03-10 21:56:48 -04:00
cottongin
c41eba1040 feat: add webhook server with payload parsing and chat/stream event handling
Made-with: Cursor
2026-03-10 21:56:12 -04:00
cottongin
09fbf76873 feat: add Owncast health poller with state change detection
Made-with: Cursor
2026-03-10 21:55:13 -04:00
cottongin
3876e12ec9 feat: add Owncast API client for sending messages and checking status
Made-with: Cursor
2026-03-10 21:54:25 -04:00
cottongin
788634fb83 feat: add HTML stripping utility for Owncast emoji and markup
Made-with: Cursor
2026-03-10 21:53:26 -04:00
cottongin
f2e3c88b60 feat: add events module with BridgeEvent, ControlCommand, OwncastState types
Made-with: Cursor
2026-03-10 21:52:17 -04:00
cottongin
bc11ead8d8 feat: add config module with TOML parsing and env var support
Made-with: Cursor
2026-03-10 21:51:35 -04:00
cottongin
ba4e2e1df2 feat: scaffold project with dependencies and config
Made-with: Cursor
2026-03-10 21:49:42 -04:00