Adds a monitor type for things that can't be probed from outside, like
cron jobs, backups or devices behind NAT (#95). Instead of being checked
by the worker, the monitored service requests
/api/push/<monitor id>/<pushToken>
periodically, and the monitor goes down when no heartbeat was received
for `pushGraceSeconds` (default 300).
{
id: 'backup',
name: 'Nightly backup',
method: 'PUSH',
target: '',
pushToken: '<random string>',
pushGraceSeconds: 300,
}
How it works:
- `pages/api/push/[id]/[token].ts` is an edge API route of the status
page, so no change to the worker deployment is needed. It stores the
time of the last heartbeat in D1 under the key `push:<monitor id>`.
An unknown monitor and a wrong token both get a 404.
- To limit D1 writes, a heartbeat within 30 seconds of the recorded one
is accepted without writing.
- The worker reads that time on every run and reports the monitor up or
down like any other check, so incidents, notifications, grace period
and callbacks all work unchanged. The error message is kept constant
during an outage to avoid error reason change notifications.
- `passwordProtection` doesn't apply to `/api/push/`, heartbeats are
authenticated by the token.
- PUSH monitors have no response time, their latency chart is hidden.
Co-Authored-By: Claude <noreply@anthropic.com>
* Update token usage in sync workflow
* sync: fallback to PAT_TOKEN secret when override-token is empty
Explain briefly:
UI input field doesn’t evaluate ${{ secrets.* }}, users may paste it and it becomes a literal string.
Add fallback to secrets.PAT_TOKEN to make workflow_dispatch easier and safer.
* More detailed desc
---------
Co-authored-by: lyc8503 <me@lyc8503.net>
Globalping rejects measurementOptions.ipVersion when the measurement target is an IP address.
Add an IP-target guard so ipVersion is only sent for domain targets, preventing validation errors when checking IP:port monitors.
The API for status is showing CORS issue: "Response body is not available to scripts (Reason: CORS Missing Allow Origin)" when using from other domain/localhost. To solve this ,CORS header is added. It also possible to specify allowed domain in Env Var in cloudflare and call them directly.