Skip to content

feat: run Talk calls through Nextcloud Talk HPB; 35.0.3:0 → 35.0.3:1 - #184

Merged
MattDHill merged 3 commits into
masterfrom
feat/talk-hpb
Nov 16, 2026
Merged

MattDHill merged 3 commits into
masterfrom
feat/talk-hpb

Conversation

@MattDHill

@MattDHill MattDHill commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Adds Nextcloud Talk's High-Performance Backend as a third way to run Talk calls, through the new nextcloud-talk-hpb package. Refs #183.

What changes

  • Configure → Talk Calls replaces the Coturn toggle: Direct only, Relay through Coturn, or High-performance backend. A migration maps talkTurn: true to talkCalls: coturn.
  • HPB mode declares nextcloud-talk-hpb as a running dependency (health check signaling), writes startos-talk.conf so Apache proxies /standalone-signaling/ on Nextcloud's own origin to the HPB's bridge-only signaling port, and points Talk at it:
    • signaling at https://<host>/standalone-signaling/, where <host> is the Web UI's first public domain or its .local name. Talk calls that URL itself as well as handing it to browsers, so the host is mapped to the bridge in the container's /etc/hosts and the entry is added without --verify; the call never leaves the server.
    • TURN and TURN over TLS on the HPB relay's public domain, or a TURN entry per private IPv4 when the relay has none.
  • An admin-configured signaling server blocks HPB setup. Talk keeps one secret for all signaling servers, so adding ours would break theirs. The reconcile reads signaling_servers first and, if any entry is not one this package added, leaves Talk unchanged and logs the conflict. URLs it is about to add are journaled first, so an interrupted run can reclaim its own entry without claiming an admin's.
  • The Talk reconcile (talk-turn → talk) now manages signaling alongside STUN and TURN, with the same record-and-delete-exactly-what-we-added approach. A relay-only signature keeps the previous format byte-for-byte. Without that, the first start after updating would reconfigure Talk during post-update maintenance mode, delete Coturn's plain TURN entry, fail to re-add it, and leave it missing until the next restart. That was found while testing the update path.

Why Janus needs no port range: the HPB bundles its own Coturn whose only allowed peer is the container address, and Janus announces only that address, so every participant reaches Janus through the relay — the arrangement Nextcloud AIO's Talk container uses.

Verified on a StartOS box (Nextcloud 35.0.3:1, nextcloud-talk-hpb 2.2.0:0, Talk 25.0.8), with headless Chromium clients forced to relay-only ICE:

  • Calls through a public domain over the StartTunnel gateway: two-person over TURN/UDP, TURN/TCP and TURN/TLS on 443, and three-person over UDP, every pair relay → Janus, media flowing both ways.
  • A call from the .local origin (the signaling server verifies Nextcloud's certificate against the StartOS root CA).
  • LAN-only, with the relay's domain removed.
  • Switching Direct → Coturn → HPB → Direct, and adding/removing the relay's domain: Talk holds exactly the expected STUN, TURN and signaling entries each time; Direct also removes the proxy conf and hosts entry.
  • Signaling ownership: an existing admin server, and an admin entry at our exact URL, each block HPB setup with the server and its secret untouched; a URL journaled as pending by an interrupted run is reclaimed and setup completes; HPB → Direct removes only our entry.
  • Updating 35.0.3:0 from beta with Coturn relaying on: Coturn mode is kept, its entries are intact, and the reconcile makes no occ calls.

Not covered: a participant on a separate network (cellular), aarch64, Talk's mobile apps.

🤖 Generated with Claude Code

The Configure action's Coturn toggle becomes Talk Calls: Direct only, Relay
through Coturn, or High-performance backend. In HPB mode the package depends on
nextcloud-talk-hpb, proxies /standalone-signaling/ on Nextcloud's own origin to
its bridge-only signaling port, and points Talk's signaling, TURN and STUN
settings at it. The signaling URL uses the Web UI's first public domain, or its
.local name, mapped to the bridge in the container so Talk's own calls to it
stay on the server. Without a public domain on the HPB's relay, Talk gets a TURN
entry per private IPv4.

The Talk reconcile now also manages the signaling server. A relay-only
signature keeps the previous format byte-for-byte, so an update with Coturn
relaying matches what is applied and makes no occ calls; reconfiguring during
post-update maintenance mode would otherwise delete the TURN entry and fail to
re-add it. A migration maps talkTurn: true to talkCalls: coturn.

Verified on a StartOS box with nextcloud-talk-hpb: relay-only Talk calls over
TURN/UDP, TCP and TLS through a public domain, from the .local origin, and
LAN-only; switching between all three modes leaves exactly the expected Talk
entries; updating 35.0.3:0 with Coturn on keeps Coturn mode and its entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for one correctness issue in reconcileTalk (startos/main.ts).

[P2] Preserve admin-owned signaling settings before enabling HPB. Talk's talk:signaling:add appends the URL but replaces the one secret shared by all signaling servers. If an admin already configured an external server with a different secret, selecting HPB leaves that server in the list with the wrong secret; the backend notifier still contacts the first server. Calls through the existing server break, and switching back to Direct does not restore its secret. Deleting the desired URL before checking ownership can also remove an admin's matching entry. This violates the README/instructions guarantee that manually entered settings survive.

The proposal checks existing signaling entries before any Talk mutations and leaves configuration unchanged with an actionable log when an unowned server exists. It journals pending signaling URLs so interrupted writes remain distinguishable from admin-owned entries, and updates the production contract and both guides.

Proposed changes: b026fc1...proposal/184

The reviewed head merges cleanly with origin/master. Static review only; no builds or tests run. Please verify preservation of an existing server and secret (including a matching URL), normal HPB setup, interrupted setup/retry, and HPB → Direct cleanup when adopting the proposal.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MattDHill

Copy link
Copy Markdown
Member Author

Adopted proposal/184 as-is, plus a formatting fix (c47f456). Verified on a StartOS box: normal HPB setup and HPB → Direct cleanup; an existing admin signaling server blocks setup and keeps its URL and secret; an admin entry at our exact URL is not claimed or deleted; a URL journaled as pending is reclaimed and setup completes; a relay-only call still connects with media both ways.

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed c47f456 against the previous head and proposal/184. The signaling-state finding is resolved: unowned servers block HPB setup before Talk mutations, pending URLs preserve ownership across interruptions, and the contract and user guides match. The only departure from the proposal is formatting. The reported runtime checks cover the requested preservation, retry, cleanup, and call cases.

No further correctness findings. Merge-tree is clean against origin/master. Static review only; no local builds or tests run. The x86 and arm CI builds are still pending.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@MattDHill
MattDHill merged commit 87aa2e2 into master Nov 16, 2026
4 checks passed
@MattDHill
MattDHill deleted the feat/talk-hpb branch November 16, 2026 05:45
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.

2 participants