voice-bridge: Discord voice ↔ Lotus voice room (patched nether-voicebridge) [awaiting go] #51

Merged
jared merged 1 commits from voice-bridge-prod into main 2026-10-29 12:56:05 -04:00
Owner

Don't merge until approved. Merging auto-deploys the guard change. That change is harmless on its own; the bridge itself is only installed by hand.

Pairs Discord #matrix-bridge (voice) with the Lotus Discord Voice Bridge voice room (!yS_ZIHL3sOKQJBt4NiIQyiHKt3cv6HrIDeq7OxDpSM0). People on Discord appear inside the Matrix call under their names, and people in Lotus appear on Discord as [Matrix] name.

Build: upstream nether-voicebridge cf52945 plus 11 Lotus patches. The patches, bug log and upstream issue drafts are in /root/code/voice-bridge-trial/. The two most important patches:

  • livekit_alias: without it the bridge sees nobody using current Element Call or Lotus Call.
  • Ghost Olm OTK collision: without it, encrypted voice breaks after any restart on Synapse.

Verification:

  • Upstream e2e suite: 28/28 runnable scenarios pass, 0 retries, on several consecutive runs.
  • Real Lotus Call in a browser:
    • Discord → Lotus (decoded audio, named tile with a speaking indicator);
    • Lotus → Discord (puppet named [Matrix] alice, audio recorded);
    • encrypted room both ways (same signal, spectral similarity 0.97);
    • mute mirroring;
    • voice limits.

Contents:

  • voice-bridge/config.toml.template and registration.yaml.template. Secrets (AS/HS tokens, Discord bot tokens) are rendered on the server only.
  • voice-bridge/install.sh. It's idempotent: the first install registers the appservice, restarts Synapse once and creates @lotus-voice_bot. Upgrades just swap the binary.
  • systemd/lotus-voice-bridge.service: runs as a dedicated lotus-voice user, hardened, MemoryMax 1G.
  • voice-limit-guard: new VOICE_LIMIT_EXEMPT_USERS, so the bridge's bot doesn't take a slot while Discord speakers still count. 5 new tests (61 pass), also verified live on the dev stack: limit 2 now fits alice plus a Discord speaker, and limit 1 still refuses the speaker.
  • README section.

After install: invite @lotus-voice_bot:matrix.lotusguild.org to the voice room.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

**Don't merge until approved.** Merging auto-deploys the guard change. That change is harmless on its own; the bridge itself is only installed by hand. Pairs Discord **#matrix-bridge** (voice) with the Lotus **Discord Voice Bridge** voice room (`!yS_ZIHL3sOKQJBt4NiIQyiHKt3cv6HrIDeq7OxDpSM0`). People on Discord appear inside the Matrix call under their names, and people in Lotus appear on Discord as `[Matrix] name`. **Build:** upstream nether-voicebridge `cf52945` plus 11 Lotus patches. The patches, bug log and upstream issue drafts are in `/root/code/voice-bridge-trial/`. The two most important patches: - **livekit_alias:** without it the bridge sees nobody using current Element Call or Lotus Call. - **Ghost Olm OTK collision:** without it, encrypted voice breaks after any restart on Synapse. **Verification:** - Upstream e2e suite: 28/28 runnable scenarios pass, 0 retries, on several consecutive runs. - Real Lotus Call in a browser: - Discord → Lotus (decoded audio, named tile with a speaking indicator); - Lotus → Discord (puppet named `[Matrix] alice`, audio recorded); - encrypted room both ways (same signal, spectral similarity 0.97); - mute mirroring; - voice limits. **Contents:** - `voice-bridge/config.toml.template` and `registration.yaml.template`. Secrets (AS/HS tokens, Discord bot tokens) are rendered on the server only. - `voice-bridge/install.sh`. It's idempotent: the first install registers the appservice, restarts Synapse once and creates `@lotus-voice_bot`. Upgrades just swap the binary. - `systemd/lotus-voice-bridge.service`: runs as a dedicated `lotus-voice` user, hardened, MemoryMax 1G. - `voice-limit-guard`: new `VOICE_LIMIT_EXEMPT_USERS`, so the bridge's bot doesn't take a slot while Discord speakers still count. 5 new tests (61 pass), also verified live on the dev stack: limit 2 now fits alice plus a Discord speaker, and limit 1 still refuses the speaker. - README section. **After install:** invite `@lotus-voice_bot:matrix.lotusguild.org` to the voice room. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-29 12:52:10 -04:00
voice-bridge: Discord voice <-> Lotus voice room (patched nether-voicebridge)
Lint / Shell (shellcheck) (push) Successful in 2m0s
Lint / JS (eslint) (push) Successful in 2m1s
Lint / No secrets in webhook configs (push) Successful in 18s
Lint / Landing page is rendered (matrix (push) Successful in 18s
Lint / Python (ruff) (push) Successful in 25s
Lint / Secret scan (gitleaks) (push) Successful in 14s
Lint / Shell (shellcheck) (pull_request) Successful in 9s
Lint / JS (eslint) (pull_request) Successful in 9s
Lint / No secrets in webhook configs (pull_request) Successful in 7s
Lint / Python deps (pip-audit) (push) Successful in 1m7s
Lint / Landing page is rendered (matrix (pull_request) Successful in 4s
Lint / Python (ruff) (pull_request) Successful in 6s
Lint / Secret scan (gitleaks) (pull_request) Successful in 6s
Lint / Python deps (pip-audit) (pull_request) Successful in 30s
46d0e98424
Production setup for the Discord voice bridge on LXC 151: config and
appservice-registration templates (secrets rendered on the server), an
idempotent install script (one Synapse restart on first install, creates
the bot account so it can be invited), and a hardened systemd unit.

voice-limit-guard: VOICE_LIMIT_EXEMPT_USERS lets the bridge's own bot
listen in a call without taking a slot; relayed Discord speakers still
count. Unit tests added (61 pass); verified live on the dev stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared scheduled this pull request to auto merge when all checks succeed 2026-10-29 12:53:52 -04:00
jared merged commit b2cab883d6 into main 2026-10-29 12:56:05 -04:00
jared deleted branch voice-bridge-prod 2026-10-29 12:56:05 -04:00
Sign in to join this conversation.