Retire the shared coturn service — every WebRTC/SIP service now runs its own
Shared coturn (services/coturn.sh, ensure_coturn_user in lib/common.sh) is no longer an installable or usable option anywhere in this repo. It's moved to attic/coturn.sh (with tools/coturn-test-check.sh alongside it), which is outside setup.sh's services/*.sh glob, so it never registers, never appears in the menu, and `sudo ./setup.sh coturn` now fails with "unknown service". Asterisk and Mattermost each already had an opt-out to run their own dedicated coturn instead of the shared one; that opt-out is now the only behavior — the shared-coturn preference, the opt-out prompt, and every ensure_coturn_user() call site are gone. find_free_coturn_range() (lib/common.sh) is what makes unconditional dedicated coturn safe: it scans every coturn-owning service's own .env on the box for already-claimed relay ranges and picks one that can't collide, so Asterisk + any number of Mattermost instances can each run their own coturn on one box without the relay-port collisions this repo's coturn history warns about. Existing installs still pointed at a shared coturn container are left running as-is on `update` (no silent migration attempt against a service that no longer exists to heal against) — a full/fresh reinstall is the migration path, which generates a new dedicated coturn with fresh credentials and says so. Also updates CLAUDE.md's coturn guidance for future service authors, attic/README.md with the retirement rationale, and stale services/coturn.sh path references in services/asterisk.sh, tools/pstn-test-check.sh, README.md, and docs/vps-sizing-recommendations.md. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Crt4ymNEHEbWqscB1qvZgC
This commit is contained in:
@@ -34,3 +34,33 @@ rather than `fresh` at the reinstall prompt, and having a snapshot.
|
||||
Two copies of the same logic is the exact problem the merge existed to fix,
|
||||
and this one will drift the moment `services/asterisk.sh` gets a fix that
|
||||
isn't backported here — which it deliberately won't be.
|
||||
|
||||
## `coturn.sh` / `coturn-test-check.sh`
|
||||
|
||||
The shared-coturn service (`services/coturn.sh`, moved here unchanged from
|
||||
`services/`) and its standalone health-check tool (`tools/coturn-test-check.sh`,
|
||||
moved from `tools/`). This model — every WebRTC/SIP-capable service
|
||||
(`asterisk`, `mattermost`) sharing one coturn instance via `ensure_coturn_user`
|
||||
— is no longer offered anywhere in this repo. Every service now runs its own
|
||||
dedicated coturn instead, with `lib/common.sh`'s `find_free_coturn_range()`
|
||||
avoiding the relay-port collisions a shared instance used to prevent by
|
||||
scanning every coturn-owning service's own `.env` on the box. See
|
||||
`CLAUDE.md`'s "coturn (TURN/STUN) relay" section for the current pattern.
|
||||
|
||||
Sharing one instance only ever saved ~40MB RAM per additional consumer
|
||||
beyond the first — real, but small — against being a single point of
|
||||
failure every consumer depended on. Parked here, not deleted, since the
|
||||
code is still correct and someone could resurrect it if a future need for
|
||||
it shows up. Both files still run standalone if invoked directly:
|
||||
|
||||
```bash
|
||||
sudo bash attic/coturn.sh
|
||||
sudo bash attic/coturn-test-check.sh
|
||||
```
|
||||
|
||||
Nothing in this repo calls `ensure_coturn_user()` anymore (the function
|
||||
itself was removed from `lib/common.sh`), so resurrecting this only makes
|
||||
sense if you're deliberately reintroducing the shared-coturn pattern
|
||||
yourself — a new consumer service would need its own call to whatever
|
||||
takes `ensure_coturn_user`'s place, since that helper no longer exists to
|
||||
call.
|
||||
|
||||
Reference in New Issue
Block a user