- scripts/ops-report.sh builds a simple daily report (app, website, deps, security, weekly scan); --send DMs it to the two admins from src/lib/admins.ts via NIP-17 (scripts/send-ops-report.ts), sender = app identity. - Delivery discovers kind-10050 inboxes + NIP-65 write relays and always includes the community relay; OPS_DRY_RUN=1 previews without publishing. - scripts/send-ops-alert.sh sends short alerts; wired into auto-deploy (preflight/smoke), update-deps (full+fallback failure) and ops-health --notify. - skatespots-ops-report.timer daily 07:00 + installer. - Signer moved into the 0600 zsp.env; old history copies removed.
24 lines
734 B
Bash
Executable file
24 lines
734 B
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# Send a short plain-English alert to the SkateSpots admins as a NIP-17 DM.
|
|
# Usage: scripts/send-ops-alert.sh "message"
|
|
set -euo pipefail
|
|
|
|
REPO="/home/sovereignsk8/SkateSpots"
|
|
cd "$REPO"
|
|
if [ -d "$HOME/.nvm/versions/node" ]; then
|
|
NODE_BIN="$(ls -d "$HOME"/.nvm/versions/node/*/bin 2>/dev/null | sort -V | tail -1)"
|
|
[ -n "$NODE_BIN" ] && export PATH="$NODE_BIN:$PATH"
|
|
fi
|
|
export PATH="$HOME/go/bin:$PATH"
|
|
|
|
MSG="${*:-SkateSpots needs attention.}"
|
|
{
|
|
echo "SkateSpots alert"
|
|
echo
|
|
echo "$MSG"
|
|
echo
|
|
echo "$(LC_ALL=C date '+%A %-d %B %Y, %H:%M')"
|
|
echo
|
|
echo "This message was sent automatically to the SkateSpots admins."
|
|
} | timeout 90 "$REPO/node_modules/.bin/tsx" "$REPO/scripts/send-ops-report.ts"
|