# Going deaf, and who may add the bot Two gates that exist because of one afternoon. Both are referenced from the README; this is the detail. ## When it cannot hear On 2026-08-29 the bot was up, healthy and deaf for three hours. A host firewall change cut every Docker container off the internet, `signal-cli` lost its connection to Signal and reconnected in a loop, and **every** health signal stayed green: the container's own healthcheck answered 204, `/v1/groups` answered 200 from local state, the bot's WebSocket to the container stayed open, and `/healthz` answered `{"status": "ok"}`. The only symptom was silence, which is also what a quiet evening looks like. Two things now make that impossible to miss: - **`signal_bot/liveness.py`** — after `SILENCE_SECONDS` (120 by default) with no frame of any kind, the bot probes `/v1/devices/`, the one endpoint that needs a live round trip to Signal. Three consecutive failures and `/healthz` answers **503** with the reason, and every failure is a `WARNING` in the journal. Worst case from the last envelope to a red `/healthz` is 120 + 3×30 ≈ 3.5 minutes. - **`scripts/signal_api_watchdog.sh`**, on a two-minute user timer — probes the same endpoint from outside the process, restarts the container after two consecutive failures, and **stops after 3 restarts in 6 hours**, escalating with `notify-send` and a journald `ERROR` instead. A deregistered account or a blocked network is not fixable by restarting, and a forever-restart loop would hide it. `scripts/install_service.sh` installs and arms it beside the bot's own unit. ```bash systemctl --user list-timers signal-api-watchdog.timer journalctl --user -u signal-api-watchdog.service -n 20 curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8137/healthz ``` ## Who may add the bot to a group `TRUSTED_INVITERS` in `.env` is a comma-separated list of `+E.164` numbers, or the member UUIDs `/v1/groups` uses for anybody the account has never messaged. Empty means anyone who knows the number can pull the bot into a group and be answered there, and the bot says so in a `WARNING` at startup. With it set, adding the bot is still the whole setup for you: a group is adopted when a group-update envelope says a trusted identity added the bot, or when a trusted identity is a full member of it in the listing. Anything else is refused once, loudly, with that group's member list in the log so you can see which string to add.