Files
joelhooks__joelclaw/infra/central/native/install-central-kickstart-sudoers.sh
shitratgit[bot] b759b904f5 session-index-health: probe Typesense data path, auto-recover wedge
Typesense /health stayed 200 for two days (2026-08-07 onward) while the
search threadpool was dead: raft apply stuck at 181302, 16/16 threads
blocked, 8700+ tasks queued. Every joelclaw session search hung to its
5-minute client timeout, which is what made pi sessions hang mid-turn.

The health daemon never probed Typesense. Unauthenticated requests 401
before the threadpool, so the new probe hits /collections with the api-key
read from typesense.ini at runtime. typesense_unavailable recovery is
scoped to kickstart Typesense only, behind the existing 3-failure
threshold and 900s cooldown.

Also adds an opt-in sudoers.d file so joel-owned agents can kickstart
central services without a human password (exact commands, visudo-checked
installer; postgres/redis deliberately excluded).
2026-08-09 09:31:15 -07:00

24 lines
640 B
Bash
Executable File

#!/bin/sh
set -eu
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
SOURCE="${SCRIPT_DIR}/sudoers-joelclaw-central"
TARGET="/etc/sudoers.d/joelclaw-central"
if [ "$(id -u)" -ne 0 ]; then
printf 'Run once with sudo: sudo %s\n' "$0" >&2
exit 2
fi
# visudo -c on the candidate before it can brick sudo.
install -o root -g wheel -m 0440 "${SOURCE}" "${TARGET}.tmp"
if ! visudo -c -f "${TARGET}.tmp"; then
rm -f "${TARGET}.tmp"
printf 'sudoers candidate failed visudo check; nothing installed\n' >&2
exit 1
fi
mv "${TARGET}.tmp" "${TARGET}"
printf 'Installed %s\n' "${TARGET}"
sudo -l -U joel | grep -A 10 NOPASSWD || true