Skip to content

Feat/voice channels#6

Merged
ValwareIRC merged 2 commits into
unreal60_devfrom
feat/voice-channels
May 3, 2026
Merged

Feat/voice channels#6
ValwareIRC merged 2 commits into
unreal60_devfrom
feat/voice-channels

Conversation

@ValwareIRC
Copy link
Copy Markdown

@ValwareIRC ValwareIRC commented May 3, 2026

Summary by CodeRabbit

New Features

  • Added voice channel functionality enabling WebRTC-based voice and video communication on designated channels.

Chores

  • Updated environment configuration to clearly mark sensitive credential variables.
  • Enhanced Docker Compose infrastructure with TURN server support and voice bridge services.

ValwareIRC added 2 commits May 3, 2026 08:24
Adds ObsidianIRC voice channels (Discord-style audio rooms with
optional video / screen-share).  All media negotiation lives in the
hosted-backend's WebRTC SFU; this module is the IRC <-> SFU bridge.

Core patches:
  * src/channel.c valid_channelname() and src/api-isupport.c
    CHANTYPES default now accept `^` alongside `#`.
  * include/struct.h IsChannelName() macro recognises both prefixes.
  * Voice channels otherwise behave exactly like normal IRC
    channels: JOIN/PART/NAMES/MODE all work; +P keeps them
    permanent; empty channels reap normally.

src/modules/voice-channels.c (new):
  * Unix-socket bridge to hosted-backend at
    /tmp/obbyirc-voice.sock by default (override via
    set::voice-bridge-socket in obbyircd.conf or VOICE_BRIDGE_SOCKET
    env var).  Reconnects on every 100ms pump tick when down.
  * NDJSON wire format -- one JSON object per line, both ways.
  * Outbound (IRCd -> backend):
      {op:"signal",from,channel,account,payload:{...}}
      {op:"part",from,channel}
      {op:"quit",from}
    Forwards every TAGMSG to a `^channel` carrying the
    +obsidianirc/rtc tag, then *strips* the tag from the outgoing
    mtag list so the empty TAGMSG is dropped by message.c's
    has_client_mtags guard -- SDP/ICE never leak to other channel
    members.
  * Inbound (backend -> IRCd):
      {op:"signal",to,payload:{...}}
    Re-emits as `:server.name TAGMSG <to> @+obsidianirc/rtc=<json>`
    with full IRC tag-value escaping (";" -> "\:", " " -> "\s",
    "\" -> "\\", CR/LF).  Targets starting with `^` or `#` fan out
    to every local member; other targets are nick lookups.
  * Hooks LOCAL_PART and LOCAL_QUIT to keep the SFU in sync when
    clients drop without explicit leave signaling.
  * Loaded by default via doc/conf/modules.default.conf; uses
    libjansson (already pulled in by other modules).
@ValwareIRC ValwareIRC merged commit 1dceb3f into unreal60_dev May 3, 2026
1 check was pending
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b24497fd-dc07-4161-a7e7-4d9f58044d85

📥 Commits

Reviewing files that changed from the base of the PR and between 3568a80 and 0939a7f.

📒 Files selected for processing (8)
  • .env.example
  • compose.yaml
  • doc/conf/modules.default.conf
  • include/struct.h
  • src/api-isupport.c
  • src/channel.c
  • src/modules/Makefile.in
  • src/modules/voice-channels.c

📝 Walkthrough

Walkthrough

This PR adds voice/video channel support to ObbyIRCd by introducing a new ^ channel prefix alongside existing # channels, implementing a WebRTC SFU bridge module that forwards RTC signaling frames via Unix socket, and configuring Docker services with Traefik routing and environment variables for deployment.

Changes

Voice-Channels Bridge Feature

Layer / File(s) Summary
Protocol Extension
include/struct.h, src/api-isupport.c, src/channel.c
Channel name validation and CHANTYPES ISUPPORT token updated to recognize ^ alongside # as valid channel prefix for voice channels.
Core Bridge Module
src/modules/voice-channels.c
Implements Unix-domain socket communication to hosted-backend WebRTC SFU; intercepts outgoing TAGMSGs on ^ channels with +obsidianirc/rtc tags, forwards JSON-encoded signal frames to bridge, and emits inbound signal frames back to IRC as server-sourced TAGMSGs with IRCv3 tag escaping. Manages client part/quit lifecycle events and includes non-blocking I/O with incremental JSON frame parsing.
Module Build & Loading
src/modules/Makefile.in, doc/conf/modules.default.conf
Build rule added for voice-channels.so linking against -ljansson; module is enabled in default configuration.
Environment & Deployment
.env.example, compose.yaml
Environment variables annotated as secrets (OPER_PASSWORD, RPC_PASSWORD, CLOAK_KEY*, VOICE_TURN_SECRET); Docker services configured with port exposure, volume mounts for voice-bridge socket, TURN UDP publishing, and Traefik labels routing ${IRC_FQDN}, ${API_FQDN}, ${WEB_FQDN} over HTTPS. Build args set default IRC server in obsidian frontend.

Sequence Diagram

sequenceDiagram
    participant Client as IRC Client
    participant ObbyIRCd as ObbyIRCd<br/>(voice-channels)
    participant Bridge as WebRTC Bridge<br/>(Unix Socket)
    participant Backend as Hosted Backend<br/>(SFU/TURN)
    
    Client->>ObbyIRCd: TAGMSG on ^channel<br/>+obsidianirc/rtc={...signal...}
    ObbyIRCd->>ObbyIRCd: Intercept pre-channel hook
    ObbyIRCd->>ObbyIRCd: Extract & parse JSON payload
    ObbyIRCd->>Bridge: Send frame: {op:"signal",...}
    ObbyIRCd->>ObbyIRCd: Remove tag from outgoing msg
    
    Bridge->>Backend: Forward signal
    Backend->>Backend: Process RTC state
    Backend->>Bridge: Return signal frame
    
    Bridge->>ObbyIRCd: Poll & read JSON frame
    ObbyIRCd->>ObbyIRCd: Parse inbound frame
    ObbyIRCd->>Client: TAGMSG ^channel<br/>+obsidianirc/rtc={...signal...}
    
    Note over Client,Backend: Lifecycle: Client parts channel
    Client->>ObbyIRCd: PART ^channel
    ObbyIRCd->>Bridge: Send frame: {op:"part",...}
    Bridge->>Backend: Notify participant exit
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • feat: docker image + compose #2: Overlaps on .env.example and compose.yaml modifications with credential annotations and environment variable definitions for the same deployment infrastructure.

Poem

🐰 A rabbit hops through channels new,
With ^ marks and signals true,
Voice bridges span the Unix way,
While signals dance and frames convey—
WebRTC dreams in IRC's light! 🎙️✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/voice-channels

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant