mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-02 18:19:07 +01:00
Adds inbound push and heartbeat availability checks (`protocol: "push"`)
for cron jobs, backups, and scheduled tasks, strictly gated behind
`availabilityPushChecks` at `stage: "build"` in
`frontend-modern/src/utils/featureReleases.json`.
### Summary
- **Feature release gate**: Registered `availabilityPushChecks` at
`stage: "build"` with no shipped guide links. Verified on a production
build that no push preset, protocol option, or wording is exposed.
- **Config and cron schedule**: Added `AvailabilityProbePush` (`push`),
interval and 5-field UTC cron schedules plus grace windows, 256-bit
base64url token generation, and encrypted persistence in
`availability_targets.enc`.
- **Monitoring and alerting**: Added local 15-second deadline
evaluation, `/start` duration measurement, explicit `/fail` handling,
push validity windows for `availability_history` and evidence envelopes,
and unified `availability_unreachable` incidents.
- **Inbound API and security**: Added token-authenticated
`GET`/`POST`/`HEAD /api/push/{token}` (supporting `/start`, `/fail`,
`?status=up|down`, `?msg=`, `?ping=`) with constant-time token
comparison, per-target and per-IP rate limiting, a 1 KiB POST body cap,
and admin-only `POST /api/availability-targets/{id}/rotate-push-token`.
- **Frontend**: Added feature-gated push preset, schedule editor,
post-create Ping URL and `curl` snippet display with copy actions,
two-step token rotation, and mobile-safe wrapping.
### Verification
- Go tests: `internal/config`, `internal/availabilityprobe`,
`internal/monitoring`, and `internal/api` (including router public-path,
auth-bypass, and route inventory tests)
- Frontend tests: `tsc --noEmit`, `AvailabilityTargetSlot.test.tsx`
(24/24), `npm run lint:feature-releases`, and production `npm run build`
- Browser verification: Verified production build hides push checks
(`1280x800`), development build creates a cron push check, ingests live
unauthenticated `curl` pings (`/start`, success, 413 oversized body, 404
unknown/revoked token, `/fail`, recovery), rotates tokens, and renders
cleanly at `1280x800` and `390x844`
(`frontend-modern/browser-verification/bf6c955c53a21415.json`).