From d55a7cc81a53692abcb4aaa2d6d36be5559e1d46 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 12 Aug 2026 11:44:02 +0000 Subject: [PATCH] Reach the coturn self-heal check from asterisk.sh's update path too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Direct follow-up to the previous commit's ensure_coturn_user() fix: that fix is useless for Asterisk specifically unless something actually calls ensure_coturn_user("asterisk") again, and the update ("Reinstall in place") branch returns 0 well before the fresh-install path's call to it — only "Full install" reached it, which re-prompts everything (droplet detection, domain, etc.) just to fix a credential re-registration. Added the same call to the update path, gated on NOT having an embedded coturn (checked via the existing _HAD_EMBEDDED_COTURN detection) — calling it unconditionally would silently chain-install the shared coturn service for a box deliberately running Asterisk's own dedicated coturn, exactly the kind of silent update-time migration CLAUDE.md's coturn guidance warns against. .env stays untouched either way (self-heal re-registers with the same cached password, never generates a new one). Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01H4k6J1qXXyYxhGEgnJaMvn --- services/asterisk.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/services/asterisk.sh b/services/asterisk.sh index bc71888..865da5a 100644 --- a/services/asterisk.sh +++ b/services/asterisk.sh @@ -1655,6 +1655,21 @@ install_asterisk() { log_warning "docker compose up failed — check: docker compose -f $EA_DIR/docker-compose.yml logs" fi + # Self-heal a stale/orphaned shared-coturn registration on + # every update, not just a full reinstall — the check inside + # ensure_coturn_user() is what actually re-registers a + # missing user, this just needs to reach it. Gated on NOT + # having an embedded coturn: an install with its own + # dedicated coturn deliberately never touches the shared one + # on update (see the warning above and CLAUDE.md's coturn + # migration guidance) — calling this unconditionally would + # silently chain-install services/coturn.sh for a box that + # was never using it, the exact "don't migrate silently on + # update" mistake that guidance warns against. + if [[ "$_HAD_EMBEDDED_COTURN" != true ]]; then + ensure_coturn_user "asterisk" + fi + _asterisk_run_presence_step "$EA_DIR" "$CONTAINER" _asterisk_offer_dashboard_and_trunk "$EA_DIR"