#!/bin/sh # Triggers deletion of AI chat history older than the retention window on the # `web` service. Run on a schedule by busybox crond (see cron/crontab). Fails # loudly (non-zero exit, stderr) but crond just tries again tomorrow — no # retry loop here on purpose, keep this script trivial. set -eu : "${WEB_INTERNAL_URL:=http://web:3000}" if [ -z "${CRON_SECRET:-}" ]; then echo "run-chat-cleanup: CRON_SECRET is not set, refusing to call the endpoint" >&2 exit 1 fi curl -fsS -X POST \ -H "Authorization: Bearer ${CRON_SECRET}" \ "${WEB_INTERNAL_URL}/api/internal/cron/chat-cleanup"